Page History
...
The default values when you create a SettingsColorMapping
plugin are different from the recommended values in 3dsMax and Maya for legacy reasons. These are the values you should use for new scenes:
type=6
// 6=Reinhard mapping (plugin default is 0=linear)dark_mult=1
// don't change dark colors additionallybright_mult=1
// don't change bright colors additionallygamma=2.2
// close to sRGB (plugin default is 1.0)subpixel_mapping=0
clamp_output=0
clamp_level=1
adaptation_only=2
// 2=only apply color mapping (plugin default is 0=apply both color mapping and gamma)linearWorkflow=0
// this is important - this option exists only for legacy scenes
There is one more place to control color mapping - BitmapBuffer
for texture assets. It has two parameters for converting the image file colors - gamma and color_space
.
<TODO> clarify gamma stuff
6.8.1. Linear workflow
In order for V-Ray to perform mathematically correct calculations, input and output color data should be linear. The results should only be converted to a non-linear color space suitable for humans (such as sRGB) for display. This is called linear workflow.
For proper linear workflow, you need to set the SettingsColorMapping
parameters gamma
, adaptation_only
and linearWorkflow
to the values listed above. The parameter linearWorkflow
is intended only for compatiblity with old vrscene files and should not be set to 1, despite its misleading name.
By default the VFB (V-Ray Frame Buffer) has its sRGB option enabled, so you will see the original linear image with sRGB applied as a post-process. The actual files you save from the VFB or with VRayRenderer::saveImage()
will be linear like the actual data if saved in a floating point format like EXR or VRIMG. On the other hand, most 8/16-bit integer formats implicitly save their data gamma-encoded (e.g. JPEG applies ~2.2 gamma for dynamic range compression. Applications that read JPEG handle that and display the data in the required color space, gamma-encoded or linear). Saving to such integer file formats with saveImage()
or from the VFB button also bakes any color corrections done in the VFB, including the sRGB conversion. So these files will look exactly like you see them in the VFB. This does not apply to EXR and VRIMG.
6.8.2. Bitmaps
There is one more place to control color mapping - BitmapBuffer
- for texture file assets. It has two parameters for converting the image file colors - gamma
and color_space
. The gamma parameter is considered only when color_space=1
and makes texture reads apply inverse gamma to decode gamma-compressed values to linear. When color_space=2
, sRGB decoding is performed (similar, but not identical to color_space=1
& gamma=0.4545
). Since V-Ray implicitly converts JPEG (or PNG and other 8-bit formats) file data to linear RGB while reading the file, it isn't necessary to change gamma or color_space from their default values for such textures. This is only necessary for images baked with gamma encoding (before any internal conversion, such as JPEG's YCbCrNote that by default the VFB (V-Ray Frame Buffer) has its sRGB option enabled, so you will see the original linear image with sRGB applied as a post-process. The actual files you save will be linear as the actual data, but it depends on the file format (i.e. JPEG applies ~2.2 gamma for dynamic range compression because it stores 8 bits).
6.9. Stereo and panorama rendering
...