summaryrefslogtreecommitdiffstats
path: root/Editor
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-01-17 01:13:49 -0800
committeryum <yum.food.vr@gmail.com>2025-01-17 01:13:49 -0800
commitbee103e89fc83030bfc0251db5a78bb153042e1f (patch)
tree5298edf99718d13d64d69efe2a0ff63bed1337b4 /Editor
parentb28359aefb16151c7c835dadfe27b969ea8fe702 (diff)
Use quad intrinsics to compute trochoid normals
Simple algo. Use quad intrinsics to get neighboring pixels' (x & y) positions in trochoid space. Compute tangent and bitangent from that. Then normal as cross product. There's some artifacting on diagonal boundaries.
Diffstat (limited to 'Editor')
-rw-r--r--Editor/tooner.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Editor/tooner.cs b/Editor/tooner.cs
index 0d15a3a..310cfa6 100644
--- a/Editor/tooner.cs
+++ b/Editor/tooner.cs
@@ -1990,6 +1990,13 @@ public class ToonerGUI : ShaderGUI {
bc = FindProperty("_Trochoid_Height_Scale");
FloatProperty(bc, "Height scale");
+ bc = FindProperty("_Trochoid_Enable_Fragment_Normals");
+ enabled = (bc.floatValue != 0.0);
+ EditorGUI.BeginChangeCheck();
+ enabled = Toggle("Enable fragment normals", enabled);
+ EditorGUI.EndChangeCheck();
+ bc.floatValue = enabled ? 1.0f : 0.0f;
+
EditorGUI.indentLevel -= 1;
}