Skip to content

Better integration of P2DX renderer #565

Open
@codeanticode

Description

@codeanticode

The P2DX renderer by @hazmatsuitor improves 2D rendering performance significantly, as discussed in #265.

This experimental renderer has its own vertex data structures and shaders uniforms/attributes that allow memory transfer speedups, but on the other hand makes it harder to integrate with standard Processing's shaders. Work needs to be done to make that integration possible, or at least to document the caveats associated with the use of P2DX:

Next step would probably be to encapsulate the shader's uniform and attribute locations into an inner Shader2D class extending PShader. Or better still, making the 2D shader in the new renderer compatible with the existing color and texture shaders, so there is no need for a new type. What's tricky is that in its current implementation, the position attribute is a vec3 since it does not use w, but the P2D and P3D shaders expect a vec4. Perhaps the texFactor could be put in the w coordinate of position? Or add an unused w just for compatibility purposes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions