From a39e5a0bc8df00d79773a0cc3318125c736028e4 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 21 Jul 2024 01:44:42 +0100 Subject: Pull material detail function into a common file --- gfx/gl/shaders/commonPoint.glsl | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'gfx/gl/shaders/commonPoint.glsl') diff --git a/gfx/gl/shaders/commonPoint.glsl b/gfx/gl/shaders/commonPoint.glsl index 2d9e388..6272d0b 100644 --- a/gfx/gl/shaders/commonPoint.glsl +++ b/gfx/gl/shaders/commonPoint.glsl @@ -1,17 +1,4 @@ -layout(binding = 1) uniform usampler2DRect materialData; - -MaterialDetail -getMaterialDetail(uint midx) -{ - if (midx > 0u) { - const vec4 sPosSize = texture(materialData, uvec2(0, midx - 1u)); - const uvec4 sMode = texture(materialData, uvec2(1, midx - 1u)); - const uint mapmodeU = sMode.x & 0xFu; - const uint mapmodeV = (sMode.x & 0xF0u) >> 1; - return MaterialDetail(sPosSize.xy, sPosSize.zw, uvec2(mapmodeU, mapmodeV)); - } - return MaterialDetail(vec2(0, 0), vec2(0, 0), uvec2(0, 0)); -} +include(`materialDetail.glsl') void main() -- cgit v1.2.3