Skip to content
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

implement RenderLayer support #37

Merged
merged 2 commits into from
Aug 3, 2024
Merged

implement RenderLayer support #37

merged 2 commits into from
Aug 3, 2024

Conversation

ChristopherBiscardi
Copy link
Collaborator

This relies on linebender/bevy_vello#71 so can't be merged until that is merged and released.

This implements RenderLayer support for Woodpecker, which means that you can now render a Camera2d with Woodpecker over a Camera3d with anything else.

This is particularly useful to do in the UI layer (as opposed to other game elements, etc) as the implementation only needs to happen on the Woodpecker Plugin configuration and the Camera2d. It does not need to be configured on any widgets since the VelloScene, VelloCanvas, and Camera are what matter.

.add_plugins(WoodpeckerUIPlugin {
    render_layers: Some(RenderLayers::layer(1)),
})
commands.spawn((Camera2dBundle::default(), RenderLayers::layer(1)));

Here it is in a game setting. I've also added a new RenderLayers example.

screenshot-2024-08-02-at-21 34 59@2x

Copy link
Owner

@StarArawn StarArawn left a comment

Choose a reason for hiding this comment

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

I think this is a good start to solving render layers. 👍 LGTM!

Somethings we can do in the future:

  1. Make WoodpeckerUIContext a component not a resource that is attached to a woodpecker ui context.
  2. Spawn a vello scene per camera. The vello scene should use the camera's render layer if available.

@StarArawn StarArawn merged commit 26e35a9 into StarArawn:main Aug 3, 2024
@StarArawn StarArawn deleted the render-layers branch August 3, 2024 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants