Shader lighting, fixes for loosing tasks in MultiThreadPrioritySemaphore, limit render generation rebuilds based on model queue and failure rate, fix native memory leak in ModelFactory (related to raw download stream)

This commit is contained in:
mcrcortex
2025-10-31 20:02:38 +10:00
parent 86882d5ac9
commit 5baf4ce2db
10 changed files with 70 additions and 37 deletions

View File

@@ -54,7 +54,7 @@ uint getFace() {
#ifdef PATCHED_SHADER
vec2 getLightmap() {
//return clamp(vec2(interData.y&0xFu, (interData.y>>4)&0xFu)/16, vec2(4.0f/255), vec2(252.0f/255));
return vec2(interData.y&0xFu, (interData.y>>4)&0xFu)/15;
return clamp((vec2((interData.y>>4)&0xFu, interData.y&0xFu))/16, vec2(8.0f/256), vec2(248.0f/256));
}
#endif
@@ -190,7 +190,9 @@ void main() {
tint = uint2vec4RGBA(interData.z).yzwx;
}
voxy_emitFragment(VoxyFragmentParameters(colour, tile, texPos, getFace(), modelId, getLightmap().yx, tint, model.customId));
uint face = getFace();
face ^= uint((face&1u)!=uint(gl_FrontFacing!=((face>>1)!=0u)));
voxy_emitFragment(VoxyFragmentParameters(colour, tile, texPos, face, modelId, getLightmap(), tint, model.customId));
#endif
}