@inweb/viewer-three 27.12.0 → 27.12.2

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.
@@ -4681,7 +4681,7 @@ class ModelImpl {
4681
4681
  this.scene.traverse((object) => (object.visible = true));
4682
4682
  return this;
4683
4683
  }
4684
- highlight(handles) {
4684
+ highlight(handles, style) {
4685
4685
  if (this.highlighter) {
4686
4686
  const objects = this.getObjectsByHandles(handles);
4687
4687
  this.highlighter.highlightObjects(objects);
@@ -4695,6 +4695,9 @@ class ModelImpl {
4695
4695
  }
4696
4696
  return this;
4697
4697
  }
4698
+ setHighlightStyle(name, style) {
4699
+ return this;
4700
+ }
4698
4701
  explode(scale = 0, coeff = 4) {
4699
4702
  const centersCache = new Map();
4700
4703
  const calcObjectCenter = (object, target) => {
@@ -4825,14 +4828,18 @@ class DynamicModelImpl extends ModelImpl {
4825
4828
  this.gltfLoader.showAllHiddenObjects();
4826
4829
  return this;
4827
4830
  }
4828
- highlight(handles) {
4829
- this.gltfLoader.highlightObjects(handles);
4831
+ highlight(handles, style) {
4832
+ this.gltfLoader.highlightObjects(handles, style);
4830
4833
  return this;
4831
4834
  }
4832
4835
  unhighlight(handles) {
4833
4836
  this.gltfLoader.unhighlightObjects(handles);
4834
4837
  return this;
4835
4838
  }
4839
+ setHighlightStyle(name, style) {
4840
+ this.gltfLoader.setHighlightStyle(name, style);
4841
+ return this;
4842
+ }
4836
4843
  explode(scale = 0, coeff = 4) {
4837
4844
  const centersCache = new Map();
4838
4845
  const calcObjectCenter = (object, target) => {
@@ -6884,7 +6891,9 @@ class DynamicGltfLoader {
6884
6891
  uniform highp sampler2D highlightTexture;
6885
6892
  uniform float objectStateTextureSize;
6886
6893
  varying vec4 vColorOverride;
6887
- varying float vHighlightStyle;
6894
+ // The style index is the same for all vertices of an object. Interpolated, it can come out just below the
6895
+ // integer, and int() then picks the previous style (pixel noise on some GPUs, e.g. SwiftShader).
6896
+ flat varying float vHighlightStyle;
6888
6897
 
6889
6898
  ivec2 getObjectStateCoord(float instanceId) {
6890
6899
  int size = int(objectStateTextureSize);
@@ -6932,7 +6941,7 @@ class DynamicGltfLoader {
6932
6941
  #include <common>
6933
6942
  varying float vVisibility;
6934
6943
  varying vec4 vColorOverride;
6935
- varying float vHighlightStyle;
6944
+ flat varying float vHighlightStyle;
6936
6945
  uniform vec4 highlightStyles[${MAX_HIGHLIGHT_STYLES * HIGHLIGHT_STYLE_VEC4_COUNT}];
6937
6946
 
6938
6947
  // Edges color for the "edges" material, faces color for everything else