Skip to content

Nested clipping with RTT does not work #457

@wouterlucas

Description

@wouterlucas

When nodes are nested with multiple layers of clipping and the parent node enables RTT the children clipping regions are ignored.

Eg:

- Node (RTT: true)
    - Child 1
    - Child 2 (clipping: True)
        - SubChild 2.1
        - SubChild 2.2
    - Child 3 

In this case SubChild 2.1 and SubChild 2.2 do not receive a proper clipping area.

The issue sits here:
https://github.com/lightning-js/renderer/blob/main/src/core/CoreNode.ts#L1139

Currently once RTT is enabled it ignores clipping regions for children. This is fine and needed because else you'd be enabling clipping on a sub region on a texture that is misaligned but does not take children into account who have clipping enabled.

What we need to change is:

  • Check if a child or a RTT node has clipping enabled
  • Honor clipping region if enabled per local RTT matrix

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions