MeshPhysicalNodeMaterial.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import { addNodeMaterial } from './NodeMaterial.js';
  2. import MeshStandardNodeMaterial from './MeshStandardNodeMaterial.js';
  3. import { MeshPhysicalMaterial } from 'three';
  4. const defaultValues = new MeshPhysicalMaterial();
  5. class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
  6. constructor( parameters ) {
  7. super();
  8. this.isMeshPhysicalNodeMaterial = true;
  9. this.clearcoatNode = null;
  10. this.clearcoatRoughnessNode = null;
  11. this.clearcoatNormalNode = null;
  12. this.sheenNode = null;
  13. this.sheenRoughnessNode = null;
  14. this.iridescenceNode = null;
  15. this.iridescenceIORNode = null;
  16. this.iridescenceThicknessNode = null;
  17. this.specularIntensityNode = null;
  18. this.specularColorNode = null;
  19. this.transmissionNode = null;
  20. this.thicknessNode = null;
  21. this.attenuationDistanceNode = null;
  22. this.attenuationColorNode = null;
  23. this.setDefaultValues( defaultValues );
  24. this.setValues( parameters );
  25. }
  26. copy( source ) {
  27. this.clearcoatNode = source.clearcoatNode;
  28. this.clearcoatRoughnessNode = source.clearcoatRoughnessNode;
  29. this.clearcoatNormalNode = source.clearcoatNormalNode;
  30. this.sheenNode = source.sheenNode;
  31. this.sheenRoughnessNode = source.sheenRoughnessNode;
  32. this.iridescenceNode = source.iridescenceNode;
  33. this.iridescenceIORNode = source.iridescenceIORNode;
  34. this.iridescenceThicknessNode = source.iridescenceThicknessNode;
  35. this.specularIntensityNode = source.specularIntensityNode;
  36. this.specularColorNode = source.specularColorNode;
  37. this.transmissionNode = source.transmissionNode;
  38. this.thicknessNode = source.thicknessNode;
  39. this.attenuationDistanceNode = source.attenuationDistanceNode;
  40. this.attenuationColorNode = source.attenuationColorNode;
  41. return super.copy( source );
  42. }
  43. }
  44. export default MeshPhysicalNodeMaterial;
  45. addNodeMaterial( MeshPhysicalNodeMaterial );