Lighting for terrain

Hi,

I have done height based color mapping for a terrain.When I set material property for a terrain the entire terrain is turning to the color.I calculated color in fragment shader through height based mapping.How to set material properties of the surface??By the way Im using blinn-phong model for directional lighting.

Thanks & Regards.
brett

If I understand you correctly you are mixing Fixed Funtion stuff with shaders.

If you are doing lighting in shaders then you’ll also need to do material properties and the like in them too.

material properties

What are material properties for you?

If you use Blinn-Phong lighting model you should know that you need to compute normals of the terrain surface. Then will be able to shade correctly the terrain surface.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.