Replies: 3 comments 2 replies
-
I can't really tell what your requirements are. But it looks like you could store your mesh chunks in |
Beta Was this translation helpful? Give feedback.
-
I have the same issue for pretty much the same use case. I am trying to build a tiled terrain system and each tile has the same triangle strip indices, but with different height values for the position vertices. To save GPU resources, I would like to share the index buffer between multiple Meshes. There seems to be a |
Beta Was this translation helpful? Give feedback.
-
Actually came to a situation where this was necessary. I'm going to write an implementation next weekend if possible. edit. I did just notice you also mentioned that the UV should be unique per instance. This is not possible when sharing bufferdata. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to share attribute data between multiple meshes?
I'm thinking about this in the context of terrain where I may have many mesh chunks that all have the same indices and 2d vertex data. The terrain would be organized into blocks and each block would be subdivided into chunks. A block would have it's own heightmap and splatmap. A mesh chunk would have a unique set of UVs that are used to fetch the height/splat data from the corresponding block image in the vertex shader. Having the block subdivided into smaller chunks would allow for better frustum culling and enabling the splat lookup to use different palettes.
From what I can tell, it doesn't seem like it is possible to share attribute data today. Ideally, I'd like to be able to de-duplicate this data both on the CPU side and on the GPU side.
Perhaps VertexAttributeValues could be altered to store
Arc<Vec<T>>
instead ofVec<T>
andArc::ptr_eq
could be used to determine if the GPU buffer should be shared?Beta Was this translation helpful? Give feedback.
All reactions