C4 Engine
C4 Engine API Documentation

Node::SetPerspectiveExclusionMask

Defined in:  C4Node.h
Sets the perspective exclusion mask.
Prototype

void SetPerspectiveExclusionMask(uint32 mask);

Parameters
mask The new perspective exclusion mask.
Description
The SetPerspectiveExclusionMask function sets the perspective exclusion mask that determines from what camera perspectives the node is enabled to the value specified by the mask parameter. The mask can be a combination (through logical OR) of the following constants.
kPerspectivePrimary The perspective of the primary camera used to render the world.
kPerspectiveReflection The perspective of a camera used to render into the reflection buffer.
kPerspectiveRefraction The perspective of a camera used to render into the refraction buffer.
kPerspectiveIlluminanceSpace The perspective of a camera used to generate an illuminance space texture map.
kPerspectiveDirectMask A mask that includes all direct perspectives (primary camera, reflection buffer, and refraction buffer). A node having these bits set will never be rendered from the direct perspective.
kPerspectiveCameraWidgetMask A mask that includes all camera widget perspectives. A node having these bits set will never be rendered from the camera widget perspective.
kPerspectiveDirectShadowMask A mask that includes all direct shadow perspectives. A node having these bits set will never cast a shadow from the direct perspective.
kPerspectiveCameraWidgetShadowMask A mask that includes all camera widget shadow perspectives. A node having these bits set will never cast a shadow from the camera widget perspective.
kPerspectivePrimaryMask A mask that includes all primary camera perspectives (direct, remote portal, and camera widget). A node having these bits set will never be rendered through the primary camera.
kPerspectiveReflectionMask A mask that includes all reflection buffer perspectives. A node having these bits set will never be rendered in the reflection buffer.
kPerspectiveRefractionMask A mask that includes all refraction buffer perspectives. A node having these bits set will never be rendered in the refraction buffer.
kPerspectivePrimaryShadowMask A mask that includes all primary camera shadow perspectives (direct, remote portal, and camera widget). A node having these bits set will never cast a shadow through the primary camera.
kPerspectiveReflectionShadowMask A mask that includes all reflection buffer shadow perspectives. A node having these bits set will never cast a shadow in the reflection buffer.
kPerspectiveRefractionShadowMask A mask that includes all refraction buffer shadow perspectives. A node having these bits set will never cast a shadow in the refraction buffer.
For any bits that are set in the perspective exclusion mask, the node is not enabled for cameras having the matching perspective. The initial value of the mask is 0, meaning that the node is enabled from all camera perspectives.

There are three different perspective classifications defined by the engine for two different camera classifications, and each combination of these classifications can apply to geometry rendering or shadow rendering. The three perspective classifications correspond to the primary rendering buffer, the reflection buffer, and the refraction buffer. The two camera classifications correspond to direct rendering and rendering through a camera widget in a panel effect. The bits corresponding to the three perspective classifications for direct rendering are the values kPerspectivePrimary, kPerspectiveReflection, and kPerspectiveRefraction. For the other camera classifications and for shadows, these three bit values can be shifted by one of the following constants.
kPerspectiveCameraWidgetShift The shift value for the camera widget classification.
kPerspectiveDirectShadowShift The shift value for the direct shadow classification.
kPerspectiveCameraWidgetShadowShift The shift value for the camera widget shadow classification. For example, to prevent a node from being rendered or casting a shadow in reflections seen through a camera widget, the perspective exclusion mask should be set to (kPerspectiveReflection << kPerspectiveCameraWidgetShift) | (kPerspectiveReflection << kPerspectiveCameraWidgetShadowShift)
See Also

Node::GetPerspectiveExclusionMask