PDA

View Full Version : [SOLVED] Lighting/Depth Testing/Quadrics



khodas
11-27-2009, 01:02 PM
Hi,

I'm fairly new to OpenGL still, but I think there is some error in lighting and/or using depth test to render a few quadric spheres. What happens is the sphere renders fine (it rotates as well), but when applying lighting to it I see striations on the sphere. And, when I enable depth test, it makes my sphere look like a giant disco ball (see pictures). Any ideas what could cause this? I'm not sure how to post code, or I would (tags, or just copy/paste?).

Depth Test + Lighting:
http://s997.photobucket.com/albums/af99/khodas/depthtest.png

Just lighting:
http://i997.photobucket.com/albums/af99/khodas/lighting.png

I'm new to this forum, so forgive me if I'm posting incorrectly. Thanks in advance.

Artemiy
11-27-2009, 02:01 PM
If your near plane depth (the argument before the last one) in glFrustum/gluPerspective is at 0.0, try setting it to, eg, 0.1.

khodas
11-27-2009, 02:30 PM
You are my hero.

That is all.