Predict Engine is a path tracer : its algorithm computes the illuminance incoming at every single point on the surface of objects in a 3D scene. Different optical instruments can be used to convert this illuminance into a 2D image.
In Unreal Engine, optical instruments are necessarily represented with a Camera component that defines the model of a digital camera. Without additional settings, a Predict Engine camera will be generated automatically from this component.
In Predict Engine, optical instruments can be digital cameras, photometers, radiometers, polarimetric sensors, Bayer sensors,... Such optical instruments can be defined by adding the UVR Custom Settings component to a Camera Actor.
NB : the plugin is still using an alpha version of this component to demo how it should work, it is not stable and might change in the following plugins.
In the UVR Camera Settings section, you can reference a Camera custom settings Asset.
The camera custom settings asset is currently a .XML file containing the definition of the camera. This format will change in the following versions of the plugin.
Currently, the .XML file defines the following parameters :
The Type of the sensor: the alpha plugin supports two kind of sensors.
Still Camera / Photographic : This sensor behaves like the CCD or CMOS sensor of a classic camera. The sensor computes a raw image using the camera’s spectral response curves. The raw image is then converted to a LDR image in the post pipeline function. Be aware that the RGB values do not correspond to any physical quantity as it depends on the post pipeline. This is the sensor you should use to model a measured sensor. The sensor requires an RGB spectral response file, we offer a choice between some commonly used presets : {Preset-CIE-RGB-1931, Preset-CIE-RGB-2006}.
Human / Photometric : In order to visualize a scene as the human eye would perceive it, the CIE (Commission Internationale de l'Eclairage) has defined several standard "observers" that represent the color perception of an average person. This sensor converts the raw spectral radiance to the CIE XYZ color space using these observers. The observers are characterized by 3 curves commonly named the Color Matching Function (CMF). We use this CMF to convert the spectral radiance to the XYZ color space. After an XYZ to RGB conversion, the resulting image corresponds to what an average person would see. We offer a choice between some commonly used CMF : {Preset-CIE-XYZ-1931, Preset-CIE-XYZ-1964, Preset-CIE-XYZ-2015-2Deg, Preset-CIE-XYZ-2015-10Deg}.
The Lens of the opical system: the lens is defined by its radius and its focus distance.
The Lens Radius is the radius of the optical system, in the same unit as the scene. The larger the radius is, the more blur there will be in the image for objects out of focus. If the radius is set to 0, a Perfect Pinhole model will be used instead of the Lens model.
The Focus Distance is the distance at which the image will be sharp, in the same unit as the scene : an object that is seen from a distance similar to the focus distance will be sharp, an object that is seen from closer/further away will be blurred.
Difference between a scene defined with a Perfect Pinhole optical system (left) and a Lens optical system focused on the red sphere (right)
The expected format for the .XML file is the following, you can edit the bold values to edit the corresponding settings. The lens radius and focal distance can be float value. The type of the sensor should be either "PhotographicSensor" or "PhotometricSensor", its preset should be one of the values listed above.
The post process is currently defined in the settings menu of the Predict Engine View.
NB : this might change in the following plugins, the post process might be defined directly on the camera custom settings.
Images produced by Predict Engine 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.
The tone mapper used in Predict Engine is linear : a simple multiplicative factor is applied to the image. This factor is called the Exposure Value. It can be edited directly in the Predict Engine view, in the settings menu.
Scene previewed using different exposures
You can find a good explanation of what the gamma correction is needed for on this page. Here is an extract :
"The need for gamma arises for two main reasons: The first is that screens have a non-linear response to intensity. The other is that the human eye can tell the difference between darker shades better than lighter shades. This means that when images are compressed to save space, we want to have greater accuracy for dark intensities at the expense of lighter intensities. Both of these problems are resolved using gamma correction, which is to say the intensity of every pixel in an image is put through a power function. Specifically, gamma is the name given to the power applied to the image.
Most images are stored with a gamma of 0.45 (1/2.2) applied to them [...]. Images stored like this are in “gamma space” [...]. This is the default behavior of nearly every digital camera, as well as image editing applications and so on. In fact, nearly every image you see on your computer has that gamma applied to it.
You may be wondering why images display correctly, and don’t look too bright. This is where the non-linear response of displays comes in. CRT screens, simply by how they work, apply a gamma of around 2.2, and modern LCD screens are designed to mimic that behavior. A gamma of 2.2, the reciprocal of 0.45, when applied to the brightened images will darken them, leaving the original image."
In order to display on screen an image corrected for your specific screen, Predict Engine needs the exact value of this gamma correction : this is the gamma defined in the settings menu of the Predict Engine view.
Gamma = 0.45
Gamma = 1
Gamma = 2.2