Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Juliean   GDNet+   -  Reputation: 3184

Like
0Likes
Like

Posted 05 January 2014 - 12:29 PM

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, 05 January 2014 - 12:31 PM.


Sponsor:

#2 unbird   Crossbones+   -  Reputation: 7107

Like
2Likes
Like

Posted 05 January 2014 - 12:53 PM

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.

#3 Mona2000   Members   -  Reputation: 794

Like
1Likes
Like

Posted 05 January 2014 - 01:59 PM

http://developer.download.nvidia.com/SDK/9.5/Samples/DEMOS/Direct3D9/src/NearClipPlane/docs/HLSL_NearClipPlane.pdf



#4 Juliean   GDNet+   -  Reputation: 3184

Like
0Likes
Like

Posted 06 January 2014 - 05:27 AM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS