@itwin/core-frontend 4.8.0-dev.29 → 4.8.0-dev.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -1
- package/ThirdPartyNotices.md +3 -3
- package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts +3 -0
- package/lib/cjs/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -1
- package/lib/cjs/RealityDataSourceTilesetUrlImpl.js +15 -4
- package/lib/cjs/RealityDataSourceTilesetUrlImpl.js.map +1 -1
- package/lib/cjs/common/gltf/GltfSchema.d.ts +15 -1
- package/lib/cjs/common/gltf/GltfSchema.d.ts.map +1 -1
- package/lib/cjs/common/gltf/GltfSchema.js.map +1 -1
- package/lib/cjs/render/FeatureSymbology.js +3 -3
- package/lib/cjs/render/FeatureSymbology.js.map +1 -1
- package/lib/cjs/render/webgl/glsl/AmbientOcclusion.js.map +1 -1
- package/lib/cjs/tile/B3dmReader.d.ts +0 -1
- package/lib/cjs/tile/B3dmReader.d.ts.map +1 -1
- package/lib/cjs/tile/B3dmReader.js +1 -2
- package/lib/cjs/tile/B3dmReader.js.map +1 -1
- package/lib/cjs/tile/GltfReader.d.ts +25 -1
- package/lib/cjs/tile/GltfReader.d.ts.map +1 -1
- package/lib/cjs/tile/GltfReader.js +239 -3
- package/lib/cjs/tile/GltfReader.js.map +1 -1
- package/lib/cjs/tile/I3dmReader.d.ts +0 -1
- package/lib/cjs/tile/I3dmReader.d.ts.map +1 -1
- package/lib/cjs/tile/I3dmReader.js +1 -2
- package/lib/cjs/tile/I3dmReader.js.map +1 -1
- package/lib/cjs/tile/RealityModelTileTree.js +1 -1
- package/lib/cjs/tile/RealityModelTileTree.js.map +1 -1
- package/lib/cjs/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/cjs/tile/RealityTileLoader.js +1 -0
- package/lib/cjs/tile/RealityTileLoader.js.map +1 -1
- package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts +3 -0
- package/lib/esm/RealityDataSourceTilesetUrlImpl.d.ts.map +1 -1
- package/lib/esm/RealityDataSourceTilesetUrlImpl.js +15 -4
- package/lib/esm/RealityDataSourceTilesetUrlImpl.js.map +1 -1
- package/lib/esm/common/gltf/GltfSchema.d.ts +15 -1
- package/lib/esm/common/gltf/GltfSchema.d.ts.map +1 -1
- package/lib/esm/common/gltf/GltfSchema.js.map +1 -1
- package/lib/esm/render/FeatureSymbology.js +3 -3
- package/lib/esm/render/FeatureSymbology.js.map +1 -1
- package/lib/esm/render/webgl/glsl/AmbientOcclusion.js.map +1 -1
- package/lib/esm/tile/B3dmReader.d.ts +0 -1
- package/lib/esm/tile/B3dmReader.d.ts.map +1 -1
- package/lib/esm/tile/B3dmReader.js +1 -2
- package/lib/esm/tile/B3dmReader.js.map +1 -1
- package/lib/esm/tile/GltfReader.d.ts +25 -1
- package/lib/esm/tile/GltfReader.d.ts.map +1 -1
- package/lib/esm/tile/GltfReader.js +239 -3
- package/lib/esm/tile/GltfReader.js.map +1 -1
- package/lib/esm/tile/I3dmReader.d.ts +0 -1
- package/lib/esm/tile/I3dmReader.d.ts.map +1 -1
- package/lib/esm/tile/I3dmReader.js +1 -2
- package/lib/esm/tile/I3dmReader.js.map +1 -1
- package/lib/esm/tile/RealityModelTileTree.js +1 -1
- package/lib/esm/tile/RealityModelTileTree.js.map +1 -1
- package/lib/esm/tile/RealityTileLoader.d.ts.map +1 -1
- package/lib/esm/tile/RealityTileLoader.js +1 -0
- package/lib/esm/tile/RealityTileLoader.js.map +1 -1
- package/package.json +18 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
# Change Log - @itwin/core-frontend
|
|
2
2
|
|
|
3
|
-
This log was last generated on Fri,
|
|
3
|
+
This log was last generated on Fri, 19 Jul 2024 14:54:06 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.7.7
|
|
6
|
+
Fri, 19 Jul 2024 14:52:42 GMT
|
|
7
|
+
|
|
8
|
+
### Updates
|
|
9
|
+
|
|
10
|
+
- Fix Viewport's never-drawn elements overriding the display style's excluded elements.
|
|
4
11
|
|
|
5
12
|
## 4.7.6
|
|
6
13
|
Fri, 12 Jul 2024 14:42:55 GMT
|
package/ThirdPartyNotices.md
CHANGED
|
@@ -7,7 +7,7 @@ The iTwin.js library potentially incorporates work from the following third-part
|
|
|
7
7
|
|
|
8
8
|
The MIT License
|
|
9
9
|
|
|
10
|
-
Copyright © 2010-
|
|
10
|
+
Copyright © 2010-2024 three.js authors
|
|
11
11
|
|
|
12
12
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
13
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -27,9 +27,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
27
27
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
28
28
|
THE SOFTWARE.
|
|
29
29
|
|
|
30
|
-
## [cesium.js](https://
|
|
30
|
+
## [cesium.js](https://github.com/CesiumGS/cesium)
|
|
31
31
|
|
|
32
|
-
Copyright 2011-
|
|
32
|
+
Copyright 2011-2022 CesiumJS Contributors
|
|
33
33
|
|
|
34
34
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
|
35
35
|
|
|
@@ -42,6 +42,9 @@ export declare class RealityDataSourceTilesetUrlImpl implements RealityDataSourc
|
|
|
42
42
|
*/
|
|
43
43
|
getServiceUrl(_iTwinId: GuidString | undefined): Promise<string | undefined>;
|
|
44
44
|
getRootDocument(iTwinId: GuidString | undefined): Promise<any>;
|
|
45
|
+
private isValidURL;
|
|
46
|
+
/** Returns the tile URL. If the tile path is a full URL, it is returned as is. Otherwise, the base URL is prepended to the tile path. */
|
|
47
|
+
private getTileUrl;
|
|
45
48
|
/**
|
|
46
49
|
* Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.
|
|
47
50
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealityDataSourceTilesetUrlImpl.d.ts","sourceRoot":"","sources":["../../src/RealityDataSourceTilesetUrlImpl.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAyB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAe,WAAW,EAA0C,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAGpJ,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAGzG;;;;;;EAME;AACF,qBAAa,+BAAgC,YAAW,iBAAiB;IACvE,SAAgB,GAAG,EAAE,oBAAoB,CAAC;IAC1C,2EAA2E;IAC3E,OAAO,CAAC,WAAW,CAAqB;IACxC,sIAAsI;IACtI,OAAO,CAAC,QAAQ,CAAc;IAE9B;;OAEG;IACH,SAAS,aAAa,KAAK,EAAE,sBAAsB;IAMnD;;OAEG;WACiB,aAAa,CAAC,SAAS,EAAE,oBAAoB,EAAE,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;IAO5I,IAAW,cAAc,IAAI,OAAO,CAEnC;IACD;;MAEE;IACF,IAAW,WAAW,IAAI,WAAW,GAAG,SAAS,CAEhD;IACD,IAAW,aAAa,IAAI,MAAM,GAAG,SAAS,CAE7C;IACD;;OAEG;IACH,IAAW,eAAe,IAAI,MAAM,GAAG,SAAS,CAE/C;IAOD,OAAO,CAAC,UAAU;IASlB;;;OAGG;IACU,aAAa,CAAC,QAAQ,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAI5E,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC;IAU3E;;OAEG;IACU,cAAc,CAAC,IAAI,EAAE,MAA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lB;;OAEG;IACU,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAI/D;;OAEG;IACU,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAI7C,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI1D;;;;OAIG;IACU,4BAA4B,IAAI,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC;IAQ3F;;;;;OAKG;IACU,uBAAuB,IAAI,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;CAIlF"}
|
|
@@ -85,19 +85,30 @@ class RealityDataSourceTilesetUrlImpl {
|
|
|
85
85
|
this.setBaseUrl(url);
|
|
86
86
|
return (0, Request_1.request)(url, "json");
|
|
87
87
|
}
|
|
88
|
+
isValidURL(url) {
|
|
89
|
+
try {
|
|
90
|
+
new URL(url);
|
|
91
|
+
}
|
|
92
|
+
catch (_) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
/** Returns the tile URL. If the tile path is a full URL, it is returned as is. Otherwise, the base URL is prepended to the tile path. */
|
|
98
|
+
getTileUrl(tilePath) {
|
|
99
|
+
return this.isValidURL(tilePath) ? tilePath : this._baseUrl + tilePath;
|
|
100
|
+
}
|
|
88
101
|
/**
|
|
89
102
|
* Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.
|
|
90
103
|
*/
|
|
91
104
|
async getTileContent(name) {
|
|
92
|
-
|
|
93
|
-
return (0, Request_1.request)(tileUrl, "arraybuffer");
|
|
105
|
+
return (0, Request_1.request)(this.getTileUrl(name), "arraybuffer");
|
|
94
106
|
}
|
|
95
107
|
/**
|
|
96
108
|
* Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.
|
|
97
109
|
*/
|
|
98
110
|
async getTileJson(name) {
|
|
99
|
-
|
|
100
|
-
return (0, Request_1.request)(tileUrl, "json");
|
|
111
|
+
return (0, Request_1.request)(this.getTileUrl(name), "json");
|
|
101
112
|
}
|
|
102
113
|
getTileContentType(url) {
|
|
103
114
|
return new URL(url, "https://localhost/").pathname.toLowerCase().endsWith("json") ? "tileset" : "tile";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealityDataSourceTilesetUrlImpl.js","sourceRoot":"","sources":["../../src/RealityDataSourceTilesetUrlImpl.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,sDAAwE;AACxE,oDAAoJ;AAEpJ,+CAA4C;AAE5C,8CAA8D;AAE9D;;;;;;EAME;AACF,MAAa,+BAA+B;IAO1C;;OAEG;IACH,YAAsB,KAA6B;QANnD,sIAAsI;QAC9H,aAAQ,GAAW,EAAE,CAAC;QAM5B,IAAA,qBAAM,EAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,KAAK,iCAAmB,CAAC,UAAU,IAAI,KAAK,CAAC,SAAS,CAAC,QAAQ,KAAK,iCAAmB,CAAC,WAAW,CAAC,CAAC;QACpI,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,SAA+B,EAAE,QAAgC;QACjG,IAAI,SAAS,CAAC,QAAQ,KAAK,iCAAmB,CAAC,UAAU;YACvD,OAAO,SAAS,CAAC;QACnB,MAAM,QAAQ,GAAG,IAAI,+BAA+B,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;QACpE,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAW,cAAc;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IACD;;MAEE;IACF,IAAW,WAAW;QACpB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAW,aAAa;QACtB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;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AC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IACzG,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,4BAA4B;QACvC,IAAI,eAAsD,CAAC;QAC3D,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,+BAAiB,CAAC,UAAU,EAAE,CAAC;YACrD,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;YAC3D,eAAe,GAAG,sCAA2B,CAAC,4BAA4B,CAAC,YAAY,CAAC,CAAC;QAC3F,CAAC;QACD,OAAO,eAAe,CAAC;IACzB,CAAC;IACD;;;;;OAKG;IACI,KAAK,CAAC,uBAAuB;QAClC,IAAI,aAA+C,CAAC;QACpD,OAAO,aAAa,CAAC;IACvB,CAAC;CACF;AApID,0EAoIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Tiles\n */\nimport { assert, BentleyStatus, GuidString } from \"@itwin/core-bentley\";\nimport { IModelError, RealityData, RealityDataFormat, RealityDataProvider, RealityDataSourceKey, RealityDataSourceProps } from \"@itwin/core-common\";\n\nimport { request } from \"./request/Request\";\nimport { PublisherProductInfo, RealityDataSource, SpatialLocationAndExtents } from \"./RealityDataSource\";\nimport { ThreeDTileFormatInterpreter } from \"./tile/internal\";\n\n/** This class provides access to the reality data provider services.\n * It encapsulates access to a reality data weiter it be from local access, http or ProjectWise Context Share.\n * The key provided at the creation determines if this is ProjectWise Context Share reference.\n * If not then it is considered local (ex: C:\\temp\\TileRoot.json) or plain http access (http://someserver.com/data/TileRoot.json)\n * There is a one to one relationship between a reality data and the instances of present class.\n* @internal\n*/\nexport class RealityDataSourceTilesetUrlImpl implements RealityDataSource {\n public readonly key: RealityDataSourceKey;\n /** The URL that supplies the 3d tiles for displaying the reality model. */\n private _tilesetUrl: string | undefined;\n /** For use by all Reality Data. For RD stored on PW Context Share, represents the portion from the root of the Azure Blob Container*/\n private _baseUrl: string = \"\";\n\n /** Construct a new reality data source.\n * @param props JSON representation of the reality data source\n */\n protected constructor(props: RealityDataSourceProps) {\n assert(props.sourceKey.provider === RealityDataProvider.TilesetUrl || props.sourceKey.provider === RealityDataProvider.OrbitGtBlob);\n this.key = props.sourceKey;\n this._tilesetUrl = this.key.id;\n }\n\n /**\n * Create an instance of this class from a source key and iTwin context/\n */\n public static async createFromKey(sourceKey: RealityDataSourceKey, _iTwinId: GuidString | undefined): Promise<RealityDataSource | undefined> {\n if (sourceKey.provider !== RealityDataProvider.TilesetUrl)\n return undefined;\n const rdSource = new RealityDataSourceTilesetUrlImpl({ sourceKey });\n return rdSource;\n }\n\n public get isContextShare(): boolean {\n return false;\n }\n /**\n * Returns Reality Data if available\n */\n public get realityData(): RealityData | undefined {\n return undefined;\n }\n public get realityDataId(): string | undefined {\n return undefined;\n }\n /**\n * Returns Reality Data type if available\n */\n public get realityDataType(): string | undefined {\n return undefined;\n }\n\n // This is to set the root url from the provided root document path.\n // If the root document is stored on PW Context Share then the root document property of the Reality Data is provided,\n // otherwise the full path to root document is given.\n // The base URL contains the base URL from which tile relative path are constructed.\n // The tile's path root will need to be reinserted for child tiles to return a 200\n private setBaseUrl(url: string): void {\n const urlParts = url.split(\"/\");\n urlParts.pop();\n if (urlParts.length === 0)\n this._baseUrl = \"\";\n else\n this._baseUrl = `${urlParts.join(\"/\")}/`;\n }\n\n /**\n * This method returns the URL to access the actual 3d tiles from the service provider.\n * @returns string containing the URL to reality data.\n */\n public async getServiceUrl(_iTwinId: GuidString | undefined): Promise<string | undefined> {\n return this._tilesetUrl;\n }\n\n public async getRootDocument(iTwinId: GuidString | undefined): Promise<any> {\n const url = await this.getServiceUrl(iTwinId);\n if (!url)\n throw new IModelError(BentleyStatus.ERROR, \"Unable to get service url\");\n\n // The following is only if the reality data is not stored on PW Context Share.\n this.setBaseUrl(url);\n return request(url, \"json\");\n }\n\n private isValidURL(url: string){\n try {\n new URL(url);\n } catch (_) {\n return false;\n }\n return true;\n }\n\n /** Returns the tile URL. If the tile path is a full URL, it is returned as is. Otherwise, the base URL is prepended to the tile path. */\n private getTileUrl(tilePath: string){\n return this.isValidURL(tilePath) ? tilePath : this._baseUrl + tilePath;\n }\n\n /**\n * Returns the tile content. The path to the tile is relative to the base url of present reality data whatever the type.\n */\n public async getTileContent(name: string): Promise<ArrayBuffer> {\n return request(this.getTileUrl(name), \"arraybuffer\");\n }\n\n /**\n * Returns the tile content in json format. The path to the tile is relative to the base url of present reality data whatever the type.\n */\n public async getTileJson(name: string): Promise<any> {\n return request(this.getTileUrl(name), \"json\");\n }\n\n public getTileContentType(url: string): \"tile\" | \"tileset\" {\n return new URL(url, \"https://localhost/\").pathname.toLowerCase().endsWith(\"json\") ? \"tileset\" : \"tile\";\n }\n\n /**\n * Gets spatial location and extents of this reality data source\n * @returns spatial location and extents\n * @internal\n */\n public async getSpatialLocationAndExtents(): Promise<SpatialLocationAndExtents | undefined> {\n let spatialLocation: SpatialLocationAndExtents | undefined;\n if (this.key.format === RealityDataFormat.ThreeDTile) {\n const rootDocument = await this.getRootDocument(undefined);\n spatialLocation = ThreeDTileFormatInterpreter.getSpatialLocationAndExtents(rootDocument);\n }\n return spatialLocation;\n }\n /**\n * Gets information to identify the product and engine that create this reality data\n * Will return undefined if cannot be resolved\n * @returns information to identify the product and engine that create this reality data\n * @alpha\n */\n public async getPublisherProductInfo(): Promise<PublisherProductInfo | undefined> {\n let publisherInfo: PublisherProductInfo | undefined;\n return publisherInfo;\n }\n}\n\n"]}
|
|
@@ -219,6 +219,18 @@ export interface Gltf2Node extends GltfChildOfRootProperty, GltfNodeBaseProps {
|
|
|
219
219
|
SCALE?: GltfId;
|
|
220
220
|
};
|
|
221
221
|
};
|
|
222
|
+
/** The [EXT_instance_features](https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_instance_features/README.md)
|
|
223
|
+
* extension permits assigning identifiers to individual instances of a mesh, which can be used to look up per-instance data in a property table.
|
|
224
|
+
*/
|
|
225
|
+
EXT_instance_features?: {
|
|
226
|
+
featureIds: {
|
|
227
|
+
attribute?: number;
|
|
228
|
+
featureCount: number;
|
|
229
|
+
label?: string;
|
|
230
|
+
nullFeatureId?: number;
|
|
231
|
+
propertyTable: number;
|
|
232
|
+
}[];
|
|
233
|
+
};
|
|
222
234
|
};
|
|
223
235
|
}
|
|
224
236
|
/** Describes a node in a [[GltfScene]]. Each node may be associated with zero, one (glTF 2.0), or any number of (glTF 1.0) [[GltfMesh]]es.
|
|
@@ -503,7 +515,9 @@ export declare namespace GltfStructuralMetadata {
|
|
|
503
515
|
name?: string;
|
|
504
516
|
description?: string;
|
|
505
517
|
version?: string;
|
|
506
|
-
classes?:
|
|
518
|
+
classes?: {
|
|
519
|
+
[classId: string]: Class | undefined;
|
|
520
|
+
};
|
|
507
521
|
enums?: Enum[];
|
|
508
522
|
}
|
|
509
523
|
interface PropertyTableProperty extends GltfProperty {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GltfSchema.d.ts","sourceRoot":"","sources":["../../../../src/common/gltf/GltfSchema.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AACH,oBAAY,YAAY;IACtB,MAAM,IAAI;IACV,KAAK,IAAI;IACT,SAAS,IAAI;IACb,SAAS,IAAI;IACb,+BAA+B;IAC/B,aAAa,IAAI;IACjB,+BAA+B;IAC/B,WAAW,IAAI;CAChB;AAED;;GAEG;AACH,oBAAY,YAAY;IACtB,UAAU,OAAS;IACnB,YAAY,OAAS;IACrB,WAAW,OAAO;IAClB,aAAa,OAAO;IACpB,MAAM,OAAO;IACb,KAAK,OAAO;IACZ,GAAG,OAAO;IACV,IAAI,OAAO;IACX,OAAO,QAAS;IAChB,OAAO,QAAS;IAChB,SAAS,QAAQ;IACjB,SAAS,QAAQ;IACjB,SAAS,QAAQ;IACjB,SAAS,QA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CAC5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GltfSchema.js","sourceRoot":"","sources":["../../../../src/common/gltf/GltfSchema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,YASX;AATD,WAAY,YAAY;IACtB,mDAAU,CAAA;IACV,iDAAS,CAAA;IACT,yDAAa,CAAA;IACb,yDAAa,CAAA;IACb,+BAA+B;IAC/B,iEAAiB,CAAA;IACjB,+BAA+B;IAC/B,6DAAe,CAAA;AACjB,CAAC,EATW,YAAY,4BAAZ,YAAY,QASvB;AAED;;GAEG;AACH,IAAY,YAiBX;AAjBD,WAAY,YAAY;IACtB,8DAAmB,CAAA;IACnB,kEAAqB,CAAA;IACrB,gEAAkB,CAAA;IAClB,oEAAoB,CAAA;IACpB,sDAAa,CAAA;IACb,oDAAY,CAAA;IACZ,gDAAU,CAAA;IACV,kDAAW,CAAA;IACX,yDAAgB,CAAA;IAChB,yDAAgB,CAAA;IAChB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;AACnB,CAAC,EAjBW,YAAY,4BAAZ,YAAY,QAiBvB;AAED,gBAAgB;AAChB,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,0DAAc,CAAA;IACd,wDAAa,CAAA;AACf,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB;AAED,gBAAgB;AAChB,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,0DAA+B,CAAA;IAC/B,wDAA6B,CAAA;IAC7B,oFAA2B,CAAA;IAC3B,kFAA0B,CAAA;IAC1B,kFAA0B,CAAA;IAC1B,gFAAyB,CAAA;AAC3B,CAAC,EAPW,aAAa,6BAAb,aAAa,QAOxB;AAED;;GAEG;AACH,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,iEAAmB,CAAA;IACnB,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I,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAEhE,MAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC;QACvB,IAAI,CAAC,IAAI;YACP,SAAS;QAEX,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClB,MAAM,IAAI,CAAC;QACX,IAAI,IAAI,CAAC,QAAQ;YACf,KAAK,MAAM,KAAK,IAAI,iBAAiB,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,SAAS,CAAC;gBACpE,MAAM,KAAK,CAAC;IAClB,CAAC;AACH,CAAC;AAfD,8CAeC;AA+FD;;GAEG;AACH,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,8BAA8B;IAC9B,gEAAY,CAAA;AACd,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAyFD,gBAAgB;AAChB,SAAgB,eAAe,CAAC,QAAsB;IACpD,MAAM,IAAI,GAAG,QAAyB,CAAC;IACvC,OAAO,SAAS,KAAK,IAAI,CAAC,SAAS,IAAI,SAAS,KAAK,IAAI,CAAC,MAAM,CAAC;AACnE,CAAC;AAHD,0CAGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\n/** Enumerates the types of [[GltfMeshPrimitive]] topologies.\n * @internal\n */\nexport enum GltfMeshMode {\n Points = 0,\n Lines = 1,\n LineStrip = 3,\n Triangles = 4,\n /** Not currently supported. */\n TriangleStrip = 5,\n /** Not currently supported. */\n TriangleFan = 6,\n}\n\n/** Enumerates the basic data types supported by accessors, material values, technique uniforms, etc.\n * @internal\n */\nexport enum GltfDataType {\n SignedByte = 0x1400,\n UnsignedByte = 0x1401,\n SignedShort = 5122,\n UnsignedShort = 5123,\n UInt32 = 5125,\n Float = 5126,\n Rgb = 6407,\n Rgba = 6408,\n IntVec2 = 0x8b53,\n IntVec3 = 0x8b54,\n FloatVec2 = 35664,\n FloatVec3 = 35665,\n FloatVec4 = 35666,\n FloatMat3 = 35675,\n FloatMat4 = 35676,\n Sampler2d = 35678,\n}\n\n/** @internal */\nexport enum GltfMagFilter {\n Nearest = 9728,\n Linear = 9729,\n}\n\n/** @internal */\nexport enum GltfMinFilter {\n Nearest = GltfMagFilter.Nearest,\n Linear = GltfMagFilter.Linear,\n NearestMipMapNearest = 9984,\n LinearMipMapNearest = 9985,\n NearestMipMapLinear = 9986,\n LinearMipMapLinear = 9987,\n}\n\n/** Describes how texture coordinates outside of the range [0..1] are handled.\n * @internal\n */\nexport enum GltfWrapMode {\n ClampToEdge = 33071,\n MirroredRepeat = 33648,\n Repeat = 10497,\n}\n\n/** Describes the intended target of a [[GltfBufferViewProps]].\n * @internal\n */\nexport enum GltfBufferTarget {\n ArrayBuffer = 34962,\n ElementArrayBuffer = 24963,\n}\n\n/** The type used to refer to an entry in a GltfDictionary in a glTF 1.0 asset. @internal */\nexport type Gltf1Id = string;\n/** The type used to refer to an entry in a GltfDictionary in a glTF 2.0 asset. @internal */\nexport type Gltf2Id = number;\n/** The type used to refer to an entry in a GltfDictionary. @internal */\nexport type GltfId = Gltf1Id | Gltf2Id;\n\n/** A collection of resources of some type defined at the top-level of a [[GltfDocument]].\n * In glTF 1.0, these are defined as objects; each resource is referenced and accessed by its string key.\n * In glTF 2.0, these are defined as arrays; each resource is referenced and accessed by its integer array index.\n * @internal\n */\nexport interface GltfDictionary<T extends GltfChildOfRootProperty> {\n [key: GltfId]: T | undefined;\n}\n\n/** @internal */\nexport interface GltfStringMap<T> {\n [key: string]: T | undefined;\n}\n\n/** Iterate the contents of a [[GltfDictionary]].\n * @internal\n */\nexport function * gltfDictionaryIterator<T extends GltfChildOfRootProperty>(dict: GltfDictionary<T>): Iterable<T> {\n if (Array.isArray(dict)) {\n for (const elem of dict)\n yield elem;\n } else {\n for (const key of Object.keys(dict)) {\n const value = dict[key];\n if (undefined !== value)\n yield value;\n }\n }\n}\n\n/** Optional extensions applied to a [[GltfProperty]] to enable behavior not defined in the core specification.\n * @internal\n */\nexport type GltfExtensions = GltfStringMap<unknown>;\n\n/** The base interface provided by most objects in a glTF asset, permitting additional data to be associated with the object.\n * @internal\n */\nexport interface GltfProperty {\n extensions?: GltfExtensions;\n extras?: any;\n}\n\n/** The base interface provided by top-level properties of a [[GltfDocument]].\n * @internal\n */\nexport interface GltfChildOfRootProperty extends GltfProperty {\n /** Optional name, strictly for human consumption. */\n name?: string;\n}\n\n/** @internal */\nexport interface DracoMeshCompression {\n bufferView: GltfId;\n // TEXCOORD_0, POSITION, etc\n attributes: GltfStringMap<number>;\n}\n\n/** @internal */\nexport interface MeshFeature extends GltfProperty {\n featureCount: number;\n nullFeatureId?: number;\n label?: string;\n propertyTable?: number;\n texture?: unknown;\n attribute?: number;\n}\n\n/** @internal */\nexport interface MeshFeatures {\n featureIds: MeshFeature[];\n}\n\n/** A unit of geometry belonging to a [[GltfMesh]]. @internal */\nexport interface GltfMeshPrimitive extends GltfProperty {\n /** Maps the name of each mesh attribute semantic to the Id of the [[GltfAccessor]] providing the attribute's data. */\n attributes: GltfStringMap<GltfId>;\n /** The Id of the [[GltfAccessor]] providing the vertex indices. */\n indices?: GltfId;\n /** The Id of the [[GltfMaterial]] to apply to the primitive when rendering. */\n material?: GltfId;\n /** The primitive topology type. */\n mode?: GltfMeshMode;\n /** Morph targets - currently unsupported. */\n targets?: GltfStringMap<GltfId>;\n extensions?: GltfExtensions & {\n /** The [CESIUM_primitive_outline](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/CESIUM_primitive_outline) extension\n * describes how to draw outline edges for a triangle mesh.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n CESIUM_primitive_outline?: {\n /** The Id of the [[GltfBufferViewProps]] supplying the endpoints of each edge as indices into the triangle mesh's vertex array.\n * The number of indices must be even; each consecutive pair of indices describes one line segment. No connectivity between\n * line segments is implied.\n */\n indices?: GltfId;\n };\n /** The [KHR_draco_mesh_compression](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md) extension\n * allows glTF to support geometry compressed with Draco geometry compression.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n KHR_draco_mesh_compression?: DracoMeshCompression;\n // eslint-disable-next-line @typescript-eslint/naming-convention\n EXT_mesh_features?: MeshFeatures;\n };\n}\n\n/** A collection of [[GltfMeshPrimitive]]s to be rendered. Each mesh is referenced by a node. Multiple nodes can refer to the same mesh.\n * The node's transform is applied when rendering the mesh.\n * @internal\n */\nexport interface GltfMesh extends GltfChildOfRootProperty {\n /** The collection of primitives to be rendered. */\n primitives?: GltfMeshPrimitive[];\n /** For morph targets - currently unsupported. */\n weights?: number[];\n}\n\n/** Properties common to [[Gltf1Node]] and [[Gltf2Node]]. @internal */\nexport interface GltfNodeBaseProps {\n /** The Ids of the child nodes. @see [[GltfNode]]. */\n children?: GltfId[];\n /** Currently ignored. */\n camera?: GltfId;\n /** Currently ignored. */\n skin?: GltfId;\n /** A 4x4 column-major transformation matrix. Mutually exclusive with [[rotation]], [[scale]], and [[translation]]. */\n matrix?: number[];\n /** Unit quaternion as [x, y, z, w], where w is the scalar. */\n rotation?: [number, number, number, number];\n /** Non-uniform scale as [x, y, z]. */\n scale?: [number, number, number];\n /** Translation as [x, y, z]. */\n translation?: [number, number, number];\n}\n\n/** glTF 1.0 representation of a [[GltfNode]]. Unlike a [[Gltf2Node]], a Gltf1Node may refer to any number of [[GltfMesh]]es.\n * @internal\n */\nexport interface Gltf1Node extends GltfChildOfRootProperty, GltfNodeBaseProps {\n /** The Ids of the [[GltfMesh]]es to be rendered by this node.\n * @note The spec defines this as an array of strings, but the original implementation of [[GltfReader]] was written to treat it as a string instead.\n * In case this was because of non-spec-compliant glTF that placed a string here instead of an array, either is permitted.\n */\n meshes?: GltfId[] | string;\n mesh?: never;\n /** Currently ignored. */\n jointName?: GltfId;\n /** Currently ignored. */\n skeletons?: GltfId[];\n}\n\n/** glTF 2.0 representation of a [[GltfNode]]. Unlike a [[Gltf1Node]], a Gltf2Node may refer to at most one [[GltfMesh]].\n * @internal\n */\nexport interface Gltf2Node extends GltfChildOfRootProperty, GltfNodeBaseProps {\n /** The Id of the [[GltfMesh]] to be rendered by this node. */\n mesh?: GltfId;\n meshes?: never;\n /** Morph targets - currently ignored. */\n weights?: number[];\n extensions?: GltfExtensions & {\n /** The [EXT_mesh_gpu_instancing](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md) extension permits multiple\n * instances of the same mesh to be rendered with different translation, rotation, and/or scale.\n * All of the attribute accessors must have the same count (which indicates the number of instances to be drawn).\n * All attributes are optional (though omitting all of them would be silly).\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n EXT_mesh_gpu_instancing?: {\n attributes?: {\n /** VEC3; FLOAT */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n TRANSLATION?: GltfId;\n /** VEC4 (quaternion); FLOAT, normalized BYTE, or normalized SHORT */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n ROTATION?: GltfId;\n /** VEC3; FLOAT */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n SCALE?: GltfId;\n };\n };\n };\n}\n\n/** Describes a node in a [[GltfScene]]. Each node may be associated with zero, one (glTF 2.0), or any number of (glTF 1.0) [[GltfMesh]]es.\n * Each node may define a transform. Each node may have any number of child nodes. A child node's transform is multiplied by its parent node's transform.\n * Some nodes may be associated with other types of data like cameras, skins, lights, etc - these types of data are currently unsupported.\n * Rendering a node means rendering its meshes and the meshes of all of its descendants, with transforms applied.\n * @internal\n */\nexport type GltfNode = Gltf1Node | Gltf2Node;\n\n/** Get the Ids of the meshes associated with a node.\n * @internal\n */\nexport function getGltfNodeMeshIds(node: GltfNode): GltfId[] {\n if (undefined !== node.meshes)\n return typeof node.meshes === \"string\" ? [node.meshes] : node.meshes;\n else if (undefined !== node.mesh)\n return [node.mesh];\n\n return [];\n}\n\n/** @internal */\nexport function * traverseGltfNodes(ids: Iterable<GltfId>, nodes: GltfDictionary<GltfNode>, traversed: Set<GltfId>): Iterable<GltfNode> {\n for (const id of ids) {\n if (traversed.has(id))\n throw new Error(\"Cycle detected while traversing glTF nodes\");\n\n const node = nodes[id];\n if (!node)\n continue;\n\n traversed.add(id);\n yield node;\n if (node.children)\n for (const child of traverseGltfNodes(node.children, nodes, traversed))\n yield child;\n }\n}\n\n/** Describes a scene graph that composes any number of [[GltfNode]]s to produce a rendering of the [[GltfDocument]] asset.\n * An asset may define any number of scenes; the default scene is specified by [[Gltf.scene]].\n * @internal\n */\nexport interface GltfScene extends GltfChildOfRootProperty {\n /** The Ids of the nodes comprising the scene graph. */\n nodes?: GltfId[];\n}\n\n/** Provides metadata about a [[GltfDocument]] asset.\n * @internal\n */\nexport interface GltfAsset extends GltfProperty {\n /** A copyright message suitable for display to credit the content creator. */\n copyright?: string;\n /** The name of the tool that generated the asset. */\n generator?: string;\n /** The glTF version targeted by the asset, in the form \"major.minor\" where \"major\" and \"minor\" are integers. */\n version: string;\n /** The minimum glTF version required to properly load this asset, in the same form as [[version]].\n * This minimum version must be no greater than [[version]].\n */\n minVersion?: string;\n}\n\n/** Describes an image such as one used for a [[GltfTexture]]. The image may be referenced by a [[uri]] or a [[bufferView]].\n * @internal\n */\nexport interface GltfImage extends GltfChildOfRootProperty {\n /** URI from which the image data can be obtained, either as a base-64-encoded data URI or an external resource.\n * Mutually exclusive with [[bufferView]].\n */\n uri?: string;\n /** The image's media type. This property is required if [[bufferView]] is defined. */\n mimeType?: \"image/jpeg\" | \"image/png\";\n /** The Id of the [[GltfBufferViewProps]] containing the image data. Mutually exclusive with [[uri]]. */\n bufferView?: GltfId;\n extensions?: GltfExtensions & {\n /** The [KHR_binary_glTF](https://github.com/KhronosGroup/glTF/tree/main/extensions/1.0/Khronos/KHR_binary_glTF) allows an image to\n * be embedded in a binary chunk appended to the glTF asset's JSON, instead of being referenced by an external URI.\n * This is superseded in glTF 2.0 by support for the glb file format specification.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n KHR_binary_glTF?: {\n /** The Id of the [[GltfBufferViewProps]] that contains the binary image data. */\n bufferView?: GltfId;\n /** Required - @see [[GltfImage.mimeType]]. */\n mimeType?: string;\n };\n };\n}\n\n/** Describes a reference to a [[GltfTexture]]. @internal */\nexport interface GltfTextureInfo extends GltfProperty {\n /** The Id of the [[GltfTexture]]. */\n index: GltfId;\n /** The set index of the texture's TEXCOORD attribute used for texture coordinate mapping.\n * For example, if `texCoord` is `2`, an attribute named `TEXCOORD_2` must exist containing the texture coordinates.\n * Default: 0.\n */\n texCoord?: number;\n}\n\n/** Describes a texture and its sampler.\n * @internal\n */\nexport interface GltfTexture extends GltfChildOfRootProperty {\n /** The Id of the [[GltfSampler]] used by this texture.\n * If undefined, a sampler with repeat wrapping and auto filtering should be used by default.\n */\n sampler?: GltfId;\n /** The Id of the [[GltfImage]] used by this texture.\n * If undefined, an extension or other mechanism should supply an alternate image source - otherwise, the behavior is undefined.\n */\n source?: GltfId;\n}\n\n/** Describes the filtering and wrapping behavior to be applied to a [[GltfTexture]].\n * @note The implementation currently does not support MirroredRepeat and does not support different wrapping for U and V;\n * effectively, unless `wrapS` or `wrapT` is set to ClampToEdge, the sampler will use GltfWrapMode.Repeat.\n * @internal\n */\nexport interface GltfSampler extends GltfChildOfRootProperty {\n /** Magnification filter. */\n magFilter?: GltfMagFilter;\n /** Minification filter. */\n minFilter?: GltfMinFilter;\n /** S (U) wrapping mode. Default: Repeat. */\n wrapS?: GltfWrapMode;\n /** T (V) wrapping mode. Default: Repeat. */\n wrapT?: GltfWrapMode;\n}\n\n/** GL states that can be enabled by a [[GltfTechnique]]. Only those queried by this implementation are enumerated.\n * @internal\n */\nexport enum GltfTechniqueState {\n /** Enables alpha blending. */\n Blend = 3042,\n}\n\n/** For glTF 1.0 only, describes shader programs and shader state associated with a [[Gltf1Material]], used to render meshes associated with the material.\n * This implementation uses it strictly to identify techniques that require alpha blending.\n * @internal\n */\nexport interface GltfTechnique extends GltfChildOfRootProperty {\n /** GL render states to be applied by the technique. */\n states?: {\n /** An array of integers corresponding to boolean GL states that should be enabled using GL's `enable` function.\n * For example, the value [[GltfTechniqueState.Blend]] (3042) indicates that blending should be enabled.\n */\n enable?: GltfTechniqueState[];\n };\n}\n\n/** @internal */\nexport interface Gltf1Material extends GltfChildOfRootProperty {\n diffuse?: string;\n emission?: number[];\n shininess?: number;\n specular?: number[];\n technique?: GltfId;\n values?: {\n texStep?: number[];\n color?: number[];\n tex?: number | string;\n };\n}\n\n/** @internal */\nexport interface GltfMaterialPbrMetallicRoughness extends GltfProperty {\n // Default [1,1,1,1]\n baseColorFactor?: number[];\n baseColorTexture?: GltfTextureInfo;\n // Default 1\n metallicFactor?: number;\n // Default 1\n roughnessFactor?: number;\n metallicRoughnessTexture?: GltfTextureInfo;\n}\n\n/** @internal */\nexport type GltfAlphaMode = \"OPAQUE\" | \"MASK\" | \"BLEND\";\n\n/** @internal */\nexport interface Gltf2Material extends GltfChildOfRootProperty {\n pbrMetallicRoughness?: GltfMaterialPbrMetallicRoughness;\n normalTexture?: GltfTextureInfo;\n occlusionTexture?: unknown;\n emissiveTexture?: GltfTextureInfo;\n emissiveFactor?: number[];\n // Default OPAQUE\n alphaMode?: GltfAlphaMode;\n // Default 0.5. Ignored unless alphaMode=MASK\n alphaCutoff?: number;\n doubleSided?: boolean;\n extensions?: GltfExtensions & {\n /** The [KHR_materials_unlit](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_unlit) extension\n * indicates that the material should be displayed without lighting. The extension adds no additional properties; it is effectively a boolean flag.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n KHR_materials_unlit?: { };\n /** The [KHR_techniques_webgl extension](https://github.com/KhronosGroup/glTF/blob/c1c12bd100e88ff468ccef1cb88cfbec56a69af2/extensions/2.0/Khronos/KHR_techniques_webgl/README.md)\n * allows \"techniques\" to be associated with [[GltfMaterial]]s. Techniques can supply custom shader programs to render geometry; this was a core feature of glTF 1.0 (see [[GltfTechnique]]).\n * Here, it is only used to extract uniform values.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n KHR_techniques_webgl?: {\n technique?: number;\n // An object containing uniform values. Each property name corresponds to a uniform in the material's technique and must conform to that uniform's type and count properties.\n // A handful of uniforms referenced in this implementation by name are defined below.\n values?: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n u_texStep?: number[];\n // eslint-disable-next-line @typescript-eslint/naming-convention\n u_color?: number[];\n // Diffuse texture.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n u_diffuse?: { index: number, texCoord: number };\n [k: string]: unknown;\n };\n };\n };\n}\n\n/** @internal */\nexport type GltfMaterial = Gltf1Material | Gltf2Material;\n\n/** @internal */\nexport function isGltf1Material(material: GltfMaterial): material is Gltf1Material {\n const mat1 = material as Gltf1Material;\n return undefined !== mat1.technique || undefined !== mat1.values;\n}\n\n/** @internal */\nexport interface GltfBuffer extends GltfChildOfRootProperty {\n uri?: string;\n byteLength?: number;\n extensions?: GltfExtensions & {\n // https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_meshopt_compression/README.md\n EXT_meshopt_compression?: { // eslint-disable-line @typescript-eslint/naming-convention\n fallback?: boolean;\n };\n };\n}\n\n/** @internal */\nexport type ExtMeshoptCompressionMode = \"ATTRIBUTES\" | \"TRIANGLES\" | \"INDICES\";\n\n/** @internal */\nexport type ExtMeshoptCompressionFilter = \"NONE\" | \"OCTAHEDRAL\" | \"QUATERNION\";\n\n/** https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_meshopt_compression/README.md\n * @internal\n*/\nexport interface GltfBufferViewMeshoptCompressionExtension {\n buffer: number;\n byteOffset?: number;\n byteLength: number;\n byteStride: number;\n count: number;\n mode: ExtMeshoptCompressionMode;\n filter?: ExtMeshoptCompressionFilter;\n}\n\n/** @internal */\nexport interface GltfBufferViewProps extends GltfChildOfRootProperty {\n buffer: GltfId;\n byteLength?: number;\n byteOffset?: number;\n byteStride?: number;\n target?: GltfBufferTarget;\n extensions?: GltfExtensions & {\n EXT_meshopt_compression?: GltfBufferViewMeshoptCompressionExtension; // eslint-disable-line @typescript-eslint/naming-convention\n };\n}\n\n/** @internal */\nexport interface GltfAccessor extends GltfChildOfRootProperty {\n bufferView?: GltfId;\n byteOffset?: number;\n componentType?: GltfDataType.SignedByte | GltfDataType.UnsignedByte | GltfDataType.SignedShort | GltfDataType.UnsignedShort | GltfDataType.UInt32 | GltfDataType.Float;\n normalized?: boolean;\n count: number;\n type: \"SCALAR\" | \"VEC2\" | \"VEC3\" | \"VEC4\" | \"MAT2\" | \"MAT3\" | \"MAT4\";\n max?: number[];\n min?: number[];\n sparse?: unknown; // ###TODO sparse accessors\n extensions?: GltfExtensions & {\n /** Quantized attributes for glTF 1.0. Superceded by KHR_mesh_quantization. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n WEB3D_quantized_attributes?: {\n decodedMin: number[];\n decodedMax: number[];\n /** Currently ignored. */\n decodeMatrix: number[];\n };\n };\n}\n\n/** @internal */\nexport namespace GltfStructuralMetadata {\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n export type ClassPropertyType = \"SCALAR\" | \"STRING\" | \"BOOLEAN\" | \"ENUM\" | \"VEC2\" | \"VEC3\" | \"VEC4\" | \"MAT2\" | \"MAT3\" | \"MAT4\" | string;\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n export type ClassPropertyComponentType = \"INT8\" | \"UINT8\" | \"INT16\" | \"UINT16\" | \"INT32\" | \"UINT32\" | \"INT64\" | \"UINT64\" | \"FLOAT32\" | \"FLOAT64\" | string;\n\n // Ignoring VECN and MATN types because they complicate offset, scale, min, and max, all of which are otherwise only relevant to SCALAR in which case they're all just numbers.\n export interface ClassProperty extends GltfProperty {\n type: ClassPropertyType;\n name?: string;\n description?: string;\n componentType?: ClassPropertyComponentType;\n enumType?: string;\n array?: boolean;\n count?: number;\n normalized?: boolean;\n offset?: number;\n scale?: number;\n min?: number;\n max?: number;\n required?: boolean;\n noData?: unknown;\n default?: unknown;\n semantic?: string;\n }\n\n export interface EnumValue extends GltfProperty {\n name: string;\n value: number; // an integer\n description?: string;\n }\n\n export interface Enum extends GltfProperty {\n values: EnumValue[];\n // Default: UINT16\n valueType?: \"INT8\" | \"UINT8\" | \"INT16\" | \"UINT16\" | \"INT32\" | \"UINT32\" | \"INT64\" | \"UINT64\" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\n name?: string;\n description?: string;\n }\n\n export interface Class extends GltfProperty {\n name?: string;\n description?: string;\n properties?: {\n [propertyId: string]: ClassProperty | undefined;\n };\n }\n\n export interface Schema extends GltfProperty {\n id: string;\n name?: string;\n description?: string;\n version?: string;\n classes?: Class[];\n enums?: Enum[];\n }\n\n // Ignoring VECN and MATN types because they complicate offset, scale, min, and max, all of which are otherwise only relevant to SCALAR in which case they're all just numbers.\n export interface PropertyTableProperty extends GltfProperty {\n values: GltfId;\n arrayOffsets?: GltfId;\n stringOffsets?: GltfId;\n arrayOffsetType?: \"UINT8\" | \"UINT16\" | \"UINT32\" | \"UINT64\" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\n stringOffsetType?: \"UINT8\" | \"UINT16\" | \"UINT32\" | \"UINT64\" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\n offset?: number;\n scale?: number;\n min?: number;\n max?: number;\n }\n\n export interface PropertyTable {\n class: string;\n count: number;\n properties?: {\n [propertyId: string]: PropertyTableProperty | undefined;\n };\n }\n\n export interface Extension extends GltfProperty {\n // Exactly one of schema or schemaUri must be present.\n schemaUri?: string;\n schema?: Schema;\n propertyTables?: PropertyTable[];\n propertyTextures?: unknown;\n propertyAttributes?: unknown;\n }\n}\n\n/** Describes the top-level structure of a glTF asset.\n * This interface, along with all of the related Gltf* types defined in this file, is primarily based upon the [official glTF 2.0 specification](https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html).\n * However, it can also represent a [glTF 1.0](https://github.com/KhronosGroup/glTF/tree/main/specification/1.0#reference-node) asset.\n * Some types are combined. For example, the top-level dictionaries in glTF 1.0 are objects, while in glTF 2.0 they are arrays; the GltfDictionary interface supports accessing\n * items using either strings or numeric indexes represented by [[GltfId]].\n * For types that differ significantly between the two specs, Gltf1* and Gltf2* versions are defined (e.g., GltfMaterial is a union of Gltf1Material and Gltf2Material).\n * These interfaces also accommodate some deviations from both specs that are known to exist in the wild.\n * Most aspects of the specifications that are not implemented here are omitted (e.g., skinning, animations).\n * @internal\n */\nexport interface GltfDocument extends GltfProperty {\n /** Metadata about the glTF asset.\n * @note This property is required in glTF 2.0, but optional in 1.0.\n */\n asset?: GltfAsset;\n /** The Id of the default [[GltfScene]] in [[scenes]]. */\n scene?: GltfId;\n extensions?: GltfExtensions & {\n /** The [CESIUM_RTC extension](https://github.com/KhronosGroup/glTF/blob/main/extensions/1.0/Vendor/CESIUM_RTC/README.md) defines a centroid\n * relative to which all coordinates in the asset are defined, to reduce floating-point precision errors for large coordinates.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n CESIUM_RTC?: {\n center?: number[];\n };\n /** The [KHR_techniques_webgl extension](https://github.com/KhronosGroup/glTF/blob/c1c12bd100e88ff468ccef1cb88cfbec56a69af2/extensions/2.0/Khronos/KHR_techniques_webgl/README.md)\n * allows \"techniques\" to be associated with [[GltfMaterial]]s. Techniques can supply custom shader programs to render geometry; this was a core feature of glTF 1.0 (see [[GltfTechnique]]).\n * Here, it is only used to extract uniform values.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n KHR_techniques_webgl?: {\n techniques?: Array<{\n uniforms?: {\n [key: string]: { type: GltfDataType, value?: any } | undefined;\n };\n }>;\n };\n // eslint-disable-next-line @typescript-eslint/naming-convention\n EXT_structural_metadata?: GltfStructuralMetadata.Extension;\n };\n /** Names of glTF extensions used in the asset. */\n extensionsUsed?: string[];\n /** Names of glTF extensions required to properly load the asset. */\n extensionsRequired?: string[];\n accessors?: GltfDictionary<GltfAccessor>;\n /** Not currently supported. */\n animations?: GltfDictionary<any>;\n buffers?: GltfDictionary<GltfBuffer>;\n bufferViews?: GltfDictionary<GltfBufferViewProps>;\n /** Not currently used. */\n cameras?: GltfDictionary<any>;\n images?: GltfDictionary<GltfImage>;\n materials?: GltfDictionary<GltfMaterial>;\n meshes?: GltfDictionary<GltfMesh>;\n nodes?: GltfDictionary<GltfNode>;\n samplers?: GltfDictionary<GltfSampler>;\n scenes?: GltfDictionary<GltfScene>;\n /** Not currently supported. */\n skins?: GltfDictionary<any>;\n textures?: GltfDictionary<GltfTexture>;\n /** For glTF 1.0 only, techniques associated with [[Gltf1Material]]s. */\n techniques?: GltfDictionary<GltfTechnique>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"GltfSchema.js","sourceRoot":"","sources":["../../../../src/common/gltf/GltfSchema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;GAEG;AACH,IAAY,YASX;AATD,WAAY,YAAY;IACtB,mDAAU,CAAA;IACV,iDAAS,CAAA;IACT,yDAAa,CAAA;IACb,yDAAa,CAAA;IACb,+BAA+B;IAC/B,iEAAiB,CAAA;IACjB,+BAA+B;IAC/B,6DAAe,CAAA;AACjB,CAAC,EATW,YAAY,4BAAZ,YAAY,QASvB;AAED;;GAEG;AACH,IAAY,YAiBX;AAjBD,WAAY,YAAY;IACtB,8DAAmB,CAAA;IACnB,kEAAqB,CAAA;IACrB,gEAAkB,CAAA;IAClB,oEAAoB,CAAA;IACpB,sDAAa,CAAA;IACb,oDAAY,CAAA;IACZ,gDAAU,CAAA;IACV,kDAAW,CAAA;IACX,yDAAgB,CAAA;IAChB,yDAAgB,CAAA;IAChB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;IACjB,6DAAiB,CAAA;IACjB,6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------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\n/** Enumerates the types of [[GltfMeshPrimitive]] topologies.\n * @internal\n */\nexport enum GltfMeshMode {\n Points = 0,\n Lines = 1,\n LineStrip = 3,\n Triangles = 4,\n /** Not currently supported. */\n TriangleStrip = 5,\n /** Not currently supported. */\n TriangleFan = 6,\n}\n\n/** Enumerates the basic data types supported by accessors, material values, technique uniforms, etc.\n * @internal\n */\nexport enum GltfDataType {\n SignedByte = 0x1400,\n UnsignedByte = 0x1401,\n SignedShort = 5122,\n UnsignedShort = 5123,\n UInt32 = 5125,\n Float = 5126,\n Rgb = 6407,\n Rgba = 6408,\n IntVec2 = 0x8b53,\n IntVec3 = 0x8b54,\n FloatVec2 = 35664,\n FloatVec3 = 35665,\n FloatVec4 = 35666,\n FloatMat3 = 35675,\n FloatMat4 = 35676,\n Sampler2d = 35678,\n}\n\n/** @internal */\nexport enum GltfMagFilter {\n Nearest = 9728,\n Linear = 9729,\n}\n\n/** @internal */\nexport enum GltfMinFilter {\n Nearest = GltfMagFilter.Nearest,\n Linear = GltfMagFilter.Linear,\n NearestMipMapNearest = 9984,\n LinearMipMapNearest = 9985,\n NearestMipMapLinear = 9986,\n LinearMipMapLinear = 9987,\n}\n\n/** Describes how texture coordinates outside of the range [0..1] are handled.\n * @internal\n */\nexport enum GltfWrapMode {\n ClampToEdge = 33071,\n MirroredRepeat = 33648,\n Repeat = 10497,\n}\n\n/** Describes the intended target of a [[GltfBufferViewProps]].\n * @internal\n */\nexport enum GltfBufferTarget {\n ArrayBuffer = 34962,\n ElementArrayBuffer = 24963,\n}\n\n/** The type used to refer to an entry in a GltfDictionary in a glTF 1.0 asset. @internal */\nexport type Gltf1Id = string;\n/** The type used to refer to an entry in a GltfDictionary in a glTF 2.0 asset. @internal */\nexport type Gltf2Id = number;\n/** The type used to refer to an entry in a GltfDictionary. @internal */\nexport type GltfId = Gltf1Id | Gltf2Id;\n\n/** A collection of resources of some type defined at the top-level of a [[GltfDocument]].\n * In glTF 1.0, these are defined as objects; each resource is referenced and accessed by its string key.\n * In glTF 2.0, these are defined as arrays; each resource is referenced and accessed by its integer array index.\n * @internal\n */\nexport interface GltfDictionary<T extends GltfChildOfRootProperty> {\n [key: GltfId]: T | undefined;\n}\n\n/** @internal */\nexport interface GltfStringMap<T> {\n [key: string]: T | undefined;\n}\n\n/** Iterate the contents of a [[GltfDictionary]].\n * @internal\n */\nexport function * gltfDictionaryIterator<T extends GltfChildOfRootProperty>(dict: GltfDictionary<T>): Iterable<T> {\n if (Array.isArray(dict)) {\n for (const elem of dict)\n yield elem;\n } else {\n for (const key of Object.keys(dict)) {\n const value = dict[key];\n if (undefined !== value)\n yield value;\n }\n }\n}\n\n/** Optional extensions applied to a [[GltfProperty]] to enable behavior not defined in the core specification.\n * @internal\n */\nexport type GltfExtensions = GltfStringMap<unknown>;\n\n/** The base interface provided by most objects in a glTF asset, permitting additional data to be associated with the object.\n * @internal\n */\nexport interface GltfProperty {\n extensions?: GltfExtensions;\n extras?: any;\n}\n\n/** The base interface provided by top-level properties of a [[GltfDocument]].\n * @internal\n */\nexport interface GltfChildOfRootProperty extends GltfProperty {\n /** Optional name, strictly for human consumption. */\n name?: string;\n}\n\n/** @internal */\nexport interface DracoMeshCompression {\n bufferView: GltfId;\n // TEXCOORD_0, POSITION, etc\n attributes: GltfStringMap<number>;\n}\n\n/** @internal */\nexport interface MeshFeature extends GltfProperty {\n featureCount: number;\n nullFeatureId?: number;\n label?: string;\n propertyTable?: number;\n texture?: unknown;\n attribute?: number;\n}\n\n/** @internal */\nexport interface MeshFeatures {\n featureIds: MeshFeature[];\n}\n\n/** A unit of geometry belonging to a [[GltfMesh]]. @internal */\nexport interface GltfMeshPrimitive extends GltfProperty {\n /** Maps the name of each mesh attribute semantic to the Id of the [[GltfAccessor]] providing the attribute's data. */\n attributes: GltfStringMap<GltfId>;\n /** The Id of the [[GltfAccessor]] providing the vertex indices. */\n indices?: GltfId;\n /** The Id of the [[GltfMaterial]] to apply to the primitive when rendering. */\n material?: GltfId;\n /** The primitive topology type. */\n mode?: GltfMeshMode;\n /** Morph targets - currently unsupported. */\n targets?: GltfStringMap<GltfId>;\n extensions?: GltfExtensions & {\n /** The [CESIUM_primitive_outline](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Vendor/CESIUM_primitive_outline) extension\n * describes how to draw outline edges for a triangle mesh.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n CESIUM_primitive_outline?: {\n /** The Id of the [[GltfBufferViewProps]] supplying the endpoints of each edge as indices into the triangle mesh's vertex array.\n * The number of indices must be even; each consecutive pair of indices describes one line segment. No connectivity between\n * line segments is implied.\n */\n indices?: GltfId;\n };\n /** The [KHR_draco_mesh_compression](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_draco_mesh_compression/README.md) extension\n * allows glTF to support geometry compressed with Draco geometry compression.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n KHR_draco_mesh_compression?: DracoMeshCompression;\n // eslint-disable-next-line @typescript-eslint/naming-convention\n EXT_mesh_features?: MeshFeatures;\n };\n}\n\n/** A collection of [[GltfMeshPrimitive]]s to be rendered. Each mesh is referenced by a node. Multiple nodes can refer to the same mesh.\n * The node's transform is applied when rendering the mesh.\n * @internal\n */\nexport interface GltfMesh extends GltfChildOfRootProperty {\n /** The collection of primitives to be rendered. */\n primitives?: GltfMeshPrimitive[];\n /** For morph targets - currently unsupported. */\n weights?: number[];\n}\n\n/** Properties common to [[Gltf1Node]] and [[Gltf2Node]]. @internal */\nexport interface GltfNodeBaseProps {\n /** The Ids of the child nodes. @see [[GltfNode]]. */\n children?: GltfId[];\n /** Currently ignored. */\n camera?: GltfId;\n /** Currently ignored. */\n skin?: GltfId;\n /** A 4x4 column-major transformation matrix. Mutually exclusive with [[rotation]], [[scale]], and [[translation]]. */\n matrix?: number[];\n /** Unit quaternion as [x, y, z, w], where w is the scalar. */\n rotation?: [number, number, number, number];\n /** Non-uniform scale as [x, y, z]. */\n scale?: [number, number, number];\n /** Translation as [x, y, z]. */\n translation?: [number, number, number];\n}\n\n/** glTF 1.0 representation of a [[GltfNode]]. Unlike a [[Gltf2Node]], a Gltf1Node may refer to any number of [[GltfMesh]]es.\n * @internal\n */\nexport interface Gltf1Node extends GltfChildOfRootProperty, GltfNodeBaseProps {\n /** The Ids of the [[GltfMesh]]es to be rendered by this node.\n * @note The spec defines this as an array of strings, but the original implementation of [[GltfReader]] was written to treat it as a string instead.\n * In case this was because of non-spec-compliant glTF that placed a string here instead of an array, either is permitted.\n */\n meshes?: GltfId[] | string;\n mesh?: never;\n /** Currently ignored. */\n jointName?: GltfId;\n /** Currently ignored. */\n skeletons?: GltfId[];\n}\n\n/** glTF 2.0 representation of a [[GltfNode]]. Unlike a [[Gltf1Node]], a Gltf2Node may refer to at most one [[GltfMesh]].\n * @internal\n */\nexport interface Gltf2Node extends GltfChildOfRootProperty, GltfNodeBaseProps {\n /** The Id of the [[GltfMesh]] to be rendered by this node. */\n mesh?: GltfId;\n meshes?: never;\n /** Morph targets - currently ignored. */\n weights?: number[];\n extensions?: GltfExtensions & {\n /** The [EXT_mesh_gpu_instancing](https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_mesh_gpu_instancing/README.md) extension permits multiple\n * instances of the same mesh to be rendered with different translation, rotation, and/or scale.\n * All of the attribute accessors must have the same count (which indicates the number of instances to be drawn).\n * All attributes are optional (though omitting all of them would be silly).\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n EXT_mesh_gpu_instancing?: {\n attributes?: {\n /** VEC3; FLOAT */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n TRANSLATION?: GltfId;\n /** VEC4 (quaternion); FLOAT, normalized BYTE, or normalized SHORT */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n ROTATION?: GltfId;\n /** VEC3; FLOAT */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n SCALE?: GltfId;\n };\n };\n /** The [EXT_instance_features](https://github.com/CesiumGS/glTF/tree/3d-tiles-next/extensions/2.0/Vendor/EXT_instance_features/README.md)\n * extension permits assigning identifiers to individual instances of a mesh, which can be used to look up per-instance data in a property table.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n EXT_instance_features?: {\n featureIds: {\n attribute?: number;\n featureCount: number;\n label?: string;\n nullFeatureId?: number;\n propertyTable: number;\n }[];\n };\n };\n}\n\n/** Describes a node in a [[GltfScene]]. Each node may be associated with zero, one (glTF 2.0), or any number of (glTF 1.0) [[GltfMesh]]es.\n * Each node may define a transform. Each node may have any number of child nodes. A child node's transform is multiplied by its parent node's transform.\n * Some nodes may be associated with other types of data like cameras, skins, lights, etc - these types of data are currently unsupported.\n * Rendering a node means rendering its meshes and the meshes of all of its descendants, with transforms applied.\n * @internal\n */\nexport type GltfNode = Gltf1Node | Gltf2Node;\n\n/** Get the Ids of the meshes associated with a node.\n * @internal\n */\nexport function getGltfNodeMeshIds(node: GltfNode): GltfId[] {\n if (undefined !== node.meshes)\n return typeof node.meshes === \"string\" ? [node.meshes] : node.meshes;\n else if (undefined !== node.mesh)\n return [node.mesh];\n\n return [];\n}\n\n/** @internal */\nexport function * traverseGltfNodes(ids: Iterable<GltfId>, nodes: GltfDictionary<GltfNode>, traversed: Set<GltfId>): Iterable<GltfNode> {\n for (const id of ids) {\n if (traversed.has(id))\n throw new Error(\"Cycle detected while traversing glTF nodes\");\n\n const node = nodes[id];\n if (!node)\n continue;\n\n traversed.add(id);\n yield node;\n if (node.children)\n for (const child of traverseGltfNodes(node.children, nodes, traversed))\n yield child;\n }\n}\n\n/** Describes a scene graph that composes any number of [[GltfNode]]s to produce a rendering of the [[GltfDocument]] asset.\n * An asset may define any number of scenes; the default scene is specified by [[Gltf.scene]].\n * @internal\n */\nexport interface GltfScene extends GltfChildOfRootProperty {\n /** The Ids of the nodes comprising the scene graph. */\n nodes?: GltfId[];\n}\n\n/** Provides metadata about a [[GltfDocument]] asset.\n * @internal\n */\nexport interface GltfAsset extends GltfProperty {\n /** A copyright message suitable for display to credit the content creator. */\n copyright?: string;\n /** The name of the tool that generated the asset. */\n generator?: string;\n /** The glTF version targeted by the asset, in the form \"major.minor\" where \"major\" and \"minor\" are integers. */\n version: string;\n /** The minimum glTF version required to properly load this asset, in the same form as [[version]].\n * This minimum version must be no greater than [[version]].\n */\n minVersion?: string;\n}\n\n/** Describes an image such as one used for a [[GltfTexture]]. The image may be referenced by a [[uri]] or a [[bufferView]].\n * @internal\n */\nexport interface GltfImage extends GltfChildOfRootProperty {\n /** URI from which the image data can be obtained, either as a base-64-encoded data URI or an external resource.\n * Mutually exclusive with [[bufferView]].\n */\n uri?: string;\n /** The image's media type. This property is required if [[bufferView]] is defined. */\n mimeType?: \"image/jpeg\" | \"image/png\";\n /** The Id of the [[GltfBufferViewProps]] containing the image data. Mutually exclusive with [[uri]]. */\n bufferView?: GltfId;\n extensions?: GltfExtensions & {\n /** The [KHR_binary_glTF](https://github.com/KhronosGroup/glTF/tree/main/extensions/1.0/Khronos/KHR_binary_glTF) allows an image to\n * be embedded in a binary chunk appended to the glTF asset's JSON, instead of being referenced by an external URI.\n * This is superseded in glTF 2.0 by support for the glb file format specification.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n KHR_binary_glTF?: {\n /** The Id of the [[GltfBufferViewProps]] that contains the binary image data. */\n bufferView?: GltfId;\n /** Required - @see [[GltfImage.mimeType]]. */\n mimeType?: string;\n };\n };\n}\n\n/** Describes a reference to a [[GltfTexture]]. @internal */\nexport interface GltfTextureInfo extends GltfProperty {\n /** The Id of the [[GltfTexture]]. */\n index: GltfId;\n /** The set index of the texture's TEXCOORD attribute used for texture coordinate mapping.\n * For example, if `texCoord` is `2`, an attribute named `TEXCOORD_2` must exist containing the texture coordinates.\n * Default: 0.\n */\n texCoord?: number;\n}\n\n/** Describes a texture and its sampler.\n * @internal\n */\nexport interface GltfTexture extends GltfChildOfRootProperty {\n /** The Id of the [[GltfSampler]] used by this texture.\n * If undefined, a sampler with repeat wrapping and auto filtering should be used by default.\n */\n sampler?: GltfId;\n /** The Id of the [[GltfImage]] used by this texture.\n * If undefined, an extension or other mechanism should supply an alternate image source - otherwise, the behavior is undefined.\n */\n source?: GltfId;\n}\n\n/** Describes the filtering and wrapping behavior to be applied to a [[GltfTexture]].\n * @note The implementation currently does not support MirroredRepeat and does not support different wrapping for U and V;\n * effectively, unless `wrapS` or `wrapT` is set to ClampToEdge, the sampler will use GltfWrapMode.Repeat.\n * @internal\n */\nexport interface GltfSampler extends GltfChildOfRootProperty {\n /** Magnification filter. */\n magFilter?: GltfMagFilter;\n /** Minification filter. */\n minFilter?: GltfMinFilter;\n /** S (U) wrapping mode. Default: Repeat. */\n wrapS?: GltfWrapMode;\n /** T (V) wrapping mode. Default: Repeat. */\n wrapT?: GltfWrapMode;\n}\n\n/** GL states that can be enabled by a [[GltfTechnique]]. Only those queried by this implementation are enumerated.\n * @internal\n */\nexport enum GltfTechniqueState {\n /** Enables alpha blending. */\n Blend = 3042,\n}\n\n/** For glTF 1.0 only, describes shader programs and shader state associated with a [[Gltf1Material]], used to render meshes associated with the material.\n * This implementation uses it strictly to identify techniques that require alpha blending.\n * @internal\n */\nexport interface GltfTechnique extends GltfChildOfRootProperty {\n /** GL render states to be applied by the technique. */\n states?: {\n /** An array of integers corresponding to boolean GL states that should be enabled using GL's `enable` function.\n * For example, the value [[GltfTechniqueState.Blend]] (3042) indicates that blending should be enabled.\n */\n enable?: GltfTechniqueState[];\n };\n}\n\n/** @internal */\nexport interface Gltf1Material extends GltfChildOfRootProperty {\n diffuse?: string;\n emission?: number[];\n shininess?: number;\n specular?: number[];\n technique?: GltfId;\n values?: {\n texStep?: number[];\n color?: number[];\n tex?: number | string;\n };\n}\n\n/** @internal */\nexport interface GltfMaterialPbrMetallicRoughness extends GltfProperty {\n // Default [1,1,1,1]\n baseColorFactor?: number[];\n baseColorTexture?: GltfTextureInfo;\n // Default 1\n metallicFactor?: number;\n // Default 1\n roughnessFactor?: number;\n metallicRoughnessTexture?: GltfTextureInfo;\n}\n\n/** @internal */\nexport type GltfAlphaMode = \"OPAQUE\" | \"MASK\" | \"BLEND\";\n\n/** @internal */\nexport interface Gltf2Material extends GltfChildOfRootProperty {\n pbrMetallicRoughness?: GltfMaterialPbrMetallicRoughness;\n normalTexture?: GltfTextureInfo;\n occlusionTexture?: unknown;\n emissiveTexture?: GltfTextureInfo;\n emissiveFactor?: number[];\n // Default OPAQUE\n alphaMode?: GltfAlphaMode;\n // Default 0.5. Ignored unless alphaMode=MASK\n alphaCutoff?: number;\n doubleSided?: boolean;\n extensions?: GltfExtensions & {\n /** The [KHR_materials_unlit](https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_unlit) extension\n * indicates that the material should be displayed without lighting. The extension adds no additional properties; it is effectively a boolean flag.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n KHR_materials_unlit?: { };\n /** The [KHR_techniques_webgl extension](https://github.com/KhronosGroup/glTF/blob/c1c12bd100e88ff468ccef1cb88cfbec56a69af2/extensions/2.0/Khronos/KHR_techniques_webgl/README.md)\n * allows \"techniques\" to be associated with [[GltfMaterial]]s. Techniques can supply custom shader programs to render geometry; this was a core feature of glTF 1.0 (see [[GltfTechnique]]).\n * Here, it is only used to extract uniform values.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n KHR_techniques_webgl?: {\n technique?: number;\n // An object containing uniform values. Each property name corresponds to a uniform in the material's technique and must conform to that uniform's type and count properties.\n // A handful of uniforms referenced in this implementation by name are defined below.\n values?: {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n u_texStep?: number[];\n // eslint-disable-next-line @typescript-eslint/naming-convention\n u_color?: number[];\n // Diffuse texture.\n // eslint-disable-next-line @typescript-eslint/naming-convention\n u_diffuse?: { index: number, texCoord: number };\n [k: string]: unknown;\n };\n };\n };\n}\n\n/** @internal */\nexport type GltfMaterial = Gltf1Material | Gltf2Material;\n\n/** @internal */\nexport function isGltf1Material(material: GltfMaterial): material is Gltf1Material {\n const mat1 = material as Gltf1Material;\n return undefined !== mat1.technique || undefined !== mat1.values;\n}\n\n/** @internal */\nexport interface GltfBuffer extends GltfChildOfRootProperty {\n uri?: string;\n byteLength?: number;\n extensions?: GltfExtensions & {\n // https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_meshopt_compression/README.md\n EXT_meshopt_compression?: { // eslint-disable-line @typescript-eslint/naming-convention\n fallback?: boolean;\n };\n };\n}\n\n/** @internal */\nexport type ExtMeshoptCompressionMode = \"ATTRIBUTES\" | \"TRIANGLES\" | \"INDICES\";\n\n/** @internal */\nexport type ExtMeshoptCompressionFilter = \"NONE\" | \"OCTAHEDRAL\" | \"QUATERNION\";\n\n/** https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Vendor/EXT_meshopt_compression/README.md\n * @internal\n*/\nexport interface GltfBufferViewMeshoptCompressionExtension {\n buffer: number;\n byteOffset?: number;\n byteLength: number;\n byteStride: number;\n count: number;\n mode: ExtMeshoptCompressionMode;\n filter?: ExtMeshoptCompressionFilter;\n}\n\n/** @internal */\nexport interface GltfBufferViewProps extends GltfChildOfRootProperty {\n buffer: GltfId;\n byteLength?: number;\n byteOffset?: number;\n byteStride?: number;\n target?: GltfBufferTarget;\n extensions?: GltfExtensions & {\n EXT_meshopt_compression?: GltfBufferViewMeshoptCompressionExtension; // eslint-disable-line @typescript-eslint/naming-convention\n };\n}\n\n/** @internal */\nexport interface GltfAccessor extends GltfChildOfRootProperty {\n bufferView?: GltfId;\n byteOffset?: number;\n componentType?: GltfDataType.SignedByte | GltfDataType.UnsignedByte | GltfDataType.SignedShort | GltfDataType.UnsignedShort | GltfDataType.UInt32 | GltfDataType.Float;\n normalized?: boolean;\n count: number;\n type: \"SCALAR\" | \"VEC2\" | \"VEC3\" | \"VEC4\" | \"MAT2\" | \"MAT3\" | \"MAT4\";\n max?: number[];\n min?: number[];\n sparse?: unknown; // ###TODO sparse accessors\n extensions?: GltfExtensions & {\n /** Quantized attributes for glTF 1.0. Superceded by KHR_mesh_quantization. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n WEB3D_quantized_attributes?: {\n decodedMin: number[];\n decodedMax: number[];\n /** Currently ignored. */\n decodeMatrix: number[];\n };\n };\n}\n\n/** @internal */\nexport namespace GltfStructuralMetadata {\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n export type ClassPropertyType = \"SCALAR\" | \"STRING\" | \"BOOLEAN\" | \"ENUM\" | \"VEC2\" | \"VEC3\" | \"VEC4\" | \"MAT2\" | \"MAT3\" | \"MAT4\" | string;\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n export type ClassPropertyComponentType = \"INT8\" | \"UINT8\" | \"INT16\" | \"UINT16\" | \"INT32\" | \"UINT32\" | \"INT64\" | \"UINT64\" | \"FLOAT32\" | \"FLOAT64\" | string;\n\n // Ignoring VECN and MATN types because they complicate offset, scale, min, and max, all of which are otherwise only relevant to SCALAR in which case they're all just numbers.\n export interface ClassProperty extends GltfProperty {\n type: ClassPropertyType;\n name?: string;\n description?: string;\n componentType?: ClassPropertyComponentType;\n enumType?: string;\n array?: boolean;\n count?: number;\n normalized?: boolean;\n offset?: number;\n scale?: number;\n min?: number;\n max?: number;\n required?: boolean;\n noData?: unknown;\n default?: unknown;\n semantic?: string;\n }\n\n export interface EnumValue extends GltfProperty {\n name: string;\n value: number; // an integer\n description?: string;\n }\n\n export interface Enum extends GltfProperty {\n values: EnumValue[];\n // Default: UINT16\n valueType?: \"INT8\" | \"UINT8\" | \"INT16\" | \"UINT16\" | \"INT32\" | \"UINT32\" | \"INT64\" | \"UINT64\" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\n name?: string;\n description?: string;\n }\n\n export interface Class extends GltfProperty {\n name?: string;\n description?: string;\n properties?: {\n [propertyId: string]: ClassProperty | undefined;\n };\n }\n\n export interface Schema extends GltfProperty {\n id: string;\n name?: string;\n description?: string;\n version?: string;\n classes?: {\n [classId: string]: Class | undefined;\n };\n enums?: Enum[];\n }\n\n // Ignoring VECN and MATN types because they complicate offset, scale, min, and max, all of which are otherwise only relevant to SCALAR in which case they're all just numbers.\n export interface PropertyTableProperty extends GltfProperty {\n values: GltfId;\n arrayOffsets?: GltfId;\n stringOffsets?: GltfId;\n arrayOffsetType?: \"UINT8\" | \"UINT16\" | \"UINT32\" | \"UINT64\" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\n stringOffsetType?: \"UINT8\" | \"UINT16\" | \"UINT32\" | \"UINT64\" | string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents\n offset?: number;\n scale?: number;\n min?: number;\n max?: number;\n }\n\n export interface PropertyTable {\n class: string;\n count: number;\n properties?: {\n [propertyId: string]: PropertyTableProperty | undefined;\n };\n }\n\n export interface Extension extends GltfProperty {\n // Exactly one of schema or schemaUri must be present.\n schemaUri?: string;\n schema?: Schema;\n propertyTables?: PropertyTable[];\n propertyTextures?: unknown;\n propertyAttributes?: unknown;\n }\n}\n\n/** Describes the top-level structure of a glTF asset.\n * This interface, along with all of the related Gltf* types defined in this file, is primarily based upon the [official glTF 2.0 specification](https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html).\n * However, it can also represent a [glTF 1.0](https://github.com/KhronosGroup/glTF/tree/main/specification/1.0#reference-node) asset.\n * Some types are combined. For example, the top-level dictionaries in glTF 1.0 are objects, while in glTF 2.0 they are arrays; the GltfDictionary interface supports accessing\n * items using either strings or numeric indexes represented by [[GltfId]].\n * For types that differ significantly between the two specs, Gltf1* and Gltf2* versions are defined (e.g., GltfMaterial is a union of Gltf1Material and Gltf2Material).\n * These interfaces also accommodate some deviations from both specs that are known to exist in the wild.\n * Most aspects of the specifications that are not implemented here are omitted (e.g., skinning, animations).\n * @internal\n */\nexport interface GltfDocument extends GltfProperty {\n /** Metadata about the glTF asset.\n * @note This property is required in glTF 2.0, but optional in 1.0.\n */\n asset?: GltfAsset;\n /** The Id of the default [[GltfScene]] in [[scenes]]. */\n scene?: GltfId;\n extensions?: GltfExtensions & {\n /** The [CESIUM_RTC extension](https://github.com/KhronosGroup/glTF/blob/main/extensions/1.0/Vendor/CESIUM_RTC/README.md) defines a centroid\n * relative to which all coordinates in the asset are defined, to reduce floating-point precision errors for large coordinates.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n CESIUM_RTC?: {\n center?: number[];\n };\n /** The [KHR_techniques_webgl extension](https://github.com/KhronosGroup/glTF/blob/c1c12bd100e88ff468ccef1cb88cfbec56a69af2/extensions/2.0/Khronos/KHR_techniques_webgl/README.md)\n * allows \"techniques\" to be associated with [[GltfMaterial]]s. Techniques can supply custom shader programs to render geometry; this was a core feature of glTF 1.0 (see [[GltfTechnique]]).\n * Here, it is only used to extract uniform values.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n KHR_techniques_webgl?: {\n techniques?: Array<{\n uniforms?: {\n [key: string]: { type: GltfDataType, value?: any } | undefined;\n };\n }>;\n };\n // eslint-disable-next-line @typescript-eslint/naming-convention\n EXT_structural_metadata?: GltfStructuralMetadata.Extension;\n };\n /** Names of glTF extensions used in the asset. */\n extensionsUsed?: string[];\n /** Names of glTF extensions required to properly load the asset. */\n extensionsRequired?: string[];\n accessors?: GltfDictionary<GltfAccessor>;\n /** Not currently supported. */\n animations?: GltfDictionary<any>;\n buffers?: GltfDictionary<GltfBuffer>;\n bufferViews?: GltfDictionary<GltfBufferViewProps>;\n /** Not currently used. */\n cameras?: GltfDictionary<any>;\n images?: GltfDictionary<GltfImage>;\n materials?: GltfDictionary<GltfMaterial>;\n meshes?: GltfDictionary<GltfMesh>;\n nodes?: GltfDictionary<GltfNode>;\n samplers?: GltfDictionary<GltfSampler>;\n scenes?: GltfDictionary<GltfScene>;\n /** Not currently supported. */\n skins?: GltfDictionary<any>;\n textures?: GltfDictionary<GltfTexture>;\n /** For glTF 1.0 only, techniques associated with [[Gltf1Material]]s. */\n techniques?: GltfDictionary<GltfTechnique>;\n}\n"]}
|
|
@@ -77,16 +77,16 @@ var FeatureSymbology;
|
|
|
77
77
|
* @internal
|
|
78
78
|
*/
|
|
79
79
|
initFromViewport(viewport) {
|
|
80
|
-
|
|
81
|
-
this._initFromView(view);
|
|
80
|
+
// Set the initial always/never-drawn sets. Later, initFromView can add more elements to them.
|
|
82
81
|
if (undefined !== viewport.neverDrawn)
|
|
83
82
|
this.setNeverDrawnSet(viewport.neverDrawn);
|
|
84
83
|
if (undefined !== viewport.alwaysDrawn)
|
|
85
84
|
this.setAlwaysDrawnSet(viewport.alwaysDrawn, viewport.isAlwaysDrawnExclusive);
|
|
85
|
+
this._initFromView(viewport.view);
|
|
86
86
|
viewport.addFeatureOverrides(this);
|
|
87
87
|
viewport.addModelSubCategoryVisibilityOverrides(this, this._modelSubCategoryOverrides);
|
|
88
88
|
// This will include any per-model subcategory visibility overrides added above.
|
|
89
|
-
this._initSubCategoryOverrides(view);
|
|
89
|
+
this._initSubCategoryOverrides(viewport.view);
|
|
90
90
|
}
|
|
91
91
|
_initFromView(view) {
|
|
92
92
|
const { viewFlags } = view;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureSymbology.js","sourceRoot":"","sources":["../../../src/render/FeatureSymbology.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,oDAAyE;AACzE,0CAAuC;AAGvC,+BAA+B;AAE/B;;;GAGG;AACH,IAAiB,gBAAgB,CA0LhC;AA1LD,WAAiB,gBAAgB;IAkB/B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAa,SAAU,SAAQ,8BAAgB;QAG7C,aAAa;QACb,IAAW,MAAM;YACf,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;QAED;;WAEG;QACH,YAAmB,IAA2B;YAC5C,KAAK,EAAE,CAAC;YACR,IAAI,SAAS,KAAK,IAA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AAgB,gCAAhB,gBAAgB,QA0LhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { BeEvent, Id64 } from \"@itwin/core-bentley\";\nimport { FeatureAppearance, FeatureOverrides } from \"@itwin/core-common\";\nimport { Viewport } from \"../Viewport\";\nimport { ViewState } from \"../ViewState\";\n\n// cspell:ignore subcat subcats\n\n/** Contains types that enable an application to customize how [Feature]($common)s are drawn within a [[Viewport]].\n * @public\n * @extensions\n */\nexport namespace FeatureSymbology {\n /** An object that serves as the source of a [[FeatureSymbology.Overrides]].\n * Use this if you are drawing the same tiles into a single Viewport and overriding the FeatureSymbology.Overrides applied to them\n * by settings [[GraphicBranch.symbologyOverrides]].\n * Each tile will have a separate set of feature overrides per combination of Source and Viewport. This prevents the display system\n * from constantly recomputing the feature overrides for a tile.\n * You must call `onSourceDisposed.raiseEvent()` when the source is no longer being used by the Viewport to allow the feature overrides\n * and their WebGL resources to be freed - failure to do so will result in memory leaks, which may eventually produce WebGL context loss.\n * @alpha\n */\n export interface Source {\n /** An event raised when this source becomes disassociated with the viewport, indicating any WebGL resources allocated for it\n * can be freed.\n * Failure to invoke this event appropriately will result in memory leaks, which may eventually produce WebGL context loss.\n */\n readonly onSourceDisposed: BeEvent<() => void>;\n }\n\n /** Allows a [[Viewport]] to customize the appearance of individual [Feature]($common)s within it.\n *\n * The Viewport computes its base Overrides based on the following:\n * - The set of categories enabled for display in its [[CategorySelectorState]]. Every [[SubCategory]] belonging to an enabled [[Category]] is added to the set of visible subcategories - all other subcategories are assumed to be invisible.\n * - For the set of visible subcategories, any [[SubCategoryOverride]]s defined by the view's [[DisplayStyleState]] are applied. This may render some subcategories invisible, and change the symbology of others.\n * - The visibility of each [GeometryClass]($common) is set based on the view's [ViewFlags]($common).\n * - The line weight is overridden to 1 pixel for all Features if line weight has been disabled by the view's [ViewFlags]($common).\n * - The sets of elements which are always drawn and never drawn are initialized from the [[Viewport]]'s sets.\n * An application can further customize the symbology of any Features by registering a [[FeatureOverrideProvider]] with a [[Viewport]]. That provider's addFeatureOverrides function will be invoked\n * whenever the Overrides need to be regenerated.\n *\n * To override the symbology of *most* Features within a view, specify a `defaultOverrides` to be applied to any Feature not explicitly overridden.\n * If default overrides are defined and some Features should draw normally without being affected by the default overrides, override that Feature with\n * an Appearance which defines no overrides.\n *\n * It is possible to override multiple aspects of a Feature. For example, you might specify that all elements belonging to subcategory \"A\" should be drawn in red, and\n * that the element with Id \"0x123\" should be drawn with 0.25 transparency. In this case, when drawing a Feature with subcategory \"A\" and element Id \"0x123\", the two overrides will\n * be merged, causing the Feature's geometry to draw 25% transparent red. On the other hand, if subcategory \"A\" is specified to draw in red and element \"0x123\" to draw in green,\n * the color specified by the element override will take precedence over that specified for the subcategory, resulting in a green Feature.\n *\n * @see [[Viewport.alwaysDrawn]]\n * @see [[Viewport.neverDrawn]]\n */\n export class Overrides extends FeatureOverrides {\n private _source?: Source;\n\n /** @alpha */\n public get source(): Source | undefined {\n return this._source;\n }\n\n /** Construct a new Overrides. The result is an empty set of overrides if no view or viewport is supplied.\n * @param view If supplied, the overrides will be initialized based on the current state of the view or viewport.\n */\n public constructor(view?: ViewState | Viewport) {\n super();\n if (undefined !== view) {\n if (view instanceof Viewport)\n this.initFromViewport(view);\n else\n this.initFromView(view);\n }\n }\n\n /** Create symbology overrides associated with a [[FeatureSymbology.Source]].\n * @alpha\n */\n public static withSource(source: Source, view?: ViewState | Viewport): Overrides {\n const ovrs = new Overrides(view);\n ovrs._source = source;\n return ovrs;\n }\n\n /** Initialize these Overrides based on a specific view.\n * @internal\n */\n public initFromView(view: ViewState): void {\n this._initFromView(view);\n this._initSubCategoryOverrides(view);\n }\n\n /** Initialize these Overrides based on a specific viewport.\n * @internal\n */\n public initFromViewport(viewport: Viewport): void {\n const view = viewport.view;\n this._initFromView(view);\n\n if (undefined !== viewport.neverDrawn)\n this.setNeverDrawnSet(viewport.neverDrawn);\n\n if (undefined !== viewport.alwaysDrawn)\n this.setAlwaysDrawnSet(viewport.alwaysDrawn, viewport.isAlwaysDrawnExclusive);\n\n viewport.addFeatureOverrides(this);\n viewport.addModelSubCategoryVisibilityOverrides(this, this._modelSubCategoryOverrides);\n\n // This will include any per-model subcategory visibility overrides added above.\n this._initSubCategoryOverrides(view);\n }\n\n private _initFromView(view: ViewState): void {\n const { viewFlags } = view;\n const { constructions, dimensions, patterns } = viewFlags;\n\n this.neverDrawnAnimationNodes.clear();\n this.animationNodeOverrides.clear();\n\n for (const excluded of view.displayStyle.settings.excludedElementIds)\n this.setNeverDrawn(excluded);\n\n this._constructions = constructions;\n this._dimensions = dimensions;\n this._patterns = patterns;\n this._lineWeights = viewFlags.weights;\n\n for (const categoryId of view.categorySelector.categories) {\n const subCategoryIds = view.iModel.subcategories.getSubCategories(categoryId);\n if (undefined === subCategoryIds)\n continue;\n\n for (const subCategoryId of subCategoryIds) {\n if (view.isSubCategoryVisible(subCategoryId)) {\n const idLo = Id64.getLowerUint32(subCategoryId);\n const idHi = Id64.getUpperUint32(subCategoryId);\n this._visibleSubCategories.add(idLo, idHi);\n\n const app = view.iModel.subcategories.getSubCategoryAppearance(subCategoryId);\n if (undefined !== app)\n this._subCategoryPriorities.set(idLo, idHi, app.priority);\n }\n }\n }\n const style = view.displayStyle;\n style.settings.modelAppearanceOverrides.forEach((appearance, modelId) => this.override({ modelId, appearance, onConflict: \"skip\" }));\n\n style.forEachRealityModel((realityModel) => {\n if (realityModel.appearanceOverrides && realityModel.modelId)\n this.override({ modelId: realityModel.modelId, appearance: realityModel.appearanceOverrides });\n });\n\n const script = style.scheduleScript;\n if (script)\n script.addSymbologyOverrides(this, style.settings.timePoint ?? 0);\n\n if (!view.is3d())\n return;\n\n const planProjectionSettings = view.getDisplayStyle3d().settings.planProjectionSettings;\n if (undefined === planProjectionSettings)\n return;\n\n for (const [modelId, projSettings] of planProjectionSettings) {\n if (undefined !== projSettings.transparency)\n this.override({ modelId, appearance: FeatureAppearance.fromJSON({ transparency: projSettings.transparency }) });\n }\n }\n\n private _initSubCategoryOverrides(view: ViewState): void {\n const addOverride = (idLo: number, idHi: number) => {\n const subCategoryId = Id64.fromUint32Pair(idLo, idHi);\n const ovr = view.getSubCategoryOverride(subCategoryId);\n if (undefined !== ovr) {\n const app = FeatureAppearance.fromSubCategoryOverride(ovr);\n if (app.overridesSymbology)\n this._subCategoryOverrides.set(idLo, idHi, app);\n\n if (undefined !== ovr.priority)\n this._subCategoryPriorities.set(idLo, idHi, ovr.priority);\n }\n };\n\n // Add overrides for all subcategories visible in the view\n this._visibleSubCategories.forEach((idLo: number, idHi: number) => {\n addOverride(idLo, idHi);\n });\n\n // Add overrides for all subcategories overridden to be visible in specific models\n this._modelSubCategoryOverrides.forEach((_modelIdLo: number, _modelIdHi: number, subcats: Id64.Uint32Set) => {\n subcats.forEach((idLo: number, idHi: number) => {\n if (!this.isSubCategoryVisible(idLo, idHi)) {\n // Overridden to be visible in one or more models - will need the appearance overrides\n addOverride(idLo, idHi);\n }\n });\n });\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"FeatureSymbology.js","sourceRoot":"","sources":["../../../src/render/FeatureSymbology.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAoD;AACpD,oDAAyE;AACzE,0CAAuC;AAGvC,+BAA+B;AAE/B;;;GAGG;AACH,IAAiB,gBAAgB,CA0LhC;AA1LD,WAAiB,gBAAgB;IAkB/B;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,MAAa,SAAU,SAAQ,8BAAgB;QAG7C,aAAa;QACb,IAAW,MAAM;YACf,OAAO,IAAI,CAAC,OAAO,CAAC;QACtB,CAAC;QAED;;WAEG;QACH,YAAmB,IAA2B;YAC5C,KAAK,EAAE,CAAC;YACR,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC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QA0LhC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Rendering\n */\n\nimport { BeEvent, Id64 } from \"@itwin/core-bentley\";\nimport { FeatureAppearance, FeatureOverrides } from \"@itwin/core-common\";\nimport { Viewport } from \"../Viewport\";\nimport { ViewState } from \"../ViewState\";\n\n// cspell:ignore subcat subcats\n\n/** Contains types that enable an application to customize how [Feature]($common)s are drawn within a [[Viewport]].\n * @public\n * @extensions\n */\nexport namespace FeatureSymbology {\n /** An object that serves as the source of a [[FeatureSymbology.Overrides]].\n * Use this if you are drawing the same tiles into a single Viewport and overriding the FeatureSymbology.Overrides applied to them\n * by settings [[GraphicBranch.symbologyOverrides]].\n * Each tile will have a separate set of feature overrides per combination of Source and Viewport. This prevents the display system\n * from constantly recomputing the feature overrides for a tile.\n * You must call `onSourceDisposed.raiseEvent()` when the source is no longer being used by the Viewport to allow the feature overrides\n * and their WebGL resources to be freed - failure to do so will result in memory leaks, which may eventually produce WebGL context loss.\n * @alpha\n */\n export interface Source {\n /** An event raised when this source becomes disassociated with the viewport, indicating any WebGL resources allocated for it\n * can be freed.\n * Failure to invoke this event appropriately will result in memory leaks, which may eventually produce WebGL context loss.\n */\n readonly onSourceDisposed: BeEvent<() => void>;\n }\n\n /** Allows a [[Viewport]] to customize the appearance of individual [Feature]($common)s within it.\n *\n * The Viewport computes its base Overrides based on the following:\n * - The set of categories enabled for display in its [[CategorySelectorState]]. Every [[SubCategory]] belonging to an enabled [[Category]] is added to the set of visible subcategories - all other subcategories are assumed to be invisible.\n * - For the set of visible subcategories, any [[SubCategoryOverride]]s defined by the view's [[DisplayStyleState]] are applied. This may render some subcategories invisible, and change the symbology of others.\n * - The visibility of each [GeometryClass]($common) is set based on the view's [ViewFlags]($common).\n * - The line weight is overridden to 1 pixel for all Features if line weight has been disabled by the view's [ViewFlags]($common).\n * - The sets of elements which are always drawn and never drawn are initialized from the [[Viewport]]'s sets.\n * An application can further customize the symbology of any Features by registering a [[FeatureOverrideProvider]] with a [[Viewport]]. That provider's addFeatureOverrides function will be invoked\n * whenever the Overrides need to be regenerated.\n *\n * To override the symbology of *most* Features within a view, specify a `defaultOverrides` to be applied to any Feature not explicitly overridden.\n * If default overrides are defined and some Features should draw normally without being affected by the default overrides, override that Feature with\n * an Appearance which defines no overrides.\n *\n * It is possible to override multiple aspects of a Feature. For example, you might specify that all elements belonging to subcategory \"A\" should be drawn in red, and\n * that the element with Id \"0x123\" should be drawn with 0.25 transparency. In this case, when drawing a Feature with subcategory \"A\" and element Id \"0x123\", the two overrides will\n * be merged, causing the Feature's geometry to draw 25% transparent red. On the other hand, if subcategory \"A\" is specified to draw in red and element \"0x123\" to draw in green,\n * the color specified by the element override will take precedence over that specified for the subcategory, resulting in a green Feature.\n *\n * @see [[Viewport.alwaysDrawn]]\n * @see [[Viewport.neverDrawn]]\n */\n export class Overrides extends FeatureOverrides {\n private _source?: Source;\n\n /** @alpha */\n public get source(): Source | undefined {\n return this._source;\n }\n\n /** Construct a new Overrides. The result is an empty set of overrides if no view or viewport is supplied.\n * @param view If supplied, the overrides will be initialized based on the current state of the view or viewport.\n */\n public constructor(view?: ViewState | Viewport) {\n super();\n if (undefined !== view) {\n if (view instanceof Viewport)\n this.initFromViewport(view);\n else\n this.initFromView(view);\n }\n }\n\n /** Create symbology overrides associated with a [[FeatureSymbology.Source]].\n * @alpha\n */\n public static withSource(source: Source, view?: ViewState | Viewport): Overrides {\n const ovrs = new Overrides(view);\n ovrs._source = source;\n return ovrs;\n }\n\n /** Initialize these Overrides based on a specific view.\n * @internal\n */\n public initFromView(view: ViewState): void {\n this._initFromView(view);\n this._initSubCategoryOverrides(view);\n }\n\n /** Initialize these Overrides based on a specific viewport.\n * @internal\n */\n public initFromViewport(viewport: Viewport): void {\n // Set the initial always/never-drawn sets. Later, initFromView can add more elements to them.\n if (undefined !== viewport.neverDrawn)\n this.setNeverDrawnSet(viewport.neverDrawn);\n\n if (undefined !== viewport.alwaysDrawn)\n this.setAlwaysDrawnSet(viewport.alwaysDrawn, viewport.isAlwaysDrawnExclusive);\n\n this._initFromView(viewport.view);\n\n viewport.addFeatureOverrides(this);\n viewport.addModelSubCategoryVisibilityOverrides(this, this._modelSubCategoryOverrides);\n\n // This will include any per-model subcategory visibility overrides added above.\n this._initSubCategoryOverrides(viewport.view);\n }\n\n private _initFromView(view: ViewState): void {\n const { viewFlags } = view;\n const { constructions, dimensions, patterns } = viewFlags;\n\n this.neverDrawnAnimationNodes.clear();\n this.animationNodeOverrides.clear();\n\n for (const excluded of view.displayStyle.settings.excludedElementIds)\n this.setNeverDrawn(excluded);\n\n this._constructions = constructions;\n this._dimensions = dimensions;\n this._patterns = patterns;\n this._lineWeights = viewFlags.weights;\n\n for (const categoryId of view.categorySelector.categories) {\n const subCategoryIds = view.iModel.subcategories.getSubCategories(categoryId);\n if (undefined === subCategoryIds)\n continue;\n\n for (const subCategoryId of subCategoryIds) {\n if (view.isSubCategoryVisible(subCategoryId)) {\n const idLo = Id64.getLowerUint32(subCategoryId);\n const idHi = Id64.getUpperUint32(subCategoryId);\n this._visibleSubCategories.add(idLo, idHi);\n\n const app = view.iModel.subcategories.getSubCategoryAppearance(subCategoryId);\n if (undefined !== app)\n this._subCategoryPriorities.set(idLo, idHi, app.priority);\n }\n }\n }\n const style = view.displayStyle;\n style.settings.modelAppearanceOverrides.forEach((appearance, modelId) => this.override({ modelId, appearance, onConflict: \"skip\" }));\n\n style.forEachRealityModel((realityModel) => {\n if (realityModel.appearanceOverrides && realityModel.modelId)\n this.override({ modelId: realityModel.modelId, appearance: realityModel.appearanceOverrides });\n });\n\n const script = style.scheduleScript;\n if (script)\n script.addSymbologyOverrides(this, style.settings.timePoint ?? 0);\n\n if (!view.is3d())\n return;\n\n const planProjectionSettings = view.getDisplayStyle3d().settings.planProjectionSettings;\n if (undefined === planProjectionSettings)\n return;\n\n for (const [modelId, projSettings] of planProjectionSettings) {\n if (undefined !== projSettings.transparency)\n this.override({ modelId, appearance: FeatureAppearance.fromJSON({ transparency: projSettings.transparency }) });\n }\n }\n\n private _initSubCategoryOverrides(view: ViewState): void {\n const addOverride = (idLo: number, idHi: number) => {\n const subCategoryId = Id64.fromUint32Pair(idLo, idHi);\n const ovr = view.getSubCategoryOverride(subCategoryId);\n if (undefined !== ovr) {\n const app = FeatureAppearance.fromSubCategoryOverride(ovr);\n if (app.overridesSymbology)\n this._subCategoryOverrides.set(idLo, idHi, app);\n\n if (undefined !== ovr.priority)\n this._subCategoryPriorities.set(idLo, idHi, ovr.priority);\n }\n };\n\n // Add overrides for all subcategories visible in the view\n this._visibleSubCategories.forEach((idLo: number, idHi: number) => {\n addOverride(idLo, idHi);\n });\n\n // Add overrides for all subcategories overridden to be visible in specific models\n this._modelSubCategoryOverrides.forEach((_modelIdLo: number, _modelIdHi: number, subcats: Id64.Uint32Set) => {\n subcats.forEach((idLo: number, idHi: number) => {\n if (!this.isSubCategoryVisible(idLo, idHi)) {\n // Overridden to be visible in one or more models - will need the appearance overrides\n addOverride(idLo, idHi);\n }\n });\n });\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AmbientOcclusion.js","sourceRoot":"","sources":["../../../../../src/render/webgl/glsl/AmbientOcclusion.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAKH,gDAA6C;AAG7C,sCAAmC;AACnC,wCAA6C;AAC7C,qCAAsC;AACtC,qCAA0C;AAC1C,yDAAgF;AAChF,yCAAmE;AACnE,yCAAyC;AACzC,iDAA2D;AAE3D,0EAA0E;AAC1E,4FAA4F;AAE5F,MAAM,+BAA+B,GAAG;;;;CAIvC,CAAC;AAEF,MAAM,+BAA+B,GAAG;;;;CAIvC,CAAC;AAEF,0EAA0E;AAC1E,yFAAyF;AACzF,wGAAwG;AACxG,MAAM,uBAAuB,GAAG;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AC,CAAC,CAAC;IAEH,IAAI,CAAC,UAAU,CAAC,gBAAgB,6BAAqB,CAAC,IAAI,EAAE,EAAE;QAC5D,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3D,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC;gBACpC,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAI;gBAC3C,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,UAAU;gBACjD,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,SAAS;gBAChD,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,aAAa;aAAC,CAAC,CAAC;YACzD,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC,iCAAyB,CAAC;IAE3B,IAAI,CAAC,UAAU,CAAC,eAAe,8BAAsB,CAAC,IAAI,EAAE,EAAE;QAC5D,IAAI,CAAC,iBAAiB,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1D,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;IACL,CAAC,iCAAyB,CAAC;IAE3B,OAAO,CAAC,IAAI,CAAC,aAAa,GAAG,wBAAwB,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,aAAa,GAAG,wBAAwB,CAAC;IAEtD,OAAO,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AA/FD,sEA+FC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module WebGL\n */\n\n// portions adapted from Cesium.js Copyright 2011 - 2017 Cesium Contributors\n\nimport { AmbientOcclusionGeometry } from \"../CachedGeometry\";\nimport { TextureUnit } from \"../RenderFlags\";\nimport { FragmentShaderComponent, VariablePrecision, VariableType } from \"../ShaderBuilder\";\nimport { ShaderProgram } from \"../ShaderProgram\";\nimport { System } from \"../System\";\nimport { Texture2DHandle } from \"../Texture\";\nimport { addFrustum } from \"./Common\";\nimport { decodeDepthRgb } from \"./Decode\";\nimport { addRenderOrderConstants, readDepthAndOrder } from \"./FeatureSymbology\";\nimport { addWindowToTexCoords, assignFragColor } from \"./Fragment\";\nimport { addViewport } from \"./Viewport\";\nimport { createViewportQuadBuilder } from \"./ViewportQuad\";\n\n// 'PB' indicates a shader variation when only the pickbuffer is available\n// 'DB' indicates a shader variation when the real floating point depth buffer is available.\n\nconst computeAmbientOcclusionPrefixPB = `\nvec2 tc = windowCoordsToTexCoords(gl_FragCoord.xy);\nvec2 depthAndOrder = readDepthAndOrder(tc);\nfloat db = depthAndOrder.y;\n`;\n\nconst computeAmbientOcclusionPrefixDB = `\nvec2 tc = windowCoordsToTexCoords(gl_FragCoord.xy);\nvec2 depthAndOrder = readDepthAndOrder(tc);\nfloat db = readDepth(tc);\n`;\n\n// This outputs 1 for unlit surfaces, and for polylines and point strings.\n// Otherwise it computes ambient occlusion based on normal reconstructed from pick depth.\n// NB: This shader code actually begins with a `computeAmbientOcclusionPrefix` variation as shown above.\nconst computeAmbientOcclusion = `\n depthAndOrder.y = unfinalizeLinearDepth(db);\n float order = depthAndOrder.x;\n if (order >= kRenderOrder_PlanarBit)\n order = order - kRenderOrder_PlanarBit;\n\n if (order < kRenderOrder_LitSurface || order == kRenderOrder_Linear)\n return vec4(1.0);\n\n // NB: linearDepth: 1 == near, 0 == far\n\n float linearDepth = depthAndOrder.y;\n float nonLinearDepth = computeNonLinearDepth(db);\n if (nonLinearDepth > u_maxDistance)\n return vec4(1.0);\n\n vec3 viewPos = computePositionFromDepth(tc, nonLinearDepth).xyz;\n\n vec2 pixelSize = 1.0 / u_viewport;\n vec3 viewNormal = computeNormalFromDepth(viewPos, tc, pixelSize);\n\n vec2 sampleDirection = vec2(1.0, 0.0);\n float gapAngle = 90.0 * 0.017453292519943295; // radians per degree\n\n // Grab some random noise\n // Multiply screen UV (range 0..1) with size of viewport divided by 4 in order to tile the 4x4 noise texture across the screen.\n // Multiply the random 0..1 vec3 by 2 and then substract 1. This puts the components of the vec3 in the range -1..1.\n vec3 noiseVec = (TEXTURE(u_noise, tc * vec2(u_viewport.x / 4.0, u_viewport.y / 4.0)).rgb + 1.0) / 2.0;\n\n float bias = u_hbaoSettings.x; // Represents an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value, sampling stops in the current direction. This is used to remove shadows from near planar edges.\n float zLengthCap = u_hbaoSettings.y; // If the distance in linear Z from the current sample to first sample is greater than this value, sampling stops in the current direction.\n float intensity = u_hbaoSettings.z; // Raise the final occlusion to the power of this value. Larger values make the ambient shadows darker.\n float texelStepSize = clamp(u_hbaoSettings.w * linearDepth, 1.0, u_hbaoSettings.w); // Indicates the distance to step toward the next texel sample in the current direction.\n\n float tOcclusion = 0.0;\n\n // loop for each direction\n for (int i = 0; i < 4; i++) {\n float newGapAngle = gapAngle * (float(i) + noiseVec.x);\n float cosVal = cos(newGapAngle);\n float sinVal = sin(newGapAngle);\n\n // rotate sampling direction\n vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);\n float curOcclusion = 0.0;\n float curStepSize = texelStepSize; // 1.0 = stepsize, StepSize should be specified by uniform - what are good values?\n\n // loop for each step\n for (int j = 0; j < 6; j++) {\n vec2 directionWithStep = vec2(rotatedSampleDirection.x * curStepSize * pixelSize.x, rotatedSampleDirection.y * curStepSize * pixelSize.y);\n vec2 newCoords = directionWithStep + tc;\n\n // do not repeat around the depth texture\n if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0) {\n break;\n }\n\n db = readDepth(newCoords);\n float curLinearDepth = unfinalizeLinearDepth(db);\n float curNonLinearDepth = computeNonLinearDepth(db);\n vec3 curViewPos = computePositionFromDepth(newCoords, curNonLinearDepth).xyz;\n vec3 diffVec = curViewPos.xyz - viewPos.xyz;\n float zLength = abs(curLinearDepth - linearDepth);\n\n float dotVal = clamp(dot(viewNormal, normalize(diffVec)), 0.0, 1.0);\n float weight = smoothstep(0.0, 1.0, zLengthCap / zLength);\n\n if (dotVal < bias) {\n dotVal = 0.0;\n }\n\n curOcclusion = max(curOcclusion, dotVal * weight);\n curStepSize += texelStepSize;\n }\n tOcclusion += curOcclusion;\n }\n\n float distanceFadeFactor = kFrustumType_Perspective == u_frustum.z ? 1.0 - pow(clamp(nonLinearDepth / u_maxDistance, 0.0, 1.0), 4.0) : 1.0;\n tOcclusion *= distanceFadeFactor;\n\n tOcclusion /= 4.0;\n tOcclusion = 1.0 - clamp(tOcclusion, 0.0, 1.0);\n tOcclusion = pow(tOcclusion, intensity);\n\n return vec4(tOcclusion, tOcclusion, tOcclusion, 1.0);\n`;\n\nconst computePositionFromDepth = `\nvec4 computePositionFromDepth(vec2 tc, float nonLinearDepth) {\n if (kFrustumType_Perspective == u_frustum.z) {\n vec2 xy = vec2((tc.x * 2.0 - 1.0), ((1.0 - tc.y) * 2.0 - 1.0));\n vec4 posEC = u_invProj * vec4(xy, nonLinearDepth, 1.0);\n posEC = posEC / posEC.w;\n return posEC;\n } else {\n float top = u_frustumPlanes.x;\n float bottom = u_frustumPlanes.y;\n float left = u_frustumPlanes.z;\n float right = u_frustumPlanes.w;\n return vec4(mix(left, right, tc.x), mix(bottom, top, tc.y), nonLinearDepth, 1.0);\n }\n}\n`;\n\nconst computeNormalFromDepth = `\nvec3 computeNormalFromDepth(vec3 viewPos, vec2 tc, vec2 pixelSize) {\n float nonLinearDepthU = computeNonLinearDepth(readDepth(tc - vec2(0.0, pixelSize.y)));\n float nonLinearDepthD = computeNonLinearDepth(readDepth(tc + vec2(0.0, pixelSize.y)));\n float nonLinearDepthL = computeNonLinearDepth(readDepth(tc - vec2(pixelSize.x, 0.0)));\n float nonLinearDepthR = computeNonLinearDepth(readDepth(tc + vec2(pixelSize.x, 0.0)));\n\n vec3 viewPosUp = computePositionFromDepth(tc - vec2(0.0, pixelSize.y), nonLinearDepthU).xyz;\n vec3 viewPosDown = computePositionFromDepth(tc + vec2(0.0, pixelSize.y), nonLinearDepthD).xyz;\n vec3 viewPosLeft = computePositionFromDepth(tc - vec2(pixelSize.x, 0.0), nonLinearDepthL).xyz;\n vec3 viewPosRight = computePositionFromDepth(tc + vec2(pixelSize.x, 0.0), nonLinearDepthR).xyz;\n\n vec3 up = viewPos.xyz - viewPosUp.xyz;\n vec3 down = viewPosDown.xyz - viewPos.xyz;\n vec3 left = viewPos.xyz - viewPosLeft.xyz;\n vec3 right = viewPosRight.xyz - viewPos.xyz;\n\n vec3 dx = length(left) < length(right) ? left : right;\n vec3 dy = length(up) < length(down) ? up : down;\n\n return normalize(cross(dy, dx));\n}\n`;\n\nconst computeNonLinearDepthPB = `\nfloat computeNonLinearDepth(float linearDepth) {\n return mix(u_frustum.y, u_frustum.x, linearDepth);\n}\n`;\nconst computeNonLinearDepthDB = `\nfloat computeNonLinearDepth(float depth) {\n return 0.0 == u_logZ.x ? depth * u_logZ.y : exp(depth * u_logZ.y) / u_logZ.x;\n}\n`;\n\nconst readDepthPB = `\nfloat readDepth(vec2 tc) {\n return readDepthAndOrder(tc).y;\n}\n`;\nconst readDepthDB = `\nfloat readDepth(vec2 tc) {\n return TEXTURE(u_depthBuffer, tc).r;\n}\n`;\nconst unfinalizeLinearDepthDB = `\n float unfinalizeLinearDepth(float depth) {\n float eyeZ = 0.0 == u_logZ.x ? depth * u_logZ.y : exp(depth * u_logZ.y) / u_logZ.x;\n float near = u_frustum.x, far = u_frustum.y;\n float depthRange = far - near;\n float linearDepth = (eyeZ - near) / depthRange;\n return 1.0 - linearDepth;\n }\n`;\n\nfunction _shouldUseDB() {\n return System.instance.supportsLogZBuffer;\n}\n\n/** @internal */\nexport function createAmbientOcclusionProgram(context: WebGL2RenderingContext): ShaderProgram {\n const builder = createViewportQuadBuilder(true);\n const frag = builder.frag;\n const shouldUseDB = _shouldUseDB();\n\n addWindowToTexCoords(frag);\n frag.addFunction(decodeDepthRgb);\n frag.addFunction(readDepthAndOrder);\n\n if (shouldUseDB) {\n frag.addFunction(unfinalizeLinearDepthDB);\n frag.addFunction(computeNonLinearDepthDB);\n frag.addFunction(readDepthDB);\n } else {\n frag.addDefine(\"unfinalizeLinearDepth\", \"\");\n frag.addFunction(computeNonLinearDepthPB);\n frag.addFunction(readDepthPB);\n }\n\n frag.addFunction(computePositionFromDepth);\n frag.addFunction(computeNormalFromDepth);\n addRenderOrderConstants(frag);\n\n if (shouldUseDB)\n frag.addUniform(\"u_logZ\", VariableType.Vec2, (prog) => {\n prog.addProgramUniform(\"u_logZ\", (uniform, params) => {\n uniform.setUniform2fv(params.target.uniforms.frustum.logZ);\n });\n });\n\n frag.set(FragmentShaderComponent.ComputeBaseColor, shouldUseDB ?\n computeAmbientOcclusionPrefixDB + computeAmbientOcclusion :\n computeAmbientOcclusionPrefixPB + computeAmbientOcclusion);\n frag.set(FragmentShaderComponent.AssignFragData, assignFragColor);\n\n frag.addUniform(\"u_pickDepthAndOrder\", VariableType.Sampler2D, (prog) => {\n prog.addGraphicUniform(\"u_pickDepthAndOrder\", (uniform, params) => {\n const geom = params.geometry as AmbientOcclusionGeometry;\n Texture2DHandle.bindSampler(uniform, geom.depthAndOrder, TextureUnit.Zero);\n });\n });\n\n if (shouldUseDB)\n frag.addUniform(\"u_depthBuffer\", VariableType.Sampler2D, (prog) => {\n prog.addGraphicUniform(\"u_depthBuffer\", (uniform, params) => {\n const geom = params.geometry as AmbientOcclusionGeometry;\n Texture2DHandle.bindSampler(uniform, geom.depth, TextureUnit.Two);\n });\n });\n\n frag.addUniform(\"u_noise\", VariableType.Sampler2D, (prog) => {\n prog.addGraphicUniform(\"u_noise\", (uniform, params) => {\n const geom = params.geometry as AmbientOcclusionGeometry;\n Texture2DHandle.bindSampler(uniform, geom.noise, TextureUnit.One);\n });\n });\n\n addFrustum(builder);\n addViewport(frag);\n\n frag.addUniform(\"u_invProj\", VariableType.Mat4, (prog) => {\n prog.addProgramUniform(\"u_invProj\", (uniform, params) => {\n const invProj = params.projectionMatrix.clone();\n invProj.invert();\n uniform.setMatrix4(invProj);\n });\n });\n\n frag.addUniform(\"u_frustumPlanes\", VariableType.Vec4, (prog) => {\n prog.addProgramUniform(\"u_frustumPlanes\", (uniform, params) => {\n uniform.setUniform4fv(params.target.uniforms.frustum.planes);\n });\n });\n\n frag.addUniform(\"u_hbaoSettings\", VariableType.Vec4, (prog) => {\n prog.addProgramUniform(\"u_hbaoSettings\", (uniform, params) => {\n const hbaoSettings = new Float32Array([\n params.target.ambientOcclusionSettings.bias,\n params.target.ambientOcclusionSettings.zLengthCap,\n params.target.ambientOcclusionSettings.intensity,\n params.target.ambientOcclusionSettings.texelStepSize]);\n uniform.setUniform4fv(hbaoSettings);\n });\n }, VariablePrecision.High);\n\n frag.addUniform(\"u_maxDistance\", VariableType.Float, (prog) => {\n prog.addProgramUniform(\"u_maxDistance\", (uniform, params) => {\n uniform.setUniform1f(params.target.ambientOcclusionSettings.maxDistance);\n });\n }, VariablePrecision.High);\n\n builder.vert.headerComment = \"//!V! AmbientOcclusion\";\n builder.frag.headerComment = \"//!F! AmbientOcclusion\";\n\n return builder.buildProgram(context);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"AmbientOcclusion.js","sourceRoot":"","sources":["../../../../../src/render/webgl/glsl/AmbientOcclusion.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAKH,gDAA6C;AAG7C,sCAAmC;AACnC,wCAA6C;AAC7C,qCAAsC;AACtC,qCAA0C;AAC1C,yDAAgF;AAChF,yCAAmE;AACnE,yCAAyC;AACzC,iDAA2D;AAE3D,0EAA0E;AAC1E,4FAA4F;AAE5F,MAAM,+BAA+B,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EAAE;YAC5D,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,UAAU,CAAC,gBAAgB,6BAAqB,CAAC,IAAI,EAAE,EAAE;QAC5D,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC3D,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC;gBACpC,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAI;gBAC3C,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,UAAU;gBACjD,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,SAAS;gBAChD,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,aAAa;aAAC,CAAC,CAAC;YACzD,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC,iCAAyB,CAAC;IAE3B,IAAI,CAAC,UAAU,CAAC,eAAe,8BAAsB,CAAC,IAAI,EAAE,EAAE;QAC5D,IAAI,CAAC,iBAAiB,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1D,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,wBAAwB,CAAC,WAAW,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;IACL,CAAC,iCAAyB,CAAC;IAE3B,OAAO,CAAC,IAAI,CAAC,aAAa,GAAG,wBAAwB,CAAC;IACtD,OAAO,CAAC,IAAI,CAAC,aAAa,GAAG,wBAAwB,CAAC;IAEtD,OAAO,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AA/FD,sEA+FC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module WebGL\n */\n\n// portions adapted from Cesium.js Copyright 2011 - 2022 Cesium Contributors\n\nimport { AmbientOcclusionGeometry } from \"../CachedGeometry\";\nimport { TextureUnit } from \"../RenderFlags\";\nimport { FragmentShaderComponent, VariablePrecision, VariableType } from \"../ShaderBuilder\";\nimport { ShaderProgram } from \"../ShaderProgram\";\nimport { System } from \"../System\";\nimport { Texture2DHandle } from \"../Texture\";\nimport { addFrustum } from \"./Common\";\nimport { decodeDepthRgb } from \"./Decode\";\nimport { addRenderOrderConstants, readDepthAndOrder } from \"./FeatureSymbology\";\nimport { addWindowToTexCoords, assignFragColor } from \"./Fragment\";\nimport { addViewport } from \"./Viewport\";\nimport { createViewportQuadBuilder } from \"./ViewportQuad\";\n\n// 'PB' indicates a shader variation when only the pickbuffer is available\n// 'DB' indicates a shader variation when the real floating point depth buffer is available.\n\nconst computeAmbientOcclusionPrefixPB = `\nvec2 tc = windowCoordsToTexCoords(gl_FragCoord.xy);\nvec2 depthAndOrder = readDepthAndOrder(tc);\nfloat db = depthAndOrder.y;\n`;\n\nconst computeAmbientOcclusionPrefixDB = `\nvec2 tc = windowCoordsToTexCoords(gl_FragCoord.xy);\nvec2 depthAndOrder = readDepthAndOrder(tc);\nfloat db = readDepth(tc);\n`;\n\n// This outputs 1 for unlit surfaces, and for polylines and point strings.\n// Otherwise it computes ambient occlusion based on normal reconstructed from pick depth.\n// NB: This shader code actually begins with a `computeAmbientOcclusionPrefix` variation as shown above.\nconst computeAmbientOcclusion = `\n depthAndOrder.y = unfinalizeLinearDepth(db);\n float order = depthAndOrder.x;\n if (order >= kRenderOrder_PlanarBit)\n order = order - kRenderOrder_PlanarBit;\n\n if (order < kRenderOrder_LitSurface || order == kRenderOrder_Linear)\n return vec4(1.0);\n\n // NB: linearDepth: 1 == near, 0 == far\n\n float linearDepth = depthAndOrder.y;\n float nonLinearDepth = computeNonLinearDepth(db);\n if (nonLinearDepth > u_maxDistance)\n return vec4(1.0);\n\n vec3 viewPos = computePositionFromDepth(tc, nonLinearDepth).xyz;\n\n vec2 pixelSize = 1.0 / u_viewport;\n vec3 viewNormal = computeNormalFromDepth(viewPos, tc, pixelSize);\n\n vec2 sampleDirection = vec2(1.0, 0.0);\n float gapAngle = 90.0 * 0.017453292519943295; // radians per degree\n\n // Grab some random noise\n // Multiply screen UV (range 0..1) with size of viewport divided by 4 in order to tile the 4x4 noise texture across the screen.\n // Multiply the random 0..1 vec3 by 2 and then substract 1. This puts the components of the vec3 in the range -1..1.\n vec3 noiseVec = (TEXTURE(u_noise, tc * vec2(u_viewport.x / 4.0, u_viewport.y / 4.0)).rgb + 1.0) / 2.0;\n\n float bias = u_hbaoSettings.x; // Represents an angle in radians. If the dot product between the normal of the sample and the vector to the camera is less than this value, sampling stops in the current direction. This is used to remove shadows from near planar edges.\n float zLengthCap = u_hbaoSettings.y; // If the distance in linear Z from the current sample to first sample is greater than this value, sampling stops in the current direction.\n float intensity = u_hbaoSettings.z; // Raise the final occlusion to the power of this value. Larger values make the ambient shadows darker.\n float texelStepSize = clamp(u_hbaoSettings.w * linearDepth, 1.0, u_hbaoSettings.w); // Indicates the distance to step toward the next texel sample in the current direction.\n\n float tOcclusion = 0.0;\n\n // loop for each direction\n for (int i = 0; i < 4; i++) {\n float newGapAngle = gapAngle * (float(i) + noiseVec.x);\n float cosVal = cos(newGapAngle);\n float sinVal = sin(newGapAngle);\n\n // rotate sampling direction\n vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y);\n float curOcclusion = 0.0;\n float curStepSize = texelStepSize; // 1.0 = stepsize, StepSize should be specified by uniform - what are good values?\n\n // loop for each step\n for (int j = 0; j < 6; j++) {\n vec2 directionWithStep = vec2(rotatedSampleDirection.x * curStepSize * pixelSize.x, rotatedSampleDirection.y * curStepSize * pixelSize.y);\n vec2 newCoords = directionWithStep + tc;\n\n // do not repeat around the depth texture\n if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0) {\n break;\n }\n\n db = readDepth(newCoords);\n float curLinearDepth = unfinalizeLinearDepth(db);\n float curNonLinearDepth = computeNonLinearDepth(db);\n vec3 curViewPos = computePositionFromDepth(newCoords, curNonLinearDepth).xyz;\n vec3 diffVec = curViewPos.xyz - viewPos.xyz;\n float zLength = abs(curLinearDepth - linearDepth);\n\n float dotVal = clamp(dot(viewNormal, normalize(diffVec)), 0.0, 1.0);\n float weight = smoothstep(0.0, 1.0, zLengthCap / zLength);\n\n if (dotVal < bias) {\n dotVal = 0.0;\n }\n\n curOcclusion = max(curOcclusion, dotVal * weight);\n curStepSize += texelStepSize;\n }\n tOcclusion += curOcclusion;\n }\n\n float distanceFadeFactor = kFrustumType_Perspective == u_frustum.z ? 1.0 - pow(clamp(nonLinearDepth / u_maxDistance, 0.0, 1.0), 4.0) : 1.0;\n tOcclusion *= distanceFadeFactor;\n\n tOcclusion /= 4.0;\n tOcclusion = 1.0 - clamp(tOcclusion, 0.0, 1.0);\n tOcclusion = pow(tOcclusion, intensity);\n\n return vec4(tOcclusion, tOcclusion, tOcclusion, 1.0);\n`;\n\nconst computePositionFromDepth = `\nvec4 computePositionFromDepth(vec2 tc, float nonLinearDepth) {\n if (kFrustumType_Perspective == u_frustum.z) {\n vec2 xy = vec2((tc.x * 2.0 - 1.0), ((1.0 - tc.y) * 2.0 - 1.0));\n vec4 posEC = u_invProj * vec4(xy, nonLinearDepth, 1.0);\n posEC = posEC / posEC.w;\n return posEC;\n } else {\n float top = u_frustumPlanes.x;\n float bottom = u_frustumPlanes.y;\n float left = u_frustumPlanes.z;\n float right = u_frustumPlanes.w;\n return vec4(mix(left, right, tc.x), mix(bottom, top, tc.y), nonLinearDepth, 1.0);\n }\n}\n`;\n\nconst computeNormalFromDepth = `\nvec3 computeNormalFromDepth(vec3 viewPos, vec2 tc, vec2 pixelSize) {\n float nonLinearDepthU = computeNonLinearDepth(readDepth(tc - vec2(0.0, pixelSize.y)));\n float nonLinearDepthD = computeNonLinearDepth(readDepth(tc + vec2(0.0, pixelSize.y)));\n float nonLinearDepthL = computeNonLinearDepth(readDepth(tc - vec2(pixelSize.x, 0.0)));\n float nonLinearDepthR = computeNonLinearDepth(readDepth(tc + vec2(pixelSize.x, 0.0)));\n\n vec3 viewPosUp = computePositionFromDepth(tc - vec2(0.0, pixelSize.y), nonLinearDepthU).xyz;\n vec3 viewPosDown = computePositionFromDepth(tc + vec2(0.0, pixelSize.y), nonLinearDepthD).xyz;\n vec3 viewPosLeft = computePositionFromDepth(tc - vec2(pixelSize.x, 0.0), nonLinearDepthL).xyz;\n vec3 viewPosRight = computePositionFromDepth(tc + vec2(pixelSize.x, 0.0), nonLinearDepthR).xyz;\n\n vec3 up = viewPos.xyz - viewPosUp.xyz;\n vec3 down = viewPosDown.xyz - viewPos.xyz;\n vec3 left = viewPos.xyz - viewPosLeft.xyz;\n vec3 right = viewPosRight.xyz - viewPos.xyz;\n\n vec3 dx = length(left) < length(right) ? left : right;\n vec3 dy = length(up) < length(down) ? up : down;\n\n return normalize(cross(dy, dx));\n}\n`;\n\nconst computeNonLinearDepthPB = `\nfloat computeNonLinearDepth(float linearDepth) {\n return mix(u_frustum.y, u_frustum.x, linearDepth);\n}\n`;\nconst computeNonLinearDepthDB = `\nfloat computeNonLinearDepth(float depth) {\n return 0.0 == u_logZ.x ? depth * u_logZ.y : exp(depth * u_logZ.y) / u_logZ.x;\n}\n`;\n\nconst readDepthPB = `\nfloat readDepth(vec2 tc) {\n return readDepthAndOrder(tc).y;\n}\n`;\nconst readDepthDB = `\nfloat readDepth(vec2 tc) {\n return TEXTURE(u_depthBuffer, tc).r;\n}\n`;\nconst unfinalizeLinearDepthDB = `\n float unfinalizeLinearDepth(float depth) {\n float eyeZ = 0.0 == u_logZ.x ? depth * u_logZ.y : exp(depth * u_logZ.y) / u_logZ.x;\n float near = u_frustum.x, far = u_frustum.y;\n float depthRange = far - near;\n float linearDepth = (eyeZ - near) / depthRange;\n return 1.0 - linearDepth;\n }\n`;\n\nfunction _shouldUseDB() {\n return System.instance.supportsLogZBuffer;\n}\n\n/** @internal */\nexport function createAmbientOcclusionProgram(context: WebGL2RenderingContext): ShaderProgram {\n const builder = createViewportQuadBuilder(true);\n const frag = builder.frag;\n const shouldUseDB = _shouldUseDB();\n\n addWindowToTexCoords(frag);\n frag.addFunction(decodeDepthRgb);\n frag.addFunction(readDepthAndOrder);\n\n if (shouldUseDB) {\n frag.addFunction(unfinalizeLinearDepthDB);\n frag.addFunction(computeNonLinearDepthDB);\n frag.addFunction(readDepthDB);\n } else {\n frag.addDefine(\"unfinalizeLinearDepth\", \"\");\n frag.addFunction(computeNonLinearDepthPB);\n frag.addFunction(readDepthPB);\n }\n\n frag.addFunction(computePositionFromDepth);\n frag.addFunction(computeNormalFromDepth);\n addRenderOrderConstants(frag);\n\n if (shouldUseDB)\n frag.addUniform(\"u_logZ\", VariableType.Vec2, (prog) => {\n prog.addProgramUniform(\"u_logZ\", (uniform, params) => {\n uniform.setUniform2fv(params.target.uniforms.frustum.logZ);\n });\n });\n\n frag.set(FragmentShaderComponent.ComputeBaseColor, shouldUseDB ?\n computeAmbientOcclusionPrefixDB + computeAmbientOcclusion :\n computeAmbientOcclusionPrefixPB + computeAmbientOcclusion);\n frag.set(FragmentShaderComponent.AssignFragData, assignFragColor);\n\n frag.addUniform(\"u_pickDepthAndOrder\", VariableType.Sampler2D, (prog) => {\n prog.addGraphicUniform(\"u_pickDepthAndOrder\", (uniform, params) => {\n const geom = params.geometry as AmbientOcclusionGeometry;\n Texture2DHandle.bindSampler(uniform, geom.depthAndOrder, TextureUnit.Zero);\n });\n });\n\n if (shouldUseDB)\n frag.addUniform(\"u_depthBuffer\", VariableType.Sampler2D, (prog) => {\n prog.addGraphicUniform(\"u_depthBuffer\", (uniform, params) => {\n const geom = params.geometry as AmbientOcclusionGeometry;\n Texture2DHandle.bindSampler(uniform, geom.depth, TextureUnit.Two);\n });\n });\n\n frag.addUniform(\"u_noise\", VariableType.Sampler2D, (prog) => {\n prog.addGraphicUniform(\"u_noise\", (uniform, params) => {\n const geom = params.geometry as AmbientOcclusionGeometry;\n Texture2DHandle.bindSampler(uniform, geom.noise, TextureUnit.One);\n });\n });\n\n addFrustum(builder);\n addViewport(frag);\n\n frag.addUniform(\"u_invProj\", VariableType.Mat4, (prog) => {\n prog.addProgramUniform(\"u_invProj\", (uniform, params) => {\n const invProj = params.projectionMatrix.clone();\n invProj.invert();\n uniform.setMatrix4(invProj);\n });\n });\n\n frag.addUniform(\"u_frustumPlanes\", VariableType.Vec4, (prog) => {\n prog.addProgramUniform(\"u_frustumPlanes\", (uniform, params) => {\n uniform.setUniform4fv(params.target.uniforms.frustum.planes);\n });\n });\n\n frag.addUniform(\"u_hbaoSettings\", VariableType.Vec4, (prog) => {\n prog.addProgramUniform(\"u_hbaoSettings\", (uniform, params) => {\n const hbaoSettings = new Float32Array([\n params.target.ambientOcclusionSettings.bias,\n params.target.ambientOcclusionSettings.zLengthCap,\n params.target.ambientOcclusionSettings.intensity,\n params.target.ambientOcclusionSettings.texelStepSize]);\n uniform.setUniform4fv(hbaoSettings);\n });\n }, VariablePrecision.High);\n\n frag.addUniform(\"u_maxDistance\", VariableType.Float, (prog) => {\n prog.addProgramUniform(\"u_maxDistance\", (uniform, params) => {\n uniform.setUniform1f(params.target.ambientOcclusionSettings.maxDistance);\n });\n }, VariablePrecision.High);\n\n builder.vert.headerComment = \"//!V! AmbientOcclusion\";\n builder.frag.headerComment = \"//!F! AmbientOcclusion\";\n\n return builder.buildProgram(context);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"B3dmReader.d.ts","sourceRoot":"","sources":["../../../src/tile/B3dmReader.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAa,MAAM,qBAAqB,CAAC;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