extendedMaterialLoaderPlugin.ts 549 B

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