diff options
| author | yum <yum.food.vr@gmail.com> | 2024-11-03 15:25:08 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-11-03 15:25:54 -0800 |
| commit | b7d3cb5d759feab1e44f4cdb01a0c8922bf4f1cb (patch) | |
| tree | cc10c40ac2e632dd07a0ac0fe515048b354af7f9 /tooner_lighting.cginc | |
| parent | cb55e813456480a036673d1d32608e10b10c8f87 (diff) | |
Misc
* Add third HSV slot
* Add ZTest enum
* Fix bug where SSR mask keyword can be set when SSR is disabled
Diffstat (limited to 'tooner_lighting.cginc')
| -rw-r--r-- | tooner_lighting.cginc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tooner_lighting.cginc b/tooner_lighting.cginc index e79681a..2952f29 100644 --- a/tooner_lighting.cginc +++ b/tooner_lighting.cginc @@ -2345,6 +2345,27 @@ float4 effect(inout v2f i, out float depth) } #endif +#if defined(_HSV2) + { + float hsv_mask = _HSV2_Mask.SampleBias(linear_repeat_s, i.uv0, _Global_Sample_Bias); + if (_HSV2_Mask_Invert) { + hsv_mask = 1 - hsv_mask; + } + if (hsv_mask > 0.01 && + (_HSV2_Hue_Shift > 1E-6 || + abs(_HSV2_Sat_Shift) > 1E-6 || + abs(_HSV2_Val_Shift) > 1E-6)) { + float3 c = albedo.rgb; + c = RGBtoHSV(c); + c += float3(_HSV2_Hue_Shift, _HSV2_Sat_Shift, _HSV2_Val_Shift); + c.x = glsl_mod(c.x, 1.0); + c.yz = saturate(c.yz); + c = HSVtoRGB(c); + albedo.rgb = c; + } + } +#endif + #if defined(_AMBIENT_OCCLUSION) float ao = _Ambient_Occlusion.SampleBias(linear_repeat_s, UV_SCOFF(i, _Ambient_Occlusion_ST, /*uv_channel=*/0), |
