Closed cpetzold closed 1 month ago
Hey @cpetzold ! Thank you for the PR. One of us will review this soon.
cc: @seabassjh
if you have multiple render layers configured for an entity you want to render with bevy_vello, does that mean that you'd need to compute the affine for each camera targeted?
Yes. But if you're expecting that there will be n Vello scenes for n cameras, that will not be possible yet and requires something thinking and reworking on my render_scene system.
if you have multiple render layers configured for an entity you want to render with bevy_vello, does that mean that you'd need to compute the affine for each camera targeted?
Yes. But if you're expecting that there will be n Vello scenes for n cameras, that will not be possible yet and requires something thinking and reworking on my render system.
To clarify, this would have to be called n times https://github.com/loopystudios/bevy_vello/blob/d25d787f14c77533b9b038ad153847b0f13e1c46/src/render/systems.rs#L181-L195
if you have multiple render layers configured for an entity you want to render with bevy_vello, does that mean that you'd need to compute the affine for each camera targeted?
Yes. But if you're expecting that there will be n Vello scenes for n cameras, that will not be possible yet and requires something thinking and reworking on my render_scene system.
Right that makes sense. I posted this on the bevy discord:
"I wonder if some sort of API where you add a VelloRenderer to a camera entity would make sense. A setup system would spawn the render target for that camera. Then it would create extracted instances per vello-rendered entity per overlapping camera with VelloRenderer."
Thoughts on that approach?
I agree on that approach. That was my initial idea as well!
What do you hope to accomplish with multiple cameras? Like split screen... because that would require us to revise the full screen triangle texture approach
I'm having a hard time thinking about what the practical uses of multiple "VelloRenderer" cameras would be. And what it would like look in a normal scenario-- multiple vello scenes overlayed right on top of each other on the full screen texture triangle?
I don't have a use case for multiple VelloRender'ing cameras. My use case is that I want to render an infinite 2d grid alongside my vello scene, and my approach is to use a separate camera to render a screen space shader.
I don't have a use case for multiple VelloRender'ing cameras. My use case is that I want to render an infinite 2d grid alongside my vello scene, and my approach is to use a separate camera to render a screen space shader.
Ah, this is already possible with existing tooling.
In this, we're using egui + bevy_vello + a custom shader (infinite "transparency" grid).
This was all Sebastian's doing, so I'll wait for him to talk about how he did that.
I did get it to work with a single camera approach, but it felt a bit bad because I had to scale the shader mesh with the camera to support zooming the camera. Though it does simplify the shader code since I can just use the View that's automatically passed!
@seabassjh
Merge conflict @cpetzold
Superseded by #68
This is a first stab at multiple camera support. It currently assumes that the desired camera is on RenderLayer 0.
I'd like to allow flexibility on RenderLayer, but I wasn't sure how to support it properly. For example, if you have multiple render layers configured for an entity you want to render with bevy_vello, does that mean that you'd need to compute the affine for each camera targeted?