I would expect this to be a more common request, is it on the current roadmap?
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
In our viewing tool, we want to be able to show our 3D tiled drone data over the top of the base imagery, with a slider to control its transparency so you can see features/alignment with underlying imagery or other 3D tile datasets.
4. The Cesium version you’re using, your operating system and browser.
You should be able to do this with the styling language. For example, to set a tileset to 0.5 alpha you could do:
tileset.style = new Cesium.Cesium3DTileStyle({
color: ‘rgba(255, 255, 255, 0.5)’
});
``
Here’s a Sandcastle example with a slider for controlling the transparency. The only thing I’m noticing though is that going from transparency 1 to less than 1 is kind of a big jump.
It looks like this is because the styling only applies to features, and this tileset has none. I opened a feature request since we would like to support this, as well as a work-around that Sean mentioned:
I’m not sure when this would ship, but contributions are always welcome! Feel free to chime in on GitHub as well.
I did try using the classification primitives for transparency, but no luck as the alpha in the provided colour (e.g. rgb(255,255,255, 0.5)) affects the colourisation of the features rather than the features themselves, i.e. if it is 100% transparent then it is the classification which becomes transparent rather than the 3D tile data.
Cesium also allow "invert classification," which styles everything that isn't inside the volume to be a certain color or opacity. I forgot that it's a scene-level property though, so for your use case it could be cumbersome to use - you may have to move or show/hide classification volumes depending on what should be transparent vs. opaque. Totally understandable if you would rather wait on (or implement?) support for styling on feature-less tilesets.