Hello community! I need help with a technical issue.
I’m trying to work with recent versions of CesiumJS (such as version 1.123) to display Google Photorealistic 3D Tiles and overlay them with a 2D tile layer containing transparency information (RGB: 255,255,255). The tile layer follows this URL pattern: http://test/{z}/{x}/{y}.png
While this overlay worked in older versions like 1.95 with the following source code:
// Create Viewer
const viewer = new Cesium.Viewer('cesiumContainer', {
terrainProvider: Cesium.createWorldTerrain(),
navigationHelpButton: true, // Display navigation help button
requestWebgl2: true,
});
// Google's 3D Photorealistic Tiles
const tileset = viewer.scene.primitives.add(
new Cesium.Cesium3DTileset({
url: Cesium.IonResource.fromAssetId(2275207)
})
);
// add 2D tile layer
const imageryLayer = viewer.imageryLayers.addImageryProvider(
new Cesium.UrlTemplateImageryProvider({
url: 'https://test/tiledata1/{z}/{x}/{y}.png',
minimumLevel: 0,
maximumLevel: 21,
credit: '2D Tile Data Source'
})
);
(But when using this code, there’s an issue with the 2D tile layer not properly conforming to the terrain irregularities in the 3D tiles.)
It now throws errors in newer versions.
If anyone has experience with this issue, I would greatly appreciate your guidance.
Like you said,This leads me to conclude that there is currently no viable method for overlaying 2D tile imagery onto the terrain geometry contained within Google 3D Photorealistic Tiles. Could you confirm if this understanding is accurate?
One challenge is that terrain is only 2.5D: at a given X/Y position, the terrain only has one value for height. This makes it relatively simple to position a 2D overlay image at the appropriate height.
3D Tiles (like the Photorealistic Tiles) are truly 3D. The surface could have multiple Z values at the same X/Y position–for example, at a bridge or tunnel. We do not currently have a way to apply a 2D overlay to this kind of 3D data.
Hi @jjhembd, thanks for your answer.
I think I understand now!
So, Cesium terrain data is 2.5D, but Google photorealistic 3D tiles are truly 3D,
therefore, at present, 2D tile data cannot be overlaid on Google photorealistic 3D terrain data.
Anyway, I’m really grateful to understand the current situation. Thank you!
(P.S.) I appreciate you leaving a comment on GitHub. I’ll make sure to check the referenced topic.