Skip to content

Remove ExtractedView::hdr, add ExtractedView::texture_format, move compositing_space to ExtractedCamera#23734

Merged
alice-i-cecile merged 41 commits intobevyengine:mainfrom
atlv24:ad/view-texture-format
Apr 13, 2026
Merged

Remove ExtractedView::hdr, add ExtractedView::texture_format, move compositing_space to ExtractedCamera#23734
alice-i-cecile merged 41 commits intobevyengine:mainfrom
atlv24:ad/view-texture-format

Conversation

@atlv24
Copy link
Copy Markdown
Contributor

@atlv24 atlv24 commented Apr 9, 2026

Objective

Solution

  • Remove ExtractedView::hdr
  • Add ExtractedView::texture_format
  • Move ExtractedView::compositing_space to ExtractedCamera::compositing_space
  • Add texture_format to a bunch of specialization keys instead of hdr bool
  • Convert VolumetricFogPipelineKey to not use flags and just use bool and texture format
  • Remove BevyDefault TextureFormat
  • Remove ViewTarget TEXTURE_FORMAT_HDR

Testing

  • Pretty extensively test at this point

This has a migration guide.

@atlv24 atlv24 added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 9, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Apr 9, 2026
@atlv24 atlv24 requested review from mate-h and tychedelia April 9, 2026 06:18
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Please review the instructions for writing migration guides, then expand or revise the content in the migration guides directory to reflect your changes.

@jasmine-nominal
Copy link
Copy Markdown
Contributor

Can you add docs to ExtractedCamera/View clarifying the differences between them? (view can be any sort of rendering thing e.g. a shadow map, camera is stuff relevant to an actual camera)

Comment thread crates/bevy_pbr/src/volumetric_fog/render.rs Outdated
Copy link
Copy Markdown
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 really like the direction of this PR, bit +1 from me once CI is passing.

Copy link
Copy Markdown
Member

@tychedelia tychedelia left a comment

Choose a reason for hiding this comment

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

Ty, this is a helpful step towards some other goals I have here. I'm wondering for a few of these passes where you switched to camera.hdr, is there a strong reason not to have them use the view target texture?

Comment thread crates/bevy_pbr/src/render/mesh.rs Outdated
@mate-h
Copy link
Copy Markdown
Contributor

mate-h commented Apr 10, 2026

I like the direction you're proposing! very nice. Extracted views really shouldn't care about hdr or compositing space or not, cameras should. I did a bunch of research and testing for this PR and I tried fixing the 2d hdr bloom, 3d scene examples and also created a compositing space example. While trying not to reintroduce any of the antipatterns being cleaned up in this PR. atlv24#5

@beicause
Copy link
Copy Markdown
Member

beicause commented Apr 10, 2026

I hope we could put all webgpu renderable && blendable formats into the mesh pipeline key to reduce collisions with #22637. But I'm not against the current either.

@atlv24
Copy link
Copy Markdown
Contributor Author

atlv24 commented Apr 11, 2026

@beicause I have incorporated some of your changes with attribute. I'd appreciate a review, thanks!

Co-authored-by: Luo Zhihao <luo_zhihao@outlook.com>
@atlv24 atlv24 force-pushed the ad/view-texture-format branch from 136138c to 9df57ec Compare April 11, 2026 08:13
Comment thread _release-content/migration-guides/camera-textureformats.md
Co-authored-by: atlv <email@atlasdostal.com>
Comment thread _release-content/migration-guides/camera-textureformats.md Outdated
Copy link
Copy Markdown
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.

Re-reviewed! I don't have any blocking comments, I also tested again with my compositing space example looks good.

Comment thread crates/bevy_core_pipeline/src/fullscreen_material.rs Outdated
Comment thread crates/bevy_render/src/view/mod.rs Outdated
Comment thread crates/bevy_render/src/view/mod.rs Outdated
atlv24 and others added 2 commits April 12, 2026 17:58
Comment thread crates/bevy_image/src/image.rs Outdated
@salixsalicaceae
Copy link
Copy Markdown
Contributor

Confirmed to fix #23732

@atlv24 atlv24 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 Apr 13, 2026
Comment thread crates/bevy_render/src/view/mod.rs Outdated
@atlv24
Copy link
Copy Markdown
Contributor Author

atlv24 commented Apr 13, 2026

This PR is good to merge, example runner passed (only fail is a flake that is flakey on main too)

@atlv24 atlv24 added this to the 0.19 milestone Apr 13, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 13, 2026
Merged via the queue into bevyengine:main with commit 082c44e Apr 13, 2026
38 checks passed
@github-project-automation github-project-automation bot moved this from Needs SME Triage to Done in Rendering Apr 13, 2026
mate-h added a commit to mate-h/bevy that referenced this pull request Apr 14, 2026
…mpositing_space to ExtractedCamera (bevyengine#23734)

# Objective

- Clean up our texture format handling.
- Fix bevyengine#23732
- Get us closer to bevyengine#22563
- It makes no sense for views to talk about being hdr or not. They have
a texture format, that's it. What does HDR shadows even mean lol
- Same for compositing_space

## Solution

- Remove ExtractedView::hdr
- Add ExtractedView::texture_format
- Move ExtractedView::compositing_space to
ExtractedCamera::compositing_space
- Add texture_format to a bunch of specialization keys instead of hdr
bool
- Convert VolumetricFogPipelineKey to not use flags and just use bool
and texture format
- Remove BevyDefault TextureFormat
- Remove ViewTarget TEXTURE_FORMAT_HDR

## Testing

- Pretty extensively test at this point

This has a migration guide.

---------

Co-authored-by: Willow Black <wmcblack@gmail.com>
Co-authored-by: Máté Homolya <mate.homolya@gmail.com>
Co-authored-by: Luo Zhihao <luo_zhihao@outlook.com>
Co-authored-by: IceSentry <IceSentry@users.noreply.github.com>
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 M-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide 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.

Hdr required to get rendertarget to respect TextureFormat

8 participants