Point Cloud Translucency and Eye Dome Lighting

TLDR: Eye Dome Lighting and Translucency don’t work well in different combinations. Is this a bug? Is there a workaround?

I render point clouds with a custom shader and apply an alpha value for translucency / transparency.

I noticed that the alpha value is interpreted differently depending on the translucencyMode for the custom shader:

  • Cesium.CustomShaderTranslucencyMode.TRANSLUCENT: The alpha value seems to be “per point”, i.e., if more points overlap, they accumulate their alpha values. So sparse parts of the point cloud are more transparent than dense parts.
  • Cesium.CustomShaderTranslucencyMode.OPAQUE: The point cloud is rendered, seemingly with a depth buffer discarding fragments that are overlapped by others. Then, the alpha value is applied to the remaining fragments. That means that the point cloud has the same transparency regardless of how many points had overlapped.

This is fine so far, I need both options to be switchable in my local app.

Eye Dome Lighting (EDL)

I created a Sandcastle for that, adapted from the point cloud shading showcase.

Now it seems that the CustomShaderTranslucencyMode.TRANSLUCENT mode does not allow Eye Dome Lighting. I guess this happens because there is no proper depth info, and thus the edges cannot be calculated. This is okay for me.

CustomShaderTranslucencyMode.OPAQUE works with Eye Dome Lighting:

However, it seems that it only works with Eye Dome Lighting. If I switch EDL off, the whole point cloud is rendered opaque, ignoring the assigned alpha value.

This seems like a bug to me. I would have expected that the black edges calculated by the EDL just disappear, and the transparency stays.

Is there a way to make that work? Maybe some workaround?

Any help is appreciated!

Hi @anneg,

Now it seems that the CustomShaderTranslucencyMode.TRANSLUCENT mode does not allow Eye Dome Lighting.

This is indeed a bug, as documented in #8550 on GitHub.

However, it seems that it only works with Eye Dome Lighting . If I switch EDL off, the whole point cloud is rendered opaque, ignoring the assigned alpha value.

This is actually being rendered with the alpha value. But the appearance is just incredibly skewed by the density of points. For example if I set the alpha value very small:

I believe the difference between this view and the previous view is the determined render state and how the translucency is getting applied (per point vs the entire pass). I’m not sure there’s a good workaround for this.

Have you considered using classification or another approach?

1 Like

Thank you for the quick response! I subscribed to the bug ticket.

Regarding:

I already noticed that, and it is not the problem I have. Your screenshot shows that you still have “Transparency” checked. My problem is that if i uncheck Transparency, AND uncheck the EDL, then everything is opaque. If you check EDL again (keeping Transparency unchecked), you’ll see that “overall transparency” like in my second screenshot. I want that “overall transparency”, just without the black edges created by EDL. Thus I disabled EDL. But in that case, everything becomes opaque again like shown in my third screenshot.

I don’t know how classification would help with that? Can you give me another hint?