-
-
Notifications
You must be signed in to change notification settings - Fork 41
Group
Marc Flerackers edited this page Sep 1, 2024
·
2 revisions
The group component will mark a subtree as static content whose render data needs to be stored on the GPU and reused every frame.
This needs support from:
- Render redirection. Render redirection or the Picture API allows for render commands to be captured and replayed. It will probably be an API similar to Framebuffer/Canvas, but instead of rendering, the drawing commands are send as vertex/index buffer data to a Picture which stores it on the GPU. Drawing the Picture just renders the data already prepared in the GPU.
- Group component. Marking a node and everything under it as a group. Also holds the prepared picture.
- Internal treewalk draw function. This function currently redirects drawing to Framebuffer and Mask. It needs to be adapted to redirect to a Picture.
Caveats:
- As with mask and canvas, there is the problem with draw order. Since the group is drawn as one object, layer/z only works locally within the group. Globally the group can be layered as one object by setting layer or z of the node which has the group component.
- Mask is not allowed within a group, as it cannot be drawn using one command.
- For the same reason, only one shader and one texture can be used. This may be problematic since primitives use their own 1x1 texture. We will need to put this default texture into the sprite atlas if it isn't already.