From c1ce0dbb8c69dd76d7e400b3284ef0216758009b Mon Sep 17 00:00:00 2001 From: alteredq Date: Wed, 14 Mar 2012 15:32:58 +0100 Subject: [PATCH] Changed depth sorting in WebGLRenderer to use world positions. This fixes issue #1504 Something similar would have to be done in Projector. Also while at it I found particles sorting is incorrect: it uses camera info from the previous frame plus _projScreenMatrix gets multiplied more times when there are more particle systems. --- build/Three.js | 2 +- build/custom/ThreeWebGL.js | 16 ++++++++-------- src/renderers/WebGLRenderer.js | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build/Three.js b/build/Three.js index 98fbaa3804..8688159662 100644 --- a/build/Three.js +++ b/build/Three.js @@ -294,7 +294,7 @@ l.UNSIGNED_SHORT,0)),y.info.render.calls++,y.info.render.vertices+=f.__webglFace 0,f.__webglVertexCount),y.info.render.calls++)}};this.render=function(a,b,c,d){var f,g,k,m,n=a.__lights,o=a.fog;S=-1;this.autoUpdateObjects&&this.initWebGLObjects(a);void 0===b.parent&&(console.warn("DEPRECATED: Camera hasn't been added to a Scene. Adding it..."),a.add(b));this.autoUpdateScene&&a.updateMatrixWorld();h(this.renderPluginsPre,a,b);y.info.render.calls=0;y.info.render.vertices=0;y.info.render.faces=0;y.info.render.points=0;b.matrixWorldInverse.getInverse(b.matrixWorld);if(!b._viewMatrixArray)b._viewMatrixArray= new Float32Array(16);b.matrixWorldInverse.flattenToArray(b._viewMatrixArray);if(!b._projectionMatrixArray)b._projectionMatrixArray=new Float32Array(16);b.projectionMatrix.flattenToArray(b._projectionMatrixArray);Za.multiply(b.projectionMatrix,b.matrixWorldInverse);cb.setFromMatrix(Za);this.setRenderTarget(c);(this.autoClear||d)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);m=a.__webglObjects;for(d=0,f=m.length;d