summaryrefslogtreecommitdiff
path: root/chart2/opengl
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-08-15 06:26:02 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-09-02 01:08:42 +0200
commit249c5e0f211bbdcbffda91a446dedd33c314ee64 (patch)
treecc42427e7969c7a1e6bdb0fb242f17a4766398bd /chart2/opengl
parentfbddfdecccb9411ec40bb9d89f6bf8ed86cd423f (diff)
replace all attribute and varying in chart shaders
Next step to a pure OpenGL 3.2 core context. Change-Id: Ifcfccd9ffc8adcc3b7338e10cb25aeb8496909a3
Diffstat (limited to 'chart2/opengl')
-rw-r--r--chart2/opengl/backgroundFragmentShader.glsl2
-rw-r--r--chart2/opengl/backgroundVertexShader.glsl6
-rw-r--r--chart2/opengl/commonFragmentShader.glsl2
-rw-r--r--chart2/opengl/commonVertexShader.glsl4
-rw-r--r--chart2/opengl/debugFragmentShader.glsl2
-rw-r--r--chart2/opengl/debugVertexShader.glsl4
-rw-r--r--chart2/opengl/pickingFragmentShader.glsl4
-rw-r--r--chart2/opengl/pickingVertexShader.glsl6
-rw-r--r--chart2/opengl/renderTextureFragmentShader.glsl5
-rw-r--r--chart2/opengl/renderTextureVertexShader.glsl6
-rw-r--r--chart2/opengl/screenTextFragmentShader.glsl2
-rw-r--r--chart2/opengl/screenTextVertexShader.glsl6
-rw-r--r--chart2/opengl/shape3DFragmentShaderV300.glsl4
-rw-r--r--chart2/opengl/shape3DVertexShaderV300.glsl8
-rw-r--r--chart2/opengl/symbolFragmentShader.glsl2
-rw-r--r--chart2/opengl/symbolVertexShader.glsl4
-rw-r--r--chart2/opengl/textFragmentShader.glsl2
-rw-r--r--chart2/opengl/textVertexShader.glsl6
18 files changed, 38 insertions, 37 deletions
diff --git a/chart2/opengl/backgroundFragmentShader.glsl b/chart2/opengl/backgroundFragmentShader.glsl
index 646dd4fe1633..eb3adaae6d91 100644
--- a/chart2/opengl/backgroundFragmentShader.glsl
+++ b/chart2/opengl/backgroundFragmentShader.glsl
@@ -9,7 +9,7 @@
#version 150 core core
-varying vec4 fragmentColor;
+in vec4 fragmentColor;
void main()
{
diff --git a/chart2/opengl/backgroundVertexShader.glsl b/chart2/opengl/backgroundVertexShader.glsl
index 3f2ae8efdf49..bf7937cafffd 100644
--- a/chart2/opengl/backgroundVertexShader.glsl
+++ b/chart2/opengl/backgroundVertexShader.glsl
@@ -9,10 +9,10 @@
#version 150 core
-attribute vec3 vPosition;
+in vec3 vPosition;
uniform mat4 MVP;
-attribute vec4 vColor;
-varying vec4 fragmentColor;
+in vec4 vColor;
+out vec4 fragmentColor;
void main()
{
diff --git a/chart2/opengl/commonFragmentShader.glsl b/chart2/opengl/commonFragmentShader.glsl
index 2f573adf1ef8..d602b21a3488 100644
--- a/chart2/opengl/commonFragmentShader.glsl
+++ b/chart2/opengl/commonFragmentShader.glsl
@@ -9,7 +9,7 @@
#version 150 core
-varying vec4 fragmentColor;
+in vec4 fragmentColor;
void main()
{
diff --git a/chart2/opengl/commonVertexShader.glsl b/chart2/opengl/commonVertexShader.glsl
index f48b4d06a355..145d4db2fcae 100644
--- a/chart2/opengl/commonVertexShader.glsl
+++ b/chart2/opengl/commonVertexShader.glsl
@@ -9,10 +9,10 @@
#version 150 core
-attribute vec3 vPosition;
+in vec3 vPosition;
uniform mat4 MVP;
uniform vec4 vColor;
-varying vec4 fragmentColor;
+out vec4 fragmentColor;
void main()
{
diff --git a/chart2/opengl/debugFragmentShader.glsl b/chart2/opengl/debugFragmentShader.glsl
index d9255eb80a7e..92b005edc862 100644
--- a/chart2/opengl/debugFragmentShader.glsl
+++ b/chart2/opengl/debugFragmentShader.glsl
@@ -9,7 +9,7 @@
#version 150 core
-varying vec4 fragmentColor;
+in vec4 fragmentColor;
void main()
{
diff --git a/chart2/opengl/debugVertexShader.glsl b/chart2/opengl/debugVertexShader.glsl
index 1768cc8b2750..a542da88b911 100644
--- a/chart2/opengl/debugVertexShader.glsl
+++ b/chart2/opengl/debugVertexShader.glsl
@@ -9,9 +9,9 @@
#version 150 core
-attribute vec3 vPosition;
+in vec3 vPosition;
uniform vec4 vColor;
-varying vec4 fragmentColor;
+out vec4 fragmentColor;
void main()
{
diff --git a/chart2/opengl/pickingFragmentShader.glsl b/chart2/opengl/pickingFragmentShader.glsl
index 749fefce624c..d9e06a6ea015 100644
--- a/chart2/opengl/pickingFragmentShader.glsl
+++ b/chart2/opengl/pickingFragmentShader.glsl
@@ -10,8 +10,8 @@
#version 150 core
uniform float minCoordX;
-varying vec3 positionWorldspace;
-varying vec4 fragmentColor;
+in vec3 positionWorldspace;
+in vec4 fragmentColor;
void main()
{
diff --git a/chart2/opengl/pickingVertexShader.glsl b/chart2/opengl/pickingVertexShader.glsl
index c0096917cb97..9dc5a1463a23 100644
--- a/chart2/opengl/pickingVertexShader.glsl
+++ b/chart2/opengl/pickingVertexShader.glsl
@@ -9,14 +9,14 @@
#version 150 core
-attribute vec3 vPosition;
+in vec3 vPosition;
uniform mat4 MVP;
uniform mat4 M;
uniform vec4 vColor;
uniform float minCoordX;
uniform float maxCoordX;
-varying vec4 fragmentColor;
-varying vec3 positionWorldspace;
+out vec4 fragmentColor;
+out vec3 positionWorldspace;
void main()
{
positionWorldspace = (M * vec4(vPosition,1)).xyz;
diff --git a/chart2/opengl/renderTextureFragmentShader.glsl b/chart2/opengl/renderTextureFragmentShader.glsl
index c037456095c7..52dfde821a7d 100644
--- a/chart2/opengl/renderTextureFragmentShader.glsl
+++ b/chart2/opengl/renderTextureFragmentShader.glsl
@@ -10,11 +10,12 @@
#version 150 core
uniform sampler2D RenderTex;
-varying vec2 vTexCoord;
+in vec2 vTexCoord;
+out vec4 actualColor;
void main()
{
- gl_FragColor = vec4(texture2D(RenderTex, vTexCoord).rgb, 1.0);
+ actualColor = vec4(texture(RenderTex, vTexCoord).rgb, 1.0);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/opengl/renderTextureVertexShader.glsl b/chart2/opengl/renderTextureVertexShader.glsl
index 80560cfe11fb..b9307fb32527 100644
--- a/chart2/opengl/renderTextureVertexShader.glsl
+++ b/chart2/opengl/renderTextureVertexShader.glsl
@@ -9,9 +9,9 @@
#version 150 core
-attribute vec4 vPosition;
-attribute vec2 texCoord;
-varying vec2 vTexCoord;
+in vec4 vPosition;
+in vec2 texCoord;
+out vec2 vTexCoord;
void main()
{
gl_Position = vPosition;
diff --git a/chart2/opengl/screenTextFragmentShader.glsl b/chart2/opengl/screenTextFragmentShader.glsl
index b5b69c90aa9f..7c90ec0e3eb0 100644
--- a/chart2/opengl/screenTextFragmentShader.glsl
+++ b/chart2/opengl/screenTextFragmentShader.glsl
@@ -9,7 +9,7 @@
#version 150 core
-varying vec2 vTexCoord;
+in vec2 vTexCoord;
uniform sampler2D TextTex;
uniform vec4 textColor;
void main()
diff --git a/chart2/opengl/screenTextVertexShader.glsl b/chart2/opengl/screenTextVertexShader.glsl
index ab3fb9259172..b0ab221cb032 100644
--- a/chart2/opengl/screenTextVertexShader.glsl
+++ b/chart2/opengl/screenTextVertexShader.glsl
@@ -9,9 +9,9 @@
#version 150 core
-attribute vec3 vPosition;
-attribute vec2 texCoord;
-varying vec2 vTexCoord;
+in vec3 vPosition;
+in vec2 texCoord;
+out vec2 vTexCoord;
void main()
{
gl_Position = vec4(vPosition, 1);
diff --git a/chart2/opengl/shape3DFragmentShaderV300.glsl b/chart2/opengl/shape3DFragmentShaderV300.glsl
index c9d4522c6eca..9a8ddeaa9b54 100644
--- a/chart2/opengl/shape3DFragmentShaderV300.glsl
+++ b/chart2/opengl/shape3DFragmentShaderV300.glsl
@@ -11,8 +11,8 @@
#define MAX_LIGHT_NUM 8
-varying vec3 positionWorldspace;
-varying vec3 normalCameraspace;
+in vec3 positionWorldspace;
+in vec3 normalCameraspace;
uniform mat4 V;
uniform vec4 materialAmbient;
diff --git a/chart2/opengl/shape3DVertexShaderV300.glsl b/chart2/opengl/shape3DVertexShaderV300.glsl
index 947ee5fde602..c5072fd0b55e 100644
--- a/chart2/opengl/shape3DVertexShaderV300.glsl
+++ b/chart2/opengl/shape3DVertexShaderV300.glsl
@@ -9,11 +9,11 @@
#version 150 core
-attribute vec3 vertexPositionModelspace;
-attribute vec3 vertexNormalModelspace;
+in vec3 vertexPositionModelspace;
+in vec3 vertexNormalModelspace;
-varying vec3 positionWorldspace;
-varying vec3 normalCameraspace;
+out vec3 positionWorldspace;
+out vec3 normalCameraspace;
uniform mat4 P;
uniform mat4 M;
diff --git a/chart2/opengl/symbolFragmentShader.glsl b/chart2/opengl/symbolFragmentShader.glsl
index 4b0b464a3622..35cc9106770f 100644
--- a/chart2/opengl/symbolFragmentShader.glsl
+++ b/chart2/opengl/symbolFragmentShader.glsl
@@ -9,7 +9,7 @@
#version 150 core
-varying vec4 fragmentColor;
+in vec4 fragmentColor;
uniform int shape;
void main()
diff --git a/chart2/opengl/symbolVertexShader.glsl b/chart2/opengl/symbolVertexShader.glsl
index 7e3a7488daa9..c5603b5e79d1 100644
--- a/chart2/opengl/symbolVertexShader.glsl
+++ b/chart2/opengl/symbolVertexShader.glsl
@@ -9,10 +9,10 @@
#version 150 core
-attribute vec3 vPosition;
+in vec3 vPosition;
uniform mat4 MVP;
uniform vec4 vColor;
-varying vec4 fragmentColor;
+out vec4 fragmentColor;
void main()
{
diff --git a/chart2/opengl/textFragmentShader.glsl b/chart2/opengl/textFragmentShader.glsl
index 4f582a4117fb..1c3af260c9a4 100644
--- a/chart2/opengl/textFragmentShader.glsl
+++ b/chart2/opengl/textFragmentShader.glsl
@@ -10,7 +10,7 @@
#version 150 core
uniform sampler2D TextTex;
-varying vec2 vTexCoord;
+in vec2 vTexCoord;
void main()
{
vec3 color = texture2D(TextTex, vTexCoord).rgb;
diff --git a/chart2/opengl/textVertexShader.glsl b/chart2/opengl/textVertexShader.glsl
index 3f14ab96800c..351da30b5f79 100644
--- a/chart2/opengl/textVertexShader.glsl
+++ b/chart2/opengl/textVertexShader.glsl
@@ -9,10 +9,10 @@
#version 150 core
-attribute vec3 vPosition;
+in vec3 vPosition;
uniform mat4 MVP;
-attribute vec2 texCoord;
-varying vec2 vTexCoord;
+in vec2 texCoord;
+out vec2 vTexCoord;
void main()
{
gl_Position = MVP * vec4(vPosition, 1);