HLSL Bump Mapping Problem (50$ as Reward for Solution :))

:slight_smile: :slight_smile: :slight_smile: :slight_smile:

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,

:slight_smile: :slight_smile: :slight_smile: :slight_smile:

:slight_smile: :slight_smile: :slight_smile: :slight_smile:

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 :slight_smile:

Greets
SharinganShuriken

HLSL Bump Mapping Problem (Solved)

Dear Community,

the Bump Problem is solved :slight_smile:

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 :slight_smile:

Lovely Greetings
SharinganShuriken