three
Version:
JavaScript 3D library
79 lines (51 loc) • 1.42 kB
JavaScript
import { Material } from './Material.js';
import { BasicDepthPacking } from '../constants.js';
/**
* parameters = {
*
* opacity: <float>,
*
* map: new THREE.Texture( <Image> ),
*
* alphaMap: new THREE.Texture( <Image> ),
*
* displacementMap: new THREE.Texture( <Image> ),
* displacementScale: <float>,
* displacementBias: <float>,
*
* wireframe: <boolean>,
* wireframeLinewidth: <float>
* }
*/
class MeshDepthMaterial extends Material {
constructor( parameters ) {
super();
this.type = 'MeshDepthMaterial';
this.depthPacking = BasicDepthPacking;
this.morphTargets = false;
this.map = null;
this.alphaMap = null;
this.displacementMap = null;
this.displacementScale = 1;
this.displacementBias = 0;
this.wireframe = false;
this.wireframeLinewidth = 1;
this.fog = false;
this.setValues( parameters );
}
copy( source ) {
super.copy( source );
this.depthPacking = source.depthPacking;
this.morphTargets = source.morphTargets;
this.map = source.map;
this.alphaMap = source.alphaMap;
this.displacementMap = source.displacementMap;
this.displacementScale = source.displacementScale;
this.displacementBias = source.displacementBias;
this.wireframe = source.wireframe;
this.wireframeLinewidth = source.wireframeLinewidth;
return this;
}
}
MeshDepthMaterial.prototype.isMeshDepthMaterial = true;
export { MeshDepthMaterial };