opengl - Supporting multiple materials per mesh -
my mesh class has single vao index, , index 1 buffer of vertices, colours, tex coords, normals , indices (if used). i'm loading wavefront .obj files mesh class , treating groups 1 vbo, load single material separately , bind before drawing mesh. works fine i'm looking back upwards .obj files multiple materials.
the easiest way create new mesh instance each grouping within .obj uses different material , grouping them meshgroup object or something, better(?) way back upwards multiple vbos within mesh's vao, assigning different materials when drawing each buffer. sec way faster other (since there vao binding per mesh rather per group), or can cop out , go first method?
edit: i've got working going method 1 , creating separate mesh instance (and associated vao) each part of mesh different material. i'm sure isn't best way, if has insight much appreciated!
opengl mesh vbo material
No comments:
Post a Comment