i want to pick transparent primitve

var appearance = new Cesium.MaterialAppearance({
translucent: false,
renderState: {
depthMask: true,
blending: Cesium.BlendingState.ALPHA_BLEND,
},
flat: true
});
appearance.material = new Cesium.Material({
fabric: {
type: ‘Image’,
uniforms: {
image: ‘./static/images/wall.png’,
// image: “./static/images/riverNormal.jpg”,
color: color
},
}
});
console.warn(appearance)
let geometry = new Cesium.GeometryInstance({
geometry: Cesium.BoxGeometry.fromDimensions({
dimensions: options.dimensions,
vertexFormat: Cesium.VertexFormat.POSITION_AND_ST,
}),
})
let obj = options.viewer.scene.primitives.add(new Cesium.Primitive({
geometryInstances: geometry,
appearance: appearance,
modelMatrix: toWorldmat
}));
let handler = new Cesium.ScreenSpaceEventHandler();
handler.setInputAction((event) => {
let ray = viewer.camera.getPickRay(event.endPosition);
let picked = viewer.scene.pickFromRay(ray, [tileset]);
console.warn(picked)}

``

``

i want to pick Boxgemoetry with transparent image,i event set depthmask=true,but i cannot pick Boxgemoetry sensitively

Off the top of my head, I think it’s either that CesiumJS uses color for picking, or that it’s still not writing to the depth buffer for some reason.

Have you verified how the picking pass works (it also may be intentionally ignoring translucent primitives in the pick pass). That logic should all be in Scene.js.