Commit Graph

498 Commits

Author SHA1 Message Date
Saran Tunyasuvunakool 2345663efb Change title to "MuJoCo Live" and respect system colour scheme.
PiperOrigin-RevId: 916183118
Change-Id: I760be720cb001038e993383a5e523a2de8496a7c
2026-05-15 14:26:48 -07:00
Haroon Qureshi b540909f18 Ensure swap chains are resized appropriately.
The swap chain dimensions are a union of all render request
viewport sizes that use the swap chain.

PiperOrigin-RevId: 916078573
Change-Id: If26a9e1486006ed346227120a361773bfa23f292
2026-05-15 10:43:52 -07:00
Haroon Qureshi d5872acec8 Use RGB8 for segmentation colors.
PiperOrigin-RevId: 916061579
Change-Id: I0c1270cb71a9a4476a54b3bf6049981ed30f229f
2026-05-15 10:10:35 -07:00
Saran Tunyasuvunakool a03191b9e8 Add a github: resource provider scheme to MuJoCo Live.
This resolves to https://raw.githubusercontent.com/... under the hood.

PiperOrigin-RevId: 916050807
Change-Id: I1630e29a5b5aad0e39cdd8aa4cfc1ff1a71f19d9
2026-05-15 09:48:22 -07:00
Haroon Qureshi 99b01b9f87 Make wireframe rendering a draw mode.
PiperOrigin-RevId: 916042943
Change-Id: Ifbf0033bfc0607c7808d90423648deb0296056a3
2026-05-15 09:30:55 -07:00
Haroon Qureshi 766f519576 Move some scene settings into render request struct.
Reflections, shadows, and post-processing can be specified per render
request rather than per scene.

PiperOrigin-RevId: 915910030
Change-Id: I8ce773b42870aa76a2d8219347ca1cafaec1a97b
2026-05-15 03:23:25 -07:00
Haroon Qureshi 85bf2b9660 Move GetMaterialType into material module.
PiperOrigin-RevId: 915895534
Change-Id: Ic7e9d52374131aa93445f90cf2208f6c93d123f4
2026-05-15 02:45:31 -07:00
Haroon Qureshi 9c372fbbea Minor cleanup to scene_geom_util.
PiperOrigin-RevId: 915367694
Change-Id: Ia20c3ba050d9f364da5c26f0812bf9a9c5763cd6
2026-05-14 04:54:28 -07:00
Saran Tunyasuvunakool e47809d50d Refactor MuJoCo Live to separate out HTML, CSS, and JS components.
PiperOrigin-RevId: 915340338
Change-Id: Ic62b9d640af9967a59a77fa59a3556b916d5a24c
2026-05-14 03:39:42 -07:00
Saran Tunyasuvunakool f7e00d041e Add commit hash and remove "Upload File" button from MuJoCo Live.
PiperOrigin-RevId: 914909503
Change-Id: I084d888eb5093b4278e758697bff43ff941c79d0
2026-05-13 09:34:47 -07:00
Haroon Qureshi 69a1087e9e Disable window resizing on load as it breaks on some platforms.
PiperOrigin-RevId: 914774489
Change-Id: I9aea71b386de93f4d2fc3da5310dd7a3018c8c1c
2026-05-13 03:59:46 -07:00
Yuval Tassa a4e49f2dff Margin and gap redesign (breaking change)
PiperOrigin-RevId: 914329812
Change-Id: I905665e4c1965bdb8b90587e5b1277cfbfe5cce0
2026-05-12 09:43:43 -07:00
Haroon Qureshi 58abf3d4ae Fix dependency between FilamentContext and SceneView.
Removes the DoRender and DoReadPixels functions which allowed
FilamentContext to "call" SceneView functions even though
SceneView depended on FilamentContext.

Adds a mjrf_setClearColor function so that we no longer rely
on SceneView setting the clear color.

PiperOrigin-RevId: 914253362
Change-Id: I33c1cc9dfc7cb2f4c3cc855a600cccb0c54ae31c
2026-05-12 06:37:51 -07:00
Haroon Qureshi 3f3ff85a59 Enable backface culling by default.
Disable only for geom types that need it (planes and triangles).

PiperOrigin-RevId: 914211570
Change-Id: Id95e32924122789111f561d922110128b3f56c77
2026-05-12 04:41:10 -07:00
Haroon Qureshi 5339d9154e Ensure faces for meshes are correctly oriented.
This is in preparation for a future CL that will disable backface culling.

PiperOrigin-RevId: 914136370
Change-Id: Ie8db1268faaa306c3f3356efc5e1305d791cf525
2026-05-12 01:27:31 -07:00
Haroon Qureshi 5d818306ef Save/restore window size in UX settings.
PiperOrigin-RevId: 913695007
Change-Id: I3366b11a5de53292d4ffe0e4c46f866381624788
2026-05-11 07:44:09 -07:00
Haroon Qureshi 4e2064b26f Fix skin/flex rendering by setting size to 1 (not 0).
PiperOrigin-RevId: 912993245
Change-Id: Ib81f58bd8d474decea469cafa40d57f053eee516
2026-05-09 08:39:14 -07:00
Haroon Qureshi b9a1fad99b Fix segmentation/depth rendering.
PiperOrigin-RevId: 912674769
Change-Id: Iba525679630e7996bc27d916e61e5a265a147061
2026-05-08 13:40:37 -07:00
Yuval Tassa 531a571dda studio: replace separate Solver and Performance charts with a unified Profiler, bound to F3
Combines the "Solver" and "Performance" chart windows into a single "Profiler" window for better ergonomics and visual layout:
- Unified Dashboard: Groups the Solver block (Counts & Convergence) and the Performance block (Dimensions & CPU Time) in a single viewable window that scales cleanly without vertical scrollbars.
- Adaptive Stacking: Uses ImGui grouping so each block internally stacks its charts vertically, but tiles side-by-side horizontally when the window is stretched wide.
- Default Docking & Width: Integrates the Profiler into the default dockspace layout attached to the right of the main viewable area, with an optimized initial width scaling factor of 0.42.
- Shortcut and Menus: Adds a toggle shortcut bound to `F3`, updates the Help Shortcuts overlay, and replaces old separate entries in the Charts menu.

PiperOrigin-RevId: 912491435
Change-Id: I1f9215e5498866a01ce48b6aeb4a7461191fa01d
2026-05-08 06:25:31 -07:00
Haroon Qureshi 395a002801 Small usability fixes.
- allow reloading of files that failed to load
- clear errors on successful reload

PiperOrigin-RevId: 912458744
Change-Id: Ie6af87508f10e83461bc998c99c9c66e2d58312e
2026-05-08 04:50:13 -07:00
Yuval Tassa 2ad01960c6 Studio UI tweaks
- RHS: Make Inspector be focused by default.
- RHS: Remove Noise pane, put the functionality in the Controls pane.
- Improve Frame and Label dropdowns.

PiperOrigin-RevId: 912434712
Change-Id: I2ee5b647febfc4a90a0cf9387b1d416f5a0dd4a1
2026-05-08 03:33:16 -07:00
Michael Moss 3ef083eecc Allow the Studio build script to be run outside the git checkout.
PiperOrigin-RevId: 912421771
Change-Id: Ie355d2f59cd43166ab06aa49349d87a0f5f9151c
2026-05-08 02:51:53 -07:00
Sam Haves b7b96d2acc Remove explicit mjz linking from studio.
PiperOrigin-RevId: 912157162
Change-Id: Ie5a229836cfe2c4af1b2f3cc9de9f03623b5d815
2026-05-07 14:35:18 -07:00
Sam Haves eddfbcfc50 Move mjz_decoder out of experimental to xml/mjz.
Since the mjz format is just an archive for MJCF assets this seems like a sensible place. The upcoming mjz encoder will also need to make use of the full precision XML utility that is local to src/xml.

PiperOrigin-RevId: 912044746
Change-Id: I6a9fef24b1c3fec5b5edc3a8d4c8e22584273264
2026-05-07 10:52:03 -07:00
Haroon Qureshi 5f36cb9e64 Add/cleanup documentation.
PiperOrigin-RevId: 912014433
Change-Id: I8f05d482e07ed58588f5847d470e5420e5c09f3a
2026-05-07 09:52:04 -07:00
Haroon Qureshi 730ecceda1 Add SDF support.
PiperOrigin-RevId: 912007379
Change-Id: I89ebf6bbabca08656932d028b27f1fbe48178986
2026-05-07 09:37:18 -07:00
Haroon Qureshi abea65b0be Simplify materials.
Merge shading model, material params, and material textures into a
single "mjrMaterial" type.

Remove redundant decor_line material.

PiperOrigin-RevId: 911960222
Change-Id: Icce3772a8ea48467dfd610799c0c2f2ba752323e
2026-05-07 07:51:15 -07:00
Haroon Qureshi d5c5a989f2 Use viewport instead of width/height.
PiperOrigin-RevId: 911942457
Change-Id: I2d6d52a8bb6b1b10d69956cce9e5d7f62e7d1f1c
2026-05-07 07:06:35 -07:00
Haroon Qureshi 8b06fe4c16 Remove invalid dlfcn.h include.
PiperOrigin-RevId: 911924226
Change-Id: Id5c05745ee8dbdd4e5518e8c6ff5feb0b9972bb5
2026-05-07 06:13:08 -07:00
Haroon Qureshi 364c716f08 Rename TextureTarget to SamplerType.
PiperOrigin-RevId: 911918372
Change-Id: If711d5909499b68316acd10a2de3a2d83436e18d
2026-05-07 05:56:07 -07:00
Haroon Qureshi 75f1b81df7 Missing file in CMakeLists.txt
PiperOrigin-RevId: 911913781
Change-Id: I080298ff26fa2d7a3646f80ed15396bbe868c76b
2026-05-07 05:42:52 -07:00
Haroon Qureshi f2da6cabdf Add API function for querying frame stats.
Replaces the current GetFrameRate function.

PiperOrigin-RevId: 911897360
Change-Id: I4199ba9ce40d1d8bc37b551fa7058d964186641d
2026-05-07 04:57:30 -07:00
Haroon Qureshi e1b27afcda Merge math_util and model_util and rename to filament_util.
Move filament_util to the main folder so as to indicate that
these utilities can be used by anyone and aren't internal to
the filament renderer implementation.

PiperOrigin-RevId: 911884375
Change-Id: Ieb58184263bdac7e44a07f1e44a4649c68c6bf77
2026-05-07 04:20:28 -07:00
Haroon Qureshi 7ade42ca88 Internal changes.
PiperOrigin-RevId: 911871922
Change-Id: I82452ffb4c96dca0206d2284193e0756e3dc830e
2026-05-07 03:49:14 -07:00
Haroon Qureshi 607970a900 Remove dependency between SceneBridge and ObjectManager.
PiperOrigin-RevId: 911824153
Change-Id: Ie87d6d9e77b0b3f68a41a0c7d13a36fb2029e4c2
2026-05-07 01:55:52 -07:00
Haroon Qureshi 8e214e5133 Move imgui_editor into filament library.
PiperOrigin-RevId: 911808107
Change-Id: I14318b1c7396e2eaf0df9d6afcc5298de01bcfa4
2026-05-07 01:19:30 -07:00
Haroon Qureshi 39c891e358 Add function for creating Renderable meshes from mjtGeom types.
The Renderable class now internally knows which built-in meshes
to use for a given geom type. It gets these meshes from the
ObjectManager which now stores the collection of built-ins based
on the nstack/nslice/nquad quality arguments.

PiperOrigin-RevId: 911782530
Change-Id: I6698ec3964a5c657f6a9495809cc795eec2e346f
2026-05-07 00:13:01 -07:00
Haroon Qureshi b6aac76cc4 Pass filament::Engine instead of FilamentContext
for textures, meshes, and render targets.

PiperOrigin-RevId: 911770834
Change-Id: I081458e118f0e91091d6d4df7b760e9dbb321672
2026-05-06 23:44:39 -07:00
Sam Haves a501731089 Update multiccd default in mjcPhysics.
PiperOrigin-RevId: 911410939
Change-Id: Ia20b5be87f85c4662b71994dd824d90c6b98b3ed
2026-05-06 10:21:48 -07:00
Haroon Qureshi 2aa2131057 Refactor how render requests are generated.
Get the camera and drawmode from the bridges rather than recalculating
it unecessarily.

PiperOrigin-RevId: 911406470
Change-Id: Ia295846bb80105a2b0ad5da21912ca82b25e04bd
2026-05-06 10:13:37 -07:00
Haroon Qureshi 2b67fe3c3a Remove direct dependency between SceneBridge and ImguiBridge.
PiperOrigin-RevId: 911366540
Change-Id: I05c348ea6b1d08c034f2bb26e4c770079073c61d
2026-05-06 08:57:23 -07:00
Haroon Qureshi a692283db3 Add functions to create context and render.
Rename mjrf_render to mjrf_renderScene to avoid naming collision.
This function is will be removed in a future CL.

PiperOrigin-RevId: 910764245
Change-Id: If4d05e806a9699570ca4bbc882f28bfdd05dbd8d
2026-05-05 10:20:04 -07:00
Haroon Qureshi 24ce1eff10 Update compat library to use public functions.
There are still a few places where the compat library is downcasting
to the internal types due to limitations in the public APIs.

PiperOrigin-RevId: 910646480
Change-Id: I1ccb6714db08a2010d9535f59338e5eba06d1d35
2026-05-05 06:33:04 -07:00
Haroon Qureshi d168eb2d7d Expose several functions in the public C API.
PiperOrigin-RevId: 910629209
Change-Id: I8623309e348c72350703f6874a887592f0607bba
2026-05-05 05:56:02 -07:00
Haroon Qureshi 88bff84cbb Add API functions for creating and destroying objects.
Also provide a header-only C++ library that wraps created objects into
unique_ptrs.

PiperOrigin-RevId: 910607824
Change-Id: I0427f6dedab6aa299b3128031b055bd4d0c8e497
2026-05-05 05:08:25 -07:00
Haroon Qureshi de030f4664 Allow SceneView to read configuration from mjModel directly.
PiperOrigin-RevId: 910548865
Change-Id: I4db045e76cd36012810c75b9d150c6c5f5746488
2026-05-05 02:52:18 -07:00
Haroon Qureshi 68fdc439e4 Use mjrTextureTarget type instead of filament type.
PiperOrigin-RevId: 910547104
Change-Id: I3e8aa30a72b9b5ec8c45e8fa6bac18353ce7b485
2026-05-05 02:47:53 -07:00
Haroon Qureshi ee3ac5b349 Expose Renderable settings in mjrRenderableParams.
PiperOrigin-RevId: 908587103
Change-Id: Ic0e19a7fb3535bf32782b85d2da0049ec4ac8ec7
2026-05-01 00:19:28 -07:00
Yuval Tassa 22ca5fe0df studio: improve behavior of help window
PiperOrigin-RevId: 908132295
Change-Id: Iac0aead82a575dffbe35e3be8ba06af13986d1a2
2026-04-30 06:21:10 -07:00
Sam Haves e552a5f80d Expose more filament render settings via XML custom fields
PiperOrigin-RevId: 907659170
Change-Id: I0d8ca1ec058d40ed072db09c370f48b1e79ca6b3
2026-04-29 10:26:51 -07:00