Skip to content

Conversation

@JeroenHoogers
Copy link
Contributor

Objective

Fixes #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:
brightness_10x_on

After change:
brightness_10x_on_fix

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2025

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@JeroenHoogers JeroenHoogers force-pushed the fix-volumetric-contribution-spotlight-pointlight branch from c95b7ab to 635e440 Compare October 4, 2025 20:45
@alice-i-cecile alice-i-cecile added this to the 0.17.3 milestone Oct 4, 2025
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 4, 2025
Copy link
Contributor

@mate-h mate-h left a 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;
Copy link
Contributor

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? 😮

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 4, 2025
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 4, 2025
Merged via the queue into bevyengine:main with commit 419e733 Oct 4, 2025
44 checks passed
@github-project-automation github-project-automation bot moved this to Done in Rendering Oct 4, 2025
beicause pushed a commit to beicause/bevy that referenced this pull request Oct 6, 2025
# 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"
/>
tigregalis pushed a commit to tigregalis/bevy that referenced this pull request Oct 7, 2025
# 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"
/>
mate-h pushed a commit to mate-h/bevy that referenced this pull request Oct 22, 2025
# 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"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Volumetric fog contribution of PointLight and SpotLight seems too strong

4 participants