Skip to content

Conversation

@pcwalton
Copy link
Contributor

The depth of field pass has a medium-performance Gaussian blur implementation that's well-commented and battle-tested, but it's currently private to that pass. Gaussian blur is useful enough that it's worth exposing to application shaders, so this PR factors that code out into a reusable shader library.

The depth of field pass has a medium-performance Gaussian blur
implementation that's well-commented and battle-tested, but it's
currently private to that pass. Gaussian blur is useful enough that it's
worth exposing to application shaders, so this PR factors that code out
into a reusable shader library.
@pcwalton pcwalton added the A-Rendering Drawing game state to the screen label Dec 23, 2025
@pcwalton pcwalton added C-Code-Quality A section of code that is hard to understand or change C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Shaders This code uses GPU shader languages labels Dec 23, 2025
@pcwalton pcwalton self-assigned this Dec 23, 2025
Copy link
Contributor

@ChristopherBiscardi ChristopherBiscardi left a comment

Choose a reason for hiding this comment

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

single-directional blur works when dropped into a post-process, etc.

One note is that the module naming is a bit unfortunate, as importing bevy_post_process::gaussian_blur instead of bevy_post_process::gaussian_blur::gaussian_blur will result in silent failures when trying to actually use the function.

Image

@hukasu
Copy link
Contributor

hukasu commented Dec 23, 2025

does this work on both bindless (if applicable) and non-bindless? because i tried doing the same with one other shader function and wgpu crashes when passing a bindless texture_2d to it

see #21714

@ChristopherBiscardi
Copy link
Contributor

@hukasu No, this crashes on my windows machine in the shader_material_bindless example, but since its just refactoring that shouldn't block the PR IMO

@tychedelia tychedelia 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 Dec 24, 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-Code-Quality A section of code that is hard to understand or change C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Shaders This code uses GPU shader languages D-Straightforward Simple bug fixes and API improvements, docs, test and examples 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: No status

Development

Successfully merging this pull request may close these issues.

4 participants