A Material System for Libgdx

I threw together a quick pseudo design for the material system i want to have in libgdx. Here we go (that’s actually a few weeks old already…):

That’s just an early design, not entirely cast in stone (Vevusio would like the MaterialAttribute class to be an interface actually, i kind of agree. kind of). Of course this system is very basic, in the spirit of the VertexAttribute class. It should suite both OpenGL ES 1.x and 2.0 (hence the need for naming material attributes so that they can be bound to a shader). Each MaterialAttribute implementation is responsible for setting the appropriate GL state/uniforms where possible. What’s still open is a system that can help reduce state changes. Not sure how to approach that yet, we’ll see.

Feedback welcome.

Leave a Reply

Your email address will not be published.