UNPKG

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