Skip to content

Commit cb80796

Browse files
committed
Reimagined r2.0.1
1 parent 329f392 commit cb80796

File tree

12 files changed

+46
-43
lines changed

12 files changed

+46
-43
lines changed

shaders/lang/en_US.lang

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,13 @@ value.REFLECTION_QUALITY.1=§4Potato §e[*]
7777
value.REFLECTION_QUALITY.2=§aMedium
7878
value.REFLECTION_QUALITY.3=§bHigh
7979

80+
option.REALTIME_SHADOWS=Real-Time Shadows
81+
option.REALTIME_SHADOWS.comment=Enables traditional shadows that move depending on the terrain and sun/moon angle. §e[*]§r Disabling this option will cause Light Shafts to not work, and will stop other shadow options from doing anything
82+
value.REALTIME_SHADOWS.true=§bON
83+
value.REALTIME_SHADOWS.false=§cOFF
84+
8085
option.SHADOW_QUALITY=Shadow Sample Quality
81-
option.SHADOW_QUALITY.comment=Adjusts the quality of shadows. Every tier further reduces the shadow noise artifacts, and options lower than §bHigh§r enable optimised shadows on leaves. §e[*]§r Potato quality will disable real-time shadows, causing Light Shafts and Shadow Distance to not work.
82-
value.SHADOW_QUALITY.0=§4Potato §e[*]
86+
option.SHADOW_QUALITY.comment=Adjusts the quality of shadows. Every tier further reduces the shadow noise artifacts, and options lower than §bHigh§r enable optimised shadows on leaves.
8387
value.SHADOW_QUALITY.1=§eLow
8488
value.SHADOW_QUALITY.2=§aMedium
8589
value.SHADOW_QUALITY.3=§bHigh

shaders/lib/atmospherics/clouds/reimaginedClouds.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ float InterleavedGradientNoise() {
1616
#endif
1717
}
1818

19-
#if SHADOW_QUALITY > 0
19+
#ifdef REALTIME_SHADOWS
2020
vec3 GetShadowOnCloudPosition(vec3 tracePos) {
2121
vec3 wpos = PlayerToShadow(tracePos - cameraPosition);
2222
float distb = sqrt(wpos.x * wpos.x + wpos.y * wpos.y);
@@ -90,7 +90,7 @@ vec4 GetVolumetricClouds(float cloudAltitude, float distanceThreshold, inout flo
9090
if (GetCloudNoise(tracePos.xyz, cloudAltitude)) {
9191
float lightMult = 1.0;
9292

93-
#if SHADOW_QUALITY > 0
93+
#ifdef REALTIME_SHADOWS
9494
if (GetShadowOnCloud(tracePos, cloudAltitude, lowerPlaneAltitude, higherPlaneAltitude)) {
9595
if (eyeBrightness.y != 240) continue;
9696
else lightMult = 0.25;

shaders/lib/atmospherics/fog/waterFog.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#ifndef INCLUDE_WATER_FOG
22
#define INCLUDE_WATER_FOG
33
float GetWaterFog(float lViewPos) {
4-
#if LIGHTSHAFT_QUALITY > 0 && SHADOW_QUALITY > 0
4+
#if LIGHTSHAFT_QUALITY > 0 && defined REALTIME_SHADOWS
55
float fog = lViewPos / 48.0;
66
fog *= fog;
77
#else

shaders/lib/atmospherics/volumetricLight.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ vec4 GetVolumetricLight(inout float vlFactor, vec3 translucentMult, float lViewP
112112

113113
float shadowSample = 1.0;
114114
vec3 vlSample = vec3(1.0);
115-
#if SHADOW_QUALITY > 0
115+
#ifdef REALTIME_SHADOWS
116116
wpos = shadowModelView * wpos;
117117
wpos = shadowProjection * wpos;
118118
wpos /= wpos.w;

shaders/lib/common.glsl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
#define CUSTOM_PBR
2828
#endif
2929

30-
#define SHADOW_QUALITY 2 //[0 1 2 3 4 5]
30+
#define REALTIME_SHADOWS
31+
#define SHADOW_QUALITY 2 //[1 2 3 4 5]
3132
const float shadowDistance = 192.0; //[64.0 80.0 96.0 112.0 128.0 160.0 192.0 224.0 256.0 320.0 384.0 512.0 768.0 1024.0]
3233
//#define ENTITY_SHADOWS
3334
#define SSAO
@@ -284,7 +285,7 @@
284285
vec3 caveFogColor = caveFogColorRaw;
285286
#endif
286287

287-
#if LIGHTSHAFT_QUALITY > 0 && SHADOW_QUALITY > 0
288+
#if LIGHTSHAFT_QUALITY > 0 && defined REALTIME_SHADOWS
288289
vec3 waterFogColor = vec3(0.07, 0.08, 0.11) * vec3(1.0 + vsBrightness);
289290
#else
290291
vec3 waterFogColor = vec3(0.15, 0.26, 0.3) * vec3(1.0 + 0.5 * vsBrightness);

shaders/lib/lighting/mainLighting.glsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ uniform float darknessLightFactor;
1010
#include "/lib/colors/lightAndAmbientColors.glsl"
1111
#include "/lib/lighting/ggx.glsl"
1212

13-
#if SHADOW_QUALITY > 0 && (defined OVERWORLD || defined END)
13+
#if defined REALTIME_SHADOWS && (defined OVERWORLD || defined END)
1414
#include "/lib/lighting/shadowSampling.glsl"
1515
#endif
1616

@@ -47,7 +47,7 @@ void DoLighting(inout vec3 color, inout vec3 shadowMult, vec3 playerPos, vec3 vi
4747
// Shadows
4848
#if defined OVERWORLD || defined END
4949
float NdotL = dot(normalM, lightVec);
50-
#if SHADOW_QUALITY == 0
50+
#ifndef REALTIME_SHADOWS
5151
if (subsurfaceMode == 1) {
5252
NdotU = 1.0;
5353
NdotUmax0 = 1.0;
@@ -86,7 +86,7 @@ void DoLighting(inout vec3 color, inout vec3 shadowMult, vec3 playerPos, vec3 vi
8686
#endif
8787

8888
if (shadowMult.r > 0.00001) {
89-
#if SHADOW_QUALITY > 0
89+
#ifdef REALTIME_SHADOWS
9090
if (NdotLM > 0.0001) {
9191
vec3 shadowMultBeforeLighting = shadowMult;
9292
float shadowLength = shadowDistance * 0.9166667 - length(vec4(playerPos.x, playerPos.y, playerPos.y, playerPos.z));
@@ -284,7 +284,7 @@ void DoLighting(inout vec3 color, inout vec3 shadowMult, vec3 playerPos, vec3 vi
284284
#ifdef OVERWORLD
285285
ambientMult = vec3(mix(lightmapYM, pow2(lightmapYM) * lightmapYM, rainFactor));
286286

287-
#if SHADOW_QUALITY == 0
287+
#ifndef REALTIME_SHADOWS
288288
float tweakFactor = 1.0 + 0.6 * (1.0 - pow2(pow2(pow2(noonFactor))));
289289
shadowLighting /= tweakFactor;
290290
ambientMult *= mix(tweakFactor, 1.0, 0.5 * NdotUmax0);

shaders/lib/materials/materialHandling/terrainMaterials.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if (mat < 10512) {
1313

1414
DoFoliageColorTweaks(color.rgb, shadowMult, snowMinNdotU, lViewPos);
1515

16-
#if SHADOW_QUALITY == 0
16+
#ifndef REALTIME_SHADOWS
1717
shadowMult *= 1.0 - 0.3 * (signMidCoordPos.y + 1.0) * (1.0 - abs(signMidCoordPos.x))
1818
+ 0.5 * (1.0 - signMidCoordPos.y) * invNoonFactor; // consistency357381
1919
#endif
@@ -36,7 +36,7 @@ if (mat < 10512) {
3636

3737
DoFoliageColorTweaks(color.rgb, shadowMult, snowMinNdotU, lViewPos);
3838

39-
#if SHADOW_QUALITY == 0
39+
#ifndef REALTIME_SHADOWS
4040
shadowMult *= 1.0 + invNoonFactor; // consistency357381
4141
#endif
4242
}

shaders/lib/materials/specificMaterials/terrain/leaves.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ materialMask = OSIEBCA * 253.0; // Reduced Edge TAA
1212
color.rgb = color.rgb * 0.5 + 0.5 * (color.rgb / glColor.rgb);
1313
#endif
1414

15-
#if SHADOW_QUALITY > 0 && SHADOW_QUALITY < 3
15+
#if defined REALTIME_SHADOWS && SHADOW_QUALITY < 3
1616
shadowMult = vec3(sqrt1(max0(max(lmCoordM.y, min1(lmCoordM.x * 2.0)) - 0.95) * 20.0));
1717
#endif

shaders/program/composite.glsl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ uniform sampler2D colortex0;
2626
uniform sampler2D depthtex0;
2727
uniform sampler2D depthtex1;
2828

29-
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
29+
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
3030
uniform int frameCounter;
3131

3232
uniform float viewWidth, viewHeight;
@@ -60,7 +60,7 @@ uniform sampler2D depthtex1;
6060
float SdotU = dot(sunVec, upVec);
6161
float sunFactor = SdotU < 0.0 ? clamp(SdotU + 0.375, 0.0, 0.75) / 0.75 : clamp(SdotU + 0.03125, 0.0, 0.0625) / 0.0625;
6262

63-
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
63+
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
6464
float sunVisibility = clamp(SdotU + 0.0625, 0.0, 0.125) / 0.125;
6565
float sunVisibility2 = sunVisibility * sunVisibility;
6666
float shadowTimeVar1 = abs(sunVisibility - 0.5) * 2.0;
@@ -86,7 +86,7 @@ float sunFactor = SdotU < 0.0 ? clamp(SdotU + 0.375, 0.0, 0.75) / 0.75 : clamp(S
8686
#include "/lib/atmospherics/fog/bloomFog.glsl"
8787
#endif
8888

89-
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
89+
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
9090
#ifdef END
9191
#include "/lib/atmospherics/enderBeams.glsl"
9292
#endif
@@ -99,7 +99,7 @@ void main() {
9999
float z0 = texelFetch(depthtex0, texelCoord, 0).r;
100100
float z1 = texelFetch(depthtex1, texelCoord, 0).r;
101101

102-
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
102+
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
103103
vec4 volumetricLight = vec4(0.0);
104104
float vlFactorM = vlFactor;
105105

@@ -129,20 +129,20 @@ void main() {
129129
const vec3 underwaterMult = vec3(0.80, 0.87, 0.97) * 0.71;
130130
color.rgb *= underwaterMult;
131131

132-
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
132+
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
133133
volumetricLight.rgb *= pow2(underwaterMult);
134134
#endif
135135
} else if (isEyeInWater == 2) {
136136
if (z1 == 1.0) color.rgb = fogColor * 5.0;
137137

138-
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
138+
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
139139
volumetricLight.rgb *= 0.0;
140140
#endif
141141
}
142142

143143
color = pow(color, vec3(2.2));
144144

145-
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
145+
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
146146
#ifndef OVERWORLD
147147
volumetricLight.rgb *= volumetricLight.rgb;
148148
#endif
@@ -162,7 +162,7 @@ void main() {
162162
/* DRAWBUFFERS:0 */
163163
gl_FragData[0] = vec4(color, 1.0);
164164

165-
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
165+
#if LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
166166
/* DRAWBUFFERS:04 */
167167
gl_FragData[1] = vec4(vlFactorM, 0.0, 0.0, 1.0);
168168
#endif

shaders/program/deferred1.glsl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ noperspective in vec2 texCoord;
1212

1313
flat in vec3 upVec, sunVec;
1414

15-
#if LIGHTSHAFT_BEHAVIOUR == 1 && LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
15+
#if LIGHTSHAFT_BEHAVIOUR == 1 && LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
1616
flat in float vlFactor;
1717
#endif
1818

@@ -66,7 +66,7 @@ uniform sampler2D noisetex;
6666

6767
uniform sampler2D colortex3;
6868

69-
#if SHADOW_QUALITY > 0
69+
#ifdef REALTIME_SHADOWS
7070
uniform sampler2DShadow shadowtex0;
7171
#endif
7272
#endif
@@ -114,7 +114,7 @@ float farMinusNear = far - near;
114114
);
115115
#endif
116116

117-
#if LIGHTSHAFT_BEHAVIOUR == 1 && LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
117+
#if LIGHTSHAFT_BEHAVIOUR == 1 && LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
118118
#else
119119
float vlFactor = 0.0;
120120
#endif
@@ -408,7 +408,7 @@ void main() {
408408
#endif
409409
}
410410

411-
#if LIGHTSHAFT_BEHAVIOUR == 1 && LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
411+
#if LIGHTSHAFT_BEHAVIOUR == 1 && LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
412412
if (viewWidth + viewHeight - gl_FragCoord.x - gl_FragCoord.y < 1.5)
413413
cloudLinearDepth = vlFactor;
414414
#endif
@@ -432,12 +432,12 @@ noperspective out vec2 texCoord;
432432

433433
flat out vec3 upVec, sunVec;
434434

435-
#if LIGHTSHAFT_BEHAVIOUR == 1 && LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
435+
#if LIGHTSHAFT_BEHAVIOUR == 1 && LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
436436
flat out float vlFactor;
437437
#endif
438438

439439
//Uniforms//
440-
#if LIGHTSHAFT_BEHAVIOUR == 1 && LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
440+
#if LIGHTSHAFT_BEHAVIOUR == 1 && LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
441441
uniform float viewWidth, viewHeight;
442442

443443
uniform sampler2D colortex4;
@@ -468,7 +468,7 @@ void main() {
468468
upVec = normalize(gbufferModelView[1].xyz);
469469
sunVec = GetSunVector();
470470

471-
#if LIGHTSHAFT_BEHAVIOUR == 1 && LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && SHADOW_QUALITY > 0 || defined END
471+
#if LIGHTSHAFT_BEHAVIOUR == 1 && LIGHTSHAFT_QUALITY > 0 && defined OVERWORLD && defined REALTIME_SHADOWS || defined END
472472
vlFactor = texelFetch(colortex4, ivec2(viewWidth-1, viewHeight-1), 0).r;
473473

474474
#ifdef END

0 commit comments

Comments
 (0)