|
@@ -18,9 +18,7 @@ import { Frustum } from '../../math/Frustum';
|
|
|
|
|
|
function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
|
|
function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
|
|
|
|
|
|
- var _gl = _renderer.context,
|
|
|
|
- _state = _renderer.state,
|
|
|
|
- _frustum = new Frustum(),
|
|
|
|
|
|
+ var _frustum = new Frustum(),
|
|
_projScreenMatrix = new Matrix4(),
|
|
_projScreenMatrix = new Matrix4(),
|
|
|
|
|
|
_shadowMapSize = new Vector2(),
|
|
_shadowMapSize = new Vector2(),
|
|
@@ -106,6 +104,10 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
|
|
|
|
|
|
if ( lights.length === 0 ) return;
|
|
if ( lights.length === 0 ) return;
|
|
|
|
|
|
|
|
+ // TODO Clean up (needed in case of contextlost)
|
|
|
|
+ var _gl = _renderer.context;
|
|
|
|
+ var _state = _renderer.state;
|
|
|
|
+
|
|
// Set GL state for depth map.
|
|
// Set GL state for depth map.
|
|
_state.disable( _gl.BLEND );
|
|
_state.disable( _gl.BLEND );
|
|
_state.buffers.color.setClear( 1, 1, 1, 1 );
|
|
_state.buffers.color.setClear( 1, 1, 1, 1 );
|