Skip to content

discussion on attribute locations #2

Description

@mattdesl

leaving this here for future discussion.

The problem: let's say we have a utility mesh like gl-sphere and it expects attributes in the order [ position, colors, normals ]. However, we want to give the user the ability to render it with a custom shader -- but their shader might have attributes in the order [position, normals, colors].

The solution should not need to re-compile shaders since it's expensive and doesn't allow for shader re-use.

One idea is to use string aliases when defining the attributes of a VAO, and have the user pass a shader to vao.bind(). Then the VAO always knows which attribute locations to bind, assuming the gl-shader has them listed in the correct order.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions