diff options
| author | yum <yum.food.vr@gmail.com> | 2025-02-19 23:42:46 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-02-19 23:42:46 -0800 |
| commit | cba7e1ab0bfa89b228955e18b47cf7aca2a84c9f (patch) | |
| tree | fb138e6932281f220e30d3e75c9d6112174c60c5 /vertex_domain_warping.cginc | |
| parent | 547c6064f6a8ab2749f496ce7ea2856e8cc1bcda (diff) | |
Add vertex domain warping gimmick
Diffstat (limited to 'vertex_domain_warping.cginc')
| -rw-r--r-- | vertex_domain_warping.cginc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vertex_domain_warping.cginc b/vertex_domain_warping.cginc new file mode 100644 index 0000000..0eea172 --- /dev/null +++ b/vertex_domain_warping.cginc @@ -0,0 +1,16 @@ +#ifndef __VERTEX_DOMAIN_WARPING_INC
+#define __VERTEX_DOMAIN_WARPING_INC
+
+#include "math.cginc"
+
+float3 domainWarpVertexPosition(float3 vertex, float3 normal, float3 tangent,
+ float3 binormal, float3 worldPos, float3 centerCamPos) {
+ float3 worldNormal = UnityObjectToWorldNormal(normal);
+ float3 worldTangent = UnityObjectToWorldDir(tangent);
+ float3 worldBinormal = cross(worldNormal, worldTangent) * tangent.w * unity_WorldTransformParams.w;
+
+ float3 worldPos = mul(unity_ObjectToWorld, vertex);
+}
+
+#endif // __VERTEX_DOMAIN_WARPING_INC
+
|
