extendedMaterialLoaderPlugin.ts 665 B

12345678910111213141516
  1. import { Material } from 'babylonjs/Materials/material';
  2. import { PBRMaterial } from 'babylonjs/Materials/PBR/pbrMaterial';
  3. import { Engine } from 'babylonjs/Engines/engine';
  4. import { ILoaderPlugin } from './loaderPlugin';
  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. }