MeshPhysicalNodeMaterial.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import MeshStandardNodeMaterial from './MeshStandardNodeMaterial.js';
  2. import { MeshPhysicalMaterial } from 'three';
  3. const defaultValues = new MeshPhysicalMaterial();
  4. export default class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
  5. constructor( parameters ) {
  6. super();
  7. this.isMeshPhysicalNodeMaterial = true;
  8. this.clearcoatNode = null;
  9. this.clearcoatRoughnessNode = null;
  10. this.clearcoatNormalNode = null;
  11. this.sheenNode = null;
  12. this.sheenRoughnessNode = null;
  13. this.iridescenceNode = null;
  14. this.iridescenceIORNode = null;
  15. this.iridescenceThicknessNode = null;
  16. this.sheen = 0;
  17. this.clearcoat = 0;
  18. this.iridescence = 0;
  19. this.transmission = 0;
  20. this.setDefaultValues( defaultValues );
  21. this.setValues( parameters );
  22. }
  23. copy( source ) {
  24. this.clearcoatNode = source.clearcoatNode;
  25. this.clearcoatRoughnessNode = source.clearcoatRoughnessNode;
  26. this.clearcoatNormalNode = source.clearcoatNormalNode;
  27. this.sheenNode = source.sheenNode;
  28. this.sheenRoughnessNode = source.sheenRoughnessNode;
  29. this.iridescenceNode = source.iridescenceNode;
  30. this.iridescenceIORNode = source.iridescenceIORNode;
  31. this.iridescenceThicknessNode = source.iridescenceThicknessNode;
  32. return super.copy( source );
  33. }
  34. }
粤ICP备19079148号