blob: 3c9f33bd3a026287471a1b2ca8e4c87677e9eec0 (
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
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// 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 450 core
layout(location=0) in vec3 vertexPosition;
layout(location=1) in vec3 vertexNormal;
layout(location=2) in vec2 vertexTexCoord;
layout(location=0) out vec3 position;
layout(location=1) out vec3 normal;
layout(location=2) out vec2 texCoord;
layout(std140, binding = 1) uniform qt3d_command_uniforms {
mat4 modelMatrix;
mat4 inverseModelMatrix;
mat4 modelViewMatrix;
mat3 modelNormalMatrix;
mat4 inverseModelViewMatrix;
mat4 modelViewProjection;
mat4 inverseModelViewProjectionMatrix;
};
layout(std140, binding = 2) uniform extras_uniforms {
float texCoordScale;
vec3 ka; // Ambient reflectivity
vec3 ks; // Specular reflectivity
float shininess; // Specular shininess factor
float opacity; // Alpha channel
vec3 lightPosition;
vec3 lightIntensity;
};
void main()
{
texCoord = vertexTexCoord * texCoordScale;
normal = normalize(modelNormalMatrix * vertexNormal);
position = vec3(modelViewMatrix * vec4(vertexPosition, 1.0));
gl_Position = modelViewProjection * vec4(vertexPosition, 1.0);
}
|