Skip to content

Commit 526952b

Browse files
committed
fix(crimsondesert): add RR_ENABLED flag to relevant shaders
1 parent ea6a22a commit 526952b

10 files changed

Lines changed: 23 additions & 23 deletions

src/games/crimsondesert/grass-foliage/GrassMain8BindlessFrond_0x28A5B177.ps_6_6.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ OutputSignature main(
274274
float _455 = select(_451, 0.0f, (((((_363 * _357) / _368) - _295) * _375) + _295));
275275
float _459 = _nearFarProj.x / max(1.0000000116860974e-07f, SV_Position.z);
276276

277-
if (CONTACT_SHADOW_QUALITY > 0.5f) {
277+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY > 0.5f) {
278278
// --- Grass/foliage AO ---
279279
// TEXCOORD.y is inverted
280280
float _grassBladeHeight = 1.0f - saturate(TEXCOORD.y);

src/games/crimsondesert/grass-foliage/GrassMain8BindlessLeaf_0x877A6337.ps_6_6.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ OutputSignature main(
274274
float _455 = select(_451, 0.0f, (((((_363 * _357) / _368) - _295) * _375) + _295));
275275
float _459 = _nearFarProj.x / max(1.0000000116860974e-07f, SV_Position.z);
276276

277-
if (CONTACT_SHADOW_QUALITY > 0.5f) {
277+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY > 0.5f) {
278278
// --- Grass/foliage AO ---
279279
// TEXCOORD.y is inverted
280280
float _grassBladeHeight = 1.0f - saturate(TEXCOORD.y);

src/games/crimsondesert/rt/EvaluateDiffuseRadiance_0xF75E217A.cs_6_6.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ void main(
746746
float _661 = ((select(_650, (((_504 * 0.9163600206375122f) + (_503 * 0.07020000368356705f)) + (_505 * 0.013450000435113907f)), _212.y) * _531) * _646) + _449;
747747
float _662 = ((select(_650, (((_504 * 0.10958000272512436f) + (_503 * 0.02061999961733818f)) + (_505 * 0.8697999715805054f)), _212.z) * _532) * _646) + _450;
748748
float _663 = _646 + _454;
749-
if ((uint)(_455 + 1) < (uint)renodx::math::Select(RT_QUALITY >= 1.f, 8.f, 4.f)) {
749+
if ((uint)(_455 + 1) < (uint)renodx::math::Select(RR_ENABLED == 1.f && RT_QUALITY >= 1.f, 8.f, 4.f)) {
750750
_448 = _660;
751751
_449 = _661;
752752
_450 = _662;

src/games/crimsondesert/rt/SpatialResampleReservoirsDiffuse_0x0985FA79.cs_6_6.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ void main(
224224
//
225225
// Griefs the game because of only 1spp, causes a lot of boiling
226226
// ============================================================
227-
if (RT_QUALITY >= 1.f) {
227+
if (RR_ENABLED == 1.f && RT_QUALITY >= 1.f) {
228228
static const int SPMIS_N = 24;
229229
static const float SPMIS_INV_N = 1.0f / 24.0f;
230230
static const float SPMIS_PI = 3.14159265358979f;

src/games/crimsondesert/rt/TemporalResampleReservoirsDiffuse_0x81E68180.cs_6_6.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ void main(
334334
// ignores that TAA jitter shifts the subpixel position each frame.
335335
float _rndx_jitter_delta_u = 0.0f;
336336
float _rndx_jitter_delta_v = 0.0f;
337-
if (RT_QUALITY >= 1.f) {
337+
if (RR_ENABLED == 1.f && RT_QUALITY >= 1.f) {
338338
_rndx_jitter_delta_u = (_temporalAAJitter.x - _temporalAAJitter.z) * 0.5f;
339339
_rndx_jitter_delta_v = (_temporalAAJitter.y - _temporalAAJitter.w) * 0.5f;
340340
}
@@ -368,7 +368,7 @@ void main(
368368
// RenoDX: Subpixel aware validation threshold relaxation
369369
// Widens world space distance threshold proportionally to jitter magnitude
370370
float _rndx_validation_threshold = _431;
371-
if (RT_QUALITY >= 1.f) {
371+
if (RR_ENABLED == 1.f && RT_QUALITY >= 1.f) {
372372
float _rndx_jitter_mag = sqrt(_rndx_jitter_delta_u * _rndx_jitter_delta_u
373373
+ _rndx_jitter_delta_v * _rndx_jitter_delta_v);
374374
_rndx_validation_threshold = _431 + _267 * _rndx_jitter_mag * 2.0f;

src/games/crimsondesert/shadows/SceneShadowTiledNight_0x87A33F91.cs_6_6.hlsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -866,14 +866,14 @@ void main(
866866
// RenoDX: Weather adaptive grass occluder thickness
867867
if (_2014 == 17) {
868868
float _grassWeather = saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY);
869-
_2088 = renodx::math::Select(CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather), 0.09f);
869+
_2088 = renodx::math::Select(RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather), 0.09f);
870870
}
871871
float _2090 = saturate(_2020 * 0.015625f);
872872
float _2093 = (1.0f - _2090) + (_2090 * _2088);
873873
_2103 = _2014;
874874
_2104 = saturate((saturate(1.0f - ((_2093 * _2093) * _2088)) * (1.0f - _1999)) + _1999);
875875
// RenoDX: Weather adaptive grass shadow contribution
876-
if (CONTACT_SHADOW_QUALITY == 1.f && _2014 == 17) {
876+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f && _2014 == 17) {
877877
float _grassContrib = lerp(0.3f, 0.65f, saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY));
878878
_2104 = lerp(_1999, _2104, _grassContrib);
879879
}
@@ -1012,14 +1012,14 @@ void main(
10121012
// RenoDX: Weather adaptive grass occluder thickness
10131013
if (_2284 == 17) {
10141014
float _grassWeather2 = saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY);
1015-
_2358 = renodx::math::Select(CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather2), 0.09f);
1015+
_2358 = renodx::math::Select(RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather2), 0.09f);
10161016
}
10171017
float _2360 = saturate(_2291 * 0.015625f);
10181018
float _2363 = (1.0f - _2360) + (_2360 * _2358);
10191019
_2373 = _2284;
10201020
_2374 = saturate((saturate(1.0f - ((_2363 * _2363) * _2358)) * (1.0f - _2269)) + _2269);
10211021
// RenoDX: Weather adaptive grass shadow contribution
1022-
if (CONTACT_SHADOW_QUALITY == 1.f && _2284 == 17) {
1022+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f && _2284 == 17) {
10231023
float _grassContrib2 = lerp(0.3f, 0.65f, saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY));
10241024
_2374 = lerp(_2269, _2374, _grassContrib2);
10251025
}

src/games/crimsondesert/shadows/SceneShadowTiledNight_0x9CD157E9.cs_6_6.hlsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ void main(
868868
// RenoDX: Weather adaptive grass occluder thickness
869869
if (_2014 == 17) {
870870
float _grassWeather = saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY);
871-
_2088 = renodx::math::Select(CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather), 0.09f);
871+
_2088 = renodx::math::Select(RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather), 0.09f);
872872
}
873873
float _2090 = saturate(_2020 * 0.015625f);
874874
float _2093 = (1.0f - _2090) + (_2090 * _2088);
@@ -880,7 +880,7 @@ void main(
880880
_2111 = _2014;
881881
_2112 = saturate(((saturate(1.0f - ((_2093 * _2093) * _2088)) * (1.0f - _1999)) * _2104) + _1999);
882882
// RenoDX: Weather adaptive grass shadow contribution
883-
if (CONTACT_SHADOW_QUALITY == 1.f && _2014 == 17) {
883+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f && _2014 == 17) {
884884
float _grassContrib = lerp(0.3f, 0.65f, saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY));
885885
_2112 = lerp(_1999, _2112, _grassContrib);
886886
}
@@ -1019,7 +1019,7 @@ void main(
10191019
// RenoDX: Weather adaptive grass occluder thickness
10201020
if (_2292 == 17) {
10211021
float _grassWeather2 = saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY);
1022-
_2366 = renodx::math::Select(CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather2), 0.09f);
1022+
_2366 = renodx::math::Select(RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather2), 0.09f);
10231023
}
10241024
float _2368 = saturate(_2299 * 0.015625f);
10251025
float _2371 = (1.0f - _2368) + (_2368 * _2366);
@@ -1031,7 +1031,7 @@ void main(
10311031
_2389 = _2292;
10321032
_2390 = saturate(((saturate(1.0f - ((_2371 * _2371) * _2366)) * (1.0f - _2277)) * _2382) + _2277);
10331033
// RenoDX: Weather adaptive grass shadow contribution
1034-
if (CONTACT_SHADOW_QUALITY == 1.f && _2292 == 17) {
1034+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f && _2292 == 17) {
10351035
float _grassContrib2 = lerp(0.3f, 0.65f, saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY));
10361036
_2390 = lerp(_2277, _2390, _grassContrib2);
10371037
}

src/games/crimsondesert/shadows/SceneShadowTiled_0x1BEDCAEF.cs_6_6.hlsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,14 +1023,14 @@ void main(
10231023
// RenoDX: Weather adaptive grass occluder thickness
10241024
if (_2472 == 17) {
10251025
float _grassWeather = saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY);
1026-
_2546 = renodx::math::Select(CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather), 0.09f);
1026+
_2546 = renodx::math::Select(RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather), 0.09f);
10271027
}
10281028
float _2548 = saturate(_2478 * 0.015625f);
10291029
float _2551 = (1.0f - _2548) + (_2548 * _2546);
10301030
_2561 = _2472;
10311031
_2562 = saturate((saturate(1.0f - ((_2551 * _2551) * _2546)) * (1.0f - _2457)) + _2457);
10321032
// RenoDX: Weather adaptive grass shadow contribution
1033-
if (CONTACT_SHADOW_QUALITY == 1.f && _2472 == 17) {
1033+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f && _2472 == 17) {
10341034
float _grassContrib = lerp(0.3f, 0.65f, saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY));
10351035
_2562 = lerp(_2457, _2562, _grassContrib);
10361036
}
@@ -1169,14 +1169,14 @@ void main(
11691169
// RenoDX: Weather adaptive grass occluder thickness
11701170
if (_2742 == 17) {
11711171
float _grassWeather2 = saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY);
1172-
_2816 = renodx::math::Select(CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather2), 0.09f);
1172+
_2816 = renodx::math::Select(RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather2), 0.09f);
11731173
}
11741174
float _2818 = saturate(_2749 * 0.015625f);
11751175
float _2821 = (1.0f - _2818) + (_2818 * _2816);
11761176
_2831 = _2742;
11771177
_2832 = saturate((saturate(1.0f - ((_2821 * _2821) * _2816)) * (1.0f - _2727)) + _2727);
11781178
// RenoDX: Weather adaptive grass shadow contribution
1179-
if (CONTACT_SHADOW_QUALITY == 1.f && _2742 == 17) {
1179+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f && _2742 == 17) {
11801180
float _grassContrib2 = lerp(0.3f, 0.65f, saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY));
11811181
_2832 = lerp(_2727, _2832, _grassContrib2);
11821182
}

src/games/crimsondesert/shadows/SceneShadowTiled_0xF2547DD2.cs_6_6.hlsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ void main(
10251025
// RenoDX: Weather adaptive grass occluder thickness
10261026
if (_2472 == 17) {
10271027
float _grassWeather = saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY);
1028-
_2546 = renodx::math::Select(CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather), 0.09f);
1028+
_2546 = renodx::math::Select(RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather), 0.09f);
10291029
}
10301030
float _2548 = saturate(_2478 * 0.015625f);
10311031
float _2551 = (1.0f - _2548) + (_2548 * _2546);
@@ -1037,7 +1037,7 @@ void main(
10371037
_2569 = _2472;
10381038
_2570 = saturate(((saturate(1.0f - ((_2551 * _2551) * _2546)) * (1.0f - _2457)) * _2562) + _2457);
10391039
// RenoDX: Weather adaptive grass shadow contribution
1040-
if (CONTACT_SHADOW_QUALITY == 1.f && _2472 == 17) {
1040+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f && _2472 == 17) {
10411041
float _grassContrib = lerp(0.3f, 0.65f, saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY));
10421042
_2570 = lerp(_2457, _2570, _grassContrib);
10431043
}
@@ -1176,7 +1176,7 @@ void main(
11761176
// RenoDX: Weather adaptive grass occluder thickness
11771177
if (_2750 == 17) {
11781178
float _grassWeather2 = saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY);
1179-
_2824 = renodx::math::Select(CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather2), 0.09f);
1179+
_2824 = renodx::math::Select(RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f, lerp(0.018f, 0.05f, _grassWeather2), 0.09f);
11801180
}
11811181
float _2826 = saturate(_2757 * 0.015625f);
11821182
float _2829 = (1.0f - _2826) + (_2826 * _2824);
@@ -1188,7 +1188,7 @@ void main(
11881188
_2847 = _2750;
11891189
_2848 = saturate(((saturate(1.0f - ((_2829 * _2829) * _2824)) * (1.0f - _2735)) * _2840) + _2735);
11901190
// RenoDX: Weather adaptive grass shadow contribution
1191-
if (CONTACT_SHADOW_QUALITY == 1.f && _2750 == 17) {
1191+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f && _2750 == 17) {
11921192
float _grassContrib2 = lerp(0.3f, 0.65f, saturate(abs(_sunDirection.y) * FOLIAGE_SHADOW_SENSITIVITY));
11931193
_2848 = lerp(_2735, _2848, _grassContrib2);
11941194
}

src/games/crimsondesert/shadows/micro_detail_shadows.hlsli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//
1212
// -----------------------------------------------------------------------------
1313

14-
if (CONTACT_SHADOW_QUALITY == 1.f) {
14+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f) {
1515
// --- Tuning constants ---
1616
static const int MICRO_STEPS = 16;
1717

0 commit comments

Comments
 (0)