summaryrefslogtreecommitdiffstats
path: root/tooner_lighting.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-06-23 13:50:19 -0700
committeryum <yum.food.vr@gmail.com>2024-06-23 13:50:58 -0700
commit79e95c1ced341d0b7db7c2fb3a5c6c2ce623a265 (patch)
treee4fbbdf4f93f3f4e4985151cc4186c470f41cb6d /tooner_lighting.cginc
parenteadd7efade2162ac66d35c2a9c3e73bb5826f974 (diff)
Add gimmicks folder
Catch-all bag for some nascent research. Zero cost if unused. Also organize all shader-side keywords into a single .cginc.
Diffstat (limited to 'tooner_lighting.cginc')
-rw-r--r--tooner_lighting.cginc23
1 files changed, 23 insertions, 0 deletions
diff --git a/tooner_lighting.cginc b/tooner_lighting.cginc
index 2a8a75d..ab90525 100644
--- a/tooner_lighting.cginc
+++ b/tooner_lighting.cginc
@@ -885,9 +885,32 @@ float4 effect(inout v2f i)
float ao = 1;
#endif
+#if defined(_GIMMICK_FLAT_COLOR)
+ if (round(_Gimmick_Flat_Color_Enable_Dynamic)) {
+ albedo = _Gimmick_Flat_Color_Color;
+ normal = i.normal;
+ }
+#endif
+
float4 lit = getLitColor(vertex_light_color, albedo, i.worldPos, normal,
metallic, 1.0 - roughness, i.uv, ao, i);
+#if defined(_GIMMICK_FLAT_COLOR)
+ if (round(_Gimmick_Flat_Color_Enable_Dynamic)) {
+#if defined(_RENDERING_CUTOUT)
+#if defined(_RENDERING_CUTOUT_STOCHASTIC)
+ float ar = rand2(i.uv);
+ clip(albedo.a - ar);
+#else
+ clip(albedo.a - _Alpha_Cutoff);
+#endif
+ albedo.a = 1;
+#endif
+
+ return float4(lit.rgb + _Gimmick_Flat_Color_Emission, albedo.a);
+ }
+#endif
+
float4 result = lit;
#if defined(_MATCAP0) || defined(_MATCAP1) || defined(_RIM_LIGHTING0) || defined(_RIM_LIGHTING1)
result.rgb += matcap_emission;