@itwin/ecschema-rpcinterface-tests 4.0.0-dev.56 → 4.0.0-dev.59

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.
@@ -1 +1 @@
1
- {"version":3,"file":"_d48c.bundled-tests.js","mappings":";;;;;;;;AAAA","sources":["file:///ignored|D:\\vsts_b\\1\\s\\common\\temp\\node_modules\\.pnpm\\@loaders.gl+worker-utils@3.3.1\\node_modules\\@loaders.gl\\worker-utils\\dist\\esm\\lib\\library-utils|../node/require-utils.node"],"names":[],"sourceRoot":""}
1
+ {"version":3,"file":"_d48c.bundled-tests.js","mappings":";;;;;;;;AAAA","sources":["file:///ignored|D:\\vsts_a\\4\\s\\common\\temp\\node_modules\\.pnpm\\@loaders.gl+worker-utils@3.3.1\\node_modules\\@loaders.gl\\worker-utils\\dist\\esm\\lib\\library-utils|../node/require-utils.node"],"names":[],"sourceRoot":""}
@@ -50167,6 +50167,13 @@ class TextureMapping {
50167
50167
  this.weight = props?.textureWeight ?? 1;
50168
50168
  this.mode = props?.mapMode ?? Mode.Parametric;
50169
50169
  this.worldMapping = props?.worldMapping ?? false;
50170
+ this.useConstantLod = props?.useConstantLod ?? false;
50171
+ this.constantLodParams = {
50172
+ repetitions: props?.constantLodParams?.repetitions ?? 1,
50173
+ offset: props?.constantLodParams?.offset ?? { x: 0, y: 0 },
50174
+ minDistClamp: props?.constantLodParams?.minDistClamp ?? 1,
50175
+ maxDistClamp: props?.constantLodParams?.maxDistClamp ?? 4096 * 1024 * 1024,
50176
+ };
50170
50177
  }
50171
50178
  /**
50172
50179
  * Generates UV parameters for textured surfaces. Returns undefined on failure.
@@ -114082,7 +114089,6 @@ class BranchUniforms {
114082
114089
  this._mvp32 = new _Matrix__WEBPACK_IMPORTED_MODULE_4__.Matrix4();
114083
114090
  this._m32 = new _Matrix__WEBPACK_IMPORTED_MODULE_4__.Matrix4();
114084
114091
  this._v32 = new _Matrix__WEBPACK_IMPORTED_MODULE_4__.Matrix3();
114085
- this._mvn32 = new _Matrix__WEBPACK_IMPORTED_MODULE_4__.Matrix3();
114086
114092
  // Working state
114087
114093
  this._scratchTransform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
114088
114094
  this._scratchTransform2 = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
@@ -114165,10 +114171,6 @@ class BranchUniforms {
114165
114171
  if (this.update(uniform, geom, isViewCoords))
114166
114172
  uniform.setMatrix3(this._v32);
114167
114173
  }
114168
- bindModelViewNTransform(uniform, geom, isViewCoords) {
114169
- if (this.update(uniform, geom, isViewCoords))
114170
- uniform.setMatrix3(this._mvn32);
114171
- }
114172
114174
  update(uniform, geometry, isViewCoords) {
114173
114175
  const uniforms = this._target.uniforms[isViewCoords ? "viewRect" : "frustum"];
114174
114176
  if (!(0,_Sync__WEBPACK_IMPORTED_MODULE_6__.sync)(uniforms, this))
@@ -114200,7 +114202,6 @@ class BranchUniforms {
114200
114202
  }
114201
114203
  else {
114202
114204
  const viewMatrix = this._target.uniforms.frustum.viewMatrix;
114203
- mv = viewMatrix.clone(this._scratchTransform);
114204
114205
  if (undefined !== instancedGeom) {
114205
114206
  // For instanced geometry, the "model view" matrix is really a transform from center of instanced geometry range to view.
114206
114207
  // Shader will compute final model-view matrix based on this and the per-instance transform.
@@ -114208,10 +114209,10 @@ class BranchUniforms {
114208
114209
  const viewToWorldRot = viewMatrix.matrix.inverse(this._scratchViewToWorld);
114209
114210
  const rotateAboutOrigin = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createFixedPointAndMatrix(vio, viewToWorldRot, this._scratchTransform2);
114210
114211
  const viModelMatrix = rotateAboutOrigin.multiplyTransformTransform(instancedGeom.getRtcModelTransform(modelMatrix), this._scratchVIModelMatrix);
114211
- mv.multiplyTransformTransform(viModelMatrix, mv);
114212
+ mv = viewMatrix.multiplyTransformTransform(viModelMatrix, this._scratchTransform);
114212
114213
  }
114213
114214
  else {
114214
- mv.multiplyTransformTransform(instancedGeom.getRtcModelTransform(modelMatrix), mv);
114215
+ mv = viewMatrix.multiplyTransformTransform(instancedGeom.getRtcModelTransform(modelMatrix), this._scratchTransform);
114215
114216
  }
114216
114217
  }
114217
114218
  else {
@@ -114219,10 +114220,10 @@ class BranchUniforms {
114219
114220
  const viewToWorldRot = viewMatrix.matrix.inverse(this._scratchViewToWorld);
114220
114221
  const rotateAboutOrigin = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createFixedPointAndMatrix(vio, viewToWorldRot, this._scratchTransform2);
114221
114222
  const viModelMatrix = rotateAboutOrigin.multiplyTransformTransform(modelMatrix, this._scratchVIModelMatrix);
114222
- mv.multiplyTransformTransform(viModelMatrix, mv);
114223
+ mv = viewMatrix.multiplyTransformTransform(viModelMatrix, this._scratchTransform);
114223
114224
  }
114224
114225
  else {
114225
- mv = mv.multiplyTransformTransform(modelMatrix, mv);
114226
+ mv = viewMatrix.multiplyTransformTransform(modelMatrix, this._scratchTransform);
114226
114227
  }
114227
114228
  }
114228
114229
  }
@@ -114230,6 +114231,9 @@ class BranchUniforms {
114230
114231
  this._m32.initFromTransform(modelMatrix);
114231
114232
  this._v32.initFromMatrix3d(this._target.uniforms.frustum.viewMatrix.matrix);
114232
114233
  }
114234
+ else if (undefined !== geometry.asSurface?.mesh.constantLodVParams) {
114235
+ this._m32.initFromTransform(modelMatrix);
114236
+ }
114233
114237
  _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createTransform(mv, this._mv);
114234
114238
  this._mv32.initFromTransform(mv);
114235
114239
  // Don't bother computing mvp for instanced geometry - it's not used.
@@ -120131,19 +120135,35 @@ class MeshData {
120131
120135
  this.hasFeatures = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FeatureIndexType.Empty !== params.vertices.featureIndexType;
120132
120136
  if (_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FeatureIndexType.Uniform === params.vertices.featureIndexType)
120133
120137
  this.uniformFeatureId = params.vertices.uniformFeatureID;
120138
+ this.textureUsesConstantLod = false;
120139
+ this.normalMapUsesConstantLod = false;
120134
120140
  if (undefined !== params.surface.textureMapping) {
120135
120141
  this.texture = params.surface.textureMapping.texture;
120136
120142
  this._textureAlwaysDisplayed = params.surface.textureMapping.alwaysDisplayed;
120137
120143
  if (undefined !== params.surface.material && !params.surface.material.isAtlas) {
120138
120144
  const matTM = params.surface.material.material.textureMapping;
120139
- if (undefined !== matTM && undefined !== matTM.normalMapParams) {
120140
- if (undefined !== matTM.normalMapParams.normalMap) {
120141
- this.normalMap = matTM.normalMapParams.normalMap;
120145
+ if (undefined !== matTM) {
120146
+ this.textureUsesConstantLod = this.texture && matTM.params.useConstantLod;
120147
+ if (undefined !== matTM.normalMapParams) {
120148
+ this.normalMapUsesConstantLod = matTM.normalMapParams.useConstantLod;
120149
+ if (undefined !== matTM.normalMapParams.normalMap) {
120150
+ this.normalMap = matTM.normalMapParams.normalMap;
120151
+ }
120152
+ else {
120153
+ // If there are normal map params but the normal map is not present, use the texture as a normal map instead of a pattern map.
120154
+ this.normalMap = this.texture;
120155
+ this.texture = undefined;
120156
+ }
120142
120157
  }
120143
- else {
120144
- // If there are normal map params but the normal map is not present, use the texture as a normal map instead of a pattern map.
120145
- this.normalMap = this.texture;
120146
- this.texture = undefined;
120158
+ if (this.normalMapUsesConstantLod || this.textureUsesConstantLod) {
120159
+ this.constantLodVParams = new Float32Array(3);
120160
+ this.constantLodVParams[0] = matTM.params.constantLodParams.offset.x; // x offset
120161
+ this.constantLodVParams[1] = matTM.params.constantLodParams.offset.y; // y offset
120162
+ this.constantLodVParams[3] = 0.0; // placeholder for orto view distance
120163
+ this.constantLodFParams = new Float32Array(3);
120164
+ this.constantLodFParams[0] = matTM.params.constantLodParams.minDistClamp; // Minimum texture size
120165
+ this.constantLodFParams[1] = matTM.params.constantLodParams.maxDistClamp; // Maximum texture size
120166
+ this.constantLodFParams[2] = matTM.params.constantLodParams.repetitions; // # repetitions of pattern (to scale it)
120147
120167
  }
120148
120168
  }
120149
120169
  }
@@ -127952,6 +127972,8 @@ class SurfaceGeometry extends _MeshGeometry__WEBPACK_IMPORTED_MODULE_7__.MeshGeo
127952
127972
  }
127953
127973
  flags[0 /* SurfaceBitIndex.HasTexture */] = this.useTexture(params) ? 1 : 0;
127954
127974
  flags[8 /* SurfaceBitIndex.HasNormalMap */] = this.useNormalMap(params) ? 1 : 0;
127975
+ flags[10 /* SurfaceBitIndex.UseConstantLodTextureMapping */] = this.mesh.textureUsesConstantLod ? 1 : 0;
127976
+ flags[11 /* SurfaceBitIndex.UseConstantLodNormalMapMapping */] = this.mesh.normalMapUsesConstantLod ? 1 : 0;
127955
127977
  // The transparency threshold controls how transparent a surface must be to allow light to pass through; more opaque surfaces cast shadows.
127956
127978
  flags[4 /* SurfaceBitIndex.TransparencyThreshold */] = params.target.isDrawingShadowMap ? 1 : 0;
127957
127979
  flags[5 /* SurfaceBitIndex.BackgroundFill */] = 0;
@@ -134519,7 +134541,6 @@ function createVolClassCopyZProgram(context) {
134519
134541
  _Texture__WEBPACK_IMPORTED_MODULE_4__.Texture2DHandle.bindSampler(uniform, geom.texture, _RenderFlags__WEBPACK_IMPORTED_MODULE_3__.TextureUnit.Zero);
134520
134542
  });
134521
134543
  });
134522
- frag.addExtension("GL_EXT_frag_depth");
134523
134544
  frag.set(18 /* FragmentShaderComponent.FinalizeDepth */, depthFromTexture);
134524
134545
  builder.vert.headerComment = "//!V! VolClassCopyZ";
134525
134546
  builder.frag.headerComment = "//!F! VolClassCopyZ";
@@ -138788,6 +138809,7 @@ __webpack_require__.r(__webpack_exports__);
138788
138809
  /* harmony import */ var _Vertex__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Vertex */ "../../core/frontend/lib/esm/render/webgl/glsl/Vertex.js");
138789
138810
  /* harmony import */ var _SurfaceGeometry__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../SurfaceGeometry */ "../../core/frontend/lib/esm/render/webgl/SurfaceGeometry.js");
138790
138811
  /* harmony import */ var _Wiremesh__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Wiremesh */ "../../core/frontend/lib/esm/render/webgl/glsl/Wiremesh.js");
138812
+ /* harmony import */ var _itwin_core_common__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
138791
138813
  /*---------------------------------------------------------------------------------------------
138792
138814
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
138793
138815
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -138818,10 +138840,45 @@ __webpack_require__.r(__webpack_exports__);
138818
138840
 
138819
138841
 
138820
138842
 
138843
+
138844
+ const constantLodTextureLookup = `
138845
+ vec4 constantLodTextureLookup(sampler2D textureSampler) {
138846
+ float logDepth = log2(v_uvCustom.z);
138847
+ float f = fract(logDepth);
138848
+ float p = floor(logDepth);
138849
+ // When p changes, both tc1 and tc2 jumped by a power of 2 at that transition (and f goes from ~1 to 0).
138850
+ // This caused a line to show up with incorrect tex coords, we believe due to a problem with the derivative
138851
+ // that is auto calculated on the tex coords for the mip-map. The below approach attempts to "smooth"
138852
+ // the transition of the coord in use at the transition by only changing the coord that is not in use
138853
+ // (but by 2 powers of 2) and switching the mix selector to account for it. It does this by using whether
138854
+ // p is odd or even to select which way it is going, so it alternates at the boundaries. This fixes the
138855
+ // line problem.
138856
+ float p1, p2;
138857
+ if (0u == (uint(p) & 1u)) { // p is even
138858
+ p1 = p;
138859
+ p2 = p + 1.0;
138860
+ } else { // p is odd
138861
+ p1 = p + 1.0;
138862
+ p2 = p;
138863
+ f = 1.0 - f;
138864
+ }
138865
+
138866
+ vec2 tc1 = v_uvCustom.xy / clamp(pow(2.0, p1), float(u_constantLodFParams.x), float(u_constantLodFParams.y)) * u_constantLodFParams.z;
138867
+ vec2 tc2 = v_uvCustom.xy / clamp(pow(2.0, p2), float(u_constantLodFParams.x), float(u_constantLodFParams.y)) * u_constantLodFParams.z;
138868
+ return mix(TEXTURE(textureSampler, tc1), TEXTURE(textureSampler, tc2), f);
138869
+ }
138870
+ `;
138821
138871
  // NB: Textures do not contain pre-multiplied alpha.
138822
138872
  const sampleSurfaceTexture = `
138823
138873
  vec4 sampleSurfaceTexture() {
138824
- return TEXTURE(s_texture, v_texCoord);
138874
+ vec4 clr;
138875
+ if (!isSurfaceBitSet(kSurfaceBit_HasTexture))
138876
+ clr = vec4(1.0, 1.0, 1.0, 1.0);
138877
+ else if (u_surfaceFlags[kSurfaceBitIndex_UseConstantLodTextureMapping])
138878
+ clr = constantLodTextureLookup(s_texture);
138879
+ else
138880
+ clr = TEXTURE(s_texture, v_texCoord);
138881
+ return clr;
138825
138882
  }
138826
138883
  `;
138827
138884
  const applyMaterialColor = `
@@ -138971,6 +139028,10 @@ const adjustEyeSpace = `
138971
139028
  if (kRenderOrder_BlankingRegion == u_renderOrder)
138972
139029
  v_eyeSpace.z -= blankingRegionOffset * (u_frustum.y - u_frustum.x);
138973
139030
  `;
139031
+ const computeConstantLodUvCustom = `
139032
+ vec2 worldpos = (u_modelToWorld * vec4(rawPos.xyz, 0.0)).xy;
139033
+ v_uvCustom = vec3((u_constantLodVParams.xy + worldpos) * vec2(1.0, -1.0), kFrustumType_Perspective == u_frustum.z ? -v_eyeSpace.z : u_constantLodVParams.z);
139034
+ `;
138974
139035
  const computePositionPostlude = `
138975
139036
  return u_proj * pos;
138976
139037
  `;
@@ -138985,17 +139046,17 @@ function createCommon(isInstanced, animated, shadowable, isHiliter, positionType
138985
139046
  (0,_SolarShadowMapping__WEBPACK_IMPORTED_MODULE_17__.addSolarShadowMap)(builder);
138986
139047
  (0,_Vertex__WEBPACK_IMPORTED_MODULE_20__.addProjectionMatrix)(vert);
138987
139048
  (0,_Vertex__WEBPACK_IMPORTED_MODULE_20__.addModelViewMatrix)(vert);
138988
- let computePosition;
138989
- if (isHiliter && !_System__WEBPACK_IMPORTED_MODULE_5__.System.instance.supportsLogZBuffer) {
138990
- computePosition = computePositionPrelude + computePositionPostlude;
138991
- }
138992
- else {
139049
+ let computePosition = computePositionPrelude;
139050
+ if (!isHiliter || _System__WEBPACK_IMPORTED_MODULE_5__.System.instance.supportsLogZBuffer) {
138993
139051
  (0,_Common__WEBPACK_IMPORTED_MODULE_9__.addFrustum)(builder);
138994
139052
  (0,_FeatureSymbology__WEBPACK_IMPORTED_MODULE_11__.addRenderOrder)(builder.vert);
138995
139053
  (0,_FeatureSymbology__WEBPACK_IMPORTED_MODULE_11__.addRenderOrderConstants)(builder.vert);
138996
139054
  builder.addVarying("v_eyeSpace", 4 /* VariableType.Vec3 */);
138997
- computePosition = computePositionPrelude + adjustEyeSpace + computePositionPostlude;
139055
+ computePosition += adjustEyeSpace;
138998
139056
  }
139057
+ if (!isHiliter)
139058
+ computePosition += computeConstantLodUvCustom;
139059
+ computePosition += computePositionPostlude;
138999
139060
  vert.set(10 /* VertexShaderComponent.ComputePosition */, computePosition);
139000
139061
  return builder;
139001
139062
  }
@@ -139029,6 +139090,8 @@ function addSurfaceFlagsLookup(builder) {
139029
139090
  builder.addConstant("kSurfaceBitIndex_OverrideRgb", 1 /* VariableType.Int */, 7 /* SurfaceBitIndex.OverrideRgb */.toString());
139030
139091
  builder.addConstant("kSurfaceBitIndex_HasNormalMap", 1 /* VariableType.Int */, 8 /* SurfaceBitIndex.HasNormalMap */.toString());
139031
139092
  builder.addConstant("kSurfaceBitIndex_HasMaterialAtlas", 1 /* VariableType.Int */, 9 /* SurfaceBitIndex.HasMaterialAtlas */.toString());
139093
+ builder.addConstant("kSurfaceBitIndex_UseConstantLodTextureMapping", 1 /* VariableType.Int */, 10 /* SurfaceBitIndex.UseConstantLodTextureMapping */.toString());
139094
+ builder.addConstant("kSurfaceBitIndex_UseConstantLodNormalMapMapping", 1 /* VariableType.Int */, 11 /* SurfaceBitIndex.UseConstantLodNormalMapMapping */.toString());
139032
139095
  // Surface flags which get modified in vertex shader are still passed to fragment shader as a single float & are thus
139033
139096
  // used differently there & so require different constants. Unused constants are commented out.
139034
139097
  builder.addBitFlagConstant("kSurfaceBit_HasTexture", 0 /* SurfaceBitIndex.HasTexture */);
@@ -139113,7 +139176,11 @@ const finalizeNormalNormalMap = `
139113
139176
  vec3 biTangent = cross (normal, tangent);
139114
139177
  if (flip)
139115
139178
  biTangent = -biTangent;
139116
- vec3 normM = TEXTURE(s_normalMap, v_texCoord).xyz;
139179
+ vec3 normM;
139180
+ if (u_surfaceFlags[kSurfaceBitIndex_UseConstantLodNormalMapMapping])
139181
+ normM = constantLodTextureLookup(s_normalMap).xyz;
139182
+ else
139183
+ normM = TEXTURE(s_normalMap, v_texCoord).xyz;
139117
139184
  if (length (normM) > 0.0001) { // check for empty normal texture
139118
139185
  normM = (normM - 0.5) * 2.0;
139119
139186
  normM = normalize (normM);
@@ -139177,7 +139244,7 @@ const computeBaseColor = `
139177
139244
  surfaceColor.rgb = (u_reverseWhiteOnWhite && isAlmostWhite.r && isAlmostWhite.g && isAlmostWhite.b ? vec3(0.0, 0.0, 0.0) : surfaceColor.rgb);
139178
139245
  return vec4(surfaceColor.rgb * g_surfaceTexel.rgb, g_surfaceTexel.a);
139179
139246
  `;
139180
- const surfaceFlagArray = new Int32Array(10 /* SurfaceBitIndex.Count */);
139247
+ const surfaceFlagArray = new Int32Array(12 /* SurfaceBitIndex.Count */);
139181
139248
  /** @internal */
139182
139249
  function addSurfaceFlags(builder, withFeatureOverrides, withFeatureColor) {
139183
139250
  addSurfaceFlagsLookup(builder.vert);
@@ -139188,7 +139255,7 @@ function addSurfaceFlags(builder, withFeatureOverrides, withFeatureColor) {
139188
139255
  compute += returnSurfaceFlags;
139189
139256
  builder.addFunctionComputedVarying("v_surfaceFlags", 2 /* VariableType.Float */, "computeSurfaceFlags", compute);
139190
139257
  builder.frag.addInitializer("surfaceFlags = uint(floor(v_surfaceFlags + 0.5));");
139191
- builder.addUniformArray("u_surfaceFlags", 0 /* VariableType.Boolean */, 10 /* SurfaceBitIndex.Count */, (prog) => {
139258
+ builder.addUniformArray("u_surfaceFlags", 0 /* VariableType.Boolean */, 12 /* SurfaceBitIndex.Count */, (prog) => {
139192
139259
  prog.addGraphicUniform("u_surfaceFlags", (uniform, params) => {
139193
139260
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== params.geometry.asSurface);
139194
139261
  const mesh = params.geometry.asSurface;
@@ -139206,17 +139273,19 @@ function addNormal(builder, animated) {
139206
139273
  builder.frag.addGlobal("g_normal", 4 /* VariableType.Vec3 */);
139207
139274
  let finalizeNormal = finalizeNormalPrelude;
139208
139275
  finalizeNormal += finalizeNormalNormalMap;
139276
+ builder.frag.addFunction(constantLodTextureLookup);
139209
139277
  builder.frag.addUniform("u_normalMapScale", 2 /* VariableType.Float */, (prog) => {
139210
139278
  prog.addGraphicUniform("u_normalMapScale", (uniform, params) => {
139211
- let normalMapScale = 1.0;
139212
- if (undefined !== params.geometry.materialInfo && !params.geometry.materialInfo.isAtlas &&
139213
- undefined !== params.geometry.materialInfo.textureMapping &&
139214
- undefined !== params.geometry.materialInfo.textureMapping.normalMapParams) {
139215
- normalMapScale = params.geometry.materialInfo.textureMapping.normalMapParams.scale ?? 1.0;
139216
- if (params.geometry.materialInfo.textureMapping.normalMapParams.greenUp)
139217
- normalMapScale = -normalMapScale;
139218
- }
139219
- uniform.setUniform1f(normalMapScale);
139279
+ if (undefined !== params.geometry.materialInfo && !params.geometry.materialInfo.isAtlas) {
139280
+ const normalMapParams = params.geometry.materialInfo.textureMapping?.normalMapParams;
139281
+ if (undefined !== normalMapParams) {
139282
+ let normalMapScale = 1.0;
139283
+ normalMapScale = normalMapParams.scale ?? 1.0;
139284
+ if (normalMapParams.greenUp)
139285
+ normalMapScale = -normalMapScale;
139286
+ uniform.setUniform1f(normalMapScale);
139287
+ }
139288
+ }
139220
139289
  });
139221
139290
  });
139222
139291
  finalizeNormal += finalizeNormalPostlude;
@@ -139252,7 +139321,6 @@ function addTexture(builder, animated, isThematic, isPointCloud, isHilite) {
139252
139321
  }
139253
139322
  });
139254
139323
  });
139255
- builder.frag.addFunction(sampleSurfaceTexture);
139256
139324
  }
139257
139325
  builder.frag.addUniform("s_texture", 8 /* VariableType.Sampler2D */, (prog) => {
139258
139326
  prog.addGraphicUniform("s_texture", (uniform, params) => {
@@ -139331,8 +139399,17 @@ function createSurfaceBuilder(flags) {
139331
139399
  opts &= ~16 /* FeatureSymbologyOptions.Alpha */;
139332
139400
  (0,_PlanarClassification__WEBPACK_IMPORTED_MODULE_15__.addColorPlanarClassifier)(builder, flags.isTranslucent, flags.isThematic);
139333
139401
  }
139334
- if (flags.isThematic)
139402
+ if (flags.isThematic) {
139335
139403
  (0,_Thematic__WEBPACK_IMPORTED_MODULE_18__.addThematicDisplay)(builder);
139404
+ }
139405
+ else {
139406
+ builder.vert.addUniform("u_modelToWorld", 7 /* VariableType.Mat4 */, (prog) => {
139407
+ prog.addGraphicUniform("u_modelToWorld", (uniform, params) => {
139408
+ if (undefined !== params.geometry.asSurface?.mesh.constantLodVParams)
139409
+ params.target.uniforms.branch.bindModelToWorldTransform(uniform, params.geometry, false);
139410
+ });
139411
+ });
139412
+ }
139336
139413
  (0,_FeatureSymbology__WEBPACK_IMPORTED_MODULE_11__.addFeatureSymbology)(builder, feat, opts);
139337
139414
  addSurfaceFlags(builder, 2 /* FeatureMode.Overrides */ === feat, true);
139338
139415
  (0,_FeatureSymbology__WEBPACK_IMPORTED_MODULE_11__.addSurfaceDiscard)(builder, flags);
@@ -139376,6 +139453,25 @@ function createSurfaceBuilder(flags) {
139376
139453
  (0,_Fragment__WEBPACK_IMPORTED_MODULE_12__.addAltPickBufferOutputs)(builder.frag);
139377
139454
  }
139378
139455
  }
139456
+ builder.addVarying("v_uvCustom", 4 /* VariableType.Vec3 */);
139457
+ builder.vert.addUniform("u_constantLodVParams", 4 /* VariableType.Vec3 */, (prog) => {
139458
+ prog.addGraphicUniform("u_constantLodVParams", (uniform, params) => {
139459
+ const vParams = params.geometry.asSurface?.mesh.constantLodVParams;
139460
+ if (undefined !== vParams) {
139461
+ vParams[2] = params.target.planFrustum.points[_itwin_core_common__WEBPACK_IMPORTED_MODULE_23__.Npc.LeftTopRear].distance(params.target.planFrustum.points[_itwin_core_common__WEBPACK_IMPORTED_MODULE_23__.Npc.RightTopRear]);
139462
+ uniform.setUniform3fv(vParams);
139463
+ }
139464
+ });
139465
+ });
139466
+ builder.frag.addUniform("u_constantLodFParams", 4 /* VariableType.Vec3 */, (prog) => {
139467
+ prog.addGraphicUniform("u_constantLodFParams", (uniform, params) => {
139468
+ const fParams = params.geometry.asSurface?.mesh.constantLodFParams;
139469
+ if (undefined !== fParams)
139470
+ uniform.setUniform3fv(fParams);
139471
+ });
139472
+ });
139473
+ builder.frag.addFunction(constantLodTextureLookup);
139474
+ builder.frag.addFunction(sampleSurfaceTexture);
139379
139475
  builder.frag.addGlobal("g_surfaceTexel", 5 /* VariableType.Vec4 */);
139380
139476
  builder.frag.set(1 /* FragmentShaderComponent.ComputeBaseColor */, (flags.isThematic === 0 /* IsThematic.No */) ? computeBaseColor : "return getSurfaceColor();");
139381
139477
  if (flags.isClassified)
@@ -139881,33 +139977,31 @@ const computeLineCode = "\nfloat computeLineCode() { return g_lineCode; }\n";
139881
139977
  function addSamplePosition(vert) {
139882
139978
  vert.addFunction(getSamplePosition(vert.positionType));
139883
139979
  }
139980
+ const getSamplePositionPrelude = `
139981
+ vec4 samplePosition(float index) {
139982
+ vec2 tc = compute_vert_coords(index);`;
139983
+ const getSamplePositionQuantizedPostlude = `
139984
+ vec4 e0 = floor(TEXTURE(u_vertLUT, tc) * 255.0 + 0.5);
139985
+ tc.x += g_vert_stepX;
139986
+ vec4 e1 = floor(TEXTURE(u_vertLUT, tc) * 255.0 + 0.5);
139987
+ vec3 qpos = vec3(decodeUInt16(e0.xy), decodeUInt16(e0.zw), decodeUInt16(e1.xy));
139988
+ return unquantizePosition(qpos, u_qOrigin, u_qScale);
139989
+ }
139990
+ `;
139991
+ const getSamplePositionUnquantizedPostlude = `
139992
+ uvec3 vux = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
139993
+ tc.x += g_vert_stepX;
139994
+ uvec3 vuy = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
139995
+ tc.x += g_vert_stepX;
139996
+ uvec3 vuz = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
139997
+ tc.x += g_vert_stepX;
139998
+ uvec3 vuw = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
139999
+ uvec3 u = (vuw << 24) | (vuz << 16) | (vuy << 8) | vux;
140000
+ return vec4(uintBitsToFloat(u), 1.0);
140001
+ }
140002
+ `;
139884
140003
  function getSamplePosition(type) {
139885
- const prelude = `
139886
- vec4 samplePosition(float index) {
139887
- vec2 tc = compute_vert_coords(index);`;
139888
- if ("quantized" === type) {
139889
- return `
139890
- ${prelude}
139891
- vec4 e0 = floor(TEXTURE(u_vertLUT, tc) * 255.0 + 0.5);
139892
- tc.x += g_vert_stepX;
139893
- vec4 e1 = floor(TEXTURE(u_vertLUT, tc) * 255.0 + 0.5);
139894
- vec3 qpos = vec3(decodeUInt16(e0.xy), decodeUInt16(e0.zw), decodeUInt16(e1.xy));
139895
- return unquantizePosition(qpos, u_qOrigin, u_qScale);
139896
- }
139897
- `;
139898
- }
139899
- return `
139900
- ${prelude}
139901
- uvec3 vux = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
139902
- tc.x += g_vert_stepX;
139903
- uvec3 vuy = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
139904
- tc.x += g_vert_stepX;
139905
- uvec3 vuz = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
139906
- tc.x += g_vert_stepX;
139907
- uvec3 vuw = uvec3(floor(TEXTURE(u_vertLUT, tc).xyz * 255.0 + 0.5));
139908
- uvec3 u = (vuw << 24) | (vuz << 16) | (vuy << 8) | vux;
139909
- return vec4(uintBitsToFloat(u), 1.0);
139910
- }`;
140004
+ return `${getSamplePositionPrelude}${"quantized" === type ? getSamplePositionQuantizedPostlude : getSamplePositionUnquantizedPostlude}`;
139911
140005
  }
139912
140006
  /** @internal */
139913
140007
  function addModelViewProjectionMatrix(vert) {
@@ -288824,7 +288918,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
288824
288918
  /***/ ((module) => {
288825
288919
 
288826
288920
  "use strict";
288827
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.56","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","build:ci":"npm run -s build && npm run -s build:esm","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","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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 --no-eslintrc -c \\"./node_modules/@itwin/eslint-plugin/dist/configs/extension-exports-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"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/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.0.0-dev.56","@itwin/core-bentley":"workspace:^4.0.0-dev.56","@itwin/core-common":"workspace:^4.0.0-dev.56","@itwin/core-geometry":"workspace:^4.0.0-dev.56","@itwin/core-orbitgt":"workspace:^4.0.0-dev.56","@itwin/core-quantity":"workspace:^4.0.0-dev.56"},"//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.32","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~5.0.2","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/object-storage-azure":"^1.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.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","deep-assign":"^2.0.0","fuse.js":"^3.3.0","qs":"^6.5.3","semver":"^7.3.5","superagent":"^7.1.5","wms-capabilities":"0.4.0","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
288921
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.59","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","build:ci":"npm run -s build && npm run -s build:esm","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","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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 --no-eslintrc -c \\"./node_modules/@itwin/eslint-plugin/dist/configs/extension-exports-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"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/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.0.0-dev.59","@itwin/core-bentley":"workspace:^4.0.0-dev.59","@itwin/core-common":"workspace:^4.0.0-dev.59","@itwin/core-geometry":"workspace:^4.0.0-dev.59","@itwin/core-orbitgt":"workspace:^4.0.0-dev.59","@itwin/core-quantity":"workspace:^4.0.0-dev.59"},"//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.32","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~5.0.2","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/object-storage-azure":"^1.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.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","deep-assign":"^2.0.0","fuse.js":"^3.3.0","qs":"^6.5.3","semver":"^7.3.5","superagent":"^7.1.5","wms-capabilities":"0.4.0","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
288828
288922
 
288829
288923
  /***/ })
288830
288924