Update #47 - Singleplayer lag fixes

This commit is contained in:
lax1dude
2025-01-19 13:26:27 -08:00
parent 3f5ee57068
commit 1f0d593a8c
2052 changed files with 133581 additions and 2339 deletions

View File

@ -47,7 +47,7 @@ void main() {
vec3 materialData3f;
float depth = textureLod(u_gbufferDepthTexture, v_position2f, 0.0).r;
if(depth < 0.00001) {
if(depth == 0.0) {
discard;
}
@ -59,11 +59,14 @@ void main() {
worldSpacePosition = u_inverseViewMatrix4f * worldSpacePosition;
vec3 lightDist = (worldSpacePosition.xyz / worldSpacePosition.w) - u_lightPosition3f;
vec3 color3f = u_lightColor3f / dot(lightDist, lightDist);
float cm = color3f.r + color3f.g + color3f.b;
if(color3f.r + color3f.g + color3f.b < 0.025) {
if(cm < 0.025) {
discard;
}
color3f *= ((cm - 0.025) / cm);
vec4 sampleVar4f = textureLod(u_gbufferColorTexture, v_position2f, 0.0);
diffuseColor3f.rgb = sampleVar4f.rgb;
lightmapCoords2f.x = sampleVar4f.a;