1- #include "/ lib/ shaderSettings/ enhancedCelestials.glsl"
2- #include "/ lib/ shaderSettings/ doomAndGloomFog.glsl"
1+ #include "/ lib/ shaderSettings/ enhancedCelestials.glsl"
2+ #include "/ lib/ shaderSettings/ doomAndGloomFog.glsl"
33// ////////////////////////////////////////
44// Complementary Shaders by EminGT //
55// With Euphoria Patches by SpacEagle17 //
@@ -103,14 +103,14 @@ void main() {
103103 vec4 viewPos = gbufferProjectionInverse * (screenPos * 2.0 - 1.0 );
104104 viewPos /= viewPos.w;
105105 vec3 nViewPos = normalize (viewPos.xyz);
106- float SkyColorPlayerPosMult = clamp ((cameraPosition.y - 100 ) / 300 , 0.0 , 1.0 );
107- vec3 SkyColorPlayerPos = mix (vec3 (1.0 , 1.0 , 1.0 ), vec3 (0.07 , 0.0 , 0.2 ), SkyColorPlayerPosMult);
108-
109- float VdotU = dot (nViewPos, upVec);
110- float VdotS = dot (nViewPos, sunVec);
111- float dither = Bayer8(gl_FragCoord .xy);
112-
113- color.rgb = GetSky(VdotU, VdotS, dither, true, false);
106+ float SkyColorPlayerPosMult = clamp ((cameraPosition.y - 100 ) / 300 , 0.0 , 1.0 );
107+ vec3 SkyColorPlayerPos = mix (vec3 (1.0 , 1.0 , 1.0 ), vec3 (0.07 , 0.0 , 0.2 ), SkyColorPlayerPosMult);
108+
109+ float VdotU = dot (nViewPos, upVec);
110+ float VdotS = dot (nViewPos, sunVec);
111+ float dither = Bayer8(gl_FragCoord .xy);
112+
113+ color.rgb = GetSky(VdotU, VdotS, dither, true, false);
114114 color.rgb *= SkyColorPlayerPos;
115115 #ifdef SECRET_CAELUM_SUPPORT_SETTING
116116 if (alphaColor < 1.0 && alphaColor > 0.0 ) color.rgb = glColor.rgb * alphaColor;
@@ -148,7 +148,11 @@ void main() {
148148 float absVdotS = abs (VdotS);
149149 #if SUN_MOON_STYLE == 2
150150 float sunSizeFactor1 = 0.9975 ;
151- float sunSizeFactor2 = 400.0 ;
151+ #ifdef SUN_SIZE
152+ float sunSizeFactor2 = SUN_SIZE;
153+ #else
154+ float sunSizeFactor2 = 400.0 ;
155+ #endif
152156 float moonCrescentOffset = 0.0055 ;
153157 float moonPhaseFactor1 = 2.45 ;
154158 float moonPhaseFactor2 = 750.0 ;
@@ -159,12 +163,12 @@ void main() {
159163 float moonPhaseFactor1 = 2.2 ;
160164 float moonPhaseFactor2 = 1000.0 ;
161165 #endif
162- #ifdef MOD_ENHANCEDCELESTIALS
163- sunSizeFactor1 = cos (sqrt (moonSizeSmooth / 20 ) * acos (sunSizeFactor1));
164- sunSizeFactor2 /= sqrt (moonSizeSmooth / 20 );
165- moonPhaseFactor1 *= pow (moonSizeSmooth / 20 , 0.2 );
166- moonPhaseFactor2 /= (moonSizeSmooth / 20 );
167- #endif
166+ #ifdef MOD_ENHANCEDCELESTIALS
167+ sunSizeFactor1 = cos (sqrt (moonSizeSmooth / 20 ) * acos (sunSizeFactor1));
168+ sunSizeFactor2 /= sqrt (moonSizeSmooth / 20 );
169+ moonPhaseFactor1 *= pow (moonSizeSmooth / 20 , 0.2 );
170+ moonPhaseFactor2 /= (moonSizeSmooth / 20 );
171+ #endif
168172 if (absVdotS > sunSizeFactor1) {
169173 float sunMoonMixer = sqrt1(sunSizeFactor2 * (absVdotS - sunSizeFactor1));
170174
@@ -183,13 +187,13 @@ void main() {
183187 float sunBrightness = 25.0 ;
184188 if (tonemap == ACESTonemap) color.rgb = mix (color.rgb, vec3 (1.0 , 0.698 , 0.5451 ) * sunBrightness, sunMoonMixer);
185189 else
186- #if DOOM_AND_GLOOM_FOG == 1
187- sunMoonMixer = pow (sunMoonMixer * 0.3 , 0.2 );
188- sunBrightness *= FOG_UNBOUND_SUN_BRIGHTNESS;
189- #elif defined MOD_DOOM_AND_GLOOM && (DOOM_AND_GLOOM_FOG == 0 )
190- sunMoonMixer = pow (sunMoonMixer * (1.0 - 0.7 * doomAndGloomFog), 0.2 );
191- sunBrightness *= mix (1.0 , FOG_UNBOUND_SUN_BRIGHTNESS, doomAndGloomFog);
192- #endif
190+ #if DOOM_AND_GLOOM_FOG == 1
191+ sunMoonMixer = pow (sunMoonMixer * 0.3 , 0.2 );
192+ sunBrightness *= FOG_UNBOUND_SUN_BRIGHTNESS;
193+ #elif defined MOD_DOOM_AND_GLOOM && (DOOM_AND_GLOOM_FOG == 0 )
194+ sunMoonMixer = pow (sunMoonMixer * (1.0 - 0.7 * doomAndGloomFog), 0.2 );
195+ sunBrightness *= mix (1.0 , FOG_UNBOUND_SUN_BRIGHTNESS, doomAndGloomFog);
196+ #endif
193197 color.rgb = mix (color.rgb, vec3 (0.9 , 0.5 , 0.3 ) * sunBrightness, sunMoonMixer);
194198 } else {
195199 float horizonFactor = GetHorizonFactor(- SdotU);
@@ -204,7 +208,7 @@ void main() {
204208 #if BLOOD_MOON > 0
205209 moonColor = mix (moonColor, vec3 (0.4588 , 0.149 , 0.149 ) * 1.5 , getBloodMoon(sunVisibility));
206210 #endif
207- moonColor *= (1.2 - (0.2 + 0.2 * sqrt1(nightFactor)) * moonNoise);
211+ moonColor *= (1.2 - (0.2 + 0.2 * sqrt1(nightFactor)) * moonNoise);
208212 moonColor *= saturateColors(moonColorSmooth, LUNAR_EVENT_MOON_SATURATION);
209213
210214 if (moonPhase >= 1 ) {
@@ -231,16 +235,16 @@ void main() {
231235 sunMoonMixer *= 1.0 - 0.5 * GetCaveFactor();
232236 #endif
233237
234- #if DOOM_AND_GLOOM_FOG == 1
235- moonColor *= mix (vec3 (1.0 ), vec3 (0.15 , 0.2 , 0.35 ), 0.3 );
236- #elif defined MOD_DOOM_AND_GLOOM && (DOOM_AND_GLOOM_FOG == 0 )
237- moonColor *= mix (vec3 (1.0 ), vec3 (0.15 , 0.2 , 0.35 ), 0.3 * doomAndGloomFog);
238- #endif
239- color.rgb = mix (color.rgb, moonColor, sunMoonMixer);
240- #if DOOM_AND_GLOOM_FOG == 1
241- color.rgb = mix (color.rgb, vec3 (0.5 ), pow2(acos (absVdotS) / acos (sunSizeFactor1)));
242- #elif defined MOD_DOOM_AND_GLOOM && (DOOM_AND_GLOOM_FOG == 0 )
243- color.rgb = mix (color.rgb, vec3 (0.5 ), doomAndGloomFog * pow2(acos (absVdotS) / acos (sunSizeFactor1)));
238+ #if DOOM_AND_GLOOM_FOG == 1
239+ moonColor *= mix (vec3 (1.0 ), vec3 (0.15 , 0.2 , 0.35 ), 0.3 );
240+ #elif defined MOD_DOOM_AND_GLOOM && (DOOM_AND_GLOOM_FOG == 0 )
241+ moonColor *= mix (vec3 (1.0 ), vec3 (0.15 , 0.2 , 0.35 ), 0.3 * doomAndGloomFog);
242+ #endif
243+ color.rgb = mix (color.rgb, moonColor, sunMoonMixer);
244+ #if DOOM_AND_GLOOM_FOG == 1
245+ color.rgb = mix (color.rgb, vec3 (0.5 ), pow2(acos (absVdotS) / acos (sunSizeFactor1)));
246+ #elif defined MOD_DOOM_AND_GLOOM && (DOOM_AND_GLOOM_FOG == 0 )
247+ color.rgb = mix (color.rgb, vec3 (0.5 ), doomAndGloomFog * pow2(acos (absVdotS) / acos (sunSizeFactor1)));
244248 #endif
245249 }
246250 }
0 commit comments