How can I get hard edges on my terain. I have a simple ambient and diffuse shader in GLSL. I think that the fragment shader is interpolating the vertex normals and causing smooth shading. Do you guys need my code or is there maybe some setting I can enable?
Current terain without hard edges:
http://twirlbound.com/uploads/terain.png
In your vertex shader, do something like this:
In your fragment shader, something like this:
flattells the GL to give all the fragments rasterized for a triangle the same value. Which vertex’s normal is used depends on the current ‘provoking vertex’, set by callingglProvokingVertex.