antarktikali / threejs-sunlight

A Three.js module that uses a directional light to imitate the sun light in a real world location
13 stars 9 forks source link

Fade out the directional light on sunset #2

Open antarktikali opened 7 years ago

antarktikali commented 7 years ago

Disable the directional light or slowly fade it out on sunset, and vice versa on dawn.

antarktikali commented 7 years ago

Implemented basic fade out in cc8634d

This is not quite realistic though, as the sky remains to be bright after the sunset. An ambient light can be added to the system, and it can be used to simulate the actual dusk after the sun's elevation is roughly 10-15 degrees below the horizon.

Furthermore managing the directional light's intensity value breaks the design of having a publicly accessible directional light object.

Garrettlynch commented 5 years ago

I'm working on a fade in and out for sunrise and sunset for this including an ambient light that deals with twilight when the sun is up to 18 degrees below the horizon as well as a few other modifications. If you are interested I will post a pull request when finished.

farfromrefug commented 2 years ago

@Garrettlynch very interested by your fade in / out. Can you share?