提交 41500fe4 编写于 作者: M Mr.doob

WebGLRenderer: We need to clear depth even if we draw background. Maybe we can just clear depth...

上级 e4324dc1
......@@ -1160,14 +1160,25 @@ THREE.WebGLRenderer = function ( parameters ) {
//
var needsClear = this.autoClear || forceClear;
var background = scene.background;
if ( background === null ) {
glClearColor( _clearColor.r, _clearColor.g, _clearColor.b, _clearAlpha );
} else if ( background instanceof THREE.CubeTexture ) {
} else if ( background instanceof THREE.Color ) {
glClearColor( background.r, background.g, background.b, 1 );
}
if ( this.autoClear || forceClear ) {
this.clear( this.autoClearColor, this.autoClearDepth, this.autoClearStencil );
}
if ( background instanceof THREE.CubeTexture ) {
backgroundCamera2.projectionMatrix.copy( camera.projectionMatrix );
......@@ -1179,28 +1190,12 @@ THREE.WebGLRenderer = function ( parameters ) {
_this.renderBufferDirect( backgroundCamera2, null, backgroundBoxMesh.geometry, backgroundBoxMesh.material, backgroundBoxMesh, null );
needsClear = false;
} else if ( background instanceof THREE.Texture ) {
backgroundPlaneMesh.material.map = background;
_this.renderBufferDirect( backgroundCamera, null, backgroundPlaneMesh.geometry, backgroundPlaneMesh.material, backgroundPlaneMesh, null );
needsClear = false;
} else if ( background instanceof THREE.Color ) {
glClearColor( background.r, background.g, background.b, 1 );
needsClear = true;
}
if ( needsClear ) {
this.clear( this.autoClearColor, this.autoClearDepth, this.autoClearStencil );
}
//
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册