API reference
API reference
Select your platform
No SDKs available
No versions available

CookieMask Class

Extends Mask2D
A mask that uses a cookie texture to determine the opacity of each pixel.

Fields

cookie : Texture2D
The cookie texture to use for the mask.
Signature
Texture2D cookie
sampleMode : SampleMode
The sample mode to use for the mask.
Signature
SampleMode sampleMode

Methods

Check ( c )
Not used on this mask.
Signature
override bool Check(Candidate c)
Parameters
c: Candidate  The candidate
Returns
override bool  true
SampleMask ( c )
This method applies the cookie mask to the given candidate.
It first generates an affine transformation based on the provided parameters, and then applies this transformation to the local position of the candidate. The resulting position is used to sample the cookie texture using the specified sample mode, and the resulting value is returned as the mask value for the candidate.
Signature
override float SampleMask(Candidate c)
Parameters
c: Candidate  The candidate to apply the mask to.
Returns
override float  The mask value for the given candidate.

Inner Enum

SampleMode Enum

The enumerator to define the samplemode.
See each item for the description.

Enumeration Constants

MemberValueDescription
NEAREST
0x0
NEAREST_REPEAT
0x1
Nearest neighbor.
NEAREST_REPEAT_MIRROR
0x2
Nearest neighbor, with repeat.
BILINEAR
0x3
Nearest neighbor, with repeat and mirror.
BILINEAR_REPEAT
0x4
Bilinear.
BILINEAR_REPEAT_MIRROR
0x5
Bilinear, with repeat.