Bit Masking
A bit masking is a flexible mechanism used to access only the specific bits in a set of data. After double clicking the mask field you need to specify values for a bit mask consisting of 32 bits. Each of 32 bits can either be turned on (1) or off (0) when clicking on the bit number. The resulting mask (when bit mask window is closed) is displayed in hexadecimal characters. After that, two masks are compared bitwise using binary operator and. As a result, the first bit of the first mask is compared to the first bit of the second mask, the second bit - to the second one etc. If at least one pair of corresponding bits is turned on at the same time, the masks match.
- A Set option turns on all the bits in the mask
- A Clear option turns all the bits in the mask
See Also
- A Collision mask section to know more about selecting objects to collide
- A Physical mask section to know more about selecting objects to be affected by physical effects
- An Intersection mask section to know more about selecting objects to be included when calculating intersections
Rendering into the Viewport
Objects (along with decals and lights) can be selectively rendered into the viewport.
For the objects to be rendered into the viewport, the camera viewport mask (set in the Tools -> Camera tab) should match the following masks:
- An object surface VIEWPORT mask
- An object material viewport mask to render the object's material
- A light viewport mask to illuminate the object (otherwise, the whole scene will be black)
Usage Example
Suppose we have two objects with the same material. To make one of them appear in the viewport and the other one not to be rendered, we need to change the viewport mask. Both objects have the same object, material and light masks, but the viewport masks differ, so we get the following result:
Reflections from Objects
Reflections from objects can also be selectively rendered into the viewport: an object can be rendered without reflection or only reflection without an object itself. For the object to be rendered with reflections, the camera's reflection mask should match with:
- A reflection mask of the reflecting material (set in the Materials -> Parameters tab -> Reflection Mask).
- A viewport mask of the reflecting material
- A viewport mask of the reflected material
- Object's surface viewport mask
- A light viewport mask
Usage Example
Let's discuss reflection masking for two cases: an object without a reflection and reflection without an object.
- To render an object without reflection, either its surface viewport mask or its material viewport mask should not match the camera reflection mask.
- To render a reflection without a surface, its surface viewport mask or its material viewport mask should not match the camera viewport mask.
An object without the reflection | A reflection without the object | ||||||||||||||||||||||||||||||||
|
|
Light Mask
For the surface to be illuminated only by the chosen light sources, a bit mask should be used. Matching this mask to the one of light source (one bit, at least), allows you to control the intensity of the object illumination.
Decal Mask
A decal mask specifies objects, onto which the decal can be projected. An object can receive the decal if its mask corresponds to this mask.