diff options
Diffstat (limited to 'tooner_lighting.cginc')
| -rw-r--r-- | tooner_lighting.cginc | 23 |
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; |
