MultipassObject Manual
A MultipassObject represents a multipass element of the render settings. Cinema 4D 's render engines will render and save different multipasses based on these settings.
MultipassObject
objects are an instance of
Zmultipass
.
// set to depth pass BaseContainer & data = depthPass-> GetDataInstanceRef (); data. SetInt32 ( MULTIPASSOBJECT_TYPE , VPBUFFER_DEPTH );
// insert renderData-> InsertMultipass (depthPass); renderData-> 消息 ( MSG_UPDATE ); }
// enable multi-passes renderData-> SetParameter ( DescID ( RDATA_MULTIPASS_ENABLE ), true , DESCFLAGS_SET::NONE );
Existing MultipassObject elements are stored in a list and can be accessed from a RenderData object:
The MultipassObject class does not offer a static "Alloc" or "Free" function so the functions of BaseList2D have to be used with Zmultipass .
A newly created MultipassObject is added to the render settings by adding it to the RenderData object:
// set to depth pass BaseContainer & data = depthPass-> GetDataInstanceRef (); data. SetInt32 ( MULTIPASSOBJECT_TYPE , VPBUFFER_DEPTH );
// insert renderData-> InsertMultipass (depthPass);
MultipassObject objects are organized in a list:
All multipasses are MultipassObject objects. They only differ in their parameters. The type of a multipass is defined with:
Simple multipass types are:
Configurable multipass types are:
The parameter IDs of configurable multipasses are defined in
zmultipass.h
.
Additional multipass types are:
Example object buffer:
// This example creates an object buffer multipass. MultipassObject * const multipass = static_cast< MultipassObject * > ( BaseList2D::Alloc ( Zmultipass )); if (multipass == nullptr ) return maxon::OutOfMemoryError( MAXON_SOURCE_LOCATION ); BaseContainer & data = multipass-> GetDataInstanceRef (); data. SetInt32 ( MULTIPASSOBJECT_TYPE , VPBUFFER_OBJECTBUFFER ); data. SetInt32 ( MULTIPASSOBJECT_OBJECTBUFFER , 99); renderData-> InsertMultipass (multipass);Example blend channel:
// This example creates an blend multipass. MultipassObject * const multipass = static_cast< MultipassObject * > ( BaseList2D::Alloc ( Zmultipass )); if (multipass == nullptr ) return maxon::OutOfMemoryError( MAXON_SOURCE_LOCATION ); BaseContainer & data = multipass-> GetDataInstanceRef (); data. SetInt32 ( MULTIPASSOBJECT_TYPE , VPBUFFER_BLEND ); data. SetBool ( MULTIPASSOBJECT_DIFFUSE , true ); data. SetBool ( MULTIPASSOBJECT_SHADOW , true ); renderData-> InsertMultipass (multipass);Example reflection channel:
// This example creates a reflection multipass. MultipassObject * const multipass = static_cast< MultipassObject * > ( BaseList2D::Alloc ( Zmultipass )); if (multipass == nullptr ) return maxon::OutOfMemoryError( MAXON_SOURCE_LOCATION ); BaseContainer & data = multipass-> GetDataInstanceRef (); data. SetInt32 ( MULTIPASSOBJECT_TYPE , VPBUFFER_REFLECTION ); data. SetInt32 ( MULTIPASSOBJECT_REFLECTION_MATERIALS , MULTIPASSOBJECT_REFLECTION_SEPARATE_ALL ); renderData-> InsertMultipass (multipass);Example specular channel:
// This example creates a specular multipass. MultipassObject * const multipass = static_cast< MultipassObject * > ( BaseList2D::Alloc ( Zmultipass )); if (multipass == nullptr ) return maxon::OutOfMemoryError( MAXON_SOURCE_LOCATION ); BaseContainer & data = multipass-> GetDataInstanceRef (); data. SetInt32 ( MULTIPASSOBJECT_TYPE , VPBUFFER_SPECULAR ); data. SetInt32 ( MULTIPASSOBJECT_SPECULAR_MATERIALS , MULTIPASSOBJECT_SPECULAR_SEPARATE_ALL ); renderData-> InsertMultipass (multipass);