![]()
Make sure you clamp your values.
The second code sample looks good except this line which doesn’t make much sense:
float3 result = N + (uv.x * xGrad) + (uv.y * yGrad);
Why would you add scalars to N which is float3?
Should be more something like this:
float3 result = N + float3(xGrad,yGrad,0);
return normalize(result);
I’ve been using the same maths when generating normals from a height map in a UDK material,


I don’t know the answer, but it might help to ask this on the AnswerHub at https://answers.unrealengine.com/ if you haven’t already.
Thank you ![]()
Greets
SharinganShuriken
HLSL Bump Mapping Problem (Solved)
Dear Community,
the Bump Problem is solved 
Don’t be sad now if you don’t figure out the solution, i bet i have in the future Problems that i can’t fix and where can the first one who post the right solution earn good money 
Lovely Greetings
SharinganShuriken