|
@@ -1,8 +1,3 @@
|
|
|
-import { ShaderMaterial } from './ShaderMaterial';
|
|
|
-import { ShaderChunk } from '../renderers/shaders/ShaderChunk';
|
|
|
-import { UniformsLib } from '../renderers/shaders/UniformsLib';
|
|
|
-import { UniformsUtils } from '../renderers/shaders/UniformsUtils';
|
|
|
-
|
|
|
/**
|
|
|
* @author mrdoob / http://mrdoob.com/
|
|
|
*
|
|
@@ -12,49 +7,26 @@ import { UniformsUtils } from '../renderers/shaders/UniformsUtils';
|
|
|
* }
|
|
|
*/
|
|
|
|
|
|
+import { Material } from './Material';
|
|
|
+import { Color } from '../math/Color';
|
|
|
+
|
|
|
function ShadowMaterial( parameters ) {
|
|
|
|
|
|
- ShaderMaterial.call( this, {
|
|
|
- uniforms: UniformsUtils.merge( [
|
|
|
- UniformsLib.lights,
|
|
|
- {
|
|
|
- color: { value: new THREE.Color( 0, 0, 0 ) },
|
|
|
- opacity: { value: 1.0 }
|
|
|
- }
|
|
|
- ] ),
|
|
|
- vertexShader: ShaderChunk[ 'shadow_vert' ],
|
|
|
- fragmentShader: ShaderChunk[ 'shadow_frag' ]
|
|
|
- } );
|
|
|
+ Material.call( this );
|
|
|
+
|
|
|
+ this.type = 'ShadowMaterial';
|
|
|
+
|
|
|
+ this.color = new Color( 0x000000 );
|
|
|
+ this.opacity = 1.0;
|
|
|
|
|
|
this.lights = true;
|
|
|
this.transparent = true;
|
|
|
|
|
|
- Object.defineProperties( this, {
|
|
|
- color: {
|
|
|
- enumerable: true,
|
|
|
- get: function () {
|
|
|
- return this.uniforms.color.value;
|
|
|
- },
|
|
|
- set: function ( value ) {
|
|
|
- this.uniforms.color.value = value;
|
|
|
- }
|
|
|
- },
|
|
|
- opacity: {
|
|
|
- enumerable: true,
|
|
|
- get: function () {
|
|
|
- return this.uniforms.opacity.value;
|
|
|
- },
|
|
|
- set: function ( value ) {
|
|
|
- this.uniforms.opacity.value = value;
|
|
|
- }
|
|
|
- }
|
|
|
- } );
|
|
|
-
|
|
|
this.setValues( parameters );
|
|
|
|
|
|
}
|
|
|
|
|
|
-ShadowMaterial.prototype = Object.create( ShaderMaterial.prototype );
|
|
|
+ShadowMaterial.prototype = Object.create( Material.prototype );
|
|
|
ShadowMaterial.prototype.constructor = ShadowMaterial;
|
|
|
|
|
|
ShadowMaterial.prototype.isShadowMaterial = true;
|