blob: 926807ef3f7a1f20755b534709c7e85eb3cff37f (
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
|
#version 330 core
in vec3 tex_coord;
uniform samplerCube cubeMap;
uniform vec3 skyColor;
out vec4 fragColor;
const float lowerLimit = -50000.f;
const float upperLimit = 50000.f;
void main() {
//fragColor = vec4(1.f);
vec4 finalColor = texture(cubeMap, tex_coord);
// blending bottom of skybox to skyColor
float factor = (tex_coord.y - lowerLimit) / (upperLimit - lowerLimit);
factor = clamp(factor, 0.f, 1.f);
fragColor = finalColor; // mix(vec4(skyColor, 1.f), finalColor, factor);
}
|