From 26c60d5ace9b2a0667a930c4c92a3990a1d7d1dc Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 10 Aug 2024 18:01:13 +0100 Subject: Fix texture usage via materials in shadows This is a mess of a commit much like the shader folder, need a better way of dealing with them. --- gfx/gl/shaders/materialCommon.glsl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gfx/gl/shaders/materialCommon.glsl') diff --git a/gfx/gl/shaders/materialCommon.glsl b/gfx/gl/shaders/materialCommon.glsl index a915ce3..3fe2237 100644 --- a/gfx/gl/shaders/materialCommon.glsl +++ b/gfx/gl/shaders/materialCommon.glsl @@ -1,5 +1,3 @@ -layout(binding = 0) uniform sampler2D texture0; - float map(uint mapmode, float value) { @@ -28,8 +26,8 @@ vec4 getTextureColour(MaterialDetail mat, vec2 uv) { if (mat.textureSize.x > 0) { - const vec2 tSize = textureSize(texture0, 0); + const vec2 tSize = textureSize(textureAlbedo, 0); uv = (mat.textureOrigin + mat.textureSize * map(mat.mapmode, uv)) / tSize; } - return texture(texture0, uv); + return texture(textureAlbedo, uv); } -- cgit v1.2.3