1. A concise explanation of the problem you’re experiencing.
I made a custom primitive that draws a red triangle. When I change the alpha value in the fragment shader, the alpha value is still set to 1. The triangle stays a solid color and does not become transparent.
I am modifying the alpha value by setting gl_FragColor[3].
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
Then the polygon disappears. Although a value of 0.5 now makes it fully opaque. One thing I know needs to change is setting the pass to translucent:
this._drawCommand.pass = Cesium.Pass.TRANSLUCENT;
``
But that still doesn’t seem to get 0.5 alpha to work as expected. You might need to create a polygon with alpha using CesiumJS’s entity system, and then print out the drawCommand it generates to compare against your custom one.
Thank you so much Omar! You’ve been really helpful with my Cesium questions over the past year. It’s wonderful that there are experts like you who are available for help. I really appreciate it.
I was able make my primitive transparent by doing what you said. Using 0.5 as the alpha value to make if fully opaque works for what I am trying to do. Thanks.