#version 330 core out vec4 FragColor; in vec3 WorldPos; void main() { /* Define colours for the top and bottom of the sky. */ vec3 zenithColor = vec3(0.3, 0.5, 0.8); vec3 horizonColor = vec3(0.7, 0.85, 1.0); float blendFactor = (normalize(WorldPos).y + 1.0) / 2.0; /* Blend the two colours. */ vec3 finalColor = mix(horizonColor, zenithColor, blendFactor); FragColor = vec4(finalColor, 1.0); }