summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/materialDetail.glsl
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-08-10 18:01:13 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2024-08-10 18:10:04 +0100
commit26c60d5ace9b2a0667a930c4c92a3990a1d7d1dc (patch)
tree7244d9e1902d2a2c90ad2e92e00ea53343c288cf /gfx/gl/shaders/materialDetail.glsl
parentPull material detail function into a common file (diff)
downloadilt-26c60d5ace9b2a0667a930c4c92a3990a1d7d1dc.tar.bz2
ilt-26c60d5ace9b2a0667a930c4c92a3990a1d7d1dc.tar.xz
ilt-26c60d5ace9b2a0667a930c4c92a3990a1d7d1dc.zip
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.
Diffstat (limited to 'gfx/gl/shaders/materialDetail.glsl')
-rw-r--r--gfx/gl/shaders/materialDetail.glsl19
1 files changed, 5 insertions, 14 deletions
diff --git a/gfx/gl/shaders/materialDetail.glsl b/gfx/gl/shaders/materialDetail.glsl
index 05cf2c7..a208d50 100644
--- a/gfx/gl/shaders/materialDetail.glsl
+++ b/gfx/gl/shaders/materialDetail.glsl
@@ -1,14 +1,5 @@
-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));
-}
+struct MaterialDetail {
+ vec2 textureOrigin;
+ vec2 textureSize;
+ uvec2 mapmode;
+};