Skip to content

Support arbitrary clip/transform stacks #154

Closed
@pcwalton

Description

@pcwalton

The idea here is to have a compressed matrix/transform palette and clip out in the fragment shader. This is somewhat slow in that it could have a lot of unnecessary FS invocations, but it's on-GPU instead of on-CPU and doesn't mandate batch breaks unlike stencil-based solutions, and that seems like a win. The common cases are handled in the VS, so this should only happen in uncommon situations.

gw: pcwalton: my tentative plan was to add support to the shader to handle clips as either a simple rect (as now) or a compressed set of 4 clip plans with arbitrary transform. I haven't checked that this idea will actually work yet :) But yes, you're right - if it works, that could handle gradients.
gw: pcwalton: Yes, a palette like the rects. I think they could be compressed a lot in the uniforms too - since there is only one normal you need (two planes have the same normal, the other two are perpendicular). I think we could just specify one normal and 4 d values perhaps or something like that...

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