Skip to content

PBRT Mappings

Ben Heasly edited this page Oct 7, 2016 · 8 revisions

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

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

PBRT Scene Elements

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

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 PBRT documentation.

Camera

This example modifies properties of the scene perspective camera.

{
  "name": "Camera",
  "broadType": "Camera",
  "specificType": "perspective",
  "operation": "update",
  "destination": "PBRT",
  "properties": [
    {
      "name": "lensradius",
      "valueType": "float",
      "value": "0.1"
    },
    {
      "name": "focaldistance",
      "valueType": "float",
      "value": "5"
    }
  ]
}

It would produce PBRT syntax like this:

# 1_Camera
Camera "perspective" 
  "float lensradius" [0.1] 
  "float focaldistance" [5] 
  ...

integrator

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

{
  "name": "integrator",
  "broadType": "SurfaceIntegrator",
  "specificType": "path",
  "destination": "PBRT", 
  "operation": "update",
  "properties": {
    "name": "maxdepth",
    "valueType": "integer",
    "value": "8"
  }
}

It would produce PBRT syntax like this:

# integrator
SurfaceIntegrator "path" 
  "integer maxdepth" [8] 

sampler

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

{
  "name": "sampler",
  "broadType": "Sampler",
  "specificType": "lowdiscrepancy",
  "operation": "update",
  "destination": "PBRT",
  "properties": {
    "name": "pixelsamples",
    "valueType": "integer",
    "value": 2048
  }
}

It would produce PBRT syntax like this:

# sampler
Sampler "lowdiscrepancy" 
  "integer pixelsamples" [2048] 

MakeNamedMaterial

This example modifies a named material declaration, aka MakeNamedMaterial, to use a PBRT-specific model for glass.

{
  "name": "DragonMaterial",
  "broadType": "MakeNamedMaterial",
  "specificType": "glass",
  "operation": "update",
  "destination": "PBRT",
  "properties": {
    "name": "index",
    "valueType": "float",
    "value": 1.5
  }
}

It would produce PBRT syntax like this:

# 4_DragonMaterial
MakeNamedMaterial "4_DragonMaterial" "string type" "glass" 
  "float index" [1.500000] 
Clone this wiki locally