Selaa lähdekoodia

updated TS and docs for shadows

Emmett Lalish 5 vuotta sitten
vanhempi
commit
668ad9d225

+ 5 - 5
docs/api/en/lights/shadows/LightShadow.html

@@ -73,7 +73,9 @@
 			Setting this to values greater than 1 will blur the edges of the shadow.<br />
 
 			High values will cause unwanted banding effects in the shadows - a greater [page:.mapSize mapSize]
-			will allow for a higher value to be used here before these effects become visible.<br /><br />
+			will allow for a higher value to be used here before these effects become visible.<br />
+			If [page:WebGLRenderer.shadowMap.type] is set to [page:Renderer PCFSoftShadowMap], it is recommended to
+			leave radius at 1 and increase softness by decreasing [page:.mapSize mapSize] instead.<br /><br />
 
 			Note that this has no effect if the [page:WebGLRenderer.shadowMap.type] is set to [page:Renderer BasicShadowMap].
 		</p>
@@ -86,13 +88,11 @@
 		Used internally by the renderer to extend the shadow map to contain all viewports
 		</p>
 
-		<h3>[method:null updateMatrices]( [param:Light light], [param:Camera viewCamera], [param:number viewportIndex])</h3>
+		<h3>[method:null updateMatrices]( [param:Light light] )</h3>
 		<p>
 		Update the matrices for the camera and shadow, used internally by the renderer.<br /><br />
 
-		light -- the light for which the shadow is being rendered.<br />
-		viewCamera -- the camera view for which the shadow is being rendered.<br />
-		viewportIndex -- calculates the matrix for this viewport
+		light -- the light for which the shadow is being rendered.
 		</p>
 
 		<h3>[method:Frustum getFrustum]()</h3>

+ 9 - 0
docs/api/en/lights/shadows/PointLightShadow.html

@@ -70,6 +70,15 @@ scene.add( helper );
 		</p>
 
 		<h2>Methods</h2>
+		
+		<h3>[method:null updateMatrices]( [param:Light light], [param:number viewportIndex])</h3>
+		<p>
+		Update the matrices for the camera and shadow, used internally by the renderer.<br /><br />
+
+		light -- the light for which the shadow is being rendered.<br />
+		viewportIndex -- calculates the matrix for this viewport
+		</p>
+
 		<p>
 			See the base [page:LightShadow LightShadow] class for common methods.
 		</p>

+ 2 - 4
docs/api/zh/lights/shadows/LightShadow.html

@@ -83,13 +83,11 @@
 		Used internally by the renderer to extend the shadow map to contain all viewports
 		</p>
 
-		<h3>[method:null updateMatrices]( [param:Light light], [param:Camera viewCamera], [param:number viewportIndex])</h3>
+		<h3>[method:null updateMatrices]( [param:Light light] )</h3>
 		<p>
 		Update the matrices for the camera and shadow, used internally by the renderer.<br /><br />
 
-		light -- the light for which the shadow is being rendered.<br />
-		viewCamera -- the camera view for which the shadow is being rendered.<br />
-		viewportIndex -- calculates the matrix for this viewport
+		light -- the light for which the shadow is being rendered.
 		</p>
 
 		<h3>[method:Frustum getFrustum]()</h3>

+ 9 - 0
docs/api/zh/lights/shadows/PointLightShadow.html

@@ -69,6 +69,15 @@ scene.add( helper );
 		</p>
 
 		<h2>方法</h2>
+
+		<h3>[method:null updateMatrices]( [param:Light light], [param:number viewportIndex])</h3>
+		<p>
+		Update the matrices for the camera and shadow, used internally by the renderer.<br /><br />
+
+		light -- the light for which the shadow is being rendered.<br />
+		viewportIndex -- calculates the matrix for this viewport
+		</p>
+		
 		<p>
 			共有方法请参见其基类[page:LightShadow LightShadow]。
 		</p>

+ 2 - 2
src/lights/DirectionalLightShadow.js

@@ -17,9 +17,9 @@ DirectionalLightShadow.prototype = Object.assign( Object.create( LightShadow.pro
 
 	isDirectionalLightShadow: true,
 
-	updateMatrices: function ( light, viewCamera, viewportIndex ) {
+	updateMatrices: function ( light ) {
 
-		LightShadow.prototype.updateMatrices.call( this, light, viewCamera, viewportIndex );
+		LightShadow.prototype.updateMatrices.call( this, light );
 
 	}
 

+ 1 - 1
src/lights/LightShadow.d.ts

@@ -21,7 +21,7 @@ export class LightShadow {
 	clone( recursive?: boolean ): this;
 	toJSON(): any;
 	getFrustum(): number;
-	updateMatrices( light: Light, viewCamera: Camera, viewportIndex: number ): void;
+	updateMatrices( light: Light ): void;
 	getViewport( viewportIndex: number ): Vector4;
 	getFrameExtents(): Vector2;
 

+ 2 - 0
src/lights/PointLightShadow.d.ts

@@ -5,4 +5,6 @@ export class PointLightShadow extends LightShadow {
 
 	camera: PerspectiveCamera;
 
+	updateMatrices( light: Light, viewportIndex: number ): void;
+
 }

+ 1 - 1
src/lights/PointLightShadow.js

@@ -58,7 +58,7 @@ PointLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype
 
 	isPointLightShadow: true,
 
-	updateMatrices: function ( light, viewCamera, viewportIndex ) {
+	updateMatrices: function ( light, viewportIndex ) {
 
 		var camera = this.camera,
 			shadowMatrix = this.matrix,

+ 2 - 2
src/lights/SpotLightShadow.js

@@ -18,7 +18,7 @@ SpotLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype
 
 	isSpotLightShadow: true,
 
-	updateMatrices: function ( light, viewCamera, viewportIndex ) {
+	updateMatrices: function ( light ) {
 
 		var camera = this.camera;
 
@@ -35,7 +35,7 @@ SpotLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype
 
 		}
 
-		LightShadow.prototype.updateMatrices.call( this, light, viewCamera, viewportIndex );
+		LightShadow.prototype.updateMatrices.call( this, light );
 
 	}
 

+ 1 - 1
src/renderers/webgl/WebGLShadowMap.js

@@ -181,7 +181,7 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
 
 				_state.viewport( _viewport );
 
-				shadow.updateMatrices( light, camera, vp );
+				shadow.updateMatrices( light, vp );
 
 				_frustum = shadow.getFrustum();