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

@ -69,15 +69,44 @@ vec3 DoAmbientLightColor(
return IndirectLight + TorchLight * TorchBrightness_autoAdjust;
}
// this is dumb, and i plan to remove it eventually...
vec4 RT_AmbientLight(
vec3 TorchColor,
vec2 Lightmap
vec3 playerPos,
vec3 lpvPos,
float Exposure,
vec2 Lightmap,
vec3 TorchColor
){
float skyLM = (pow(Lightmap.y,15.0)*2.0 + pow(Lightmap.y,2.5))*0.5;
float TorchLM = 10.0 - ( 1.0 / (pow(exp(-0.5*inversesqrt(Lightmap.x)),5.0)+0.1));
TorchLM = pow(TorchLM/4,10) + pow(Lightmap.x,1.5)*0.5;
vec3 TorchLight = TorchColor * TORCH_AMOUNT * TorchLM;
// do torch lighting
float TorchLM = pow(1.0-sqrt(1.0-clamp(Lightmap.x,0.0,1.0)),2.0) * 2.0;
float TorchBrightness_autoAdjust = mix(1.0, 30.0, clamp(exp(-10.0*Exposure),0.0,1.0)) ;
vec3 TorchLight = TorchColor * TorchLM * TORCH_AMOUNT ;
#if defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store
vec4 lpvSample = SampleLpvLinear(lpvPos);
vec3 LpvTorchLight = GetLpvBlockLight(lpvSample);
// i gotchu
float fadeLength = 10.0; // in blocks
vec3 cubicRadius = clamp( min(((LpvSize3-1.0) - lpvPos)/fadeLength, lpvPos/fadeLength) ,0.0,1.0);
float LpvFadeF = cubicRadius.x*cubicRadius.y*cubicRadius.z;
LpvFadeF = 1.0 - pow(1.0-pow(LpvFadeF,1.5),3.0); // make it nice and soft :)
TorchLight = mix(TorchLight,LpvTorchLight/5.0, LpvFadeF);
const vec3 normal = vec3(0.0); // TODO
if (heldItemId > 0)
TorchLight += GetHandLight(heldItemId, playerPos, normal);
if (heldItemId2 > 0)
TorchLight += GetHandLight(heldItemId2, playerPos, normal);
#endif
return vec4(TorchLight, skyLM);
}

View File

@ -296,8 +296,12 @@ void ApplySSRT(
vec3 viewPos,
vec3 normal,
vec3 noise,
vec3 playerPos,
vec3 lpvPos,
float Exposure,
vec2 lightmaps,
vec3 skylightcolor,
vec3 torchcolor,
@ -315,7 +319,7 @@ void ApplySSRT(
vec3 skycontribution2 = vec3(0.0);
// rgb = torch color * lightmap. a = sky lightmap.
vec4 Lighting = RT_AmbientLight(torchcolor, lightmaps);
vec4 Lighting = RT_AmbientLight(playerPos, lpvPos, Exposure, lightmaps, torchcolor);
skylightcolor = skylightcolor * ambient_brightness * Lighting.a;
for (int i = 0; i < nrays; i++){

View File

@ -132,6 +132,8 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0.
#define RENDER_ENTITY_SHADOWS
#define RENDER_PLAYER_SHADOWS
#define SCREENSPACE_CONTACT_SHADOWS
#define Variable_Penumbra_Shadows
@ -746,4 +748,6 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
#if DH_KNOWN_ISSUES == 0
#endif
#ifdef PARTICLE_RENDERING_FIX
#endif
#ifdef RENDER_PLAYER_SHADOWS
#endif