3ds Max C++ API Reference
gbuf.h File Reference
#include "coreexp.h"
#include "maxheap.h"
#include "strbasic.h"
#include "maxtypes.h"
#include "point2.h"
#include "color.h"
#include "baseinterface.h"

Classes

struct  GBufData
 
class  GBufReader
 
class  GBufWriter
 
class  GBuffer
 

Macros

#define NUMGBCHAN   14
 
#define GB_Z   0
 (4) Z-Buffer depth, float More...
 
#define GB_MTL_ID   1
 (1) ID assigned to mtl via mtl editor More...
 
#define GB_NODE_ID   2
 (2) ID assigned to node via properties More...
 
#define GB_UV   3
 (8) UV coordinates - Point2 More...
 
#define GB_NORMAL   4
 (4) Normal vector in view space, compressed More...
 
#define GB_REALPIX   5
 (4) Non-clamped colors in "RealPixel" format More...
 
#define GB_COVERAGE   6
 (1) Pixel coverage of the front surface More...
 
#define GB_BG   7
 (3) RGB color of what's behind the front object More...
 
#define GB_NODE_RENDER_ID   8
 (2) System node number, valid during a render More...
 
#define GB_COLOR   9
 (3) Color (RGB) More...
 
#define GB_TRANSP   10
 (3) Transparency (RGB) More...
 
#define GB_VELOC   11
 (8) Velocity (Point2) More...
 
#define GB_WEIGHT   12
 (3) Weight of layers contribution to pixel color More...
 
#define GB_MASK   13
 (2) Sub pixel coverage mask More...
 
#define BMM_CHAN_NONE   0
 
#define BMM_CHAN_Z   (1<<GB_Z)
 The size is 32 bits per pixel. More...
 
#define BMM_CHAN_MTL_ID   (1<<GB_MTL_ID)
 The size is 8 bits per pixel. More...
 
#define BMM_CHAN_NODE_ID   (1<<GB_NODE_ID)
 The size is 16 bits per pixel. More...
 
#define BMM_CHAN_UV   (1<<GB_UV)
 The size is 64 bits per pixel. More...
 
#define BMM_CHAN_NORMAL   (1<<GB_NORMAL)
 The size is 32 bits per pixel. More...
 
#define BMM_CHAN_REALPIX   (1<<GB_REALPIX)
 The size is 32 bits per pixel. More...
 
#define BMM_CHAN_COVERAGE   (1<<GB_COVERAGE)
 This provides an 8-bit value (0..255) that gives the coverage of the surface fragment from which the other G-buffer values are obtained. More...
 
#define BMM_CHAN_BG   (1<<GB_BG)
 The size is 24 bits per pixel. More...
 
#define BMM_CHAN_NODE_RENDER_ID   (1<<GB_NODE_RENDER_ID)
 The size is 16 bits per pixel. More...
 
#define BMM_CHAN_COLOR   (1<<GB_COLOR)
 It is a 24 bit RGB color (3 bytes per pixel). More...
 
#define BMM_CHAN_TRANSP   (1<<GB_TRANSP)
 It is a 24 bit RGB color (3 bytes per pixel). More...
 
#define BMM_CHAN_VELOC   (1<<GB_VELOC)
 It is a Point 2 (8 bytes per pixel). More...
 
#define BMM_CHAN_WEIGHT   (1<<GB_WEIGHT)
 It is a 24 bit RGB color (3 bytes per pixel). More...
 
#define BMM_CHAN_MASK   (1<<GB_MASK)
 The 4x4 (16 bits = 1 word) pixel coverage mask. More...
 
#define BMM_CHAN_TYPE_UNKNOWN   0
 
#define BMM_CHAN_TYPE_8   2
 1 byte per pixel More...
 
#define BMM_CHAN_TYPE_16   3
 1 word per pixel More...
 
#define BMM_CHAN_TYPE_24   8
 3 bytes per pixel More...
 
#define BMM_CHAN_TYPE_32   4
 2 words per pixel More...
 
#define BMM_CHAN_TYPE_48   5
 3 words per pixel More...
 
#define BMM_CHAN_TYPE_64   6
 4 words per pixel More...
 
#define BMM_CHAN_TYPE_96   7
 6 words per pixel More...
 

Functions

CoreExport int GBDataSize (int i)
 
CoreExport MCHARGBChannelName (int i)
 
CoreExport void SetMaximumGBufferLayerDepth (int m)
 
CoreExport int GetMaximumGBufferLayerDepth ()
 
CoreExport GBufferNewDefaultGBuffer ()
 

Macro Definition Documentation

◆ NUMGBCHAN

#define NUMGBCHAN   14

Function Documentation

◆ GBDataSize()

CoreExport int GBDataSize ( int  i)
Remarks
Returns the number of bytes per pixel for the specified channel.
Parameters:
int i

The index of the channel. See G-Buffer Channel Indices.

◆ GBChannelName()

CoreExport MCHAR* GBChannelName ( int  i)
Remarks
Returns the name of the specified channel.
Parameters:
int i

The index of the channel. See G-Buffer Channel Indices.
Returns
The name returned for the specified index:

GB_Z (0): "Z"

GB_MTL_ID (1): "Material Effects"

GB_NODE_ID (2): "Object"

GB_UV (3): "UV Coordinates"

GB_NORMAL (4): "Normal"

GB_REALPIX (5): "Non-Clamped Color"

GB_COVERAGE (6): "Coverage"

GB_BG (7): "Coverage Background"

GB_NODE_RENDER_ID (8): "Node Render ID"

GB_COLOR (9): "Color"

GB_TRANSP10): "Transparency"

GB_VELOC (11): "Velocity"

GB_WEIGHT (12): "Sub-Pixel Weight"

GB_MASK (2): "Sub-Pixel Coverage Mask"

◆ SetMaximumGBufferLayerDepth()

CoreExport void SetMaximumGBufferLayerDepth ( int  m)
Remarks
Sets the maximum GBuffer layer depth.
Parameters:
int m

The number to set.

◆ GetMaximumGBufferLayerDepth()

CoreExport int GetMaximumGBufferLayerDepth ( )
Remarks
Returns the maximum GBuffer layer depth.

◆ NewDefaultGBuffer()

CoreExport GBuffer* NewDefaultGBuffer ( )
Remarks
Creates and returns a pointer to a new default G-Buffer. The buffer is essentially created empty.

A 'default' G-Buffer is one that 3ds Max itself creates. See GBuffer::IsDefaultGBuffer() below.