Skip to content

Commit d32676b

Browse files
committed
Simplified ShadowMapPlugin.
1 parent e1f89d1 commit d32676b

6 files changed

Lines changed: 13 additions & 61 deletions

File tree

docs/api/renderers/WebGLRenderer.html

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,6 @@ <h3>[property:Boolean shadowMapEnabled]</h3>
8888
<div>Default is false. If set, use shadow maps in the scene.</div>
8989

9090

91-
<h3>[property:Boolean shadowMapAutoUpdate]</h3>
92-
93-
<div>Default is true. If set, autoupdate the shadowmaps every frame.</div>
94-
95-
9691
<h3>[property:Integer shadowMapType]</h3>
9792

9893
<div>Defines shadow map type (unfiltered, percentage close filtering, percentage close filtering with bilinear filtering in shader)</div>
@@ -208,12 +203,6 @@ <h3>[method:todo clear]( [page:Boolean color], [page:Boolean depth], [page:Boole
208203
<div>Tells the renderer to clear its color, depth or stencil drawing buffer(s).</div>
209204
<div>Arguments default to true.</div>
210205

211-
<h3>[method:todo updateShadowMap]( [page:Scene scene], [page:Camera camera] )</h3>
212-
<div>scene — an instance of [page:Scene]<br />
213-
camera — an instance of [page:Camera]</div>
214-
<div>Tells the shadow map plugin to update using the passed scene and camera parameters.</div>
215-
216-
217206
<h3>[method:todo renderBufferImmediate]( [page:Object3D object], [page:shaderprogram program], [page:Material shading] )</h3>
218207
<div>object — an instance of [page:Object3D]]<br />
219208
program — an instance of shaderProgram<br />

docs/api/renderers/webgl/plugins/ShadowMapPlugin.html

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ <h3>[name]()</h3>
2222

2323
<h2>Methods</h2>
2424

25-
<h3>[method:todo update]([page:Scene scene], [page:Camera camera])</h3>
26-
<div>
27-
scene -- The scene to render. <br />
28-
camera -- The camera to render.
29-
</div>
30-
<div>
31-
Updates the textures nessecary for the shadowmaps. This gets called by updateShadowMap in [page:WebGLRenderer].
32-
</div>
33-
3425
<h3>[method:todo render]([page:Scene scene], [page:Camera camera])</h3>
3526
<div>
3627
scene -- The scene to render. <br />

examples/webgl_animation_skinning_blending.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
77
<style>
88
body {
9-
color: #000;
9+
color: #fff;
1010
font-family:Monospace;
1111
font-size:13px;
1212
text-align:center;

examples/webgl_shading_physical.html

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,6 @@
352352

353353
//
354354

355-
renderer.shadowMapAutoUpdate = false;
356355
renderer.shadowMapEnabled = true;
357356
renderer.shadowMapType = THREE.PCFSoftShadowMap;
358357

@@ -569,10 +568,6 @@
569568

570569
sunLight.shadowDarkness = shadowConfig.shadowDarkness * sunLight.intensity;
571570

572-
// render shadow map
573-
574-
renderer.updateShadowMap( scene, camera );
575-
576571
// render cube map
577572

578573
mesh.visible = false;

src/renderers/WebGLRenderer.js

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ THREE.WebGLRenderer = function ( parameters ) {
6767
// shadow map
6868

6969
this.shadowMapEnabled = false;
70-
this.shadowMapAutoUpdate = true;
7170
this.shadowMapType = THREE.PCFShadowMap;
7271
this.shadowMapCullFace = THREE.CullFaceFront;
7372
this.shadowMapDebug = false;
@@ -560,26 +559,6 @@ THREE.WebGLRenderer = function ( parameters ) {
560559

561560
};
562561

563-
// Rendering
564-
565-
this.updateShadowMap = function ( scene, camera ) {
566-
567-
_currentProgram = null;
568-
_oldBlending = - 1;
569-
_oldDepthTest = - 1;
570-
_oldDepthWrite = - 1;
571-
_currentGeometryGroupHash = - 1;
572-
_currentMaterialId = - 1;
573-
_lightsNeedUpdate = true;
574-
_oldDoubleSided = - 1;
575-
_oldFlipSided = - 1;
576-
577-
shadowMapPlugin.update( scene, camera );
578-
579-
};
580-
581-
// Internal functions
582-
583562
// Buffer allocation
584563

585564
function createParticleBuffers ( geometry ) {
@@ -3486,12 +3465,6 @@ THREE.WebGLRenderer = function ( parameters ) {
34863465

34873466
if ( object.visible === false ) return;
34883467

3489-
if ( object instanceof THREE.Light ) {
3490-
3491-
lights.push( object );
3492-
3493-
}
3494-
34953468
if ( object instanceof THREE.Scene || object instanceof THREE.Group ) {
34963469

34973470
// skip
@@ -3500,7 +3473,11 @@ THREE.WebGLRenderer = function ( parameters ) {
35003473

35013474
initObject( object, scene );
35023475

3503-
if ( object instanceof THREE.Sprite ) {
3476+
if ( object instanceof THREE.Light ) {
3477+
3478+
lights.push( object );
3479+
3480+
} else if ( object instanceof THREE.Sprite ) {
35043481

35053482
sprites.push( object );
35063483

@@ -6463,4 +6440,10 @@ THREE.WebGLRenderer = function ( parameters ) {
64636440

64646441
};
64656442

6443+
this.updateShadowMap = function () {
6444+
6445+
console.warn( 'THREE.WebGLRenderer: .updateShadowMap() has been removed.' );
6446+
6447+
};
6448+
64666449
};

src/renderers/webgl/plugins/ShadowMapPlugin.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,7 @@ THREE.ShadowMapPlugin = function ( _renderer, _lights, _webglObjects, _webglObje
5858

5959
this.render = function ( scene, camera ) {
6060

61-
if ( _renderer.shadowMapEnabled === false || _renderer.shadowMapAutoUpdate === false ) return;
62-
63-
this.update( scene, camera );
64-
65-
};
66-
67-
this.update = function ( scene, camera ) {
61+
if ( _renderer.shadowMapEnabled === false ) return;
6862

6963
var i, il, j, jl, n,
7064

0 commit comments

Comments
 (0)