PhysicallyBasedMaterial constructor

PhysicallyBasedMaterial({
  1. Texture? baseColorTexture,
  2. Texture? metallicRoughnessTexture,
  3. Texture? normalTexture,
  4. Texture? emissiveTexture,
  5. Texture? occlusionTexture,
  6. EnvironmentMap? environment,
})

Creates a PBR material with the given textures.

All textures are optional; missing textures are replaced with neutral placeholders at draw time. Per-channel scaling factors (e.g. metallicFactor, roughnessFactor) default to neutral and can be tweaked after construction.

Implementation

PhysicallyBasedMaterial({
  gpu.Texture? baseColorTexture,
  gpu.Texture? metallicRoughnessTexture,
  gpu.Texture? normalTexture,
  gpu.Texture? emissiveTexture,
  gpu.Texture? occlusionTexture,
  this.environment,
}) : _baseColorSource = baseColorTexture,
     _metallicRoughnessSource = metallicRoughnessTexture,
     _normalSource = normalTexture,
     _emissiveSource = emissiveTexture,
     _occlusionSource = occlusionTexture {
  setFragmentShader(baseShaderLibrary['StandardFragment']!);
}