mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 23:11:49 +00:00
improve sky lighting
This commit is contained in:
parent
d9a7afad05
commit
3055621894
5 changed files with 14 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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