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

Procedural atmospheric scattering #16314

Merged
merged 144 commits into from
Jan 23, 2025
Merged

Conversation

ecoskey
Copy link
Contributor

@ecoskey ecoskey commented Nov 9, 2024

Implement procedural atmospheric scattering from Sebastien Hillaire's 2020 paper. This approach should scale well even down to mobile hardware, and is physically accurate.

Co-author: @mate-h

He helped massively with getting this over the finish line, ensuring everything was physically correct, correcting several places where I had misunderstood or misapplied the paper, and improving the performance in several places as well. Thanks!

Credits

@aevyrie: helped find numerous bugs and improve the example to best show off this feature :)

Built off of @mtsr's original branch, which handled the transmittance lut (arguably the most important part)

Showcase:

sunset
twilight

For followup

  • Integrate with pcwalton's volumetrics code
  • refactor/reorganize for better integration with other effects
  • have atmosphere transmittance affect directional lights
  • add support for generating skybox/environment map

Copy link
Contributor

@IceSentry IceSentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't really comment on the math, but the results look good and the implementation itself is fine.

I added a few minor comments but none of them are blockers.

@IceSentry IceSentry 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 Jan 21, 2025
@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Jan 22, 2025
@ecoskey
Copy link
Contributor Author

ecoskey commented Jan 23, 2025

bevy_example_runner results: https://pixel-eagle.com/project/B25A040A-A980-4602-B90C-D480AB84076D?filter=PR-16314

Nothing seems super out of place

@pcwalton pcwalton removed their request for review January 23, 2025 08:39
@pcwalton
Copy link
Contributor

Unassigning myself as this has enough reviews already.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 23, 2025
@alice-i-cecile
Copy link
Member

Agreed, merging :) Thanks!

should fix NaN issue, scene seems unaffected
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 23, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 23, 2025
Merged via the queue into bevyengine:main with commit 81a25bb Jan 23, 2025
32 checks passed
mrchantey pushed a commit to mrchantey/bevy that referenced this pull request Feb 4, 2025
Implement procedural atmospheric scattering from [Sebastien Hillaire's
2020 paper](https://sebh.github.io/publications/egsr2020.pdf). This
approach should scale well even down to mobile hardware, and is
physically accurate.

## Co-author: @mate-h 

He helped massively with getting this over the finish line, ensuring
everything was physically correct, correcting several places where I had
misunderstood or misapplied the paper, and improving the performance in
several places as well. Thanks!

## Credits

@aevyrie: helped find numerous bugs and improve the example to best show
off this feature :)

Built off of @mtsr's original branch, which handled the transmittance
lut (arguably the most important part)

## Showcase: 


![sunset](https://github.com/user-attachments/assets/2eee1f38-f66d-4772-bb72-163e13c719d8)

![twilight](https://github.com/user-attachments/assets/f7d358b6-898d-4df7-becc-188cd753102d)


## For followup

- Integrate with pcwalton's volumetrics code
- refactor/reorganize for better integration with other effects
- have atmosphere transmittance affect directional lights
- add support for generating skybox/environment map

---------

Co-authored-by: Emerson Coskey <[email protected]>
Co-authored-by: atlv <[email protected]>
Co-authored-by: JMS55 <[email protected]>
Co-authored-by: Emerson Coskey <[email protected]>
Co-authored-by: Máté Homolya <[email protected]>
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-Feature A new feature, making something new possible D-Complex Quite challenging from either a design or technical perspective. Ask for help! M-Needs-Release-Note Work that should be called out in the blog due to impact 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.

10 participants