Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return some computed values from the share for adjusting ambient and directional lighting #26

Open
ericvrp opened this issue Sep 5, 2022 · 4 comments

Comments

@ericvrp
Copy link

ericvrp commented Sep 5, 2022

Currently I am adjusting the ambient light brightness based on the directional illuminance.

I would also like to adjust the color the directional and ambient lighting so sunsets for instance become more realistic in my scene.

Would this be possible?

@JonahPlusPlus
Copy link
Owner

When Bevy gets support for image-based lighting, it will be possible to use the skybox as a light source for the scene. Though, I might have to create a few other sky models to get more accurate lighting (Nishita is currently used and I've heard from feedback that it isn't the best for lighting). Until then, you could try to use AtmosphereImage to somehow adjust the lighting (maybe sampling parts of the image?)

@ericvrp
Copy link
Author

ericvrp commented Sep 5, 2022

I'm not looking for something perfect but having a gradient between sunrise, mid-day and sunset would probably work for me. I will have a look at AtmosphereImage but perhaps guessing the color for the directional light and using the absence of that color in the shadows would work good enough.

@JonahPlusPlus
Copy link
Owner

You could also try mapping the value of the sun's position to a color. You could take the Y axis and use it to pick a color across a gradient (you might need an external crate for this). This would give you more control (and is probably more performant) than using AtmosphereImage.

@galop1n
Copy link

galop1n commented Mar 6, 2023

I was also looking at something similar, It would be helpful to be able to query the model on the cpu for a given direction to collect the sun color

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants