Advice Needed

Hey -
I am currently working on a simple FPS, and lately have been running into some trouble. Whenever I back far away from my objects, the edges start to go wild - shaking all over the place. I thought it might be the textures, but I tried mipmapping, and there was no change, so I took that code back out. I have enabled:

glEnable(GL_POLYGON_SMOOTH);
glEnable(GL_POINT_SMOOTH);
glEnable(GL_LINE_SMOOTH);

so I thought that would smooth the edges.

Everything I am doing is in floats, so I wonder if rounding errors have something to do with it? Right now I am rather confused.

Since it is hard to describe, it might be easier if you saw it in action.

If anyone could take a look at it and give me some advice, I would really appreciate it. Here is a link to the program: http://www.rpi.edu/~letteh/CrystalJack.zip

Just back far away from one of the castle pillars, and you will see what I mean - they move all over the place. There is a readme file with the key config. Thanks a lot!

-lost hope

Make sure you have depth testing enabled and that you have enough depth buffer precision. Try pushing the near plane out and see if that helps.

Hey -
Thanks for your help! By increasing the near clipping plane value from 0.1 to 5, the problem all but totally went away. I’m not sure how that affects it as it does, but I am certainly pleased with the results =)

As this solved the problem, I didn’t try it, however, if I had wanted to, how would I have gone about changing the precision of the depth buffer? You mentioned that as another alternative, and I just wondered how that worked. Again, thank you very much.

-lost hope

You’d do this with another visual (Pixel format descriptor) which has more depthbuffer bits. You may have to change the desktop from 16 to 32 bits (or the other way) it’s all vendor dependent.

[This message has been edited by dorbie (edited 11-29-2001).]

Also, pushing the near plane out makes you use the precision you’ve got in a more efficient manner. There’s more precision close to the near plane, so if it’s really close, you spend all your precision at stuff that’s just in front of you, and have none left for the things that are far away. Bringing the far plane in also helps, it’s the ratio between them that’s important.

[This message has been edited by harsman (edited 11-30-2001).]

Thanks a lot guys! Your help is much appreciated =)
-lost hope