-
Notifications
You must be signed in to change notification settings - Fork 942
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
Allow mesh for sole visualization purpose #2455
Comments
Yes, this is a good idea. |
Hi all – I just want to add my support for this feature request! Being able to tag “visual‐only” meshes would be extremely helpful for reducing overhead on large or decorative elements. I’d be happy to contribute by working on a PR to implement such a feature. If maintainers have any guidelines or suggested approaches, please let me know and I’ll get started. Thanks! |
I think that somehow adding meshes directly to the visual scene is probably not a good idea. If this is what the user wants it should happen further down the line from MuJoCo (in a hopefully-not-distant future world where MuJoCo has better interfacing with external renderers 🙂). However, adding meshes that are visual-only can speed up the compilation process significantly. This implies two things, in terms of MJCF API. asset/mesh/inertia wants a new attribute value: In one way, adding these attributes is easy, since all they do is skip existing code. However the real difficulty would be in writing the tests that assert that the behaviour is indeed correct, that make sure that no existing assumptions in downstream code are violated (which would need to be changed/fixed), and importantly, that the right errors are thrown if used inconsistently. So basically I would not recommend this project for an inexperienced contributor. |
Hey @yuvaltassa , thanks for explaining the complexity involved in this feature. I understand now that adding attributes like inertia="none" and convexhull="false" requires careful testing and changes under the hood. I’ll hold off on creating a PR for this specific enhancement until I’m more familiar with MuJoCo’s internals and test requirements. In the meantime, I’d love to contribute elsewhere—so I’ll look out for other issues or enhancements that might be a better fit. Thanks again! |
The feature, motivation and pitch
For some context, I don't think MuJoCo supports
material_index
mechanism to associate different faces of a mesh to multiple materials (colors) as some more dedicated renderers do. Two workarounds are:I go for the second approach, then encounter several strange bugs related to planar mesh (in <= 3.2.7). In 3.2.8, setting
inertia="shell"
resolves this issue. But even in upcoming 3.2.8, all meshes are forced to compute inertia, re-centering, and compute BVH, which is wasteful for sole visualization purpose. So, I hope MuJoCo could implement a flag to skip such process for certain meshes.As a generalization, currently MuJoCo supports
mjr_uploadMesh
to update mesh dynamically for visualization. But it only takes themeshid
-th mesh from the associatedmjModel
. Since MuJoCo stores meshes in a memory-efficient flat format, adding new meshes or adding / removing vertices from a mesh is very difficult. I think, mesh for sole visualization purpose could safely skip the whole MuJoCo core engine, and be supplied directly to the render context or visual struct.Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: