提交 8c72ccc7 编写于 作者: M Mr.doob

WebGLRenderer: Moved layer test to renderObject. See #11083.

上级 47af6d66
......@@ -1304,79 +1304,73 @@ function WebGLRenderer( parameters ) {
if ( ! object.visible ) return;
var visible = object.layers.test( camera.layers );
if ( object.isLight ) {
if ( visible ) {
lights.push( object );
if ( object.isLight ) {
} else if ( object.isSprite ) {
lights.push( object );
if ( ! object.frustumCulled || _frustum.intersectsSprite( object ) ) {
} else if ( object.isSprite ) {
sprites.push( object );
if ( ! object.frustumCulled || _frustum.intersectsSprite( object ) ) {
sprites.push( object );
}
}
} else if ( object.isLensFlare ) {
} else if ( object.isLensFlare ) {
lensFlares.push( object );
lensFlares.push( object );
} else if ( object.isImmediateRenderObject ) {
} else if ( object.isImmediateRenderObject ) {
if ( sortObjects ) {
if ( sortObjects ) {
_vector3.setFromMatrixPosition( object.matrixWorld )
.applyMatrix4( _projScreenMatrix );
_vector3.setFromMatrixPosition( object.matrixWorld )
.applyMatrix4( _projScreenMatrix );
}
currentRenderList.push( object, null, object.material, _vector3.z, null );
}
} else if ( object.isMesh || object.isLine || object.isPoints ) {
currentRenderList.push( object, null, object.material, _vector3.z, null );
if ( object.isSkinnedMesh ) {
} else if ( object.isMesh || object.isLine || object.isPoints ) {
object.skeleton.update();
if ( object.isSkinnedMesh ) {
}
object.skeleton.update();
if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {
}
if ( sortObjects ) {
if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {
_vector3.setFromMatrixPosition( object.matrixWorld )
.applyMatrix4( _projScreenMatrix );
if ( sortObjects ) {
}
_vector3.setFromMatrixPosition( object.matrixWorld )
.applyMatrix4( _projScreenMatrix );
var geometry = objects.update( object );
var material = object.material;
}
if ( Array.isArray( material ) ) {
var geometry = objects.update( object );
var material = object.material;
var groups = geometry.groups;
if ( Array.isArray( material ) ) {
for ( var i = 0, l = groups.length; i < l; i ++ ) {
var groups = geometry.groups;
var group = groups[ i ];
var groupMaterial = material[ group.materialIndex ];
for ( var i = 0, l = groups.length; i < l; i ++ ) {
if ( groupMaterial && groupMaterial.visible ) {
var group = groups[ i ];
var groupMaterial = material[ group.materialIndex ];
currentRenderList.push( object, geometry, groupMaterial, _vector3.z, group );
if ( groupMaterial && groupMaterial.visible ) {
}
currentRenderList.push( object, geometry, groupMaterial, _vector3.z, group );
}
} else if ( material.visible ) {
}
currentRenderList.push( object, geometry, material, _vector3.z, null );
} else if ( material.visible ) {
}
currentRenderList.push( object, geometry, material, _vector3.z, null );
}
......@@ -1444,6 +1438,8 @@ function WebGLRenderer( parameters ) {
function renderObject( object, scene, camera, geometry, material, group ) {
if ( object.layers.test( camera.layers ) === false ) return;
object.modelViewMatrix.multiplyMatrices( camera.matrixWorldInverse, object.matrixWorld );
object.normalMatrix.getNormalMatrix( object.modelViewMatrix );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册