-
Notifications
You must be signed in to change notification settings - Fork 2
Generic Scene Elements
RenderToolbox3 defines a few "Generic Scene Elements" that can be specified in mappings files and applied to with both PBRT and Mitsuba. Generic scene elements make it easier to specify things like the camera, lights, and materials, because they can be specified once, instead of once per renderer.
Generic scene elements must be specified in the [mappings file](Mappings File Format), inside Generic
blocks. They must use [scene target](Mappings Syntax) syntax.
In order for RenderToolbox3 to define a generic scene element:
- PBRT and Mitsuba must agree on a particular behavior.
- We have to know that they agree.
- We have to know how to specify the behavior for both renderers.
So far, this makes for a short list of generic scene elements.
Consider a rough metal material. Both renderers define surface reflectance functions that model metals, and they parametrize the functions in similar ways. So it would seem that both renderers should agree on metal-related behaviors. However, the renderers use different surface microfacet models, so it's unclear how to specify the same "roughness" to both renderers. We may yet figure this out.
Here is the list of generic scene elements defined in RenderToolbox3. The list uses [scene target](Mappings Syntax) mapping syntax. This is the syntax expected for generic scene elements in [mappings files](Mappings File Format).
On the left-hand side of each mapping, myID
represents any scene element unique identifier. The right-hand side shows default property values that RenderToolbox3 fills in automatically unless you specify different values.
Generic materials must be declared with the category name material
. A generic material will replace any existing material that has the same id.
The matte
material specifies Lambertian diffuse scattering from a smooth surface.
myID:material:matte
myID:diffuseReflectance.spectrum = 300:0.5 800:0.5
The anisoward
material specifies Lambertian diffuse scattering and anisotropic Ward specular scattering from a smooth surface.
myID:material:anisoward
myID:diffuseReflectance.spectrum = 300:0.5 800:0.5
myID:specularReflectance.spectrum = 300:0.5 800:0.5
myID:alphaU.float = 0.1
myID:alphaV.float = 0.1
The metal
material specifies metallic/conductive scattering from a rough surface.
myID:material:metal
myID:eta.spectrum = Cu.eta.spd
myID:k.spectrum = Cu.k.spd
myID:roughness.float = 0.4
Note: the roughness
property is experimental. Renderers may produce different results when roughness
in non-zero.
Note: Cu.eta.spd
and Cu.k.spd
are measured spectrum files locate in the RenderData/
sub-folder of RenderToolbox3.
The bumpmap
material combines an existing material with a float texture. The texture values are interpreted as bumps on the existing material.
myID:material:bumpmap
myID:materialID.string = ''
myID:textureID.string = ''
myID:scale.float = 1.0
materialID
and textureID
have no default values. You must specify the id of an existing material and an existing texture. scale
affects the height of the bumps on the surface.
Note: even with the same scale
value, PBRT and Mitsuba seem to produce bumps of different sizes, and possibly different fine-scale geometry.
Generic lights must be declared with the category name light
. A generic light will modify any existing light that has the same id. This allows you to change the emission spectrum of a light without erasing its position, orientation, etc.
The point
light specifies a tiny light that emits in all directions.
myID:light:point
myID:intensity.spectrum = '300:1.0 800:1.0'
The directional
light specifies parallel light, as from a distant sun.
myID:light:directional
myID:intensity.spectrum = '300:1.0 800:1.0'
The spot
light specifies a tiny light that emits in a conic region, with falloff at the edges.
myID:light:spot
myID:intensity.spectrum = '300:1.0 800:1.0'
The area
light instructs RenderToolbox3 to convert an existing shape into a diffuse area light. myShapeID
below should be the id of an existing shape. You might need to rotate the shape to make sure light is emitted from the correct side.
myShapeID:light:area
myShapeID:intensity.spectrum = '300:1.0 800:1.0'
Note: the physical units of the intensity
property depend on the geometry of the light source. For some lights, the renderer may interpret "intensity" as "radiance".
Generic textures must be declared with the category name floatTexture
or spectrumTexture
. floatTexture
instructs RenderToolbox3 to treat the texture as having scalar values, suitable for roughness, bump maps, etc. spectrumTexture
instructs RenderToolbox3 to treat the texture as having spectrum or color values, suitable for emission spectra and reflectances. A generic texture will replace any existing texture that has the same id.
The bitmap
texture loads texture data from an image file. Currently only OpenEXR images are expected to work for both PBRT and Mitsuba. Image format support depends on which renderer you use and how it was built.
myID:floatTexture:bitmap
myID:spectrumTexture:bitmap
myID:filename.string = ''
myID:wrapMode.string = 'repeat' % may be 'repeat', 'zero', or 'clamp'
myID:gamma.float = '1'
myID:filterMode = 'ewa' % may be 'ewa' or 'trilinear'
myID:maxAnisotropy.float = '20'
myID:offsetU.float = '0.0'
myID:offsetV.float = '0.0'
myID:scaleU.float = '1.0'
myID:scaleV.float = '1.0'
The checkerboard
texture creates a tesselated pattern of squares, of alternating colors.
myID:checksPerU.float = '2'
myID:checksPerV.float = '2'
myID:offsetU.float = '0'
myID:offsetV.float = '0'
% for floatTextures
myID:oddColor.float = '0'
myID:evenColor.float = '1'
% for spectrumTextures
myID:oddColor.float = '300:0 800:0'
myID:evenColor.float = '300:1 800:1'
checksPerU
and checksPerV
determine how many checks will appear, per UV coordinate. The default value of 2
creates a 2x2 checkerboard in the default UV coordinate interval [0 1].