mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
improve sky lighting
This commit is contained in:
parent
d9a7afad05
commit
3055621894
5 changed files with 14 additions and 7 deletions
|
|
@ -12,6 +12,8 @@ layout (location = 3) in vec4 v_normal;
|
|||
|
||||
out vec4 a_torchLight;
|
||||
|
||||
uniform float u_dayTime;
|
||||
|
||||
void main() {
|
||||
a_modelpos = u_model * vec4(v_position, 1.0f);
|
||||
vec3 pos3d = a_modelpos.xyz - u_cameraPos;
|
||||
|
|
@ -25,7 +27,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_skyLight = skyLightColor.rgb*v_light.a;
|
||||
|
||||
mat4 viewmodel = u_view * u_model;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue