JonahPlusPlus / bevy_atmosphere

A procedural sky plugin for bevy
Apache License 2.0
272 stars 21 forks source link

Dark side of the moon #17

Open gilescope opened 2 years ago

gilescope commented 2 years ago

Would be cool if we could create an example of lighting half the world but leaving the other half in darkness.

JonahPlusPlus commented 2 years ago

You can do this by changing the ray_origin of AtmosphereMat. For example, changing swapping the Y and Z axis so it becomes (0, 0, 6372e3): Screenshot 2022-05-28 160055 This changes the plane the atmosphere rests on to be on the Z axis instead of the Y axis. It's not exactly cutting the world into two separate halves, but I find it hard to justify adding such a niche feature into the crate. If you need a certain aesthetic, it might be better to fork the crate and implement your own solution, such as creating a round cube in Blender and cutting it into two meshes and apply two separate AtmosphereMat to the meshes, one for day and night.