Near clipping plane issues.
Hi.
I've tryed to code some sort of portal optimisation algorithm,and I've faced a really weird problem.
Clipping code work generally right,but clipping against NEAR_PLANE is not always right.When I get close to the portal,the portal is identified as invisible,and when I move away,the portal is identified as visible.Usage of
gluPerspective doesn't do the trick.
Frustum generation & boxInFrustum test are coded correctly for sure.
Has anyone ever encountered this sort of near-plane clipping issues?I would really appreciate any kind of advice.
Quote:Original post by DarkMessiaHClose as in the portal is in front of the near plane (between the camera and the near plane)? If that's the case, then it's working perfectly because the portal isn't inside the frustum. If that's what's happening but you still want the portal to be "visible" for that, run a modified frustum test to ignore the near plane. If that's not the problem, I can't think of what it could be so maybe post some more info? Such as what do you mean when you say "Usage of gluPerspective doesn't do the trick?"
When I get close to the portal,the portal is identified as invisible,and when I move away,the portal is identified as visible.
I take it you are using OpenGL's culling/clipping routines? I have always been under the impression that a more suitable way to attack this is to perform your own clipping routines & treat OpenGL as merely a tool to display the results. This way you have complete control over what will be defined as visible (from a data point of view) instead of leaving it up to OpenGL.
That may not answer your question of course.
That may not answer your question of course.
I've always thought that gluPerspective should make the near clipping plane closer to the camera(in OpenGl).I extracted frustum data from projection*modelview matrix.
Quote:Original post by DarkMessiaHOnly if you set the near parameter to a number less than what you previously used (same goes for glFrustum, glOrtho, and gluOrtho2D).
I've always thought that gluPerspective should make the near clipping plane closer to the camera(in OpenGl)[...]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement