0

I already have a shader that generates a normal map from a height map. Now I need to apply the effect to all 360 degrees of the rotated heightmap.

Of coarse I could just apply the effect 360 times to each heighmap, but if I have already done it once then is it possible to use what I have to efficiently generate the remaining 359 maps?

Im guessing that each pixel gets offset (in r,g,b) by some constant amount depending on the rotation:

enter image description here

So I need a new shader that I will apply on the rotated normal map (to recalculate the normals). Is it possible?

Deniz Cetinalp
  • 901
  • 1
  • 18
  • 34
  • 2
    This is what tangent-space is for. Compute the normal map in tangent-space and then you can deform the object it's mapped to all you want later on. – Andon M. Coleman Mar 08 '15 at 21:15

1 Answers1

1

It's pretty simple really: just rotate the normals in the map with the rotation of the map after generating them normally. You don't even need to regenerate them strictly speaking; just adjust your shader.

ratchet freak
  • 47,288
  • 5
  • 68
  • 106