]> git.lizzy.rs Git - dragonblocks_alpha.git/blob - shaders/sky/skybox/fragment.glsl
e8c42306a4b7eeb52982cd7c726de06b846f1176
[dragonblocks_alpha.git] / shaders / sky / skybox / fragment.glsl
1 in vec3 fragmentTextureCoords;
2
3 out vec4 outColor;
4
5 uniform bool transparency;
6 uniform float daylight;
7 uniform samplerCube textures[2];
8
9 void main()
10 {
11         outColor = mix(texture(textures[1], fragmentTextureCoords), texture(textures[0], fragmentTextureCoords), daylight);
12
13         if (transparency) {
14                 float f = 0.2;
15                 float e = 2.0;
16
17                 outColor.a = pow((outColor.r + outColor.g) / 2.0 + f, e) / pow(1.0 + f, e);
18         }
19 }