PDA

View Full Version : lighting, anomalies, frustration ;)



hikeeba!
04-21-2000, 10:23 PM
I could write a large post on what I need help with, but I'd rather let you see for yourself.
I've uploaded the relevant info onto my website http://www.opengl.org/discussion_boards/ubb/wink.gif
I'm having problems with lighting and strange renderings.

Please look at my code/program/images! and tell me what i'm doing wrong.
http://www.mindshade.com/hikeeba/dump

Thanks,
John

Lord Chaos
04-22-2000, 10:05 PM
From the a.bmp image it seems as the normals for the edge polygons are wrong.

hikeeba!
04-23-2000, 02:51 AM
I kinda got it to work. I enabled face culling, maybe it was my drivers. :P

Rob
04-23-2000, 10:16 AM
This looks to me like it could be a Z-buffer precision issue (and the fact that enabling face culling fixed it supports this). When you setup your perspective matrix, make sure to use reasonable values for the front and rear clipping planes in order to maximize the precision of the buffer.

Oh, and I assume that you have enabled GL_DEPTH_TEST.

Just a couple thoughts.
--------------
Ooops. I wrote that last part before I realised you had posted the code as well. I see that you have indeed enabled GL_DEPTH_TEST, so that's not it. But the values for front and rear in your perspective matrix do seem a bit wider of a spread than necessary and if your card has a low-precision z-buffer this could be the problem.

Try bringing those values closer to the actual extents of your model space.

By the way, it looks fine when I run it on my machine (3dlabs Oxygen GVX1 card).

[This message has been edited by Rob (edited 04-23-2000).]

[This message has been edited by Rob (edited 04-23-2000).]

hikeeba!
04-23-2000, 02:18 PM
It probably is the z-buffer. Thanks for the help http://www.opengl.org/discussion_boards/ubb/smile.gif So far I love opengl!


--John