|
@@ -29,6 +29,7 @@ import { Frustum } from '../math/Frustum.js';
|
|
|
import { Vector4 } from '../math/Vector4.js';
|
|
|
import { WebGLUtils } from './webgl/WebGLUtils.js';
|
|
|
import { WebGLRenderStates } from './webgl/WebGLRenderStates.js';
|
|
|
+import { WebGLInfo } from './webgl/WebGLInfo.js';
|
|
|
|
|
|
/**
|
|
|
* @author supereggbert / http://www.paulbrunt.co.uk/
|
|
@@ -149,44 +150,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
_projScreenMatrix = new Matrix4(),
|
|
|
|
|
|
- _vector3 = new Vector3(),
|
|
|
-
|
|
|
- // info
|
|
|
-
|
|
|
- _infoMemory = {
|
|
|
- geometries: 0,
|
|
|
- textures: 0
|
|
|
- },
|
|
|
-
|
|
|
- _infoRender = {
|
|
|
-
|
|
|
- frame: 0,
|
|
|
- calls: 0,
|
|
|
- vertices: 0,
|
|
|
- faces: 0,
|
|
|
- points: 0
|
|
|
-
|
|
|
- };
|
|
|
-
|
|
|
- this.info = {
|
|
|
-
|
|
|
- render: _infoRender,
|
|
|
- memory: _infoMemory,
|
|
|
- programs: null,
|
|
|
- autoReset: true,
|
|
|
- reset: resetInfo
|
|
|
-
|
|
|
- };
|
|
|
-
|
|
|
- function resetInfo() {
|
|
|
-
|
|
|
- _infoRender.frame ++;
|
|
|
- _infoRender.calls = 0;
|
|
|
- _infoRender.vertices = 0;
|
|
|
- _infoRender.faces = 0;
|
|
|
- _infoRender.points = 0;
|
|
|
-
|
|
|
- }
|
|
|
+ _vector3 = new Vector3();
|
|
|
|
|
|
function getTargetPixelRatio() {
|
|
|
|
|
@@ -249,7 +213,7 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- var extensions, capabilities, state;
|
|
|
+ var extensions, capabilities, state, info;
|
|
|
var properties, textures, attributes, geometries, objects;
|
|
|
var programCache, renderLists, renderStates;
|
|
|
|
|
@@ -278,11 +242,12 @@ function WebGLRenderer( parameters ) {
|
|
|
state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ) );
|
|
|
state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ) );
|
|
|
|
|
|
+ info = new WebGLInfo( _gl );
|
|
|
properties = new WebGLProperties();
|
|
|
- textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, _infoMemory, _infoRender );
|
|
|
+ textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info );
|
|
|
attributes = new WebGLAttributes( _gl );
|
|
|
- geometries = new WebGLGeometries( _gl, attributes, _infoMemory );
|
|
|
- objects = new WebGLObjects( geometries, _infoRender );
|
|
|
+ geometries = new WebGLGeometries( _gl, attributes, info );
|
|
|
+ objects = new WebGLObjects( geometries, info );
|
|
|
morphtargets = new WebGLMorphtargets( _gl );
|
|
|
programCache = new WebGLPrograms( _this, extensions, capabilities );
|
|
|
renderLists = new WebGLRenderLists();
|
|
@@ -290,12 +255,12 @@ function WebGLRenderer( parameters ) {
|
|
|
|
|
|
background = new WebGLBackground( _this, state, geometries, _premultipliedAlpha );
|
|
|
|
|
|
- bufferRenderer = new WebGLBufferRenderer( _gl, extensions, _infoRender );
|
|
|
- indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, _infoRender );
|
|
|
+ bufferRenderer = new WebGLBufferRenderer( _gl, extensions, info );
|
|
|
+ indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info );
|
|
|
|
|
|
spriteRenderer = new WebGLSpriteRenderer( _this, _gl, state, textures, capabilities );
|
|
|
|
|
|
- _this.info.programs = programCache.programs;
|
|
|
+ info.programs = programCache.programs;
|
|
|
|
|
|
_this.context = _gl;
|
|
|
_this.capabilities = capabilities;
|
|
@@ -303,6 +268,7 @@ function WebGLRenderer( parameters ) {
|
|
|
_this.properties = properties;
|
|
|
_this.renderLists = renderLists;
|
|
|
_this.state = state;
|
|
|
+ _this.info = info;
|
|
|
|
|
|
}
|
|
|
|