Skip to content

Render hetero#873

Merged
thowell merged 48 commits into
google-deepmind:renderfrom
StafaH:render_hetero
Dec 5, 2025
Merged

Render hetero#873
thowell merged 48 commits into
google-deepmind:renderfrom
StafaH:render_hetero

Conversation

@StafaH

@StafaH StafaH commented Nov 30, 2025

Copy link
Copy Markdown
Collaborator

This PR adds the following:

  • Support for Ellipsoid and Cylinders
  • Flex rendering for 2D and 3D flex
  • Optimized Hfield rendering
  • Visual assets for the franka benchmark scene for benchmarking
  • Active camera filtering
  • Better rendering script for tiled and rollout rendering

Comment thread mujoco_warp/_src/render_context.py Outdated
Comment thread mujoco_warp/_src/render_context.py Outdated
Comment thread mujoco_warp/_src/render_context.py Outdated
Comment thread mujoco_warp/_src/render_context.py Outdated
Comment thread mujoco_warp/_src/render_context.py
Comment thread mujoco_warp/_src/render_context.py
Comment thread mujoco_warp/_src/render_context.py Outdated
Comment thread mujoco_warp/_src/render_context.py
Comment thread mujoco_warp/_src/render_context.py Outdated
@thowell

thowell commented Dec 3, 2025

Copy link
Copy Markdown
Collaborator

great work Mustafa!!

left some comments for minor changes. will you please run ruff check and the kernel analyzer and fix any reported issues? thanks!

@StafaH

StafaH commented Dec 4, 2025

Copy link
Copy Markdown
Collaborator Author

Thanks @thowell, the PR is now updated, kernel analyser passes. Also added better frustum calculation using mujoco reference. Let me know if anything still needs fixing

@StafaH StafaH requested a review from thowell December 5, 2025 06:43
@thowell thowell merged commit 67a18c0 into google-deepmind:render Dec 5, 2025
1 check passed
StafaH added a commit that referenced this pull request Dec 14, 2025
* Integrate madrona_warp into mjwarp

* Fix bug for <8 views

* Move mesh construction to SAH, tile pixels

* Change to registry to pass jax io test

* Remove dist from bvh_query_ray

* Add render context

* Update testspeed

* Add render context registry wrapper

* Fix circular import

* fix ray box and ambient lighting

* Cleanup rc options in kernel

* Small fix to static nlight

* ray capsule fix

* Fix testspeed merge artifact

* Cleanup before PR into mjwarp

* Remove global fovy, use cam 0 values

* Cleanup bvh/render/ray

* Fix capsule calc comment

* Cleanup docstrings

* Cleanup testspeed for render

* Fix bug when no texid is set

* hetero camera support

* Add heightfield support

* Add flex mesh building

* Add correct flex 2d mesh building

* Fixes for downstream use

* Rename output buffers to match mujoco style

* Add flex support, improve render script

* Add selective camera rendering support via cam_active parameter

* Fix render output reading, fix bg color

* Add more optimzed hfield mesh building

* Add visual franka benchmark, fix merge artifacts

* Add 3d flex rendering support

* Add ellipsoid and cylinder primitives

* Cleanup flex 2d and 3d rendering

* Cleanup of bvh code

* Fix 2d flex side triangle update

* More cleanup for PR

* More cleanup of naming, paranthesis, casts

* Add correct frustrum calculation for rays

* Ruff check

* Fix naming, add todo

* Update kernel arguments using analyzer

* Remove comment

* Remove visual assets

* Add back camera

* Remove stray 1, dim

---------

Co-authored-by: Kevin Zakka <kevinarmandzakka@gmail.com>
StafaH added a commit to StafaH/mujoco_warp that referenced this pull request Jan 4, 2026
* Integrate madrona_warp into mjwarp

* Fix bug for <8 views

* Move mesh construction to SAH, tile pixels

* Change to registry to pass jax io test

* Remove dist from bvh_query_ray

* Add render context

* Update testspeed

* Add render context registry wrapper

* Fix circular import

* fix ray box and ambient lighting

* Cleanup rc options in kernel

* Small fix to static nlight

* ray capsule fix

* Fix testspeed merge artifact

* Cleanup before PR into mjwarp

* Remove global fovy, use cam 0 values

* Cleanup bvh/render/ray

* Fix capsule calc comment

* Cleanup docstrings

* Cleanup testspeed for render

* Fix bug when no texid is set

* hetero camera support

* Add heightfield support

* Add flex mesh building

* Add correct flex 2d mesh building

* Fixes for downstream use

* Rename output buffers to match mujoco style

* Add flex support, improve render script

* Add selective camera rendering support via cam_active parameter

* Fix render output reading, fix bg color

* Add more optimzed hfield mesh building

* Add visual franka benchmark, fix merge artifacts

* Add 3d flex rendering support

* Add ellipsoid and cylinder primitives

* Cleanup flex 2d and 3d rendering

* Cleanup of bvh code

* Fix 2d flex side triangle update

* More cleanup for PR

* More cleanup of naming, paranthesis, casts

* Add correct frustrum calculation for rays

* Ruff check

* Fix naming, add todo

* Update kernel arguments using analyzer

* Remove comment

* Remove visual assets

* Add back camera

* Remove stray 1, dim

---------

Co-authored-by: Kevin Zakka <kevinarmandzakka@gmail.com>
erikfrey pushed a commit that referenced this pull request Feb 6, 2026
* Render (#836)

* Integrate madrona_warp into mjwarp

* Fix bug for <8 views

* Move mesh construction to SAH, tile pixels

* Change to registry to pass jax io test

* Remove dist from bvh_query_ray

* Add render context

* Update testspeed

* Add render context registry wrapper

* Fix circular import

* fix ray box and ambient lighting

* Cleanup rc options in kernel

* Small fix to static nlight

* ray capsule fix

* Fix testspeed merge artifact

* Cleanup before PR into mjwarp

* Remove global fovy, use cam 0 values

* Cleanup bvh/render/ray

* Fix capsule calc comment

* Cleanup docstrings

* Cleanup testspeed for render

* Fix bug when no texid is set

* Render hetero (#873)

* Integrate madrona_warp into mjwarp

* Fix bug for <8 views

* Move mesh construction to SAH, tile pixels

* Change to registry to pass jax io test

* Remove dist from bvh_query_ray

* Add render context

* Update testspeed

* Add render context registry wrapper

* Fix circular import

* fix ray box and ambient lighting

* Cleanup rc options in kernel

* Small fix to static nlight

* ray capsule fix

* Fix testspeed merge artifact

* Cleanup before PR into mjwarp

* Remove global fovy, use cam 0 values

* Cleanup bvh/render/ray

* Fix capsule calc comment

* Cleanup docstrings

* Cleanup testspeed for render

* Fix bug when no texid is set

* hetero camera support

* Add heightfield support

* Add flex mesh building

* Add correct flex 2d mesh building

* Fixes for downstream use

* Rename output buffers to match mujoco style

* Add flex support, improve render script

* Add selective camera rendering support via cam_active parameter

* Fix render output reading, fix bg color

* Add more optimzed hfield mesh building

* Add visual franka benchmark, fix merge artifacts

* Add 3d flex rendering support

* Add ellipsoid and cylinder primitives

* Cleanup flex 2d and 3d rendering

* Cleanup of bvh code

* Fix 2d flex side triangle update

* More cleanup for PR

* More cleanup of naming, paranthesis, casts

* Add correct frustrum calculation for rays

* Ruff check

* Fix naming, add todo

* Update kernel arguments using analyzer

* Remove comment

* Remove visual assets

* Add back camera

* Remove stray 1, dim

---------

Co-authored-by: Kevin Zakka <kevinarmandzakka@gmail.com>

* Render merge ray normal (#979)

* Add ray with normal (#940)

* Add ray with normal

* Ruff

* Propagate ray normal changes

* ruff

* Fix tuple type check

* Update ray to return -1 for non-hits

* Ray normal fixes (#960)

* Add ray with normal

* Ruff

* Propagate ray normal changes

* ruff

* Fix tuple type check

* Update ray to return -1 for non-hits

* Small fixes

* Ruff format

* Simplify assert for vec3

* Add comment and adjust docstring

* Fix bugs in ray hfield impl (#967)

* Merge main into render branch (#980)

* Add ray with normal (#940)

* Add ray with normal

* Ruff

* Propagate ray normal changes

* ruff

* Fix tuple type check

* Update ray to return -1 for non-hits

* Ray normal fixes (#960)

* Add ray with normal

* Ruff

* Propagate ray normal changes

* ruff

* Fix tuple type check

* Update ray to return -1 for non-hits

* Small fixes

* Ruff format

* Simplify assert for vec3

* Add comment and adjust docstring

* Fix bugs in ray hfield impl (#967)

* clamp pair_friction with minmu (#969)

* add --kernel_cache_dir pytest flag for warp kernel cache (#968)

* fix _NCONMAX info (#965)

* reuse xnorm (#959)

* Expose rays through the public API. (#975)

---------

Co-authored-by: Taylor Howell <taylorhowell@google.com>
Co-authored-by: Kevin Zakka <kevinzakka@users.noreply.github.com>

* Fix render aspect ratio bug (#1002)

* Update to new cam proj field

* Fix frustrum aspect ratio

* Render tests and cleanup (#1021)

* ruff

* Move render script to contrib

* Add render tests

* Move create render context into io.py

* Cleanup bvh test, ruff

* cleanup render_context_test

* More cleanup

* Render Cleanup 2 (#1037)

* Update context to read from new mujoco fields

* Add anyhit ray mesh query for fast shadows

* Cleanup tests, msgs, comments

* Render Cleanup 3 (#1063)

* Fix naming, move mesh bvh build to bvh module

* Add batched cam intrinsic for randomization

* Fix indexing in render context

* ruff

* Render Cleanup 4 (#1064)

* Fix failing tests with new batched cam fields

* Move hfield bvh build to bvh module

* Fix docstring

* Render Cleanup 5 (#1075)

* Fix flex rendering for multiple flex

* Add flex bvh test

* Render Cleanup - Textures (#1080)

* Add cuda texture sampling

* Fix textures and mesh sample, cleanup

* ruff

* Clean up texture processing kernel

* Fix flipped texture uv

* Remove nested texture kernel

* Render Cleanup - Ray (#1081)

* Add bvh accelerated ray

* Move ray_bvh into ray

* Remove ray_bvh_test and merge with ray_test

* Use absolute import

* Cleanup public API for render/bvh

* Render Cleanup - types and io (#1103)

* Move RenderContext to types

* Cleanup flex fields and refit kernel

* Use array in render context type

* Fix all render related tests after refactor

* Move packing to render util

* Cleanup render file

* Cleanup based on pr comments

* Fix error with rc init

* Fix flex render error (#1108)

* Update _render_megakernel decorator (#1109)

* Fix error for downstream mjlab

* Fix ray none check

* Change nested kernel to wp.kernel

* Remove TODO

* Revert uv.lock

* Post merge cleanup and fixes

* Add guards for bleeding edge features

* Fix guards for mjtProjection

* Fix failing test, post merge artifact

* Fix failing tests for ray/render

* Add more guards for mujoco < 3.4.1

* Ruff

* Disable flex cpu test, fix leading dim

* Add newline

---------

Co-authored-by: Kevin Zakka <kevinarmandzakka@gmail.com>
Co-authored-by: Taylor Howell <taylorhowell@google.com>
Co-authored-by: Kevin Zakka <kevinzakka@users.noreply.github.com>
@StafaH StafaH deleted the render_hetero branch February 8, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants