|
@@ -262,7 +262,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
let extensions, capabilities, state, info;
|
|
let extensions, capabilities, state, info;
|
|
let properties, textures, cubemaps, attributes, geometries, objects;
|
|
let properties, textures, cubemaps, attributes, geometries, objects;
|
|
- let programCache, materials, renderLists, renderStates, clipping;
|
|
|
|
|
|
+ let programCache, materials, renderLists, renderStates, clipping, shadowMap;
|
|
|
|
|
|
let background, morphtargets, bufferRenderer, indexedBufferRenderer;
|
|
let background, morphtargets, bufferRenderer, indexedBufferRenderer;
|
|
|
|
|
|
@@ -295,6 +295,7 @@ function WebGLRenderer( parameters ) {
|
|
renderLists = new WebGLRenderLists( properties );
|
|
renderLists = new WebGLRenderLists( properties );
|
|
renderStates = new WebGLRenderStates( extensions, capabilities );
|
|
renderStates = new WebGLRenderStates( extensions, capabilities );
|
|
background = new WebGLBackground( _this, cubemaps, state, objects, _premultipliedAlpha );
|
|
background = new WebGLBackground( _this, cubemaps, state, objects, _premultipliedAlpha );
|
|
|
|
+ shadowMap = new WebGLShadowMap( _this, objects, capabilities );
|
|
|
|
|
|
bufferRenderer = new WebGLBufferRenderer( _gl, extensions, info, capabilities );
|
|
bufferRenderer = new WebGLBufferRenderer( _gl, extensions, info, capabilities );
|
|
indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info, capabilities );
|
|
indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info, capabilities );
|
|
@@ -305,6 +306,7 @@ function WebGLRenderer( parameters ) {
|
|
_this.extensions = extensions;
|
|
_this.extensions = extensions;
|
|
_this.properties = properties;
|
|
_this.properties = properties;
|
|
_this.renderLists = renderLists;
|
|
_this.renderLists = renderLists;
|
|
|
|
+ _this.shadowMap = shadowMap;
|
|
_this.state = state;
|
|
_this.state = state;
|
|
_this.info = info;
|
|
_this.info = info;
|
|
|
|
|
|
@@ -318,12 +320,6 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
this.xr = xr;
|
|
this.xr = xr;
|
|
|
|
|
|
- // shadow map
|
|
|
|
-
|
|
|
|
- const shadowMap = new WebGLShadowMap( _this, objects, capabilities.maxTextureSize );
|
|
|
|
-
|
|
|
|
- this.shadowMap = shadowMap;
|
|
|
|
-
|
|
|
|
// API
|
|
// API
|
|
|
|
|
|
this.getContext = function () {
|
|
this.getContext = function () {
|
|
@@ -620,8 +616,20 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
_isContextLost = false;
|
|
_isContextLost = false;
|
|
|
|
|
|
|
|
+ const infoAutoReset = info.autoReset;
|
|
|
|
+ const shadowMapEnabled = shadowMap.enabled;
|
|
|
|
+ const shadowMapAutoUpdate = shadowMap.autoUpdate;
|
|
|
|
+ const shadowMapNeedsUpdate = shadowMap.needsUpdate;
|
|
|
|
+ const shadowMapType = shadowMap.type;
|
|
|
|
+
|
|
initGLContext();
|
|
initGLContext();
|
|
|
|
|
|
|
|
+ info.autoReset = infoAutoReset;
|
|
|
|
+ shadowMap.enabled = shadowMapEnabled;
|
|
|
|
+ shadowMap.autoUpdate = shadowMapAutoUpdate;
|
|
|
|
+ shadowMap.needsUpdate = shadowMapNeedsUpdate;
|
|
|
|
+ shadowMap.type = shadowMapType;
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
function onMaterialDispose( event ) {
|
|
function onMaterialDispose( event ) {
|