PDA

View Full Version : Lighting problem



Kenrae
05-24-2006, 08:48 AM
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.

jtipton
05-24-2006, 09:12 AM
If you are using quadrics, the normals and shading are specified per quadric. Are you using quadrics?

Kenrae
05-24-2006, 09:17 AM
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.

Kenrae
05-24-2006, 10:05 AM
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.

knackered
05-24-2006, 10:22 AM
Aww, nevermind. At least you apologised.

jide
05-24-2006, 10:45 AM
Are you changing your gemini face knackered ? Really, I appreciate it a lot !

rgpc
05-24-2006, 07:46 PM
Knack only gets stuck into those that deserve it...