Skip to main content
GameDev.net gamedev.net
🔒 Locked

Basic shading problem (FFP)

Started by Muftobration May 20, 2012 at 9:04 PM 1 replies 1.2k views
Original Post
Muftobration
Muftobration
I've been having some shading trouble. The sphere here is just a unit sphere created and triangulated in modo (attached), with normals also computed in modo. The light is in the upper left of the picture a few units away. On average, the shading looks right, but why the huge discrepancy between two triangles from the same quad? I've ruled out incorrectly computed normals and back-facing polygons.

badlighting-1.png
21st Century Moose
21st Century Moose
Looks a lot like you need to set glShadeModel (GL_SMOOTH) here. That should be the default mode, so you may have set it to GL_FLAT somewhere during initialization or you may have a driver bug. See http://www.opengl.org/sdk/docs/man/xhtml/glShadeModel.xml
Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls. 
Muftobration
Muftobration
Thank you, mhagain. I was originally using smooth shading, but I thought things just didn't look quite right, so I switched to flat to see if I could make sense of it. Now that I think about it, I guess this is probably how it's supposed to look.


smooth.png

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.