Raw Predict Engine simulations are stored in *.exr files. They contain :
an XML header with informations about the image, the simulation conditions and the machine that was used for rendering,
an array of named textures with HDR information : each texture is called a layer and represents a specific value. A layer can contain an RGB or XYZ texture (the processed output for instance), a vector (the normals for instance), a float (the depth for instance) or an integer (the material index for instance).
Files from other softwares (*.png, *.jpg, other *.exr files) can also be loaded by Predict Lab, but they won't contain any header informations and only contain one RGB layer.
You can use the left/right arrows to switch between the different layers.
The raw data preview module is designed to visualize and post process all the layers contained inside a raw Predict Engine simulation.
The window contains 2 widgets :
the settings widget contains an histogram and a chromaticity diagram (visible if the current output is RGB), and the post process options that can be applied to the current layer. The available data depends on the type of the layer,
the preview widget contains a preview of the current post processed image.
Using this module, the save button has the following options :
LDR output : the processed output (the image currently displayed on screen) saved to a *.png file,
HDR output : the processed output (the image currently displayed on screen) saved to a *.exr file, note that only the RGB layer will be exported.
Layers of type "RGB", "XYZ" or "Albedo" contain HDR data stored in Vector3. The settings widget contains :
options to enable filters and effects (see the Filters and Effects section bellow),
mapping settings to define the colorspace in which the image should be displayed, control the exposure, gamma and white balance of the image (see the Tone Mapping section bellow), or to display one of the channels in false colors (see the False Color layers section bellow).
Layers of type "Vector" contain normalized vector data stored in Vector3. Each vector channel contains data in the range [-1;1] and is displayed in the corresponding RGB channel. The settings widget does not contain any settings.
Layers of type "false color" contain HDR data stored in floats, integer or unsigned integer. The settings widget contains :
an histogram of the values,
options to enable filters and effects (see the Filters and Effects section bellow),
mapping settings to control the color map and ranges of data displayed on screen (see Tone Mapping section bellow).
Fireflies management :
Fireflies are rendering artifacts resulting from numerical instabilities in solving the rendering equation. They manifest themselves as anomalously-bright single pixels scattered over parts of the image.
To limit the impact of these incoherences, you can apply different filters :
median filter : every pixel is replaced by the median of its neighbours,
gaussian filter : a gaussian blur is applied to every pixel,
outlier filter : abnormal values are replaced by the mean of their neighbours. Values are identified as abnormals when they are higher than : [mean of the neighbours + threshold * neighbours standard deviation].
Point Spread Function (PSF) :
In real life, imaging with an optical system is subject to diffraction which makes the image of a point not perfect : the diaphragm usually makes the image of a point look like a start. The Point Spread Function (PSF) defines the shape of a single point imaged by the optical system.
You can specify the PSF with an RGB texture. Some default values are available next to the texture field. You can reduce the size of the PSF kernel to make it less impactfull.
Figure A : Example of a PSF texture
Figure B : rendering of a scene without PSF
Figure C : rendering of the same scene as in Figure B, using the PSF defined in Figure A
Flat field :
In real life, the intensity of the image captured by an optical system is not constant for every pixel of the sensor. Usually, the pixels at the center receive more energy than the outer ones. This results in an image that is brighter at the center which is called the flat field.
You can specify the Flat Field with an RGB texture.
Figure A : Example of a Flat Field texture
Figure B : rendering of a scene without Flat Field
Figure C : rendering of the same scene as in Figure B, using the Flat Field defined in Figure A
Blooming :
When using an actual camera and a pixel gets saturated, it tends to fill the adjacents pixels. This behaviour is called Blooming and results in a luminous blur around saturated pixels.
You can specify the blooming by :
A texture that defines how a pixel fills its neighbouring pixels : the pixel is represented at the center of the texture, surrounded by its neighbours. Some default values are available next to the texture field,
The Intensity defines the impact of the blooming on the final output,
The Threshold defines the saturation level for the pixel : only pixels above this value will bloom,
You can reduce the size of the Blooming kernel to make it less impactfull,
The resulting image is Output = Input + BloomingHightlight. The Highlights option enables you to only display the blooming effect that is summed with the input image. If enabled, an additional "Mask Only" toggle enables you to display a mask of the pixels that are affected by the blooming effect without the actual blooming.
Figure A : Example of a Blooming texture
Figure B : rendering of a scene without Blooming
Figure C : rendering of the same scene as in Figure B, using the Blooming defined in Figure A
Blooming and PSF are quite heavy processes and may result in an interface that is a little less interactive than usual. As much as possible, for comfort, we recommand applying them once the rest of the settings are configured (exposure especially).
Images produced by Predict Engine (and HDR images in general) are defined within a dynamic range that cannot be displayed on the screen : values on screen must be contained within [0;255] whereas values in Predict Engine can go up to thousands or be contained in a much smaller interval. In order to adapt this dynamic range, we use a Tone Mapper.
Predict Lab supports different tone mappers :
Linear tone mapper : a simple multiplicative factor is applied to the image. This factor is called the Exposure.
For some processes, white balance may be required. You can define the color that will be used as the reference white in the balance.
You can also define a gamma correction to linearize or unlinearize an image.
When using the linear tone mapper, the chromaticity is corrected as follow :
RGB images are usualy stored as RGB, in the sRGBD65 color space. When it is not the case, the color space must be stored in the file metadatas, in the "chromaticities" field, or selected in the Input color space field. The RGB image is first converted to XYZ.
If the image is already stored as XYZ, it doesn't need this first convertion : you can select the XYZ_Identity option in the Input color space field.
The XYZ image is converted back to RGB in the selected Display color space.
OCIO tone mapper : OpenColorIO (OCIO) is a color management solution based around a configuration file "config.ocio" that can be interprated by the OCIO library. The configuration file defines a list of color spaces with the corresponding conversions, as well as looks and views :
- A look is an artistic process to manage contrast, saturation, bleach effects, etc.
- A view transform is a display process to manage tone mapping, compression, gamma, etc.
- A view combines a view transform, a conversion from working color space to display color space, and an optional look.
An OCIO preset (or config) is defined by an input color space, a display color space, a view and an optionnal look. You can select the preset to use in the tone mapper Config combobox in the interface. In addition to the OCIO preset selection, you can define an Exposure value : a simple multiplicative factor applied to the image during the process (see details bellow).
For some processes, white balance may be required. You can define the color that will be used as the reference white in the balance.
You can also define a gamma correction to linearize or unlinearize an image.
Some presets (Standard and Human Vision) are always available to be used in the post pipeline. You can also define your own presets in the Tone Mapping Preferences (menu Predict Suite/Preferences... > Tone Mapping).
To define your custom presets, you can use the default OCIO config or change for a custom config file of your own. When changing the config file, make sure the XYZ space is properly selected, it is important for the color system management when using OCIO tone mapping in Predict Engine (see Post Pipeline section). You can also select a default working space that will be used if it is not defined in the config.ocio file.
NB : The name of your custom preset defines what will show in the Config combobox in the interface.
The OCIO tone mapper works as follow (see figure bellow) :
The input data is given in the input color space in a given [min;max] range : the input color space is specified by the user,
The input data is then converted to a working color space : the working color space is usually defined in the config.ocio file but the user can override it or define a fallback value for files where the default value is not found,
The exposure is corrected with a linear factor (this is not defined in the config.ocio file),
Optionnal : if defined by the user, a user look is applied in addition to the look defined in the view,
The view is then applied : first the optionnal look, then the view transform, and finally the conversion from working color space to display color space,
The gamma correction is usually included in the view, but the user can choose to manually linearize/unlinearize the output at the end of the process (this is not defined in the config.ocio file),
The final output is the display data, defined in [0;1] in the display color space.
Reinhard tone mapper : a photographic tone mapper based on the Reinhard 2002 paper. The Reinhard 02 tone mapper is defined as follow :
Burn : the dodging-and-burning parameter, > 1 for burning (increasing the luminance) and < 1 for dodging (reducing the luminance),
Pre scale and Post scale : the scales used to compute the Reinhard parameters, see functions bellow.
AppyReinhard is the function that computes the tone mapped value from the input value. lPScale and lInvY2 are computed via the computeReinhardParameters function. Global inputs are : Average (the average of the entire image for each channel R, G and B), Burn, PreScale and PostScale.
When using the Reinhard tone mapper, the chromaticity, gamma and white balance are corrected as when using a linear tone mapper. See section above.
Photographic tone mapper : simulates the behaviour of an actual camera. The Photographic tone mapper is defined as follow :
Exposure : the exposure time in seconds (can be edited at run time and automatized using the Auto Exposure option),
Aperture : the aperture of the optical system, the higher the aperture the more light enters the system (can be edited at run time),
ISO : the sensitivity of the sensor, the higher the sensitivity the less light is needed to expose the sensor (can be edited at run time),
Gain RGB : a multiplicative factor applied to the final output,
Bit Depth : the number of bits each pixel is stored on,
Pixel Offset : the minimum value taken by a pixel, the value should be in the interval [0; 2^BitDepth - 1].
If any of the following values {exposure time, ISO, Gain RGB} are set to 0, the output will be a completely black image.
When using the Photographic tone mapper, the chromaticity, gamma and white balance are corrected as when using a linear tone mapper. See section above.
False colors : RGB layers can also be displayed in false colors. In this case you must select a channel to display (R, G or B / X, Y or Z).
The range of data displayed on screen can be :
computed automatically : the entire range available is displayed,
defined with min/max percentages : the range is defined with values in [0;1] that represent a % of the range defined by [min;max],
defined with min/max values : the range is defined with raw values. In this case, the "Auto" button enables you to set the [min;max] to the available range in the current image.
The scale used to display false color values can be :
linear,
logarithm,
square root,
cubic root,
Figure : impact of the false color scale in the [0;1] range
When displaying false colors, the chromaticity is corrected as when using a linear tone mapper. See section above.
The exposure of the tone mapper (Linear/OCIO/Photographic : Exposure, Reinhard : Burn) can be chosen manually or it can be computed automatically using the Auto button in the Mapping section header.
The post processes made by Predict Lab happen in the following order :
1) Filters (Outlier > Median > Gaussian)
2) PSF
3) Flat field
4) Chromaticity (for OCIO : Input > Working)
5) Tone Mapping
6) Blooming
7) Chromaticity for OCIO : Working > Display
8) Gamma
9) White reference