summaryrefslogtreecommitdiff
path: root/gfx/gl/shaders/materialInterface.glsl
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-04-27 18:36:45 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-04-27 18:36:45 +0100
commit6ed208747005774f3fbc90256b9da0c6890a0814 (patch)
treeb10a7a2a23bdfad799fb108687108798561ed866 /gfx/gl/shaders/materialInterface.glsl
parentMerge branch 'instancing-pt2' (diff)
downloadilt-6ed208747005774f3fbc90256b9da0c6890a0814.tar.bz2
ilt-6ed208747005774f3fbc90256b9da0c6890a0814.tar.xz
ilt-6ed208747005774f3fbc90256b9da0c6890a0814.zip
Lookup material details once in the vertex shader
... instead of per texel in the fragment shader
Diffstat (limited to 'gfx/gl/shaders/materialInterface.glsl')
-rw-r--r--gfx/gl/shaders/materialInterface.glsl8
1 files changed, 7 insertions, 1 deletions
diff --git a/gfx/gl/shaders/materialInterface.glsl b/gfx/gl/shaders/materialInterface.glsl
index 5735cf9..3a4796b 100644
--- a/gfx/gl/shaders/materialInterface.glsl
+++ b/gfx/gl/shaders/materialInterface.glsl
@@ -1,7 +1,13 @@
+struct MaterialDetail {
+ vec2 textureOrigin;
+ vec2 textureSize;
+ uvec2 mapmode;
+};
+
ifelse(TYPE, .fs, in, out) vec3 FragPos;
ifelse(TYPE, .fs, in, out) vec2 TexCoords;
ifelse(TYPE, .fs, in, out) vec3 Normal;
ifelse(TYPE, .fs, in, out) vec4 Colour;
flat
ifelse(TYPE, .fs, in, out)
-uint Material;
+MaterialDetail Material;