Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying attribute layout for AttributeBuffer #13

Open
axel22 opened this issue Feb 28, 2014 · 2 comments
Open

Specifying attribute layout for AttributeBuffer #13

axel22 opened this issue Feb 28, 2014 · 2 comments

Comments

@axel22
Copy link
Member

axel22 commented Feb 28, 2014

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.

@axel22
Copy link
Member Author

axel22 commented Dec 11, 2014

@storm-enroute-bot

1 similar comment
@axel22
Copy link
Member Author

axel22 commented Dec 11, 2014

@storm-enroute-bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant