MeshDepthMaterial.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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.map = null;
  26. this.alphaMap = null;
  27. this.displacementMap = null;
  28. this.displacementScale = 1;
  29. this.displacementBias = 0;
  30. this.wireframe = false;
  31. this.wireframeLinewidth = 1;
  32. this.fog = false;
  33. this.setValues( parameters );
  34. }
  35. copy( source ) {
  36. super.copy( source );
  37. this.depthPacking = source.depthPacking;
  38. this.map = source.map;
  39. this.alphaMap = source.alphaMap;
  40. this.displacementMap = source.displacementMap;
  41. this.displacementScale = source.displacementScale;
  42. this.displacementBias = source.displacementBias;
  43. this.wireframe = source.wireframe;
  44. this.wireframeLinewidth = source.wireframeLinewidth;
  45. return this;
  46. }
  47. }
  48. MeshDepthMaterial.prototype.isMeshDepthMaterial = true;
  49. export { MeshDepthMaterial };
粤ICP备19079148号