From 77738989396b79998d2b494962817376690f78a9 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 12 Nov 2015 09:34:04 +0100 Subject: Rename varyings that clash with three.js' glTFLoader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-49343 Change-Id: Ice78fc0a689251ddd27f1b4cfe9b5ba2a4db0f0f Reviewed-by: Miikka Heikkinen Reviewed-by: Tomi Korpipää --- tools/qgltf/qgltf.cpp | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tools/qgltf/qgltf.cpp b/tools/qgltf/qgltf.cpp index cb30f89e6..6fdd58fdf 100644 --- a/tools/qgltf/qgltf.cpp +++ b/tools/qgltf/qgltf.cpp @@ -1326,15 +1326,15 @@ struct Shader { "$VERSION\n" "$ATTRIBUTE vec3 vertexPosition;\n" "$ATTRIBUTE vec3 vertexNormal;\n" -"$VVARYING vec3 position;\n" -"$VVARYING vec3 normal;\n" +"$VVARYING vec3 vPosition;\n" +"$VVARYING vec3 vNormal;\n" "uniform mat4 projection;\n" "uniform mat4 modelView;\n" "uniform mat3 modelViewNormal;\n" "void main()\n" "{\n" -" normal = normalize( modelViewNormal * vertexNormal );\n" -" position = vec3( modelView * vec4( vertexPosition, 1.0 ) );\n" +" vNormal = normalize( modelViewNormal * vertexNormal );\n" +" vPosition = vec3( modelView * vec4( vertexPosition, 1.0 ) );\n" " gl_Position = projection * modelView * vec4( vertexPosition, 1.0 );\n" "}\n" }, @@ -1347,8 +1347,8 @@ struct Shader { "uniform $HIGHP vec4 kd;\n" "uniform $HIGHP vec3 ks;\n" "uniform $HIGHP float shininess;\n" -"$FVARYING $HIGHP vec3 position;\n" -"$FVARYING $HIGHP vec3 normal;\n" +"$FVARYING $HIGHP vec3 vPosition;\n" +"$FVARYING $HIGHP vec3 vNormal;\n" "$DECL_FRAGCOLOR\n" "$HIGHP vec3 adsModel( const $HIGHP vec3 pos, const $HIGHP vec3 n )\n" "{\n" @@ -1363,7 +1363,7 @@ struct Shader { "}\n" "void main()\n" "{\n" -" $FRAGCOLOR = vec4( adsModel( position, normalize( normal ) ) * kd.a, kd.a );\n" +" $FRAGCOLOR = vec4( adsModel( vPosition, normalize( vNormal ) ) * kd.a, kd.a );\n" "}\n" }, { @@ -1372,17 +1372,17 @@ struct Shader { "$ATTRIBUTE vec3 vertexPosition;\n" "$ATTRIBUTE vec3 vertexNormal;\n" "$ATTRIBUTE vec2 vertexTexCoord;\n" -"$VVARYING vec3 position;\n" -"$VVARYING vec3 normal;\n" -"$VVARYING vec2 texCoord;\n" +"$VVARYING vec3 vPosition;\n" +"$VVARYING vec3 vNormal;\n" +"$VVARYING vec2 vTexCoord;\n" "uniform mat4 projection;\n" "uniform mat4 modelView;\n" "uniform mat3 modelViewNormal;\n" "void main()\n" "{\n" -" texCoord = vertexTexCoord;\n" -" normal = normalize( modelViewNormal * vertexNormal );\n" -" position = vec3( modelView * vec4( vertexPosition, 1.0 ) );\n" +" vTexCoord = vertexTexCoord;\n" +" vNormal = normalize( modelViewNormal * vertexNormal );\n" +" vPosition = vec3( modelView * vec4( vertexPosition, 1.0 ) );\n" " gl_Position = projection * modelView * vec4( vertexPosition, 1.0 );\n" "}\n" }, @@ -1395,9 +1395,9 @@ struct Shader { "uniform $HIGHP vec3 ks;\n" "uniform $HIGHP float shininess;\n" "uniform sampler2D diffuseTexture;\n" -"$FVARYING $HIGHP vec3 position;\n" -"$FVARYING $HIGHP vec3 normal;\n" -"$FVARYING $HIGHP vec2 texCoord;\n" +"$FVARYING $HIGHP vec3 vPosition;\n" +"$FVARYING $HIGHP vec3 vNormal;\n" +"$FVARYING $HIGHP vec2 vTexCoord;\n" "$DECL_FRAGCOLOR\n" "$HIGHP vec4 adsModel( const $HIGHP vec3 pos, const $HIGHP vec3 n )\n" "{\n" @@ -1408,12 +1408,12 @@ struct Shader { " $HIGHP float specular = 0.0;\n" " if ( dot( s, n ) > 0.0 )\n" " specular = pow( max( dot( r, v ), 0.0 ), shininess );\n" -" $HIGHP vec4 kd = $TEXTURE2D( diffuseTexture, texCoord );\n" +" $HIGHP vec4 kd = $TEXTURE2D( diffuseTexture, vTexCoord );\n" " return vec4( lightIntensity * ( ka + kd.rgb * diffuse + ks * specular ) * kd.a, kd.a );\n" "}\n" "void main()\n" "{\n" -" $FRAGCOLOR = adsModel( position, normalize( normal ) );\n" +" $FRAGCOLOR = adsModel( vPosition, normalize( vNormal ) );\n" "}\n" }, { @@ -1425,9 +1425,9 @@ struct Shader { "uniform $HIGHP float shininess;\n" "uniform sampler2D diffuseTexture;\n" "uniform sampler2D specularTexture;\n" -"$FVARYING $HIGHP vec3 position;\n" -"$FVARYING $HIGHP vec3 normal;\n" -"$FVARYING $HIGHP vec2 texCoord;\n" +"$FVARYING $HIGHP vec3 vPosition;\n" +"$FVARYING $HIGHP vec3 vNormal;\n" +"$FVARYING $HIGHP vec2 vTexCoord;\n" "$DECL_FRAGCOLOR\n" "$HIGHP vec4 adsModel( const in $HIGHP vec3 pos, const in $HIGHP vec3 n )\n" "{\n" @@ -1438,13 +1438,13 @@ struct Shader { " $HIGHP float specular = 0.0;\n" " if ( dot( s, n ) > 0.0 )\n" " specular = ( shininess / ( 8.0 * 3.14 ) ) * pow( max( dot( r, v ), 0.0 ), shininess );\n" -" $HIGHP vec4 kd = $TEXTURE2D( diffuseTexture, texCoord );\n" -" $HIGHP vec3 ks = $TEXTURE2D( specularTexture, texCoord );\n" +" $HIGHP vec4 kd = $TEXTURE2D( diffuseTexture, vTexCoord );\n" +" $HIGHP vec3 ks = $TEXTURE2D( specularTexture, vTexCoord );\n" " return vec4( lightIntensity * ( ka + kd.rgb * diffuse + ks * specular ) * kd.a, kd.a );\n" "}\n" "void main()\n" "{\n" -" $FRAGCOLOR = vec4( adsModel( position, normalize( normal ) ), 1.0 );\n" +" $FRAGCOLOR = vec4( adsModel( vPosition, normalize( vNormal ) ), 1.0 );\n" "}\n" }, { -- cgit v1.2.3