bind method

  1. @override
void bind(
  1. RenderPass pass,
  2. HostBuffer transientsBuffer,
  3. Environment environment
)
override

Implementation

@override
void bind(gpu.RenderPass pass, gpu.HostBuffer transientsBuffer,
    Environment environment) {
  super.bind(pass, transientsBuffer, environment);

  var fragInfo = Float32List.fromList([
    baseColorFactor.r, baseColorFactor.g,
    baseColorFactor.b, baseColorFactor.a, // color
    vertexColorWeight, // vertex_color_weight
  ]);
  pass.bindUniform(fragmentShader.getUniformSlot("FragInfo"),
      transientsBuffer.emplace(ByteData.sublistView(fragInfo)));
  pass.bindTexture(
      fragmentShader.getUniformSlot('base_color_texture'), baseColorTexture,
      sampler: gpu.SamplerOptions(
          widthAddressMode: gpu.SamplerAddressMode.repeat,
          heightAddressMode: gpu.SamplerAddressMode.repeat));
}