blob: c7ee7e1b759bbb0afeb2bb075c1a38fa511edcb9 (
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
|
// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#version 150 core
// TODO: Replace with a struct
uniform vec3 ka; // Ambient reflectivity
uniform vec3 kd; // Diffuse reflectivity
uniform vec3 ks; // Specular reflectivity
uniform float shininess; // Specular shininess factor
uniform float alpha;
uniform vec3 eyePosition;
in vec3 worldPosition;
in vec3 worldNormal;
out vec4 fragColor;
#pragma include light.inc.frag
void main()
{
vec3 diffuseColor, specularColor;
adsModel(worldPosition, worldNormal, eyePosition, shininess, diffuseColor, specularColor);
fragColor = vec4( ka + kd * diffuseColor + ks * specularColor, alpha );
}
|