Commit Graph

4416 Commits

Author SHA1 Message Date
Mustafa Haiderbhai 5e677f1091 Update mjwarp render doc after flex rendering improvements 2026-03-27 13:01:16 -04:00
Haroon Qureshi e4f4044659 Move material multipliers to calling function.
PiperOrigin-RevId: 890457829
Change-Id: Icb4151a792321aadd3958d479ef02f29ae4a2afc
2026-03-27 08:06:57 -07:00
Haroon Qureshi e17e3bfd82 Remove ObjectManager dependency from Light.
PiperOrigin-RevId: 890454094
Change-Id: Idb609ad6d8ed7df714cad7b0aca997fee73ab96d
2026-03-27 07:57:43 -07:00
Haroon Qureshi 75bbf03cfb Add PBR test model.
PiperOrigin-RevId: 890431107
Change-Id: Ib3b5fa775daa93b4c798483df226585441ea5c61
2026-03-27 07:05:08 -07:00
Haroon Qureshi b31e15fbb8 Remove ObjectManager dependency from GuiView.
PiperOrigin-RevId: 890407310
Change-Id: I9548ee698fbd02d967581200ba2f6ec31e0f7a7c
2026-03-27 06:01:56 -07:00
Haroon Qureshi 1c2100e27c Refactor FilamentContext to prepare for upcoming changes.
Separate out the parts of the FilamentContext initialization that
depends on the mjModel into a separate Init function.

PiperOrigin-RevId: 890373341
Change-Id: I06b524668cd60dad804d437958f4f6606c46200b
2026-03-27 04:26:10 -07:00
Haroon Qureshi d597b23e5e Remove mjModel dependency from builtins.
PiperOrigin-RevId: 890372546
Change-Id: I1d6b99998e42c1d80072a04f5e57eaf5b4d49791
2026-03-27 04:24:09 -07:00
Haroon Qureshi f7fb23084d Remove mjrContext from FilamentContext.
Setting values in the mjrContext is only useful for the classic
renderer.

PiperOrigin-RevId: 890345656
Change-Id: Ie3d34dc260d13f74b569dcf575e88dde894d652b
2026-03-27 03:13:17 -07:00
Yuval Tassa 9f5fc99711 Convert monolithic RecompileCompare and WriteReadCompare tests into test suites, one test per file.
PiperOrigin-RevId: 890149850
Change-Id: Ib3e8c032a7b43b4a3f85e7a922e25987050cd77c
2026-03-26 18:21:49 -07:00
Haroon Qureshi 0021564035 Remove unused member variable.
PiperOrigin-RevId: 889775964
Change-Id: I8464d381158875c22437633dfbb548c10dc89462
2026-03-26 05:18:01 -07:00
Haroon Qureshi a25b9376f0 Remove unused variable.
PiperOrigin-RevId: 889771550
Change-Id: I8b89e6ccf0a896461b9ddadc23f57e003ea7f8da
2026-03-26 05:07:28 -07:00
Michael Moss f28e727a57 Ignore new tsc deprecation warning from emscripten.
PiperOrigin-RevId: 889322248
Change-Id: I70be60506a8ecbc0dde0f64f5a31c075a804706e
2026-03-25 10:38:57 -07:00
Yuval Tassa c000724a53 Update references.h
PiperOrigin-RevId: 889270962
Change-Id: I0d4295b936e00c55846ea4f6e13f7c25c36c5c6b
2026-03-25 08:59:15 -07:00
Haroon Qureshi 07fc5bc736 Fix build.
PiperOrigin-RevId: 889270417
Change-Id: I4052639054f98c1775357797a80b3049e31b18c7
2026-03-25 08:58:04 -07:00
Haroon Qureshi 4fce53c31f Detect KTX files as image/ktx.
PiperOrigin-RevId: 889260070
Change-Id: I93a505bca3da87d05c71fe302f9e7ac31806ab90
2026-03-25 08:32:28 -07:00
Sam Haves 10c5f5d066 Add comments to mjpEncoder member functions.
PiperOrigin-RevId: 889233466
Change-Id: Ia08ae7ef9bd554cea2f82270e8f150db3e01bf69
2026-03-25 07:33:10 -07:00
Haroon Qureshi 1bfd68cbba Adds function for creating the filament Platform based on the renderer
configuration.

PiperOrigin-RevId: 889226229
Change-Id: Ia5bcdc16e9861e39c49422c2d5fccee23e477af6
2026-03-25 07:15:58 -07:00
Alessio Quaglino c49bc7c7c0 Warn when a non-rigid flex has no constraints or passive forces.
Add a warning in user_model.cc if a flex is not rigid and has no edge equality constraints or passive forces (edge stiffness, edge damping, or vertex damping). Such flexes would not affect the simulation. A test case is added to verify the warning.

PiperOrigin-RevId: 889215981
Change-Id: I481128e1456921b632719547c676d201fdfbe931
2026-03-25 06:50:30 -07:00
Haroon Qureshi fd3ce4fe92 Implement reflective surfaces.
Reflective surfaces (planes) use a custom shader to blend their
texture with a texture that contains the reflected image. The
reflected image is rendered to a texture as a separate render
pass in the SceneView.

Because reflective textures are generated after the preparation
phase, additional functions are needed to reapply the texture
to the drawable.

PiperOrigin-RevId: 889213413
Change-Id: I7bad39d62e3e5ba38cf6ac667fec5b87bfa7b2a2
2026-03-25 06:43:46 -07:00
Haroon Qureshi 02b0b40b1c Add reflective materials.
A future CL will implement reflective surfaces and make use of these materials.

PiperOrigin-RevId: 889200524
Change-Id: Icbe5c0c390f89789ed0f5d5c6058a2ef31105608
2026-03-25 06:10:59 -07:00
Haroon Qureshi c61d239ac6 Use model name for window title.
PiperOrigin-RevId: 889193934
Change-Id: Ief9ade9e239c14da1d824d9bc8aa95dc0a71b65f
2026-03-25 05:53:47 -07:00
Haroon Qureshi 4df2fc2490 Ensure decoder has an error string.
We use that error buffer to check for errors.

PiperOrigin-RevId: 889193796
Change-Id: I1f7575321a57301b4ae5002d0c488bbb16a30b26
2026-03-25 05:52:46 -07:00
Sam Haves f5d3ce3451 Introduce mjpEncoder plugin architecture
Add a new mjpEncoder plugin type mirroring the existing mjpDecoder pattern.
Encoders serialize an mjSpec + mjModel to an mjResource for a given format.

New API functions:
- mjp_registerEncoder: globally register an encoder
- mjp_defaultEncoder: zero-initialize an encoder struct
- mjp_findEncoder: look up an encoder by filename extension or content type

The mjfEncode callback takes (mjSpec*, mjModel*, mjVFS*, mjResource*) and
returns 0 on success. Writing to mjResource keeps symmetry with the decoder
reading from mjResource and leaves the door open for writable resource providers.

PiperOrigin-RevId: 889187898
Change-Id: I180771b2255b91dea188ac5e2cdc3a8f0fb85364
2026-03-25 05:35:39 -07:00
Alessio Quaglino 2d33b50243 Parallelize tactile sensor computation.
The computation of tactile sensor values for each taxel is now parallelized using the MuJoCo threadpool when the number of taxels exceeds a threshold. Each thread processes a batch of taxels, accumulating forces from all colliding geoms.

PiperOrigin-RevId: 888606457
Change-Id: I98abf3e98a7318fc14080054bea7093ab46e8b8b
2026-03-24 05:21:08 -07:00
Alessio Quaglino f4e3469239 Add test for geom and mesh plugin attributes.
This test verifies that geom.plugin and mesh.plugin are accessible and can be assigned a plugin instance.

PiperOrigin-RevId: 888576511
Change-Id: Id17885de5fdf1f4543ac195a8b04bb01139d1bfa
2026-03-24 03:59:35 -07:00
Kyle Bayes 5c0de1f84d Remove model and data from ccd object. Each geom gets a copy of pos and mat, which is editable without modifying mjData.
PiperOrigin-RevId: 888028695
Change-Id: Ic9bbea4bcd7c2dbe62326798eab73d14da0aaa13
2026-03-23 04:51:53 -07:00
Haroon Qureshi babcfd6575 Add class to manage resources for a RenderTarget.
PiperOrigin-RevId: 888016283
Change-Id: I4959e63e95fad4f75a7a04fabf0879f0b9238f9f
2026-03-23 04:17:53 -07:00
Michael Moss 5664b9e89e Update pybind to 3.0.2.
PiperOrigin-RevId: 887980078
Change-Id: I2eb5284e878180293553e20c94dae853c380805c
2026-03-23 02:44:19 -07:00
Yuval Tassa 4b1667e4ce Fix documentation links
PiperOrigin-RevId: 886920783
Change-Id: Ie1ab433aeaaa668a103a684cbb30ef5375c6211b
2026-03-20 12:26:56 -07:00
Yuval Tassa 510d75f4cf Allow actuators to add damping and armature to joint and tendon transmissions.
PiperOrigin-RevId: 886899849
Change-Id: I02200ee0d4f7c96096d8188b95f823b566562a30
2026-03-20 11:41:15 -07:00
Copybara-Service f7bd6d15f7 Merge pull request #3164 from Balint-H:unity/passive-resubmit
PiperOrigin-RevId: 886821338
Change-Id: I2b733732fcc17223aad4299713f5528b597f03e8
2026-03-20 09:05:07 -07:00
Yuval Tassa c348bc9f4c Disable clang-format for MuJoCo public headers and engine source.
PiperOrigin-RevId: 886720463
Change-Id: I7c89fa99bee0598dcf48807bfbd61ee8bf8fa9b8
2026-03-20 05:06:15 -07:00
Michael Moss 904744bd72 Fix --gc-sections linking error on github macos-15-x86_64.
This forces `CMAKE_REQUIRED_FLAGS` to be treated as a string instead of list,
so none of the args get dropped when passed through `check_c_source_compiles`.

PiperOrigin-RevId: 886717366
Change-Id: I6314f9bfabd9d62bdcad5070c8801c453c381b79
2026-03-20 04:57:54 -07:00
Michael Moss 02d1d3d503 Fix call_guard usage inside .def_property calls.
See also [PR #5533](https://github.com/pybind/pybind11/pull/5533).

PiperOrigin-RevId: 886714838
Change-Id: I8c98461098ccf4958fb18bdcb5acc293c988c258
2026-03-20 04:50:50 -07:00
Yuval Tassa 9fa3f6f77e Enable float32 testing for most MuJoCo engine and user tests.
PiperOrigin-RevId: 886697701
Change-Id: I4a96fae03ea18494c3fcef8eb17b3b6f0863e9b7
2026-03-20 04:05:06 -07:00
Copybara-Service cab4b73f41 Merge pull request #3184 from MatiasManevi:single-thread-npm
PiperOrigin-RevId: 886334046
Change-Id: If054286ac11f2b0e13e770922c049e334d136ab1
2026-03-19 13:05:52 -07:00
Haroon Qureshi 6134fe48d9 Enable shadows depending on render settings.
PiperOrigin-RevId: 886236214
Change-Id: I6999e52ff3d9fc0734082312a77d6c033b69a24b
2026-03-19 09:59:50 -07:00
Haroon Qureshi eae31f0b3c Use model's num_quads for generating planes.
PiperOrigin-RevId: 886228541
Change-Id: I693f85edd84e4e1b1db6a932d4479888426bcae4
2026-03-19 09:44:53 -07:00
Michael Moss 779f6e8403 Save some CMake logs for debugging.
PiperOrigin-RevId: 886222847
Change-Id: Iaa641c334b3e90f594c6a19a29beefcf6eb7a3f4
2026-03-19 09:32:41 -07:00
Haroon Qureshi 7c63bcc8f3 Move Render logic into the Scene/Gui View classes.
This is in preparation for an upcoming change.

PiperOrigin-RevId: 886203890
Change-Id: I91eba35b394898d942f66f75e947c450b924a973
2026-03-19 08:50:41 -07:00
Taylor Howell 57bdf89d07 Import google-deepmind/mujoco_warp from GitHub.
PiperOrigin-RevId: 885715192
Change-Id: I13fcb8312c1515bb1bd2d6cdfd0d256e37cb74de
2026-03-18 11:58:25 -07:00
Kyle Bayes eec6e43a73 Bit compress face vertices in EPA to reduce memory needed. The parameter ccd_iteration is only supported to 1000, so we only need 10 bits for vertex index.
PiperOrigin-RevId: 885690198
Change-Id: I4c6af170ddc86316d3e9cfaf7ca7e0e4fac8a416
2026-03-18 11:10:14 -07:00
MatiasManevi b1c7ae1c19 Restore PTHREAD flag 2026-03-18 13:13:05 -03:00
MatiasManevi 9561decf64 Remove PTHREAD flag 2026-03-18 13:04:04 -03:00
MatiasManevi b35a5bab5e Shorten mv instruction 2026-03-18 12:10:08 -03:00
Alessio Quaglino e57d95e68f Remove vertcollide attribute from flex contact.
The `vertcollide` attribute in flex and flexcomp contact specifications has been removed since the next mjWarp release will support flex collisions. This attribute was previously used to enable vertex-based collisions by adding sphere geoms at flex vertices. The functionality associated with this attribute has been deprecated and removed from the XML parser, documentation, and internal data structures. Affected example XML files have also been updated.

PiperOrigin-RevId: 885595503
Change-Id: I6a78975f1bc540c09ea8b5306ff3be0962b7ab24
2026-03-18 07:59:57 -07:00
MatiasManevi 65d8d26af6 Add newline 2026-03-18 11:50:06 -03:00
MatiasManevi b694e9e951 Change caution for note 2026-03-18 11:49:19 -03:00
MatiasManevi aa07cdde5c Add documentation 2026-03-18 11:48:11 -03:00
MatiasManevi 8b7951c20c Add single threaded version 2026-03-18 11:18:41 -03:00