Skip to content

Conversation

@mate-h
Copy link
Contributor

@mate-h mate-h commented Oct 4, 2025

Objective

  • Occlude the directional lights by the atmosphere
  • More Physically accurate light values reaching the objects from directional lights
  • Support volumetric shadowing through the atmosphere with an additional layer of FogVolume
  • Strategic direction: use the FogVolume and expand on that implementation for shadow sampling Since it already uses pipeline specialization.
  • For now keep the atmosphere pipeline as is, free from shadow sampling code since these effects only matter at large scales. Shadow sampling for the atmosphere can be implemented in a later PR for planetary rings, objects in space, other large scale objects.

Solution

  • Bind the transmittance LUT to the core 3d mesh PBR shader
  • tint the incoming light L to point P by the transmittance through the atmospheric medium
  • Apply the same effects to volumetric fog
  • Ensured that new new Atmosphere pipeline key works with deferred rendering
  • Updated example to include water plane and screen space reflections. Removed the water plane from the GLB terrain asset. (small asset churn!)

Testing

cargo run --example atmosphere
# or
cargo run --example atmosphere --features=free_camera

Showcase

Screenshot 2025-10-22 at 9 50 27 PM

@mate-h mate-h added C-Feature A new feature, making something new possible A-Rendering Drawing game state to the screen M-Release-Note Work that should be called out in the blog due to impact S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2025

It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note.

Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes.

@mate-h mate-h requested review from JMS55 and atlv24 October 4, 2025 18:00
@ecoskey ecoskey self-requested a review October 5, 2025 05:26
Copy link
Contributor

@ecoskey ecoskey left a comment

Choose a reason for hiding this comment

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

Looks great! Sorry I didn't review earlier, I've been pretty busy :)

@mate-h mate-h force-pushed the m/atmosphere-occlusion branch from f1e613e to 5f718c5 Compare October 22, 2025 23:47
@mate-h mate-h added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 23, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 24, 2025
@alice-i-cecile alice-i-cecile removed this pull request from the merge queue due to a manual request Oct 24, 2025
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Missing release notes still ;) Perils of making pretty features.

Once there's at least a stub though, ping me and I'll merge!

@mate-h
Copy link
Contributor Author

mate-h commented Oct 24, 2025

Ah fair! I missed those, will publish the release notes. Thanks 😊

@alice-i-cecile alice-i-cecile self-requested a review October 27, 2025 06:10
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 29, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 29, 2025
@mate-h
Copy link
Contributor Author

mate-h commented Oct 29, 2025

Taking a look at why the merge is failing!
Seems like its the run-examples-on-wasm I will make sure to test on wasm. I think maybe the SSR + deferred may have broke the warm build for the example.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 30, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 30, 2025
@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Oct 30, 2025
@alice-i-cecile
Copy link
Member

Yep, looks like WASM builds are properly broken with this :) Let me know when you have a fix!

@mate-h
Copy link
Contributor Author

mate-h commented Oct 30, 2025

@alice-i-cecile Thanks for working with me on merging this PR! <3
The commit I pushed fixes the webGL2 examples since the atmosphere plugin is disabled in those cases. So I marked the resource query as optional in the arguments of the system function in the mesh view bindings file.

Unrelated problem to the CI being blocked, but ran into it while testing:
The atmosphere example is broken on webgpu on the main branch so I created an issue to track the fix:
#21700

I ran the CI tests locally and it's passing so it's likely just broken in github actions.

@mate-h mate-h force-pushed the m/atmosphere-occlusion branch from e5d50e0 to be4e9c4 Compare October 30, 2025 23:39
@mate-h mate-h 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-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Nov 1, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Nov 1, 2025
Merged via the queue into bevyengine:main with commit e3814a9 Nov 1, 2025
38 checks passed
@github-project-automation github-project-automation bot moved this to Done in Rendering Nov 1, 2025
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 M-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.

4 participants