-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support multiple cameras #49
Conversation
Hey @cpetzold ! Thank you for the PR. One of us will review this soon. cc: @seabassjh |
camera: Query<(&ExtractedCamera, &ExtractedView)>, | ||
mut render_vectors: Query<(Entity, &ExtractedRenderScene)>, | ||
camera: Query<(&ExtractedCamera, &ExtractedView, &RenderLayers)>, | ||
mut render_scenes: Query<(Entity, &ExtractedRenderScene)>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, good spot! We definitely copy/pasted this wrong ;)
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. |
To clarify, this would have to be called n times |
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 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! |
Merge conflict @cpetzold |
Superseded by #68 |
This is a rebased version of #49 which looks like it only needed merge conflicts resolved --------- Co-authored-by: Conner Petzold <cpetzold@gmail.com> Co-authored-by: Spencer C. Imbleau <spencer@imbleau.com>
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?