|
@@ -31,8 +31,7 @@ import { WebGLBindingStates } from './webgl/WebGLBindingStates.js';
|
|
|
import { WebGLBufferRenderer } from './webgl/WebGLBufferRenderer.js';
|
|
import { WebGLBufferRenderer } from './webgl/WebGLBufferRenderer.js';
|
|
|
import { WebGLCapabilities } from './webgl/WebGLCapabilities.js';
|
|
import { WebGLCapabilities } from './webgl/WebGLCapabilities.js';
|
|
|
import { WebGLClipping } from './webgl/WebGLClipping.js';
|
|
import { WebGLClipping } from './webgl/WebGLClipping.js';
|
|
|
-import { WebGLCubeMaps } from './webgl/WebGLCubeMaps.js';
|
|
|
|
|
-import { WebGLCubeUVMaps } from './webgl/WebGLCubeUVMaps.js';
|
|
|
|
|
|
|
+import { WebGLEnvironments } from './webgl/WebGLEnvironments.js';
|
|
|
import { WebGLExtensions } from './webgl/WebGLExtensions.js';
|
|
import { WebGLExtensions } from './webgl/WebGLExtensions.js';
|
|
|
import { WebGLGeometries } from './webgl/WebGLGeometries.js';
|
|
import { WebGLGeometries } from './webgl/WebGLGeometries.js';
|
|
|
import { WebGLIndexedBufferRenderer } from './webgl/WebGLIndexedBufferRenderer.js';
|
|
import { WebGLIndexedBufferRenderer } from './webgl/WebGLIndexedBufferRenderer.js';
|
|
@@ -414,7 +413,7 @@ class WebGLRenderer {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let extensions, capabilities, state, info;
|
|
let extensions, capabilities, state, info;
|
|
|
- let properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects;
|
|
|
|
|
|
|
+ let properties, textures, environments, attributes, geometries, objects;
|
|
|
let programCache, materials, renderLists, renderStates, clipping, shadowMap;
|
|
let programCache, materials, renderLists, renderStates, clipping, shadowMap;
|
|
|
|
|
|
|
|
let background, morphtargets, bufferRenderer, indexedBufferRenderer;
|
|
let background, morphtargets, bufferRenderer, indexedBufferRenderer;
|
|
@@ -441,19 +440,18 @@ class WebGLRenderer {
|
|
|
info = new WebGLInfo( _gl );
|
|
info = new WebGLInfo( _gl );
|
|
|
properties = new WebGLProperties();
|
|
properties = new WebGLProperties();
|
|
|
textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info );
|
|
textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info );
|
|
|
- cubemaps = new WebGLCubeMaps( _this );
|
|
|
|
|
- cubeuvmaps = new WebGLCubeUVMaps( _this );
|
|
|
|
|
|
|
+ environments = new WebGLEnvironments( _this );
|
|
|
attributes = new WebGLAttributes( _gl );
|
|
attributes = new WebGLAttributes( _gl );
|
|
|
bindingStates = new WebGLBindingStates( _gl, attributes );
|
|
bindingStates = new WebGLBindingStates( _gl, attributes );
|
|
|
geometries = new WebGLGeometries( _gl, attributes, info, bindingStates );
|
|
geometries = new WebGLGeometries( _gl, attributes, info, bindingStates );
|
|
|
objects = new WebGLObjects( _gl, geometries, attributes, bindingStates, info );
|
|
objects = new WebGLObjects( _gl, geometries, attributes, bindingStates, info );
|
|
|
morphtargets = new WebGLMorphtargets( _gl, capabilities, textures );
|
|
morphtargets = new WebGLMorphtargets( _gl, capabilities, textures );
|
|
|
clipping = new WebGLClipping( properties );
|
|
clipping = new WebGLClipping( properties );
|
|
|
- programCache = new WebGLPrograms( _this, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping );
|
|
|
|
|
|
|
+ programCache = new WebGLPrograms( _this, environments, extensions, capabilities, bindingStates, clipping );
|
|
|
materials = new WebGLMaterials( _this, properties );
|
|
materials = new WebGLMaterials( _this, properties );
|
|
|
renderLists = new WebGLRenderLists();
|
|
renderLists = new WebGLRenderLists();
|
|
|
renderStates = new WebGLRenderStates( extensions );
|
|
renderStates = new WebGLRenderStates( extensions );
|
|
|
- background = new WebGLBackground( _this, cubemaps, cubeuvmaps, state, objects, _alpha, premultipliedAlpha );
|
|
|
|
|
|
|
+ background = new WebGLBackground( _this, environments, state, objects, _alpha, premultipliedAlpha );
|
|
|
shadowMap = new WebGLShadowMap( _this, objects, capabilities );
|
|
shadowMap = new WebGLShadowMap( _this, objects, capabilities );
|
|
|
uniformsGroups = new WebGLUniformsGroups( _gl, info, capabilities, state );
|
|
uniformsGroups = new WebGLUniformsGroups( _gl, info, capabilities, state );
|
|
|
|
|
|
|
@@ -1055,8 +1053,7 @@ class WebGLRenderer {
|
|
|
renderLists.dispose();
|
|
renderLists.dispose();
|
|
|
renderStates.dispose();
|
|
renderStates.dispose();
|
|
|
properties.dispose();
|
|
properties.dispose();
|
|
|
- cubemaps.dispose();
|
|
|
|
|
- cubeuvmaps.dispose();
|
|
|
|
|
|
|
+ environments.dispose();
|
|
|
objects.dispose();
|
|
objects.dispose();
|
|
|
bindingStates.dispose();
|
|
bindingStates.dispose();
|
|
|
uniformsGroups.dispose();
|
|
uniformsGroups.dispose();
|
|
@@ -2137,7 +2134,7 @@ class WebGLRenderer {
|
|
|
|
|
|
|
|
materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;
|
|
materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;
|
|
|
materialProperties.fog = scene.fog;
|
|
materialProperties.fog = scene.fog;
|
|
|
- materialProperties.envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || materialProperties.environment );
|
|
|
|
|
|
|
+ materialProperties.envMap = environments.get( material.envMap || materialProperties.environment, material.isMeshStandardMaterial );
|
|
|
materialProperties.envMapRotation = ( materialProperties.environment !== null && material.envMap === null ) ? scene.environmentRotation : material.envMapRotation;
|
|
materialProperties.envMapRotation = ( materialProperties.environment !== null && material.envMap === null ) ? scene.environmentRotation : material.envMapRotation;
|
|
|
|
|
|
|
|
if ( programs === undefined ) {
|
|
if ( programs === undefined ) {
|
|
@@ -2270,7 +2267,7 @@ class WebGLRenderer {
|
|
|
const fog = scene.fog;
|
|
const fog = scene.fog;
|
|
|
const environment = material.isMeshStandardMaterial ? scene.environment : null;
|
|
const environment = material.isMeshStandardMaterial ? scene.environment : null;
|
|
|
const colorSpace = ( _currentRenderTarget === null ) ? _this.outputColorSpace : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace );
|
|
const colorSpace = ( _currentRenderTarget === null ) ? _this.outputColorSpace : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace );
|
|
|
- const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );
|
|
|
|
|
|
|
+ const envMap = environments.get( material.envMap || environment, material.isMeshStandardMaterial );
|
|
|
const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;
|
|
const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;
|
|
|
const vertexTangents = !! geometry.attributes.tangent && ( !! material.normalMap || material.anisotropy > 0 );
|
|
const vertexTangents = !! geometry.attributes.tangent && ( !! material.normalMap || material.anisotropy > 0 );
|
|
|
const morphTargets = !! geometry.morphAttributes.position;
|
|
const morphTargets = !! geometry.morphAttributes.position;
|