From 04f3e8ba416ed24a981d5ae74867e084004cb2ae Mon Sep 17 00:00:00 2001 From: Naviary2 Date: Tue, 24 Dec 2024 23:29:58 -0700 Subject: [PATCH] Corrected BIG mistake in the colorProgram_Instanced shader program --- src/client/scripts/esm/game/rendering/shaders.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/scripts/esm/game/rendering/shaders.js b/src/client/scripts/esm/game/rendering/shaders.js index 2554e309..2fa38239 100644 --- a/src/client/scripts/esm/game/rendering/shaders.js +++ b/src/client/scripts/esm/game/rendering/shaders.js @@ -157,7 +157,7 @@ function createColorProgram_Instanced() { void main() { // Add the instance offset to the vertex position - vec4 transformedVertexPosition = aVertexPosition + aInstanceOffset; + vec4 transformedVertexPosition = vec4(aVertexPosition.xyz + aInstanceOffset.xyz, 1.0); gl_Position = uProjMatrix * uViewMatrix * uWorldMatrix * transformedVertexPosition; vColor = aVertexColor; @@ -224,7 +224,7 @@ function createTextureProgram() { out vec4 fragColor; void main(void) { - fragColor = texture(uSampler, vTextureCoord, -0.5); // Apply a mipmap level bias so as to make the textures sharper. (For devices only compatible with WebGL1, their textures will be a little more blurred) + fragColor = texture(uSampler, vTextureCoord, -0.5); // Apply a mipmap level bias so as to make the textures sharper. } `;