Lighting problem

Hello everybody,

I’m doing an OpenGL-based nonphotorealistic render, which has different modes of operation. One of those, the simplest one, is a flat OpenGL rendering with simple lighting (and stencil shadows and transparency, but that doesn’t matter now).

My problem is: it renders as if the LIGHTING weren’t enabled. I’ve tested it with simple objects like spheres and cubes, and it’s always the same. All of the faces of the object are rendered with the basic material color. Given that:

  • The normals are set and correct.
  • GL_LIGHTING is enabled.
  • There is only one light and GL_LIGHT0 is enabled.
  • The light is correctly placed and configured, the other modes work well with the same imput (on the other modes I handle the lighting, not OpenGL).
  • Ambient light is black (no ambient light at all).

I’m completely at a loss. I don’t know what could possibly be happening.

Thanks in advance.

If you are using quadrics, the normals and shading are specified per quadric. Are you using quadrics?

No. Really, it’s quite simple, just triangles. That’s what’s puzzling me, this mode of rendering is very basic. Color and normals per vertex, no textures.

By the way, I’m using Windows OpenGL software implementation, so it can’t be a hardware error neither.

OK, I’ve found the problem.
I was… errr… defining an emission color. Instead of black, it was the diffuse color of the object.
Now I’m quite ashamed of myself, you know. It’s been three days debugging this error.

Aww, nevermind. At least you apologised.

Are you changing your gemini face knackered ? Really, I appreciate it a lot !

Knack only gets stuck into those that deserve it…