Mitsuba Mappings - RenderToolbox/RenderToolbox4 GitHub Wiki

RenderToolbox allows you to specify mappings that directly modify Mitsuba scene files as they are generated. These mappings must use the destination Mitsuba.

These mappings will apply to the object-oriented representation of the Mitsuba scene provided by the mMitsuba tool that RenderToolbox uses internally.

Mitsuba Scene Elements

Here are several examples of Mitsuba scene elements that you can specify in the mappings file, with destination Mitsuba.

Each element is presented as a JSON object which you could copy into your mappings file. You can change the names, types, and values used in these examples to other names, types, and values that you find in the Mitsuba documentation.

sensor

This example modifies the default scene camera to have type thinlens.

{
  "name": "Camera",
  "broadType": "sensor",
  "specificType": "thinlens",
  "operation": "update",
  "destination": "Mitsuba",
  "properties": [
    {
      "name": "apertureRadius",
      "valueType": "float",
      "value": .1
    },
    {
      "name": "focusDistance",
      "valueType": "float",
      "value": 5
    }
  ]
}

It would produce Mitsuba syntax like this:

<sensor id="1_Camera" type="thinlens">
  <float name="apertureRadius" value="0.1"/>
  <float name="focusDistance" value="5"/>
  ...
</sensor>

integrator

This example modifies the default scene integrator to do bidirectional path tracing.

{
  "name": "integrator",
  "broadType": "integrator",
  "specificType": "bdpt",
  "destination": "Mitsuba",
  "operation": "update",
  "properties": [
    {
      "name": "maxDepth",
      "valueType": "integer",
      "value": 7
    }
  ]
}

It would produce Mitsuba syntax like this:

<integrator id="integrator" type="bdpt">
  <integer name="maxDepth" value="7"/>
</integrator>

sampler

This example modifies the default scene sampler to use a large number of samples.

{
  "name": "sampler",
  "broadType": "sampler",
  "specificType": "ldsampler",
  "destination": "Mitsuba",
  "operation": "update",
  "properties": {
    "name": "sampleCount",
    "valueType": "integer",
    "value": 2048
  }
}

It would produce Mitsuba syntax like this:

<sampler id="sampler" type="ldsampler">
  <integer name="sampleCount" value="2048"/>
</sampler>

bsdf

This example modifies a material, aka "bsdf", to use a Mitsuba-specific model for rough plastic.

{
  "name": "cylinderMaterial",
  "broadType": "bsdf",
  "specificType": "roughplastic",
  "destination": "Mitsuba",
  "operation": "update",
  "properties": [
    {
      "name": "diffuseReflectance",
      "valueType": "spectrum",
      "value": "BlueRGB_scale0.70_Spectrum.spd"
    },
    {
      "name": "alpha",
      "valueType": "float",
      "value": "0.01"
    }
  ]
}

It would produce Mitsuba syntax like this:

<bsdf id="2_cylinderMaterial" type="roughplastic">
  <spectrum filename="resources/BlueRGB_scale0.70_Spectrum.spd" name="diffuseReflectance"/>
  <float name="alpha" value="0.01"/>
</bsdf>
⚠️ **GitHub.com Fallback** ⚠️