Hi,
We have been investigating those issues also.
As i understand the “zoffset patch” allows to manually sorting the objects.
But there already seems to have the pieces in Away3D to do this king of sorting automatically between opaque/blended objects in the scene.
But it seems this sorting is done on the “z” values of the entities, withouth taking in account the position of the object relative to the camera.
We tested a patch in Entity.pushModelViewProjection, that computes _zIndices from bounds center projection with the camera. (on 4.0.9 version)
This gives us better results with sorting the opaque/blended objects.
Here is our modified pushModelViewProjection method (away3d.entities.Entity) :
public function pushModelViewProjection(camera : Camera3D) : void
{
if (++_mvpIndex == _stackLen) {
_mvpTransformStack[_mvpIndex] = new Matrix3D();
_stackLen++;
}
//@Patch
var _boundsCenter : Vector3D = new Vector3D( (this.minX + this.maxX) * 0.5, (this.minY + this.maxY) * 0.5, (this.minZ + this.maxZ) * 0.5);
//@Patch
var mvp : Matrix3D = _mvpTransformStack[_mvpIndex];
mvp.copyFrom(sceneTransform);
mvp.append(camera.viewProjection);
mvp.copyColumnTo(3, _pos);
//@Patch
var _transformedBoundsCenter : Vector3D = mvp.transformVector( _boundsCenter );
_zIndices[_mvpIndex] = -(_transformedBoundsCenter.subtract(camera.position)).length;
//_zIndices[_mvpIndex] = -_pos.z;
//@Patch
}