summaryrefslogtreecommitdiff
path: root/data/shaders
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2016-04-25 22:07:15 -0400
committerDavid Thompson <dthompson2@worcester.edu>2016-04-25 22:07:15 -0400
commite63e356ec5947f2641b7df33fa47daa782814358 (patch)
treee17cf8eaf2b79cbdabb5c7cb33d736bc27b914b4 /data/shaders
parent9958edd9d61f13b181a9f44ec12f713d5819451a (diff)
render: Use separate model, view, and projection matrices.
* sly/render.scm: Replace 'model-view' procedures with separate 'model' and 'view' procedures. (<graphics>)[model-view]: Delete field. [model, view]: New fields. * sly/render/camera.scm (with-camera): Use separate model/view matrices. * sly/render/shader.scm (%default-shader): Specify model, view, and projection uniforms. * sly/render/sprite-batch.scm (sprite-batch-flush!): Use new model, view, and projection uniforms. * data/shaders/default-vertex.glsl (model, view, projection): New uniforms. (mvp): Delete.
Diffstat (limited to 'data/shaders')
-rw-r--r--data/shaders/default-vertex.glsl6
1 files changed, 4 insertions, 2 deletions
diff --git a/data/shaders/default-vertex.glsl b/data/shaders/default-vertex.glsl
index 11f389f..d2ab135 100644
--- a/data/shaders/default-vertex.glsl
+++ b/data/shaders/default-vertex.glsl
@@ -3,9 +3,11 @@
in vec3 position;
in vec2 tex;
out vec2 frag_tex;
-uniform mat4 mvp;
+uniform mat4 model;
+uniform mat4 view;
+uniform mat4 projection;
void main(void) {
frag_tex = tex;
- gl_Position = mvp * vec4(position.xyz, 1.0);
+ gl_Position = projection * view * model * vec4(position.xyz, 1.0);
}