summaryrefslogtreecommitdiffstats
path: root/math.cginc
diff options
context:
space:
mode:
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