In different situations shadowmaps can be used for static objects that do not move often :
- a procedural city (big shadow maps),
- objects that move only when dragged….
In those situations we need shadowmap rendering, but not each frame. For example, once a part of a procedural city has been created, the buildings don’t move but the shadow rendering still uses a lot of computational power.
Here is the suggestion of a
shadowMapNeedsUpdate = true parameter to the WebGLRenderer the way
Its value is checked in the ShadowMapPlugin and set to false just after :
if( _renderer.shadowMapEnabled === false || _renderer.shadowMapNeedsUpdate === false ) return; _renderer.shadowMapNeedsUpdate = false;
This way the shadowmap is rendered once at the first render call, and if the scene requires the realtime shadowmap it has to be precised in the render loop. Otherwise it has to be precised in the functions that move/create/delete objects.