fromFlatbuffer static method

Material fromFlatbuffer(
  1. Material fbMaterial,
  2. List<Texture> textures
)

Implementation

static Material fromFlatbuffer(
    fb.Material fbMaterial, List<gpu.Texture> textures) {
  switch (fbMaterial.type) {
    case fb.MaterialType.kUnlit:
      return UnlitMaterial.fromFlatbuffer(fbMaterial, textures);
    case fb.MaterialType.kPhysicallyBased:
      return PhysicallyBasedMaterial.fromFlatbuffer(fbMaterial, textures);
    default:
      throw Exception('Unknown material type');
  }
}