-
Notifications
You must be signed in to change notification settings - Fork 17
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
Mesh-visualizer: uncomment and update to the new serializing format #17
Comments
Hey there. So the multi vs. single concept is a bit confusing and I plan to re-work it at some point. For now though, I'll explain. Multi indexed just means that instead of repeating the same position, normal and uv data we use a position index, normal index and uv index to point to the data so that if we need to use the second vertex normal 10 times we can just say "use vertex normal number 2 10 times". Same idea for positions and uvs. Modern graphics APIs have no notion of this though. You can't have three different indices. You can only have one. So instead of saying "Hey use vertex normal number 2 ten different times". You instead just have to duplicate that data ten times. It looks like you started trying to use some of the more recent Buffering the multi indexed vertex attributes won't work for the reasons mentioned above. Instead you want to first call blender_mesh.combine_vertex_indices and then buffer that vertex data. Please let me know if that works for you or if there is any other way that I can help. |
Anyway I can find no working renderind example for combined index. It would look nice if it could convert SingleIndexedVertexAttributes to &[f32] arrays to pass to GL array buffer )) |
Hey. I use I'm not sure when I'll get around to writing one. If it helps at all (apologies for not having a working example for you), it should be no different from how you'd render using an interleaved vertex buffer anywhere else. Create a vertex buffer on the GPU and set up your vertex attributes with the proper stride. Actually it should probably be renamed from |
Hi @chinedufn: Awesome work. Thank you for sharing the water demo and the deserializer.
I got well impressed with the water demo and could reproduce it (Blender 2.7).
Problem: I would like to upload my own Blender 2.8 files.
So trying to make mesh-visualizer work but it is pretty hard for me (noob: never heard of multi-index)
If someone manage to do it before me, I would be pretty glad.
Solution: Very little changes seems required: getting data from a subobject (positions.attribute.data).
Like in mesh-visualizer/src/render/mod.rs
Reason: It is difficult to count, get the good order, well do the good thing.
That is why a deserializer helps a lot to use a serializer (one could even load a class mesh-visualizer in its code and use some nice object forgetting the 1d array nightmare)
The text was updated successfully, but these errors were encountered: