diff --git a/docs/api/lights/DirectionalLight.html b/docs/api/lights/DirectionalLight.html index 44f1000f4a22ddbfb896aac8c41d0507a52de92a..320bb5aaceb8a81ce46c1b7236299d7434bdfafb 100644 --- a/docs/api/lights/DirectionalLight.html +++ b/docs/api/lights/DirectionalLight.html @@ -30,6 +30,9 @@ scene.add( directionalLight );

.[page:Object3D target]

+
+ Target used for shadow camera orientation. +

.[page:Float intensity]

@@ -56,26 +59,70 @@ scene.add( directionalLight );

.[page:Float shadowCameraNear]

+
+ Orthographic shadow camera frustum parameter.
+ Default — *50*. +

.[page:Float shadowCameraFar]

+
+ Orthographic shadow camera frustum parameter.
+ Default — *5000*. +

.[page:Float shadowCameraLeft]

+
+ Orthographic shadow camera frustum parameter.
+ Default — *-500*. +

.[page:Float shadowCameraRight]

+
+ Orthographic shadow camera frustum parameter.
+ Default — *500*. +

.[page:Float shadowCameraTop]

+
+ Orthographic shadow camera frustum parameter.
+ Default — *500*. +

.[page:Float shadowCameraBottom]

+
+ Orthographic shadow camera frustum parameter.
+ Default — *-500*. +

.[page:Boolean shadowCameraVisible]

+
+ Show debug shadow camera frustum.
+ Default — *false*. +

.[page:Float shadowBias]

+
+ Shadow map bias.
+ Default — *0*. +

.[page:Float shadowDarkness]

+
+ Darkness of shadow casted by this light (from *0* to *1*).
+ Default — *0.5*. +

.[page:Integer shadowMapWidth]

+
+ Shadow map texture width in pixels.
+ Default — *512*. +

.[page:Integer shadowMapHeight]

+
+ Shadow map texture height in pixels.
+ Default — *512*. +

.[page:Boolean shadowCascade]

diff --git a/docs/api/lights/DirectionalLight.rst b/docs/api/lights/DirectionalLight.rst deleted file mode 100644 index 1364642112e0e43041b81e35d2239fb377905b2a..0000000000000000000000000000000000000000 --- a/docs/api/lights/DirectionalLight.rst +++ /dev/null @@ -1,145 +0,0 @@ -DirectionalLight - A directional light --------------------------------------- - -.. ............................................................................... -.. rubric:: Constructor -.. ............................................................................... - -.. class:: DirectionalLight( hex, intensity, distance ) - - A directional light - - Part of scene graph - - Inherits from :class:`Light` :class:`Object3D` - - Affects :class:`MeshLambertMaterial` and :class:`MeshPhongMaterial` - - :param integer hex: light color - :param float intensity: light intensity - :param float distance: distance affected by light - - -.. ............................................................................... -.. rubric:: Attributes -.. ............................................................................... - -.. attribute:: DirectionalLight.color - - Light :class:`Color` - -.. attribute:: DirectionalLight.intensity - - Light intensity - - ``default 1.0`` - -.. attribute:: DirectionalLight.position - - Direction of the light is normalized vector from ``position`` to ``(0,0,0)``. - -.. attribute:: DirectionalLight.distance - - Modulating directional light by distance not implemented in :class:`WebGLRenderer` - - -.. ............................................................................... -.. rubric:: Shadow attributes -.. ............................................................................... - -.. attribute:: DirectionalLight.castShadow - - If set to `true` light will cast dynamic shadows - - Warning: this is expensive and requires tweaking to get shadows looking right. - - ``default false`` - -.. attribute:: DirectionalLight.onlyShadow - - If set to `true` light will only cast shadow but not contribute any lighting (as if intensity was 0 but cheaper to compute) - - ``default false`` - -.. attribute:: DirectionalLight.target - - :class:`Object3D` target used for shadow camera orientation - -.. attribute:: DirectionalLight.shadowCameraNear - - Orthographic shadow camera frustum parameter - - ``default 50`` - -.. attribute:: DirectionalLight.shadowCameraFar - - Orthographic shadow camera frustum parameter - - ``default 5000`` - -.. attribute:: DirectionalLight.shadowCameraLeft - - Orthographic shadow camera frustum parameter - - ``default -500`` - -.. attribute:: DirectionalLight.shadowCameraRight - - Orthographic shadow camera frustum parameter - - ``default 500`` - -.. attribute:: DirectionalLight.shadowCameraTop - - Orthographic shadow camera frustum parameter - - ``default 500`` - -.. attribute:: DirectionalLight.shadowCameraBottom - - Orthographic shadow camera frustum parameter - - ``default -500`` - -.. attribute:: DirectionalLight.shadowCameraVisible - - Show debug shadow camera frustum - - ``default false`` - -.. attribute:: DirectionalLight.shadowBias - - Shadow map bias - - ``default 0`` - -.. attribute:: DirectionalLight.shadowDarkness - - Darkness of shadow casted by this light (``float`` from 0 to 1) - - ``default 0.5`` - -.. attribute:: DirectionalLight.shadowMapWidth - - Shadow map texture width in pixels - - ``default 512`` - -.. attribute:: DirectionalLight.shadowMapHeight - - Shadow map texture height in pixels - - ``default 512`` - - -.. ............................................................................... -.. rubric:: Example -.. ............................................................................... - -:: - - // white directional light at half intensity shining from the top - - var directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 ); - directionalLight.position.set( 0, 1, 0 ); - scene.add( directionalLight ); diff --git a/docs/api/lights/SpotLight.html b/docs/api/lights/SpotLight.html index 63c265e4501cd6e38f3f6ae52b1b0ba5569c31b7..82b9cbf6cd4eeb9283e02a3de0d033c346d0dc62 100644 --- a/docs/api/lights/SpotLight.html +++ b/docs/api/lights/SpotLight.html @@ -5,6 +5,25 @@
todo
+

Example

+ +// white spotlight shining from the side, casting shadow + +var spotLight = new THREE.SpotLight( 0xffffff ); +spotLight.position.set( 100, 1000, 100 ); + +spotLight.castShadow = true; + +spotLight.shadowMapWidth = 1024; +spotLight.shadowMapHeight = 1024; + +spotLight.shadowCameraNear = 500; +spotLight.shadowCameraFar = 4000; +spotLight.shadowCameraFov = 30; + +scene.add( spotLight ); + +

Constructor

[name]()

@@ -15,14 +34,6 @@

.[page:Vector3 todo]

-

Methods

- -

.todo( [page:Vector3 todo] )

-
-todo — todo
-
- -

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] \ No newline at end of file diff --git a/src/lights/SpotLight.js b/src/lights/SpotLight.js index 7d2f6d4f67ca3ead6ad08bb78491e512028b17e7..0b6e0af8d5f0adfb3c85cbda6d0bae26185d1fc2 100644 --- a/src/lights/SpotLight.js +++ b/src/lights/SpotLight.js @@ -2,7 +2,7 @@ * @author alteredq / http://alteredqualia.com/ */ -THREE.SpotLight = function ( hex, intensity, distance, castShadow ) { +THREE.SpotLight = function ( hex, intensity, distance ) { THREE.Light.call( this, hex ); @@ -12,7 +12,7 @@ THREE.SpotLight = function ( hex, intensity, distance, castShadow ) { this.intensity = ( intensity !== undefined ) ? intensity : 1; this.distance = ( distance !== undefined ) ? distance : 0; - this.castShadow = ( castShadow !== undefined ) ? castShadow : false; + this.castShadow = false; this.onlyShadow = false; //