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