You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the filamesh util to create a .filamesh file and the filamesh::MeshReader to load this mesh, it creates the vertex and index buffers together with a utils::Entity which represents a renderable:
When I want to create multiple instances of this mesh (e.g. rendering many trees of the same mesh) what is the recommended approach? Do I load the mesh, keep it around and create new renderable entities for each instance I want to draw?
If this is the case you would need to copy the properties of the entity. Some can be retrieved via the getters in RenderableManager.h like getPrimitiveCount(), getMaterialIntanceAt().
But how would I get the values for the calls to setGeometryAt()? The utils::Entity aka renderable does not have getters that allow me to retrieve all the necessary information and the filamesh::MeshReader doesn't keep the necessary info either.
This is just a simple helper API for samples or simple apps, it’s not meant to do more than it provides. You would indeed have to create multiple renderables. To do so you’d need to expose the information about each part. Note that the filamesh format is fully documented in the readme file of the filamesh tool if you want to create your own more advanced loader.
If you craft a glTF and create multiple node objects that reference the same mesh object, gltfio will do the right thing by sharing the same VertexBuffers and IndexBuffers amongst several renderables. That other issue you referenced is more about efficiently instancing the entire glTF asset.
When I use the
filamesh
util to create a.filamesh
file and thefilamesh::MeshReader
to load this mesh, it creates the vertex and index buffers together with autils::Entity
which represents a renderable:When I want to create multiple instances of this mesh (e.g. rendering many trees of the same mesh) what is the recommended approach? Do I load the mesh, keep it around and create new renderable entities for each instance I want to draw?
If this is the case you would need to copy the properties of the entity. Some can be retrieved via the getters in
RenderableManager.h
likegetPrimitiveCount()
,getMaterialIntanceAt()
.But how would I get the values for the calls to
setGeometryAt()
? Theutils::Entity
aka renderable does not have getters that allow me to retrieve all the necessary information and thefilamesh::MeshReader
doesn't keep the necessary info either.This seems to be somewhat related to
gltfio
and this issue: #1513.The text was updated successfully, but these errors were encountered: