Define blending translucent.

Hi, In my custom primitive I set my render state to be:

this._renderState = Cesium.RenderState.fromCache({
   cull: {
      enabled: true,
      face: Cesium.CullFace.BACK
   depthTest: {
      enabled: false
   depthMask: true,
   blending: Cesium.BlendingState.ALPHA_BLEND

I set the color to [1.0, 1.0, 1.0, 0.2]

But it see that the alpha channel is being ignored.

In normal webgl I would just use the

  • gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);

How would I do that in cesium ?

I just saw that I need to use belnding like so blending: {enabled:true} but it still does not work, can anyone provide me with an example on who to use it?

That seems ok to me, you don’t need to set {enabled:true} yourself, that’s part of the Cesium.BlendingState.AlphaBlend.

Is your DrawCommand’s pass set to Pass.Translucent?

Not really related to the problem, but shouldn’t depthTest be enabled and depthMask disabled? That is the traditional way, maybe you are going for a different look.