depthTest problem with draw custom geometry

Hi:

Recently, i try to draw many draw many custom 3d Buildings on
the globe, and i got some trouble. Like picture below, some triangle does not display properly.
So i try to use depthTest test to solve the problem,but i does not work, here is my code.

       var instance = new Cesium.GeometryInstance({
            geometry : that,
            modelMatrix : matrix,
            attributes : {
                color : new Cesium.GeometryInstanceAttribute({
                    componentDatatype : Cesium.ComponentDatatype.UNSIGNED_BYTE,
                    componentsPerAttribute : 4,
                    normalize : true,
                    value : [255,255,255,255]
                })
            }
        });

        var textureMaterial = Cesium.Material.fromType("Image");
        textureMaterial.uniforms.image = textureUrl;

        tile._primitive = new Cesium.Primitive({
            geometryInstances : instance,
            appearance : new Cesium.MaterialAppearance({
                material : textureMaterial,
                translucent : false,
                faceForward : true,
                closed : false,
                renderState: {
                    depthTest : {
                        enabled : true,
                        func : Cesium.DepthFunction.LESS
                    },
                    depthMask:false,
                    cull : {
                        enabled : true,
                        face : Cesium.CullFace.BACK
                    }
                }
            }),
            allowPicking : false,
            releaseGeometryInstances : true,
            show : true
        });

does anyone have experience with this?

Thanks,
Song

Try changing

depthMask:false,

to

depthMask:true,

so the primitive containing the geometry writes depth.

If this doesn’t work, can you provide a complete example that can be copy and pasted into Sandcastle?

Patrick

hi Patrick,

Did you got the building model?