summaryrefslogtreecommitdiffstats
path: root/tooner_lighting.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-01-01 17:42:11 -0800
committeryum <yum.food.vr@gmail.com>2025-01-01 17:42:11 -0800
commitdf8aa8f2b59bad2269f9228d5ed25e7454ca3971 (patch)
tree9ae33b187458a2c5e5245c65208aad68a526ee4b /tooner_lighting.cginc
parent4880e4125f529496a48269eda545ca006db17646 (diff)
More work on downstairs 2 gimmicks
* Use float param to select which gimmick to show * Add colors & domain warping to gimmick 2 * Also optimize it. Colors let us avoid 4-fold neighbor check fanout * Add rough/unoptimized version of gimmick 3
Diffstat (limited to 'tooner_lighting.cginc')
-rw-r--r--tooner_lighting.cginc27
1 files changed, 19 insertions, 8 deletions
diff --git a/tooner_lighting.cginc b/tooner_lighting.cginc
index 21d97b0..059653b 100644
--- a/tooner_lighting.cginc
+++ b/tooner_lighting.cginc
@@ -2751,14 +2751,25 @@ float4 effect(inout v2f i, out float depth)
#if defined(_GIMMICK_DS2)
Gimmick_DS2_Output ds2 = (Gimmick_DS2_Output)0;
// TODO if these remain mutually exclusive, we should use an enum + switch
- if (_Gimmick_DS2_00_Enable_Dynamic) {
- ds2 = Gimmick_DS2_00(i);
- } else if (_Gimmick_DS2_01_Enable_Dynamic) {
- ds2 = Gimmick_DS2_01(i);
- } else if (_Gimmick_DS2_02_Enable_Dynamic) {
- ds2 = Gimmick_DS2_02(i);
- } else if (_Gimmick_DS2_03_Enable_Dynamic) {
- ds2 = Gimmick_DS2_03(i);
+ switch (round(_Gimmick_DS2_Choice)) {
+ case 0:
+ ds2 = Gimmick_DS2_00(i);
+ break;
+ case 1:
+ ds2 = Gimmick_DS2_01(i);
+ break;
+ case 2:
+ ds2 = Gimmick_DS2_02(i);
+ break;
+ case 3:
+ ds2 = Gimmick_DS2_03(i);
+ break;
+ case 10:
+ ds2 = Gimmick_DS2_10(i);
+ break;
+ default:
+ ds2 = (Gimmick_DS2_Output)0;
+ break;
}
float ds2_mask = _Gimmick_DS2_Mask.SampleLevel(linear_clamp_s, i.uv0, 0);
albedo = ds2.albedo * _Gimmick_DS2_Albedo_Factor * ds2_mask;