Commit Graph

2085 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Yuval Tassa 0e04436d51 Remove `mjWARN_VGEOMFULL, handle visual geom buffer full warnings in mjvScene`.
PiperOrigin-RevId: 896483023
Change-Id: I6dde2c20d8e8e229cf95e1f002dd10525d3376e6
2026-04-08 07:17:53 -07:00
Haroon Qureshi c6a434a408 Move flex/skin Mesh creation into ModelObjects.
PiperOrigin-RevId: 896419032
Change-Id: Ib0f0cd0c80c9f630127f2f72dbaed7c644046663
2026-04-08 04:38:10 -07:00
Haroon Qureshi 87b0ea785e Move UpdateMeshData into model_objects.cc.
PiperOrigin-RevId: 896346482
Change-Id: Id57586d652faca75d07ccfe0cee72e97afc823fc
2026-04-08 01:48:38 -07:00
Haroon Qureshi 49b45bd993 Merge vertex_util into math_util.
PiperOrigin-RevId: 896071837
Change-Id: Ieec0e4b4b11988805219739a84f413871ae34f1b
2026-04-07 13:53:27 -07:00
Haroon Qureshi f7fd5fc58b Rename RenderTargetAndTextures to RenderTarget.
Also rename render_target_util to render_target.

PiperOrigin-RevId: 896033907
Change-Id: I123cf98dc308f7cc4916f7b79dcc59a05564022d
2026-04-07 12:30:39 -07:00
Yuval Tassa 382474bb9d Minor improvements to dcmotor
PiperOrigin-RevId: 895907301
Change-Id: Ia50a6d06c1ede9894cc71f375db837d104f0211e
2026-04-07 08:11:13 -07:00
Haroon Qureshi b61d304126 Rename buffer_util to mesh.
PiperOrigin-RevId: 895897940
Change-Id: Ic6d4315fd6429efda81d24168548271a1a1f03c5
2026-04-07 07:49:38 -07:00
Haroon Qureshi a3c9115d1e Use MeshData struct for creating Meshes.
Consolidate all Vertex and Index buffer creation inside the
Mesh class. Users now set data pointers in the MeshData
from which the Mesh class will create the filament buffers.

PiperOrigin-RevId: 895871213
Change-Id: Ie086fcb5c31adf90e54cba168b03501e21720726
2026-04-07 06:41:36 -07:00
Matija Kecman 9f3babd60c Group platform components into descriptive subfolders
PiperOrigin-RevId: 895832492
Change-Id: I6cc56b0e4b002b2998579cde95f4b88dfbd88184
2026-04-07 04:58:32 -07:00
Haroon Qureshi 6273331d82 Define a struct that can be used to create a Mesh.
A future change will update all callers to use this
method for creating Meshes after which we will remove
the constructor that takes explicit filament objects.

PiperOrigin-RevId: 895807063
Change-Id: I50833817961ae57fbb9ed6b875c1ef286b9fdd26
2026-04-07 03:58:21 -07:00
Haroon Qureshi 28d8ddcbeb Rename FilamentBuffers class to Mesh.
Update the Mesh class so that it manages the lifetime of the
vertex and index buffers.

PiperOrigin-RevId: 895794022
Change-Id: I5eda578b8b7ed7f918e792f6181ec724729b5215
2026-04-07 03:24:40 -07:00
Yuval Tassa 70a7647ad9 Add <dcmotor> actuator and related docs and tests.
PiperOrigin-RevId: 892927987
Change-Id: I38ed6412801341ba03ddf5fe7b93a6081df24d37
2026-04-01 07:50:23 -07:00
Haroon Qureshi 6da210c794 Rename texture_util to texture.
PiperOrigin-RevId: 892868713
Change-Id: I113132dc9e4535e94d48c4e71520acb159e2e216
2026-04-01 05:14:47 -07:00
Haroon Qureshi 565e46da42 Update GuiView to use Texture class.
PiperOrigin-RevId: 892866156
Change-Id: I2a2e9ef51df51472b675d69edcf2d5ba291721ea
2026-04-01 05:06:08 -07:00
Haroon Qureshi 9fa9193a62 Split Texture creation into two structs.
TextureConfig describes the properties of the texture (e.g.
width, height, pixel format, etc.).  TextureData contains
the binary payload of the texture.

PiperOrigin-RevId: 892854578
Change-Id: I604b926ac38ff1050cac8fdf9ec767b789c0798e
2026-04-01 04:32:22 -07:00
Haroon Qureshi 95666da039 Introduce a Texture class that wraps filament::Texture.
PiperOrigin-RevId: 892839636
Change-Id: I3c08fba0a514cfb758ec2842d8510c6d88300874
2026-04-01 03:52:05 -07:00
Haroon Qureshi 6d32038417 Move all texture creation functions into texture_util.
PiperOrigin-RevId: 892838123
Change-Id: I84a536b111c3d6b5391513d6623c2e9a4d02f3df
2026-04-01 03:47:51 -07:00
Haroon Qureshi d4103939e4 Correctly compute bounding boxes for meshes.
Enable culling when bounding box is available.

PiperOrigin-RevId: 892289875
Change-Id: I124426b6e7e72f4d9a1486320d72d6eb032e0828
2026-03-31 05:58:11 -07:00
Haroon Qureshi 06d6bda5bb Factor out mjModel-specific objects from ObjectManager.
All objects that are specific to the mjModel (meshes, textures, etc.)
are now managed by a ModelObjects class which is owned by the SceneView
and not the FilamentContext.

PiperOrigin-RevId: 892250776
Change-Id: Iddad66fd3ab1a60c4becdcb5d0c935ed9ea8ad90
2026-03-31 04:16:51 -07:00
Haroon Qureshi bcaa0a8e6a Use mjrf functions from within other mjrf functions.
PiperOrigin-RevId: 892234323
Change-Id: I70ff01121764b552da84bdcc9b01527ae138dfea
2026-03-31 03:37:26 -07: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