Skip to content

Commit decc119

Browse files
committed
add mesh render benchmark
1 parent 40ef9d6 commit decc119

4 files changed

Lines changed: 70 additions & 1 deletion

File tree

benchmarks/render/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
## Description
44

5-
GPU ray-traced rendering of the [primitives](../../mujoco_warp/test_data/primitives.xml) scene. This benchmark measures rendering performance using a 5×5 grid of spheres, capsules, ellipsoids, cylinders, and boxes above a plane.
5+
GPU ray-traced rendering performance benchmarks. These benchmarks measure rendering speed across both simple primitive layouts and complex high-resolution textured meshes on the GPU.
66

77
### primitives
88

9+
GPU ray-traced rendering of the [primitives](../../mujoco_warp/test_data/primitives.xml) scene. This benchmark measures rendering performance using a 5×5 grid of spheres, capsules, ellipsoids, cylinders, and boxes above a plane.
10+
911
| Property | Value |
1012
|----------|-------|
1113
| Bodies | 126 |
@@ -16,3 +18,18 @@ GPU ray-traced rendering of the [primitives](../../mujoco_warp/test_data/primiti
1618
| Worlds | 8192 |
1719

1820
![primitives](primitives.webp)
21+
22+
### mug
23+
24+
GPU ray-traced rendering of the official [MuJoCo Mug](assets/mug.xml) scene. This benchmark measures rendering performance of a high-resolution, textured OBJ mesh with complex geometry.
25+
26+
| Property | Value |
27+
|----------|-------|
28+
| Bodies | 2 |
29+
| DoFs | 6 |
30+
| Geoms | 37 |
31+
| Cameras | 1 |
32+
| Resolution | 64×64 |
33+
| Worlds | 8192 |
34+
35+
![mug](mug.webp)

benchmarks/render/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
ASSETS = [
2+
{
3+
"source": "https://github.com/google-deepmind/mujoco.git",
4+
"ref": "3f3ff85a59b9ce68cfb9d9a5222bf7e050d966c1",
5+
}
6+
]
7+
18
BENCHMARKS = [
29
{
310
"name": "primitives",
@@ -8,4 +15,16 @@
815
"njmax": 256,
916
"nstep": 100,
1017
},
18+
{
19+
"name": "mug",
20+
"mjcf": "mug.xml",
21+
"function": "render",
22+
"nworld": 8192,
23+
"nconmax": 100,
24+
"njmax": 256,
25+
"nstep": 100,
26+
"assets": [
27+
(ASSETS[0], "model/mug", "assets"),
28+
],
29+
},
1130
]

benchmarks/render/mug.webp

6.99 KB
Loading

benchmarks/render/mug.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<mujoco model="mug">
2+
<visual>
3+
<map znear="0.01" zfar="200" />
4+
<quality shadowsize="8192" />
5+
<headlight diffuse=".8 .8 .8" ambient=".2 .2 .2" specular="1 1 1" />
6+
<global azimuth="140" elevation="-20" />
7+
</visual>
8+
9+
<asset>
10+
<texture type="skybox" builtin="gradient" rgb1="1 1 1" rgb2="1 1 1" width="800" height="800" />
11+
<texture name="grid" type="2d" builtin="checker" width="512" height="512" rgb1=".1 .2 .3" rgb2=".2 .3 .4"/>
12+
<material name="grid" texture="grid" texrepeat="1 1" texuniform="true" reflectance=".2"/>
13+
14+
<texture name="mug" file="assets/mug.png" type="2d"/>
15+
<material name="mug" texture="mug" specular="1" shininess="1"/>
16+
<mesh name="mug" file="assets/mug.obj" scale=".01 .01 .01"/>
17+
</asset>
18+
19+
<worldbody>
20+
<geom name="floor" size="0 0 .05" type="plane" material="grid" contype="1" conaffinity="1"/>
21+
<camera pos="1.1 0.0 0.75" xyaxes="0 1 0 -0.6 0 1"/>
22+
<light pos="0 0 3" dir="0 0 -1" directional="true" />
23+
24+
<!-- A table to hold the mug -->
25+
<geom name="table" pos="0.8 0.0 0.5" type="box" size="0.5 1.0 0.01" quat="1.0 0.0 0.0 0.0" contype="1" conaffinity="1"/>
26+
27+
<!-- A single mug above the table -->
28+
<body name="mug" pos="0.8 0.0 0.6" euler="0 0 90">
29+
<freejoint name="mug_joint"/>
30+
<geom type="mesh" mesh="mug" material="mug" euler="90 0 0" group="1" contype="0" conaffinity="0"/>
31+
</body>
32+
</worldbody>
33+
</mujoco>

0 commit comments

Comments
 (0)