summaryrefslogtreecommitdiffstats
path: root/vertex.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-10-12 16:28:53 -0700
committeryum <yum.food.vr@gmail.com>2025-10-12 16:28:53 -0700
commita4bf31470f7e2855f13d922e3e7ad1c7767d9afd (patch)
treeeeefe31633142978c609c2dd2b4d6890349526a6 /vertex.cginc
parent6ac3da1b0bd363d70c2f6e4b7b921f2f929dedac (diff)
add geometry shader
Diffstat (limited to 'vertex.cginc')
-rw-r--r--vertex.cginc7
1 files changed, 4 insertions, 3 deletions
diff --git a/vertex.cginc b/vertex.cginc
index 2f5b5f5..58c5209 100644
--- a/vertex.cginc
+++ b/vertex.cginc
@@ -4,22 +4,23 @@
#include "custom31.hlsl"
void deform(inout float3 objPos) {
+ float t_eps = 1e-9;
#if defined(_CUSTOM31_XZ_TUBE)
{
- float t = _Custom31_XZ_Tube_t;
+ float t = clamp(_Custom31_XZ_Tube_t, -1+t_eps, 1-t_eps);;
objPos = plane_to_tube(objPos.xyz, t);
}
#endif // _CUSTOM31_XZ_TUBE
#if defined(_CUSTOM31_YZ_TUBE)
{
- float t = _Custom31_YZ_Tube_t;
+ float t = clamp(_Custom31_YZ_Tube_t, -1+t_eps, 1-t_eps);
objPos = plane_to_tube(objPos.yxz, t);
objPos = objPos.yxz;
}
#endif // _CUSTOM31_YZ_TUBE
#if defined(_CUSTOM31_XY_TUBE)
{
- float t = _Custom31_XY_Tube_t;
+ float t = clamp(_Custom31_XY_Tube_t, -1+t_eps, 1-t_eps);
objPos = plane_to_tube(objPos.xzy, t);
objPos = objPos.xzy;
}