configureDepthAlphaMask method

  1. @protected
void configureDepthAlphaMask({
  1. bool? masked,
  2. required TextureSource? texture,
  3. TextureTransform? transform,
  4. int texCoord = 0,
  5. double cutoff = 0.5,
  6. double alpha = 1.0,
})

Configures cutout coverage for the depth-writing passes: the camera depth, the shadow maps, and the main pass's coverage pre-draw, which is what cuts the surface out on screen.

masked defaults to whether a texture is given; pass true to mask by the constant and vertex-color alpha alone (sampling white).

Implementation

@protected
void configureDepthAlphaMask({
  bool? masked,
  required TextureSource? texture,
  TextureTransform? transform,
  int texCoord = 0,
  double cutoff = 0.5,
  double alpha = 1.0,
}) {
  _depthMasked = masked ?? texture != null;
  _depthMaskTexture = texture;
  _depthMaskTransform = transform ?? TextureTransform();
  _depthMaskTexCoord = texCoord.clamp(0, 1);
  _depthMaskCutoff = cutoff;
  _depthMaskAlpha = alpha;
}