Here are some ideas related to your last bullet point about the “branching in the fragment shader” using the new features of CesiumJS:
This Sandcastle includes an example of mixing translucent and opaque features (see the Translucent Windows option). There are some caveats. CesiumJS uses order-independent translucency by default which tends to make everything a little translucent. We also haven’t tried this technique with very complex scenes.
That example uses Feature ID Textures from EXT_mesh_features to identify which regions are what material.
I would like to follow up on the problem encountered with mixed opaque/translucent shading for a same model using customShaders.
I am trying to render the whole model with customShader’s translucencyMode set to Cesium.CustomShaderTranslucencyMode.TRANSLUCENT
I had hoped that the shader could return an alpha value (based on some criteria: branching, opacity map) to make the material translucent in some places.
However, with alpha is set to (or near) 1.0 by the shader, Z sorting goes wrong and polygons appear invisible/reversed or mis-sorted (see screenshot)
The sandcastle mentioned by @ptrgags in the previous post does not work and I can not refer to it any more.
Am I doing something wrong? Is there new development around this issue?