PDA

View Full Version : Newbie questions on terrain per pixel shading



anopgl
07-18-2011, 01:32 AM
Hi

Terrain rendering is implemented using quadtrees.

1.What is the best way to pass the normal map to a pixel shader in terrain per pixel shading (TBO, texture, other)?
2.Should something with color or texture be done also in vertex shader (besides passing it to the pixel shader)?

Thanks.

BionicBytes
07-18-2011, 01:44 AM
The answer to both of these questions really depends upon what your application needs. There is no one answer for it.


1.What is the best way to pass the normal map to a pixel shader in terrain per pixel shading (TBO, texture, other)?

In my engine I pass in a normal map as a texture.



2.Should something with color or texture be done also in vertex shader (besides passing it to the pixel shader)?
Depends on your needs. Usually I let the vertex code just handle the geometry and the pixel shader handles the material side of things.

anopgl
07-18-2011, 02:08 AM
Thanks a lot! At this stage my needs are very basic - shaded textured terrain with good performance.
I read a lot of theory last few days and I feel a bit shaky how to put all of this togeher, but you reassured my thoughts.