@itwin/rpcinterface-full-stack-tests 4.3.0-dev.23 → 4.3.0-dev.25

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.
@@ -31343,6 +31343,7 @@ var ChangesetType;
31343
31343
  "use strict";
31344
31344
  __webpack_require__.r(__webpack_exports__);
31345
31345
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31346
+ /* harmony export */ ClipIntersectionStyle: () => (/* binding */ ClipIntersectionStyle),
31346
31347
  /* harmony export */ ClipStyle: () => (/* binding */ ClipStyle),
31347
31348
  /* harmony export */ CutStyle: () => (/* binding */ CutStyle)
31348
31349
  /* harmony export */ });
@@ -31350,6 +31351,7 @@ __webpack_require__.r(__webpack_exports__);
31350
31351
  /* harmony import */ var _RgbColor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RgbColor */ "../../core/common/lib/esm/RgbColor.js");
31351
31352
  /* harmony import */ var _HiddenLine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./HiddenLine */ "../../core/common/lib/esm/HiddenLine.js");
31352
31353
  /* harmony import */ var _FeatureSymbology__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FeatureSymbology */ "../../core/common/lib/esm/FeatureSymbology.js");
31354
+ /* harmony import */ var _ColorDef__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ColorDef */ "../../core/common/lib/esm/ColorDef.js");
31353
31355
  /*---------------------------------------------------------------------------------------------
31354
31356
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
31355
31357
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -31361,6 +31363,7 @@ __webpack_require__.r(__webpack_exports__);
31361
31363
 
31362
31364
 
31363
31365
 
31366
+
31364
31367
  /** As part of a [[ClipStyle]], describes how section-cut graphics should be displayed.
31365
31368
  * @note Section-cut graphics are only produced if [[ClipStyle.produceCutGeometry]] is `true`.
31366
31369
  * @public
@@ -31413,30 +31416,89 @@ class CutStyle {
31413
31416
  /** The default CutStyle, configured to draw the section-cut graphics using the view's settings, with no overrides. */
31414
31417
  CutStyle.defaults = new CutStyle();
31415
31418
 
31419
+ /** As part of a [[ClipStyle]], describes how to colorize geometry intersecting the clip planes.
31420
+ * @note Edges are highlighted only if [[ClipStyle.ClipIntersectionStyle]] is `true`.
31421
+ * @public
31422
+ * @extensions
31423
+ */
31424
+ class ClipIntersectionStyle {
31425
+ constructor(color = _RgbColor__WEBPACK_IMPORTED_MODULE_1__.RgbColor.fromColorDef(_ColorDef__WEBPACK_IMPORTED_MODULE_4__.ColorDef.white), width = 1) {
31426
+ this.color = color;
31427
+ this.width = width;
31428
+ }
31429
+ /** Create a highlight from its components. */
31430
+ static create(color, width) {
31431
+ if (!color && !width)
31432
+ return this.defaults;
31433
+ return new ClipIntersectionStyle(color, width);
31434
+ }
31435
+ static fromJSON(props) {
31436
+ if (props === undefined) {
31437
+ return ClipIntersectionStyle.defaults;
31438
+ }
31439
+ const color = props.color ? _RgbColor__WEBPACK_IMPORTED_MODULE_1__.RgbColor.fromJSON(props.color) : _RgbColor__WEBPACK_IMPORTED_MODULE_1__.RgbColor.fromColorDef(_ColorDef__WEBPACK_IMPORTED_MODULE_4__.ColorDef.white);
31440
+ const width = props.width ? props.width : 1;
31441
+ return new ClipIntersectionStyle(color, width);
31442
+ }
31443
+ /** The JSON representation of this style. It is `undefined` if this style matches the defaults. */
31444
+ toJSON() {
31445
+ const props = {};
31446
+ if (this.matchesDefaults) {
31447
+ return undefined;
31448
+ }
31449
+ if (this.color)
31450
+ props.color = this.color.toJSON();
31451
+ if (this.width)
31452
+ props.width = this.width;
31453
+ return props;
31454
+ }
31455
+ get matchesDefaults() {
31456
+ if (this === ClipIntersectionStyle.defaults)
31457
+ return true;
31458
+ return !this.color && !this.width;
31459
+ }
31460
+ }
31461
+ ClipIntersectionStyle.defaults = new ClipIntersectionStyle();
31462
+
31416
31463
  /** Describes symbology and behavior applied to a [ClipVector]($core-geometry) when applied to a [ViewState]($frontend) or [[ModelClipGroup]].
31417
31464
  * @see [[DisplayStyleSettings.clipStyle]].
31418
31465
  * @public
31419
31466
  */
31420
31467
  class ClipStyle {
31421
- constructor(produceCutGeometry, cutStyle, inside, outside) {
31468
+ constructor(produceCutGeometry, colorizeIntersection, cutStyle, inside, outside, intersectionStyle) {
31422
31469
  this.produceCutGeometry = produceCutGeometry;
31470
+ this.colorizeIntersection = colorizeIntersection;
31423
31471
  this.cutStyle = cutStyle;
31424
31472
  this.insideColor = inside;
31425
31473
  this.outsideColor = outside;
31474
+ this.intersectionStyle = intersectionStyle;
31426
31475
  }
31427
- /** Create a style from its components. */
31428
- static create(produceCutGeometry, cutStyle, insideColor, outsideColor) {
31429
- if (!produceCutGeometry && cutStyle.matchesDefaults && !insideColor && !outsideColor)
31476
+ /** @internal */
31477
+ static create(styleOrProduceCutGeometry, cutStyle, insideColor, outsideColor) {
31478
+ if (typeof styleOrProduceCutGeometry === "boolean") {
31479
+ cutStyle = cutStyle === undefined ? CutStyle.defaults : cutStyle;
31480
+ if (!styleOrProduceCutGeometry && cutStyle.matchesDefaults && !insideColor && !outsideColor) {
31481
+ return this.defaults;
31482
+ }
31483
+ return new ClipStyle(styleOrProduceCutGeometry, false, cutStyle, insideColor, outsideColor, undefined);
31484
+ }
31485
+ const style = styleOrProduceCutGeometry;
31486
+ if (!style.produceCutGeometry && !style.colorizeIntersection && (!style.cutStyle || style.cutStyle.matchesDefaults) && !style.insideColor && !style.outsideColor && !style.intersectionStyle)
31430
31487
  return this.defaults;
31431
- return new ClipStyle(produceCutGeometry, cutStyle, insideColor, outsideColor);
31488
+ const produceCutGeometry = style.produceCutGeometry ? true : false;
31489
+ const colorizeIntersection = style.colorizeIntersection ? true : false;
31490
+ cutStyle = style.cutStyle === undefined ? CutStyle.defaults : style.cutStyle;
31491
+ return new ClipStyle(produceCutGeometry, colorizeIntersection, cutStyle, style.insideColor, style.outsideColor, style.intersectionStyle);
31432
31492
  }
31433
31493
  static fromJSON(props) {
31434
31494
  if (_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.isNonEmptyObject(props)) {
31435
31495
  const produceCutGeometry = props.produceCutGeometry ?? false;
31496
+ const colorizeIntersection = props.colorizeIntersection ? true : false;
31436
31497
  const cutStyle = CutStyle.fromJSON(props.cutStyle);
31437
- const inside = props.insideColor ? _RgbColor__WEBPACK_IMPORTED_MODULE_1__.RgbColor.fromJSON(props.insideColor) : undefined;
31438
- const outside = props.outsideColor ? _RgbColor__WEBPACK_IMPORTED_MODULE_1__.RgbColor.fromJSON(props.outsideColor) : undefined;
31439
- return this.create(produceCutGeometry, cutStyle, inside, outside);
31498
+ const insideColor = props.insideColor ? _RgbColor__WEBPACK_IMPORTED_MODULE_1__.RgbColor.fromJSON(props.insideColor) : undefined;
31499
+ const outsideColor = props.outsideColor ? _RgbColor__WEBPACK_IMPORTED_MODULE_1__.RgbColor.fromJSON(props.outsideColor) : undefined;
31500
+ const intersectionStyle = props.intersectionStyle ? ClipIntersectionStyle.fromJSON(props.intersectionStyle) : undefined;
31501
+ return this.create({ produceCutGeometry, colorizeIntersection, cutStyle, insideColor, outsideColor, intersectionStyle });
31440
31502
  }
31441
31503
  return this.defaults;
31442
31504
  }
@@ -31447,6 +31509,8 @@ class ClipStyle {
31447
31509
  const props = {};
31448
31510
  if (this.produceCutGeometry)
31449
31511
  props.produceCutGeometry = true;
31512
+ if (this.colorizeIntersection)
31513
+ props.colorizeIntersection = true;
31450
31514
  const cutStyle = this.cutStyle.toJSON();
31451
31515
  if (cutStyle) {
31452
31516
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!this.cutStyle.matchesDefaults);
@@ -31456,17 +31520,19 @@ class ClipStyle {
31456
31520
  props.insideColor = this.insideColor.toJSON();
31457
31521
  if (this.outsideColor)
31458
31522
  props.outsideColor = this.outsideColor.toJSON();
31523
+ if (this.intersectionStyle)
31524
+ props.intersectionStyle = this.intersectionStyle.toJSON();
31459
31525
  return props;
31460
31526
  }
31461
31527
  /** Returns true if this style matches the [[ClipStyle.defaults]] - that is, it overrides no settings from the view. */
31462
31528
  get matchesDefaults() {
31463
31529
  if (this === ClipStyle.defaults)
31464
31530
  return true;
31465
- return !this.produceCutGeometry && !this.insideColor && !this.outsideColor && this.cutStyle.matchesDefaults;
31531
+ return !this.produceCutGeometry && !this.colorizeIntersection && !this.insideColor && !this.outsideColor && this.cutStyle.matchesDefaults && !this.intersectionStyle;
31466
31532
  }
31467
31533
  }
31468
31534
  /** The default style, which overrides none of the view's settings. */
31469
- ClipStyle.defaults = new ClipStyle(false, CutStyle.defaults, undefined, undefined);
31535
+ ClipStyle.defaults = new ClipStyle(false, false, CutStyle.defaults, undefined, undefined, undefined);
31470
31536
 
31471
31537
 
31472
31538
 
@@ -46990,6 +47056,7 @@ __webpack_require__.r(__webpack_exports__);
46990
47056
  /* harmony export */ ChangedValueState: () => (/* reexport safe */ _ECSqlTypes__WEBPACK_IMPORTED_MODULE_21__.ChangedValueState),
46991
47057
  /* harmony export */ ChangesetType: () => (/* reexport safe */ _ChangesetProps__WEBPACK_IMPORTED_MODULE_11__.ChangesetType),
46992
47058
  /* harmony export */ ChannelConstraintError: () => (/* reexport safe */ _IModelError__WEBPACK_IMPORTED_MODULE_62__.ChannelConstraintError),
47059
+ /* harmony export */ ClipIntersectionStyle: () => (/* reexport safe */ _ClipStyle__WEBPACK_IMPORTED_MODULE_12__.ClipIntersectionStyle),
46993
47060
  /* harmony export */ ClipStyle: () => (/* reexport safe */ _ClipStyle__WEBPACK_IMPORTED_MODULE_12__.ClipStyle),
46994
47061
  /* harmony export */ Code: () => (/* reexport safe */ _Code__WEBPACK_IMPORTED_MODULE_13__.Code),
46995
47062
  /* harmony export */ CodeScopeSpec: () => (/* reexport safe */ _Code__WEBPACK_IMPORTED_MODULE_13__.CodeScopeSpec),
@@ -102449,6 +102516,7 @@ const extensionExports = {
102449
102516
  ChangedValueState: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ChangedValueState,
102450
102517
  ChangesetType: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ChangesetType,
102451
102518
  ClipEventType: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.ClipEventType,
102519
+ ClipIntersectionStyle: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ClipIntersectionStyle,
102452
102520
  Cluster: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.Cluster,
102453
102521
  ColorByName: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorByName,
102454
102522
  ColorDef: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.ColorDef,
@@ -113184,6 +113252,10 @@ class ClipStack {
113184
113252
  this._outsideColor = _FloatRGBA__WEBPACK_IMPORTED_MODULE_3__.FloatRgba.from(0, 0, 0, 0);
113185
113253
  /** For detecting whether the transform changed from one invocation of setViewClip to the next. */
113186
113254
  this._prevTransform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createZero();
113255
+ /** True if we want to colorize geometry intersecting clip planes */
113256
+ this._colorizeIntersection = false;
113257
+ /** The style to colorize the geometry intersecting clip planes */
113258
+ this._intersectionStyle = _FloatRGBA__WEBPACK_IMPORTED_MODULE_3__.FloatRgba.from(0, 0, 0, 0);
113187
113259
  this._getTransform = getTransform;
113188
113260
  this._wantViewClip = wantViewClip;
113189
113261
  this._numTotalRows = this._numRowsInUse = 0;
@@ -113199,6 +113271,15 @@ class ClipStack {
113199
113271
  get hasOutsideColor() {
113200
113272
  return this.outsideColor.alpha !== 0;
113201
113273
  }
113274
+ get colorizeIntersection() {
113275
+ return this._colorizeIntersection;
113276
+ }
113277
+ set colorizeIntersection(b) {
113278
+ this._colorizeIntersection = b;
113279
+ }
113280
+ get intersectionStyle() {
113281
+ return this._intersectionStyle;
113282
+ }
113202
113283
  get bytesUsed() {
113203
113284
  return this._texture ? this._texture.bytesUsed : 0;
113204
113285
  }
@@ -113206,6 +113287,7 @@ class ClipStack {
113206
113287
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(this._stack.length === 1);
113207
113288
  this.updateColor(style.insideColor, this._insideColor);
113208
113289
  this.updateColor(style.outsideColor, this._outsideColor);
113290
+ this.updateIntersectionStyle(style.colorizeIntersection, style.intersectionStyle, this._intersectionStyle);
113209
113291
  const transform = this._getTransform();
113210
113292
  if (!transform.isAlmostEqual(this._prevTransform)) {
113211
113293
  transform.clone(this._prevTransform);
@@ -113342,6 +113424,15 @@ class ClipStack {
113342
113424
  if (rgb)
113343
113425
  rgba.setRgbColor(rgb);
113344
113426
  }
113427
+ updateIntersectionStyle(colorizeIntersection, style, _thisStyle) {
113428
+ this._colorizeIntersection = colorizeIntersection === true ? true : false;
113429
+ if (style !== undefined) {
113430
+ if (style.color !== undefined)
113431
+ _thisStyle.setRgbColor(style.color);
113432
+ if (style.width !== undefined)
113433
+ _thisStyle.alpha = style.width;
113434
+ }
113435
+ }
113345
113436
  }
113346
113437
 
113347
113438
 
@@ -123590,6 +123681,7 @@ var Convert;
123590
123681
  case 8 /* VariableType.Sampler2D */: return "sampler2D";
123591
123682
  case 9 /* VariableType.SamplerCube */: return "samplerCube";
123592
123683
  case 10 /* VariableType.Uint */: return "uint";
123684
+ case 11 /* VariableType.BVec2 */: return "bvec2";
123593
123685
  default:
123594
123686
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false);
123595
123687
  return "undefined";
@@ -123800,6 +123892,7 @@ class ShaderVariables {
123800
123892
  variableSize = 1;
123801
123893
  break;
123802
123894
  case 3 /* VariableType.Vec2 */:
123895
+ case 11 /* VariableType.BVec2 */:
123803
123896
  variableSize = 2;
123804
123897
  break;
123805
123898
  case 4 /* VariableType.Vec3 */:
@@ -123866,6 +123959,7 @@ class ShaderVariables {
123866
123959
  variableSize = 1;
123867
123960
  break;
123868
123961
  case 3 /* VariableType.Vec2 */:
123962
+ case 11 /* VariableType.BVec2 */:
123869
123963
  variableSize = 2;
123870
123964
  break;
123871
123965
  case 4 /* VariableType.Vec3 */:
@@ -124249,9 +124343,9 @@ class FragmentShaderBuilder extends ShaderBuilder {
124249
124343
  const applyClipping = this.get(10 /* FragmentShaderComponent.ApplyClipping */);
124250
124344
  if (undefined !== applyClipping) {
124251
124345
  prelude.addline("vec3 g_clipColor;\n");
124252
- prelude.addFunction("bool applyClipping(vec4 baseColor)", applyClipping);
124253
- main.addline(" bool hasClipColor = applyClipping(baseColor);");
124254
- main.addline(" if (hasClipColor) { baseColor.rgb = g_clipColor; } else {");
124346
+ prelude.addFunction("bvec2 applyClipping(vec4 baseColor)", applyClipping);
124347
+ main.addline(" g_hasClipColor = applyClipping(baseColor);");
124348
+ main.addline(" if (g_hasClipColor.x) { baseColor.rgb = g_clipColor; } else {");
124255
124349
  clipIndent = " ";
124256
124350
  }
124257
124351
  const applyMaterialOverrides = this.get(2 /* FragmentShaderComponent.ApplyMaterialOverrides */);
@@ -124307,6 +124401,9 @@ class FragmentShaderBuilder extends ShaderBuilder {
124307
124401
  prelude.addFunction("vec4 applyLighting(vec4 baseColor)", applyLighting);
124308
124402
  main.addline(" baseColor = applyLighting(baseColor);");
124309
124403
  }
124404
+ if (undefined !== applyClipping) {
124405
+ main.addline(" if (g_hasClipColor.y) { baseColor.rgba = vec4(g_clipColor, 1.0); } ");
124406
+ }
124310
124407
  const reverseWoW = this.get(9 /* FragmentShaderComponent.ReverseWhiteOnWhite */);
124311
124408
  if (undefined !== reverseWoW) {
124312
124409
  prelude.addFunction("vec4 reverseWhiteOnWhite(vec4 baseColor)", reverseWoW);
@@ -132150,7 +132247,9 @@ __webpack_require__.r(__webpack_exports__);
132150
132247
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
132151
132248
  /* harmony import */ var _RenderFlags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../RenderFlags */ "../../core/frontend/lib/esm/render/webgl/RenderFlags.js");
132152
132249
  /* harmony import */ var _Common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Common */ "../../core/frontend/lib/esm/render/webgl/glsl/Common.js");
132153
- /* harmony import */ var _Vertex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Vertex */ "../../core/frontend/lib/esm/render/webgl/glsl/Vertex.js");
132250
+ /* harmony import */ var _FeatureSymbology__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FeatureSymbology */ "../../core/frontend/lib/esm/render/webgl/glsl/FeatureSymbology.js");
132251
+ /* harmony import */ var _Translucency__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Translucency */ "../../core/frontend/lib/esm/render/webgl/glsl/Translucency.js");
132252
+ /* harmony import */ var _Vertex__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Vertex */ "../../core/frontend/lib/esm/render/webgl/glsl/Vertex.js");
132154
132253
  /*---------------------------------------------------------------------------------------------
132155
132254
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
132156
132255
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -132162,11 +132261,11 @@ __webpack_require__.r(__webpack_exports__);
132162
132261
 
132163
132262
 
132164
132263
 
132264
+
132265
+
132165
132266
  const getClipPlaneFloat = `
132166
132267
  vec4 getClipPlane(int index) {
132167
- float x = 0.5;
132168
- float y = (float(index) + 0.5) / float(u_clipParams[2]);
132169
- return TEXTURE(s_clipSampler, vec2(x, y));
132268
+ return texelFetch(s_clipSampler, ivec2(0, index), 0);
132170
132269
  }
132171
132270
  `;
132172
132271
  const unpackFloat = `
@@ -132187,57 +132286,112 @@ float calcClipPlaneDist(vec3 camPos, vec4 plane) {
132187
132286
  return dot(vec4(camPos, 1.0), plane);
132188
132287
  }
132189
132288
  `;
132289
+ const applyClipPlanesLoop = `
132290
+ for (int i = u_clipParams[0]; i < u_clipParams[1]; i++) {
132291
+ `;
132292
+ const applyClipPlanesLoopBody = `
132293
+ vec4 plane = getClipPlane(i);
132294
+ if (plane.x == 2.0) { // indicates start of new UnionOfConvexClipPlaneSets
132295
+ if (numSetsClippedBy + int(clippedByCurrentPlaneSet) == numPlaneSets)
132296
+ break;
132297
+
132298
+ numPlaneSets = 1;
132299
+ numSetsClippedBy = 0;
132300
+ clippedByCurrentPlaneSet = false;
132301
+ } else if (plane.xyz == vec3(0.0)) { // indicates start of new clip plane set
132302
+ numPlaneSets = numPlaneSets + 1;
132303
+ numSetsClippedBy += int(clippedByCurrentPlaneSet);
132304
+ clippedByCurrentPlaneSet = false;
132305
+ } else if (!clippedByCurrentPlaneSet && calcClipPlaneDist(v_eyeSpace, plane) < 0.0) {
132306
+ clippedByCurrentPlaneSet = true;
132307
+ }
132308
+ `;
132309
+ const applyClipPlanesIntersectionLoopBody = `
132310
+ if ((i <= u_clipParams[1] - 2) && (!clippedByCurrentPlaneSet)) {
132311
+
132312
+ //Obtaining closest point on plane to current frag in eyespace
132313
+ vec3 pointOnPlane = v_eyeSpace - (abs(calcClipPlaneDist(v_eyeSpace, plane)) * plane.xyz);
132314
+
132315
+ //determining whether to colorize
132316
+ if (distance(v_eyeSpace, pointOnPlane) <= (kFrustumType_Perspective == u_frustum.z ? -pointOnPlane.z * widthFactor : widthFactor)) {
132317
+ colorizeIntersection = true;
132318
+ }
132319
+ }
132320
+ }
132321
+
132322
+ //Need to pull this condition out of the loop for when there are multiple clip planes defined
132323
+ if (colorizeIntersection && !clippedByCurrentPlaneSet) {
132324
+ g_clipColor = u_clipIntersection.rgb;
132325
+ return bvec2(true, true);
132326
+ }
132327
+ `;
132190
132328
  const applyClipPlanesPrelude = `
132191
132329
  int numPlaneSets = 1;
132192
132330
  int numSetsClippedBy = 0;
132193
132331
  bool clippedByCurrentPlaneSet = false;
132194
- `;
132195
- const applyClipPlanesLoop = `
132196
- for (int i = u_clipParams[0]; i < u_clipParams[1]; i++) {
132332
+ bool colorizeIntersection = false;
132333
+ if (u_colorizeIntersection) {
132334
+ float widthFactor = u_pixelWidthFactor * 2.0 * u_clipIntersection.a;
132335
+ ${applyClipPlanesLoop}${applyClipPlanesLoopBody}${applyClipPlanesIntersectionLoopBody}
132336
+ } else {
132337
+ ${applyClipPlanesLoop}${applyClipPlanesLoopBody} }\n
132338
+ }
132197
132339
  `;
132198
132340
  const applyClipPlanesPostlude = `
132199
- vec4 plane = getClipPlane(i);
132200
- if (plane.x == 2.0) { // indicates start of new UnionOfConvexClipPlaneSets
132201
- if (numSetsClippedBy + int(clippedByCurrentPlaneSet) == numPlaneSets)
132202
- break;
132203
-
132204
- numPlaneSets = 1;
132205
- numSetsClippedBy = 0;
132206
- clippedByCurrentPlaneSet = false;
132207
- } else if (plane.xyz == vec3(0.0)) { // indicates start of new clip plane set
132208
- numPlaneSets = numPlaneSets + 1;
132209
- numSetsClippedBy += int(clippedByCurrentPlaneSet);
132210
- clippedByCurrentPlaneSet = false;
132211
- } else if (!clippedByCurrentPlaneSet && calcClipPlaneDist(v_eyeSpace, plane) < 0.0) {
132212
- clippedByCurrentPlaneSet = true;
132213
- }
132214
- }
132215
132341
 
132216
132342
  numSetsClippedBy += int(clippedByCurrentPlaneSet);
132217
132343
  if (numSetsClippedBy == numPlaneSets) {
132218
132344
  if (u_outsideRgba.a > 0.0) {
132219
132345
  g_clipColor = u_outsideRgba.rgb;
132220
- return true;
132346
+ return bvec2(true,false);
132221
132347
  } else {
132222
132348
  discard;
132223
132349
  }
132224
132350
  } else if (u_insideRgba.a > 0.0) {
132225
132351
  g_clipColor = u_insideRgba.rgb;
132226
- return true;
132352
+ return bvec2(true,false);
132227
132353
  }
132228
132354
 
132229
- return false;
132355
+ return bvec2(false,false);
132356
+ `;
132357
+ const assignFragData = `
132358
+ if (g_hasClipColor.y) {
132359
+ vec4 output0 = vec4(g_clipColor, 1.0);
132360
+ vec4 output1 = vec4(1.0, 1.0, 0.0, 1.0);
132361
+
132362
+ FragColor0 = output0;
132363
+ FragColor1 = output1;
132364
+ } else {
132365
+ ${_Translucency__WEBPACK_IMPORTED_MODULE_4__.computeOutputs}
132366
+
132367
+ FragColor0 = output0;
132368
+ FragColor1 = output1;
132369
+ }
132230
132370
  `;
132231
- const applyClipPlanes = applyClipPlanesPrelude + applyClipPlanesLoop + applyClipPlanesPostlude;
132371
+ const applyClipPlanes = applyClipPlanesPrelude + applyClipPlanesPostlude;
132232
132372
  const clipParams = new Int32Array(3);
132233
132373
  /** @internal */
132234
132374
  function addClipping(prog) {
132235
132375
  const frag = prog.frag;
132236
132376
  const vert = prog.vert;
132237
132377
  (0,_Common__WEBPACK_IMPORTED_MODULE_2__.addEyeSpace)(prog);
132378
+ prog.addUniform("u_outsideRgba", 5 /* VariableType.Vec4 */, (program) => {
132379
+ program.addGraphicUniform("u_outsideRgba", (uniform, params) => {
132380
+ params.target.uniforms.branch.clipStack.outsideColor.bind(uniform);
132381
+ });
132382
+ });
132383
+ prog.addUniform("u_insideRgba", 5 /* VariableType.Vec4 */, (program) => {
132384
+ program.addGraphicUniform("u_insideRgba", (uniform, params) => {
132385
+ params.target.uniforms.branch.clipStack.insideColor.bind(uniform);
132386
+ });
132387
+ });
132388
+ (0,_Common__WEBPACK_IMPORTED_MODULE_2__.addFrustum)(prog);
132389
+ (0,_FeatureSymbology__WEBPACK_IMPORTED_MODULE_3__.addPixelWidthFactor)(frag);
132390
+ (0,_Vertex__WEBPACK_IMPORTED_MODULE_5__.addModelViewMatrix)(vert);
132238
132391
  // [0] = index of first plane
132239
132392
  // [1] = index of last plane (one past the end)
132240
132393
  // [2] = texture height
132394
+ prog.frag.addGlobal("g_hasClipColor", 11 /* VariableType.BVec2 */);
132241
132395
  prog.addUniformArray("u_clipParams", 1 /* VariableType.Int */, 3, (program) => {
132242
132396
  program.addGraphicUniform("u_clipParams", (uniform, params) => {
132243
132397
  // Set this to false to visualize pre-shader culling of geometry.
@@ -132250,17 +132404,16 @@ function addClipping(prog) {
132250
132404
  uniform.setUniform1iv(clipParams);
132251
132405
  });
132252
132406
  });
132253
- prog.addUniform("u_outsideRgba", 5 /* VariableType.Vec4 */, (program) => {
132254
- program.addGraphicUniform("u_outsideRgba", (uniform, params) => {
132255
- params.target.uniforms.branch.clipStack.outsideColor.bind(uniform);
132407
+ prog.frag.addUniform("u_colorizeIntersection", 0 /* VariableType.Boolean */, (program) => {
132408
+ program.addProgramUniform("u_colorizeIntersection", (uniform, params) => {
132409
+ uniform.setUniform1i(params.target.uniforms.branch.clipStack.colorizeIntersection ? 1 : 0);
132256
132410
  });
132257
132411
  });
132258
- prog.addUniform("u_insideRgba", 5 /* VariableType.Vec4 */, (program) => {
132259
- program.addGraphicUniform("u_insideRgba", (uniform, params) => {
132260
- params.target.uniforms.branch.clipStack.insideColor.bind(uniform);
132412
+ prog.frag.addUniform("u_clipIntersection", 5 /* VariableType.Vec4 */, (program) => {
132413
+ program.addGraphicUniform("u_clipIntersection", (uniform, params) => {
132414
+ params.target.uniforms.branch.clipStack.intersectionStyle.bind(uniform);
132261
132415
  });
132262
132416
  });
132263
- (0,_Vertex__WEBPACK_IMPORTED_MODULE_3__.addModelViewMatrix)(vert);
132264
132417
  frag.addFunction(getClipPlaneFloat);
132265
132418
  frag.addFunction(calcClipPlaneDist);
132266
132419
  frag.addUniform("s_clipSampler", 8 /* VariableType.Sampler2D */, (program) => {
@@ -132272,6 +132425,9 @@ function addClipping(prog) {
132272
132425
  });
132273
132426
  }, 3 /* VariablePrecision.High */);
132274
132427
  frag.set(10 /* FragmentShaderComponent.ApplyClipping */, applyClipPlanes);
132428
+ // modify translucent shaders
132429
+ if (frag.findFunction(_Translucency__WEBPACK_IMPORTED_MODULE_4__.computeAlphaWeight))
132430
+ frag.set(16 /* FragmentShaderComponent.AssignFragData */, assignFragData);
132275
132431
  }
132276
132432
 
132277
132433
 
@@ -132738,10 +132894,10 @@ const computeTranslucentColor = `
132738
132894
  vec4 computeColor() {
132739
132895
  vec4 opaque = computeOpaqueColor();
132740
132896
  vec4 accum = TEXTURE(u_accumulation, v_texCoord);
132741
- float r = TEXTURE(u_revealage, v_texCoord).r;
132897
+ vec2 rg = TEXTURE(u_revealage, v_texCoord).rg;
132742
132898
 
132743
- vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);
132744
- vec4 col = (1.0 - transparent.a) * transparent + transparent.a * opaque;
132899
+ vec4 transparent = vec4(accum.rgb / clamp(rg.r, 1e-4, 5e4), accum.a);
132900
+ vec4 col = mix((1.0 - transparent.a) * transparent + transparent.a * opaque, vec4(u_clipIntersection.rgb, 1.0), rg.g);
132745
132901
  return col;
132746
132902
  }
132747
132903
  `;
@@ -132789,6 +132945,11 @@ function createCompositeProgram(flags, context) {
132789
132945
  _Texture__WEBPACK_IMPORTED_MODULE_2__.Texture2DHandle.bindSampler(uniform, params.geometry.reveal, _RenderFlags__WEBPACK_IMPORTED_MODULE_1__.TextureUnit.Two);
132790
132946
  });
132791
132947
  });
132948
+ builder.frag.addUniform("u_clipIntersection", 5 /* VariableType.Vec4 */, (program) => {
132949
+ program.addGraphicUniform("u_clipIntersection", (uniform, params) => {
132950
+ params.target.uniforms.branch.clipStack.intersectionStyle.bind(uniform);
132951
+ });
132952
+ });
132792
132953
  frag.addFunction(computeTranslucentColor);
132793
132954
  if (!wantHilite) {
132794
132955
  frag.set(1 /* FragmentShaderComponent.ComputeBaseColor */, computeTranslucentBaseColor);
@@ -133931,6 +134092,7 @@ __webpack_require__.r(__webpack_exports__);
133931
134092
  /* harmony export */ addHiliter: () => (/* binding */ addHiliter),
133932
134093
  /* harmony export */ addMaxAlpha: () => (/* binding */ addMaxAlpha),
133933
134094
  /* harmony export */ addOvrFlagConstants: () => (/* binding */ addOvrFlagConstants),
134095
+ /* harmony export */ addPixelWidthFactor: () => (/* binding */ addPixelWidthFactor),
133934
134096
  /* harmony export */ addRenderOrder: () => (/* binding */ addRenderOrder),
133935
134097
  /* harmony export */ addRenderOrderConstants: () => (/* binding */ addRenderOrderConstants),
133936
134098
  /* harmony export */ addSurfaceDiscard: () => (/* binding */ addSurfaceDiscard),
@@ -138395,7 +138557,9 @@ function addThematicDisplay(builder, isForPointClouds = false, isForTerrainMesh
138395
138557
  "use strict";
138396
138558
  __webpack_require__.r(__webpack_exports__);
138397
138559
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
138398
- /* harmony export */ addTranslucency: () => (/* binding */ addTranslucency)
138560
+ /* harmony export */ addTranslucency: () => (/* binding */ addTranslucency),
138561
+ /* harmony export */ computeAlphaWeight: () => (/* binding */ computeAlphaWeight),
138562
+ /* harmony export */ computeOutputs: () => (/* binding */ computeOutputs)
138399
138563
  /* harmony export */ });
138400
138564
  /* harmony import */ var _Common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Common */ "../../core/frontend/lib/esm/render/webgl/glsl/Common.js");
138401
138565
  /* harmony import */ var _Fragment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Fragment */ "../../core/frontend/lib/esm/render/webgl/glsl/Fragment.js");
@@ -138433,7 +138597,7 @@ const computeOutputs = `
138433
138597
  float outputScale = (u_shaderFlags[kShaderBit_OITScaleOutput] ? 1.0 / 3001.040604 : 1.0);
138434
138598
 
138435
138599
  vec4 output0 = vec4(Ci * wzi * outputScale, ai);
138436
- vec4 output1 = vec4(ai * wzi * outputScale);
138600
+ vec4 output1 = vec4(ai * wzi * outputScale, 0.0, 0.0, ai * wzi * outputScale);
138437
138601
  `;
138438
138602
  const assignFragData = `${computeOutputs}
138439
138603
  FragColor0 = output0;
@@ -281969,7 +282133,7 @@ class TestContext {
281969
282133
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
281970
282134
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
281971
282135
  await core_frontend_1.NoRenderApp.startup({
281972
- applicationVersion: "4.3.0-dev.23",
282136
+ applicationVersion: "4.3.0-dev.25",
281973
282137
  applicationId: this.settings.gprid,
281974
282138
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
281975
282139
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -301381,7 +301545,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
301381
301545
  /***/ ((module) => {
301382
301546
 
301383
301547
  "use strict";
301384
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.3.0-dev.23","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.3.0-dev.23","@itwin/core-bentley":"workspace:^4.3.0-dev.23","@itwin/core-common":"workspace:^4.3.0-dev.23","@itwin/core-geometry":"workspace:^4.3.0-dev.23","@itwin/core-orbitgt":"workspace:^4.3.0-dev.23","@itwin/core-quantity":"workspace:^4.3.0-dev.23"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"18.16.1","@types/sinon":"^10.0.15","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^15.0.4","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.1.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
301548
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.3.0-dev.25","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.3.0-dev.25","@itwin/core-bentley":"workspace:^4.3.0-dev.25","@itwin/core-common":"workspace:^4.3.0-dev.25","@itwin/core-geometry":"workspace:^4.3.0-dev.25","@itwin/core-orbitgt":"workspace:^4.3.0-dev.25","@itwin/core-quantity":"workspace:^4.3.0-dev.25"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"18.16.1","@types/sinon":"^10.0.15","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^15.0.4","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.1.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
301385
301549
 
301386
301550
  /***/ }),
301387
301551