bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Move `Msaa` to component

Open tychedelia opened this issue 1 year ago • 2 comments

Switches Msaa from being a globally configured resource to a per camera view component.

Closes #7194

Objective

Allow individual views to describe their own MSAA settings. For example, when rendering to different windows or to different parts of the same view.

Solution

Make Msaa a component that is required on all camera bundles.

Testing

Ran a variety of examples to ensure that nothing broke.

TODO:

  • [ ] Make sure android still works per previous comment in extract_windows.

Migration Guide

Msaa is no longer configured as a global resource, and should be specified on each spawned camera if a non-default setting is desired.

tychedelia avatar Jul 10 '24 21:07 tychedelia

Did you test this with multiple cameras with different MSAA modes? Iirc there are some pipeline properties that depend on it, so things might break if multiple levels are enabled at once.

Yes! Here are some foxes:

image

tychedelia avatar Jul 11 '24 15:07 tychedelia

Here's a simple patch that might help alleviate the problem of having the proliferation of main textures be confusing to users who want to run split screen setups: https://github.com/bevyengine/bevy/pull/14287.

tychedelia avatar Jul 12 '24 19:07 tychedelia

the mobile example needs to be updated, or this will fail merging on android compilation

mockersf avatar Jul 15 '24 23:07 mockersf

the mobile example needs to be updated, or this will fail merging on android compilation

Should be fixed now. This PR also removes the more advanced per-window feature detection. I'd be happy to add that back in but wasn't sure where exactly it should go.

tychedelia avatar Jul 15 '24 23:07 tychedelia

I think some things were missed here. Iirc in TAA plugin docs and meshlet plugin docs, it mentions that it automatically disabled MSAA, which is no longer true.

JMS55 avatar Jul 22 '24 19:07 JMS55