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

@ -8,8 +8,8 @@
#define CURVATURE_FACTOR 0.002
// lighting
#define SKY_LIGHT_MUL 2.9
#define SKY_LIGHT_TINT (vec3(1.0, 0.95, 0.9) * 2.0)
#define SKY_LIGHT_MUL 2.5
#define SKY_LIGHT_TINT (vec3(1.0, 0.75, 0.6) * 2.0)
#define MIN_SKY_LIGHT vec3(0.2, 0.25, 0.33)
// fog

View file

@ -3,8 +3,9 @@
#include <constants>
vec3 pick_sky_color(samplerCube cubemap) {
vec3 skyLightColor = texture(cubemap, vec3(0.4f, 0.05f, 0.4f)).rgb;
vec3 pick_sky_color(samplerCube cubemap, float dayTime) {
float elevation = sin(dayTime * PI2) * 0.2;
vec3 skyLightColor = texture(cubemap, vec3(0.0f, elevation, -0.4f)).rgb;
skyLightColor *= SKY_LIGHT_TINT;
skyLightColor = min(vec3(1.0f), skyLightColor * SKY_LIGHT_MUL);
skyLightColor = max(MIN_SKY_LIGHT, skyLightColor);