diff options
Diffstat (limited to 'slideshow/opengl/basicVertexShader.glsl')
-rw-r--r-- | slideshow/opengl/basicVertexShader.glsl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/slideshow/opengl/basicVertexShader.glsl b/slideshow/opengl/basicVertexShader.glsl index 020616fff872..a4b258c69043 100644 --- a/slideshow/opengl/basicVertexShader.glsl +++ b/slideshow/opengl/basicVertexShader.glsl @@ -28,14 +28,20 @@ #version 120 +uniform mat4 u_sceneTransformMatrix; +uniform mat4 u_primitiveTransformMatrix; +uniform mat4 u_operationsTransformMatrix; + varying vec2 v_texturePosition; varying vec3 v_normal; void main( void ) { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + mat4 modelViewMatrix = gl_ModelViewMatrix * u_operationsTransformMatrix * u_sceneTransformMatrix * u_primitiveTransformMatrix; + mat3 normalMatrix = mat3(transpose(inverse(modelViewMatrix))); + gl_Position = gl_ProjectionMatrix * modelViewMatrix * gl_Vertex; v_texturePosition = gl_MultiTexCoord0.xy; - v_normal = normalize(gl_NormalMatrix * gl_Normal); + v_normal = normalize(normalMatrix * gl_Normal); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |