Skip to content

Commit 5b2e3f8

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

13 files changed

+37
-37
lines changed

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_0x28104287.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
float _665 = ((select(_654, (((_508 * 0.9163600206375122f) + (_507 * 0.07020000368356705f)) + (_509 * 0.013450000435113907f)), _216.y) * _535) * _650) + _453;
869869
float _666 = ((select(_654, (((_508 * 0.10958000272512436f) + (_507 * 0.02061999961733818f)) + (_509 * 0.8697999715805054f)), _216.z) * _536) * _650) + _454;
870870
float _667 = _650 + _458;
871-
if ((uint)(_459 + 1) < (uint)renodx::math::Select(RT_QUALITY >= 1.f, 8.f, 4.f)) {
871+
if ((uint)(_459 + 1) < (uint)renodx::math::Select(RR_ENABLED == 1.f && RT_QUALITY >= 1.f, 8.f, 4.f)) {
872872
_452 = _664;
873873
_453 = _665;
874874
_454 = _666;
@@ -1561,7 +1561,7 @@ void main(
15611561
float _1954 = (((((_1808 * 0.9163600206375122f) + (_1807 * 0.07020000368356705f)) + (_1809 * 0.013450000435113907f)) * _1835) * _1946) + _1756;
15621562
float _1955 = (((((_1808 * 0.10958000272512436f) + (_1807 * 0.02061999961733818f)) + (_1809 * 0.8697999715805054f)) * _1836) * _1946) + _1757;
15631563
float _1956 = _1946 + _1758;
1564-
if ((uint)(_1759 + 1) < (uint)renodx::math::Select(RT_QUALITY >= 1.f, 8.f, 4.f)) {
1564+
if ((uint)(_1759 + 1) < (uint)renodx::math::Select(RR_ENABLED == 1.f && RT_QUALITY >= 1.f, 8.f, 4.f)) {
15651565
_1755 = _1953;
15661566
_1756 = _1954;
15671567
_1757 = _1955;
@@ -2760,7 +2760,7 @@ void main(
27602760
float _4838 = (((((_4698 * 0.9163600206375122f) + (_4697 * 0.07020000368356705f)) + (_4699 * 0.013450000435113907f)) * _4725) * _4830) + _4646;
27612761
float _4839 = (((((_4698 * 0.10958000272512436f) + (_4697 * 0.02061999961733818f)) + (_4699 * 0.8697999715805054f)) * _4726) * _4830) + _4647;
27622762
float _4840 = _4830 + _4648;
2763-
if ((uint)(_4649 + 1) < (uint)renodx::math::Select(RT_QUALITY >= 1.f, 8.f, 4.f)) {
2763+
if ((uint)(_4649 + 1) < (uint)renodx::math::Select(RR_ENABLED == 1.f && RT_QUALITY >= 1.f, 8.f, 4.f)) {
27642764
_4645 = _4837;
27652765
_4646 = _4838;
27662766
_4647 = _4839;
@@ -3145,7 +3145,7 @@ void main(
31453145
//
31463146
// Apply a luminance based soft compression on the raw hit radiance before it
31473147
// enters the reservoir
3148-
if (RT_QUALITY >= 1.f && RT_GI_STRENGTH > 0.0f) {
3148+
if (RR_ENABLED == 1.f && RT_QUALITY >= 1.f && RT_GI_STRENGTH > 0.0f) {
31493149
float _rndx_gi_lum = renodx::color::y::from::BT709(float3(_5729, _5730, _5731));
31503150
if (_rndx_gi_lum > RT_GI_KNEE) {
31513151
float _rndx_gi_excess = _rndx_gi_lum - RT_GI_KNEE;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3153,7 +3153,7 @@ void main(
31533153
//
31543154
// Apply a luminance based soft compression on the raw hit radiance before it
31553155
// enters the reservoir
3156-
if (RT_QUALITY >= 1.f && RT_GI_STRENGTH > 0.0f) {
3156+
if (RR_ENABLED == 1.f && RT_QUALITY >= 1.f && RT_GI_STRENGTH > 0.0f) {
31573157
float _rndx_gi_lum = renodx::color::y::from::BT709(float3(_5732, _5733, _5734));
31583158
if (_rndx_gi_lum > RT_GI_KNEE) {
31593159
float _rndx_gi_excess = _rndx_gi_lum - RT_GI_KNEE;

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

Lines changed: 3 additions & 3 deletions
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;
@@ -1439,7 +1439,7 @@ void main(
14391439
float _1950 = (((((_1804 * 0.9163600206375122f) + (_1803 * 0.07020000368356705f)) + (_1805 * 0.013450000435113907f)) * _1831) * _1942) + _1752;
14401440
float _1951 = (((((_1804 * 0.10958000272512436f) + (_1803 * 0.02061999961733818f)) + (_1805 * 0.8697999715805054f)) * _1832) * _1942) + _1753;
14411441
float _1952 = _1942 + _1754;
1442-
if ((uint)(_1755 + 1) < (uint)renodx::math::Select(RT_QUALITY >= 1.f, 8.f, 4.f)) {
1442+
if ((uint)(_1755 + 1) < (uint)renodx::math::Select(RR_ENABLED == 1.f && RT_QUALITY >= 1.f, 8.f, 4.f)) {
14431443
_1751 = _1949;
14441444
_1752 = _1950;
14451445
_1753 = _1951;
@@ -2354,7 +2354,7 @@ void main(
23542354
//
23552355
// Apply a luminance based soft compression on the raw hit radiance before it
23562356
// enters the reservoir
2357-
if (RT_QUALITY >= 1.f && RT_GI_STRENGTH > 0.0f) {
2357+
if (RR_ENABLED == 1.f && RT_QUALITY >= 1.f && RT_GI_STRENGTH > 0.0f) {
23582358
float _rndx_gi_lum = renodx::color::y::from::BT709(float3(_4123, _4124, _4125));
23592359
if (_rndx_gi_lum > RT_GI_KNEE) {
23602360
float _rndx_gi_excess = _rndx_gi_lum - RT_GI_KNEE;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ void main(
23622362
//
23632363
// Apply a luminance based soft compression on the raw hit radiance before it
23642364
// enters the reservoir
2365-
if (RT_QUALITY >= 1.f && RT_GI_STRENGTH > 0.0f) {
2365+
if (RR_ENABLED == 1.f && RT_QUALITY >= 1.f && RT_GI_STRENGTH > 0.0f) {
23662366
float _rndx_gi_lum = renodx::color::y::from::BT709(float3(_4126, _4127, _4128));
23672367
if (_rndx_gi_lum > RT_GI_KNEE) {
23682368
float _rndx_gi_excess = _rndx_gi_lum - RT_GI_KNEE;

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

Lines changed: 2 additions & 2 deletions
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;
@@ -386,7 +386,7 @@ void main(
386386
uint _371 = _362 * -1964877855;
387387
// RenoDX: R2+CP blue noise for spatial neighbor selection
388388
int _390, _391;
389-
if (RT_QUALITY >= 1.f) {
389+
if (RR_ENABLED == 1.f && RT_QUALITY >= 1.f) {
390390
float2 _rndx_nbr = _rndx_sample_noise(SV_DispatchThreadID.xy, _frameNumber.x, 3u + _365);
391391
_390 = int(min(max(float(int((_rndx_nbr.x * 2.0f - 1.0f) * _313) + (int)(SV_DispatchThreadID.x)), 0.0f), (_bufferSizeAndInvSize.x - 1.0f)));
392392
_391 = int(min(max(float(int((_rndx_nbr.y * 2.0f - 1.0f) * _313) + (int)(SV_DispatchThreadID.y)), 0.0f), (_bufferSizeAndInvSize.y - 1.0f)));

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

Lines changed: 3 additions & 3 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;
@@ -677,7 +677,7 @@ void main(
677677
float _1035 = _1034 * _634;
678678
// RenoDX: Smooth exposure M cap sigmoid replaces linear cliff
679679
float _1052;
680-
if (RT_QUALITY >= 1.f) {
680+
if (RR_ENABLED == 1.f && RT_QUALITY >= 1.f) {
681681
float _rndx_t = rcp(1.0f + exp(-6.0f * (_exposure3.w - 0.5f)));
682682
_1052 = renodx::math::Select(((_428) || ((_renderParams.y > 0.0f))), 32.0f, lerp(256.0f, 64.0f, _rndx_t));
683683
} else {

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

Lines changed: 5 additions & 5 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
}
@@ -1266,7 +1266,7 @@ void main(
12661266
// ──────────────────────────────────────────────────────────────────
12671267

12681268
// ────────────────── Screen edge contact shadow fade ───────────────
1269-
if (CONTACT_SHADOW_QUALITY == 1.f && _2585 < 1.0f) {
1269+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f && _2585 < 1.0f) {
12701270
float2 _screenUV = float2((_54 + 0.5f) * _bufferSizeAndInvSize.z,
12711271
(_55 + 0.5f) * _bufferSizeAndInvSize.w);
12721272
float2 _edgeDist = min(_screenUV, 1.0f - _screenUV);

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

Lines changed: 5 additions & 5 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
}
@@ -1278,7 +1278,7 @@ void main(
12781278
// ──────────────────────────────────────────────────────────────────
12791279

12801280
// ────────────────── Screen edge contact shadow fade ───────────────
1281-
if (CONTACT_SHADOW_QUALITY == 1.f && _2601 < 1.0f) {
1281+
if (RR_ENABLED == 1.f && CONTACT_SHADOW_QUALITY == 1.f && _2601 < 1.0f) {
12821282
float2 _screenUV = float2((_54 + 0.5f) * _bufferSizeAndInvSize.z,
12831283
(_55 + 0.5f) * _bufferSizeAndInvSize.w);
12841284
float2 _edgeDist = min(_screenUV, 1.0f - _screenUV);

0 commit comments

Comments
 (0)