MeshDepthMaterial.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import { Material } from './Material.js';
  2. import { BasicDepthPacking } from '../constants.js';
  3. /**
  4. * parameters = {
  5. *
  6. * opacity: <float>,
  7. *
  8. * map: new THREE.Texture( <Image> ),
  9. *
  10. * alphaMap: new THREE.Texture( <Image> ),
  11. *
  12. * displacementMap: new THREE.Texture( <Image> ),
  13. * displacementScale: <float>,
  14. * displacementBias: <float>,
  15. *
  16. * wireframe: <boolean>,
  17. * wireframeLinewidth: <float>
  18. * }
  19. */
  20. class MeshDepthMaterial extends Material {
  21. constructor( parameters ) {
  22. super();
  23. this.type = 'MeshDepthMaterial';
  24. this.depthPacking = BasicDepthPacking;
  25. this.skinning = false;
  26. this.morphTargets = false;
  27. this.map = null;
  28. this.alphaMap = null;
  29. this.displacementMap = null;
  30. this.displacementScale = 1;
  31. this.displacementBias = 0;
  32. this.wireframe = false;
  33. this.wireframeLinewidth = 1;
  34. this.fog = false;
  35. this.setValues( parameters );
  36. }
  37. copy( source ) {
  38. super.copy( source );
  39. this.depthPacking = source.depthPacking;
  40. this.skinning = source.skinning;
  41. this.morphTargets = source.morphTargets;
  42. this.map = source.map;
  43. this.alphaMap = source.alphaMap;
  44. this.displacementMap = source.displacementMap;
  45. this.displacementScale = source.displacementScale;
  46. this.displacementBias = source.displacementBias;
  47. this.wireframe = source.wireframe;
  48. this.wireframeLinewidth = source.wireframeLinewidth;
  49. return this;
  50. }
  51. }
  52. MeshDepthMaterial.prototype.isMeshDepthMaterial = true;
  53. export { MeshDepthMaterial };