diff options
| author | yum <yum.food.vr@gmail.com> | 2025-04-11 19:17:06 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-04-11 19:17:06 -0700 |
| commit | a522e7738d75e84cc1ee1491a098421622ef1918 (patch) | |
| tree | c08951cdd65f3eccadc17d57d97ea24d7b0b750f /math.cginc | |
| parent | 77ae276b2b6e47d0de8bf0d9c4bbafd4212135b1 (diff) | |
add rough ability to nudge tessellation heightmap direction
Diffstat (limited to 'math.cginc')
| -rw-r--r-- | math.cginc | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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
|
