Jump to content
  • Advertisement
Sign in to follow this  
supagu

software clipping

This topic is 3889 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 trying to implement clipping in my software renderer. I can clip successfully with all clip planes except the front clip plane. I'm clipping in clip space (ie. after the perspective divide). Now I figure I need to do near plane clipping in camera/view space (ie. before the perspective divide) as the perspective divide causes issues when vertices go behind the camera and get mirrored. Now, my problem is, how do i determine the near clip plane? I treat my software renderer pretty much like a video card: i have vertex and pixel shaders and have no idea of any matrices used in the shaders. So im wondering how video cards for example do near plane clipping so i can emulate them in my software renderer. edit: I think i may have found my solution, if i divide by abs(w) this fixes any mirroring from back projections so i can do near plane clipping in regular clip space [Edited by - supagu on February 1, 2008 3:42:52 AM]

Share this post


Link to post
Share on other sites
Advertisement
um, the same way you did the far clip plane, and all the others. you pick a number and go with it. 1 works fine for most people but that depends on how much '1' unit relates to in your renderer. it's probably not the worst idea to do your near plane clip before doing perspective transformations so that you can forget about having to check for zero divides and crap from negative divides etc.

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!