Changed the OpenGL part and the GLSL shaders to use UBO and
[demo] / gl_shaders / sky.v.glsl
index 84097a0..f5ba24f 100644 (file)
@@ -1,6 +1,11 @@
 #version 450
 
-uniform mat4 mviewproj;
+#define SKY_MATRIX_UNIFORMS 2
+
+layout(std140, binding = SKY_MATRIX_UNIFORMS) uniform svu {
+       mat4 mviewproj;
+} s;
+
 
 layout(location = 1) in vec3 attr_pos;
 layout(location = 2) in vec3 attr_normal;
@@ -9,6 +14,6 @@ out vec3 normal;
 
 void main()
 {
-       gl_Position = mviewproj * vec4(attr_pos, 1.0);
+       gl_Position = s.mviewproj * vec4(attr_pos, 1.0);
        normal = attr_normal;
-}
\ No newline at end of file
+}