MeshDepthMaterial.js 1.6 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. function MeshDepthMaterial( parameters ) {
  21. Material.call( this );
  22. this.type = 'MeshDepthMaterial';
  23. this.depthPacking = BasicDepthPacking;
  24. this.skinning = false;
  25. this.morphTargets = false;
  26. this.map = null;
  27. this.alphaMap = null;
  28. this.displacementMap = null;
  29. this.displacementScale = 1;
  30. this.displacementBias = 0;
  31. this.wireframe = false;
  32. this.wireframeLinewidth = 1;
  33. this.fog = false;
  34. this.setValues( parameters );
  35. }
  36. MeshDepthMaterial.prototype = Object.create( Material.prototype );
  37. MeshDepthMaterial.prototype.constructor = MeshDepthMaterial;
  38. MeshDepthMaterial.prototype.isMeshDepthMaterial = true;
  39. MeshDepthMaterial.prototype.copy = function ( source ) {
  40. Material.prototype.copy.call( this, source );
  41. this.depthPacking = source.depthPacking;
  42. this.skinning = source.skinning;
  43. this.morphTargets = source.morphTargets;
  44. this.map = source.map;
  45. this.alphaMap = source.alphaMap;
  46. this.displacementMap = source.displacementMap;
  47. this.displacementScale = source.displacementScale;
  48. this.displacementBias = source.displacementBias;
  49. this.wireframe = source.wireframe;
  50. this.wireframeLinewidth = source.wireframeLinewidth;
  51. return this;
  52. };
  53. export { MeshDepthMaterial };
粤ICP备19079148号