MeshDepthMaterial.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import { Material } from './Material.js';
  2. import { BasicDepthPacking } from '../constants.js';
  3. /**
  4. * @author mrdoob / http://mrdoob.com/
  5. * @author alteredq / http://alteredqualia.com/
  6. * @author bhouston / https://clara.io
  7. * @author WestLangley / http://github.com/WestLangley
  8. *
  9. * parameters = {
  10. *
  11. * opacity: <float>,
  12. *
  13. * map: new THREE.Texture( <Image> ),
  14. *
  15. * alphaMap: new THREE.Texture( <Image> ),
  16. *
  17. * displacementMap: new THREE.Texture( <Image> ),
  18. * displacementScale: <float>,
  19. * displacementBias: <float>,
  20. *
  21. * wireframe: <boolean>,
  22. * wireframeLinewidth: <float>
  23. * }
  24. */
  25. function MeshDepthMaterial( parameters ) {
  26. Material.call( this );
  27. this.type = 'MeshDepthMaterial';
  28. this.depthPacking = BasicDepthPacking;
  29. this.skinning = false;
  30. this.morphTargets = false;
  31. this.map = null;
  32. this.alphaMap = null;
  33. this.displacementMap = null;
  34. this.displacementScale = 1;
  35. this.displacementBias = 0;
  36. this.wireframe = false;
  37. this.wireframeLinewidth = 1;
  38. this.fog = false;
  39. this.lights = false;
  40. this.setValues( parameters );
  41. }
  42. MeshDepthMaterial.prototype = Object.create( Material.prototype );
  43. MeshDepthMaterial.prototype.constructor = MeshDepthMaterial;
  44. MeshDepthMaterial.prototype.isMeshDepthMaterial = true;
  45. MeshDepthMaterial.prototype.copy = function ( source ) {
  46. Material.prototype.copy.call( this, source );
  47. this.depthPacking = source.depthPacking;
  48. this.skinning = source.skinning;
  49. this.morphTargets = source.morphTargets;
  50. this.map = source.map;
  51. this.alphaMap = source.alphaMap;
  52. this.displacementMap = source.displacementMap;
  53. this.displacementScale = source.displacementScale;
  54. this.displacementBias = source.displacementBias;
  55. this.wireframe = source.wireframe;
  56. this.wireframeLinewidth = source.wireframeLinewidth;
  57. return this;
  58. };
  59. export { MeshDepthMaterial };