add projection and modelview matrices to obj shader
This commit is contained in:
1 parent
fb749eef11
commit
4a6d38ddb9
1 file changed
+4
-2
@@ -1,5 +1,7 @@
|
||||
|
||||
uniform float scale;
|
||||
uniform mat4 projection;
|
||||
uniform mat4 modelview;
|
||||
|
||||
attribute vec3 pos;
|
||||
attribute vec3 normal;
|
||||
@@ -9,7 +11,7 @@ varying vec3 normal_i;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_Position = gl_ModelViewProjectionMatrix * vec4(scale * pos, 1);
|
||||
gl_Position = projection * modelview * vec4(scale * pos, 1);
|
||||
pos_i = gl_Position.xyz;
|
||||
normal_i = gl_NormalMatrix * normal;
|
||||
normal_i = modelview * vec4(normal, 1);
|
||||
}
|
||||
Reference in new issue
Block a user