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

how do I load a model in webgl2 with multiple material/objects? #75

Open
manueldun opened this issue Mar 16, 2020 · 0 comments
Open

how do I load a model in webgl2 with multiple material/objects? #75

manueldun opened this issue Mar 16, 2020 · 0 comments

Comments

@manueldun
Copy link

Hello

I've been trying this method:

  1. Create a one global array buffer for each type of data (position, uv, normal, etc).

  2. Then create one element buffer array (index) for each material index data.

  3. Create one VAO for each material index array. Every VAO is going to be bound to all the global array buffer and one respective element buffer.

  4. Lastly I draw every VAO.

I tried this approach with Drovaric sponza from https://casual-effects.com/data/ and it works fine, but it does not have normal data, so I used blender to generate the normals and I get a bad result when drawing the mesh, like the the vertices are out of order.

in the case of using OBJ.initMeshBuffers, how would i go about it?

Thanks.

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