OBJ File structure allows for groups of faces to have a single material attached to them.
I have written a parser which separates groups and they each have their own material.
How can I go about getting that data to the shader?
I figure my two options are:
- Load them in as a vertex array object attribute
- Load them in as uniform variables
The only way I know how to implement option 1 is to load an array of material data for every vertex which seems to be a LOT of extra information. Is there a way to point to the current group’s material while it’s being drawn and then switch to a new material for the next group? Or, is there something I’m missing completely?
Option 2 doesn’t seem viable because it seems to persist throughout the whole draw call.
Any information would be greatly appreciated.