| 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 |
uniform sampler2D diffuseTexture; |
| 6 |
|
| 7 |
varying highp vec3 position; |
| 8 |
varying highp vec2 texCoord; |
| 9 |
|
| 10 |
highp vec4 dModel(const highp vec2 flipYTexCoord) |
| 11 |
{ |
| 12 |
// Lookup diffuse |
| 13 |
highp vec3 diffuseColor = texture2D(diffuseTexture, flipYTexCoord).rgb; |
| 14 |
|
| 15 |
return vec4(diffuseColor, 1.0); |
| 16 |
} |
| 17 |
|
| 18 |
void main() |
| 19 |
{ |
| 20 |
highp vec2 flipYTexCoord = texCoord; |
| 21 |
flipYTexCoord.y = 1.0 - texCoord.y; |
| 22 |
|
| 23 |
highp vec4 result = dModel(flipYTexCoord); |
| 24 |
|
| 25 |
gl_FragColor = result; |
| 26 |
} |