Non-hardcoded time
philpax opened this issue · 2 comments
I wanted to see how my homeland of Australia looked, but it is unfortunately covered by shadow using the hardcoded sun direction/sidereal time. A quick perusal suggests that this would need to be addressed in the following places:
- https://github.com/fintelia/terra/blob/main/src/lib.rs#L405
- https://github.com/fintelia/terra/blob/main/src/lib.rs#L591
- https://github.com/fintelia/terra/blob/main/src/lib.rs#L655
Not sure if there are any other places, or how/if you'd want to expose this in preview
. My 2c is that Terrain::update
should take the sun direction/sidereal time, and that should be stored and used by render_shadows
and render
.
Thanks for the suggestion! I'd been meaning to calculate the sun direction based on time of day for a while, so I went ahead and implemented it. The --time HH:MM
option now lets you specify the time of day in GMT. So for instance, if you want to start the camera over Canberra at 9:00am local time, you can do:
cargo run --release -- --time 23:00 --plus 4RPFP435+RRW
Fun extra: if you set --timescale
to something like 50000 and zoom out, you can rapidly see day/night cycle transitions and watch how the amount of daylight varies with the seasons
Can confirm it works great, thank you!