Jump to content
  • Advertisement
Sign in to follow this  
Juliean

OpenGL Any alternative to DX9/OpenGL user clip planes (outside of shader?)

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

Hello,

 

I was wondering if there was any way to simulate user clip planes in DirectX11, outside of using SV_CLIPDISTANCE in the shader, in a way like DirectX9 did with SetClipPlane? The reason being that I'm actually generating my shaders from the same source for all 3 APIs, and neigther DirectX9 nor OpenGL4 support anything comparable to keep compatibility. Also, it would actually be much nicer to be able for me to just set the clip plane application side without having to specify it in the shader, e.g. so that I can render models for water reflection with the same shader that is used normally (right now, I had to dublicate it and insert the clipping in the second version, which sucks hard time). Any easy way to do so, if any at all

Edited by Juliean

Share this post


Link to post
Share on other sites
Advertisement
No, apart from SV_ClipDistance or a manual plane check with clip() in the pixel shader I don't think there is a way API-wise.
 
Not that I've tried, but there are some projection matrix tricks (ab)using clip-space clipping you could explore.

Share this post


Link to post
Share on other sites

Damn, the one thing that was really cool from the FFP and IMHO really didn't belong into the shader, and they remove it. I quess I'm going to go with the matrix tricks, thanks.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!