Jump to content
  • Advertisement
Sign in to follow this  
supagu

clip space clip planes

This topic is 3914 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

im writing a software renderer, and im trying to get my head around clip space and clip planes. I did have clipping working in camera space (i think that might not be correct terminology, the space when you have clip space coords and then divide by the w component). Except the near plane was screwing up. So in camera space my clip planes were easy, each side of a unit cube. How ever in clip space, i need to somehow calculate the clip planes, and a method to determine the distance from the points to the plane. Its the w component that is screwing over my standard calculations for distance from point to a plane. google'ing for 'clip space' doesnt turn up much explanations :-/

Share this post


Link to post
Share on other sites
Advertisement
Your terminology is mixed up. You're currently clipping in clip space (called that becaue it is really easy to clip things using a unit cube) and you want to clip things in camera space (which is the space you're in before applying the projection matrix) or even world space (the space you're in before applying the camera/view matrix).

Google for "view frustrum".

Share this post


Link to post
Share on other sites
i cant do clipping before the projection matrix is applied, as my code is setup to run vertex shaders which apply the world * view * projection matrix to the vertices (like you would in a standard vertex shader).

Once these vertices have gone through this w * v * p matrix are they now in camera space? then once i do the divide by w they are in clip space? i thought it was the other way around.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!