projects
/
demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed the OpenGL part and the GLSL shaders to use UBO and
[demo]
/
gl_shaders
/
sky.v.glsl
diff --git
a/gl_shaders/sky.v.glsl
b/gl_shaders/sky.v.glsl
index
84097a0
..
f5ba24f
100644
(file)
--- a/
gl_shaders/sky.v.glsl
+++ b/
gl_shaders/sky.v.glsl
@@
-1,6
+1,11
@@
#version 450
#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;
layout(location = 1) in vec3 attr_pos;
layout(location = 2) in vec3 attr_normal;
@@
-9,6
+14,6
@@
out vec3 normal;
void main()
{
void main()
{
- gl_Position = mviewproj * vec4(attr_pos, 1.0);
+ gl_Position = s.mviewproj * vec4(attr_pos, 1.0);
normal = attr_normal;
normal = attr_normal;
-}
\ No newline at end of file
+}