Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save droganaida/dfcc9bf073d32d5a6dc7b9a4dce75e79 to your computer and use it in GitHub Desktop.
Save droganaida/dfcc9bf073d32d5a6dc7b9a4dce75e79 to your computer and use it in GitHub Desktop.
//HLSL Animated Normal Map for Unreal Engine material (custom node)
float2 uv = iCoord.xy / iResolution.xy; // iCoord - UV, iResolution - Float2(1,1)
float h = 0.6 * iTexture; // iTexture - RGBA (Float4)
float w = 40.0;
float3 n = normalize(float3(ddx(h) * w, ddy(h) * w, 1.0));
return float4(n * 0.5 + 0.5,1.0);
@droganaida
Copy link
Author

Use custom node in material editor.
Inputs:
iCoord = UV
iResolution = Float2(1,1)
iTexture = RGBA (Float4) - your custom animated (or static) HLSL shader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment