Culling a custom primitive

1. A concise explanation of the problem you’re experiencing.

I am trying to cull a custom primitive so that it doesn’t show when I rotate the globe. I know this has something to do with setting the bounding volume in the draw command, but I haven’t been able to get it to work.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

Here is sandcastle example. It shows 2000 lines that are still visible when I rotate the globe.

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I need to make thousands of moving lines for a project to visualize wave data. I can’t just use polylines because it would be too slow and I need to animate them.

4. The Cesium version you’re using, your operating system and browser.

Cesium 1.50.0, Windows 10, Chrome

Thanks for you help

I also thought about calculating if the lines should show when I first set the vertices (Using the Occluder). But then I would have to update them every time the map moves so it would be too inefficient.

I still think the best way is to figure out how to get the primitive to cull the lines based on the bounding sphere of earth.

It looks like the cullface property works but only for triangles, not for lines. I think Cesium only supports culling for primitives made out of triangles. Does that seem correct?

Triangle example is culled:


Lines are not: