From 00753d2ed1174ffee13f25e548cd4b70536017f4 Mon Sep 17 00:00:00 2001 From: makamys Date: Fri, 24 Jun 2022 01:51:46 +0200 Subject: Leave alpha out of the fragment shader calculations in pass 1 Improves FPS from 400 to 420 in savanna --- src/main/resources/shaders/chunk.frag | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/main/resources/shaders') diff --git a/src/main/resources/shaders/chunk.frag b/src/main/resources/shaders/chunk.frag index d8ffdcf..1066dc5 100644 --- a/src/main/resources/shaders/chunk.frag +++ b/src/main/resources/shaders/chunk.frag @@ -37,8 +37,13 @@ void main() vec4 colorMult = Color/256.0; vec4 lightyColor = texture(lightTex, (BTexCoord + 8.0) / 256.0); - - vec4 rasterColor = ((texColor * colorMult) * lightyColor); + + vec4 rasterColor = +#ifdef PASS_0 + vec4((texColor.xyz * colorMult.xyz) * lightyColor.xyz, texColor.w); +#else + (texColor * colorMult) * lightyColor; +#endif #ifdef RENDER_FOG FragColor = vec4(mix(FogColor.xyz, rasterColor.xyz, FogFactor), rasterColor.w); -- cgit