summaryrefslogtreecommitdiffstats
path: root/vertex.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-12-08 18:20:39 -0800
committeryum <yum.food.vr@gmail.com>2025-12-08 18:43:14 -0800
commit220aaf68d67538dbc1e5d3a0488498a59a9ee95b (patch)
tree2434b4700bde616a4bfea013eac4ce7b2a7e0e1b /vertex.cginc
parent036919d692fda532bfba508f77ea9dba37d5c4f9 (diff)
begin plane_to_tube rework
Diffstat (limited to 'vertex.cginc')
-rw-r--r--vertex.cginc27
1 files changed, 18 insertions, 9 deletions
diff --git a/vertex.cginc b/vertex.cginc
index f82fad6..daa5ce0 100644
--- a/vertex.cginc
+++ b/vertex.cginc
@@ -61,11 +61,14 @@
#if defined(_VERTEX_DEFORMATION_XZ_TUBE)
#define VERTEX_DEFORM_XZ_TUBE_PREAMBLE \
+ float3 p = _Vertex_Deformation_XZ_Tube_p; \
+ float3 r = _Vertex_Deformation_XZ_Tube_r; \
+ float3 s = _Vertex_Deformation_XZ_Tube_s; \
float t = _Vertex_Deformation_XZ_Tube_t
#define VERTEX_DEFORM_XZ_TUBE_POS \
- objPos = plane_to_tube(objPos.xyz, t)
+ objPos = plane_to_tube(objPos.xyz, p, r, s, t)
#define VERTEX_DEFORM_XZ_TUBE_NORM \
- plane_to_tube_normal(objPos, objNorm, objTan, t)
+ plane_to_tube_normal(objPos.xyz, objNorm, objTan, p, r, s, t)
#else
#define VERTEX_DEFORM_XZ_TUBE_PREAMBLE
#define VERTEX_DEFORM_XZ_TUBE_POS
@@ -74,15 +77,18 @@
#if defined(_VERTEX_DEFORMATION_YZ_TUBE)
#define VERTEX_DEFORM_YZ_TUBE_PREAMBLE \
+ float3 p = _Vertex_Deformation_YZ_Tube_p; \
+ float3 r = _Vertex_Deformation_YZ_Tube_r; \
+ float3 s = _Vertex_Deformation_YZ_Tube_s; \
float t = _Vertex_Deformation_YZ_Tube_t
#define VERTEX_DEFORM_YZ_TUBE_POS \
- objPos = plane_to_tube(objPos.yxz, t); \
+ objPos = plane_to_tube(objPos.yxz, p, r, s, t); \
objPos = objPos.yxz
#define VERTEX_DEFORM_YZ_TUBE_NORM \
float3 yzPos = objPos.yxz; \
float3 yzNorm = objNorm.yxz; \
float3 yzTan = objTan.yxz; \
- plane_to_tube_normal(yzPos, yzNorm, yzTan, t); \
+ plane_to_tube_normal(yzPos, yzNorm, yzTan, p, r, s, t); \
objPos = yzPos.yxz; \
objNorm = yzNorm.yxz; \
objTan = yzTan.yxz
@@ -94,15 +100,18 @@
#if defined(_VERTEX_DEFORMATION_XY_TUBE)
#define VERTEX_DEFORM_XY_TUBE_PREAMBLE \
+ float3 p = _Vertex_Deformation_XY_Tube_p; \
+ float3 r = _Vertex_Deformation_XY_Tube_r; \
+ float3 s = _Vertex_Deformation_XY_Tube_s; \
float t = _Vertex_Deformation_XY_Tube_t
#define VERTEX_DEFORM_XY_TUBE_POS \
- objPos = plane_to_tube(objPos.xzy, t); \
+ objPos = plane_to_tube(objPos.xzy, p, r, s, t); \
objPos = objPos.xzy
#define VERTEX_DEFORM_XY_TUBE_NORM \
float3 xyPos = objPos.xzy; \
float3 xyNorm = objNorm.xzy; \
float3 xyTan = objTan.xzy; \
- plane_to_tube_normal(xyPos, xyNorm, xyTan, t); \
+ plane_to_tube_normal(xyPos, xyNorm, xyTan, p, r, s, t); \
objPos = xyPos.xzy; \
objNorm = xyNorm.xzy; \
objTan = xyTan.xzy
@@ -406,7 +415,7 @@ void undeform_normal(inout float3 objPos, inout float3 objNorm, inout float3 obj
float3 xyPos = stageInput.xzy;
float3 xyNorm = objNorm.xzy;
float3 xyTan = objTan.xzy;
- plane_to_tube_undeform_normal(xyPos, xyNorm, xyTan, t);
+ plane_to_tube_undeform_normal(xyPos, xyNorm, xyTan, p, r, s, t);
objNorm = xyNorm.xzy;
objTan = xyTan.xzy;
objPos = stageInput;
@@ -420,7 +429,7 @@ void undeform_normal(inout float3 objPos, inout float3 objNorm, inout float3 obj
float3 yzPos = stageInput.yxz;
float3 yzNorm = objNorm.yxz;
float3 yzTan = objTan.yxz;
- plane_to_tube_undeform_normal(yzPos, yzNorm, yzTan, t);
+ plane_to_tube_undeform_normal(yzPos, yzNorm, yzTan, p, r, s, t);
objNorm = yzNorm.yxz;
objTan = yzTan.yxz;
objPos = stageInput;
@@ -431,7 +440,7 @@ void undeform_normal(inout float3 objPos, inout float3 objNorm, inout float3 obj
if (cursor > 0) {
VERTEX_DEFORM_XZ_TUBE_PREAMBLE;
float3 stageInput = posHistory[cursor - 1];
- plane_to_tube_undeform_normal(stageInput, objNorm, objTan, t);
+ plane_to_tube_undeform_normal(stageInput, objNorm, objTan, p, r, s, t);
objPos = stageInput;
cursor -= 1;
}