3ds Max C++ API Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Color Management Overview

3ds Max can work in three different color management modes:

  • Unmanaged: All the color swatches and the bitmap pixel values are used as-is, i.e. no physical to perceptual conversions (like gamma encoding/decoding) will be performed.
  • Gamma: This is also called "de-gamma/re-gamma work flow". In this mode all the input colors and textures are converted to linear space using the input gamma values. Similarly all the output colors are properly gamma-encoded for the output medium (monitor, file, etc). The color computations (like rendering) are done in linear (scene-referred) space. This mode assumes that all of the colors are expressed in the same color gamut (typically sRGB).
  • OpenColorIO: There are two OCIO modes (ColorPipelineMode::kOCIO_DEFAULT and ColorPipelineMode::kOCIO_CUSTOM) which are the most powerful color management modes 3ds Max provides. In these modes the user can use textures and colors from different color spaces, can pick any linear color space (such as ACEScg) to perform renderings in, can work on monitors with different color gamuts and can save images in various color spaces with different view transforms applied. This mode uses OpenColorIO as the color management engine and the available color spaces, displays, transforms etc are defined in OCIO config files.

    IColorPipelineMgr is the central hub for controlling and querying the active color management mode, available color spaces, displays, views and and accessing the other settings. IModeSettings class provides access to detailed settings of each mode. (see IColorPipelineMgr::Settings() )

    If you need to convert colors from one color space to another, you'll need to create objects of class IColorPipeline. You can create IColorPipeline objects using various methods of the IColorPipelineMgr class. Although IColorPipeline defines the operations needed to transform colors, it can not do the computations by itself. The actual conversions are done by the ColorConverter class which is a template class and can perform operations in an optimized way for the specified input and output data types.

    Here is an example showing how the classes relate to each other and how to use them in some simple scenarios.

    // Get the pointer to the IColorPipelineMgr instance.
    IColorPipelineMgr* colorPipelineMgr = IColorPipelineMgr::GetInstance();
    // Get the pipeline for transforming colors from the current rendering space
    // to default display/view pair.
    auto pipeline = colorPipelineMgr->GetDefaultViewingPipeline();
    // Get two converters, one for Color->BMM_Color_32, other for
    // BMM_Color_64->BMM_Color_64 pixel data types.
    auto conv_Flto32 = pipeline->GetColorConverter<Color, BMM_Color_32>();
    auto conv_64to64 = pipeline->GetColorConverter<BMM_Color_64, BMM_Color_64>();
    // Example 1: single color conversion from Color in rendering color space to
    // BMM_Color_32 in default display/view color space.
    BMM_Color_32 out32 = conv_Flto32->ConvertColor(Color(1.0f, 0.5f, 0.25f));
    // Example 2: in-place image conversion in parallel
    BMM_Color_64 myImage[1280 * 1024];
    parallel_for(
    ...,
    [&](...)
    {
    BMM_Color_64* bufferSliceForThread = ...
    size_t sliceHeight = ...
    conv_64to64->ConvertImage(bufferSliceForThread, 1280, sliceHeight);
    }
    );
    static CoreExport IColorPipelineMgr * GetInstance()
    Returns a pointer to the system-wide instance of IColorPipelineMgr.


Please See Color Management in the 3ds Max Developer Guide for more information.