Skip to content
← All articles
Project introduction

MistubaVideo: rendering simulation recordings with Mitsuba

Listen to the audio story

Replaying a simulation without rerunning it · 1:34 · AI-written script, synthetic voices

Transcript

Ava: Imagine you've spent hours on a simulation, and then you realize the camera angle was wrong. Do you rerun everything?

Andrew: I'd cry a little. Is there a way around that?

Ava: That's the idea behind MistubaVideo. It turns simulation exports into images and video with Mitsuba 3. Because it renders from a recording, you can change the camera or the lighting without repeating the simulation.

Andrew: What does it actually read?

Ava: Two things. A batch renderer handles sequences of OBJ meshes, and FFmpeg stitches the frames into video or a GIF. Then there's a helper called mitsuba-video that replays recorded body poses and surface fields, like wear.

Andrew: So you can see where a surface got worn down.

Ava: Yes. For each frame it applies the recorded poses, blends a base material and an affected material using the surface field, and renders the scene. It can add a heatmap, a panel showing the UV atlas, and a covered-area chart, then encode an MP4.

Andrew: How do you avoid wasting render time?

Ava: There's an inspect command to check the input and a preview command to check framing before the full render. Quality presets go from preview to draft to paper.

Andrew: Any catch when reading the results?

Ava: One good one. The chart measures the covered area of the recorded field, not the visible area of the object on screen. And if you compare videos, keep the heatmap range the same, or the same field can look different.

Andrew: Careful reading, then.

Ava: Always. The full write-up has the pipeline table and the render images.

Table of contents

MistubaVideo turns simulation exports into images and video with Mitsuba 3. Its batch renderer handles OBJ sequences; the mitsuba-video helper replays recorded body poses and surface fields such as wear.

1. Where rendering fits

A simulation computes motion and changes to surfaces. The renderer reads those outputs to show where bodies moved, which regions of the UV atlas changed, and how the material appearance evolves. Rendering a recording lets you change the camera or lighting without repeating the simulation.

python main.py multi --folder exports renders an OBJ sequence. Camera views, resolution and samples per pixel control the output; FFmpeg assembles the images into video or GIF. The field renderer adds per-frame transforms and textures.

A rough-conductor material rendered with Mitsuba.

Existing material illustration from the project report. It illustrates shading, without representing a wear-simulation result.

2. The render helper

StageData
InputMeshes, materials, recorded poses and surface fields
ProcessingSource adapter, material blend and Mitsuba rendering
OutputRendered frames, area CSV, settings and MP4

The mitsuba-video package accepts a versioned manifest or a TextureFriction recording through a source adapter. A manifest describes bodies, meshes, materials, poses and field images. ManifestWriter lets another simulator export this format.

For each selected frame, the helper applies recorded poses, blends base and affected materials using the surface field, and renders the scene. It can add a heatmap, a UV-atlas panel and a covered-area chart before encoding an MP4.

flowchart TD
  subgraph Inputs[Simulation output]
    R[TextureFriction recording]
    M[Manifest: meshes, poses and fields]
  end
  subgraph Helper[mitsuba-video helper]
    A[Source adapter]
    B[Apply poses and blend materials]
    C[Mitsuba 3 path tracing]
    D[Atlas panel and area chart]
  end
  R --> A
  M --> A
  A --> B --> C --> D
  D --> E[Frame images and MP4]

Start with inspect to check the input and preview to check framing. render produces the sequence; encode changes video assembly using existing frames. Quality presets include preview, draft and paper.

mitsuba-video inspect path/to/manifest.json
mitsuba-video preview path/to/manifest.json
mitsuba-video render path/to/manifest.json -q preview

3. Reading the output

Outputs include beauty images, composite frames, a field-area CSV and render_config.json with settings and timings. Linear EXR frames are optional. The chart measures the recorded field’s covered area. It does not measure the visible area of the rendered object.

Keep display settings with the render when comparing videos: changing the heatmap range can make the same field look different.

Mitsuba spotlight illustration from the project report.

Existing lighting illustration from the report. Scene lighting and the recorded surface field are separate inputs.

4. Sources and tests

The package documents pytest tests for transforms, material blending, OBJ and MTL readers, and the manifest schema and writer. A measured coverage percentage is not supplied here.

Render-helper documentation[1].

Implementation: source interface[2], material blending[3].

The project documentation provides the source link and terminology.

References

  1. ETSim. (). Render-helper documentation. [Source file or documentation] github.com.
  2. ETSim. (). source interface. [Source file or documentation] github.com.
  3. ETSim. (). material blending. [Source file or documentation] github.com.
  4. ETSim. (). MistubaVideo. [Software repository] github.com.

References use this article’s publication date.