Commit Graph

4499 Commits

Author SHA1 Message Date
Haroon Qureshi 5a0809efaf Remove dependency on Texture from ObjectManager.
ObjectManger now manages low-level filament Texture and
Material objects directly. Moves the IBL Texture to the
SceneBridge class.

PiperOrigin-RevId: 900626110
Change-Id: Idd39464bfb324188dd54975a500954d4ebb29006
2026-04-16 03:24:21 -07:00
Haroon Qureshi a6b98e5a78 Keep track of the vertex attributes in a Mesh.
PiperOrigin-RevId: 900583030
Change-Id: I5b1ff5ad7b698e3e68fd06f44f2c5d3399d08504
2026-04-16 01:41:56 -07:00
Haroon Qureshi eacbce95f4 Fix CMakeLists file.
gui_view was renamed imgui_bridge

PiperOrigin-RevId: 900208849
Change-Id: I305a8a90306038c236256c21d04d2bad7144d83a
2026-04-15 09:37:06 -07:00
Kyle Bayes d9b3faf8f4 Remove thread_local EPA data in favor of using mjData stack.
PiperOrigin-RevId: 900201369
Change-Id: I82fbe9bf0ef9ea117c2124353d876dd42a57fb3a
2026-04-15 09:19:57 -07:00
Matija Kecman 7ac30a39fe Fix mj_loadXML hang in single-threaded WASM builds
The top-level CMakeLists.txt unconditionally added -pthread for all Emscripten builds, but PTHREAD_POOL_SIZE was only set when MUJOCO_WASM_THREADS=ON. This gave the ST build a live pthread runtime with zero pre-spawned workers, causing CompileMeshesAndTextures to deadlock when it tried to spawn a ThreadPool on the main thread.

Fix by making -pthread conditional on MUJOCO_WASM_THREADS. Without -pthread, hardware_concurrency() returns 0 and the existing nthread < 2 guards naturally select the serial compilation path.

PiperOrigin-RevId: 900191420
Change-Id: I0481b81fc6f7cccb52c7d7592dcf9dd317b5bad1
2026-04-15 08:57:04 -07:00
Haroon Qureshi e047f1101a Rename GuiView to ImguiBridge.
PiperOrigin-RevId: 900186368
Change-Id: Ie8f08d081dbc9a2b5638b5e799788e81891c908a
2026-04-15 08:44:00 -07:00
Yuval Tassa a2d0e33c0f 2-3x speedup of sparse matrix squaring.
Split symbolic and numeric phases for sparse `M'*diag*M` computation. Microseconds per call for the monolithic vs the split approach for the 100_humanoids and 2humanoid100 models:

```
+-------+------+----------+------------+---------+
| Model | Arch | Col (µs) | Split (µs) | Speedup |
+-------+------+----------+------------+---------+
| 2H100 | x86  | 238.3    | 74.5       | 3.2x    |
+-------+------+----------+------------+---------+
|       | ARM  | 111.6    | 53.2       | 2.1x    |
+-------+------+----------+------------+---------+
| 100H  | x86  | 1325.3   | 656.2      | 2.0x    |
+-------+------+----------+------------+---------+
|       | ARM  | 594.8    | 306.6      | 1.9x    |
+-------+------+----------+------------+---------+
```

PiperOrigin-RevId: 900154308
Change-Id: Ia6e9b8e196e2ed37b723a0faf60e9731303a9619
2026-04-15 07:19:41 -07:00
Haroon Qureshi 62cffb1536 Update GuiView to use SceneView and Renderables.
PiperOrigin-RevId: 900145167
Change-Id: I613c9fe171e97f8a4cd08c0c63e9706e09cbd202
2026-04-15 06:56:16 -07:00
Yuval Tassa 8f3ed662eb Hoist solver stack allocations out of iteration loop
PiperOrigin-RevId: 900085248
Change-Id: I2bde8fafc8a4801a92c39aa9a13af0ea7475843d
2026-04-15 04:23:08 -07:00
Haroon Qureshi f24f9ef44d Allow submeshes to be set when adding meshes to a Renderable.
Also add support for blend order.

PiperOrigin-RevId: 900061778
Change-Id: I601757a8672fed23e45defd4cdbe4e9526ea3b70
2026-04-15 03:25:55 -07:00
Matija Kecman 9289905c9a Make StepControlGui a reusable component and refactor/simplify the implementation
PiperOrigin-RevId: 900045404
Change-Id: I9976ece042710ddce0a7c5d99a6ac85a0ef06d2f
2026-04-15 02:48:11 -07:00
Haroon Qureshi d913e0b1e9 Add ReadPixels function to RenderTarget.
PiperOrigin-RevId: 900017779
Change-Id: I0632b66124632558ea19157e4ca319e4b0d10617
2026-04-15 01:39:54 -07:00
Michael Moss 4a98cc8bff Update MuJoCo version to 3.7.1 following the 3.7.0 release
PiperOrigin-RevId: 899835826
Change-Id: Ibe247b921e7dad7184acef69ee3199fec79c6e24
2026-04-14 16:49:03 -07:00
Taylor Howell 8bf11166b1 Import google-deepmind/mujoco_warp from GitHub.
PiperOrigin-RevId: 899731493
Change-Id: Ib563023047e85db1aff56e78724dc28d769ef91e
2026-04-14 12:55:31 -07:00
Alessio Quaglino 5724158593 Refactor flex stiffness storage to support variable sizes.
This change introduces `nflexstiffness` and `flex_stiffnessadr` to allow flex stiffness matrices to have sizes other than the fixed 21 per element. Higher-order flexes can now store larger stiffness matrices based on their number of nodes. The `flex_stiffnessadr` array provides the starting index for each flex's stiffness data within the `flex_stiffness` array.

PiperOrigin-RevId: 899632263
Change-Id: Ie49182c46c3777acf0c6b492345edfcf62fb5e44
2026-04-14 09:39:00 -07:00
Haroon Qureshi 08bb6e66f1 Small fixes to decor rendering.
Use an unlit material for decorative elements and do not render them
in the reflection pass.

PiperOrigin-RevId: 899560291
Change-Id: I3b035d556432c850ce8240e0c4c4c2d6645d7bf2
2026-04-14 06:50:51 -07:00
Michael Moss 72cb2b210d Update changelog for the 3.7.0 release.
PiperOrigin-RevId: 899497703
Change-Id: Ib9ec75550615dc245bc66af60c877e8adae17e67
2026-04-14 04:10:38 -07:00
Haroon Qureshi aef0589442 Allow Light objects to be image based lights.
PiperOrigin-RevId: 899488765
Change-Id: I3b56fc6499404bb011f9361c03dba23b736ad4bc
2026-04-14 03:49:26 -07:00
Haroon Qureshi fd5a7004f8 Remove Drawable abstraction.
Instead, use a set of functions to create/update a Renderable
from an mjvGeom.

This completely isolates mjvScene/mjvGeom from SceneView,
making SceneView a more general purpose class.

PiperOrigin-RevId: 899475268
Change-Id: I48a3a45bc8fff3e1f514847c7a1ca8ab3a1ff16e
2026-04-14 03:13:55 -07:00
Michael Moss 171e6dc177 Automated rollback of PiperOrigin-RevId: 899009633.
*** Original change description ***

Add protocols for authoring simulation environments. This is for preview only, we discourage users from using this in production code.

PiperOrigin-RevId: 899425542
Change-Id: Ifb6c5d3b762789d821bfa9826f5d6d983e8af7d3
2026-04-14 01:16:35 -07:00
Haroon Qureshi 82e021fcda Fix UI material; it no longer requires featureLevel 0.
PiperOrigin-RevId: 899400551
Change-Id: I7a2d42cd5342ed079599eef50e85c50aa340aecc
2026-04-14 00:13:47 -07:00
Google DeepMind 8135465779 Remove usages of texture2D and other FL0 features that are obsolete due to FL0 now going through spirv-cross.
This is an early upload of https://github.com/google/filament/pull/9867 and necessary material changes

Original PR commits:
FL0 materials are always compile via spirv-cross
postfx materials now support sRGB emulation in FL0

PiperOrigin-RevId: 899262890
Change-Id: I52c002d60790d84269674c1f0d0c5f7d6a58000c
2026-04-13 17:31:29 -07:00
Yuval Tassa 412cee2059 Add Jdot correction for connect and weld constaints
Measured reduction in constraint violations before/after this change:

| Model | Correction ON (Avg Viol) | Correction OFF (Avg Viol) | Reduction |
| :--- | :--- | :--- | :--- |
| `jdotv_connect_2d.xml` | 3.959e-4 | 1.699e-3 | **76.7%** |
| `jdotv_connect_3d.xml` | 1.399e-3 | 5.493e-3 | **74.5%** |
| `jdotv_weld_3d.xml` | 9.472e-3 | 1.148e-2 | **17.5%** |

PiperOrigin-RevId: 899137525
Change-Id: Ic3e33764ebd64239bab916289c23d80c3da0b51b
2026-04-13 12:48:03 -07:00
Yuval Tassa 0c337799bd Implement midpoint integrator for free bodies.
PiperOrigin-RevId: 899043541
Change-Id: I0bb38f6ad94e189b45ab16777a04ad6fefc6adf7
2026-04-13 10:58:49 -07:00
Copybara-Service d9b5d8babb Merge pull request #3216 from tkelestemur:mjx-render-batched-unpackers
PiperOrigin-RevId: 899017204
Change-Id: I7409a00cff81a1d24afe2ca50ec14c2f25c103ea
2026-04-13 10:58:20 -07:00
Sam Haves 7ae07d8157 URDF parsing no longer strips filepaths by default.
This default forces users to use the `spec.assets` dictionary or to do other filepath gymnastics when loading URDF. Instead we encourage users to just modify file paths directly if necessary.

PiperOrigin-RevId: 899009853
Change-Id: I4bb84606a95b65be79ccc77ccbe78062d6de8773
2026-04-13 10:57:52 -07:00
Tom Erez f55aeb04fa Add protocols for authoring simulation environments. This is for preview only, we discourage users from using this in production code.
PiperOrigin-RevId: 899009633
Change-Id: I2de08c5cc4ece69fa135f3fd02df7542bf66d7d0
2026-04-13 10:57:25 -07:00
Yuval Tassa c004d144d1 Correct DC motor derivative calculation and enforce actearly.
PiperOrigin-RevId: 898983657
Change-Id: I008529eacf3e400696d26bd3a52a4cf4c1c12225
2026-04-13 10:56:58 -07:00
Haroon Qureshi bc83c24a4d Rename Renderables to Renderable.
PiperOrigin-RevId: 898904688
Change-Id: I5e52708e4f745ef1d0e4281a7fa1aa29b660bb6a
2026-04-13 10:56:30 -07:00
Haroon Qureshi b38aa0fa23 Move Material into Renderables.
PiperOrigin-RevId: 898873853
Change-Id: I3ef13e44c16334c52ea6f08dbc44fde23096ef4c
2026-04-13 10:55:59 -07:00
Haroon Qureshi 126d5b67e3 Remove ModelObjects and ObjectManager members from Drawable.
Split up the Update function into parts and allow SceneBridge
to call them individually, passing in the ModelObjects or
ObjectManager as needed.

PiperOrigin-RevId: 898851732
Change-Id: I25c6bf920b85caa7b2ddee045475f11fb7a8bac8
2026-04-13 10:55:30 -07:00
Michael Moss 45c6137ec2 Update dependencies ahead of the 3.7.0 release.
PiperOrigin-RevId: 898652802
Change-Id: I74668a5116e8d1b81b61c5b5e94680d08f72bc33
2026-04-13 10:55:01 -07:00
Yuval Tassa 239aa1f856 Minor updates to documentation across multiple sections.
PiperOrigin-RevId: 898652783
Change-Id: Idb671910c18ed3406722b8a1307f97ae9a194139
2026-04-13 10:54:28 -07:00
Tom Erez c08d181d52 Add protocols for authoring simulation environments. This is for preview only, we discourage users from using this in production code.
PiperOrigin-RevId: 897908600
Change-Id: Ib2fa1ca8527665a99a8f31e9320afb5f54c31035
2026-04-13 10:50:26 -07:00
Tom Erez bd4ee537b8 Add protocols for authoring simulation environments. This is for preview only, we discourage users from using this in production code.
PiperOrigin-RevId: 897857927
Change-Id: I82ce0a23465429e7025334e83ba00dfbe5085649
2026-04-13 17:19:19 +00:00
Yuval Tassa f114ea8038 Optimize mj_tendonBias by computing Jdot * qvel directly
PiperOrigin-RevId: 897628283
Change-Id: Iee26a95d6aaa379730b89be14746308742111e2d
2026-04-10 04:57:55 -07:00
Yuval Tassa 025ba59fab Implement sparse Jacobian time derivative
PiperOrigin-RevId: 897609541
Change-Id: Ic86b6026cfc369c584d3edfe12a9a2fd14cc4357
2026-04-10 04:08:06 -07:00
Alessio Quaglino 6b724616c0 Prevent deletion from an attached mjSpec.
This change disallows calling `mjs_delete` on an mjSpec that has been attached to another mjSpec via `mjs_attach`. Attempting to delete an element from an attached spec will now result in an error. The Python bindings for `mjSpec.delete` have been updated to raise a ValueError when this occurs.

PiperOrigin-RevId: 897266695
Change-Id: Ic0670125a3028191ec50eca890f02b5910ec8b03
2026-04-09 13:14:00 -07:00
Sam Haves a744b366fb Include obj and stl decoder plugins as sources in CMake builds.
This removes the need to load these decoders via mj_loadAllPluginLibraries when using MuJoCo built with CMake. Other plugins are unchanged.

PiperOrigin-RevId: 897114719
Change-Id: Iee914cc5e05798186f384a67901f1cf86bc2f887
2026-04-09 07:58:28 -07:00
Yuval Tassa 81720071b8 Changes to dcmotor:
- Remove `lugre:viscous`, should now be added directly to actuator `damping`. Trying to do this for the user was incompatible with default inheritance (compounding instead of overriding).
- Move voltage limiting from the `saturation` to the `controller` attribute.
- Fix indexing issues in default inheritance.

PiperOrigin-RevId: 897087642
Change-Id: I5388c2633e15c7e223992e7eb5d6a28db75a6438
2026-04-09 06:52:45 -07:00
Haroon Qureshi 26fb65c7a7 Expose Drawable Material allowing users to manipulate it directly.
PiperOrigin-RevId: 897079632
Change-Id: Iec51ab30dc087562b8e6a464e122525f144e73a9
2026-04-09 06:34:53 -07:00
Haroon Qureshi f6baacfa86 Remove ObjectManager dependency from Material.
PiperOrigin-RevId: 897056556
Change-Id: Ic02239d7a411b52333b48a069292b21afb547b19
2026-04-09 05:34:18 -07:00
Tarik Kelestemur 1c310ca7be keep render util test setup
Restore the existing Warp/CUDA-gated render_util test setup so the review change stays minimal while preserving the new batched shape coverage.

Made-with: Cursor
2026-04-09 08:14:15 -04:00
Haroon Qureshi edc807895f Split SceneView into two parts: SceneView and SceneBridge.
SceneView owns the filament Scene, View, and Camera objects.
is responsible for rendering the Scene (to which Entities
have been added).

SceneBridge takes the mjvScene as an input and updates the
corresponding light and drawable Entities in the SceneView.

PiperOrigin-RevId: 897007401
Change-Id: I3ec245f5bd48c3654672b11a55fb011f113454cc
2026-04-09 03:32:57 -07:00
Kyle Bayes 229d821915 Enable multiccd for golden data.
PiperOrigin-RevId: 896996806
Change-Id: I7f842d25b4497e135831879e4ac1b268d0307aa6
2026-04-09 03:07:01 -07:00
Tom Power cc0933af8b Add com_pos to Mujoco Warp shims.
PiperOrigin-RevId: 896969879
Change-Id: Idc3eb067a8473251a98404525df0c8c134ac2032
2026-04-09 02:12:17 -07:00
Tom Power 05e26e961c Refactor: Expose flex-related fields directly on mjx.Model.
PiperOrigin-RevId: 896958292
Change-Id: I94b32048e69d2b6844db0911f037318d5fbf4a6a
2026-04-09 01:43:00 -07:00
Sam Haves f2461f9ce6 Modify mj_PLUGIN_LIB_INIT to support multiple plugins in the same compilation unit.
Previously on MSVC we used DllMain to register plugins, you cannot have multiple definitions of DllMain in a single unit so you would get errors if you tried to register two plugins. This modifies the implementation to insert a function pointer into the C runtime initialization instead.

PiperOrigin-RevId: 896612678
Change-Id: I07732147b955d741c836acff6da986db0e9b9eff
2026-04-08 11:35:16 -07:00
Tarik Kelestemur de39128114 fix render batching 2026-04-08 14:09:45 -04:00
Yuval Tassa 33fd2fe40e Improve mju_addToSclSparseInc with two-pointer loop.
Profiling `leaves.xml` with contacts disabled, this function takes up most of the time (in the implicit integrator). Total `testspeed` run time:

BEFORE: 18.5s
AFTER: 16.5
PiperOrigin-RevId: 896525902
Change-Id: I57f4a984d178956a2902212deb857bf53f53f01b
2026-04-08 08:49:15 -07:00