# Calculating normals....

This topic is 3614 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I currently have a set of 4 height maps (I can generate the normal maps for these heightmaps if need be). I am scrolling these height maps by a function of time and space. The result of each sample is added together and then the final value is used as an offset for the Y coord's of a radial plane. (I am doing this in the VS using Vertex Texturing and passing in offset values for sampling each channel of a texture) What I need is to come up with a reasonable way to get the normals into the pixel shader, I can get the 4 normal maps for each individual height map, however as I am adding all 4 offsets together I imagine the new normal will have to be calculated based on the surronding geometry(which is not realistic to do every frame on the GPU)? Is there anything I can do with the normal maps to get the normal of my offset value? I suppose if I just use one heightmap I wont have this problem, but the random/natural motion that these multiple heightmaps provide is something I would like to keep. Any suggestions appreciated.

##### Share on other sites

I'm not sure what you mean by "Y coord's of a radial plane", but it may be an option for you to calculate the normals in a pixel shader, which should typically be a lot faster than on the CPU. I did something similar with 4 'height maps' when rendering clouds over in this old topic.

The last reply contains the HLSL shader I used on the combined heightmap to generate the normal map. This combined height map is also generated each frame in a pixel shader by rendering my 4 height maps to a surface with some appropriate offsets, with quite good performance results.

Hope this helps :)

1. 1
2. 2
3. 3
Rutin
13
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633700
• Total Posts
3013418
×