Combine sparse vectors in-place by first counting total `nnz` and then working backwards from the end. This removes the need for temporary buffers in `mju_combineSparse` and its callers and speeds up the function by ~10%.
PiperOrigin-RevId: 902530210
Change-Id: I4f48c327103552ab968d3915399c6067367bec9f
This provides a reduction from 26 to 18 constraints for trilinear and from 162 to 75 for quadratic. The assembly of the constraints becomes trivial. In total the speedup for a trilinear 3x3x3 grid is about 3x.
PiperOrigin-RevId: 902502398
Change-Id: I764772c7adef78da5a644f64701f842d36e4b543
Collect all entries from the recursive directory iterator, sort them, and then check for the filename. This ensures that if multiple files with the same name exist in different subdirectories, the one found is always the same, regardless of the filesystem's directory iteration order.
PiperOrigin-RevId: 902487291
Change-Id: Ia4c45cd2e3cab4a4e3825c267fc47c3134f99f76
Simplifies Renderable as it no longer has the option of owning
any Meshes. Instead, the ModelObjects owns the Meshes for
flex and skin geom (just like it owns all the other mjModel
Meshes).
PiperOrigin-RevId: 902485912
Change-Id: I8b9f9d394de6c46f7e25aa4b3885a374aad05294
Each mjEQ_FLEXSTRAIN equality now represents a single cell within a flex. This allows for more efficient sparse Jacobian computation by only considering the degrees of freedom of the nodes within each specific cell. This change gives a speedup of about 10x on a 3x3x3 model.
PiperOrigin-RevId: 902164069
Change-Id: I78eedf1d5cf39b8989fe9863c22d164922fc0efb
The flex interpolation stiffness matrix within the implicit/implicitfast solvers is now built and factorized in a banded format instead of a dense one. This involves:
- Calculating the bandwidth based on the sparsity of the mass/damping matrix and the connectivity within flex cells.
- Allocating and populating a banded matrix `H`.
- Using `mju_cholFactorBand` and `mju_cholSolveBand` for factorization and solving.
This change improves performance for flexes with many DOFs but local coupling.
PiperOrigin-RevId: 901297952
Change-Id: I3efe06353d1903ea65ab30dc49685cede228bb68
This change introduces a `flex_cellcount` field to `mjModel` to specify the number of cells in each dimension for interpolated flexes. The stiffness computation, passive force calculation, and Jacobian derivatives are updated to operate on a per-cell basis, significantly improving performance by localizing computations to the nodes within each cell.
PiperOrigin-RevId: 901216393
Change-Id: Ic23132e609de11e71bb7fef8d1f139daad2ec264
Allows the Renderable to update its own MaterialInstances whenever
Material textures or parameters are modified. Each Renderable now
also knows how it is intended to be used (i.e. scene objects or ux)
which allows it to correctly pick the underlying filament::Material
to use.
PiperOrigin-RevId: 901161990
Change-Id: Ic280731d39c272c50d6ad100cec7116e683cbc79
* Ensure compiler.usethread=0 is set before compilation in single-threaded WASM builds
* Explicitly enable exceptions for the single-threaded WASM module
* Test the single-threaded module in addition to the multi-threaded module in internal and external CI
* Consolidate wasm/tests/CMakeLists.txt into wasm/CMakeLists.txt, fixing the single-threaded benchmark test build which was missing shared linker flags
PiperOrigin-RevId: 901149728
Change-Id: If4946e29e5116610782d218906cf3f5940c1cdd0
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
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
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
Use an unlit material for decorative elements and do not render them
in the reflection pass.
PiperOrigin-RevId: 899560291
Change-Id: I3b035d556432c850ce8240e0c4c4c2d6645d7bf2
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
*** 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
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
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
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