summaryrefslogtreecommitdiffstats
path: root/tests/manual/planets-qml/shaders/gl3/sun.frag
blob: d62e87954c78108d5a944ff2376dfd0924c51710 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#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;
}