bevy_atmosphere icon indicating copy to clipboard operation
bevy_atmosphere copied to clipboard

Add "up" direction in settings

Open aevyrie opened this issue 2 years ago • 4 comments

I'm using Z-up in an application, so using this plugin results in everything being rotated 90 degrees. Being able to set the up vector would be handy.

aevyrie avatar Jun 06 '23 04:06 aevyrie

Assuming you are using the Nishita model, that can be done by setting the ray_origin to (0.0, 0.0, 1.0). Of course, that is a model-dependent method and issue #39 addresses the need to have a way to add manual rotation.

JonahPlusPlus avatar Jun 06 '23 13:06 JonahPlusPlus

@JonahPlusPlus I have a question about "ray_origin". I'm playing with making the directional light come from the right place for the time of day at a given latitude. For the sky to match, should ray_origin be set to the zenith?

mattdm avatar Sep 22 '23 13:09 mattdm

@mattdm I'm not really sure what your use case is, but if you are trying to rotate the sky independent of the camera, then yes, the ray_origin can do this, you just set it to the direction that is "up", the zenith as you say. Though, you might want to look into just rotating the sky mesh (IDK if that can be done, others have been maintaining the project in my absence) since that is not as computationally expensive (but if you are changing other parameters as well, it doesn't matter).

JonahPlusPlus avatar Sep 22 '23 14:09 JonahPlusPlus

Use case is simply simulating sunlight and sun-position at non-equitorial latitudes. Changing sun_position seems to align the sky nicely — but I'm not sure what this parameter does for the model, and want to make sure I'm not missing something.

mattdm avatar Sep 24 '23 00:09 mattdm