Skip to content

Support Google Photorealistic 3D Tiles in iTwin.js #8104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 129 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 114 commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
ea82b02
Investigation on supporting GP3DT
matmarchand May 12, 2025
e1a716c
Store all URL params test
eringram May 13, 2025
69e695e
merge
markschlosseratbentley May 14, 2025
fc368df
handle base url better in case of a preceding slash
markschlosseratbentley May 14, 2025
690f580
split G3DT tile handling into separate reality data source implementa…
markschlosseratbentley May 15, 2025
81577d7
add file
markschlosseratbentley May 15, 2025
445fd1f
cleanup impl, add unit tests
andremig-bentley May 15, 2025
50ccc96
Clean up search parameters & add tests
eringram May 15, 2025
8fd1ed6
Clean up query param handling
eringram May 19, 2025
62e4e8c
accumulate glTF attribution information + store on tiles.
markschlosseratbentley May 19, 2025
a431d82
Add attributions from tiles
eringram May 19, 2025
55885c7
Merge branch 'master' into google-3d-tiles
eringram May 19, 2025
f539c7f
handle gp3dt auth more cleanly
markschlosseratbentley May 20, 2025
885dc92
rename G3DT to GP3DT
markschlosseratbentley May 20, 2025
ce3173d
gp3dt rename for test file
markschlosseratbentley May 20, 2025
850b444
Merge branch 'master' into google-3d-tiles
markschlosseratbentley May 20, 2025
92f5ee5
copyright internal
markschlosseratbentley May 20, 2025
36827e3
docs
markschlosseratbentley May 20, 2025
18f7130
docs + extract-api
markschlosseratbentley May 20, 2025
b0703bc
WIP google tiles decorator
eringram May 20, 2025
6bdab4e
Merge branch 'master' into google-3d-tiles
eringram May 20, 2025
9f7f54c
add RealityDataFormatRegistry on IModelApp. Move gp3dtKey from TileAd…
markschlosseratbentley May 21, 2025
7c5c126
Merge branch 'google-3d-tiles' of https://github.com/iTwin/itwinjs-co…
markschlosseratbentley May 21, 2025
d91ba63
Merge branch 'master' into google-3d-tiles
markschlosseratbentley May 21, 2025
da7893d
rush change
markschlosseratbentley May 21, 2025
5d4a738
rush extract-api
markschlosseratbentley May 21, 2025
fb3aa4f
remove gp3dtKey from TileAdmin
markschlosseratbentley May 21, 2025
ff601cd
extract-api
markschlosseratbentley May 21, 2025
163771e
Remove collectGltfAttributions option, always collect
eringram May 21, 2025
07ea254
extract-api
markschlosseratbentley May 21, 2025
f24009f
add getGooglePhotorealistic3DTilesURL function
markschlosseratbentley May 21, 2025
b76a766
alpha in imodelapp
markschlosseratbentley May 21, 2025
0da3381
extract-api
markschlosseratbentley May 21, 2025
3d4298d
Rm GoogleMapDecorator from map-layers-formats, rm copyright from Tile
eringram May 21, 2025
24a24a2
extract-api
eringram May 21, 2025
eaf2611
Merge branch 'master' into google-3d-tiles
eringram May 21, 2025
76c6097
Remove unnecessary export
eringram May 21, 2025
9a3778b
Merge branch 'google-3d-tiles' of https://github.com/iTwin/itwinjs-co…
eringram May 21, 2025
91231e0
Clean up comments
eringram May 21, 2025
66e52cb
Rush change
eringram May 21, 2025
7a47ad4
Merge branch 'master' into google-3d-tiles
markschlosseratbentley May 22, 2025
0d0b6b0
Merge branch 'master' into google-3d-tiles
eringram May 22, 2025
32ba8d4
rework registry
markschlosseratbentley May 22, 2025
a135b7f
RealityTileTreeReference test WIP
eringram May 22, 2025
30766b5
Merge branch 'master' into google-3d-tiles
eringram May 22, 2025
2abf4ed
Merge branch 'master' into google-3d-tiles
eringram May 23, 2025
bd0e5d7
Merge branch 'master' into google-3d-tiles
eringram May 23, 2025
d5ee6bd
Unit test progress
eringram May 23, 2025
2d76949
Merge branch 'master' into google-3d-tiles
eringram May 27, 2025
42e8436
RealityDataSourceGP3DTProvider WIP
eringram May 27, 2025
10bce2d
Merge branch 'master' into google-3d-tiles
eringram May 28, 2025
536ac63
Fix build errors
eringram May 28, 2025
86508b2
Add assets, remove whitespace change
eringram May 28, 2025
48dbc7e
remove dead code/api
markschlosseratbentley May 29, 2025
b8cb0d1
remove old API
markschlosseratbentley May 29, 2025
78f0596
export changes; extract-api
markschlosseratbentley May 29, 2025
8170f58
remove common changelog
markschlosseratbentley May 29, 2025
7b9d785
rush change
markschlosseratbentley May 29, 2025
dda78df
rush update
markschlosseratbentley May 29, 2025
b2648f1
Merge branch 'master' into google-3d-tiles
eringram May 29, 2025
25950bd
Add option for user to pass getAuthToken function to provider
eringram May 29, 2025
f5d39bf
Merge branch 'master' into google-3d-tiles
eringram May 30, 2025
54806b0
Make API key optional, docs
eringram May 30, 2025
8f4cd4f
Move decorator from tileTreeRef to rdSourceProvider
eringram May 30, 2025
d187797
Merge branch 'master' into google-3d-tiles
eringram May 30, 2025
da4c404
Merge branch 'master' into google-3d-tiles
eringram Jun 2, 2025
1721498
Fix RealityModelTileTree tests
eringram Jun 2, 2025
af3baf0
Merge branch 'master' into google-3d-tiles
eringram Jun 2, 2025
844a26f
Merge branch 'master' into google-3d-tiles
eringram Jun 3, 2025
1c46382
Fix unit tests
eringram Jun 3, 2025
c66ca83
Merge branch 'master' into google-3d-tiles
eringram Jun 3, 2025
73ad054
Test cleanup
eringram Jun 3, 2025
0fb4e2c
Merge branch 'master' into google-3d-tiles
eringram Jun 3, 2025
99ab26a
Show copyrights on screen WIP
eringram Jun 3, 2025
d9505b3
Merge branch 'master' into google-3d-tiles
eringram Jun 4, 2025
ca0f014
Use getCopyrights function
eringram Jun 4, 2025
0da8a87
Improve tests & extract-api
eringram Jun 4, 2025
21da2f2
Merge branch 'master' into google-3d-tiles
eringram Jun 6, 2025
1fa48f2
Merge branch 'master' into google-3d-tiles
eringram Jun 6, 2025
2892d32
Merge branch 'master' into google-3d-tiles
eringram Jun 9, 2025
5833f44
Move addAttributions() to provider and simplify unit tests
eringram Jun 9, 2025
000ab04
Merge branch 'master' into google-3d-tiles
eringram Jun 9, 2025
ea504e4
extract-api
eringram Jun 9, 2025
a66d07c
export RealityDataSourceGP3DTProviderOptions
eringram Jun 9, 2025
c3b471f
Clean up DTA
eringram Jun 9, 2025
592e04a
Cleanup
eringram Jun 9, 2025
c6f30e0
Merge branch 'master' into google-3d-tiles
eringram Jun 9, 2025
5ba1e7f
Merge branch 'master' into google-3d-tiles
eringram Jun 10, 2025
de624ac
Fix lint errors
eringram Jun 10, 2025
6999548
Merge branch 'master' into google-3d-tiles
eringram Jun 10, 2025
56051d1
Merge branch 'master' into google-3d-tiles
eringram Jun 10, 2025
bc68998
Make RealityDataSourceGP3DTProvider use cached decorations
eringram Jun 10, 2025
de48d57
Fix PR comments & add changelog
eringram Jun 10, 2025
c538a97
Merge branch 'master' into google-3d-tiles
eringram Jun 10, 2025
03af32b
Merge branch 'master' into google-3d-tiles
eringram Jun 10, 2025
deea9d3
Merge branch 'master' into google-3d-tiles
eringram Jun 11, 2025
9717459
Learning article and code snippets
eringram Jun 11, 2025
657bc6f
Test fix docs build error
eringram Jun 11, 2025
ff3271c
Merge branch 'master' into google-3d-tiles
eringram Jun 11, 2025
97dc980
Merge branch 'master' into google-3d-tiles
eringram Jun 11, 2025
e7db0b6
Convert GP3DT APIs to beta
eringram Jun 11, 2025
e770b20
Also promote IModelApp.realityDataSourceProviders to beta
eringram Jun 11, 2025
dfd9044
Merge branch 'master' into google-3d-tiles
eringram Jun 12, 2025
840bdfa
Merge branch 'master' into google-3d-tiles
markschlosseratbentley Jun 13, 2025
1e74630
Merge branch 'master' into google-3d-tiles
markschlosseratbentley Jun 13, 2025
c6f7a7f
Merge branch 'master' into google-3d-tiles
markschlosseratbentley Jun 13, 2025
6406622
Merge branch 'master' into google-3d-tiles
markschlosseratbentley Jun 16, 2025
cae623d
Merge branch 'master' into google-3d-tiles
eringram Jun 16, 2025
6742bec
Consistent namig and move some files to src/internal
eringram Jun 16, 2025
f76ecc5
Set maximumScreenSpaceError for Google 3D Tiles
eringram Jun 16, 2025
14cace6
Merge branch 'master' into google-3d-tiles
eringram Jun 17, 2025
a77ba81
remove setBaseUrl on namespace
markschlosseratbentley Jun 17, 2025
2886a8f
extract-api
markschlosseratbentley Jun 17, 2025
a1745e6
Merge branch 'master' into google-3d-tiles
eringram Jun 17, 2025
eb935b7
Fix Google3dTilesProviderOptions type & docs
eringram Jun 17, 2025
5491398
Cleanup & extract-api
eringram Jun 17, 2025
1e9f79f
Fix docs link
eringram Jun 17, 2025
03f41a7
Merge branch 'master' into google-3d-tiles
markschlosseratbentley Jun 18, 2025
16e01b1
fix sse test
markschlosseratbentley Jun 18, 2025
6cd1fa5
Merge branch 'master' into google-3d-tiles
markschlosseratbentley Jun 18, 2025
97e5b34
Merge branch 'master' into google-3d-tiles
markschlosseratbentley Jun 18, 2025
e749821
Merge branch 'master' into google-3d-tiles
markschlosseratbentley Jun 18, 2025
c00b81d
Merge branch 'master' into google-3d-tiles
markschlosseratbentley Jun 20, 2025
251813b
Merge branch 'master' into google-3d-tiles
eringram Jun 20, 2025
d58337a
Merge branch 'master' into google-3d-tiles
eringram Jun 20, 2025
26b0949
Alphabetize dependencies
eringram Jun 20, 2025
b6c5a3d
Merge branch 'master' into google-3d-tiles
markschlosseratbentley Jun 23, 2025
db4fa0f
Merge branch 'master' into google-3d-tiles
markschlosseratbentley Jun 23, 2025
4ae415e
Merge branch 'master' into google-3d-tiles
markschlosseratbentley Jun 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 58 additions & 3 deletions common/api/core-frontend.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3767,6 +3767,9 @@ export function getCompressedJpegFromCanvas(canvas: HTMLCanvasElement, maxBytes?
// @internal (undocumented)
export function getFrustumPlaneIntersectionDepthRange(frustum: Frustum, plane: Plane3dByOriginAndUnitNormal): Range1d;

// @beta
export function getGoogle3dTilesUrl(): string;

// @public
export function getImageSourceFormatForMimeType(mimeType: string): ImageSourceFormat | undefined;

Expand Down Expand Up @@ -4075,6 +4078,8 @@ export interface GltfReaderArgs {

// @internal
export interface GltfReaderResult extends TileContent {
// (undocumented)
copyright?: string;
// (undocumented)
range?: AxisAlignedBox3d;
// (undocumented)
Expand All @@ -4095,6 +4100,35 @@ export interface GLTimerResult {
nanoseconds: number;
}

// @beta
export class Google3dTilesProvider implements RealityDataSourceProvider {
constructor(options: Google3dTilesProviderOptions);
// (undocumented)
addAttributions(cards: HTMLTableElement, vp: ScreenViewport): Promise<void>;
// (undocumented)
createRealityDataSource(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined>;
// (undocumented)
decorate(_context: DecorateContext): void;
initialize(): Promise<boolean>;
readonly useCachedDecorations = true;
}

// @beta
export interface Google3dTilesProviderOptions {
apiKey?: string;
getAuthToken?: () => Promise<string | undefined>;
showCreditsOnScreen?: boolean;
}

// @internal
export class GoogleMapsDecorator implements Decorator {
constructor(showCreditsOnScreen?: boolean);
activate(mapType: GoogleMapsMapTypes): Promise<boolean>;
decorate: (context: DecorateContext) => void;
// (undocumented)
readonly logo: LogoDecoration;
}

// @public
export type GpuMemoryLimit = "none" | "default" | "aggressive" | "relaxed" | number;

Expand Down Expand Up @@ -4876,7 +4910,7 @@ export class IModelApp {
static queryRenderCompatibility(): WebGLRenderCompatibilityInfo;
// @beta
static get realityDataAccess(): RealityDataAccess | undefined;
// @alpha
// @beta
static get realityDataSourceProviders(): RealityDataSourceProviderRegistry;
// @internal
static registerEntityState(classFullName: string, classType: typeof EntityState): void;
Expand Down Expand Up @@ -5620,6 +5654,20 @@ export enum LockedStates {
Y_BM = 2
}

// @internal
export class LogoDecoration implements CanvasDecoration {
// (undocumented)
activate(sprite: Sprite): Promise<boolean>;
// (undocumented)
decorate(context: DecorateContext): void;
drawDecoration(ctx: CanvasRenderingContext2D): void;
get isLoaded(): boolean;
moveToLowerLeftCorner(context: DecorateContext): boolean;
set offset(offset: Point3d | undefined);
get offset(): Point3d | undefined;
readonly position: Point3d;
}

// @public
export class LookAndMoveTool extends ViewManip {
constructor(vp: ScreenViewport, oneShot?: boolean, isDraggingRequired?: boolean);
Expand Down Expand Up @@ -8117,12 +8165,15 @@ export namespace RealityDataSource {
export function fromKey(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined>;
}

// @alpha
// @beta
export interface RealityDataSourceProvider {
addAttributions?(cards: HTMLTableElement, vp: ScreenViewport): Promise<void>;
createRealityDataSource(key: RealityDataSourceKey, iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined>;
decorate?(_context: DecorateContext): void;
useCachedDecorations?: true | undefined;
}

// @alpha
// @beta
export class RealityDataSourceProviderRegistry {
// @internal
constructor();
Expand Down Expand Up @@ -8217,6 +8268,10 @@ export class RealityTile extends Tile {
// @internal (undocumented)
computeVisibilityFactor(args: TileDrawArgs): number;
// @internal (undocumented)
get copyright(): string | undefined;
// @internal (undocumented)
protected _copyright?: string;
// @internal (undocumented)
disposeContents(): void;
// @internal (undocumented)
protected forceSelectRealityTile(): boolean;
Expand Down
9 changes: 7 additions & 2 deletions common/api/summary/core-frontend.exports.csv
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ public;function;getCenteredViewRect
public;function;getCesiumAssetUrl
public;function;getCompressedJpegFromCanvas
internal;function;getFrustumPlaneIntersectionDepthRange
beta;function;getGoogle3dTilesUrl
public;function;getImageSourceFormatForMimeType
public;function;getImageSourceMimeType
public;interface;GetPixelDataWorldPointArgs
Expand All @@ -241,6 +242,9 @@ internal;interface;GltfReaderArgs
internal;interface;GltfReaderResult
beta;interface;GltfTemplate
internal;interface;GLTimerResult
beta;class;Google3dTilesProvider
beta;interface;Google3dTilesProviderOptions
internal;class;GoogleMapsDecorator
public;type;GpuMemoryLimit
public;interface;GpuMemoryLimits
public;class;GraphicalEditingScope
Expand Down Expand Up @@ -346,6 +350,7 @@ public;enum;LocateFilterStatus
public;class;LocateOptions
public;class;LocateResponse
internal;enum;LockedStates
internal;class;LogoDecoration
public;class;LookAndMoveTool
public;interface;LookAtArgs
public;interface;LookAtOrthoArgs
Expand Down Expand Up @@ -507,8 +512,8 @@ alpha;function;createKeyFromBlobUrl
alpha;function;createKeyFromOrbitGtBlobProps
alpha;function;createOrbitGtBlobPropsFromKey
alpha;function;fromKey
alpha;interface;RealityDataSourceProvider
alpha;class;RealityDataSourceProviderRegistry
beta;interface;RealityDataSourceProvider
beta;class;RealityDataSourceProviderRegistry
public;interface;RealityMeshParams
public;namespace;RealityMeshParams
internal;function;fromGltfMesh
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-common",
"comment": "",
"type": "none"
}
],
"packageName": "@itwin/core-common"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-frontend",
"comment": "Support Google Photorealistic 3D Tiles.",
"type": "none"
}
],
"packageName": "@itwin/core-frontend"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/map-layers-formats",
"comment": "",
"type": "none"
}
],
"packageName": "@itwin/map-layers-formats"
}
6 changes: 6 additions & 0 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions core/common/src/ContextRealityModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ export interface OrbitGtBlobProps {
*/
export enum RealityDataProvider {
/**
* This is the legacy mode where the access to the 3d tiles is harcoded in ContextRealityModelProps.tilesetUrl property.
* It was use to support RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles
* You should use other mode when possible
* This is the legacy mode where the access to the 3d tiles is hardcoded in ContextRealityModelProps.tilesetUrl property.
* It was used to support RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles
* You should use other modes when possible
* @see [[RealityDataSource.createKeyFromUrl]] that will try to detect provider from an URL
*/
TilesetUrl = "TilesetUrl",
/**
* This is the legacy mode where the access to the 3d tiles is harcoded in ContextRealityModelProps.OrbitGtBlob property.
* It was use to support OrbitPointCloud (OPC) from other server than ContextShare
* You should use other mode when possible
* This is the legacy mode where the access to the 3d tiles is hardcoded in ContextRealityModelProps.OrbitGtBlob property.
* It was used to support OrbitPointCloud (OPC) from other server than ContextShare
* You should use other modes when possible
* @see [[RealityDataSource.createKeyFromOrbitGtBlobProps]] that will try to detect provider from an URL
*/
OrbitGtBlob = "OrbitGtBlob",
/**
* Will provide access url from realityDataId and iTwinId on contextShare for 3dTile storage format or OPC storage format
* This provider support all type of 3dTile storage fomat and OrbitPointCloud: RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles, OPC
* Will provide access url from realityDataId and iTwinId on contextShare for 3dTile storage format or OPC storage format
* This provider supports all types of 3dTile storage format and OrbitPointCloud: RealityMesh3DTiles, Terrain3DTiles, Cesium3DTiles, OPC
* @see [[RealityDataFormat]].
*/
ContextShare = "ContextShare",
Expand Down
4 changes: 3 additions & 1 deletion core/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
"vitest": "^3.0.6",
"vite-multiple-assets": "^1.3.1",
"vite-plugin-static-copy": "2.2.0",
"webpack": "^5.97.1"
"webpack": "^5.97.1",
"sinon": "^17.0.2",
"@types/sinon": "^17.0.2"
},
"//dependencies": [
"NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API",
Expand Down
2 changes: 1 addition & 1 deletion core/frontend/src/IModelApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export class IModelApp {
/** The [[TerrainProviderRegistry]] for this session. */
public static get terrainProviderRegistry(): TerrainProviderRegistry { return this._terrainProviderRegistry; }
/** The [[RealityDataSourceProviderRegistry]] for this session.
* @alpha
* @beta
*/
public static get realityDataSourceProviders(): RealityDataSourceProviderRegistry { return this._realityDataSourceProviders; }
/** The [[RenderSystem]] for this session. */
Expand Down
Loading
Loading