extendedMaterialLoaderPlugin.ts 745 B

12345678910111213141516
  1. import { ILoaderPlugin } from "./loaderPlugin";
  2. import { telemetryManager } from "../../telemetryManager";
  3. import { ViewerModel } from "../../model/viewerModel";
  4. import { Color3, Texture, BaseTexture, Tools, ISceneLoaderPlugin, ISceneLoaderPluginAsync, Material, PBRMaterial, Engine } from "babylonjs";
  5. /**
  6. * A (PBR) material will be extended using this function.
  7. * This function will hold extra default configuration for the viewer, if not implemented in Babylon itself.
  8. */
  9. export class ExtendedMaterialLoaderPlugin implements ILoaderPlugin {
  10. public onMaterialLoaded(baseMaterial: Material) {
  11. var material = baseMaterial as PBRMaterial;
  12. material.alphaMode = Engine.ALPHA_PREMULTIPLIED_PORTERDUFF;
  13. }
  14. }