bind method

void bind(
  1. RenderPass pass,
  2. HostBuffer transientsBuffer,
  3. Lighting lighting
)

Binds this material's render-pass state, uniforms, and textures.

The base implementation enables back-face culling with counter-clockwise winding (matching the glTF convention). Subclasses must call super.bind and then bind any per-material uniforms and textures expected by their fragment shader. lighting carries the IBL EnvironmentMap (and its intensity) plus the analytic lights and shadow resources that materials shade against.

Implementation

void bind(
  gpu.RenderPass pass,
  gpu.HostBuffer transientsBuffer,
  Lighting lighting,
) {
  pass.setCullMode(doubleSided ? gpu.CullMode.none : gpu.CullMode.backFace);
  // backendWinding wraps the default winding for the GLES render-target
  // Y-flip workaround (see y_flip.dart); identity on Metal/Vulkan/web.
  pass.setWindingOrder(backendWinding(gpu.WindingOrder.counterClockwise));
}