|
@@ -521,7 +521,6 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
resetGLState();
|
|
|
setDefaultGLState();
|
|
|
|
|
|
- objects.clear();
|
|
|
properties.clear();
|
|
|
|
|
|
};
|
|
@@ -1260,91 +1259,82 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
if ( object.visible === false ) return;
|
|
|
|
|
|
- if ( object instanceof THREE.Scene || object instanceof THREE.Group ) {
|
|
|
+ if ( object instanceof THREE.Light ) {
|
|
|
|
|
|
- // skip
|
|
|
+ lights.push( object );
|
|
|
|
|
|
- } else {
|
|
|
-
|
|
|
- // update Skeleton objects
|
|
|
- if ( object instanceof THREE.SkinnedMesh ) {
|
|
|
-
|
|
|
- object.skeleton.update();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- objects.init( object );
|
|
|
+ } else if ( object instanceof THREE.Sprite ) {
|
|
|
|
|
|
- if ( object instanceof THREE.Light ) {
|
|
|
+ sprites.push( object );
|
|
|
|
|
|
- lights.push( object );
|
|
|
+ } else if ( object instanceof THREE.LensFlare ) {
|
|
|
|
|
|
- } else if ( object instanceof THREE.Sprite ) {
|
|
|
+ lensFlares.push( object );
|
|
|
|
|
|
- sprites.push( object );
|
|
|
+ } else if ( object instanceof THREE.ImmediateRenderObject ) {
|
|
|
|
|
|
- } else if ( object instanceof THREE.LensFlare ) {
|
|
|
+ var material = object.material;
|
|
|
|
|
|
- lensFlares.push( object );
|
|
|
+ if ( material.transparent ) {
|
|
|
|
|
|
- } else if ( object instanceof THREE.ImmediateRenderObject ) {
|
|
|
+ transparentImmediateObjects.push( object );
|
|
|
|
|
|
- var material = object.material;
|
|
|
-
|
|
|
- if ( material.transparent ) {
|
|
|
-
|
|
|
- transparentImmediateObjects.push( object );
|
|
|
+ } else {
|
|
|
|
|
|
- } else {
|
|
|
+ opaqueImmediateObjects.push( object );
|
|
|
|
|
|
- opaqueImmediateObjects.push( object );
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ } else if ( object instanceof THREE.Mesh || object instanceof THREE.Line || object instanceof THREE.PointCloud ){
|
|
|
|
|
|
- } else {
|
|
|
+ if ( object instanceof THREE.SkinnedMesh ) {
|
|
|
|
|
|
- var webglObject = objects.objects[ object.id ];
|
|
|
+ object.skeleton.update();
|
|
|
|
|
|
- if ( webglObject && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
|
|
|
+ }
|
|
|
|
|
|
- var material = object.material;
|
|
|
+ if ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) {
|
|
|
|
|
|
- if ( material.visible === true ) {
|
|
|
+ var material = object.material;
|
|
|
|
|
|
- if ( material instanceof THREE.MeshFaceMaterial ) {
|
|
|
+ if ( material.visible === true ) {
|
|
|
|
|
|
- var materials = material.materials;
|
|
|
+ if ( material instanceof THREE.MeshFaceMaterial ) {
|
|
|
|
|
|
- for ( var i = 0, l = materials.length; i < l; i ++ ) {
|
|
|
+ var materials = material.materials;
|
|
|
|
|
|
- materials[ i ].program = properties.get( materials[ i ] ).program;
|
|
|
+ for ( var i = 0, l = materials.length; i < l; i ++ ) {
|
|
|
|
|
|
- }
|
|
|
+ materials[ i ].program = properties.get( materials[ i ] ).program;
|
|
|
|
|
|
- } else {
|
|
|
+ }
|
|
|
|
|
|
- material.program = properties.get( material ).program;
|
|
|
+ } else {
|
|
|
|
|
|
- }
|
|
|
+ material.program = properties.get( material ).program;
|
|
|
|
|
|
- if ( material.transparent ) {
|
|
|
+ }
|
|
|
|
|
|
- transparentObjects.push( webglObject );
|
|
|
+ if ( _this.sortObjects === true ) {
|
|
|
|
|
|
- } else {
|
|
|
+ _vector3.setFromMatrixPosition( object.matrixWorld );
|
|
|
+ _vector3.applyProjection( _projScreenMatrix );
|
|
|
|
|
|
- opaqueObjects.push( webglObject );
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
+ var renderItem = {
|
|
|
+ id: object.id,
|
|
|
+ object: object,
|
|
|
+ z: _vector3.z
|
|
|
+ };
|
|
|
|
|
|
- if ( _this.sortObjects === true ) {
|
|
|
+ if ( material.transparent ) {
|
|
|
|
|
|
- _vector3.setFromMatrixPosition( object.matrixWorld );
|
|
|
- _vector3.applyProjection( _projScreenMatrix );
|
|
|
+ transparentObjects.push( renderItem );
|
|
|
|
|
|
- webglObject.z = _vector3.z;
|
|
|
+ } else {
|
|
|
|
|
|
- }
|
|
|
+ opaqueObjects.push( renderItem );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1370,8 +1360,8 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
for ( var i = 0, l = renderList.length; i < l; i ++ ) {
|
|
|
|
|
|
- var webglObject = renderList[ i ];
|
|
|
- var object = webglObject.object;
|
|
|
+ var renderItem = renderList[ i ];
|
|
|
+ var object = renderItem.object;
|
|
|
var geometry = objects.update( object );
|
|
|
|
|
|
object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
|