PixelFragment Struct Reference

#include <c4d_raytrace.h>

Public Attributes

PixelFragmentnext
 
PixelFragmentcluster
 
RayHitID id
 
union {
   UInt16   mask [16]
 
   UInt32   lmask [16/2]
 
}; 
 
Float32 z
 
Float32 u
 
Float32 v
 
Vector32 col
 
Vector n
 
Int32 subid
 

Member Data Documentation

◆ next

The next fragment in the list.

◆ cluster

PixelFragment * cluster

If not nullptr then this pixel fragment is just a dummy for its children, stored as a linear list in 'cluster'.
The coverage masks are then automatically in the union of all children masks.

◆ id

The global RayHitID structure.

◆ mask

UInt16 mask[16]

The coverage mask. Each pixel fragment can cover 16*16 sub-pixels at maximum.
For each Y sub-pixel line the mask is stored in PixelFragment::mask[y]. Bit 15 it the leftmost sub-pixel, 0 is at the right.
To check for the upper left sub-pixel use exists=PixelFragment::mask[0]&(1<<15).

Note
Use either mask or lmask. Both belong to the same union in the structure.

◆ lmask

UInt32 lmask[16/2]

Provides wide access to the 16 elements of mask.

Note
Use either mask or lmask. Both belong to the same union in the structure.

◆ 

union { ... }

◆ z

The pixel fragment's average z value as the fragment can cover a large Z area this is just a rough Z.

◆ u

The UV coordinates for the pixel fragment for it is first evaluated texture (several textures can be stacked, so only the first one can be stored here).

◆ v

The UV coordinates for the pixel fragment for it is first evaluated texture (several textures can be stacked, so only the first one can be stored here).

◆ col

Vector32 col

The color of the pixel fragment.

◆ n

Vector n

The average normal. As the fragment can cover a 'large' area this is just a rough normal.

◆ subid

Int32 subid

For polygon objects this is the sub-pixel displacement ID.
For perfect sphere objects this is true for the back side and false for the front side.