mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-26 18:22:33 +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
|
#endif
|
||||||
|
|
||||||
#ifdef CLOUDS_SHADOWS
|
|
||||||
Shadows *= GetCloudShadow(playerPos + cameraPosition, WsunVec);
|
Shadows *= GetCloudShadow(playerPos + cameraPosition, WsunVec);
|
||||||
#endif
|
|
||||||
|
|
||||||
Direct_lighting = DirectLightColor * NdotL * Shadows;
|
Direct_lighting = DirectLightColor * NdotL * Shadows;
|
||||||
|
|
||||||
|
@ -419,9 +419,7 @@ void main() {
|
|||||||
|
|
||||||
Shadows *= mix(LM_shadowMapFallback, 1.0, shadowMapFalloff2);
|
Shadows *= mix(LM_shadowMapFallback, 1.0, shadowMapFalloff2);
|
||||||
|
|
||||||
#ifdef CLOUDS_SHADOWS
|
|
||||||
Shadows *= GetCloudShadow(feetPlayerPos+cameraPosition, WsunVec);
|
Shadows *= GetCloudShadow(feetPlayerPos+cameraPosition, WsunVec);
|
||||||
#endif
|
|
||||||
|
|
||||||
if(isEyeInWater == 1){
|
if(isEyeInWater == 1){
|
||||||
float distanceFromWaterSurface = max(-(feetPlayerPos.y + (cameraPosition.y - waterEnteredAltitude)),0.0) ;
|
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, Shadows, shadowMapFalloff2);
|
||||||
Shadows *= mix(LM_shadowMapFallback,1.0,shadowMapFalloff2);
|
Shadows *= mix(LM_shadowMapFallback,1.0,shadowMapFalloff2);
|
||||||
|
|
||||||
#ifdef CLOUDS_SHADOWS
|
|
||||||
Shadows *= GetCloudShadow(feetPlayerPos+cameraPosition, WsunVec);
|
Shadows *= GetCloudShadow(feetPlayerPos+cameraPosition, WsunVec);
|
||||||
#endif
|
|
||||||
|
|
||||||
Direct_lighting = DirectLightColor * NdotL * Shadows;
|
Direct_lighting = DirectLightColor * NdotL * Shadows;
|
||||||
|
|
||||||
|
@ -1077,11 +1077,10 @@ void main() {
|
|||||||
|
|
||||||
if(isEyeInWater != 1) SSSColor *= lightLeakFix;
|
if(isEyeInWater != 1) SSSColor *= lightLeakFix;
|
||||||
|
|
||||||
#ifdef CLOUDS_SHADOWS
|
|
||||||
float cloudShadows = GetCloudShadow(feetPlayerPos.xyz + cameraPosition, WsunVec);
|
float cloudShadows = GetCloudShadow(feetPlayerPos.xyz + cameraPosition, WsunVec);
|
||||||
shadowColor *= cloudShadows;
|
shadowColor *= cloudShadows;
|
||||||
SSSColor *= cloudShadow*cloudShadows;
|
SSSColor *= cloudShadow*cloudShadows;
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1351,16 +1350,13 @@ void main() {
|
|||||||
gl_FragData[0].rgb = clamp(fp10Dither(Background, triangularize(noise_2)), 0.0, 65000.);
|
gl_FragData[0].rgb = clamp(fp10Dither(Background, triangularize(noise_2)), 0.0, 65000.);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(translucentMasks > 0.0 && isEyeInWater != 1){
|
|
||||||
|
|
||||||
// water absorbtion will impact ALL light coming up from terrain underwater.
|
// water absorbtion will impact ALL light coming up from terrain underwater.
|
||||||
gl_FragData[0].rgb *= Absorbtion;
|
gl_FragData[0].rgb *= Absorbtion;
|
||||||
|
|
||||||
|
if(translucentMasks > 0.0 && isEyeInWater != 1){
|
||||||
vec4 vlBehingTranslucents = BilateralUpscale_VLFOG(colortex13, depthtex1, gl_FragCoord.xy - 1.5, ld(z));
|
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;
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef VL_CLOUDS_SHADOWS
|
|
||||||
sh *= GetCloudShadow(progressW, WsunVec * lightCol.a);
|
sh *= GetCloudShadow(progressW, WsunVec * lightCol.a);
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -191,7 +191,7 @@ vec4 waterVolumetrics( vec3 rayStart, vec3 rayEnd, float estEndDepth, float estS
|
|||||||
vec3 sh = vec3(1.0);
|
vec3 sh = vec3(1.0);
|
||||||
|
|
||||||
// do this outside raymarch loop, masking the water surface is good enough
|
// 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);
|
sh *= GetCloudShadow(wpos+cameraPosition, WsunVec);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -286,18 +286,19 @@ void main() {
|
|||||||
float noise_1 = R2_dither();
|
float noise_1 = R2_dither();
|
||||||
float noise_2 = blueNoise();
|
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
|
#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
|
#else
|
||||||
float DH_z0 = 0.0;
|
float DH_z0 = 0.0;
|
||||||
#endif
|
#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
|
#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
|
#else
|
||||||
float DH_z = 0.0;
|
float DH_z = 0.0;
|
||||||
#endif
|
#endif
|
||||||
@ -355,14 +356,14 @@ void main() {
|
|||||||
vec4 finalVolumetrics = vec4(0.0,0.0,0.0,1.0);
|
vec4 finalVolumetrics = vec4(0.0,0.0,0.0,1.0);
|
||||||
float cloudPlaneDistance = 0.0;
|
float cloudPlaneDistance = 0.0;
|
||||||
|
|
||||||
if(!iswater){
|
|
||||||
#ifdef OVERWORLD_SHADER
|
#ifdef OVERWORLD_SHADER
|
||||||
vec4 VolumetricClouds = GetVolumetricClouds(viewPos1, vec2(noise_1, noise_2), WsunVec, directLightColor, indirectLightColor,cloudPlaneDistance);
|
vec4 VolumetricClouds = GetVolumetricClouds(viewPos1, vec2(noise_1, noise_2), WsunVec, directLightColor, indirectLightColor, cloudPlaneDistance);
|
||||||
|
|
||||||
float atmosphereAlpha = 1.0;
|
float atmosphereAlpha = 1.0;
|
||||||
vec4 VolumetricFog = GetVolumetricFog(viewPos1, WsunVec, vec2(noise_1, noise_2), directLightColor, indirectLightColor, indirectLightColor_dynamic, atmosphereAlpha, VolumetricClouds.rgb,cloudPlaneDistance);
|
vec4 VolumetricFog = GetVolumetricFog(viewPos1, WsunVec, vec2(noise_1, noise_2), directLightColor, indirectLightColor, indirectLightColor_dynamic, atmosphereAlpha, VolumetricClouds.rgb,cloudPlaneDistance);
|
||||||
|
|
||||||
finalVolumetrics.rgb += VolumetricClouds.rgb;
|
finalVolumetrics.rgb += VolumetricClouds.rgb;
|
||||||
|
finalVolumetrics.a *= VolumetricClouds.a;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined NETHER_SHADER || defined END_SHADER
|
#if defined NETHER_SHADER || defined END_SHADER
|
||||||
@ -371,13 +372,16 @@ void main() {
|
|||||||
|
|
||||||
finalVolumetrics.rgb = finalVolumetrics.rgb * VolumetricFog.a + VolumetricFog.rgb;
|
finalVolumetrics.rgb = finalVolumetrics.rgb * VolumetricFog.a + VolumetricFog.rgb;
|
||||||
finalVolumetrics.a *= VolumetricFog.a;
|
finalVolumetrics.a *= VolumetricFog.a;
|
||||||
}
|
|
||||||
|
|
||||||
vec4 underwaterVlFog = vec4(0,0,0,1);
|
vec4 underwaterVlFog = vec4(0,0,0,1);
|
||||||
|
|
||||||
float lightleakfix = clamp(lightmap.y + (1-caveDetection),0.0,1.0);
|
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);
|
gl_FragData[0] = clamp(finalVolumetrics, 0.0, 65000.0);
|
||||||
}
|
}
|
||||||
|
@ -206,9 +206,8 @@ vec4 GetVolumetricFog(
|
|||||||
vec3 sh_forClouds = sh;
|
vec3 sh_forClouds = sh;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef VL_CLOUDS_SHADOWS
|
|
||||||
sh *= GetCloudShadow(progressW, sunVector);
|
sh *= GetCloudShadow(progressW, sunVector);
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PER_BIOME_ENVIRONMENT
|
#ifdef PER_BIOME_ENVIRONMENT
|
||||||
float maxDistance = inBiome * min(max(1.0 - length(d*dVWorld.xz)/(32*8),0.0)*2.0,1.0);
|
float maxDistance = inBiome * min(max(1.0 - length(d*dVWorld.xz)/(32*8),0.0)*2.0,1.0);
|
||||||
|
@ -134,6 +134,7 @@ float GetCloudShadow(vec3 playerPos, vec3 sunVector){
|
|||||||
|
|
||||||
vec3 startPosition = playerPos;
|
vec3 startPosition = playerPos;
|
||||||
|
|
||||||
|
#ifdef CLOUDS_SHADOWS
|
||||||
float cloudShadows = 0.0;
|
float cloudShadows = 0.0;
|
||||||
|
|
||||||
#ifdef CloudLayer0
|
#ifdef CloudLayer0
|
||||||
@ -154,6 +155,7 @@ float GetCloudShadow(vec3 playerPos, vec3 sunVector){
|
|||||||
#if defined CloudLayer0 || defined CloudLayer1 || defined CloudLayer2
|
#if defined CloudLayer0 || defined CloudLayer1 || defined CloudLayer2
|
||||||
totalShadow *= exp((cloudShadows*cloudShadows) * -200.0);
|
totalShadow *= exp((cloudShadows*cloudShadows) * -200.0);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
return totalShadow;
|
return totalShadow;
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ SHADER_VERSION_LABEL <empty> \
|
|||||||
######## LIGHTING
|
######## LIGHTING
|
||||||
### DIRECT LIGHT
|
### DIRECT LIGHT
|
||||||
screen.Direct_Light.columns=1
|
screen.Direct_Light.columns=1
|
||||||
screen.Direct_Light = [Shadows] [Subsurface_Scattering] [Sun_and_Moon_Colors] OLD_LIGHTLEAK_FIX sunPathRotation sun_illuminance MOONPHASE_BASED_MOONLIGHT moon_illuminance
|
screen.Direct_Light =[Shadows] [Subsurface_Scattering] [Sun_and_Moon_Colors] OLD_LIGHTLEAK_FIX sunPathRotation sun_illuminance MOONPHASE_BASED_MOONLIGHT moon_illuminance
|
||||||
|
|
||||||
screen.Shadows.columns=1
|
screen.Shadows.columns=1
|
||||||
screen.Shadows = TRANSLUCENT_COLORED_SHADOWS SCREENSPACE_CONTACT_SHADOWS RENDER_ENTITY_SHADOWS RENDER_PLAYER_SHADOWS entityShadowDistanceMul <empty> [Filtering] shadowMapResolution shadowDistance OPTIMIZED_SHADOW_DISTANCE
|
screen.Shadows = TRANSLUCENT_COLORED_SHADOWS SCREENSPACE_CONTACT_SHADOWS RENDER_ENTITY_SHADOWS RENDER_PLAYER_SHADOWS entityShadowDistanceMul <empty> [Filtering] shadowMapResolution shadowDistance OPTIMIZED_SHADOW_DISTANCE
|
||||||
@ -182,7 +182,6 @@ SHADER_VERSION_LABEL <empty> \
|
|||||||
screen.Resource_Pack_Support = [Reflections] [Emissives] [Subsurface_Scattering] [POM] [Porosity] MATERIAL_AO RESOURCEPACK_SKY
|
screen.Resource_Pack_Support = [Reflections] [Emissives] [Subsurface_Scattering] [POM] [Porosity] MATERIAL_AO RESOURCEPACK_SKY
|
||||||
|
|
||||||
screen.Reflections.columns=2
|
screen.Reflections.columns=2
|
||||||
# screen.Reflections = Specular_Reflections Sun_specular_Strength Screen_Space_Reflections reflection_quality Rough_reflections Roughness_Threshold Sky_reflection Dynamic_SSR_quality
|
|
||||||
screen.Reflections = \
|
screen.Reflections = \
|
||||||
DEFERRED_SPECULAR FORWARD_SPECULAR \
|
DEFERRED_SPECULAR FORWARD_SPECULAR \
|
||||||
DEFERRED_ENVIORNMENT_REFLECTION FORWARD_ENVIORNMENT_REFLECTION \
|
DEFERRED_ENVIORNMENT_REFLECTION FORWARD_ENVIORNMENT_REFLECTION \
|
||||||
|
Reference in New Issue
Block a user