I’ve been looking around and found many threads on this topic but none of them seems to tackle my concern specifically. So I’ll try to explain my approach in drawing geometries with multiple materials.
For simplicity sake, let’s focus on only one geometry.
This concept first appeared ideal for sharing the vertices between meshes but consider a geometry composed of 4 Quads:
| A | B |
| C | D |
- VBO is aligned ABCD
- Mesh1: Material1: Face Indices AD
- Mesh2: Material2: Face Indices BC
Chances are that Mesh2 will be rendered correctly because the Vertices are packed one after the other in the VBO but Mesh1 might have wrong data since the Face Indices AD are not align in the VBO.
To share V, VA and VBO between meshes. Avoiding geometry reconstruction and using FI to render whatever part of the geometry, leaving the VA undisturbed from their original structure (presumably imported from an CG package).
Now, could this be done or I’m dreaming a fantasy world?