diff --git a/docs/api/materials/ShadowMaterial.html b/docs/api/materials/ShadowMaterial.html index 5bd2c9c14ef73a33b7a8eed86a49171b9dd23b3b..0c78945182e952d87939e11eef3224fe0ba66094 100644 --- a/docs/api/materials/ShadowMaterial.html +++ b/docs/api/materials/ShadowMaterial.html @@ -13,11 +13,11 @@

[name]

- This material can recieve shadows, but otherwise is completely transparent. + This material can receive shadows, but otherwise is completely transparent.

Example

- [example:webgl_geometry_spline_editor gemoetry / spline / editor] + [example:webgl_geometry_spline_editor geometry / spline / editor] var planeGeometry = new THREE.PlaneGeometry( 2000, 2000 ); @@ -34,7 +34,11 @@ scene.add( plane );

Constructor

-

[name]( )

+

[name]( [page:Object parameters] )

+
+ [page:Object parameters] - (optional) an object with one or more properties defining the material's appearance. + Any property of the material (including any property inherited from [page:Material] and [page:ShaderMaterial]) can be passed in here.

+

Properties

diff --git a/examples/webgl_geometry_spline_editor.html b/examples/webgl_geometry_spline_editor.html index cdaf5e7ccfa6d34923ae8deb9e016c1fe6b8888a..94951a1d8588e5305bfe97bcfa14b4d80a7dbe0d 100644 --- a/examples/webgl_geometry_spline_editor.html +++ b/examples/webgl_geometry_spline_editor.html @@ -98,12 +98,9 @@ scene.add( light ); spotlight = light; - // scene.add( new THREE.CameraHelper( light.shadow.camera ) ); - var planeGeometry = new THREE.PlaneGeometry( 2000, 2000 ); planeGeometry.rotateX( - Math.PI / 2 ); - var planeMaterial = new THREE.ShadowMaterial(); - planeMaterial.opacity = 0.2; + var planeMaterial = new THREE.ShadowMaterial( { opacity: 0.2 } ); var plane = new THREE.Mesh( planeGeometry, planeMaterial ); plane.position.y = -200; diff --git a/src/materials/ShadowMaterial.js b/src/materials/ShadowMaterial.js index a376344bb2e44c3601b68e19414466d68a2bb981..8a2c5c07c75d52e2b5f15b5e00b685fff0b6667a 100644 --- a/src/materials/ShadowMaterial.js +++ b/src/materials/ShadowMaterial.js @@ -5,9 +5,13 @@ import { UniformsUtils } from '../renderers/shaders/UniformsUtils'; /** * @author mrdoob / http://mrdoob.com/ + * + * parameters = { + * opacity: + * } */ -function ShadowMaterial() { +function ShadowMaterial( parameters ) { ShaderMaterial.call( this, { uniforms: UniformsUtils.merge( [ @@ -35,6 +39,8 @@ function ShadowMaterial() { } } ); + this.setValues( parameters ); + } ShadowMaterial.prototype = Object.create( ShaderMaterial.prototype );