2 * \file skybox_frag.glsl
3 * \brief Skybox fragment shader.
8 smooth in vec3 texCoord0;
10 uniform samplerCube texture0;
11 uniform mat4 colorMatrix;
17 vec4 color = texture(texture0, texCoord0);
19 // transform color by color matrix
20 vec4 transformedColor = colorMatrix * vec4(color.rgb, 1.);
21 transformedColor /= transformedColor.a; // perspective division
23 // set final fragment color
24 fragColor = clamp(vec4(transformedColor.rgb, color.a), 0., 1.);