aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2012-04-13 16:11:28 -0400
committerEhsan Akhgari <ehsan.akhgari@gmail.com>2012-04-13 16:11:28 -0400
commit5f2b6215fc0a9aeb12692bed0722e41f816c5770 (patch)
tree43fb2089f1fef5b25f2ebf97eb3cbd3e2b1e823f
parent740ba04b4a6ab38a48d65d25343c88c9422fa34d (diff)
Make sure that we treat position as a vec3
-rw-r--r--src/library_gl.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 6c4b78ba..00049d76 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -1046,14 +1046,14 @@ var LibraryGL = {
initted: false,
init: function() {
this.vertexShader = Module.ctx.createShader(Module.ctx.VERTEX_SHADER);
- Module.ctx.shaderSource(this.vertexShader, 'attribute vec4 a_position; \n\
+ Module.ctx.shaderSource(this.vertexShader, 'attribute vec3 a_position; \n\
attribute vec2 a_texCoord; \n\
varying vec2 v_texCoord; \n\
uniform mat4 u_modelView; \n\
uniform mat4 u_projection; \n\
void main() \n\
{ \n\
- gl_Position = u_projection * (u_modelView * a_position); \n\
+ gl_Position = u_projection * (u_modelView * vec4(a_position, 1.0)); \n\
v_texCoord = a_texCoord; \n\
} \n');
Module.ctx.compileShader(this.vertexShader);