mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-14 23:41:50 +00:00
improve sky lighting
This commit is contained in:
parent
d9a7afad05
commit
3055621894
5 changed files with 14 additions and 7 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue