-
-
Save toxicFork/b2f3244b2c8db42d9d2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float4 _planePos; | |
float4 _planeNorm; | |
#if (CLIP_TWO || CLIP_THREE) | |
float4 _planePos2; | |
float4 _planeNorm2; | |
#endif | |
#if (CLIP_THREE) | |
float4 _planePos3; | |
float4 _planeNorm3; | |
#endif | |
void PlaneClip(float3 posWorld) { | |
#if CLIP_THREE | |
clip(float3( | |
distanceToPlane(_planePos.xyz, _planeNorm.xyz, posWorld), | |
distanceToPlane(_planePos2.xyz, _planeNorm2.xyz, posWorld), | |
distanceToPlane(_planePos3.xyz, _planeNorm3.xyz, posWorld) | |
)); | |
#else //CLIP_THREE | |
#if CLIP_TWO | |
clip(float2( | |
distanceToPlane(_planePos.xyz, _planeNorm.xyz, posWorld), | |
distanceToPlane(_planePos2.xyz, _planeNorm2.xyz, posWorld) | |
)); | |
#else //CLIP_TWO | |
clip(distanceToPlane(_planePos.xyz, _planeNorm.xyz, posWorld)); | |
#endif //CLIP_TWO | |
#endif //CLIP_THREE | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment