Saturday, December 1, 2012

Geometry Shader

Added a geometry shader to the code for calculating face normals. The Geometry Shader is called after the Vertex assembly for each primitive. So it has all the information about a primitive, thus making it easy to calculate normals for a face. But the problem here is that shading will be flat for a single triangle which might not be an issue after I apply tessellation. Will have to wait and see when I implement tessellation. Below are images with diffuse lighting (A single directional light in the -ve y-direction)

Mesh structure

Diffuse Shading with normals

The terrain looks faceted with this change, with allowed to get some diffuse lighting.

Next Steps:
  • Tessellation

No comments:

Post a Comment