| 1 |
// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). |
| 2 |
// Copyright (C) 2017 The Qt Company Ltd. |
| 3 |
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 4 |
|
| 5 |
#version 450 core |
| 6 |
|
| 7 |
layout(binding=3) uniform sampler2D diffuseTexture; |
| 8 |
|
| 9 |
layout(location=0) in vec3 position; |
| 10 |
layout(location=1) in vec2 texCoord; |
| 11 |
|
| 12 |
layout(location = 0) out vec4 fragColor; |
| 13 |
|
| 14 |
vec4 dModel(const in vec2 flipYTexCoord) |
| 15 |
{ |
| 16 |
// Lookup diffuse |
| 17 |
vec3 diffuseColor = texture(diffuseTexture, flipYTexCoord).rgb; |
| 18 |
|
| 19 |
return vec4(diffuseColor, 1.0); |
| 20 |
} |
| 21 |
|
| 22 |
void main() |
| 23 |
{ |
| 24 |
vec2 flipYTexCoord = texCoord; |
| 25 |
flipYTexCoord.y = 1.0 - texCoord.y; |
| 26 |
|
| 27 |
vec4 result = dModel(flipYTexCoord); |
| 28 |
|
| 29 |
fragColor = result; |
| 30 |
} |