MeshPhysicalNodeMaterial.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.specularIntensityNode = null;
  17. this.specularColorNode = null;
  18. this.transmissionNode = null;
  19. this.thicknessNode = null;
  20. this.attenuationDistanceNode = null;
  21. this.attenuationColorNode = null;
  22. this.sheen = 0;
  23. this.clearcoat = 0;
  24. this.iridescence = 0;
  25. this.transmission = 0;
  26. this.setDefaultValues( defaultValues );
  27. this.setValues( parameters );
  28. }
  29. copy( source ) {
  30. this.clearcoatNode = source.clearcoatNode;
  31. this.clearcoatRoughnessNode = source.clearcoatRoughnessNode;
  32. this.clearcoatNormalNode = source.clearcoatNormalNode;
  33. this.sheenNode = source.sheenNode;
  34. this.sheenRoughnessNode = source.sheenRoughnessNode;
  35. this.iridescenceNode = source.iridescenceNode;
  36. this.iridescenceIORNode = source.iridescenceIORNode;
  37. this.iridescenceThicknessNode = source.iridescenceThicknessNode;
  38. this.specularIntensityNode = source.specularIntensityNode;
  39. this.specularColorNode = source.specularColorNode;
  40. this.transmissionNode = source.transmissionNode;
  41. this.thicknessNode = source.thicknessNode;
  42. this.attenuationDistanceNode = source.attenuationDistanceNode;
  43. this.attenuationColorNode = source.attenuationColorNode;
  44. return super.copy( source );
  45. }
  46. }