3ds Max C++ API Reference
RealPixel Struct Reference

#include <color.h>

Public Member Functions

 operator Color ()
 

Public Attributes

unsigned char r
 The mantissas of R,G,and B, relative to this exponent. More...
 
unsigned char g
 
unsigned char b
 
unsigned char e
 The base 2 exponent of the maximum RGB component. More...
 

Detailed Description

See also
Class Color.
Remarks
This structure describes color in terms of r, g, b, e.

This is taken from GraphicsGems II, "Real Pixels" by Greg Ward of Lawrence Berkeley Laboratory. What it means is this: "e" is the base 2 exponent of the maximum RGB component, and r,g,b are the mantissas of R,G,and B, relative to this exponent. It essentially compresses the essential data of a floating point color into 32 bits.

Quoting from Graphics Gems II:
"It appears that this format favors the largest primary value at the expense of accuracy in the other two primaries. This is true, but it also is true that the largest value dominates the displayed pixel color so that the other primaries become less noticeable".

One GBuffer option is to write out the image in RealPixel format, storing NON CLAMPED colors. This could be used by a Video Post process to detect those areas of the image where the intensity goes beyond 1 and apply halo and flare effects much more realistically.

There are functions for converting between floating point and RealPixel format:
RealPixel MakeRealPixel(float r, float g, float b);
and
ExpandRealPixel(RealPixel &rp, float& r, float &g, float& b);
as well as methods in RealPixel and Color.

Member Function Documentation

◆ operator Color()

operator Color ( )
Remarks
Converts the RealPixel format to the Color format.

Member Data Documentation

◆ r

unsigned char r

The mantissas of R,G,and B, relative to this exponent.

◆ g

unsigned char g

◆ b

unsigned char b

◆ e

unsigned char e

The base 2 exponent of the maximum RGB component.