mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-27 02:32:39 +08:00
fix mishandling of cloud shadow related toggles. fix clouds not appearing behind translucent things. remove random spaces from shaders.properties
This commit is contained in:
@ -368,9 +368,8 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CLOUDS_SHADOWS
|
||||
Shadows *= GetCloudShadow(playerPos + cameraPosition, WsunVec);
|
||||
#endif
|
||||
Shadows *= GetCloudShadow(playerPos + cameraPosition, WsunVec);
|
||||
|
||||
|
||||
Direct_lighting = DirectLightColor * NdotL * Shadows;
|
||||
|
||||
|
@ -419,9 +419,7 @@ void main() {
|
||||
|
||||
Shadows *= mix(LM_shadowMapFallback, 1.0, shadowMapFalloff2);
|
||||
|
||||
#ifdef CLOUDS_SHADOWS
|
||||
Shadows *= GetCloudShadow(feetPlayerPos+cameraPosition, WsunVec);
|
||||
#endif
|
||||
Shadows *= GetCloudShadow(feetPlayerPos+cameraPosition, WsunVec);
|
||||
|
||||
if(isEyeInWater == 1){
|
||||
float distanceFromWaterSurface = max(-(feetPlayerPos.y + (cameraPosition.y - waterEnteredAltitude)),0.0) ;
|
||||
|
@ -588,9 +588,8 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
|
||||
// Shadows = mix(LM_shadowMapFallback, Shadows, shadowMapFalloff2);
|
||||
Shadows *= mix(LM_shadowMapFallback,1.0,shadowMapFalloff2);
|
||||
|
||||
#ifdef CLOUDS_SHADOWS
|
||||
Shadows *= GetCloudShadow(feetPlayerPos+cameraPosition, WsunVec);
|
||||
#endif
|
||||
Shadows *= GetCloudShadow(feetPlayerPos+cameraPosition, WsunVec);
|
||||
|
||||
|
||||
Direct_lighting = DirectLightColor * NdotL * Shadows;
|
||||
|
||||
|
@ -1077,11 +1077,10 @@ void main() {
|
||||
|
||||
if(isEyeInWater != 1) SSSColor *= lightLeakFix;
|
||||
|
||||
#ifdef CLOUDS_SHADOWS
|
||||
float cloudShadows = GetCloudShadow(feetPlayerPos.xyz + cameraPosition, WsunVec);
|
||||
shadowColor *= cloudShadows;
|
||||
SSSColor *= cloudShadow*cloudShadows;
|
||||
#endif
|
||||
float cloudShadows = GetCloudShadow(feetPlayerPos.xyz + cameraPosition, WsunVec);
|
||||
shadowColor *= cloudShadows;
|
||||
SSSColor *= cloudShadow*cloudShadows;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -1351,16 +1350,13 @@ void main() {
|
||||
gl_FragData[0].rgb = clamp(fp10Dither(Background, triangularize(noise_2)), 0.0, 65000.);
|
||||
}
|
||||
|
||||
// water absorbtion will impact ALL light coming up from terrain underwater.
|
||||
gl_FragData[0].rgb *= Absorbtion;
|
||||
|
||||
if(translucentMasks > 0.0 && isEyeInWater != 1){
|
||||
|
||||
// water absorbtion will impact ALL light coming up from terrain underwater.
|
||||
gl_FragData[0].rgb *= Absorbtion;
|
||||
|
||||
vec4 vlBehingTranslucents = BilateralUpscale_VLFOG(colortex13, depthtex1, gl_FragCoord.xy - 1.5, ld(z));
|
||||
|
||||
gl_FragData[0].rgb = gl_FragData[0].rgb * vlBehingTranslucents.a + vlBehingTranslucents.rgb;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -328,9 +328,8 @@ vec4 waterVolumetrics(vec3 rayStart, vec3 rayEnd, float rayLength, vec2 dither,
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef VL_CLOUDS_SHADOWS
|
||||
sh *= GetCloudShadow(progressW, WsunVec * lightCol.a);
|
||||
#endif
|
||||
sh *= GetCloudShadow(progressW, WsunVec * lightCol.a);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -191,7 +191,7 @@ vec4 waterVolumetrics( vec3 rayStart, vec3 rayEnd, float estEndDepth, float estS
|
||||
vec3 sh = vec3(1.0);
|
||||
|
||||
// do this outside raymarch loop, masking the water surface is good enough
|
||||
#if defined VL_CLOUDS_SHADOWS && defined OVERWORLD_SHADER
|
||||
#if defined OVERWORLD_SHADER
|
||||
sh *= GetCloudShadow(wpos+cameraPosition, WsunVec);
|
||||
#endif
|
||||
|
||||
@ -286,18 +286,19 @@ void main() {
|
||||
float noise_1 = R2_dither();
|
||||
float noise_2 = blueNoise();
|
||||
|
||||
float z0 = texture2D(depthtex0,tc).x;
|
||||
float z0 = texelFetch2D(depthtex0, ivec2((floor(gl_FragCoord.xy - 0.5)/VL_RENDER_RESOLUTION*texelSize)/texelSize), 0 ).x;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float DH_z0 = texture2D(dhDepthTex,tc).x;
|
||||
float DH_z0 = texelFetch2D(dhDepthTex, ivec2((floor(gl_FragCoord.xy - 0.5)/VL_RENDER_RESOLUTION*texelSize)/texelSize), 0 ).x;//texture2D(dhDepthTex,tc).x;
|
||||
#else
|
||||
float DH_z0 = 0.0;
|
||||
#endif
|
||||
|
||||
float z = texture2D(depthtex1,tc).x;
|
||||
float z = texelFetch2D(depthtex1, ivec2((floor(gl_FragCoord.xy - 0.5)/VL_RENDER_RESOLUTION*texelSize)/texelSize), 0 ).x;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float DH_z = texture2D(dhDepthTex1,tc).x;
|
||||
// float DH_z = texture2D(dhDepthTex1,tc).x;
|
||||
float DH_z = texelFetch2D(dhDepthTex1, ivec2((floor(gl_FragCoord.xy - 0.5)/VL_RENDER_RESOLUTION*texelSize)/texelSize), 0 ).x;//texture2D(dhDepthTex,tc).x;
|
||||
#else
|
||||
float DH_z = 0.0;
|
||||
#endif
|
||||
@ -355,29 +356,32 @@ void main() {
|
||||
vec4 finalVolumetrics = vec4(0.0,0.0,0.0,1.0);
|
||||
float cloudPlaneDistance = 0.0;
|
||||
|
||||
if(!iswater){
|
||||
#ifdef OVERWORLD_SHADER
|
||||
vec4 VolumetricClouds = GetVolumetricClouds(viewPos1, vec2(noise_1, noise_2), WsunVec, directLightColor, indirectLightColor,cloudPlaneDistance);
|
||||
#ifdef OVERWORLD_SHADER
|
||||
vec4 VolumetricClouds = GetVolumetricClouds(viewPos1, vec2(noise_1, noise_2), WsunVec, directLightColor, indirectLightColor, cloudPlaneDistance);
|
||||
|
||||
float atmosphereAlpha = 1.0;
|
||||
vec4 VolumetricFog = GetVolumetricFog(viewPos1, WsunVec, vec2(noise_1, noise_2), directLightColor, indirectLightColor, indirectLightColor_dynamic, atmosphereAlpha, VolumetricClouds.rgb,cloudPlaneDistance);
|
||||
|
||||
finalVolumetrics.rgb += VolumetricClouds.rgb;
|
||||
#endif
|
||||
float atmosphereAlpha = 1.0;
|
||||
vec4 VolumetricFog = GetVolumetricFog(viewPos1, WsunVec, vec2(noise_1, noise_2), directLightColor, indirectLightColor, indirectLightColor_dynamic, atmosphereAlpha, VolumetricClouds.rgb,cloudPlaneDistance);
|
||||
|
||||
finalVolumetrics.rgb += VolumetricClouds.rgb;
|
||||
finalVolumetrics.a *= VolumetricClouds.a;
|
||||
#endif
|
||||
|
||||
#if defined NETHER_SHADER || defined END_SHADER
|
||||
vec4 VolumetricFog = GetVolumetricFog(viewPos1, noise_1, noise_2);
|
||||
#endif
|
||||
#if defined NETHER_SHADER || defined END_SHADER
|
||||
vec4 VolumetricFog = GetVolumetricFog(viewPos1, noise_1, noise_2);
|
||||
#endif
|
||||
|
||||
finalVolumetrics.rgb = finalVolumetrics.rgb * VolumetricFog.a + VolumetricFog.rgb;
|
||||
finalVolumetrics.a *= VolumetricFog.a;
|
||||
}
|
||||
finalVolumetrics.rgb = finalVolumetrics.rgb * VolumetricFog.a + VolumetricFog.rgb;
|
||||
finalVolumetrics.a *= VolumetricFog.a;
|
||||
|
||||
vec4 underwaterVlFog = vec4(0,0,0,1);
|
||||
|
||||
float lightleakfix = clamp(lightmap.y + (1-caveDetection),0.0,1.0);
|
||||
|
||||
if(iswater && isEyeInWater != 1) finalVolumetrics = waterVolumetrics(viewPos0, viewPos1, estimatedDepth, estimatedSunDepth, Vdiff, noise_1, totEpsilon, scatterCoef, indirectLightColor_dynamic, directLightColor, dot(normalize(viewPos1), normalize(sunVec*lightCol.a)) ,lightleakfix);
|
||||
if(iswater && isEyeInWater != 1) {
|
||||
vec4 underWaterFog = waterVolumetrics(viewPos0, viewPos1, estimatedDepth, estimatedSunDepth, Vdiff, noise_1, totEpsilon, scatterCoef, indirectLightColor_dynamic, directLightColor, dot(normalize(viewPos1), normalize(sunVec*lightCol.a)) ,lightleakfix);
|
||||
finalVolumetrics.rgb = finalVolumetrics.rgb * underWaterFog.a*underWaterFog.a + underWaterFog.rgb;
|
||||
finalVolumetrics.a *= underWaterFog.a;
|
||||
}
|
||||
|
||||
gl_FragData[0] = clamp(finalVolumetrics, 0.0, 65000.0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user