playcanvas 2.24.0-beta.35 → 2.24.0-beta.36

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.
Files changed (31) hide show
  1. package/build/playcanvas/src/core/core.js +2 -2
  2. package/build/playcanvas/src/scene/materials/lit-material-options-builder.js +1 -1
  3. package/build/playcanvas/src/scene/materials/lit-material.js +1 -0
  4. package/build/playcanvas/src/scene/materials/standard-material-options-builder.d.ts +0 -19
  5. package/build/playcanvas/src/scene/materials/standard-material-options-builder.js +7 -14
  6. package/build/playcanvas/src/scene/materials/standard-material-parameters.d.ts +1 -1
  7. package/build/playcanvas/src/scene/materials/standard-material-parameters.js +1 -1
  8. package/build/playcanvas/src/scene/materials/standard-material.d.ts +3 -11
  9. package/build/playcanvas/src/scene/materials/standard-material.js +8 -32
  10. package/build/playcanvas.d.ts +3 -30
  11. package/build/playcanvas.dbg/src/core/core.js +2 -2
  12. package/build/playcanvas.dbg/src/scene/materials/lit-material-options-builder.js +1 -1
  13. package/build/playcanvas.dbg/src/scene/materials/lit-material.js +1 -0
  14. package/build/playcanvas.dbg/src/scene/materials/standard-material-options-builder.js +9 -37
  15. package/build/playcanvas.dbg/src/scene/materials/standard-material-parameters.js +1 -1
  16. package/build/playcanvas.dbg/src/scene/materials/standard-material.js +8 -32
  17. package/build/playcanvas.dbg.js +22 -70
  18. package/build/playcanvas.dbg.mjs +22 -70
  19. package/build/playcanvas.js +22 -53
  20. package/build/playcanvas.min.js +760 -760
  21. package/build/playcanvas.min.mjs +754 -754
  22. package/build/playcanvas.mjs +22 -52
  23. package/build/playcanvas.prf/src/core/core.js +2 -2
  24. package/build/playcanvas.prf/src/scene/materials/lit-material-options-builder.js +1 -1
  25. package/build/playcanvas.prf/src/scene/materials/lit-material.js +1 -0
  26. package/build/playcanvas.prf/src/scene/materials/standard-material-options-builder.js +7 -14
  27. package/build/playcanvas.prf/src/scene/materials/standard-material-parameters.js +1 -1
  28. package/build/playcanvas.prf/src/scene/materials/standard-material.js +8 -32
  29. package/build/playcanvas.prf.js +22 -53
  30. package/build/playcanvas.prf.mjs +22 -52
  31. package/package.json +1 -1
@@ -120,10 +120,6 @@ const _propertiesByUniform = new Map(_propertyList.map((property) => [property.u
120
120
  const isBlack = (color) => {
121
121
  return color.r === 0 && color.g === 0 && color.b === 0;
122
122
  };
123
- const dirtyShaderOnZeroOrOne = (oldValue, newValue) => {
124
- return oldValue === 0 || oldValue === 1 || newValue === 0 || newValue === 1;
125
- };
126
- const { equalish, DEFAULT_REFRACTION_INDEX } = StandardMaterialOptionsBuilder;
127
123
  class StandardMaterial extends Material {
128
124
  /**
129
125
  * Create a new StandardMaterial instance.
@@ -428,7 +424,7 @@ class StandardMaterial extends Material {
428
424
  */
429
425
  set specularityFactor(value) {
430
426
  if (this._specularityFactor !== value) {
431
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._specularityFactor, value);
427
+ this._dirtyShader = this._dirtyShader || this._specularityFactor > 0 !== value > 0;
432
428
  this._specularityFactor = value;
433
429
  this._markPropertyModified(_properties.specularityFactor);
434
430
  }
@@ -449,7 +445,6 @@ class StandardMaterial extends Material {
449
445
  */
450
446
  set sheenGloss(value) {
451
447
  if (this._sheenGloss !== value) {
452
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._sheenGloss, value);
453
448
  this._sheenGloss = value;
454
449
  this._markPropertyModified(_properties.sheenGloss);
455
450
  }
@@ -471,7 +466,6 @@ class StandardMaterial extends Material {
471
466
  */
472
467
  set gloss(value) {
473
468
  if (this._gloss !== value) {
474
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._gloss, value);
475
469
  this._gloss = value;
476
470
  this._markPropertyModified(_properties.gloss);
477
471
  }
@@ -491,7 +485,6 @@ class StandardMaterial extends Material {
491
485
  */
492
486
  set aoIntensity(value) {
493
487
  if (this._aoIntensity !== value) {
494
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._aoIntensity, value);
495
488
  this._aoIntensity = value;
496
489
  this._markPropertyModified(_properties.aoIntensity);
497
490
  }
@@ -536,7 +529,6 @@ class StandardMaterial extends Material {
536
529
  */
537
530
  set parallaxSamples(value) {
538
531
  if (this._parallaxSamples !== value) {
539
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._parallaxSamples, value);
540
532
  this._parallaxSamples = value;
541
533
  this._markPropertyModified(_properties.parallaxSamples);
542
534
  }
@@ -584,7 +576,6 @@ class StandardMaterial extends Material {
584
576
  */
585
577
  set opacity(value) {
586
578
  if (this._opacity !== value) {
587
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._opacity, value);
588
579
  this._opacity = value;
589
580
  this._markPropertyModified(_properties.opacity);
590
581
  this._markPropertyModified(_properties.alphaDither);
@@ -605,7 +596,6 @@ class StandardMaterial extends Material {
605
596
  */
606
597
  set alphaFade(value) {
607
598
  if (this._alphaFade !== value) {
608
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._alphaFade, value);
609
599
  this._alphaFade = value;
610
600
  this._markPropertyModified(_properties.alphaFade);
611
601
  }
@@ -627,7 +617,6 @@ class StandardMaterial extends Material {
627
617
  */
628
618
  set bumpiness(value) {
629
619
  if (this._bumpiness !== value) {
630
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._bumpiness, value);
631
620
  this._bumpiness = value;
632
621
  this._markPropertyModified(_properties.bumpiness);
633
622
  }
@@ -649,7 +638,6 @@ class StandardMaterial extends Material {
649
638
  */
650
639
  set normalDetailMapBumpiness(value) {
651
640
  if (this._normalDetailMapBumpiness !== value) {
652
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._normalDetailMapBumpiness, value);
653
641
  this._normalDetailMapBumpiness = value;
654
642
  this._markPropertyModified(_properties.normalDetailMapBumpiness);
655
643
  }
@@ -669,7 +657,6 @@ class StandardMaterial extends Material {
669
657
  */
670
658
  set reflectivity(value) {
671
659
  if (this._reflectivity !== value) {
672
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._reflectivity, value);
673
660
  this._reflectivity = value;
674
661
  this._markPropertyModified(_properties.reflectivity);
675
662
  }
@@ -689,7 +676,6 @@ class StandardMaterial extends Material {
689
676
  */
690
677
  set occludeSpecularIntensity(value) {
691
678
  if (this._occludeSpecularIntensity !== value) {
692
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._occludeSpecularIntensity, value);
693
679
  this._occludeSpecularIntensity = value;
694
680
  this._markPropertyModified(_properties.occludeSpecularIntensity);
695
681
  }
@@ -710,7 +696,7 @@ class StandardMaterial extends Material {
710
696
  */
711
697
  set refraction(value) {
712
698
  if (this._refraction !== value) {
713
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._refraction, value) || equalish(this._refraction, 1) !== equalish(value, 1);
699
+ this._dirtyShader = this._dirtyShader || this._refraction !== 0 !== (value !== 0);
714
700
  this._refraction = value;
715
701
  this._markPropertyModified(_properties.refraction);
716
702
  }
@@ -733,7 +719,6 @@ class StandardMaterial extends Material {
733
719
  */
734
720
  set refractionIndex(value) {
735
721
  if (this._refractionIndex !== value) {
736
- this._dirtyShader = this._dirtyShader || equalish(this._refractionIndex, DEFAULT_REFRACTION_INDEX) !== equalish(value, DEFAULT_REFRACTION_INDEX);
737
722
  this._refractionIndex = value;
738
723
  this._markPropertyModified(_properties.refractionIndex);
739
724
  }
@@ -754,7 +739,7 @@ class StandardMaterial extends Material {
754
739
  */
755
740
  set dispersion(value) {
756
741
  if (this._dispersion !== value) {
757
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._dispersion, value);
742
+ this._dirtyShader = this._dirtyShader || this._dispersion > 0 !== value > 0;
758
743
  this._dispersion = value;
759
744
  this._markPropertyModified(_properties.dispersion);
760
745
  }
@@ -775,7 +760,6 @@ class StandardMaterial extends Material {
775
760
  */
776
761
  set thickness(value) {
777
762
  if (this._thickness !== value) {
778
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._thickness, value);
779
763
  this._thickness = value;
780
764
  this._markPropertyModified(_properties.thickness);
781
765
  }
@@ -816,7 +800,7 @@ class StandardMaterial extends Material {
816
800
  */
817
801
  set anisotropyIntensity(value) {
818
802
  if (this._anisotropyIntensity !== value) {
819
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._anisotropyIntensity, value);
803
+ this._dirtyShader = this._dirtyShader || this.enableGGXSpecular && !this.anisotropyMap && this._anisotropyIntensity > 0 !== value > 0;
820
804
  this._anisotropyIntensity = value;
821
805
  this._markPropertyModified(_properties.anisotropyIntensity);
822
806
  }
@@ -837,7 +821,7 @@ class StandardMaterial extends Material {
837
821
  */
838
822
  set clearCoat(value) {
839
823
  if (this._clearCoat !== value) {
840
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._clearCoat, value);
824
+ this._dirtyShader = this._dirtyShader || this._clearCoat !== 0 !== (value !== 0) || this._clearCoat > 0 !== value > 0;
841
825
  this._clearCoat = value;
842
826
  this._markPropertyModified(_properties.clearCoat);
843
827
  }
@@ -857,7 +841,6 @@ class StandardMaterial extends Material {
857
841
  */
858
842
  set clearCoatGloss(value) {
859
843
  if (this._clearCoatGloss !== value) {
860
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._clearCoatGloss, value);
861
844
  this._clearCoatGloss = value;
862
845
  this._markPropertyModified(_properties.clearCoatGloss);
863
846
  }
@@ -879,7 +862,6 @@ class StandardMaterial extends Material {
879
862
  */
880
863
  set clearCoatBumpiness(value) {
881
864
  if (this._clearCoatBumpiness !== value) {
882
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._clearCoatBumpiness, value);
883
865
  this._clearCoatBumpiness = value;
884
866
  this._markPropertyModified(_properties.clearCoatBumpiness);
885
867
  }
@@ -901,7 +883,7 @@ class StandardMaterial extends Material {
901
883
  */
902
884
  set iridescence(value) {
903
885
  if (this._iridescence !== value) {
904
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._iridescence, value);
886
+ this._dirtyShader = this._dirtyShader || this.useIridescence && this._iridescence !== 0 !== (value !== 0);
905
887
  this._iridescence = value;
906
888
  this._markPropertyModified(_properties.iridescence);
907
889
  }
@@ -923,7 +905,6 @@ class StandardMaterial extends Material {
923
905
  */
924
906
  set iridescenceRefractionIndex(value) {
925
907
  if (this._iridescenceRefractionIndex !== value) {
926
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._iridescenceRefractionIndex, value);
927
908
  this._iridescenceRefractionIndex = value;
928
909
  this._markPropertyModified(_properties.iridescenceRefractionIndex);
929
910
  }
@@ -944,7 +925,6 @@ class StandardMaterial extends Material {
944
925
  */
945
926
  set iridescenceThicknessMin(value) {
946
927
  if (this._iridescenceThicknessMin !== value) {
947
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._iridescenceThicknessMin, value);
948
928
  this._iridescenceThicknessMin = value;
949
929
  this._markPropertyModified(_properties.iridescenceThicknessMin);
950
930
  }
@@ -965,7 +945,6 @@ class StandardMaterial extends Material {
965
945
  */
966
946
  set iridescenceThicknessMax(value) {
967
947
  if (this._iridescenceThicknessMax !== value) {
968
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._iridescenceThicknessMax, value);
969
948
  this._iridescenceThicknessMax = value;
970
949
  this._markPropertyModified(_properties.iridescenceThicknessMax);
971
950
  }
@@ -1032,7 +1011,6 @@ class StandardMaterial extends Material {
1032
1011
  */
1033
1012
  set anisotropyRotation(value) {
1034
1013
  if (this._anisotropyRotation !== value) {
1035
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._anisotropyRotation, value);
1036
1014
  this._anisotropyRotation = value;
1037
1015
  this._markPropertyModified(_properties.anisotropyRotation);
1038
1016
  }
@@ -1053,7 +1031,6 @@ class StandardMaterial extends Material {
1053
1031
  */
1054
1032
  set attenuationDistance(value) {
1055
1033
  if (this._attenuationDistance !== value) {
1056
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._attenuationDistance, value);
1057
1034
  this._attenuationDistance = value;
1058
1035
  this._markPropertyModified(_properties.attenuationDistance);
1059
1036
  }
@@ -1075,7 +1052,6 @@ class StandardMaterial extends Material {
1075
1052
  */
1076
1053
  set heightMapFactor(value) {
1077
1054
  if (this._heightMapFactor !== value) {
1078
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._heightMapFactor, value);
1079
1055
  this._heightMapFactor = value;
1080
1056
  this._markPropertyModified(_properties.heightMapFactor);
1081
1057
  }
@@ -1609,7 +1585,7 @@ function _defineMaterialProps() {
1609
1585
  registerProp("reflectivity", () => 1);
1610
1586
  registerProp("occludeSpecularIntensity", () => 1);
1611
1587
  registerProp("refraction", () => 0);
1612
- registerProp("refractionIndex", () => DEFAULT_REFRACTION_INDEX);
1588
+ registerProp("refractionIndex", () => 1 / 1.5);
1613
1589
  registerProp("dispersion", () => 0);
1614
1590
  registerProp("thickness", () => 0);
1615
1591
  registerProp("metalness", () => 1);
@@ -1630,7 +1606,6 @@ function _defineMaterialProps() {
1630
1606
  registerProp("planarReflectionMatrix", () => new Mat4(), true);
1631
1607
  registerProp("alphaTest", () => 0);
1632
1608
  _defineObject("ambientSH");
1633
- _defineFlag("specularityFactorTint", false);
1634
1609
  _defineFlag("useMetalness", false);
1635
1610
  _defineFlag("useMetalnessSpecularColor", false);
1636
1611
  _defineFlag("useSheen", false);
@@ -1768,6 +1743,7 @@ _defineRemovedTint("diffuseTint");
1768
1743
  _defineRemovedTint("emissiveTint");
1769
1744
  _defineRemovedTint("ambientTint");
1770
1745
  _defineRemovedTint("specularTint");
1746
+ _defineRemovedTint("specularityFactorTint");
1771
1747
  _defineDeprecatedAlias("aoVertexColor", "aoMapVertexColor");
1772
1748
  _defineDeprecatedAlias("diffuseVertexColor", "diffuseMapVertexColor");
1773
1749
  _defineDeprecatedAlias("specularVertexColor", "specularMapVertexColor");
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * PlayCanvas Engine v2.24.0-beta.35 revision 597f7e9 (DEBUG)
3
+ * PlayCanvas Engine v2.24.0-beta.36 revision 934e4e7 (DEBUG)
4
4
  * Copyright 2011-2026 PlayCanvas Ltd. All rights reserved.
5
5
  *
6
6
  * This source code is licensed under the MIT license found in the
@@ -1462,8 +1462,8 @@ var pc = (() => {
1462
1462
  var TRACEID_GPU_TIMINGS = "GpuTimings";
1463
1463
 
1464
1464
  // src/core/core.js
1465
- var version = "2.24.0-beta.35";
1466
- var revision = "597f7e9";
1465
+ var version = "2.24.0-beta.36";
1466
+ var revision = "934e4e7";
1467
1467
  function extend(target2, ex) {
1468
1468
  for (const prop in ex) {
1469
1469
  const copy = ex[prop];
@@ -54641,7 +54641,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
54641
54641
  litOptions.pixelSnap = material.pixelSnap;
54642
54642
  litOptions.ambientSH = material.ambientSH;
54643
54643
  litOptions.occludeSpecular = material.occludeSpecular;
54644
- litOptions.occludeSpecularFloat = material.occludeSpecularIntensity !== 1;
54644
+ litOptions.occludeSpecularFloat = true;
54645
54645
  litOptions.useMsdf = false;
54646
54646
  litOptions.msdfTextAttribute = false;
54647
54647
  litOptions.alphaToCoverage = material.alphaToCoverage;
@@ -54744,19 +54744,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
54744
54744
  var notBlack = (color2) => {
54745
54745
  return color2.r !== 0 || color2.g !== 0 || color2.b !== 0;
54746
54746
  };
54747
- var _StandardMaterialOptionsBuilder = class _StandardMaterialOptionsBuilder {
54748
- /**
54749
- * Compares two material numbers with the tolerance used to decide whether a shader constant can
54750
- * replace a uniform.
54751
- *
54752
- * @param {number} a - The first value.
54753
- * @param {number} b - The second value.
54754
- * @returns {boolean} True when the values are equal within tolerance.
54755
- * @ignore
54756
- */
54757
- static equalish(a, b) {
54758
- return Math.abs(a - b) < 1e-4;
54759
- }
54747
+ var StandardMaterialOptionsBuilder = class {
54760
54748
  // Minimal options for Depth and Shadow passes, and the outline pass
54761
54749
  updateMinRef(options2, scene, stdMat, objDefs, pass, lightList, vertexFormat, outlinePass = false) {
54762
54750
  this._updateSharedOptions(options2, scene, stdMat, objDefs, pass);
@@ -54878,20 +54866,20 @@ ${requiredChangeStrings.join("\n")}`, { code });
54878
54866
  _updateMaterialOptions(options2, stdMat, scene) {
54879
54867
  const useSpecular = !!(stdMat.useMetalness || stdMat.specularMap || stdMat.sphereMap || stdMat.cubeMap || stdMat.planarReflectionMap || notBlack(stdMat.specular) || stdMat.specularityFactor > 0 && stdMat.useMetalness || stdMat.enableGGXSpecular || stdMat.clearCoat > 0);
54880
54868
  const useSpecularColor = !stdMat.useMetalness || stdMat.useMetalnessSpecularColor;
54881
- const specularityFactorTint = useSpecular && stdMat.useMetalnessSpecularColor && (stdMat.specularityFactorTint || stdMat.specularityFactor !== 1);
54869
+ const specularityFactorTint = useSpecular && stdMat.useMetalnessSpecularColor;
54882
54870
  const isPackedNormalMap = (texture) => texture ? texture.format === PIXELFORMAT_DXT5 || texture.type === TEXTURETYPE_SWIZZLEGGGR : false;
54883
- const { equalish: equalish2, DEFAULT_REFRACTION_INDEX: DEFAULT_REFRACTION_INDEX2 } = _StandardMaterialOptionsBuilder;
54884
- options2.specularityFactorTint = specularityFactorTint;
54885
54871
  options2.metalnessTint = stdMat.useMetalness;
54886
54872
  options2.glossTint = true;
54873
+ options2.iorTint = true;
54874
+ options2.refractionTint = true;
54875
+ options2.thicknessTint = true;
54876
+ options2.iridescenceTint = true;
54877
+ options2.specularityFactorTint = specularityFactorTint;
54887
54878
  options2.diffuseEncoding = stdMat.diffuseMap?.encoding;
54888
54879
  options2.diffuseDetailEncoding = stdMat.diffuseDetailMap?.encoding;
54889
54880
  options2.emissiveEncoding = stdMat.emissiveMap?.encoding;
54890
54881
  options2.lightMapEncoding = stdMat.lightMap?.encoding;
54891
54882
  options2.packedNormal = isPackedNormalMap(stdMat.normalMap);
54892
- options2.refractionTint = !equalish2(stdMat.refraction, 1);
54893
- options2.refractionIndexTint = !equalish2(stdMat.refractionIndex, DEFAULT_REFRACTION_INDEX2);
54894
- options2.thicknessTint = stdMat.useDynamicRefraction && stdMat.thickness !== 1;
54895
54883
  options2.specularEncoding = stdMat.specularMap?.encoding;
54896
54884
  options2.sheenEncoding = stdMat.sheenMap?.encoding;
54897
54885
  options2.diffuseTransmissionColorEncoding = stdMat.diffuseTransmissionColorMap?.encoding;
@@ -54901,10 +54889,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
54901
54889
  options2.normalDetailPackedNormal = isPackedNormalMap(stdMat.normalDetailMap);
54902
54890
  options2.diffuseDetailMode = stdMat.diffuseDetailMode;
54903
54891
  options2.aoDetailMode = stdMat.aoDetailMode;
54904
- options2.clearCoatGloss = !!stdMat.clearCoatGloss;
54905
54892
  options2.clearCoatPackedNormal = isPackedNormalMap(stdMat.clearCoatNormalMap);
54906
- options2.iorTint = !equalish2(stdMat.refractionIndex, DEFAULT_REFRACTION_INDEX2);
54907
- options2.iridescenceTint = true;
54908
54893
  options2.glossInvert = stdMat.glossInvert;
54909
54894
  options2.sheenGlossInvert = stdMat.sheenGlossInvert;
54910
54895
  options2.clearCoatGlossInvert = stdMat.clearCoatGlossInvert;
@@ -54913,7 +54898,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
54913
54898
  options2.litOptions.pixelSnap = stdMat.pixelSnap;
54914
54899
  options2.litOptions.ambientSH = !!stdMat.ambientSH;
54915
54900
  options2.litOptions.occludeSpecular = stdMat.occludeSpecular;
54916
- options2.litOptions.occludeSpecularFloat = stdMat.occludeSpecularIntensity !== 1;
54901
+ options2.litOptions.occludeSpecularFloat = true;
54917
54902
  options2.litOptions.useMsdf = !!stdMat.msdfMap;
54918
54903
  options2.litOptions.msdfTextAttribute = !!stdMat.msdfTextAttribute;
54919
54904
  options2.litOptions.alphaToCoverage = stdMat.alphaToCoverage;
@@ -55031,16 +55016,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55031
55016
  }
55032
55017
  }
55033
55018
  };
55034
- /**
55035
- * The refraction index for which the shader uses a built-in constant instead of the
55036
- * material_refractionIndex uniform. Shared with StandardMaterial, which needs to invalidate its
55037
- * shaders when refractionIndex moves across this value.
55038
- *
55039
- * @type {number}
55040
- * @ignore
55041
- */
55042
- __publicField(_StandardMaterialOptionsBuilder, "DEFAULT_REFRACTION_INDEX", 1 / 1.5);
55043
- var StandardMaterialOptionsBuilder = _StandardMaterialOptionsBuilder;
55044
55019
 
55045
55020
  // src/scene/materials/standard-material-parameters.js
55046
55021
  function _textureParameter(name, channel = true, vertexColor = true) {
@@ -55079,7 +55054,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55079
55054
  ..._textureParameter("specular"),
55080
55055
  occludeSpecular: "enum:occludeSpecular",
55081
55056
  specularityFactor: "number",
55082
- specularityFactorTint: "boolean",
55083
55057
  ..._textureParameter("specularityFactor"),
55084
55058
  useMetalness: "boolean",
55085
55059
  metalness: "number",
@@ -55225,6 +55199,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
55225
55199
  useGamma: "boolean",
55226
55200
  useGammaTonemap: "boolean",
55227
55201
  sheenGlossTint: "boolean",
55202
+ specularityFactorTint: "boolean",
55228
55203
  anisotropy: "boolean"
55229
55204
  };
55230
55205
 
@@ -55313,10 +55288,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55313
55288
  var isBlack = (color2) => {
55314
55289
  return color2.r === 0 && color2.g === 0 && color2.b === 0;
55315
55290
  };
55316
- var dirtyShaderOnZeroOrOne = (oldValue, newValue) => {
55317
- return oldValue === 0 || oldValue === 1 || newValue === 0 || newValue === 1;
55318
- };
55319
- var { equalish, DEFAULT_REFRACTION_INDEX } = StandardMaterialOptionsBuilder;
55320
55291
  var StandardMaterial = class extends Material {
55321
55292
  /**
55322
55293
  * Create a new StandardMaterial instance.
@@ -55621,7 +55592,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
55621
55592
  */
55622
55593
  set specularityFactor(value) {
55623
55594
  if (this._specularityFactor !== value) {
55624
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._specularityFactor, value);
55595
+ this._dirtyShader = this._dirtyShader || this._specularityFactor > 0 !== value > 0;
55625
55596
  this._specularityFactor = value;
55626
55597
  this._markPropertyModified(_properties.specularityFactor);
55627
55598
  }
@@ -55642,7 +55613,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55642
55613
  */
55643
55614
  set sheenGloss(value) {
55644
55615
  if (this._sheenGloss !== value) {
55645
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._sheenGloss, value);
55646
55616
  this._sheenGloss = value;
55647
55617
  this._markPropertyModified(_properties.sheenGloss);
55648
55618
  }
@@ -55664,7 +55634,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55664
55634
  */
55665
55635
  set gloss(value) {
55666
55636
  if (this._gloss !== value) {
55667
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._gloss, value);
55668
55637
  this._gloss = value;
55669
55638
  this._markPropertyModified(_properties.gloss);
55670
55639
  }
@@ -55684,7 +55653,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55684
55653
  */
55685
55654
  set aoIntensity(value) {
55686
55655
  if (this._aoIntensity !== value) {
55687
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._aoIntensity, value);
55688
55656
  this._aoIntensity = value;
55689
55657
  this._markPropertyModified(_properties.aoIntensity);
55690
55658
  }
@@ -55729,7 +55697,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55729
55697
  */
55730
55698
  set parallaxSamples(value) {
55731
55699
  if (this._parallaxSamples !== value) {
55732
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._parallaxSamples, value);
55733
55700
  this._parallaxSamples = value;
55734
55701
  this._markPropertyModified(_properties.parallaxSamples);
55735
55702
  }
@@ -55777,7 +55744,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55777
55744
  */
55778
55745
  set opacity(value) {
55779
55746
  if (this._opacity !== value) {
55780
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._opacity, value);
55781
55747
  this._opacity = value;
55782
55748
  this._markPropertyModified(_properties.opacity);
55783
55749
  this._markPropertyModified(_properties.alphaDither);
@@ -55798,7 +55764,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55798
55764
  */
55799
55765
  set alphaFade(value) {
55800
55766
  if (this._alphaFade !== value) {
55801
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._alphaFade, value);
55802
55767
  this._alphaFade = value;
55803
55768
  this._markPropertyModified(_properties.alphaFade);
55804
55769
  }
@@ -55820,7 +55785,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55820
55785
  */
55821
55786
  set bumpiness(value) {
55822
55787
  if (this._bumpiness !== value) {
55823
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._bumpiness, value);
55824
55788
  this._bumpiness = value;
55825
55789
  this._markPropertyModified(_properties.bumpiness);
55826
55790
  }
@@ -55842,7 +55806,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55842
55806
  */
55843
55807
  set normalDetailMapBumpiness(value) {
55844
55808
  if (this._normalDetailMapBumpiness !== value) {
55845
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._normalDetailMapBumpiness, value);
55846
55809
  this._normalDetailMapBumpiness = value;
55847
55810
  this._markPropertyModified(_properties.normalDetailMapBumpiness);
55848
55811
  }
@@ -55862,7 +55825,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55862
55825
  */
55863
55826
  set reflectivity(value) {
55864
55827
  if (this._reflectivity !== value) {
55865
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._reflectivity, value);
55866
55828
  this._reflectivity = value;
55867
55829
  this._markPropertyModified(_properties.reflectivity);
55868
55830
  }
@@ -55882,7 +55844,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55882
55844
  */
55883
55845
  set occludeSpecularIntensity(value) {
55884
55846
  if (this._occludeSpecularIntensity !== value) {
55885
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._occludeSpecularIntensity, value);
55886
55847
  this._occludeSpecularIntensity = value;
55887
55848
  this._markPropertyModified(_properties.occludeSpecularIntensity);
55888
55849
  }
@@ -55903,7 +55864,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
55903
55864
  */
55904
55865
  set refraction(value) {
55905
55866
  if (this._refraction !== value) {
55906
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._refraction, value) || equalish(this._refraction, 1) !== equalish(value, 1);
55867
+ this._dirtyShader = this._dirtyShader || this._refraction !== 0 !== (value !== 0);
55907
55868
  this._refraction = value;
55908
55869
  this._markPropertyModified(_properties.refraction);
55909
55870
  }
@@ -55926,7 +55887,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55926
55887
  */
55927
55888
  set refractionIndex(value) {
55928
55889
  if (this._refractionIndex !== value) {
55929
- this._dirtyShader = this._dirtyShader || equalish(this._refractionIndex, DEFAULT_REFRACTION_INDEX) !== equalish(value, DEFAULT_REFRACTION_INDEX);
55930
55890
  this._refractionIndex = value;
55931
55891
  this._markPropertyModified(_properties.refractionIndex);
55932
55892
  }
@@ -55947,7 +55907,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
55947
55907
  */
55948
55908
  set dispersion(value) {
55949
55909
  if (this._dispersion !== value) {
55950
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._dispersion, value);
55910
+ this._dirtyShader = this._dirtyShader || this._dispersion > 0 !== value > 0;
55951
55911
  this._dispersion = value;
55952
55912
  this._markPropertyModified(_properties.dispersion);
55953
55913
  }
@@ -55968,7 +55928,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
55968
55928
  */
55969
55929
  set thickness(value) {
55970
55930
  if (this._thickness !== value) {
55971
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._thickness, value);
55972
55931
  this._thickness = value;
55973
55932
  this._markPropertyModified(_properties.thickness);
55974
55933
  }
@@ -56009,7 +55968,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
56009
55968
  */
56010
55969
  set anisotropyIntensity(value) {
56011
55970
  if (this._anisotropyIntensity !== value) {
56012
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._anisotropyIntensity, value);
55971
+ this._dirtyShader = this._dirtyShader || this.enableGGXSpecular && !this.anisotropyMap && this._anisotropyIntensity > 0 !== value > 0;
56013
55972
  this._anisotropyIntensity = value;
56014
55973
  this._markPropertyModified(_properties.anisotropyIntensity);
56015
55974
  }
@@ -56030,7 +55989,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
56030
55989
  */
56031
55990
  set clearCoat(value) {
56032
55991
  if (this._clearCoat !== value) {
56033
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._clearCoat, value);
55992
+ this._dirtyShader = this._dirtyShader || this._clearCoat !== 0 !== (value !== 0) || this._clearCoat > 0 !== value > 0;
56034
55993
  this._clearCoat = value;
56035
55994
  this._markPropertyModified(_properties.clearCoat);
56036
55995
  }
@@ -56050,7 +56009,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
56050
56009
  */
56051
56010
  set clearCoatGloss(value) {
56052
56011
  if (this._clearCoatGloss !== value) {
56053
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._clearCoatGloss, value);
56054
56012
  this._clearCoatGloss = value;
56055
56013
  this._markPropertyModified(_properties.clearCoatGloss);
56056
56014
  }
@@ -56072,7 +56030,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
56072
56030
  */
56073
56031
  set clearCoatBumpiness(value) {
56074
56032
  if (this._clearCoatBumpiness !== value) {
56075
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._clearCoatBumpiness, value);
56076
56033
  this._clearCoatBumpiness = value;
56077
56034
  this._markPropertyModified(_properties.clearCoatBumpiness);
56078
56035
  }
@@ -56094,7 +56051,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
56094
56051
  */
56095
56052
  set iridescence(value) {
56096
56053
  if (this._iridescence !== value) {
56097
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._iridescence, value);
56054
+ this._dirtyShader = this._dirtyShader || this.useIridescence && this._iridescence !== 0 !== (value !== 0);
56098
56055
  this._iridescence = value;
56099
56056
  this._markPropertyModified(_properties.iridescence);
56100
56057
  }
@@ -56116,7 +56073,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
56116
56073
  */
56117
56074
  set iridescenceRefractionIndex(value) {
56118
56075
  if (this._iridescenceRefractionIndex !== value) {
56119
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._iridescenceRefractionIndex, value);
56120
56076
  this._iridescenceRefractionIndex = value;
56121
56077
  this._markPropertyModified(_properties.iridescenceRefractionIndex);
56122
56078
  }
@@ -56137,7 +56093,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
56137
56093
  */
56138
56094
  set iridescenceThicknessMin(value) {
56139
56095
  if (this._iridescenceThicknessMin !== value) {
56140
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._iridescenceThicknessMin, value);
56141
56096
  this._iridescenceThicknessMin = value;
56142
56097
  this._markPropertyModified(_properties.iridescenceThicknessMin);
56143
56098
  }
@@ -56158,7 +56113,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
56158
56113
  */
56159
56114
  set iridescenceThicknessMax(value) {
56160
56115
  if (this._iridescenceThicknessMax !== value) {
56161
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._iridescenceThicknessMax, value);
56162
56116
  this._iridescenceThicknessMax = value;
56163
56117
  this._markPropertyModified(_properties.iridescenceThicknessMax);
56164
56118
  }
@@ -56225,7 +56179,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
56225
56179
  */
56226
56180
  set anisotropyRotation(value) {
56227
56181
  if (this._anisotropyRotation !== value) {
56228
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._anisotropyRotation, value);
56229
56182
  this._anisotropyRotation = value;
56230
56183
  this._markPropertyModified(_properties.anisotropyRotation);
56231
56184
  }
@@ -56246,7 +56199,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
56246
56199
  */
56247
56200
  set attenuationDistance(value) {
56248
56201
  if (this._attenuationDistance !== value) {
56249
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._attenuationDistance, value);
56250
56202
  this._attenuationDistance = value;
56251
56203
  this._markPropertyModified(_properties.attenuationDistance);
56252
56204
  }
@@ -56268,7 +56220,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
56268
56220
  */
56269
56221
  set heightMapFactor(value) {
56270
56222
  if (this._heightMapFactor !== value) {
56271
- this._dirtyShader = this._dirtyShader || dirtyShaderOnZeroOrOne(this._heightMapFactor, value);
56272
56223
  this._heightMapFactor = value;
56273
56224
  this._markPropertyModified(_properties.heightMapFactor);
56274
56225
  }
@@ -56802,7 +56753,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
56802
56753
  registerProp("reflectivity", () => 1);
56803
56754
  registerProp("occludeSpecularIntensity", () => 1);
56804
56755
  registerProp("refraction", () => 0);
56805
- registerProp("refractionIndex", () => DEFAULT_REFRACTION_INDEX);
56756
+ registerProp("refractionIndex", () => 1 / 1.5);
56806
56757
  registerProp("dispersion", () => 0);
56807
56758
  registerProp("thickness", () => 0);
56808
56759
  registerProp("metalness", () => 1);
@@ -56823,7 +56774,6 @@ ${requiredChangeStrings.join("\n")}`, { code });
56823
56774
  registerProp("planarReflectionMatrix", () => new Mat4(), true);
56824
56775
  registerProp("alphaTest", () => 0);
56825
56776
  _defineObject("ambientSH");
56826
- _defineFlag("specularityFactorTint", false);
56827
56777
  _defineFlag("useMetalness", false);
56828
56778
  _defineFlag("useMetalnessSpecularColor", false);
56829
56779
  _defineFlag("useSheen", false);
@@ -56961,6 +56911,7 @@ ${requiredChangeStrings.join("\n")}`, { code });
56961
56911
  _defineRemovedTint("emissiveTint");
56962
56912
  _defineRemovedTint("ambientTint");
56963
56913
  _defineRemovedTint("specularTint");
56914
+ _defineRemovedTint("specularityFactorTint");
56964
56915
  _defineDeprecatedAlias("aoVertexColor", "aoMapVertexColor");
56965
56916
  _defineDeprecatedAlias("diffuseVertexColor", "diffuseMapVertexColor");
56966
56917
  _defineDeprecatedAlias("specularVertexColor", "specularMapVertexColor");
@@ -73198,6 +73149,7 @@ fn main(
73198
73149
  super.updateUniforms(device, scene);
73199
73150
  this.setParameter("material_occludeDirect", this.occludeDirect ? 1 : 0);
73200
73151
  this.setParameter("material_twoSidedLighting", this.twoSidedLighting ? 1 : 0);
73152
+ this.setParameter("material_occludeSpecularIntensity", this.occludeSpecularIntensity);
73201
73153
  }
73202
73154
  /** @ignore */
73203
73155
  getShaderVariant(params) {