diff options
author | Robert Brock <robert.brock@kdab.com> | 2017-01-09 08:10:57 +0000 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2017-05-16 10:02:58 +0000 |
commit | 4b3f368aba47d559040c3f038620883462b925ea (patch) | |
tree | 1829f28a84bddde1b0b3469d1d2a91c368d7ec0e /examples/qt3d/planets-qml/shaders | |
parent | 7261606116768d563c0e49a23ca60ab367a4cab5 (diff) |
Replace undistributable files
The texture files used were from a third party that didn't explicitly
allow their distribution. All of them have been replaced by textures
from NASA and another third party that do allow their distribution
and editing.
Task-number: QTBUG-57543
Change-Id: I69f1309424bba029cdce08689ea8670ed32d44ae
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'examples/qt3d/planets-qml/shaders')
-rw-r--r-- | examples/qt3d/planets-qml/shaders/gl3/planetDSB.frag | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/qt3d/planets-qml/shaders/gl3/planetDSB.frag b/examples/qt3d/planets-qml/shaders/gl3/planetDSB.frag index 507d1d208..bf6461191 100644 --- a/examples/qt3d/planets-qml/shaders/gl3/planetDSB.frag +++ b/examples/qt3d/planets-qml/shaders/gl3/planetDSB.frag @@ -70,13 +70,13 @@ in vec2 texCoord; out vec4 fragColor; -void dsbModel(const in vec3 norm, const in vec2 flipYTexCoord, out vec3 ambientAndDiff, out vec3 spec) +void dsbModel(const in vec3 norm, const in vec2 flipXTexCoord, out vec3 ambientAndDiff, out vec3 spec) { // Reflection of light direction about normal vec3 r = reflect(-lightDir, norm); - vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb; - vec3 specularColor = texture(specularTexture, flipYTexCoord).rgb; + vec3 diffuseColor = texture(diffuseTexture, flipXTexCoord).rgb; + vec3 specularColor = texture(specularTexture, flipXTexCoord).rgb; // Calculate the ambient contribution vec3 ambient = lightIntensity * ka * diffuseColor; @@ -98,15 +98,15 @@ void dsbModel(const in vec3 norm, const in vec2 flipYTexCoord, out vec3 ambientA void main() { - vec2 flipYTexCoord = texCoord; - flipYTexCoord.y = 1.0 - texCoord.y; + vec2 flipXTexCoord = texCoord; + flipXTexCoord.x = 1.0 - texCoord.x; // Sample the textures at the interpolated texCoords - vec4 normal = 2.0 * texture(normalTexture, flipYTexCoord) - vec4(1.0); + vec4 normal = 2.0 * texture(normalTexture, flipXTexCoord) - vec4(1.0); // Calculate the lighting model, keeping the specular component separate vec3 ambientAndDiff, spec; - dsbModel(normalize(normal.xyz), flipYTexCoord, ambientAndDiff, spec); + dsbModel(normalize(normal.xyz), flipXTexCoord, ambientAndDiff, spec); vec3 result = ambientAndDiff + spec; // Combine spec with ambient+diffuse for final fragment color |