diff options
Diffstat (limited to 'tests/manual/planets-qml/shaders/gl3/sun.frag')
-rw-r--r-- | tests/manual/planets-qml/shaders/gl3/sun.frag | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/manual/planets-qml/shaders/gl3/sun.frag b/tests/manual/planets-qml/shaders/gl3/sun.frag new file mode 100644 index 000000000..82c5bd035 --- /dev/null +++ b/tests/manual/planets-qml/shaders/gl3/sun.frag @@ -0,0 +1,30 @@ +// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). +// Copyright (C) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#version 150 core + +uniform sampler2D diffuseTexture; + +in vec3 position; +in vec2 texCoord; + +out vec4 fragColor; + +vec4 dModel(const in vec2 flipYTexCoord) +{ + // Lookup diffuse + vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb; + + return vec4(diffuseColor, 1.0); +} + +void main() +{ + vec2 flipYTexCoord = texCoord; + flipYTexCoord.y = 1.0 - texCoord.y; + + vec4 result = dModel(flipYTexCoord); + + fragColor = result; +} |