Structure GBufData

3DS Max Plug-In SDK

Structure GBufData

See Also: List of Image Channels, Class GBufReader, Class GBufWriter, Class GBuffer, Structure RealPixel, Structure Color24, Class Point2, List of G-Buffer Channel Types.

This structure is used by the GBufReader and GBurWriter code to hold the G-Buffer data.

struct GBufData {

float z;

The floating point depth value at the center of the fragment that is foremost in the sorted list of a-buffer fragments.

UBYTE mtl_id;

The ID assigned to the material via the Material Editor.

UWORD node_id;

This is the ID assigned to node via the Object Properties / G-buffer ID spinner.

Point2 uv;

UV coordinates, stored as a Point2.

DWORD normal;

Normal vector in view space, compressed.

RealPixel realpix;

Non clamped colors in "RealPixel" format.

UBYTE coverage;

Pixel coverage of the front surface.

UWORD rend_id;

The renderer will set this ID for all rendered nodes, and will set all non-rendered nodes to 0xffff.

Color24 color;

This is color returned by the material shader for the fragment.

Color24 transp;

This is transparency returned by the material shader for the fragment.

Color24 weight;

This is the sub-pixel weight of a fragment.

Point2 veloc;

This gives the velocity vector of the fragment relative to the screen, in screen coordinates.

};