Update #51 - Protocol and FPS improvements, better workspace

This commit is contained in:
lax1dude
2025-05-18 15:01:06 -07:00
parent 71c61e33fd
commit 325a6826bf
1191 changed files with 9266 additions and 187695 deletions

View File

@ -54,13 +54,12 @@ void main() {
if(u_dynamicLightCount1i > 0) {
vec4 worldPosition4f = u_inverseViewMatrix4f * v_position4f;
worldPosition4f.xyz /= worldPosition4f.w;
vec3 normalVector3f = normalize(u_inverseViewMatrix4f[2].xyz);
int safeLightCount = u_dynamicLightCount1i > 12 ? 0 : u_dynamicLightCount1i;
for(int i = 0; i < safeLightCount; ++i) {
light = u_dynamicLightArray[i];
light.xyz = light.xyz - worldPosition4f.xyz;
len = length(light.xyz);
diffuse += max(dot(light.xyz / len, normalVector3f) * 0.8 + 0.2, 0.0) * max(light.w - len, 0.0);
diffuse += max(light.w - len, 0.0);
}
blockLight = min(blockLight + diffuse * 0.066667, 1.0);
}

View File

@ -145,12 +145,6 @@ void main() {
#endif
#endif
#ifdef COMPILE_NORMAL_ATTRIB
vec3 normal = v_normal3f;
#else
vec3 normal = u_uniformNormal3f;
#endif
#ifdef COMPILE_ENABLE_LIGHTMAP
float diffuse = 0.0;
#ifdef COMPILE_LIGHTMAP_ATTRIB
@ -163,13 +157,12 @@ void main() {
if(u_dynamicLightCount1i > 0) {
vec4 worldPosition4f = u_inverseViewMatrix4f * v_position4f;
worldPosition4f.xyz /= worldPosition4f.w;
vec3 normalVector3f = normalize(mat3(u_inverseViewMatrix4f) * normal);
int safeLightCount = u_dynamicLightCount1i > 12 ? 0 : u_dynamicLightCount1i;
for(int i = 0; i < safeLightCount; ++i) {
light = u_dynamicLightArray[i];
light.xyz = light.xyz - worldPosition4f.xyz;
len = length(light.xyz);
diffuse += max(dot(light.xyz / len, normalVector3f) * 0.8 + 0.2, 0.0) * max(light.w - len, 0.0);
diffuse += max(light.w - len, 0.0);
}
blockLight = min(blockLight + diffuse * 0.066667, 1.0);
}
@ -190,6 +183,12 @@ void main() {
#endif
#ifdef COMPILE_NORMAL_ATTRIB
vec3 normal = v_normal3f;
#else
vec3 normal = u_uniformNormal3f;
#endif
#ifdef COMPILE_ENABLE_MC_LIGHTING
#ifndef COMPILE_ENABLE_LIGHTMAP
vec4 light;