Had to use this snippet to get it to work for both point and mesh data:
tileset.style = new Cesium3dTileStyle({
color:
"undefined === ${COLOR}.x ? color('white', " +
alpha +
" ) : rgba(${COLOR}.r * 255, ${COLOR}.g * 255, ${COLOR}.b *255, " +
alpha +
")",
});
The color white is a special value. See the comment in ColorBlendMode and the example of setting defaults in setting default values for styling. It will render the tileset’s original color value for meshes.
However that does not work for point clouds. See this sandcastle with points that appear white. For that you need to use the ${COLOR}
variable provided for point clouds only to get the original color.
The solution expression combines both of these cases with a conditional to check if we have the ${COLOR}
variable available.