Skip to content
Browse files

some small improvements to get webglrenderer faster

  • Loading branch information...
1 parent dd0ad34 commit 32ee545296a06d609f4bd9c539dd30d50780d607 @gero3 committed Apr 11, 2012
View
18 build/Three.js
@@ -14563,7 +14563,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( p_uniforms.objectMatrix !== null ) {
- _gl.uniformMatrix4fv( p_uniforms.objectMatrix, false, object._objectMatrixArray );
+ _gl.uniformMatrix4fv( p_uniforms.objectMatrix, false, object.matrixWorld.elements );
}
@@ -14751,7 +14751,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function loadUniformsMatrices ( uniforms, object ) {
- _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object._modelViewMatrixArray );
+ _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object._modelViewMatrix.elements );
if ( uniforms.normalMatrix ) {
@@ -14981,7 +14981,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function setupMatrices ( object, camera ) {
- object._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( camera.matrixWorldInverse, object.matrixWorld);
object._normalMatrix.getInverse( object._modelViewMatrix );
object._normalMatrix.transposeIntoArray( object._normalMatrixArray );
@@ -35054,7 +35054,7 @@ THREE.ShadowMapPlugin = function ( ) {
if ( ! ( object instanceof THREE.Mesh ) || ! ( object.frustumCulled ) || _frustum.contains( object ) ) {
object.matrixWorld.flattenToArray( object._objectMatrixArray );
- object._modelViewMatrix.multiplyToArray( shadowCamera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( shadowCamera.matrixWorldInverse, object.matrixWorld);
webglObject.render = true;
@@ -35122,7 +35122,7 @@ THREE.ShadowMapPlugin = function ( ) {
}
- object._modelViewMatrix.multiplyToArray( shadowCamera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( shadowCamera.matrixWorldInverse, object.matrixWorld);
_renderer.renderImmediateObject( shadowCamera, scene.__lights, fog, _depthMaterial, object );
@@ -35408,7 +35408,7 @@ THREE.SpritePlugin = function ( ) {
if( ! sprite.useScreenCoordinates ) {
- sprite._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, sprite.matrixWorld, sprite._modelViewMatrixArray );
+ sprite._modelViewMatrix.multiply( camera.matrixWorldInverse, sprite.matrixWorld);
sprite.z = - sprite._modelViewMatrix.elements[14];
} else {
@@ -35442,7 +35442,7 @@ THREE.SpritePlugin = function ( ) {
_gl.uniform1i( uniforms.useScreenCoordinates, 0 );
_gl.uniform1i( uniforms.affectedByDistance, sprite.affectedByDistance ? 1 : 0 );
- _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite._modelViewMatrixArray );
+ _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite._modelViewMatrix.elements);
}
@@ -35613,7 +35613,7 @@ THREE.DepthPassPlugin = function ( ) {
if ( ! ( object instanceof THREE.Mesh ) || ! ( object.frustumCulled ) || _frustum.contains( object ) ) {
object.matrixWorld.flattenToArray( object._objectMatrixArray );
- object._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( camera.matrixWorldInverse, object.matrixWorld);
webglObject.render = true;
@@ -35681,7 +35681,7 @@ THREE.DepthPassPlugin = function ( ) {
}
- object._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( camera.matrixWorldInverse, object.matrixWorld);
_renderer.renderImmediateObject( camera, scene.__lights, fog, _depthMaterial, object );
View
12 build/custom/ThreeExtras.js
@@ -18661,7 +18661,7 @@ THREE.ShadowMapPlugin = function ( ) {
if ( ! ( object instanceof THREE.Mesh ) || ! ( object.frustumCulled ) || _frustum.contains( object ) ) {
object.matrixWorld.flattenToArray( object._objectMatrixArray );
- object._modelViewMatrix.multiplyToArray( shadowCamera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( shadowCamera.matrixWorldInverse, object.matrixWorld);
webglObject.render = true;
@@ -18729,7 +18729,7 @@ THREE.ShadowMapPlugin = function ( ) {
}
- object._modelViewMatrix.multiplyToArray( shadowCamera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( shadowCamera.matrixWorldInverse, object.matrixWorld);
_renderer.renderImmediateObject( shadowCamera, scene.__lights, fog, _depthMaterial, object );
@@ -19015,7 +19015,7 @@ THREE.SpritePlugin = function ( ) {
if( ! sprite.useScreenCoordinates ) {
- sprite._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, sprite.matrixWorld, sprite._modelViewMatrixArray );
+ sprite._modelViewMatrix.multiply( camera.matrixWorldInverse, sprite.matrixWorld);
sprite.z = - sprite._modelViewMatrix.elements[14];
} else {
@@ -19049,7 +19049,7 @@ THREE.SpritePlugin = function ( ) {
_gl.uniform1i( uniforms.useScreenCoordinates, 0 );
_gl.uniform1i( uniforms.affectedByDistance, sprite.affectedByDistance ? 1 : 0 );
- _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite._modelViewMatrixArray );
+ _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite._modelViewMatrix.elements);
}
@@ -19220,7 +19220,7 @@ THREE.DepthPassPlugin = function ( ) {
if ( ! ( object instanceof THREE.Mesh ) || ! ( object.frustumCulled ) || _frustum.contains( object ) ) {
object.matrixWorld.flattenToArray( object._objectMatrixArray );
- object._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( camera.matrixWorldInverse, object.matrixWorld);
webglObject.render = true;
@@ -19288,7 +19288,7 @@ THREE.DepthPassPlugin = function ( ) {
}
- object._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( camera.matrixWorldInverse, object.matrixWorld);
_renderer.renderImmediateObject( camera, scene.__lights, fog, _depthMaterial, object );
View
14 build/custom/ThreeWebGL.js
@@ -12552,7 +12552,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( p_uniforms.objectMatrix !== null ) {
- _gl.uniformMatrix4fv( p_uniforms.objectMatrix, false, object._objectMatrixArray );
+ _gl.uniformMatrix4fv( p_uniforms.objectMatrix, false, object.matrixWorld.elements );
}
@@ -12740,7 +12740,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function loadUniformsMatrices ( uniforms, object ) {
- _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object._modelViewMatrixArray );
+ _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object._modelViewMatrix.elements );
if ( uniforms.normalMatrix ) {
@@ -12970,7 +12970,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function setupMatrices ( object, camera ) {
- object._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( camera.matrixWorldInverse, object.matrixWorld);
object._normalMatrix.getInverse( object._modelViewMatrix );
object._normalMatrix.transposeIntoArray( object._normalMatrixArray );
@@ -15319,7 +15319,7 @@ THREE.ShadowMapPlugin = function ( ) {
if ( ! ( object instanceof THREE.Mesh ) || ! ( object.frustumCulled ) || _frustum.contains( object ) ) {
object.matrixWorld.flattenToArray( object._objectMatrixArray );
- object._modelViewMatrix.multiplyToArray( shadowCamera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( shadowCamera.matrixWorldInverse, object.matrixWorld);
webglObject.render = true;
@@ -15387,7 +15387,7 @@ THREE.ShadowMapPlugin = function ( ) {
}
- object._modelViewMatrix.multiplyToArray( shadowCamera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( shadowCamera.matrixWorldInverse, object.matrixWorld);
_renderer.renderImmediateObject( shadowCamera, scene.__lights, fog, _depthMaterial, object );
@@ -15673,7 +15673,7 @@ THREE.SpritePlugin = function ( ) {
if( ! sprite.useScreenCoordinates ) {
- sprite._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, sprite.matrixWorld, sprite._modelViewMatrixArray );
+ sprite._modelViewMatrix.multiply( camera.matrixWorldInverse, sprite.matrixWorld);
sprite.z = - sprite._modelViewMatrix.elements[14];
} else {
@@ -15707,7 +15707,7 @@ THREE.SpritePlugin = function ( ) {
_gl.uniform1i( uniforms.useScreenCoordinates, 0 );
_gl.uniform1i( uniforms.affectedByDistance, sprite.affectedByDistance ? 1 : 0 );
- _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite._modelViewMatrixArray );
+ _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite._modelViewMatrix.elements);
}
View
8 src/extras/renderers/plugins/DepthPassPlugin.js
@@ -92,8 +92,8 @@ THREE.DepthPassPlugin = function ( ) {
if ( ! ( object instanceof THREE.Mesh ) || ! ( object.frustumCulled ) || _frustum.contains( object ) ) {
- object.matrixWorld.flattenToArray( object._objectMatrixArray );
- object._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ //object.matrixWorld.flattenToArray( object._objectMatrixArray );
+ object._modelViewMatrix.multiply( camera.matrixWorldInverse, object.matrixWorld);
webglObject.render = true;
@@ -157,11 +157,11 @@ THREE.DepthPassPlugin = function ( ) {
if( object.matrixAutoUpdate ) {
- object.matrixWorld.flattenToArray( object._objectMatrixArray );
+ //object.matrixWorld.flattenToArray( object._objectMatrixArray );
}
- object._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( camera.matrixWorldInverse, object.matrixWorld);
_renderer.renderImmediateObject( camera, scene.__lights, fog, _depthMaterial, object );
View
8 src/extras/renderers/plugins/ShadowMapPlugin.js
@@ -222,8 +222,8 @@ THREE.ShadowMapPlugin = function ( ) {
if ( ! ( object instanceof THREE.Mesh ) || ! ( object.frustumCulled ) || _frustum.contains( object ) ) {
- object.matrixWorld.flattenToArray( object._objectMatrixArray );
- object._modelViewMatrix.multiplyToArray( shadowCamera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ //object.matrixWorld.flattenToArray( object._objectMatrixArray );
+ object._modelViewMatrix.multiply( shadowCamera.matrixWorldInverse, object.matrixWorld);
webglObject.render = true;
@@ -287,11 +287,11 @@ THREE.ShadowMapPlugin = function ( ) {
if( object.matrixAutoUpdate ) {
- object.matrixWorld.flattenToArray( object._objectMatrixArray );
+ //object.matrixWorld.flattenToArray( object._objectMatrixArray );
}
- object._modelViewMatrix.multiplyToArray( shadowCamera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( shadowCamera.matrixWorldInverse, object.matrixWorld);
_renderer.renderImmediateObject( shadowCamera, scene.__lights, fog, _depthMaterial, object );
View
4 src/extras/renderers/plugins/SpritePlugin.js
@@ -129,7 +129,7 @@ THREE.SpritePlugin = function ( ) {
if( ! sprite.useScreenCoordinates ) {
- sprite._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, sprite.matrixWorld, sprite._modelViewMatrixArray );
+ sprite._modelViewMatrix.multiply( camera.matrixWorldInverse, sprite.matrixWorld);
sprite.z = - sprite._modelViewMatrix.elements[14];
} else {
@@ -163,7 +163,7 @@ THREE.SpritePlugin = function ( ) {
_gl.uniform1i( uniforms.useScreenCoordinates, 0 );
_gl.uniform1i( uniforms.affectedByDistance, sprite.affectedByDistance ? 1 : 0 );
- _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite._modelViewMatrixArray );
+ _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, sprite._modelViewMatrix.elements);
}
View
12 src/renderers/WebGLRenderer.js
@@ -3370,7 +3370,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( ! ( object instanceof THREE.Mesh || object instanceof THREE.ParticleSystem ) || ! ( object.frustumCulled ) || _frustum.contains( object ) ) {
- object.matrixWorld.flattenToArray( object._objectMatrixArray );
+ //object.matrixWorld.flattenToArray( object._objectMatrixArray );
setupMatrices( object, camera );
@@ -3420,7 +3420,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if( object.matrixAutoUpdate ) {
- object.matrixWorld.flattenToArray( object._objectMatrixArray );
+ //object.matrixWorld.flattenToArray( object._objectMatrixArray );
}
@@ -3831,7 +3831,7 @@ THREE.WebGLRenderer = function ( parameters ) {
object._modelViewMatrixArray = new Float32Array( 16 );
object._objectMatrixArray = new Float32Array( 16 );
- object.matrixWorld.flattenToArray( object._objectMatrixArray );
+ //object.matrixWorld.flattenToArray( object._objectMatrixArray );
if ( object instanceof THREE.Mesh ) {
@@ -4519,7 +4519,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( p_uniforms.objectMatrix !== null ) {
- _gl.uniformMatrix4fv( p_uniforms.objectMatrix, false, object._objectMatrixArray );
+ _gl.uniformMatrix4fv( p_uniforms.objectMatrix, false, object.matrixWorld.elements );
}
@@ -4707,7 +4707,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function loadUniformsMatrices ( uniforms, object ) {
- _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object._modelViewMatrixArray );
+ _gl.uniformMatrix4fv( uniforms.modelViewMatrix, false, object._modelViewMatrix.elements );
if ( uniforms.normalMatrix ) {
@@ -4937,7 +4937,7 @@ THREE.WebGLRenderer = function ( parameters ) {
function setupMatrices ( object, camera ) {
- object._modelViewMatrix.multiplyToArray( camera.matrixWorldInverse, object.matrixWorld, object._modelViewMatrixArray );
+ object._modelViewMatrix.multiply( camera.matrixWorldInverse, object.matrixWorld);
object._normalMatrix.getInverse( object._modelViewMatrix );
object._normalMatrix.transposeIntoArray( object._normalMatrixArray );

0 comments on commit 32ee545

Please sign in to comment.
Something went wrong with that request. Please try again.