update sponza demo with day/night cycle

main
Dominik Madarász 2023-09-11 13:38:43 +02:00
parent aa66b03929
commit 53b63dff58
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ int main() {
// initialize SH coefficients from rayleigh skybox // initialize SH coefficients from rayleigh skybox
if (flag("--mie") && sky_update_until <= window_time()) { if (flag("--mie") && sky_update_until <= window_time()) {
shader_bind(sky.program); shader_bind(sky.program);
shader_vec3("uSunPos", cam.position); shader_vec3("uSunPos", vec3(0, (cosf((float)window_time())*0.3)+0.2, -1));
skybox_mie_calc_sh(&sky); skybox_mie_calc_sh(&sky);
sky_update_until = window_time() + 0.02; sky_update_until = window_time() + 0.02;
} }