Jump to content
  • Advertisement
Sign in to follow this  
supagu

[cg/hlsl] clip

This topic is 4564 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

so i wanna clip in my shader to a water plane (0, 1, 0, 0) some one suggested the use of clip: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/clip___HLSL.asp which is used in the pixel shader it seems. now im wondering how this should be used. Im thinking, convert the clip plane in to screen space so: tansform = world * view * projection transformed plane = transform * plane then i do something in my vertex shader with this to pass to my pixel shader so then i upload this transformed plane to my shader then simply check against the IN.position.z of my pixel in the pixel shader, against the passed value from the vertex shader sound roughly right? problem is im lost there, what to do in my vertex shader to pass to my pixel shader relating to the clip plane? or have i got the whole idea wrong?

Share this post


Link to post
Share on other sites
Advertisement
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!