summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2017-08-02 17:15:57 +0200
committerKevin Ottens <kevin.ottens@kdab.com>2017-09-27 07:22:26 +0000
commitf212c4fb5cbb8e8043faf69a82f249c81cf6368d (patch)
treeef4c1675223e768e1a8c3395c1d62d3006d0b5f8 /src
parent2321b335f066275736802a26a9e7650422def10a (diff)
Remove the *alpha.frag from extras
They are identical to their non-alpha counterparts at that point, so no need to keep them around. Change-Id: Ia3961670dc1d5c0f65711476c8dc6cc467df62c5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/extras/defaults/qnormaldiffusemapalphamaterial.cpp4
-rw-r--r--src/extras/defaults/qphongalphamaterial.cpp4
-rw-r--r--src/extras/extras.qrc4
-rw-r--r--src/extras/shaders/es2/normaldiffusemapalpha.frag34
-rw-r--r--src/extras/shaders/es2/phongalpha.frag20
-rw-r--r--src/extras/shaders/gl3/normaldiffusemapalpha.frag36
-rw-r--r--src/extras/shaders/gl3/phongalpha.frag22
7 files changed, 4 insertions, 120 deletions
diff --git a/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp b/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp
index eb6398341..8393b54df 100644
--- a/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp
+++ b/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp
@@ -83,9 +83,9 @@ void QNormalDiffuseMapAlphaMaterialPrivate::init()
this, &QNormalDiffuseMapMaterialPrivate::handleTextureScaleChanged);
m_normalDiffuseGL3Shader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/gl3/normaldiffusemap.vert"))));
- m_normalDiffuseGL3Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/gl3/normaldiffusemapalpha.frag"))));
+ m_normalDiffuseGL3Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/gl3/normaldiffusemap.frag"))));
m_normalDiffuseGL2ES2Shader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/es2/normaldiffusemap.vert"))));
- m_normalDiffuseGL2ES2Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/es2/normaldiffusemapalpha.frag"))));
+ m_normalDiffuseGL2ES2Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/es2/normaldiffusemap.frag"))));
m_normalDiffuseGL3Technique->graphicsApiFilter()->setApi(QGraphicsApiFilter::OpenGL);
m_normalDiffuseGL3Technique->graphicsApiFilter()->setMajorVersion(3);
diff --git a/src/extras/defaults/qphongalphamaterial.cpp b/src/extras/defaults/qphongalphamaterial.cpp
index 08cf43200..2d35e7386 100644
--- a/src/extras/defaults/qphongalphamaterial.cpp
+++ b/src/extras/defaults/qphongalphamaterial.cpp
@@ -96,9 +96,9 @@ void QPhongAlphaMaterialPrivate::init()
this, &QPhongAlphaMaterialPrivate::handleShininessChanged);
m_phongAlphaGL3Shader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/gl3/phong.vert"))));
- m_phongAlphaGL3Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/gl3/phongalpha.frag"))));
+ m_phongAlphaGL3Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/gl3/phong.frag"))));
m_phongAlphaGL2ES2Shader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/es2/phong.vert"))));
- m_phongAlphaGL2ES2Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/es2/phongalpha.frag"))));
+ m_phongAlphaGL2ES2Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/es2/phong.frag"))));
m_phongAlphaGL3Technique->graphicsApiFilter()->setApi(QGraphicsApiFilter::OpenGL);
m_phongAlphaGL3Technique->graphicsApiFilter()->setMajorVersion(3);
diff --git a/src/extras/extras.qrc b/src/extras/extras.qrc
index 6a51cfea6..7310a7c79 100644
--- a/src/extras/extras.qrc
+++ b/src/extras/extras.qrc
@@ -19,10 +19,8 @@
<file>shaders/es2/diffusemap.frag</file>
<file>shaders/es2/normaldiffusemap.vert</file>
<file>shaders/es2/normaldiffusemap.frag</file>
- <file>shaders/es2/normaldiffusemapalpha.frag</file>
<file>shaders/gl3/normaldiffusemap.frag</file>
<file>shaders/gl3/normaldiffusemap.vert</file>
- <file>shaders/gl3/normaldiffusemapalpha.frag</file>
<file>shaders/es2/diffusespecularmap.frag</file>
<file>shaders/gl3/diffusespecularmap.frag</file>
<file>shaders/gl3/pervertexcolor.frag</file>
@@ -37,8 +35,6 @@
<file>shaders/gl3/gooch.frag</file>
<file>shaders/es2/gooch.frag</file>
<file>shaders/es2/gooch.vert</file>
- <file>shaders/gl3/phongalpha.frag</file>
- <file>shaders/es2/phongalpha.frag</file>
<file>shaders/gl3/unlittexture.vert</file>
<file>shaders/gl3/unlittexture.frag</file>
<file>shaders/es2/unlittexture.frag</file>
diff --git a/src/extras/shaders/es2/normaldiffusemapalpha.frag b/src/extras/shaders/es2/normaldiffusemapalpha.frag
deleted file mode 100644
index 19ca27de8..000000000
--- a/src/extras/shaders/es2/normaldiffusemapalpha.frag
+++ /dev/null
@@ -1,34 +0,0 @@
-#define FP highp
-
-varying FP vec3 worldPosition;
-varying FP vec3 worldNormal;
-varying FP vec4 worldTangent;
-varying FP vec2 texCoord;
-
-uniform sampler2D diffuseTexture;
-uniform sampler2D normalTexture;
-
-// TODO: Replace with a struct
-uniform FP vec4 ka; // Ambient reflectivity
-uniform FP vec4 ks; // Specular reflectivity
-uniform FP float shininess; // Specular shininess factor
-
-uniform FP vec3 eyePosition;
-
-#pragma include light.inc.frag
-#pragma include coordinatesystems.inc
-
-void main()
-{
- // Sample the textures at the interpolated texCoords
- FP vec4 diffuseTextureColor = texture2D( diffuseTexture, texCoord );
- FP vec3 tNormal = 2.0 * texture2D( normalTexture, texCoord ).rgb - vec3( 1.0 );
-
- FP mat3 tangentMatrix = calcWorldSpaceToTangentSpaceMatrix(worldNormal, worldTangent);
- FP mat3 invertTangentMatrix = transpose(tangentMatrix);
-
- FP vec3 wNormal = normalize(invertTangentMatrix * tNormal);
- FP vec3 worldView = normalize(eyePosition - worldPosition);
-
- gl_FragColor = phongFunction(ka, diffuseTextureColor, ks, shininess, worldPosition, worldView, wNormal);
-}
diff --git a/src/extras/shaders/es2/phongalpha.frag b/src/extras/shaders/es2/phongalpha.frag
deleted file mode 100644
index bf41f3c9f..000000000
--- a/src/extras/shaders/es2/phongalpha.frag
+++ /dev/null
@@ -1,20 +0,0 @@
-#define FP highp
-
-// TODO: Replace with a struct
-uniform FP vec4 ka; // Ambient reflectivity
-uniform FP vec4 kd; // Diffuse reflectivity
-uniform FP vec4 ks; // Specular reflectivity
-uniform FP float shininess; // Specular shininess factor
-
-uniform FP vec3 eyePosition;
-
-varying FP vec3 worldPosition;
-varying FP vec3 worldNormal;
-
-#pragma include light.inc.frag
-
-void main()
-{
- FP vec3 worldView = normalize(eyePosition - worldPosition);
- gl_FragColor = phongFunction(ka, kd, ks, shininess, worldPosition, worldView, worldNormal);
-}
diff --git a/src/extras/shaders/gl3/normaldiffusemapalpha.frag b/src/extras/shaders/gl3/normaldiffusemapalpha.frag
deleted file mode 100644
index 1266cafa0..000000000
--- a/src/extras/shaders/gl3/normaldiffusemapalpha.frag
+++ /dev/null
@@ -1,36 +0,0 @@
-#version 150 core
-
-in vec3 worldPosition;
-in vec3 worldNormal;
-in vec4 worldTangent;
-in vec2 texCoord;
-
-uniform sampler2D diffuseTexture;
-uniform sampler2D normalTexture;
-
-// TODO: Replace with a struct
-uniform vec4 ka; // Ambient reflectivity
-uniform vec4 ks; // Specular reflectivity
-uniform float shininess; // Specular shininess factor
-
-uniform vec3 eyePosition;
-
-out vec4 fragColor;
-
-#pragma include light.inc.frag
-#pragma include coordinatesystems.inc
-
-void main()
-{
- // Sample the textures at the interpolated texCoords
- vec4 diffuseTextureColor = texture( diffuseTexture, texCoord );
- vec3 tNormal = 2.0 * texture( normalTexture, texCoord ).rgb - vec3( 1.0 );
-
- mat3 tangentMatrix = calcWorldSpaceToTangentSpaceMatrix(worldNormal, worldTangent);
- mat3 invertTangentMatrix = transpose(tangentMatrix);
-
- vec3 wNormal = normalize(invertTangentMatrix * tNormal);
-
- vec3 worldView = normalize(eyePosition - worldPosition);
- fragColor = phongFunction(ka, diffuseTextureColor, ks, shininess, worldPosition, worldView, wNormal);
-}
diff --git a/src/extras/shaders/gl3/phongalpha.frag b/src/extras/shaders/gl3/phongalpha.frag
deleted file mode 100644
index 0d6bbfd24..000000000
--- a/src/extras/shaders/gl3/phongalpha.frag
+++ /dev/null
@@ -1,22 +0,0 @@
-#version 150 core
-
-// TODO: Replace with a struct
-uniform vec4 ka; // Ambient reflectivity
-uniform vec4 kd; // Diffuse reflectivity
-uniform vec4 ks; // Specular reflectivity
-uniform float shininess; // Specular shininess factor
-
-uniform vec3 eyePosition;
-
-in vec3 worldPosition;
-in vec3 worldNormal;
-
-out vec4 fragColor;
-
-#pragma include light.inc.frag
-
-void main()
-{
- vec3 worldView = normalize(eyePosition - worldPosition);
- fragColor = phongFunction(ka, kd, ks, shininess, worldPosition, worldView, worldNormal);
-}