-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Currently the AttributeBuffer
's render
method takes an array of tuples to specify the layout of the attributes.
Maybe we should have a separate class for doing this, e.g. AttributeBuffer.Layout
that takes a sequence of name and size tuples:
AttributeBuffer.Layout(
"position" -> 3, // or even some datatype describing vec3, at some point
"normal" -> 3,
"textureCoord" -> 2
)
This layout should be the constructor parameter for the AttributeBuffer
.
When the buffer is used with a particular shader, which attributes are used should be specified explictily:
// cached somewhere
val myShaderAttributes = List("position", "textureCoord")
// during rendering
buffer.render(mode, myShaderAttributes)
From the myShaderAttributes
list and the Layout
, the render
call should set the appropriate attribute buffer pointers.
Metadata
Metadata
Assignees
Labels
No labels