-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
MSAA for textures #3254
Copy link
Copy link
Closed
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-FeatureA new feature, making something new possibleA new feature, making something new possible
Description
What problem does this solve or what need does it fill?
MSAA is implemented when rendering to a window, but not when rendering to a texture.
What solution would you like?
To be able to render to a texture with MSAA enabled.
What alternative(s) have you considered?
I tried following the render_to_texture example to render a second camera to a texture, but it failed due to MSAA being enabled in my app.
Adding .insert_resource(Msaa { samples: 4 }) to the example will cause this error:
2021-12-05T10:27:57.789110Z ERROR wgpu::backend::direct: Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error
Caused by:
In a RenderPass
note: encoder = `<CommandBuffer-(1, 2, Metal)>`
In a set_pipeline command
note: render pipeline = `<RenderPipeline-(0, 1, Metal)>`
Render pipeline targets are incompatible with render pass
Incompatible sample count: 1 != 4
I tried to mimic render graph setup code elsewhere that inserts a resolve target node, but have been unsuccessful, because Bevy doesn't seem to support multisampled textures:
which will cause this validation failure:
Additional context
In addition to the texture not being antialiased, I can't find a good way to use MSAA at all when rendering to a texture.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-FeatureA new feature, making something new possibleA new feature, making something new possible