]> git.tdb.fi Git - libs/gl.git/blobdiff - shaderlib/occluder.glsl
Check the flat qualifier from the correct member
[libs/gl.git] / shaderlib / occluder.glsl
index abd29a0aaa07dde0db265fd95eec33d4464aed9d..a4d876ecef40062decfb2cb255b0200980ed3413 100644 (file)
@@ -1,13 +1,14 @@
 import msp_interface;
 
-uniform AlphaCutoff
+layout(set=1) uniform AlphaCutoff
 {
        float alpha_cutoff;
 };
 
-uniform sampler2D alpha_map;
+layout(set=1) uniform sampler2D alpha_map;
 
 layout(constant_id=auto) const bool use_alpha_cutoff = false;
+layout(constant_id=auto) const bool use_instancing = false;
 
 #pragma MSP stage(vertex)
 virtual vec4 get_vertex_position()
@@ -17,7 +18,10 @@ virtual vec4 get_vertex_position()
 
 virtual mat4 get_vertex_transform()
 {
-       return world_obj_matrix;
+       if(use_instancing)
+               return transpose(mat4(instance_transform[0], instance_transform[1], instance_transform[2], vec4(0.0, 0.0, 0.0, 1.0)));
+       else
+               return world_obj_matrix;
 }
 
 virtual void clipping(vec3 eye_vertex)