improve sky lighting

This commit is contained in:
MihailRis 2026-02-02 18:35:44 +03:00
parent d9a7afad05
commit 3055621894
5 changed files with 14 additions and 7 deletions

View file

@ -13,6 +13,8 @@ layout (location = 4) in vec4 v_normal;
out vec4 a_color;
uniform float u_dayTime;
void main() {
a_modelpos = u_model * vec4(v_position, 1.0);
vec3 pos3d = a_modelpos.xyz - u_cameraPos;
@ -26,7 +28,7 @@ void main() {
a_texCoord = v_texCoord;
a_dir = a_modelpos.xyz - u_cameraPos;
vec3 skyLightColor = pick_sky_color(u_skybox);
vec3 skyLightColor = pick_sky_color(u_skybox, u_dayTime);
a_color.rgb = max(a_color.rgb, skyLightColor.rgb * v_light.a) * v_color;
a_color.a = u_opacity;