DepthFailMaterial not working for Cesium.CallbackProperty

Hi everyone,

I’m currently working on a measurement tool in CesiumJS.

When creating a polyline entity with a Cesium.CallbackProperty for its positions, the depthFailMaterial does not appear to take effect. The polyline renders correctly above terrain/tiles, but when occluded (behind terrain or a 3D tileset), it does not render with the fallback material colour. However, when positions is set as a static array instead of a CallbackProperty, depthFailMaterial works as expected.

Has anyone else run into this, or is there a known workaround for using depthFailMaterial alongside CallbackProperty positions?

Here is the link to Cesium Sandcastle https://sandcastle.cesium.com/#c=vVgJb9s2FP4rrDcM8uoylm87B5Y6TmssFxo3RVEXDS0xDldaFCgqiVv4v+9R1EEpSZu2wwwE5vHOj+9y2CoUUqE/EYnQmEYsXqErKVZoXvOS3by2PZfzQP95IogUumH0lkq0iwJ6m3Lgi+TMyXjGIlCEBVTOaw30VbMipKiUcDbKWGZmj7Wyd0JyPz1w6g3NsKlX1EYeDShoNepxsk1IkhVecrGg2Kehup7RSO0vQVSkUpnApmRMKxJDwQI1FpxTTzGhiYyoULIVU+yGRpj4vmPMt5w903xnGVEhwKlrUmM3pwpxsqC8uM7PV5REsWTBEjReER4Vdhn9HllRSXBElYbVSfHzwSsWEC1pZFszJlLBigTt1FKE3Jbb67gubvY7g35/2Op1GtnVi06/3Wu7bezCZb87aOc3nebAbXeHuOu2ut2e2291zE09pRCSUXjVe/pfU+KDL2dMeddvwNncig5utYfDVtdttru9Qbs3KIxo4s7QdVvD9qDdGTRbYEh+18Ot/nDQGbaGreZg0O1VrKCBP5MkiK6EXOWhdEyUZHcdPD2YnMyms/fVAFJynUWheXnFOAV4AX9yS5jKoUy+2gczc52E5lQE+xFspr4DCPV6Rip6OFRSuYZmgzwCmCAHYlDIum2B4BRzsXQuJ/oKcZFAmJk1Qr9/TXg2l6mkctwulI5VX3jxCl4EL6macKqXL9dg5bxm4sucqGBeK4AATm3n5AaujlikwIUkaTnzPutUdepody8z1A7TZ/kmdZ9dISc/y31D2jas6J3SFQCUAOu8dsAisuAUHRd2pUUl44jUGhB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iuLmCKVy3+nkt0aFZ9ozNO4tYKZiaEwHV30l7938i7GwZBiNnywjKv3NT0h9wpzdUcrIGSTvX7t6ROcQY72zB9j6XEgL6mtTk6d08+Bc

ezgif.com-video-to-gif-converter

Hey @realuseriz,

This is a known issue you can see here, this is not currently planned for but if you are interested in contributing CesiumJS is open source and you are welcome to implement and submit a pull request!

You could try destroying and rebuilding the line entity on mouse move so that your polyline is static, this may have a performance hit on your application.

Cheers!

Hi @darcyvdd ,

Thanks for the confirmation. I did found the forum topic on this issue, and wondering if its not updated or anything.

Anyway, thanks again for taking your time reply to this.