depthOnlyVertex property

  1. @override
({VertexLayoutDescriptor layout, Shader shader})? get depthOnlyVertex

The vertex shader and layout the depth-style passes (the directional shadow map, the camera depth prepass, and the object-selection mask) should use for this geometry, or null to reuse vertexShader with instancedVertexLayout.

Unskinned geometry returns a position-only shader and layout so those passes fetch only the position attribute. Skinned geometry returns null (its joints-driven shader has no position-only variant yet), so the depth passes drive it through bind like the color pass.

Implementation

@override
({gpu.Shader shader, VertexLayoutDescriptor layout})? get depthOnlyVertex {
  final declared = _declaredDepthOnlyVertex;
  if (declared != null) return declared;
  if (_vertexLayout != null) return null;
  return (
    shader: _depthVertexShader ??= baseShaderLibrary['UnskinnedDepthVertex']!,
    layout: _isDeInterleaved
        ? kUnskinnedSoADepthLayout
        : kUnskinnedPositionOnlyLayout,
  );
}