summaryrefslogtreecommitdiffstats
path: root/math.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-04-11 19:17:06 -0700
committeryum <yum.food.vr@gmail.com>2025-04-11 19:17:06 -0700
commita522e7738d75e84cc1ee1491a098421622ef1918 (patch)
treec08951cdd65f3eccadc17d57d97ea24d7b0b750f /math.cginc
parent77ae276b2b6e47d0de8bf0d9c4bbafd4212135b1 (diff)
add rough ability to nudge tessellation heightmap direction
Diffstat (limited to 'math.cginc')
-rw-r--r--math.cginc6
1 files changed, 5 insertions, 1 deletions
diff --git a/math.cginc b/math.cginc
index 6c48a2c..f2b64fa 100644
--- a/math.cginc
+++ b/math.cginc
@@ -16,7 +16,7 @@ float pow5(float x)
}
float wrapNoL(float NoL, float k) {
-#if 1
+#if 0
// https://www.iro.umontreal.ca/~derek/files/jgt_wrap_final.pdf
return pow(max(1E-4, (NoL + k) / (1 + k)), 1 + k);
#else
@@ -242,4 +242,8 @@ float4 get_quaternion(float3 axis_normal, float theta) {
return float4(axis_normal * sin(theta / 2), cos(theta / 2));
}
+void calcNormalInScreenSpace(inout float3 normal, float3 objPos) {
+ normal = normalize(cross(ddy(objPos), ddx(objPos)));
+}
+
#endif // __MATH_INC