@itwin/core-frontend 3.6.0-dev.14 → 3.6.0-dev.21
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 +9 -1
- package/lib/cjs/render/RealityMeshParams.d.ts.map +1 -1
- package/lib/cjs/render/RealityMeshParams.js +0 -2
- package/lib/cjs/render/RealityMeshParams.js.map +1 -1
- package/lib/cjs/render/webgl/BranchState.d.ts +3 -0
- package/lib/cjs/render/webgl/BranchState.d.ts.map +1 -1
- package/lib/cjs/render/webgl/BranchState.js +5 -0
- package/lib/cjs/render/webgl/BranchState.js.map +1 -1
- package/lib/cjs/render/webgl/DrawCommand.d.ts.map +1 -1
- package/lib/cjs/render/webgl/DrawCommand.js +3 -1
- package/lib/cjs/render/webgl/DrawCommand.js.map +1 -1
- package/lib/cjs/render/webgl/RenderCommands.d.ts +2 -1
- package/lib/cjs/render/webgl/RenderCommands.d.ts.map +1 -1
- package/lib/cjs/render/webgl/RenderCommands.js +15 -7
- package/lib/cjs/render/webgl/RenderCommands.js.map +1 -1
- package/lib/cjs/render/webgl/SceneCompositor.d.ts +1 -1
- package/lib/cjs/render/webgl/SceneCompositor.d.ts.map +1 -1
- package/lib/cjs/render/webgl/SceneCompositor.js +3 -3
- package/lib/cjs/render/webgl/SceneCompositor.js.map +1 -1
- package/lib/cjs/render/webgl/Target.js +4 -4
- package/lib/cjs/render/webgl/Target.js.map +1 -1
- package/lib/esm/render/RealityMeshParams.d.ts.map +1 -1
- package/lib/esm/render/RealityMeshParams.js +0 -2
- package/lib/esm/render/RealityMeshParams.js.map +1 -1
- package/lib/esm/render/webgl/BranchState.d.ts +3 -0
- package/lib/esm/render/webgl/BranchState.d.ts.map +1 -1
- package/lib/esm/render/webgl/BranchState.js +5 -0
- package/lib/esm/render/webgl/BranchState.js.map +1 -1
- package/lib/esm/render/webgl/DrawCommand.d.ts.map +1 -1
- package/lib/esm/render/webgl/DrawCommand.js +3 -1
- package/lib/esm/render/webgl/DrawCommand.js.map +1 -1
- package/lib/esm/render/webgl/RenderCommands.d.ts +2 -1
- package/lib/esm/render/webgl/RenderCommands.d.ts.map +1 -1
- package/lib/esm/render/webgl/RenderCommands.js +15 -7
- package/lib/esm/render/webgl/RenderCommands.js.map +1 -1
- package/lib/esm/render/webgl/SceneCompositor.d.ts +1 -1
- package/lib/esm/render/webgl/SceneCompositor.d.ts.map +1 -1
- package/lib/esm/render/webgl/SceneCompositor.js +3 -3
- package/lib/esm/render/webgl/SceneCompositor.js.map +1 -1
- package/lib/esm/render/webgl/Target.js +4 -4
- package/lib/esm/render/webgl/Target.js.map +1 -1
- package/package.json +20 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# Change Log - @itwin/core-frontend
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 15 Dec 2022 16:38:28 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 3.5.1
|
|
6
|
+
Thu, 15 Dec 2022 16:38:28 GMT
|
|
7
|
+
|
|
8
|
+
### Updates
|
|
9
|
+
|
|
10
|
+
- realityModelRange
|
|
11
|
+
- Support reality meshes with 8- or 32-bit indices.
|
|
4
12
|
|
|
5
13
|
## 3.5.0
|
|
6
14
|
Wed, 07 Dec 2022 19:12:37 GMT
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealityMeshParams.d.ts","sourceRoot":"","sources":["../../../src/render/RealityMeshParams.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAU,kBAAkB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAC8B,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAY,KAAK,EAAE,MAAM,EAClG,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACuB,cAAc,EAAE,qBAAqB,EAAY,cAAc,EAAE,qBAAqB,EAA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CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM;IAOjF;;OAEG;IACI,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAKpE;;;;;;;OAOG;IACI,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM;IAa/E,oEAAoE;IAC7D,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAM5D,4HAA4H;IACrH,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAKpE,+DAA+D;IACxD,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,IAAI;IAKlD,OAAO,CAAC,QAAQ;IAIhB,kDAAkD;IAC3C,MAAM,IAAI,iBAAiB;CASnC"}
|
|
@@ -136,7 +136,6 @@ class RealityMeshParamsBuilder {
|
|
|
136
136
|
* @returns the index of the new vertex in [[positions]].
|
|
137
137
|
*/
|
|
138
138
|
addQuantizedVertex(position, uv, normal) {
|
|
139
|
-
(0, core_bentley_1.assert)(this.positions.length < 0xffff, "RealityMeshParams supports no more than 64k vertices");
|
|
140
139
|
(0, core_bentley_1.assert)((undefined === normal) === (undefined === this.normals), "RealityMeshParams requires all vertices to have normals, or none.");
|
|
141
140
|
this.positions.push(position);
|
|
142
141
|
this.uvs.push(uv);
|
|
@@ -163,7 +162,6 @@ class RealityMeshParamsBuilder {
|
|
|
163
162
|
this.addIndex(index);
|
|
164
163
|
}
|
|
165
164
|
addIndex(index) {
|
|
166
|
-
(0, core_bentley_1.assert)(index <= 0xffff, "RealityMeshParams supports no more than 64k vertices");
|
|
167
165
|
this.indices.push(index);
|
|
168
166
|
}
|
|
169
167
|
/** Extract the finished [[RealityMeshParams]]. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RealityMeshParams.js","sourceRoot":"","sources":["../../../src/render/RealityMeshParams.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8F;AAC9F,wDAE8B;AAC9B,oDAE4B;AAE5B,qEAAwD;AAwBxD,YAAY;AACZ,IAAiB,iBAAiB,CAkEjC;AAlED,WAAiB,iBAAiB;IAChC,gBAAgB;IAChB,SAAgB,YAAY,CAAC,IAAkB;;QAC7C,4EAA4E;QAC5E,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,qBAAI,CAAC,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO;YAChK,OAAO,SAAS,CAAC;QAEnB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE;gBACT,MAAM,EAAE,IAAI,CAAC,YAAY;gBACzB,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB;YACD,GAAG,EAAE;gBACH,MAAM,EAAE,IAAI,CAAC,SAAS;gBACtB,MAAM,EAAE,IAAI,CAAC,GAAG;aACjB;YACD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,gBAAgB;YAChB,OAAO,EAAE,MAAA,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,0CAAE,OAAO;SAC9D,CAAC;IACJ,CAAC;IAnBe,8BAAY,eAmB3B,CAAA;IAED,aAAa;IACb,SAAgB,UAAU,CAAC,MAAyB,EAAE,OAAgF;QACpI,MAAM,EAAE,SAA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,EAAE,EAAE,CAAC,CAAC;IAC/B,CAAC;IAED,+DAA+D;IACxD,UAAU,CAAC,OAAyB;QACzC,KAAK,MAAM,KAAK,IAAI,OAAO;YACzB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAEO,QAAQ,CAAC,KAAa;QAC5B,IAAA,qBAAM,EAAC,KAAK,IAAI,MAAM,EAAE,sDAAsD,CAAC,CAAC;QAChF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kDAAkD;IAC3C,MAAM;;QACX,IAAA,qBAAM,EAAC,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,kDAAkD,CAAC,CAAC;QACnH,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;YAClC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YACtB,OAAO,EAAE,MAAA,IAAI,CAAC,OAAO,0CAAE,YAAY,EAAE;YACrC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;SACrC,CAAC;IACJ,CAAC;CACF;AAjID,4DAiIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert, Uint16ArrayBuilder, UintArray, UintArrayBuilder } from \"@itwin/core-bentley\";\r\nimport {\r\n IndexedPolyface, Point2d, Point3d, Polyface, Range2d, Range3d, Transform, Vector3d, XAndY, XYAndZ,\r\n} from \"@itwin/core-geometry\";\r\nimport {\r\n OctEncodedNormal, QPoint2d, QPoint2dBuffer, QPoint2dBufferBuilder, QPoint3d, QPoint3dBuffer, QPoint3dBufferBuilder, RenderTexture,\r\n} from \"@itwin/core-common\";\r\nimport { GltfMeshData } from \"../tile/internal\";\r\nimport { Mesh } from \"./primitives/mesh/MeshPrimitives\";\r\n\r\n/** Geometry for a reality mesh to be submitted to the [[RenderSystem]] for conversion to a [[RenderGraphic]].\r\n * A reality mesh is a simple triangle mesh to which a [RenderTexture]($common) image can be mapped. Sources of reality meshes\r\n * include [[TerrainMeshProvider]]s to which background map imagery is applied, and [ContextRealityModel]($common)s captured using\r\n * [photogrammetry](https://en.wikipedia.org/wiki/Photogrammetry).\r\n * @see [[RealityMeshParamsBuilder]] to incrementally construct a `RealityMeshParams`.\r\n * @beta\r\n */\r\nexport interface RealityMeshParams {\r\n /** The 3d position of each vertex in the mesh, indexed by [[indices]]. */\r\n positions: QPoint3dBuffer;\r\n /** The 2d texture coordinates of each vertex in the mesh, indexed by [[indices]]. */\r\n uvs: QPoint2dBuffer;\r\n /** The optional normal vector for each vertex in the mesh, indexed by [[indices]], stored as [OctEncodedNormal]($common)s. */\r\n normals?: Uint16Array;\r\n /** The integer indices of each triangle in the mesh. The array's length must be a multiple of 3. */\r\n indices: UintArray;\r\n /** @alpha unused by terrain meshes */\r\n featureID?: number; // default 0\r\n /** @alpha unused by terrain meshes */\r\n texture?: RenderTexture;\r\n}\r\n\r\n/** @beta */\r\nexport namespace RealityMeshParams {\r\n /** @internal */\r\n export function fromGltfMesh(mesh: GltfMeshData): RealityMeshParams | undefined {\r\n // The specialized reality mesh shaders expect a mesh with uvs and no edges.\r\n if (mesh.primitive.type !== Mesh.PrimitiveType.Mesh || mesh.primitive.edges || !mesh.pointQParams || !mesh.uvQParams || !mesh.points || !mesh.uvs || !mesh.indices)\r\n return undefined;\r\n\r\n return {\r\n indices: mesh.indices,\r\n positions: {\r\n params: mesh.pointQParams,\r\n points: mesh.points,\r\n },\r\n uvs: {\r\n params: mesh.uvQParams,\r\n points: mesh.uvs,\r\n },\r\n normals: mesh.normals,\r\n // featureID: 0,\r\n texture: mesh.primitive.displayParams.textureMapping?.texture,\r\n };\r\n }\r\n\r\n /** @alpha */\r\n export function toPolyface(params: RealityMeshParams, options?: { transform?: Transform, wantNormals?: boolean, wantParams?: boolean }): Polyface | undefined {\r\n const { positions, normals, uvs, indices } = params;\r\n const includeNormals = options?.wantNormals && undefined !== normals;\r\n const includeParams = options?.wantParams;\r\n\r\n const polyface = IndexedPolyface.create(includeNormals, includeParams);\r\n const points = positions.points;\r\n const point = new Point3d();\r\n const transform = options?.transform;\r\n for (let i = 0; i < positions.points.length; i += 3) {\r\n positions.params.unquantize(points[i], points[i + 1], points[i + 2], point);\r\n transform?.multiplyPoint3d(point, point);\r\n polyface.addPoint(point);\r\n }\r\n\r\n if (includeNormals) {\r\n const normal = new Vector3d();\r\n for (const oen of normals)\r\n polyface.addNormal(OctEncodedNormal.decodeValue(oen, normal));\r\n }\r\n\r\n if (includeParams) {\r\n const uv = new Point2d();\r\n for (let i = 0; i < uvs.points.length; i += 2)\r\n polyface.addParam(uvs.params.unquantize(uvs.points[i], uvs.points[i + 1], uv));\r\n }\r\n\r\n let j = 0;\r\n indices.forEach((index: number) => {\r\n polyface.addPointIndex(index);\r\n if (includeNormals)\r\n polyface.addNormalIndex(index);\r\n\r\n if (includeParams)\r\n polyface.addParamIndex(index);\r\n\r\n if (0 === (++j % 3))\r\n polyface.terminateFacet();\r\n });\r\n\r\n return polyface;\r\n }\r\n}\r\n\r\n/** Options used to construct a [[RealityMeshParamsBuilder]].\r\n * @beta\r\n */\r\nexport interface RealityMeshParamsBuilderOptions {\r\n /** A bounding box fully containing the positions of all vertices to be included in the mesh.\r\n * This range is used to quantize [[RealityMeshParams.positions]].\r\n */\r\n positionRange: Range3d;\r\n /** A range fully containing the texture coordinates of all vertices to be included in the mesh.\r\n * This range is used to quantize [[RealityMeshParams.uvs]].\r\n * Default: [0.0, 1.0].\r\n */\r\n uvRange?: Range2d;\r\n /** If true, [[RealityMeshParams.normals]] will be populated.\r\n * If you set this to true, you must supply a normal for every vertex when calling [[RealityMeshParamsBuilder.addQuantizedVertex]] or [[RealityMeshParamsBuilder.addUnquantizedVertex]].\r\n */\r\n wantNormals?: boolean;\r\n /** If defined, memory for this number of vertices will be allocated up-front. Set this if you know the minimum number of vertices in the mesh, to\r\n * avoid unnecessary reallocations when adding vertices.\r\n */\r\n initialVertexCapacity?: number;\r\n /** If defined, memory for this number of indices will be allocated up-front. Set this if you know the minimum number of triangles in the mesh, to avoid\r\n * unnecessary reallocations when adding triangles. The number of indices is equal to three times the number of triangles.\r\n */\r\n initialIndexCapacity?: number;\r\n}\r\n\r\n/** Incrementally constructs a [[RealityMeshParams]].\r\n * The following simple example produces a rectangular mesh containing two triangles.\r\n * ```ts\r\n * [[include:Build_Reality_Mesh_Params]]\r\n * ```\r\n * @beta\r\n */\r\nexport class RealityMeshParamsBuilder {\r\n /** The indices of the vertices in each triangle of the mesh.\r\n * @see [[addTriangle]] to add 3 indices describing a single triangle.\r\n * @see [[addQuad]] to add 4 indices describing two triangles sharing an edge.\r\n * @see [[addIndices]] to add any number of indices.\r\n */\r\n public readonly indices: UintArrayBuilder;\r\n /** The 3d position of each vertex in the mesh.\r\n * @see [[addQuantizedVertex]] and [[addUnquantizedVertex]] to add a vertex.\r\n */\r\n public readonly positions: QPoint3dBufferBuilder;\r\n /** The 2d texture coordinates of each vertex in the mesh.\r\n * @see [[addQuantizedVertex]] and [[addUnquantizedVertex]] to add a vertex.\r\n */\r\n public readonly uvs: QPoint2dBufferBuilder;\r\n /** The normal vector of each vertex in the mesh, or `undefined` if [[RealityMeshParamsBuilderOptions.wantNormals]] was not `true` when constructing the builder.\r\n * A normal vector must be supplied to [[addQuantizedVertex]] and [[addUnquantizedVertex]] if and only if [[RealityMeshParamsBuilderOptions.wantNormals]] was\r\n * specified as `true`.\r\n * The vectors are stored as [OctEncodedNormal]($common)s.\r\n */\r\n public normals?: Uint16ArrayBuilder;\r\n\r\n // Scratch variables\r\n private readonly _q3d = new QPoint3d();\r\n private readonly _q2d = new QPoint2d();\r\n\r\n /** Construct a builder from the specified options. */\r\n public constructor(options: RealityMeshParamsBuilderOptions) {\r\n let initialType;\r\n if (undefined !== options.initialVertexCapacity && options.initialVertexCapacity > 0xff)\r\n initialType = options.initialVertexCapacity > 0xffff ? Uint32Array : Uint16Array;\r\n\r\n this.indices = new UintArrayBuilder({\r\n initialCapacity: options.initialIndexCapacity,\r\n initialType,\r\n });\r\n\r\n if (options.wantNormals)\r\n this.normals = new Uint16ArrayBuilder({ initialCapacity: options.initialVertexCapacity });\r\n\r\n this.positions = new QPoint3dBufferBuilder({\r\n range: options.positionRange,\r\n initialCapacity: options.initialVertexCapacity,\r\n });\r\n\r\n this.uvs = new QPoint2dBufferBuilder({\r\n range: options.uvRange ?? new Range2d(0, 0, 1, 1),\r\n initialCapacity: options.initialVertexCapacity,\r\n });\r\n }\r\n\r\n /** Add a vertex to the mesh and return its index in [[positions]].\r\n * @param position The 3d position, which will be quantized to the [[RealityMeshParamsBuilderOptions.positionRange]] supplied to the builder's constructor.\r\n * @param uv The texture coordinates, which will be quantized to the [[RealityMeshParamsBuilderOptions.uvRange]] supplied to the builder's constructor.\r\n * @param the normal vector, to be supplied if and only if [[RealityMeshParamsBuilderOptions.wantNormals]] was `true` when the builder was constructed.\r\n * @see [[addQuantizedVertex]] if your vertex data is already quantized.\r\n * @returns the index of the new vertex in [[positions]].\r\n */\r\n public addUnquantizedVertex(position: XYAndZ, uv: XAndY, normal?: XYAndZ): number {\r\n this._q3d.init(position, this.positions.params);\r\n this._q2d.init(uv, this.uvs.params);\r\n const oen = normal ? OctEncodedNormal.encode(normal) : undefined;\r\n return this.addQuantizedVertex(this._q3d, this._q2d, oen);\r\n }\r\n\r\n /** Original API had weird mix of quantized and unquantized, used by CesiumTerrainProvider.\r\n * @internal\r\n */\r\n public addVertex(position: XYAndZ, uv: XAndY, normal?: number): void {\r\n this._q3d.init(position, this.positions.params);\r\n this.addQuantizedVertex(this._q3d, uv, normal);\r\n }\r\n\r\n /** Add a vertex to the mesh and return its index in [[positions]].\r\n * @param position The 3d position, quantized to the [[RealityMeshParamsBuilderOptions.positionRange]] supplied to the builder's constructor.\r\n * @param uv The texture coordinates, quantized to the [[RealityMeshParamsBuilderOptions.uvRange]] supplied to the builder's constructor.\r\n * @param normal The unsigned 16-bit [OctEncodedNormal]($common) integer representation of the normal vector, to be supplied if and only if\r\n * [[RealityMeshParamsBuilderOptions.wantNormals]] was `true` when the builder was constructed.\r\n * @see [[addUnquantizedVertex]] if your vertex data is not already quantized.\r\n * @returns the index of the new vertex in [[positions]].\r\n */\r\n public addQuantizedVertex(position: XYAndZ, uv: XAndY, normal?: number): number {\r\n assert(this.positions.length < 0xffff, \"RealityMeshParams supports no more than 64k vertices\");\r\n assert((undefined === normal) === (undefined === this.normals), \"RealityMeshParams requires all vertices to have normals, or none.\");\r\n\r\n this.positions.push(position);\r\n this.uvs.push(uv);\r\n if (undefined !== normal) {\r\n assert(undefined !== this.normals, \"Set RealityMeshParamsBuilderOptions.wantNormals\");\r\n this.normals.push(normal);\r\n }\r\n\r\n return this.positions.length - 1;\r\n }\r\n\r\n /** Add a triangle corresponding to the three specified vertices. */\r\n public addTriangle(i0: number, i1: number, i2: number): void {\r\n this.addIndex(i0);\r\n this.addIndex(i1);\r\n this.addIndex(i2);\r\n }\r\n\r\n /** Add two triangles sharing an edge. This is equivalent to calling `addTriangle(i0, i1, i2); addTriangle(i1, i3, i2);`. */\r\n public addQuad(i0: number, i1: number, i2: number, i3: number): void {\r\n this.addTriangle(i0, i1, i2);\r\n this.addTriangle(i1, i3, i2);\r\n }\r\n\r\n /** Add all of the indices in `indices` to the index buffer. */\r\n public addIndices(indices: Iterable<number>): void {\r\n for (const index of indices)\r\n this.addIndex(index);\r\n }\r\n\r\n private addIndex(index: number): void {\r\n assert(index <= 0xffff, \"RealityMeshParams supports no more than 64k vertices\");\r\n this.indices.push(index);\r\n }\r\n\r\n /** Extract the finished [[RealityMeshParams]]. */\r\n public finish(): RealityMeshParams {\r\n assert(this.positions.length >= 3 && this.indices.length >= 3, \"RealityMeshParams requires at least one triangle\");\r\n return {\r\n positions: this.positions.finish(),\r\n uvs: this.uvs.finish(),\r\n normals: this.normals?.toTypedArray(),\r\n indices: this.indices.toTypedArray(),\r\n };\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"RealityMeshParams.js","sourceRoot":"","sources":["../../../src/render/RealityMeshParams.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA8F;AAC9F,wDAE8B;AAC9B,oDAE4B;AAE5B,qEAAwD;AAwBxD,YAAY;AACZ,IAAiB,iBAAiB,CAkEjC;AAlED,WAAiB,iBAAiB;IAChC,gBAAgB;IAChB,SAAgB,YAAY,CAAC,IAAkB;;QAC7C,4EAA4E;QAC5E,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,KAAK,qBAAI,CAAC,aAAa,CAAC,IAAI,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO;YAChK,OAAO,SAAS,CAAC;QAEnB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE;gBACT,MAAM,EAAE,IAAI,CAAC,YAAY;gBACzB,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB;YACD,GAAG,EAAE;gBACH,MAAM,EAAE,IAAI,CAAC,SAAS;gBACtB,MAAM,EAAE,IAAI,CAAC,GAAG;aACjB;YACD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,gBAAgB;YAChB,OAAO,EAAE,MAAA,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,cAAc,0CAAE,OAAO;SAC9D,CAAC;IACJ,CAAC;IAnBe,8BAAY,eAmB3B,CAAA;IAED,aAAa;IACb,SAAgB,UAAU,CA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D;IACxD,UAAU,CAAC,OAAyB;QACzC,KAAK,MAAM,KAAK,IAAI,OAAO;YACzB,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAEO,QAAQ,CAAC,KAAa;QAC5B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,kDAAkD;IAC3C,MAAM;;QACX,IAAA,qBAAM,EAAC,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,kDAAkD,CAAC,CAAC;QACnH,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;YAClC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YACtB,OAAO,EAAE,MAAA,IAAI,CAAC,OAAO,0CAAE,YAAY,EAAE;YACrC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;SACrC,CAAC;IACJ,CAAC;CACF;AA/HD,4DA+HC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Rendering\r\n */\r\n\r\nimport { assert, Uint16ArrayBuilder, UintArray, UintArrayBuilder } from \"@itwin/core-bentley\";\r\nimport {\r\n IndexedPolyface, Point2d, Point3d, Polyface, Range2d, Range3d, Transform, Vector3d, XAndY, XYAndZ,\r\n} from \"@itwin/core-geometry\";\r\nimport {\r\n OctEncodedNormal, QPoint2d, QPoint2dBuffer, QPoint2dBufferBuilder, QPoint3d, QPoint3dBuffer, QPoint3dBufferBuilder, RenderTexture,\r\n} from \"@itwin/core-common\";\r\nimport { GltfMeshData } from \"../tile/internal\";\r\nimport { Mesh } from \"./primitives/mesh/MeshPrimitives\";\r\n\r\n/** Geometry for a reality mesh to be submitted to the [[RenderSystem]] for conversion to a [[RenderGraphic]].\r\n * A reality mesh is a simple triangle mesh to which a [RenderTexture]($common) image can be mapped. Sources of reality meshes\r\n * include [[TerrainMeshProvider]]s to which background map imagery is applied, and [ContextRealityModel]($common)s captured using\r\n * [photogrammetry](https://en.wikipedia.org/wiki/Photogrammetry).\r\n * @see [[RealityMeshParamsBuilder]] to incrementally construct a `RealityMeshParams`.\r\n * @beta\r\n */\r\nexport interface RealityMeshParams {\r\n /** The 3d position of each vertex in the mesh, indexed by [[indices]]. */\r\n positions: QPoint3dBuffer;\r\n /** The 2d texture coordinates of each vertex in the mesh, indexed by [[indices]]. */\r\n uvs: QPoint2dBuffer;\r\n /** The optional normal vector for each vertex in the mesh, indexed by [[indices]], stored as [OctEncodedNormal]($common)s. */\r\n normals?: Uint16Array;\r\n /** The integer indices of each triangle in the mesh. The array's length must be a multiple of 3. */\r\n indices: UintArray;\r\n /** @alpha unused by terrain meshes */\r\n featureID?: number; // default 0\r\n /** @alpha unused by terrain meshes */\r\n texture?: RenderTexture;\r\n}\r\n\r\n/** @beta */\r\nexport namespace RealityMeshParams {\r\n /** @internal */\r\n export function fromGltfMesh(mesh: GltfMeshData): RealityMeshParams | undefined {\r\n // The specialized reality mesh shaders expect a mesh with uvs and no edges.\r\n if (mesh.primitive.type !== Mesh.PrimitiveType.Mesh || mesh.primitive.edges || !mesh.pointQParams || !mesh.uvQParams || !mesh.points || !mesh.uvs || !mesh.indices)\r\n return undefined;\r\n\r\n return {\r\n indices: mesh.indices,\r\n positions: {\r\n params: mesh.pointQParams,\r\n points: mesh.points,\r\n },\r\n uvs: {\r\n params: mesh.uvQParams,\r\n points: mesh.uvs,\r\n },\r\n normals: mesh.normals,\r\n // featureID: 0,\r\n texture: mesh.primitive.displayParams.textureMapping?.texture,\r\n };\r\n }\r\n\r\n /** @alpha */\r\n export function toPolyface(params: RealityMeshParams, options?: { transform?: Transform, wantNormals?: boolean, wantParams?: boolean }): Polyface | undefined {\r\n const { positions, normals, uvs, indices } = params;\r\n const includeNormals = options?.wantNormals && undefined !== normals;\r\n const includeParams = options?.wantParams;\r\n\r\n const polyface = IndexedPolyface.create(includeNormals, includeParams);\r\n const points = positions.points;\r\n const point = new Point3d();\r\n const transform = options?.transform;\r\n for (let i = 0; i < positions.points.length; i += 3) {\r\n positions.params.unquantize(points[i], points[i + 1], points[i + 2], point);\r\n transform?.multiplyPoint3d(point, point);\r\n polyface.addPoint(point);\r\n }\r\n\r\n if (includeNormals) {\r\n const normal = new Vector3d();\r\n for (const oen of normals)\r\n polyface.addNormal(OctEncodedNormal.decodeValue(oen, normal));\r\n }\r\n\r\n if (includeParams) {\r\n const uv = new Point2d();\r\n for (let i = 0; i < uvs.points.length; i += 2)\r\n polyface.addParam(uvs.params.unquantize(uvs.points[i], uvs.points[i + 1], uv));\r\n }\r\n\r\n let j = 0;\r\n indices.forEach((index: number) => {\r\n polyface.addPointIndex(index);\r\n if (includeNormals)\r\n polyface.addNormalIndex(index);\r\n\r\n if (includeParams)\r\n polyface.addParamIndex(index);\r\n\r\n if (0 === (++j % 3))\r\n polyface.terminateFacet();\r\n });\r\n\r\n return polyface;\r\n }\r\n}\r\n\r\n/** Options used to construct a [[RealityMeshParamsBuilder]].\r\n * @beta\r\n */\r\nexport interface RealityMeshParamsBuilderOptions {\r\n /** A bounding box fully containing the positions of all vertices to be included in the mesh.\r\n * This range is used to quantize [[RealityMeshParams.positions]].\r\n */\r\n positionRange: Range3d;\r\n /** A range fully containing the texture coordinates of all vertices to be included in the mesh.\r\n * This range is used to quantize [[RealityMeshParams.uvs]].\r\n * Default: [0.0, 1.0].\r\n */\r\n uvRange?: Range2d;\r\n /** If true, [[RealityMeshParams.normals]] will be populated.\r\n * If you set this to true, you must supply a normal for every vertex when calling [[RealityMeshParamsBuilder.addQuantizedVertex]] or [[RealityMeshParamsBuilder.addUnquantizedVertex]].\r\n */\r\n wantNormals?: boolean;\r\n /** If defined, memory for this number of vertices will be allocated up-front. Set this if you know the minimum number of vertices in the mesh, to\r\n * avoid unnecessary reallocations when adding vertices.\r\n */\r\n initialVertexCapacity?: number;\r\n /** If defined, memory for this number of indices will be allocated up-front. Set this if you know the minimum number of triangles in the mesh, to avoid\r\n * unnecessary reallocations when adding triangles. The number of indices is equal to three times the number of triangles.\r\n */\r\n initialIndexCapacity?: number;\r\n}\r\n\r\n/** Incrementally constructs a [[RealityMeshParams]].\r\n * The following simple example produces a rectangular mesh containing two triangles.\r\n * ```ts\r\n * [[include:Build_Reality_Mesh_Params]]\r\n * ```\r\n * @beta\r\n */\r\nexport class RealityMeshParamsBuilder {\r\n /** The indices of the vertices in each triangle of the mesh.\r\n * @see [[addTriangle]] to add 3 indices describing a single triangle.\r\n * @see [[addQuad]] to add 4 indices describing two triangles sharing an edge.\r\n * @see [[addIndices]] to add any number of indices.\r\n */\r\n public readonly indices: UintArrayBuilder;\r\n /** The 3d position of each vertex in the mesh.\r\n * @see [[addQuantizedVertex]] and [[addUnquantizedVertex]] to add a vertex.\r\n */\r\n public readonly positions: QPoint3dBufferBuilder;\r\n /** The 2d texture coordinates of each vertex in the mesh.\r\n * @see [[addQuantizedVertex]] and [[addUnquantizedVertex]] to add a vertex.\r\n */\r\n public readonly uvs: QPoint2dBufferBuilder;\r\n /** The normal vector of each vertex in the mesh, or `undefined` if [[RealityMeshParamsBuilderOptions.wantNormals]] was not `true` when constructing the builder.\r\n * A normal vector must be supplied to [[addQuantizedVertex]] and [[addUnquantizedVertex]] if and only if [[RealityMeshParamsBuilderOptions.wantNormals]] was\r\n * specified as `true`.\r\n * The vectors are stored as [OctEncodedNormal]($common)s.\r\n */\r\n public normals?: Uint16ArrayBuilder;\r\n\r\n // Scratch variables\r\n private readonly _q3d = new QPoint3d();\r\n private readonly _q2d = new QPoint2d();\r\n\r\n /** Construct a builder from the specified options. */\r\n public constructor(options: RealityMeshParamsBuilderOptions) {\r\n let initialType;\r\n if (undefined !== options.initialVertexCapacity && options.initialVertexCapacity > 0xff)\r\n initialType = options.initialVertexCapacity > 0xffff ? Uint32Array : Uint16Array;\r\n\r\n this.indices = new UintArrayBuilder({\r\n initialCapacity: options.initialIndexCapacity,\r\n initialType,\r\n });\r\n\r\n if (options.wantNormals)\r\n this.normals = new Uint16ArrayBuilder({ initialCapacity: options.initialVertexCapacity });\r\n\r\n this.positions = new QPoint3dBufferBuilder({\r\n range: options.positionRange,\r\n initialCapacity: options.initialVertexCapacity,\r\n });\r\n\r\n this.uvs = new QPoint2dBufferBuilder({\r\n range: options.uvRange ?? new Range2d(0, 0, 1, 1),\r\n initialCapacity: options.initialVertexCapacity,\r\n });\r\n }\r\n\r\n /** Add a vertex to the mesh and return its index in [[positions]].\r\n * @param position The 3d position, which will be quantized to the [[RealityMeshParamsBuilderOptions.positionRange]] supplied to the builder's constructor.\r\n * @param uv The texture coordinates, which will be quantized to the [[RealityMeshParamsBuilderOptions.uvRange]] supplied to the builder's constructor.\r\n * @param the normal vector, to be supplied if and only if [[RealityMeshParamsBuilderOptions.wantNormals]] was `true` when the builder was constructed.\r\n * @see [[addQuantizedVertex]] if your vertex data is already quantized.\r\n * @returns the index of the new vertex in [[positions]].\r\n */\r\n public addUnquantizedVertex(position: XYAndZ, uv: XAndY, normal?: XYAndZ): number {\r\n this._q3d.init(position, this.positions.params);\r\n this._q2d.init(uv, this.uvs.params);\r\n const oen = normal ? OctEncodedNormal.encode(normal) : undefined;\r\n return this.addQuantizedVertex(this._q3d, this._q2d, oen);\r\n }\r\n\r\n /** Original API had weird mix of quantized and unquantized, used by CesiumTerrainProvider.\r\n * @internal\r\n */\r\n public addVertex(position: XYAndZ, uv: XAndY, normal?: number): void {\r\n this._q3d.init(position, this.positions.params);\r\n this.addQuantizedVertex(this._q3d, uv, normal);\r\n }\r\n\r\n /** Add a vertex to the mesh and return its index in [[positions]].\r\n * @param position The 3d position, quantized to the [[RealityMeshParamsBuilderOptions.positionRange]] supplied to the builder's constructor.\r\n * @param uv The texture coordinates, quantized to the [[RealityMeshParamsBuilderOptions.uvRange]] supplied to the builder's constructor.\r\n * @param normal The unsigned 16-bit [OctEncodedNormal]($common) integer representation of the normal vector, to be supplied if and only if\r\n * [[RealityMeshParamsBuilderOptions.wantNormals]] was `true` when the builder was constructed.\r\n * @see [[addUnquantizedVertex]] if your vertex data is not already quantized.\r\n * @returns the index of the new vertex in [[positions]].\r\n */\r\n public addQuantizedVertex(position: XYAndZ, uv: XAndY, normal?: number): number {\r\n assert((undefined === normal) === (undefined === this.normals), \"RealityMeshParams requires all vertices to have normals, or none.\");\r\n\r\n this.positions.push(position);\r\n this.uvs.push(uv);\r\n if (undefined !== normal) {\r\n assert(undefined !== this.normals, \"Set RealityMeshParamsBuilderOptions.wantNormals\");\r\n this.normals.push(normal);\r\n }\r\n\r\n return this.positions.length - 1;\r\n }\r\n\r\n /** Add a triangle corresponding to the three specified vertices. */\r\n public addTriangle(i0: number, i1: number, i2: number): void {\r\n this.addIndex(i0);\r\n this.addIndex(i1);\r\n this.addIndex(i2);\r\n }\r\n\r\n /** Add two triangles sharing an edge. This is equivalent to calling `addTriangle(i0, i1, i2); addTriangle(i1, i3, i2);`. */\r\n public addQuad(i0: number, i1: number, i2: number, i3: number): void {\r\n this.addTriangle(i0, i1, i2);\r\n this.addTriangle(i1, i3, i2);\r\n }\r\n\r\n /** Add all of the indices in `indices` to the index buffer. */\r\n public addIndices(indices: Iterable<number>): void {\r\n for (const index of indices)\r\n this.addIndex(index);\r\n }\r\n\r\n private addIndex(index: number): void {\r\n this.indices.push(index);\r\n }\r\n\r\n /** Extract the finished [[RealityMeshParams]]. */\r\n public finish(): RealityMeshParams {\r\n assert(this.positions.length >= 3 && this.indices.length >= 3, \"RealityMeshParams requires at least one triangle\");\r\n return {\r\n positions: this.positions.finish(),\r\n uvs: this.uvs.finish(),\r\n normals: this.normals?.toTypedArray(),\r\n indices: this.indices.toTypedArray(),\r\n };\r\n }\r\n}\r\n"]}
|
|
@@ -36,6 +36,7 @@ export interface BranchStateOptions {
|
|
|
36
36
|
};
|
|
37
37
|
readonly appearanceProvider?: FeatureAppearanceProvider;
|
|
38
38
|
readonly realityModelDisplaySettings?: RealityModelDisplaySettings;
|
|
39
|
+
forceViewCoords?: boolean;
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
42
|
* Represents a branch node in the scene graph, with associated view flags and transform to be applied to
|
|
@@ -48,6 +49,7 @@ export declare class BranchState {
|
|
|
48
49
|
get viewFlags(): ViewFlags;
|
|
49
50
|
set viewFlags(vf: ViewFlags);
|
|
50
51
|
get clipVolume(): ClipVolume | undefined;
|
|
52
|
+
get forceViewCoords(): boolean;
|
|
51
53
|
get planarClassifier(): PlanarClassifier | undefined;
|
|
52
54
|
get textureDrape(): TextureDrape | undefined;
|
|
53
55
|
get edgeSettings(): EdgeSettings;
|
|
@@ -67,6 +69,7 @@ export declare class BranchState {
|
|
|
67
69
|
static fromBranch(prev: BranchState, branch: Branch): BranchState;
|
|
68
70
|
getFeatureAppearance(overrides: FeatureSymbology.Overrides, elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number): FeatureAppearance | undefined;
|
|
69
71
|
static createForDecorations(): BranchState;
|
|
72
|
+
withViewCoords(): BranchState;
|
|
70
73
|
constructor(opts: BranchStateOptions);
|
|
71
74
|
}
|
|
72
75
|
//# sourceMappingURL=BranchState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BranchState.d.ts","sourceRoot":"","sources":["../../../../src/render/webgl/BranchState.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,SAAS,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,aAAa,EAAE,UAAU,EAAE,2BAA2B,EAAc,SAAS,EACvI,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,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|
|
28
28
|
get viewFlags() { return this._opts.viewFlags; }
|
|
29
29
|
set viewFlags(vf) { this._opts.viewFlags = vf.normalize(); }
|
|
30
30
|
get clipVolume() { return this._opts.clipVolume; }
|
|
31
|
+
get forceViewCoords() { return true === this._opts.forceViewCoords; }
|
|
31
32
|
get planarClassifier() { return this._opts.planarClassifier; }
|
|
32
33
|
get textureDrape() { return this._opts.textureDrape; }
|
|
33
34
|
get edgeSettings() { return this._opts.edgeSettings; }
|
|
@@ -59,6 +60,7 @@ class BranchState {
|
|
|
59
60
|
planarClassifier: (undefined !== branch.planarClassifier && undefined !== branch.planarClassifier.texture) ? branch.planarClassifier : prev.planarClassifier,
|
|
60
61
|
textureDrape: (_c = branch.textureDrape) !== null && _c !== void 0 ? _c : prev.textureDrape,
|
|
61
62
|
clipVolume: branch.clips,
|
|
63
|
+
forceViewCoords: prev.forceViewCoords,
|
|
62
64
|
edgeSettings: (_d = branch.edgeSettings) !== null && _d !== void 0 ? _d : prev.edgeSettings,
|
|
63
65
|
is3d: (_f = (_e = branch.frustum) === null || _e === void 0 ? void 0 : _e.is3d) !== null && _f !== void 0 ? _f : prev.is3d,
|
|
64
66
|
frustumScale: (_h = (_g = branch.frustum) === null || _g === void 0 ? void 0 : _g.scale) !== null && _h !== void 0 ? _h : prev.frustumScale,
|
|
@@ -77,6 +79,9 @@ class BranchState {
|
|
|
77
79
|
const vf = new core_common_1.ViewFlags({ renderMode: core_common_1.RenderMode.SmoothShade, lighting: false, whiteOnWhiteReversal: false });
|
|
78
80
|
return new BranchState({ viewFlags: vf, transform: core_geometry_1.Transform.createIdentity(), symbologyOverrides: new FeatureSymbology_1.FeatureSymbology.Overrides(), edgeSettings: EdgeSettings_1.EdgeSettings.create(undefined), is3d: true });
|
|
79
81
|
}
|
|
82
|
+
withViewCoords() {
|
|
83
|
+
return new BranchState({ ...this._opts, forceViewCoords: true });
|
|
84
|
+
}
|
|
80
85
|
}
|
|
81
86
|
exports.BranchState = BranchState;
|
|
82
87
|
//# sourceMappingURL=BranchState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BranchState.js","sourceRoot":"","sources":["../../../../src/render/webgl/BranchState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAiD;AACjD,oDAE4B;AAE5B,0DAAuD;AAKvD,iDAA8C;AA2B9C;;;;GAIG;AACH,MAAa,WAAW;IA+DtB,YAAmB,IAAwB;QACzC,IAAI,CAAC,IAAI,CAAC,YAAY;YACpB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAErC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;IAC1D,CAAC;IAlED,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACvD,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACvD,IAAW,SAAS,CAAC,EAAa,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IAC9E,IAAW,UAAU,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;IACzD,IAAW,gBAAgB,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACrE,IAAW,YAAY,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAC7D,IAAW,YAAY,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAC7D,IAAW,MAAM,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAA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AE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;QAE/J,OAAO,SAAS,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;IACzH,CAAC;IAEM,MAAM,CAAC,oBAAoB;QAChC,MAAM,EAAE,GAAG,IAAI,uBAAS,CAAC,EAAE,UAAU,EAAE,wBAAU,CAAC,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC,CAAC;QAE/G,OAAO,IAAI,WAAW,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,yBAAS,CAAC,cAAc,EAAE,EAAE,kBAAkB,EAAE,IAAI,mCAAgB,CAAC,SAAS,EAAE,EAAE,YAAY,EAAE,2BAAY,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACnM,CAAC;CASF;AAtED,kCAsEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module WebGL\r\n */\r\n\r\nimport { Transform } from \"@itwin/core-geometry\";\r\nimport {\r\n BatchType, FeatureAppearance, FeatureAppearanceProvider, GeometryClass, HiddenLine, RealityModelDisplaySettings, RenderMode, ViewFlags,\r\n} from \"@itwin/core-common\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\nimport { FeatureSymbology } from \"../FeatureSymbology\";\r\nimport { ClipVolume } from \"./ClipVolume\";\r\nimport { Branch } from \"./Graphic\";\r\nimport { PlanarClassifier } from \"./PlanarClassifier\";\r\nimport { TextureDrape } from \"./TextureDrape\";\r\nimport { EdgeSettings } from \"./EdgeSettings\";\r\n\r\n/** Options used to construct a BranchState.\r\n * @internal\r\n */\r\nexport interface BranchStateOptions {\r\n readonly transform: Transform;\r\n viewFlags: ViewFlags;\r\n symbologyOverrides: FeatureSymbology.Overrides;\r\n clipVolume?: ClipVolume;\r\n readonly planarClassifier?: PlanarClassifier;\r\n readonly secondaryClassifiers?: PlanarClassifier[];\r\n readonly textureDrape?: TextureDrape;\r\n readonly edgeSettings: EdgeSettings;\r\n /** Used chiefly for readPixels() to identify context of picked Ids when graphics from multiple iModels are displayed together. */\r\n readonly iModel?: IModelConnection;\r\n /** Whether the graphics in this branch are 2d or 3d.\r\n * Sometimes we draw 3d orthographic views in the context of a 2d view (e.g., sheet view attachments).\r\n * Currently this only affects the logic for discarding surfaces (in 2d, we relay on display priority to enforce draw order between different elements;\r\n * in 3d we use the pick buffers.\r\n */\r\n is3d: boolean;\r\n frustumScale?: { x: number, y: number };\r\n readonly appearanceProvider?: FeatureAppearanceProvider;\r\n readonly realityModelDisplaySettings?: RealityModelDisplaySettings;\r\n}\r\n\r\n/**\r\n * Represents a branch node in the scene graph, with associated view flags and transform to be applied to\r\n * all sub-nodes of the branch.\r\n * @internal\r\n */\r\nexport class BranchState {\r\n private readonly _opts: BranchStateOptions;\r\n\r\n public get transform() { return this._opts.transform; }\r\n public get viewFlags() { return this._opts.viewFlags; }\r\n public set viewFlags(vf: ViewFlags) { this._opts.viewFlags = vf.normalize(); }\r\n public get clipVolume() { return this._opts.clipVolume; }\r\n public get planarClassifier() { return this._opts.planarClassifier; }\r\n public get textureDrape() { return this._opts.textureDrape; }\r\n public get edgeSettings() { return this._opts.edgeSettings; }\r\n public get iModel() { return this._opts.iModel; }\r\n public get is3d() { return this._opts.is3d; }\r\n public get frustumScale() { return this._opts.frustumScale!; }\r\n public get appearanceProvider() { return this._opts.appearanceProvider; }\r\n public get secondaryClassifiers() { return this._opts.secondaryClassifiers; }\r\n public get realityModelDisplaySettings() { return this._opts.realityModelDisplaySettings; }\r\n\r\n public get symbologyOverrides() {\r\n return this._opts.symbologyOverrides;\r\n }\r\n public set symbologyOverrides(ovrs: FeatureSymbology.Overrides) {\r\n this._opts.symbologyOverrides = ovrs;\r\n }\r\n\r\n public changeRenderPlan(viewFlags: ViewFlags, is3d: boolean, hline: HiddenLine.Settings | undefined): void {\r\n this.viewFlags = viewFlags;\r\n this._opts.is3d = is3d;\r\n this.edgeSettings.init(hline);\r\n }\r\n\r\n /** Create a BranchState from a Branch. Any properties not explicitly specified by the new Branch are inherited from the previous BranchState. */\r\n public static fromBranch(prev: BranchState, branch: Branch): BranchState {\r\n return new BranchState({\r\n viewFlags: branch.branch.getViewFlags(prev.viewFlags),\r\n transform: prev.transform.multiplyTransformTransform(branch.localToWorldTransform),\r\n symbologyOverrides: branch.branch.symbologyOverrides ?? prev.symbologyOverrides,\r\n iModel: branch.iModel ?? prev.iModel,\r\n planarClassifier: (undefined !== branch.planarClassifier && undefined !== branch.planarClassifier.texture) ? branch.planarClassifier : prev.planarClassifier,\r\n textureDrape: branch.textureDrape ?? prev.textureDrape,\r\n clipVolume: branch.clips,\r\n edgeSettings: branch.edgeSettings ?? prev.edgeSettings,\r\n is3d: branch.frustum?.is3d ?? prev.is3d,\r\n frustumScale: branch.frustum?.scale ?? prev.frustumScale,\r\n secondaryClassifiers: branch.secondaryClassifiers?? prev.secondaryClassifiers,\r\n // The branch can augment the symbology overrides. If it doesn't want to, allow its parent to do so, unless this branch supplies its own symbology overrides.\r\n appearanceProvider: branch.appearanceProvider ?? (branch.branch.symbologyOverrides ? undefined : prev.appearanceProvider),\r\n realityModelDisplaySettings: branch.branch.realityModelDisplaySettings ?? prev.realityModelDisplaySettings,\r\n });\r\n }\r\n\r\n public getFeatureAppearance(overrides: FeatureSymbology.Overrides, elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number): FeatureAppearance | undefined {\r\n if (this._opts.appearanceProvider)\r\n return this._opts.appearanceProvider.getFeatureAppearance(overrides, elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId);\r\n\r\n return overrides.getAppearance(elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId);\r\n }\r\n\r\n public static createForDecorations(): BranchState {\r\n const vf = new ViewFlags({ renderMode: RenderMode.SmoothShade, lighting: false, whiteOnWhiteReversal: false });\r\n\r\n return new BranchState({ viewFlags: vf, transform: Transform.createIdentity(), symbologyOverrides: new FeatureSymbology.Overrides(), edgeSettings: EdgeSettings.create(undefined), is3d: true });\r\n }\r\n\r\n public constructor(opts: BranchStateOptions) {\r\n if (!opts.frustumScale)\r\n opts.frustumScale = { x: 1, y: 1 };\r\n\r\n this._opts = opts;\r\n this._opts.viewFlags = this._opts.viewFlags.normalize();\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"BranchState.js","sourceRoot":"","sources":["../../../../src/render/webgl/BranchState.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,wDAAiD;AACjD,oDAE4B;AAE5B,0DAAuD;AAKvD,iDAA8C;AA4B9C;;;;GAIG;AACH,MAAa,WAAW;IAqEtB,YAAmB,IAAwB;QACzC,IAAI,CAAC,IAAI,CAAC,YAAY;YACpB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;QAErC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;IAC1D,CAAC;IAxED,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACvD,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IACvD,IAAW,SAAS,CAAC,EAAa,IAAI,IAAI,CAAC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C,CAAC;IACnM,CAAC;IAEM,cAAc;QACnB,OAAO,IAAI,WAAW,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IACnE,CAAC;CASF;AA5ED,kCA4EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module WebGL\r\n */\r\n\r\nimport { Transform } from \"@itwin/core-geometry\";\r\nimport {\r\n BatchType, FeatureAppearance, FeatureAppearanceProvider, GeometryClass, HiddenLine, RealityModelDisplaySettings, RenderMode, ViewFlags,\r\n} from \"@itwin/core-common\";\r\nimport { IModelConnection } from \"../../IModelConnection\";\r\nimport { FeatureSymbology } from \"../FeatureSymbology\";\r\nimport { ClipVolume } from \"./ClipVolume\";\r\nimport { Branch } from \"./Graphic\";\r\nimport { PlanarClassifier } from \"./PlanarClassifier\";\r\nimport { TextureDrape } from \"./TextureDrape\";\r\nimport { EdgeSettings } from \"./EdgeSettings\";\r\n\r\n/** Options used to construct a BranchState.\r\n * @internal\r\n */\r\nexport interface BranchStateOptions {\r\n readonly transform: Transform;\r\n viewFlags: ViewFlags;\r\n symbologyOverrides: FeatureSymbology.Overrides;\r\n clipVolume?: ClipVolume;\r\n readonly planarClassifier?: PlanarClassifier;\r\n readonly secondaryClassifiers?: PlanarClassifier[];\r\n readonly textureDrape?: TextureDrape;\r\n readonly edgeSettings: EdgeSettings;\r\n /** Used chiefly for readPixels() to identify context of picked Ids when graphics from multiple iModels are displayed together. */\r\n readonly iModel?: IModelConnection;\r\n /** Whether the graphics in this branch are 2d or 3d.\r\n * Sometimes we draw 3d orthographic views in the context of a 2d view (e.g., sheet view attachments).\r\n * Currently this only affects the logic for discarding surfaces (in 2d, we relay on display priority to enforce draw order between different elements;\r\n * in 3d we use the pick buffers.\r\n */\r\n is3d: boolean;\r\n frustumScale?: { x: number, y: number };\r\n readonly appearanceProvider?: FeatureAppearanceProvider;\r\n readonly realityModelDisplaySettings?: RealityModelDisplaySettings;\r\n forceViewCoords?: boolean;\r\n}\r\n\r\n/**\r\n * Represents a branch node in the scene graph, with associated view flags and transform to be applied to\r\n * all sub-nodes of the branch.\r\n * @internal\r\n */\r\nexport class BranchState {\r\n private readonly _opts: BranchStateOptions;\r\n\r\n public get transform() { return this._opts.transform; }\r\n public get viewFlags() { return this._opts.viewFlags; }\r\n public set viewFlags(vf: ViewFlags) { this._opts.viewFlags = vf.normalize(); }\r\n public get clipVolume() { return this._opts.clipVolume; }\r\n public get forceViewCoords(): boolean { return true === this._opts.forceViewCoords; }\r\n public get planarClassifier() { return this._opts.planarClassifier; }\r\n public get textureDrape() { return this._opts.textureDrape; }\r\n public get edgeSettings() { return this._opts.edgeSettings; }\r\n public get iModel() { return this._opts.iModel; }\r\n public get is3d() { return this._opts.is3d; }\r\n public get frustumScale() { return this._opts.frustumScale!; }\r\n public get appearanceProvider() { return this._opts.appearanceProvider; }\r\n public get secondaryClassifiers() { return this._opts.secondaryClassifiers; }\r\n public get realityModelDisplaySettings() { return this._opts.realityModelDisplaySettings; }\r\n\r\n public get symbologyOverrides() {\r\n return this._opts.symbologyOverrides;\r\n }\r\n public set symbologyOverrides(ovrs: FeatureSymbology.Overrides) {\r\n this._opts.symbologyOverrides = ovrs;\r\n }\r\n\r\n public changeRenderPlan(viewFlags: ViewFlags, is3d: boolean, hline: HiddenLine.Settings | undefined): void {\r\n this.viewFlags = viewFlags;\r\n this._opts.is3d = is3d;\r\n this.edgeSettings.init(hline);\r\n }\r\n\r\n /** Create a BranchState from a Branch. Any properties not explicitly specified by the new Branch are inherited from the previous BranchState. */\r\n public static fromBranch(prev: BranchState, branch: Branch): BranchState {\r\n return new BranchState({\r\n viewFlags: branch.branch.getViewFlags(prev.viewFlags),\r\n transform: prev.transform.multiplyTransformTransform(branch.localToWorldTransform),\r\n symbologyOverrides: branch.branch.symbologyOverrides ?? prev.symbologyOverrides,\r\n iModel: branch.iModel ?? prev.iModel,\r\n planarClassifier: (undefined !== branch.planarClassifier && undefined !== branch.planarClassifier.texture) ? branch.planarClassifier : prev.planarClassifier,\r\n textureDrape: branch.textureDrape ?? prev.textureDrape,\r\n clipVolume: branch.clips,\r\n forceViewCoords: prev.forceViewCoords,\r\n edgeSettings: branch.edgeSettings ?? prev.edgeSettings,\r\n is3d: branch.frustum?.is3d ?? prev.is3d,\r\n frustumScale: branch.frustum?.scale ?? prev.frustumScale,\r\n secondaryClassifiers: branch.secondaryClassifiers?? prev.secondaryClassifiers,\r\n // The branch can augment the symbology overrides. If it doesn't want to, allow its parent to do so, unless this branch supplies its own symbology overrides.\r\n appearanceProvider: branch.appearanceProvider ?? (branch.branch.symbologyOverrides ? undefined : prev.appearanceProvider),\r\n realityModelDisplaySettings: branch.branch.realityModelDisplaySettings ?? prev.realityModelDisplaySettings,\r\n });\r\n }\r\n\r\n public getFeatureAppearance(overrides: FeatureSymbology.Overrides, elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number): FeatureAppearance | undefined {\r\n if (this._opts.appearanceProvider)\r\n return this._opts.appearanceProvider.getFeatureAppearance(overrides, elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId);\r\n\r\n return overrides.getAppearance(elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId);\r\n }\r\n\r\n public static createForDecorations(): BranchState {\r\n const vf = new ViewFlags({ renderMode: RenderMode.SmoothShade, lighting: false, whiteOnWhiteReversal: false });\r\n\r\n return new BranchState({ viewFlags: vf, transform: Transform.createIdentity(), symbologyOverrides: new FeatureSymbology.Overrides(), edgeSettings: EdgeSettings.create(undefined), is3d: true });\r\n }\r\n\r\n public withViewCoords(): BranchState {\r\n return new BranchState({ ...this._opts, forceViewCoords: true });\r\n }\r\n\r\n public constructor(opts: BranchStateOptions) {\r\n if (!opts.frustumScale)\r\n opts.frustumScale = { x: 1, y: 1 };\r\n\r\n this._opts = opts;\r\n this._opts.viewFlags = this._opts.viewFlags.normalize();\r\n }\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawCommand.d.ts","sourceRoot":"","sources":["../../../../src/render/webgl/DrawCommand.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAM3C,gBAAgB;AAChB,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,WAAW,CAA+B;IAElD,IAAW,MAAM,IAAI,MAAM,CAG1B;IAED,IAAW,UAAU,eAA+B;IAEpD,IAAW,gBAAgB,+BAA4E;IAChG,oBAAoB,CAAC,OAAO,EAAE,aAAa;IAElD,IAAW,YAAY,YAAsG;IAC7H,IAAW,aAAa,YAAwG;IAChI,IAAW,OAAO,sDAAsC;IAEjD,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,UAAqC;CAIxE;AAED,gBAAgB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oBAAY,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAEtE;;GAEG;AACH,oBAAY,YAAY,GAAG,WAAW,EAAE,CAAC;AAEzC;;;;GAIG;AACH,wBAAgB,sCAAsC,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAyBxJ;AAED,gBAAgB;AAChB,wBAAgB,sCAAsC,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,GAAG,YAAY,CA2CzG"}
|
|
@@ -47,7 +47,9 @@ class DrawParams {
|
|
|
47
47
|
get target() { return this.programParams.target; }
|
|
48
48
|
get renderPass() { return this.programParams.renderPass; }
|
|
49
49
|
get projectionMatrix() { return this.programParams.projectionMatrix; }
|
|
50
|
-
get isViewCoords() {
|
|
50
|
+
get isViewCoords() {
|
|
51
|
+
return this.programParams.isViewCoords || this.target.currentBranch.forceViewCoords;
|
|
52
|
+
}
|
|
51
53
|
get isOverlayPass() { return this.programParams.isOverlayPass; }
|
|
52
54
|
get context() { return this.programParams.context; }
|
|
53
55
|
init(programParams, geometry) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawCommand.js","sourceRoot":"","sources":["../../../../src/render/webgl/DrawCommand.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA+D;AAI/D,yDAAsD;AAMtD,qCAAkC;AAElC,qDAA+H;AAG/H,yCAAyC;AAEzC,gBAAgB;AAChB,MAAa,mBAAmB;IAAhC;QAEU,gBAAW,kBAA+B;IAoBpD,CAAC;IAlBC,IAAW,MAAM;QACf,IAAA,qBAAM,EAAC,SAAS,KAAK,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,IAAW,UAAU,KAAK,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;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AS;oBAEX,MAAM,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;oBACnF,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,IAAA,mCAAgB,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;wBAChH,SAAS;oBAEX,MAAM;iBACP;SACJ;QAED,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAClB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA3CD,wFA2CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module WebGL\r\n */\r\n\r\nimport { assert, Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { BranchState } from \"./BranchState\";\r\nimport { CachedGeometry } from \"./CachedGeometry\";\r\nimport { ClipVolume } from \"./ClipVolume\";\r\nimport { isFeatureHilited } from \"./FeatureOverrides\";\r\nimport { Batch, Branch } from \"./Graphic\";\r\nimport { UniformHandle } from \"./UniformHandle\";\r\nimport { Primitive } from \"./Primitive\";\r\nimport { Pass, RenderOrder, RenderPass } from \"./RenderFlags\";\r\nimport { ShaderProgramExecutor } from \"./ShaderProgram\";\r\nimport { System } from \"./System\";\r\nimport { Hilites, Target } from \"./Target\";\r\nimport { IsAnimated, IsClassified, IsInstanced, IsShadowable, IsThematic, IsWiremesh, TechniqueFlags } from \"./TechniqueFlags\";\r\nimport { TechniqueId } from \"./TechniqueId\";\r\n\r\n/* eslint-disable no-restricted-syntax */\r\n\r\n/** @internal */\r\nexport class ShaderProgramParams {\r\n private _target?: Target;\r\n private _renderPass: RenderPass = RenderPass.None;\r\n\r\n public get target(): Target {\r\n assert(undefined !== this._target);\r\n return this._target;\r\n }\r\n\r\n public get renderPass() { return this._renderPass; }\r\n\r\n public get projectionMatrix() { return this.target.uniforms.getProjectionMatrix32(this.isViewCoords); }\r\n public bindProjectionMatrix(uniform: UniformHandle) { this.target.uniforms.bindProjectionMatrix(uniform, this.isViewCoords); }\r\n\r\n public get isViewCoords() { return RenderPass.ViewOverlay === this.renderPass || RenderPass.Background === this.renderPass; }\r\n public get isOverlayPass() { return RenderPass.WorldOverlay === this.renderPass || RenderPass.ViewOverlay === this.renderPass; }\r\n public get context() { return System.instance.context; }\r\n\r\n public init(target: Target, pass: RenderPass = RenderPass.OpaqueGeneral) {\r\n this._renderPass = pass;\r\n this._target = target;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class DrawParams {\r\n private _programParams?: ShaderProgramParams;\r\n private _geometry?: CachedGeometry;\r\n\r\n public get geometry(): CachedGeometry {\r\n assert(undefined !== this._geometry);\r\n return this._geometry;\r\n }\r\n\r\n public get programParams(): ShaderProgramParams {\r\n assert(undefined !== this._programParams);\r\n return this._programParams;\r\n }\r\n\r\n public get target() { return this.programParams.target; }\r\n public get renderPass() { return this.programParams.renderPass; }\r\n public get projectionMatrix() { return this.programParams.projectionMatrix; }\r\n public get isViewCoords() { return this.programParams.isViewCoords; }\r\n public get isOverlayPass() { return this.programParams.isOverlayPass; }\r\n public get context() { return this.programParams.context; }\r\n\r\n public init(programParams: ShaderProgramParams, geometry: CachedGeometry) {\r\n this._programParams = programParams;\r\n this._geometry = geometry;\r\n }\r\n}\r\n\r\n/** Defines operation associated with pushing or popping a branch\r\n * @internal\r\n */\r\nexport const enum PushOrPop {\r\n Push,\r\n Pop,\r\n}\r\n\r\n/** Represents a command to be executed within a RenderPass. The most common command is\r\n * to draw a primitive; others involve state changes such as pushing/popping transforms\r\n * and symbology overrides, which require that commands be executed in order.\r\n * @internal\r\n */\r\nexport enum DrawOpCode {\r\n Primitive = \"drawPrimitive\", // eslint-disable-line @typescript-eslint/no-shadow\r\n PushBranch = \"pushBranch\",\r\n PopBranch = \"popBranch\",\r\n PushBatch = \"pushBatch\",\r\n PopBatch = \"popBatch\",\r\n PushState = \"pushState\",\r\n PushClip = \"pushClip\",\r\n PopClip = \"popClip\",\r\n}\r\n\r\n/** @internal */\r\nexport class PopBatchCommand {\r\n public readonly opcode = \"popBatch\";\r\n\r\n private constructor() { }\r\n\r\n public static instance = new PopBatchCommand();\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.target.popBatch();\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PushBatchCommand {\r\n public readonly opcode = \"pushBatch\";\r\n\r\n public constructor(public readonly batch: Batch) { }\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.target.pushBatch(this.batch);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PushStateCommand {\r\n public readonly opcode = \"pushState\";\r\n\r\n public constructor(public readonly state: BranchState) { }\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.target.pushState(this.state);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PushBranchCommand {\r\n public readonly opcode = \"pushBranch\";\r\n\r\n public constructor(public readonly branch: Branch) { }\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.pushBranch(this.branch);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PopBranchCommand {\r\n public readonly opcode = \"popBranch\";\r\n\r\n private constructor() { }\r\n\r\n public static instance = new PopBranchCommand();\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.popBranch();\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PushClipCommand {\r\n public readonly opcode = \"pushClip\";\r\n\r\n public constructor(public readonly clip: ClipVolume) { }\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.target.uniforms.branch.clipStack.push(this.clip);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PopClipCommand {\r\n public readonly opcode = \"popClip\";\r\n\r\n private constructor() { }\r\n\r\n public static instance = new PopClipCommand();\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.target.uniforms.branch.clipStack.pop();\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PrimitiveCommand {\r\n public readonly opcode = \"drawPrimitive\";\r\n\r\n public constructor(public readonly primitive: Primitive) { }\r\n\r\n private static readonly _scratchTechniqueFlags = new TechniqueFlags();\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n if (exec.target.isGeometryOutsideActiveVolume(this.primitive.cachedGeometry))\r\n return;\r\n\r\n const techniqueId = this.primitive.techniqueId;\r\n if (TechniqueId.Invalid === techniqueId)\r\n return;\r\n\r\n const target = exec.target;\r\n const thematic = this.primitive.cachedGeometry.supportsThematicDisplay && target.wantThematicDisplay;\r\n const shadowable = (techniqueId === TechniqueId.Surface || techniqueId === TechniqueId.RealityMesh) && target.solarShadowMap.isReady && target.currentViewFlags.shadows && !thematic;\r\n const isShadowable = shadowable ? IsShadowable.Yes : IsShadowable.No;\r\n let isThematic = thematic ? IsThematic.Yes : IsThematic.No;\r\n const isClassified = (undefined !== target.currentPlanarClassifierOrDrape || undefined !== target.activeVolumeClassifierTexture) ? IsClassified.Yes : IsClassified.No;\r\n const isInstanced = this.primitive.isInstanced ? IsInstanced.Yes : IsInstanced.No;\r\n const isAnimated = this.primitive.hasAnimation ? IsAnimated.Yes : IsAnimated.No;\r\n\r\n // Point clouds do not support hillshade or slope mode for thematic display.\r\n if (isThematic && (undefined !== this.primitive.cachedGeometry.asPointCloud) && (target.uniforms.thematic.wantSlopeMode || target.uniforms.thematic.wantHillShadeMode))\r\n isThematic = IsThematic.No;\r\n\r\n const wiremesh = target.currentViewFlags.wiremesh && System.instance.isWebGL2 && (techniqueId === TechniqueId.Surface || techniqueId === TechniqueId.RealityMesh);\r\n const isWiremesh = wiremesh ? IsWiremesh.Yes : IsWiremesh.No;\r\n const flags = PrimitiveCommand._scratchTechniqueFlags;\r\n const posType = this.primitive.cachedGeometry.usesQuantizedPositions ? \"quantized\" : \"unquantized\";\r\n flags.init(target, exec.renderPass, isInstanced, isAnimated, isClassified, isShadowable, isThematic, isWiremesh, posType);\r\n\r\n const technique = target.techniques.getTechnique(techniqueId);\r\n const program = technique.getShader(flags);\r\n\r\n if (exec.setProgram(program))\r\n exec.target.compositor.drawPrimitive(this.primitive, exec, program.outputsToPick);\r\n }\r\n\r\n public get hasFeatures(): boolean { return this.primitive.hasFeatures; }\r\n public get renderOrder(): RenderOrder { return this.primitive.renderOrder; }\r\n\r\n public getPass(target: Target): Pass {\r\n return this.primitive.getPass(target);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport type PushCommand = PushBranchCommand | PushBatchCommand | PushStateCommand | PushClipCommand;\r\n/** @internal */\r\nexport type PopCommand = PopBranchCommand | PopBatchCommand | PopClipCommand;\r\n/** @internal */\r\nexport type DrawCommand = PushCommand | PopCommand | PrimitiveCommand;\r\n\r\n/** For a single RenderPass, an ordered list of commands to be executed during that pass.\r\n * @internal\r\n */\r\nexport type DrawCommands = DrawCommand[];\r\n\r\n/** Extracts the commands for rendering the flashed classifier (if any) from the by-index set of volume classifier commands.\r\n * NB: Cmds will be sets of some pushes, a primitive, and then some pops (equal to number of pushes).\r\n * The primitive should be right in the middle of a set. We need to find the set which matches the flashID.\r\n * @internal\r\n */\r\nexport function extractFlashedVolumeClassifierCommands(flashedId: Id64String, cmds: DrawCommands, numCmdsPerClassifier: number): DrawCommands | undefined {\r\n if (!Id64.isValid(flashedId) || 0 === numCmdsPerClassifier)\r\n return undefined;\r\n\r\n const firstPrim = (numCmdsPerClassifier - 1) / 2;\r\n for (let i = firstPrim; i < cmds.length; i += numCmdsPerClassifier) {\r\n assert(\"drawPrimitive\" === cmds[i].opcode, \"Command list not configured as expected.\");\r\n const pc: PrimitiveCommand = cmds[i] as PrimitiveCommand;\r\n const surface = pc.primitive.cachedGeometry.asSurface;\r\n if (undefined !== surface && undefined !== surface.mesh.uniformFeatureId) {\r\n let j = i - 1;\r\n while (j >= 0 && \"pushBatch\" !== cmds[j].opcode) // Find batch for this primitive\r\n j--;\r\n if (j < 0)\r\n continue;\r\n\r\n const pushBatch = cmds[j] as PushBatchCommand;\r\n const elemId = pushBatch.batch.featureTable.findElementId(surface.mesh.uniformFeatureId);\r\n if (undefined !== elemId && elemId === flashedId) {\r\n return cmds.slice(i - firstPrim, i + firstPrim + 1);\r\n }\r\n }\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\n/** @internal */\r\nexport function extractHilitedVolumeClassifierCommands(hilites: Hilites, cmds: DrawCommands): DrawCommands {\r\n // TODO: This could really be done at the time the HiliteClassification render pass commands are being generated\r\n // by just not putting the ones which are not hilited into the ClassificationHilite command list.\r\n const result: DrawCommand[] = [];\r\n\r\n let batch;\r\n for (const cmd of cmds) {\r\n switch (cmd.opcode) {\r\n case \"popBranch\":\r\n if (result.length > 0 && \"pushBranch\" === result[result.length - 1].opcode) {\r\n result.pop(); // remove empty push/pop pairs\r\n continue;\r\n }\r\n break;\r\n case \"popBatch\":\r\n batch = undefined;\r\n if (result.length > 0 && \"pushBatch\" === result[result.length - 1].opcode) {\r\n result.pop(); // remove empty push/pop pairs\r\n continue;\r\n }\r\n break;\r\n case \"pushBatch\":\r\n batch = cmd.batch;\r\n break;\r\n case \"drawPrimitive\":\r\n if (undefined !== batch) {\r\n // Skip any primitives that are not hilited.\r\n const surface = cmd.primitive.cachedGeometry.asSurface;\r\n if (undefined === surface || undefined === surface.mesh.uniformFeatureId)\r\n continue;\r\n\r\n const feature = batch.featureTable.getPackedFeature(surface.mesh.uniformFeatureId);\r\n if (undefined === feature || !isFeatureHilited(feature, hilites, hilites.models.hasId(batch.featureTable.modelId)))\r\n continue;\r\n\r\n break;\r\n }\r\n }\r\n\r\n result.push(cmd);\r\n }\r\n\r\n return result;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"DrawCommand.js","sourceRoot":"","sources":["../../../../src/render/webgl/DrawCommand.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/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C,CAAC,MAAM,EAAE;oBACzE,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,8BAA8B;oBAC5C,SAAS;iBACV;gBACD,MAAM;YACR,KAAK,WAAW;gBACd,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;gBAClB,MAAM;YACR,KAAK,eAAe;gBAClB,IAAI,SAAS,KAAK,KAAK,EAAE;oBACvB,4CAA4C;oBAC5C,MAAM,OAAO,GAAG,GAAG,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC;oBACvD,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,gBAAgB;wBACtE,SAAS;oBAEX,MAAM,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;oBACnF,IAAI,SAAS,KAAK,OAAO,IAAI,CAAC,IAAA,mCAAgB,EAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;wBAChH,SAAS;oBAEX,MAAM;iBACP;SACJ;QAED,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAClB;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA3CD,wFA2CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module WebGL\r\n */\r\n\r\nimport { assert, Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { BranchState } from \"./BranchState\";\r\nimport { CachedGeometry } from \"./CachedGeometry\";\r\nimport { ClipVolume } from \"./ClipVolume\";\r\nimport { isFeatureHilited } from \"./FeatureOverrides\";\r\nimport { Batch, Branch } from \"./Graphic\";\r\nimport { UniformHandle } from \"./UniformHandle\";\r\nimport { Primitive } from \"./Primitive\";\r\nimport { Pass, RenderOrder, RenderPass } from \"./RenderFlags\";\r\nimport { ShaderProgramExecutor } from \"./ShaderProgram\";\r\nimport { System } from \"./System\";\r\nimport { Hilites, Target } from \"./Target\";\r\nimport { IsAnimated, IsClassified, IsInstanced, IsShadowable, IsThematic, IsWiremesh, TechniqueFlags } from \"./TechniqueFlags\";\r\nimport { TechniqueId } from \"./TechniqueId\";\r\n\r\n/* eslint-disable no-restricted-syntax */\r\n\r\n/** @internal */\r\nexport class ShaderProgramParams {\r\n private _target?: Target;\r\n private _renderPass: RenderPass = RenderPass.None;\r\n\r\n public get target(): Target {\r\n assert(undefined !== this._target);\r\n return this._target;\r\n }\r\n\r\n public get renderPass() { return this._renderPass; }\r\n\r\n public get projectionMatrix() { return this.target.uniforms.getProjectionMatrix32(this.isViewCoords); }\r\n public bindProjectionMatrix(uniform: UniformHandle) { this.target.uniforms.bindProjectionMatrix(uniform, this.isViewCoords); }\r\n\r\n public get isViewCoords() { return RenderPass.ViewOverlay === this.renderPass || RenderPass.Background === this.renderPass; }\r\n public get isOverlayPass() { return RenderPass.WorldOverlay === this.renderPass || RenderPass.ViewOverlay === this.renderPass; }\r\n public get context() { return System.instance.context; }\r\n\r\n public init(target: Target, pass: RenderPass = RenderPass.OpaqueGeneral) {\r\n this._renderPass = pass;\r\n this._target = target;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class DrawParams {\r\n private _programParams?: ShaderProgramParams;\r\n private _geometry?: CachedGeometry;\r\n\r\n public get geometry(): CachedGeometry {\r\n assert(undefined !== this._geometry);\r\n return this._geometry;\r\n }\r\n\r\n public get programParams(): ShaderProgramParams {\r\n assert(undefined !== this._programParams);\r\n return this._programParams;\r\n }\r\n\r\n public get target() { return this.programParams.target; }\r\n public get renderPass() { return this.programParams.renderPass; }\r\n public get projectionMatrix() { return this.programParams.projectionMatrix; }\r\n public get isViewCoords() {\r\n return this.programParams.isViewCoords || this.target.currentBranch.forceViewCoords;\r\n }\r\n public get isOverlayPass() { return this.programParams.isOverlayPass; }\r\n public get context() { return this.programParams.context; }\r\n\r\n public init(programParams: ShaderProgramParams, geometry: CachedGeometry) {\r\n this._programParams = programParams;\r\n this._geometry = geometry;\r\n }\r\n}\r\n\r\n/** Defines operation associated with pushing or popping a branch\r\n * @internal\r\n */\r\nexport const enum PushOrPop {\r\n Push,\r\n Pop,\r\n}\r\n\r\n/** Represents a command to be executed within a RenderPass. The most common command is\r\n * to draw a primitive; others involve state changes such as pushing/popping transforms\r\n * and symbology overrides, which require that commands be executed in order.\r\n * @internal\r\n */\r\nexport enum DrawOpCode {\r\n Primitive = \"drawPrimitive\", // eslint-disable-line @typescript-eslint/no-shadow\r\n PushBranch = \"pushBranch\",\r\n PopBranch = \"popBranch\",\r\n PushBatch = \"pushBatch\",\r\n PopBatch = \"popBatch\",\r\n PushState = \"pushState\",\r\n PushClip = \"pushClip\",\r\n PopClip = \"popClip\",\r\n}\r\n\r\n/** @internal */\r\nexport class PopBatchCommand {\r\n public readonly opcode = \"popBatch\";\r\n\r\n private constructor() { }\r\n\r\n public static instance = new PopBatchCommand();\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.target.popBatch();\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PushBatchCommand {\r\n public readonly opcode = \"pushBatch\";\r\n\r\n public constructor(public readonly batch: Batch) { }\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.target.pushBatch(this.batch);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PushStateCommand {\r\n public readonly opcode = \"pushState\";\r\n\r\n public constructor(public readonly state: BranchState) { }\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.target.pushState(this.state);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PushBranchCommand {\r\n public readonly opcode = \"pushBranch\";\r\n\r\n public constructor(public readonly branch: Branch) { }\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.pushBranch(this.branch);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PopBranchCommand {\r\n public readonly opcode = \"popBranch\";\r\n\r\n private constructor() { }\r\n\r\n public static instance = new PopBranchCommand();\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.popBranch();\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PushClipCommand {\r\n public readonly opcode = \"pushClip\";\r\n\r\n public constructor(public readonly clip: ClipVolume) { }\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.target.uniforms.branch.clipStack.push(this.clip);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PopClipCommand {\r\n public readonly opcode = \"popClip\";\r\n\r\n private constructor() { }\r\n\r\n public static instance = new PopClipCommand();\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n exec.target.uniforms.branch.clipStack.pop();\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport class PrimitiveCommand {\r\n public readonly opcode = \"drawPrimitive\";\r\n\r\n public constructor(public readonly primitive: Primitive) { }\r\n\r\n private static readonly _scratchTechniqueFlags = new TechniqueFlags();\r\n\r\n public execute(exec: ShaderProgramExecutor): void {\r\n if (exec.target.isGeometryOutsideActiveVolume(this.primitive.cachedGeometry))\r\n return;\r\n\r\n const techniqueId = this.primitive.techniqueId;\r\n if (TechniqueId.Invalid === techniqueId)\r\n return;\r\n\r\n const target = exec.target;\r\n const thematic = this.primitive.cachedGeometry.supportsThematicDisplay && target.wantThematicDisplay;\r\n const shadowable = (techniqueId === TechniqueId.Surface || techniqueId === TechniqueId.RealityMesh) && target.solarShadowMap.isReady && target.currentViewFlags.shadows && !thematic;\r\n const isShadowable = shadowable ? IsShadowable.Yes : IsShadowable.No;\r\n let isThematic = thematic ? IsThematic.Yes : IsThematic.No;\r\n const isClassified = (undefined !== target.currentPlanarClassifierOrDrape || undefined !== target.activeVolumeClassifierTexture) ? IsClassified.Yes : IsClassified.No;\r\n const isInstanced = this.primitive.isInstanced ? IsInstanced.Yes : IsInstanced.No;\r\n const isAnimated = this.primitive.hasAnimation ? IsAnimated.Yes : IsAnimated.No;\r\n\r\n // Point clouds do not support hillshade or slope mode for thematic display.\r\n if (isThematic && (undefined !== this.primitive.cachedGeometry.asPointCloud) && (target.uniforms.thematic.wantSlopeMode || target.uniforms.thematic.wantHillShadeMode))\r\n isThematic = IsThematic.No;\r\n\r\n const wiremesh = target.currentViewFlags.wiremesh && System.instance.isWebGL2 && (techniqueId === TechniqueId.Surface || techniqueId === TechniqueId.RealityMesh);\r\n const isWiremesh = wiremesh ? IsWiremesh.Yes : IsWiremesh.No;\r\n const flags = PrimitiveCommand._scratchTechniqueFlags;\r\n const posType = this.primitive.cachedGeometry.usesQuantizedPositions ? \"quantized\" : \"unquantized\";\r\n flags.init(target, exec.renderPass, isInstanced, isAnimated, isClassified, isShadowable, isThematic, isWiremesh, posType);\r\n\r\n const technique = target.techniques.getTechnique(techniqueId);\r\n const program = technique.getShader(flags);\r\n\r\n if (exec.setProgram(program))\r\n exec.target.compositor.drawPrimitive(this.primitive, exec, program.outputsToPick);\r\n }\r\n\r\n public get hasFeatures(): boolean { return this.primitive.hasFeatures; }\r\n public get renderOrder(): RenderOrder { return this.primitive.renderOrder; }\r\n\r\n public getPass(target: Target): Pass {\r\n return this.primitive.getPass(target);\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport type PushCommand = PushBranchCommand | PushBatchCommand | PushStateCommand | PushClipCommand;\r\n/** @internal */\r\nexport type PopCommand = PopBranchCommand | PopBatchCommand | PopClipCommand;\r\n/** @internal */\r\nexport type DrawCommand = PushCommand | PopCommand | PrimitiveCommand;\r\n\r\n/** For a single RenderPass, an ordered list of commands to be executed during that pass.\r\n * @internal\r\n */\r\nexport type DrawCommands = DrawCommand[];\r\n\r\n/** Extracts the commands for rendering the flashed classifier (if any) from the by-index set of volume classifier commands.\r\n * NB: Cmds will be sets of some pushes, a primitive, and then some pops (equal to number of pushes).\r\n * The primitive should be right in the middle of a set. We need to find the set which matches the flashID.\r\n * @internal\r\n */\r\nexport function extractFlashedVolumeClassifierCommands(flashedId: Id64String, cmds: DrawCommands, numCmdsPerClassifier: number): DrawCommands | undefined {\r\n if (!Id64.isValid(flashedId) || 0 === numCmdsPerClassifier)\r\n return undefined;\r\n\r\n const firstPrim = (numCmdsPerClassifier - 1) / 2;\r\n for (let i = firstPrim; i < cmds.length; i += numCmdsPerClassifier) {\r\n assert(\"drawPrimitive\" === cmds[i].opcode, \"Command list not configured as expected.\");\r\n const pc: PrimitiveCommand = cmds[i] as PrimitiveCommand;\r\n const surface = pc.primitive.cachedGeometry.asSurface;\r\n if (undefined !== surface && undefined !== surface.mesh.uniformFeatureId) {\r\n let j = i - 1;\r\n while (j >= 0 && \"pushBatch\" !== cmds[j].opcode) // Find batch for this primitive\r\n j--;\r\n if (j < 0)\r\n continue;\r\n\r\n const pushBatch = cmds[j] as PushBatchCommand;\r\n const elemId = pushBatch.batch.featureTable.findElementId(surface.mesh.uniformFeatureId);\r\n if (undefined !== elemId && elemId === flashedId) {\r\n return cmds.slice(i - firstPrim, i + firstPrim + 1);\r\n }\r\n }\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\n/** @internal */\r\nexport function extractHilitedVolumeClassifierCommands(hilites: Hilites, cmds: DrawCommands): DrawCommands {\r\n // TODO: This could really be done at the time the HiliteClassification render pass commands are being generated\r\n // by just not putting the ones which are not hilited into the ClassificationHilite command list.\r\n const result: DrawCommand[] = [];\r\n\r\n let batch;\r\n for (const cmd of cmds) {\r\n switch (cmd.opcode) {\r\n case \"popBranch\":\r\n if (result.length > 0 && \"pushBranch\" === result[result.length - 1].opcode) {\r\n result.pop(); // remove empty push/pop pairs\r\n continue;\r\n }\r\n break;\r\n case \"popBatch\":\r\n batch = undefined;\r\n if (result.length > 0 && \"pushBatch\" === result[result.length - 1].opcode) {\r\n result.pop(); // remove empty push/pop pairs\r\n continue;\r\n }\r\n break;\r\n case \"pushBatch\":\r\n batch = cmd.batch;\r\n break;\r\n case \"drawPrimitive\":\r\n if (undefined !== batch) {\r\n // Skip any primitives that are not hilited.\r\n const surface = cmd.primitive.cachedGeometry.asSurface;\r\n if (undefined === surface || undefined === surface.mesh.uniformFeatureId)\r\n continue;\r\n\r\n const feature = batch.featureTable.getPackedFeature(surface.mesh.uniformFeatureId);\r\n if (undefined === feature || !isFeatureHilited(feature, hilites, hilites.models.hasId(batch.featureTable.modelId)))\r\n continue;\r\n\r\n break;\r\n }\r\n }\r\n\r\n result.push(cmd);\r\n }\r\n\r\n return result;\r\n}\r\n"]}
|
|
@@ -67,7 +67,8 @@ export declare class RenderCommands implements Iterable<DrawCommands> {
|
|
|
67
67
|
pushAndPopState(state: BranchState, func: () => void): void;
|
|
68
68
|
clear(): void;
|
|
69
69
|
private _clearCommands;
|
|
70
|
-
|
|
70
|
+
private initForPickOverlayDecorations;
|
|
71
|
+
initForPickOverlays(sceneOverlays: GraphicList, worldOverlayDecorations: GraphicList | undefined, viewOverlayDecorations: GraphicList | undefined): void;
|
|
71
72
|
initForReadPixels(gfx: TargetGraphics): void;
|
|
72
73
|
initForRender(gfx: TargetGraphics): void;
|
|
73
74
|
addPrimitive(prim: Primitive): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderCommands.d.ts","sourceRoot":"","sources":["../../../../src/render/webgl/RenderCommands.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,OAAO,EAA6B,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGnF,OAAO,EAAE,WAAW,EAAiB,MAAM,kBAAkB,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,YAAY,EAAiE,gBAAgB,EAE9F,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAiB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AE,SAAS,GAAG,IAAI;IA2BnC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAM/B,4BAA4B,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU;IAwBtD,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAsE5B,aAAa,CAAC,OAAO,EAAE,OAAO;IAE9B,eAAe,IAAI,IAAI;IAE9B,OAAO,CAAC,2BAA2B;IAkC5B,IAAI,IAAI,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CA8BtD"}
|
|
@@ -389,18 +389,26 @@ class RenderCommands {
|
|
|
389
389
|
this._commands.forEach((cmds) => cmds.splice(0));
|
|
390
390
|
this._layers.clear();
|
|
391
391
|
}
|
|
392
|
-
|
|
392
|
+
initForPickOverlayDecorations(overlays) {
|
|
393
|
+
for (const overlay of overlays) {
|
|
394
|
+
const gf = overlay;
|
|
395
|
+
if (gf.isPickable)
|
|
396
|
+
gf.addCommands(this);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
initForPickOverlays(sceneOverlays, worldOverlayDecorations, viewOverlayDecorations) {
|
|
393
400
|
this._clearCommands();
|
|
394
401
|
this._addTranslucentAsOpaque = true;
|
|
395
402
|
for (const sceneGf of sceneOverlays)
|
|
396
403
|
sceneGf.addCommands(this);
|
|
397
|
-
if (
|
|
404
|
+
if (worldOverlayDecorations === null || worldOverlayDecorations === void 0 ? void 0 : worldOverlayDecorations.length) {
|
|
398
405
|
this.pushAndPopState(this.target.decorationsState, () => {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
406
|
+
this.initForPickOverlayDecorations(worldOverlayDecorations);
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
if (viewOverlayDecorations === null || viewOverlayDecorations === void 0 ? void 0 : viewOverlayDecorations.length) {
|
|
410
|
+
this.pushAndPopState(this.target.decorationsState.withViewCoords(), () => {
|
|
411
|
+
this.initForPickOverlayDecorations(viewOverlayDecorations);
|
|
404
412
|
});
|
|
405
413
|
}
|
|
406
414
|
this._addTranslucentAsOpaque = false;
|