fix DH water rendering over the player. fix DH shadowmap SSS blending. make floodfill work when SSGI/RTAO are enabled.. add player shadow toggle.

This commit is contained in:
Xonk
2024-05-09 19:14:41 -04:00
parent e1787e4355
commit 56389b9eef
8 changed files with 57 additions and 28 deletions

View File

@ -424,7 +424,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
#ifdef DH_OVERDRAW_PREVENTION
float distancefade = min(max(1.0 - length(playerPos)/max(far-16*4,16),0.0)*5,1.0);
if(texture2D(depthtex1, gl_FragCoord.xy*texelSize).x < 1.0 || distancefade > 0.0){
if(texture2D(depthtex0, gl_FragCoord.xy*texelSize).x < 1.0 || distancefade > 0.0){
gl_FragData[0].a = 0.0;
material = 0.0;
}

View File

@ -753,7 +753,6 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
float roughness = pow(1.0-specularValues.r,2.0);
float f0 = isReflective ? max(specularValues.g, 0.02) : specularValues.g;
#ifdef HAND
f0 = max(specularValues.g, 0.02);
#endif
@ -766,8 +765,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 )
vec3 Metals = f0 > 229.5/255.0 ? normalize(Albedo+1e-7) * (dot(Albedo,vec3(0.21, 0.72, 0.07)) * 0.7 + 0.3) : vec3(1.0);
// make sure zero alpha is not forced to be full alpha by fresnel on items with funny normal padding
// if(UnchangedAlpha <= 0.0 && !isReflective) f0 = 0.0;
if(UnchangedAlpha <= 0.0 && !isReflective) f0 = 0.0;
if (f0 > 0.0){

View File

@ -954,15 +954,6 @@ void main() {
float NdotL = 1.0;
float lightLeakFix = clamp(pow(eyeBrightnessSmooth.y/240. + lightmap.y,2.0) ,0.0,1.0);
// #ifdef DISTANT_HORIZONS_SHADOWMAP
// float shadowMapFalloff = pow(1.0-pow(1.0-min(max(1.0 - length(vec3(feetPlayerPos.x,feetPlayerPos.y/1.5,feetPlayerPos.z)) / min(shadowDistance, dhFarPlane),0.0)*5.0,1.0),2.0),2.0);
// #else
// float shadowMapFalloff = pow(1.0-pow(1.0-min(max(1.0 - length(vec3(feetPlayerPos.x,feetPlayerPos.y/1.5,feetPlayerPos.z)) / shadowDistance,0.0)*5.0,1.0),2.0),2.0);
// #endif
// float shadowMapFalloff2 = pow(1.0-pow(1.0-min(max(1.0 - length(vec3(feetPlayerPos.x,feetPlayerPos.y/1.5,feetPlayerPos.z)) / min(shadowDistance,far),0.0)*5.0,1.0),2.0),2.0);
#ifdef OVERWORLD_SHADER
DirectLightColor = lightCol.rgb / 80.0;
AmbientLightColor = averageSkyCol_Clouds / 30.0;
@ -1270,7 +1261,7 @@ void main() {
// RTAO and/or SSGI
#if indirect_effect == 3 || indirect_effect == 4
Indirect_lighting = AmbientLightColor;
ApplySSRT(Indirect_lighting, viewPos, normal, vec3(bnoise, noise_2), lightmap.xy, AmbientLightColor*2.5, vec3(TORCH_R,TORCH_G,TORCH_B), isGrass, hand);
ApplySSRT(Indirect_lighting, viewPos, normal, vec3(bnoise, noise_2), feetPlayerPos, lpvPos, exposure, lightmap.xy, AmbientLightColor*2.5, vec3(TORCH_R,TORCH_G,TORCH_B), isGrass, hand);
#endif
#if defined END_SHADER
@ -1291,7 +1282,6 @@ void main() {
Indirect_SSS *= AO;
// apply to ambient light.
// if(texcoord.x>0.5)
Indirect_lighting = max(Indirect_lighting, Indirect_SSS * ambientColor * ambientsss_brightness);
// #ifdef OVERWORLD_SHADER
@ -1305,9 +1295,10 @@ void main() {
float sunSSS_density = LabSSS;
float SSS_shadow = ShadowAlpha * Shadows;
// #ifdef DISTANT_HORIZONS_SHADOWMAP
// shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / min(shadowDistance,far),0.0)*5.0,1.0));
// #endif
#ifdef DISTANT_HORIZONS_SHADOWMAP
shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / min(shadowDistance, far-16),0.0)*5.0,1.0));
#endif
#ifndef RENDER_ENTITY_SHADOWS
if(entities) sunSSS_density = 0.0;