[Libreoffice-commits] core.git: Branch 'feature/opengl-canvas-rework' - canvas/opengl

Michael Jaumann meta_dev at yahoo.com
Thu Oct 23 06:30:28 PDT 2014


 canvas/opengl/simpleVertexShader.glsl           |    7 ++++---
 canvas/opengl/texVertexShader.glsl              |    4 +++-
 canvas/opengl/textManipulatingVertexShader.glsl |    5 +++--
 3 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 9967a0b20acb16cdf9ada926d67ac16448ce8c40
Author: Michael Jaumann <meta_dev at yahoo.com>
Date:   Thu Oct 23 12:57:00 2014 +0000

    vertex shaders live now in the MVP space
    
    Change-Id: I36dcecabe79bbd1c29d4148dd01a47483450eb85

diff --git a/canvas/opengl/simpleVertexShader.glsl b/canvas/opengl/simpleVertexShader.glsl
index 56ad104..0aa110f 100644
--- a/canvas/opengl/simpleVertexShader.glsl
+++ b/canvas/opengl/simpleVertexShader.glsl
@@ -9,12 +9,13 @@
 attribute vec2 vPosition;
 attribute vec2 UV;
 varying vec2 textCoords;
+uniform mat4 MVP;
 
 void main(void)
 {
-    gl_Position =  vec4(vPosition,1,1);	
-
-     textCoords = UV;
+    vec4 v =  vec4(vPosition,1,1);	
+    gl_Position = MVP * v;
+    textCoords = UV;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/canvas/opengl/texVertexShader.glsl b/canvas/opengl/texVertexShader.glsl
index e7b2566..c359f11 100644
--- a/canvas/opengl/texVertexShader.glsl
+++ b/canvas/opengl/texVertexShader.glsl
@@ -7,10 +7,12 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 attribute vec2 vPosition;
+uniform mat4 MVP;
 
 void main(void)
 {
-    gl_Position =  vec4(vPosition,1,1);	
+     vec4 v =  vec4(vPosition,1,1);	
+     gl_Position = MVP * v;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/canvas/opengl/textManipulatingVertexShader.glsl b/canvas/opengl/textManipulatingVertexShader.glsl
index 8ebeae9..dfe10d2 100644
--- a/canvas/opengl/textManipulatingVertexShader.glsl
+++ b/canvas/opengl/textManipulatingVertexShader.glsl
@@ -9,11 +9,12 @@
 attribute vec2 vPosition;
 varying vec2 textCoords;
 uniform vec2 texCord;
+uniform mat4 MVP;
 
 void main(void)
 {
-    gl_Position =  vec4(vPosition,1,1);	
-
+     vec4 v =  vec4(vPosition,1,1);	
+     gl_Position = MVP * v;
      textCoords = vPosition/texCord;
 }
 


More information about the Libreoffice-commits mailing list