Has the Cesium.DrawCommand been removed from the Public API?

Hi Everyone,

5 years ago, I developed a custom primitive in Cesium to create some WebGL animation. I relied on Cesium.DrawCommand in a similar way that is used in section 1.6 of this blog.

However, I am not able to import this anymore in Cesium 1.132.0. Can someone confirm if Cesium.DrawCommand has been removed from the public API in the latest Cesium release?

Thank you!

Hi @Sam,

The DrawCommand class still exists, but it is private–as mentioned in that blog you referenced. See this Sandcastle example that demonstrates that the DrawCommand constructor still can be accessed.

Please be aware that since it is a private class, there is no guarantee that it will work the same across different versions. Future versions of Cesium may introduce breaking changes in the DrawCommand API without warning.

Can you explain a little more about what you are trying to do with this custom primitive? It should be possible to create custom primitives without accessing any private APIs. This way your code will be less likely to break in future versions of Cesium.

Hi @jjhembd ,
Thank you for looking into this and for sharing the Sandcastle example! Your explanation makes sense. I understand that this isn’t part of the official public API so there is no guarantee that it will work with future releases.

Our custom primitive renders wind animation similar to this example.

I got it to work by precomputing the path of a few thousand wind particle. The primitive itself takes the particle paths and the shader code changes the alpha value of different parts of the particle path based off the frame counter (czm_frameNumber) to give the appearance of an animation.

Definitely interested to see if there is an easier way to accomplish this than to use the low level WebGL API. Thanks!

Hi @Sam, I’m afraid I’m not familiar enough with this animation to comment on the implementation.

One basic question: What is the primitive’s shape? Is it a polygon or quad on the surface, with the particles computed in the fragment shader? Or is each particle path a primitive with its own vertex buffer?