Browse Source

Simplified ShadowMapPlugin.

Mr.doob 10 years ago
parent
commit
d32676ba7e

+ 0 - 11
docs/api/renderers/WebGLRenderer.html

@@ -88,11 +88,6 @@
 		<div>Default is false. If set, use shadow maps in the scene.</div>
 
 
-		<h3>[property:Boolean shadowMapAutoUpdate]</h3>
-
-		<div>Default is true. If set, autoupdate the shadowmaps every frame.</div>
-
-
 		<h3>[property:Integer shadowMapType]</h3>
 
 		<div>Defines shadow map type (unfiltered, percentage close filtering, percentage close filtering with bilinear filtering in shader)</div>
@@ -208,12 +203,6 @@
 		<div>Tells the renderer to clear its color, depth or stencil drawing buffer(s).</div>
 		<div>Arguments default to true.</div>
 
-		<h3>[method:todo updateShadowMap]( [page:Scene scene], [page:Camera camera] )</h3>
-		<div>scene — an instance of [page:Scene]<br />
-		camera — an instance of [page:Camera]</div>
-		<div>Tells the shadow map plugin to update using the passed scene and camera parameters.</div>
-
-
 		<h3>[method:todo renderBufferImmediate]( [page:Object3D object], [page:shaderprogram program], [page:Material shading] )</h3>
 		<div>object — an instance of [page:Object3D]]<br />
 		program — an instance of shaderProgram<br />

+ 0 - 9
docs/api/renderers/webgl/plugins/ShadowMapPlugin.html

@@ -22,15 +22,6 @@
 
 		<h2>Methods</h2>
 
-		<h3>[method:todo update]([page:Scene scene], [page:Camera camera])</h3>
-		<div>
-		scene -- The scene to render. <br />
-		camera -- The camera to render.
-		</div>
-		<div>
-		Updates the textures nessecary for the shadowmaps. This gets called by updateShadowMap in [page:WebGLRenderer].
-		</div>
-
 		<h3>[method:todo render]([page:Scene scene], [page:Camera camera])</h3>
 		<div>
 		scene -- The scene to render. <br />

+ 1 - 1
examples/webgl_animation_skinning_blending.html

@@ -6,7 +6,7 @@
 		<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
 		<style>
 			body {
-				color: #000;
+				color: #fff;
 				font-family:Monospace;
 				font-size:13px;
 				text-align:center;

+ 0 - 5
examples/webgl_shading_physical.html

@@ -352,7 +352,6 @@
 
 				//
 
-				renderer.shadowMapAutoUpdate = false;
 				renderer.shadowMapEnabled = true;
 				renderer.shadowMapType = THREE.PCFSoftShadowMap;
 
@@ -569,10 +568,6 @@
 
 				sunLight.shadowDarkness = shadowConfig.shadowDarkness * sunLight.intensity;
 
-				// render shadow map
-
-				renderer.updateShadowMap( scene, camera );
-
 				// render cube map
 
 				mesh.visible = false;

+ 11 - 28
src/renderers/WebGLRenderer.js

@@ -67,7 +67,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 	// shadow map
 
 	this.shadowMapEnabled = false;
-	this.shadowMapAutoUpdate = true;
 	this.shadowMapType = THREE.PCFShadowMap;
 	this.shadowMapCullFace = THREE.CullFaceFront;
 	this.shadowMapDebug = false;
@@ -560,26 +559,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	};
 
-	// Rendering
-
-	this.updateShadowMap = function ( scene, camera ) {
-
-		_currentProgram = null;
-		_oldBlending = - 1;
-		_oldDepthTest = - 1;
-		_oldDepthWrite = - 1;
-		_currentGeometryGroupHash = - 1;
-		_currentMaterialId = - 1;
-		_lightsNeedUpdate = true;
-		_oldDoubleSided = - 1;
-		_oldFlipSided = - 1;
-
-		shadowMapPlugin.update( scene, camera );
-
-	};
-
-	// Internal functions
-
 	// Buffer allocation
 
 	function createParticleBuffers ( geometry ) {
@@ -3486,12 +3465,6 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 		if ( object.visible === false ) return;
 
-		if ( object instanceof THREE.Light ) {
-
-			lights.push( object );
-
-		}
-
 		if ( object instanceof THREE.Scene || object instanceof THREE.Group ) {
 
 			// skip
@@ -3500,7 +3473,11 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 			initObject( object, scene );
 
-			if ( object instanceof THREE.Sprite ) {
+			if ( object instanceof THREE.Light ) {
+
+				lights.push( object );
+
+			} else if ( object instanceof THREE.Sprite ) {
 
 				sprites.push( object );
 
@@ -6463,4 +6440,10 @@ THREE.WebGLRenderer = function ( parameters ) {
 
 	};
 
+	this.updateShadowMap = function () {
+
+		console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' );
+
+	};
+
 };

+ 1 - 7
src/renderers/webgl/plugins/ShadowMapPlugin.js

@@ -58,13 +58,7 @@ THREE.ShadowMapPlugin = function ( _renderer, _lights, _webglObjects, _webglObje
 
 	this.render = function ( scene, camera ) {
 
-		if ( _renderer.shadowMapEnabled === false || _renderer.shadowMapAutoUpdate === false ) return;
-
-		this.update( scene, camera );
-
-	};
-
-	this.update = function ( scene, camera ) {
+		if ( _renderer.shadowMapEnabled === false ) return;
 
 		var i, il, j, jl, n,