Near and far planes

Qudus, I recently switched from Scene to ExtXith3DEnvironment and the display was very strange, something like that (see first attached screenshot).

This was due to your setting of the near plane which was of 0.00001f… It seems to be a too small value. When set to 0.0001f it’s perfect (see second attached screenshot).

I committed this change to CVS.

Hmm in fact it was named front clip and back clip distances.

I now set it to 1f because of other problems : that’s the default value when you create a RenderPass and seems fine after some testing.

[quote="<MagicSpark.org [ BlueSky ]>,post:1,topic:27758"]
Qudus, I recently switched from Scene to ExtXith3DEnvironment and the display was very strange, something like that (see first attached screenshot).

This was due to your setting of the near plane which was of 0.00001f… It seems to be a too small value. When set to 0.0001f it’s perfect (see second attached screenshot).

I committed this change to CVS.
[/quote]
Great! I’ve had this issue, too in some cases. For a strange reason not in all cases. And I couldn’t find the solution. Thank you very much.

[quote="<MagicSpark.org [ BlueSky ]>,post:2,topic:27758"]
Hmm in fact it was named front clip and back clip distances.

I now set it to 1f because of other problems : that’s the default value when you create a RenderPass and seems fine after some testing.
[/quote]
Then we should set the default z-translation of the HUD to something like 1.5f.

I think you’re seeing the effects of depth buffer resolution - which is defined by the ratio between front and back clip distances. If you’ve only got 16 bit depth buffer and it has to represent a big range of values (i.e. ratio between back and front clip planes) then the accuracy goes down - sometimes giving artefacts in the scene.

Theres some stuff on the OpenGL FAQ about it:

http://www.opengl.org/resources/faq/technical/depthbuffer.htm

and I found this useful:

http://www.starfireresearch.com/services/java3d/supplementalDocumentation.html

Kev

I got it. OpenGL doc is very comprehensive.