-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Fixed fog contribution for point and spotlights #21387
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
Fixed fog contribution for point and spotlights #21387
Conversation
|
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
c95b7ab to
635e440
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File diff and the proposal to change this looks good to me!
| let light_attenuation = exp(-density * bounding_radius * (absorption + scattering)); | ||
| let light_factors_per_step = fog_color * light_tint * light_attenuation * | ||
| scattering * density * step_size_world * light_intensity * 0.1; | ||
| scattering * density * step_size_world * light_intensity * exposure; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a 0.1 hardcoded there? 😮
# Objective Fixes bevyengine#21327 Volumetric fog contribution was not proportional to the light intensity for point and spotlights. ## Solution Take into account `exposure` value for Point and Spotlights to match the Directional light implementation. ## Testing - Run the updated `volumetric_fog` example. You can see the volumetric effect of point and spotlights now match the intensity of this light on the surfaces of the room. --- ## Showcase Point and spotlight intensities in the original `volumetric_fog` example were too low to light up the room despite having a very strong volumetric contribution. This update boosts the light intensity and lowers the volumetric contribution of point and spotlights Before this change `volumetric_fog` example with 10x light intensity for point and spotlights: <img width="1922" height="1126" alt="brightness_10x_on" src="https://github.com/user-attachments/assets/7562585c-bc1b-4cbf-9d52-4ffb083d65f4" /> After change: <img width="1922" height="1126" alt="brightness_10x_on_fix" src="https://github.com/user-attachments/assets/2a17fec8-0272-4c4e-9d88-d0916027a7c5" />
# Objective Fixes bevyengine#21327 Volumetric fog contribution was not proportional to the light intensity for point and spotlights. ## Solution Take into account `exposure` value for Point and Spotlights to match the Directional light implementation. ## Testing - Run the updated `volumetric_fog` example. You can see the volumetric effect of point and spotlights now match the intensity of this light on the surfaces of the room. --- ## Showcase Point and spotlight intensities in the original `volumetric_fog` example were too low to light up the room despite having a very strong volumetric contribution. This update boosts the light intensity and lowers the volumetric contribution of point and spotlights Before this change `volumetric_fog` example with 10x light intensity for point and spotlights: <img width="1922" height="1126" alt="brightness_10x_on" src="https://github.com/user-attachments/assets/7562585c-bc1b-4cbf-9d52-4ffb083d65f4" /> After change: <img width="1922" height="1126" alt="brightness_10x_on_fix" src="https://github.com/user-attachments/assets/2a17fec8-0272-4c4e-9d88-d0916027a7c5" />
# Objective Fixes bevyengine#21327 Volumetric fog contribution was not proportional to the light intensity for point and spotlights. ## Solution Take into account `exposure` value for Point and Spotlights to match the Directional light implementation. ## Testing - Run the updated `volumetric_fog` example. You can see the volumetric effect of point and spotlights now match the intensity of this light on the surfaces of the room. --- ## Showcase Point and spotlight intensities in the original `volumetric_fog` example were too low to light up the room despite having a very strong volumetric contribution. This update boosts the light intensity and lowers the volumetric contribution of point and spotlights Before this change `volumetric_fog` example with 10x light intensity for point and spotlights: <img width="1922" height="1126" alt="brightness_10x_on" src="https://github.com/user-attachments/assets/7562585c-bc1b-4cbf-9d52-4ffb083d65f4" /> After change: <img width="1922" height="1126" alt="brightness_10x_on_fix" src="https://github.com/user-attachments/assets/2a17fec8-0272-4c4e-9d88-d0916027a7c5" />
Objective
Fixes #21327
Volumetric fog contribution was not proportional to the light intensity for point and spotlights.
Solution
Take into account
exposurevalue for Point and Spotlights to match the Directional light implementation.Testing
volumetric_fogexample. You can see the volumetric effect of point and spotlights now match the intensity of this light on the surfaces of the room.Showcase
Point and spotlight intensities in the original
volumetric_fogexample were too low to light up the room despite having a very strong volumetric contribution. This update boosts the light intensity and lowers the volumetric contribution of point and spotlightsBefore this change

volumetric_fogexample with 10x light intensity for point and spotlights:After change:
