@galacean/engine-core 1.0.0-beta.3 → 1.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -682,7 +682,9 @@ __decorate([
682
682
  */ _proto._addToResourceManager = function _addToResourceManager(path) {
683
683
  this._engine.resourceManager._addAsset(path, this);
684
684
  };
685
- _proto._onDestroy = function _onDestroy() {
685
+ /**
686
+ * @internal
687
+ */ _proto._onDestroy = function _onDestroy() {
686
688
  EngineObject.prototype._onDestroy.call(this);
687
689
  this._engine.resourceManager._deleteReferResource(this);
688
690
  var refCount = this._getReferCount();
@@ -814,7 +816,9 @@ var GraphicsResource = /*#__PURE__*/ function(ReferResource) {
814
816
  return _this;
815
817
  }
816
818
  var _proto = GraphicsResource.prototype;
817
- _proto._onDestroy = function _onDestroy() {
819
+ /**
820
+ * @internal
821
+ */ _proto._onDestroy = function _onDestroy() {
818
822
  ReferResource.prototype._onDestroy.call(this);
819
823
  this.engine.resourceManager._deleteGraphicResource(this);
820
824
  };
@@ -893,7 +897,9 @@ var Logger = {
893
897
  platformTexture.depthCompareFunction = this._depthCompareFunction;
894
898
  platformTexture.setUseDepthCompareMode(this._useDepthCompareMode);
895
899
  };
896
- _proto._onDestroy = function _onDestroy() {
900
+ /**
901
+ * @internal
902
+ */ _proto._onDestroy = function _onDestroy() {
897
903
  GraphicsResource.prototype._onDestroy.call(this);
898
904
  this._platformTexture.destroy();
899
905
  this._platformTexture = null;
@@ -1081,7 +1087,9 @@ var Logger = {
1081
1087
  this._depthTexture && this._depthTexture.generateMipmaps();
1082
1088
  }
1083
1089
  };
1084
- _proto._onDestroy = function _onDestroy() {
1090
+ /**
1091
+ * @internal
1092
+ */ _proto._onDestroy = function _onDestroy() {
1085
1093
  GraphicsResource.prototype._onDestroy.call(this);
1086
1094
  this._platformRenderTarget.destroy();
1087
1095
  this._colorTextures.length = 0;
@@ -1459,7 +1467,9 @@ var Logger = {
1459
1467
  _proto.getCharInfo = function getCharInfo(char) {
1460
1468
  return this._charInfoMap[char.charCodeAt(0)];
1461
1469
  };
1462
- _proto._onDestroy = function _onDestroy() {
1470
+ /**
1471
+ * @internal
1472
+ */ _proto._onDestroy = function _onDestroy() {
1463
1473
  ReferResource.prototype._onDestroy.call(this);
1464
1474
  this.texture.destroy();
1465
1475
  this.texture = null;
@@ -2022,7 +2032,9 @@ var Logger = {
2022
2032
  subFontMap[key] = subFont;
2023
2033
  return subFont;
2024
2034
  };
2025
- _proto._onDestroy = function _onDestroy() {
2035
+ /**
2036
+ * @internal
2037
+ */ _proto._onDestroy = function _onDestroy() {
2026
2038
  ReferResource.prototype._onDestroy.call(this);
2027
2039
  var subFontMap = this._subFontMap;
2028
2040
  for(var k in subFontMap){
@@ -3241,7 +3253,9 @@ exports.GLCapabilityType = void 0;
3241
3253
  }
3242
3254
  }
3243
3255
  };
3244
- _proto._onDestroy = function _onDestroy() {
3256
+ /**
3257
+ * @internal
3258
+ */ _proto._onDestroy = function _onDestroy() {
3245
3259
  EngineObject.prototype._onDestroy.call(this);
3246
3260
  this._entity._removeComponent(this);
3247
3261
  if (this._entity.isActiveInHierarchy) {
@@ -6014,7 +6028,9 @@ exports.Collider = /*#__PURE__*/ function(Component) {
6014
6028
  */ _proto._onDisable = function _onDisable() {
6015
6029
  this.engine.physicsManager._removeCollider(this);
6016
6030
  };
6017
- _proto._onDestroy = function _onDestroy() {
6031
+ /**
6032
+ * @internal
6033
+ */ _proto._onDestroy = function _onDestroy() {
6018
6034
  Component.prototype._onDestroy.call(this);
6019
6035
  this.clearShapes();
6020
6036
  this._nativeCollider.destroy();
@@ -7864,7 +7880,9 @@ exports.DynamicColliderConstraints = void 0;
7864
7880
  return _this;
7865
7881
  }
7866
7882
  var _proto = Light.prototype;
7867
- _proto._getLightColor = function _getLightColor() {
7883
+ /**
7884
+ * @internal
7885
+ */ _proto._getLightColor = function _getLightColor() {
7868
7886
  this._lightColor.r = this.color.r * this.intensity;
7869
7887
  this._lightColor.g = this.color.g * this.intensity;
7870
7888
  this._lightColor.b = this.color.b * this.intensity;
@@ -9581,9 +9599,9 @@ var noise_simplex_3D_grad = "#define GLSLIFY 1\nfloat simplex(vec3 v,out vec3 gr
9581
9599
 
9582
9600
  var noise_simplex_4D = "#define GLSLIFY 1\nvec4 grad4(float j,vec4 ip){const vec4 ones=vec4(1.0,1.0,1.0,-1.0);vec4 p,s;p.xyz=floor(fract(vec3(j)*ip.xyz)*7.0)*ip.z-1.0;p.w=1.5-dot(abs(p.xyz),ones.xyz);s=vec4(lessThan(p,vec4(0.0)));p.xyz=p.xyz+(s.xyz*2.0-1.0)*s.www;return p;}\n#define F4 0.309016994374947451\nfloat simplex(vec4 v){const vec4 C=vec4(0.138196601125011,0.276393202250021,0.414589803375032,-0.447213595499958);vec4 i=floor(v+dot(v,vec4(F4)));vec4 x0=v-i+dot(i,C.xxxx);vec4 i0;vec3 isX=step(x0.yzw,x0.xxx);vec3 isYZ=step(x0.zww,x0.yyz);i0.x=isX.x+isX.y+isX.z;i0.yzw=1.0-isX;i0.y+=isYZ.x+isYZ.y;i0.zw+=1.0-isYZ.xy;i0.z+=isYZ.z;i0.w+=1.0-isYZ.z;vec4 i3=clamp(i0,0.0,1.0);vec4 i2=clamp(i0-1.0,0.0,1.0);vec4 i1=clamp(i0-2.0,0.0,1.0);vec4 x1=x0-i1+C.xxxx;vec4 x2=x0-i2+C.yyyy;vec4 x3=x0-i3+C.zzzz;vec4 x4=x0+C.wwww;i=mod289(i);float j0=permute(permute(permute(permute(i.w)+i.z)+i.y)+i.x);vec4 j1=permute(permute(permute(permute(i.w+vec4(i1.w,i2.w,i3.w,1.0))+i.z+vec4(i1.z,i2.z,i3.z,1.0))+i.y+vec4(i1.y,i2.y,i3.y,1.0))+i.x+vec4(i1.x,i2.x,i3.x,1.0));vec4 ip=vec4(1.0/294.0,1.0/49.0,1.0/7.0,0.0);vec4 p0=grad4(j0,ip);vec4 p1=grad4(j1.x,ip);vec4 p2=grad4(j1.y,ip);vec4 p3=grad4(j1.z,ip);vec4 p4=grad4(j1.w,ip);vec4 norm=taylorInvSqrt(vec4(dot(p0,p0),dot(p1,p1),dot(p2,p2),dot(p3,p3)));p0*=norm.x;p1*=norm.y;p2*=norm.z;p3*=norm.w;p4*=taylorInvSqrt(dot(p4,p4));vec3 m0=max(0.6-vec3(dot(x0,x0),dot(x1,x1),dot(x2,x2)),0.0);vec2 m1=max(0.6-vec2(dot(x3,x3),dot(x4,x4)),0.0);m0=m0*m0;m1=m1*m1;return 49.0*(dot(m0*m0,vec3(dot(p0,x0),dot(p1,x1),dot(p2,x2)))+dot(m1*m1,vec2(dot(p3,x3),dot(p4,x4))));}"; // eslint-disable-line
9583
9601
 
9584
- var pbr_frag_define = "#define GLSLIFY 1\nuniform float material_AlphaCutoff;uniform vec4 material_BaseColor;uniform float material_Metal;uniform float material_Roughness;uniform vec3 material_PBRSpecularColor;uniform float material_Glossiness;uniform vec3 material_EmissiveColor;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nuniform float material_ClearCoat;uniform float material_ClearCoatRoughness;\n#endif\nuniform float material_NormalIntensity;uniform float material_OcclusionIntensity;uniform float material_OcclusionTextureCoord;\n#ifdef MATERIAL_HAS_BASETEXTURE\nuniform sampler2D material_BaseTexture;\n#endif\n#ifdef MATERIAL_HAS_NORMALTEXTURE\nuniform sampler2D material_NormalTexture;\n#endif\n#ifdef MATERIAL_HAS_EMISSIVETEXTURE\nuniform sampler2D material_EmissiveTexture;\n#endif\n#ifdef MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE\nuniform sampler2D material_RoughnessMetallicTexture;\n#endif\n#ifdef MATERIAL_HAS_SPECULAR_GLOSSINESS_TEXTURE\nuniform sampler2D material_SpecularGlossinessTexture;\n#endif\n#ifdef MATERIAL_HAS_OCCLUSION_TEXTURE\nuniform sampler2D material_OcclusionTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_TEXTURE\nuniform sampler2D material_ClearCoatTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE\nuniform sampler2D material_ClearCoatRoughnessTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE\nuniform sampler2D material_ClearCoatNormalTexture;\n#endif\nstruct ReflectedLight{vec3 directDiffuse;vec3 directSpecular;vec3 indirectDiffuse;vec3 indirectSpecular;};struct Geometry{vec3 position;vec3 normal;vec3 viewDir;float dotNV;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nvec3 clearCoatNormal;float clearCoatDotNV;\n#endif\n};struct Material{vec3 diffuseColor;float roughness;vec3 specularColor;float opacity;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nfloat clearCoat;float clearCoatRoughness;\n#endif\n};"; // eslint-disable-line
9602
+ var pbr_frag_define = "#define GLSLIFY 1\nuniform float material_AlphaCutoff;uniform vec4 material_BaseColor;uniform float material_Metal;uniform float material_Roughness;uniform float material_IOR;uniform vec3 material_PBRSpecularColor;uniform float material_Glossiness;uniform vec3 material_EmissiveColor;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nuniform float material_ClearCoat;uniform float material_ClearCoatRoughness;\n#endif\nuniform float material_NormalIntensity;uniform float material_OcclusionIntensity;uniform float material_OcclusionTextureCoord;\n#ifdef MATERIAL_HAS_BASETEXTURE\nuniform sampler2D material_BaseTexture;\n#endif\n#ifdef MATERIAL_HAS_NORMALTEXTURE\nuniform sampler2D material_NormalTexture;\n#endif\n#ifdef MATERIAL_HAS_EMISSIVETEXTURE\nuniform sampler2D material_EmissiveTexture;\n#endif\n#ifdef MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE\nuniform sampler2D material_RoughnessMetallicTexture;\n#endif\n#ifdef MATERIAL_HAS_SPECULAR_GLOSSINESS_TEXTURE\nuniform sampler2D material_SpecularGlossinessTexture;\n#endif\n#ifdef MATERIAL_HAS_OCCLUSION_TEXTURE\nuniform sampler2D material_OcclusionTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_TEXTURE\nuniform sampler2D material_ClearCoatTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE\nuniform sampler2D material_ClearCoatRoughnessTexture;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE\nuniform sampler2D material_ClearCoatNormalTexture;\n#endif\nstruct ReflectedLight{vec3 directDiffuse;vec3 directSpecular;vec3 indirectDiffuse;vec3 indirectSpecular;};struct Geometry{vec3 position;vec3 normal;vec3 viewDir;float dotNV;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nvec3 clearCoatNormal;float clearCoatDotNV;\n#endif\n};struct Material{vec3 diffuseColor;float roughness;vec3 specularColor;float opacity;\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nfloat clearCoat;float clearCoatRoughness;\n#endif\n};"; // eslint-disable-line
9585
9603
 
9586
- var pbr_helper = "#define GLSLIFY 1\n#include <normal_get>\nfloat computeSpecularOcclusion(float ambientOcclusion,float roughness,float dotNV){return saturate(pow(dotNV+ambientOcclusion,exp2(-16.0*roughness-1.0))-1.0+ambientOcclusion);}float getAARoughnessFactor(vec3 normal){\n#ifdef HAS_DERIVATIVES\nvec3 dxy=max(abs(dFdx(normal)),abs(dFdy(normal)));return 0.04+max(max(dxy.x,dxy.y),dxy.z);\n#else\nreturn 0.04;\n#endif\n}void initGeometry(out Geometry geometry){geometry.position=v_pos;geometry.viewDir=normalize(camera_Position-v_pos);\n#if defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE)\nmat3 tbn=getTBN();\n#endif\n#ifdef MATERIAL_HAS_NORMALTEXTURE\ngeometry.normal=getNormalByNormalTexture(tbn,material_NormalTexture,material_NormalIntensity,v_uv);\n#else\ngeometry.normal=getNormal();\n#endif\ngeometry.dotNV=saturate(dot(geometry.normal,geometry.viewDir));\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\n#ifdef MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE\ngeometry.clearCoatNormal=getNormalByNormalTexture(tbn,material_ClearCoatNormalTexture,material_NormalIntensity,v_uv);\n#else\ngeometry.clearCoatNormal=getNormal();\n#endif\ngeometry.clearCoatDotNV=saturate(dot(geometry.clearCoatNormal,geometry.viewDir));\n#endif\n}void initMaterial(out Material material,const in Geometry geometry){vec4 baseColor=material_BaseColor;float metal=material_Metal;float roughness=material_Roughness;vec3 specularColor=material_PBRSpecularColor;float glossiness=material_Glossiness;float alphaCutoff=material_AlphaCutoff;\n#ifdef MATERIAL_HAS_BASETEXTURE\nvec4 baseTextureColor=texture2D(material_BaseTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nbaseTextureColor=gammaToLinear(baseTextureColor);\n#endif\nbaseColor*=baseTextureColor;\n#endif\n#ifdef RENDERER_HAS_VERTEXCOLOR\nbaseColor*=v_color;\n#endif\n#ifdef MATERIAL_IS_ALPHA_CUTOFF\nif(baseColor.a<alphaCutoff){discard;}\n#endif\n#ifdef MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE\nvec4 metalRoughMapColor=texture2D(material_RoughnessMetallicTexture,v_uv);roughness*=metalRoughMapColor.g;metal*=metalRoughMapColor.b;\n#endif\n#ifdef MATERIAL_HAS_SPECULAR_GLOSSINESS_TEXTURE\nvec4 specularGlossinessColor=texture2D(material_SpecularGlossinessTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nspecularGlossinessColor=gammaToLinear(specularGlossinessColor);\n#endif\nspecularColor*=specularGlossinessColor.rgb;glossiness*=specularGlossinessColor.a;\n#endif\n#ifdef IS_METALLIC_WORKFLOW\nmaterial.diffuseColor=baseColor.rgb*(1.0-metal);material.specularColor=mix(vec3(0.04),baseColor.rgb,metal);material.roughness=roughness;\n#else\nfloat specularStrength=max(max(specularColor.r,specularColor.g),specularColor.b);material.diffuseColor=baseColor.rgb*(1.0-specularStrength);material.specularColor=specularColor;material.roughness=1.0-glossiness;\n#endif\nmaterial.roughness=max(material.roughness,getAARoughnessFactor(geometry.normal));\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nmaterial.clearCoat=material_ClearCoat;material.clearCoatRoughness=material_ClearCoatRoughness;\n#ifdef MATERIAL_HAS_CLEAR_COAT_TEXTURE\nmaterial.clearCoat*=texture2D(material_ClearCoatTexture,v_uv).r;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE\nmaterial.clearCoatRoughness*=texture2D(material_ClearCoatRoughnessTexture,v_uv).g;\n#endif\nmaterial.clearCoat=saturate(material.clearCoat);material.clearCoatRoughness=max(material.clearCoatRoughness,getAARoughnessFactor(geometry.clearCoatNormal));\n#endif\n#ifdef MATERIAL_IS_TRANSPARENT\nmaterial.opacity=baseColor.a;\n#else\nmaterial.opacity=1.0;\n#endif\n}\n#include <brdf>\n#include <direct_irradiance_frag_define>\n#include <ibl_frag_define>\n"; // eslint-disable-line
9604
+ var pbr_helper = "#define GLSLIFY 1\n#include <normal_get>\nfloat computeSpecularOcclusion(float ambientOcclusion,float roughness,float dotNV){return saturate(pow(dotNV+ambientOcclusion,exp2(-16.0*roughness-1.0))-1.0+ambientOcclusion);}float getAARoughnessFactor(vec3 normal){\n#ifdef HAS_DERIVATIVES\nvec3 dxy=max(abs(dFdx(normal)),abs(dFdy(normal)));return 0.04+max(max(dxy.x,dxy.y),dxy.z);\n#else\nreturn 0.04;\n#endif\n}void initGeometry(out Geometry geometry){geometry.position=v_pos;geometry.viewDir=normalize(camera_Position-v_pos);\n#if defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE)\nmat3 tbn=getTBN();\n#endif\n#ifdef MATERIAL_HAS_NORMALTEXTURE\ngeometry.normal=getNormalByNormalTexture(tbn,material_NormalTexture,material_NormalIntensity,v_uv);\n#else\ngeometry.normal=getNormal();\n#endif\ngeometry.dotNV=saturate(dot(geometry.normal,geometry.viewDir));\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\n#ifdef MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE\ngeometry.clearCoatNormal=getNormalByNormalTexture(tbn,material_ClearCoatNormalTexture,material_NormalIntensity,v_uv);\n#else\ngeometry.clearCoatNormal=getNormal();\n#endif\ngeometry.clearCoatDotNV=saturate(dot(geometry.clearCoatNormal,geometry.viewDir));\n#endif\n}void initMaterial(out Material material,const in Geometry geometry){vec4 baseColor=material_BaseColor;float metal=material_Metal;float roughness=material_Roughness;vec3 specularColor=material_PBRSpecularColor;float glossiness=material_Glossiness;float alphaCutoff=material_AlphaCutoff;float F0=pow2((material_IOR-1.0)/(material_IOR+1.0))\n#ifdef MATERIAL_HAS_BASETEXTURE\nvec4 baseTextureColor=texture2D(material_BaseTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nbaseTextureColor=gammaToLinear(baseTextureColor);\n#endif\nbaseColor*=baseTextureColor;\n#endif\n#ifdef RENDERER_HAS_VERTEXCOLOR\nbaseColor*=v_color;\n#endif\n#ifdef MATERIAL_IS_ALPHA_CUTOFF\nif(baseColor.a<alphaCutoff){discard;}\n#endif\n#ifdef MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE\nvec4 metalRoughMapColor=texture2D(material_RoughnessMetallicTexture,v_uv);roughness*=metalRoughMapColor.g;metal*=metalRoughMapColor.b;\n#endif\n#ifdef MATERIAL_HAS_SPECULAR_GLOSSINESS_TEXTURE\nvec4 specularGlossinessColor=texture2D(material_SpecularGlossinessTexture,v_uv);\n#ifndef ENGINE_IS_COLORSPACE_GAMMA\nspecularGlossinessColor=gammaToLinear(specularGlossinessColor);\n#endif\nspecularColor*=specularGlossinessColor.rgb;glossiness*=specularGlossinessColor.a;\n#endif\n#ifdef IS_METALLIC_WORKFLOW\nmaterial.diffuseColor=baseColor.rgb*(1.0-metal);material.specularColor=mix(vec3(F0),baseColor.rgb,metal);material.roughness=roughness;\n#else\nfloat specularStrength=max(max(specularColor.r,specularColor.g),specularColor.b);material.diffuseColor=baseColor.rgb*(1.0-specularStrength);material.specularColor=specularColor;material.roughness=1.0-glossiness;\n#endif\nmaterial.roughness=max(material.roughness,getAARoughnessFactor(geometry.normal));\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\nmaterial.clearCoat=material_ClearCoat;material.clearCoatRoughness=material_ClearCoatRoughness;\n#ifdef MATERIAL_HAS_CLEAR_COAT_TEXTURE\nmaterial.clearCoat*=texture2D(material_ClearCoatTexture,v_uv).r;\n#endif\n#ifdef MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE\nmaterial.clearCoatRoughness*=texture2D(material_ClearCoatRoughnessTexture,v_uv).g;\n#endif\nmaterial.clearCoat=saturate(material.clearCoat);material.clearCoatRoughness=max(material.clearCoatRoughness,getAARoughnessFactor(geometry.clearCoatNormal));\n#endif\n#ifdef MATERIAL_IS_TRANSPARENT\nmaterial.opacity=baseColor.a;\n#else\nmaterial.opacity=1.0;\n#endif\n}\n#include <brdf>\n#include <direct_irradiance_frag_define>\n#include <ibl_frag_define>\n"; // eslint-disable-line
9587
9605
 
9588
9606
  var brdf = "#define GLSLIFY 1\nfloat F_Schlick(float dotLH){return 0.04+0.96*(pow(1.0-dotLH,5.0));}vec3 F_Schlick(vec3 specularColor,float dotLH){float fresnel=exp2((-5.55473*dotLH-6.98316)*dotLH);return(1.0-specularColor)*fresnel+specularColor;}float G_GGX_SmithCorrelated(float alpha,float dotNL,float dotNV){float a2=pow2(alpha);float gv=dotNL*sqrt(a2+(1.0-a2)*pow2(dotNV));float gl=dotNV*sqrt(a2+(1.0-a2)*pow2(dotNL));return 0.5/max(gv+gl,EPSILON);}float D_GGX(float alpha,float dotNH){float a2=pow2(alpha);float denom=pow2(dotNH)*(a2-1.0)+1.0;return RECIPROCAL_PI*a2/pow2(denom);}vec3 BRDF_Specular_GGX(vec3 incidentDirection,vec3 viewDir,vec3 normal,vec3 specularColor,float roughness){float alpha=pow2(roughness);vec3 halfDir=normalize(incidentDirection+viewDir);float dotNL=saturate(dot(normal,incidentDirection));float dotNV=saturate(dot(normal,viewDir));float dotNH=saturate(dot(normal,halfDir));float dotLH=saturate(dot(incidentDirection,halfDir));vec3 F=F_Schlick(specularColor,dotLH);float G=G_GGX_SmithCorrelated(alpha,dotNL,dotNV);float D=D_GGX(alpha,dotNH);return F*(G*D);}vec3 BRDF_Diffuse_Lambert(vec3 diffuseColor){return RECIPROCAL_PI*diffuseColor;}"; // eslint-disable-line
9589
9607
 
@@ -10781,14 +10799,18 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10781
10799
  (_materials_i = materials[i]) == null ? void 0 : _materials_i._addReferCount(-1);
10782
10800
  }
10783
10801
  };
10784
- _proto._updateShaderData = function _updateShaderData(context) {
10802
+ /**
10803
+ * @internal
10804
+ */ _proto._updateShaderData = function _updateShaderData(context) {
10785
10805
  var entity = this.entity;
10786
10806
  var worldMatrix = entity.transform.worldMatrix;
10787
10807
  this._updateTransformShaderData(context, worldMatrix);
10788
10808
  var layer = entity.layer;
10789
10809
  this._rendererLayer.set(layer & 65535, layer >>> 16 & 65535, 0, 0);
10790
10810
  };
10791
- _proto._updateTransformShaderData = function _updateTransformShaderData(context, worldMatrix) {
10811
+ /**
10812
+ * @internal
10813
+ */ _proto._updateTransformShaderData = function _updateTransformShaderData(context, worldMatrix) {
10792
10814
  var shaderData = this.shaderData;
10793
10815
  var virtualCamera = context.virtualCamera;
10794
10816
  var mvMatrix = this._mvMatrix;
@@ -10807,14 +10829,22 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10807
10829
  shaderData.setMatrix(exports.Renderer._mvInvMatrixProperty, mvInvMatrix);
10808
10830
  shaderData.setMatrix(exports.Renderer._normalMatrixProperty, normalMatrix);
10809
10831
  };
10810
- _proto._registerEntityTransformListener = function _registerEntityTransformListener() {
10832
+ /**
10833
+ * @internal
10834
+ */ _proto._registerEntityTransformListener = function _registerEntityTransformListener() {
10811
10835
  this.entity.transform._updateFlagManager.addListener(this._onTransformChanged);
10812
10836
  };
10813
- _proto._updateBounds = function _updateBounds(worldBounds) {};
10814
- _proto._render = function _render(context) {
10837
+ /**
10838
+ * @internal
10839
+ */ _proto._updateBounds = function _updateBounds(worldBounds) {};
10840
+ /**
10841
+ * @internal
10842
+ */ _proto._render = function _render(context) {
10815
10843
  throw "not implement";
10816
10844
  };
10817
- _proto._createInstanceMaterial = function _createInstanceMaterial(material, index) {
10845
+ /**
10846
+ * @internal
10847
+ */ _proto._createInstanceMaterial = function _createInstanceMaterial(material, index) {
10818
10848
  var insMaterial = material.clone();
10819
10849
  insMaterial.name = insMaterial.name + "(Instance)";
10820
10850
  material._addReferCount(-1);
@@ -10837,7 +10867,9 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10837
10867
  materials[index] = material;
10838
10868
  }
10839
10869
  };
10840
- _proto._onTransformChanged = function _onTransformChanged(type) {
10870
+ /**
10871
+ * @internal
10872
+ */ _proto._onTransformChanged = function _onTransformChanged(type) {
10841
10873
  this._dirtyUpdateFlag |= 0x1;
10842
10874
  };
10843
10875
  _create_class(Renderer1, [
@@ -11162,7 +11194,9 @@ SimpleSpriteAssembler = __decorate([
11162
11194
  */ _proto._cloneTo = function _cloneTo(target) {
11163
11195
  target.sprite = this._sprite;
11164
11196
  };
11165
- _proto._updateBounds = function _updateBounds(worldBounds) {
11197
+ /**
11198
+ * @internal
11199
+ */ _proto._updateBounds = function _updateBounds(worldBounds) {
11166
11200
  var _this_sprite;
11167
11201
  if (!((_this_sprite = this.sprite) == null ? void 0 : _this_sprite.texture) || !this.width || !this.height) {
11168
11202
  worldBounds.min.set(0, 0, 0);
@@ -11172,6 +11206,7 @@ SimpleSpriteAssembler = __decorate([
11172
11206
  }
11173
11207
  };
11174
11208
  /**
11209
+ * @internal
11175
11210
  * @inheritdoc
11176
11211
  */ _proto._render = function _render(context) {
11177
11212
  var _this_sprite;
@@ -11197,6 +11232,7 @@ SimpleSpriteAssembler = __decorate([
11197
11232
  this._maskElement = renderElement;
11198
11233
  };
11199
11234
  /**
11235
+ * @internal
11200
11236
  * @inheritdoc
11201
11237
  */ _proto._onDestroy = function _onDestroy() {
11202
11238
  var _this__sprite;
@@ -11621,7 +11657,9 @@ var BufferUtil = /*#__PURE__*/ function() {
11621
11657
  var platformBuffer = this._engine._hardwareRenderer.createPlatformBuffer(this._type, this._byteLength, this._bufferUsage);
11622
11658
  this._platformBuffer = platformBuffer;
11623
11659
  };
11624
- _proto._onDestroy = function _onDestroy() {
11660
+ /**
11661
+ * @internal
11662
+ */ _proto._onDestroy = function _onDestroy() {
11625
11663
  GraphicsResource.prototype._onDestroy.call(this);
11626
11664
  this._platformBuffer.destroy();
11627
11665
  };
@@ -11834,13 +11872,17 @@ var BufferUtil = /*#__PURE__*/ function() {
11834
11872
  this._vertexElementMap = null;
11835
11873
  this._platformPrimitive.destroy();
11836
11874
  };
11837
- _proto._setVertexElements = function _setVertexElements(elements) {
11875
+ /**
11876
+ * @internal
11877
+ */ _proto._setVertexElements = function _setVertexElements(elements) {
11838
11878
  this._clearVertexElements();
11839
11879
  for(var i = 0, n = elements.length; i < n; i++){
11840
11880
  this._addVertexElement(elements[i]);
11841
11881
  }
11842
11882
  };
11843
- _proto._setIndexBufferBinding = function _setIndexBufferBinding(binding) {
11883
+ /**
11884
+ * @internal
11885
+ */ _proto._setIndexBufferBinding = function _setIndexBufferBinding(binding) {
11844
11886
  var lastBinding = this._indexBufferBinding;
11845
11887
  if (binding) {
11846
11888
  this._indexBufferBinding = binding;
@@ -12978,7 +13020,9 @@ var MeshModifyFlags;
12978
13020
  }
12979
13021
  this.setTangents(tangents);
12980
13022
  };
12981
- _proto._onDestroy = function _onDestroy() {
13023
+ /**
13024
+ * @internal
13025
+ */ _proto._onDestroy = function _onDestroy() {
12982
13026
  Mesh.prototype._onDestroy.call(this);
12983
13027
  this._readable && this._releaseCache();
12984
13028
  };
@@ -13453,7 +13497,9 @@ var VertexChangedFlags;
13453
13497
  return _this;
13454
13498
  }
13455
13499
  var _proto = MeshRenderer.prototype;
13456
- _proto._onDestroy = function _onDestroy() {
13500
+ /**
13501
+ * @internal
13502
+ */ _proto._onDestroy = function _onDestroy() {
13457
13503
  Renderer.prototype._onDestroy.call(this);
13458
13504
  var mesh = this._mesh;
13459
13505
  if (mesh && !mesh.destroyed) {
@@ -13466,7 +13512,9 @@ var VertexChangedFlags;
13466
13512
  */ _proto._cloneTo = function _cloneTo(target) {
13467
13513
  target.mesh = this._mesh;
13468
13514
  };
13469
- _proto._updateBounds = function _updateBounds(worldBounds) {
13515
+ /**
13516
+ * @internal
13517
+ */ _proto._updateBounds = function _updateBounds(worldBounds) {
13470
13518
  var mesh = this._mesh;
13471
13519
  if (mesh) {
13472
13520
  var localBounds = mesh.bounds;
@@ -13477,7 +13525,9 @@ var VertexChangedFlags;
13477
13525
  worldBounds.max.set(0, 0, 0);
13478
13526
  }
13479
13527
  };
13480
- _proto._render = function _render(context) {
13528
+ /**
13529
+ * @internal
13530
+ */ _proto._render = function _render(context) {
13481
13531
  var mesh = this._mesh;
13482
13532
  if (mesh) {
13483
13533
  if (this._dirtyUpdateFlag & 0x2) {
@@ -13638,7 +13688,9 @@ var /**
13638
13688
  }
13639
13689
  }
13640
13690
  };
13641
- _proto._updateShaderData = function _updateShaderData(context) {
13691
+ /**
13692
+ * @internal
13693
+ */ _proto._updateShaderData = function _updateShaderData(context) {
13642
13694
  var entity = this.entity;
13643
13695
  var worldMatrix = this._rootBone ? this._rootBone.transform.worldMatrix : entity.transform.worldMatrix;
13644
13696
  this._updateTransformShaderData(context, worldMatrix);
@@ -13693,10 +13745,14 @@ var /**
13693
13745
  MeshRenderer.prototype._cloneTo.call(this, target);
13694
13746
  this._blendShapeWeights && (target._blendShapeWeights = this._blendShapeWeights.slice());
13695
13747
  };
13696
- _proto._registerEntityTransformListener = function _registerEntityTransformListener() {
13748
+ /**
13749
+ * @internal
13750
+ */ _proto._registerEntityTransformListener = function _registerEntityTransformListener() {
13697
13751
  // Cancel register listener to entity transform.
13698
13752
  };
13699
- _proto._updateBounds = function _updateBounds(worldBounds) {
13753
+ /**
13754
+ * @internal
13755
+ */ _proto._updateBounds = function _updateBounds(worldBounds) {
13700
13756
  if (this._rootBone) {
13701
13757
  var localBounds = this._localBounds;
13702
13758
  var worldMatrix = this._rootBone.transform.worldMatrix;
@@ -16791,7 +16847,9 @@ ShaderPool.init();
16791
16847
  this._magentaTexture2DArray = magentaTexture2DArray;
16792
16848
  }
16793
16849
  };
16794
- _proto._initialize = function _initialize(configuration) {
16850
+ /**
16851
+ * @internal
16852
+ */ _proto._initialize = function _initialize(configuration) {
16795
16853
  var _this = this;
16796
16854
  var physics = configuration.physics;
16797
16855
  if (physics) {
@@ -17113,7 +17171,9 @@ ShaderPool.init();
17113
17171
  this._entity._removeScript(this);
17114
17172
  this._waitHandlingInValid = false;
17115
17173
  };
17116
- _proto._onDestroy = function _onDestroy() {
17174
+ /**
17175
+ * @internal
17176
+ */ _proto._onDestroy = function _onDestroy() {
17117
17177
  Component.prototype._onDestroy.call(this);
17118
17178
  this._engine._componentsManager.addPendingDestroyScript(this);
17119
17179
  };
@@ -18796,6 +18856,7 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
18796
18856
  this.entity.scene._detachRenderCamera(this);
18797
18857
  };
18798
18858
  /**
18859
+ * @internal
18799
18860
  * @inheritdoc
18800
18861
  */ _proto._onDestroy = function _onDestroy() {
18801
18862
  var _this__renderPipeline;
@@ -19990,6 +20051,7 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
19990
20051
  _this = PBRBaseMaterial.call(this, engine, Shader.find("pbr")) || this;
19991
20052
  _this.shaderData.setFloat(PBRMaterial._metallicProp, 1);
19992
20053
  _this.shaderData.setFloat(PBRMaterial._roughnessProp, 1);
20054
+ _this.shaderData.setFloat(PBRMaterial._iorProp, 1.5);
19993
20055
  return _this;
19994
20056
  }
19995
20057
  var _proto = PBRMaterial.prototype;
@@ -20001,10 +20063,23 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
20001
20063
  return dest;
20002
20064
  };
20003
20065
  _create_class(PBRMaterial, [
20066
+ {
20067
+ key: "ior",
20068
+ get: /**
20069
+ * Index Of Refraction.
20070
+ * @defaultValue `1.5`
20071
+ */ function get() {
20072
+ return this.shaderData.getFloat(PBRMaterial._iorProp);
20073
+ },
20074
+ set: function set(v) {
20075
+ this.shaderData.setFloat(PBRMaterial._iorProp, Math.max(v, 0));
20076
+ }
20077
+ },
20004
20078
  {
20005
20079
  key: "metallic",
20006
20080
  get: /**
20007
- * Metallic, default 1.0.
20081
+ * Metallic.
20082
+ * @defaultValue `1.0`
20008
20083
  */ function get() {
20009
20084
  return this.shaderData.getFloat(PBRMaterial._metallicProp);
20010
20085
  },
@@ -20015,7 +20090,8 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
20015
20090
  {
20016
20091
  key: "roughness",
20017
20092
  get: /**
20018
- * Roughness, default 1.0.
20093
+ * Roughness. default 1.0.
20094
+ * @defaultValue `1.0`
20019
20095
  */ function get() {
20020
20096
  return this.shaderData.getFloat(PBRMaterial._roughnessProp);
20021
20097
  },
@@ -20052,6 +20128,9 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
20052
20128
  (function() {
20053
20129
  PBRMaterial._roughnessMetallicTextureProp = ShaderProperty.getByName("material_RoughnessMetallicTexture");
20054
20130
  })();
20131
+ (function() {
20132
+ PBRMaterial._iorProp = Shader.getPropertyByName("material_IOR");
20133
+ })();
20055
20134
 
20056
20135
  /**
20057
20136
  * PBR (Specular-Glossiness Workflow) Material.
@@ -20264,7 +20343,9 @@ exports.TextVerticalAlignment = void 0;
20264
20343
  */ _proto._addSprite = function _addSprite(sprite) {
20265
20344
  this._spriteNamesToIndex[sprite.name] = this._sprites.push(sprite) - 1;
20266
20345
  };
20267
- _proto._onDestroy = function _onDestroy() {
20346
+ /**
20347
+ * @internal
20348
+ */ _proto._onDestroy = function _onDestroy() {
20268
20349
  ReferResource.prototype._onDestroy.call(this);
20269
20350
  this._sprites = null;
20270
20351
  this._spriteNamesToIndex = null;
@@ -20373,7 +20454,9 @@ exports.TextVerticalAlignment = void 0;
20373
20454
  this._dirtyUpdateFlag & 0x1 && this._updatePositions();
20374
20455
  return this._bounds;
20375
20456
  };
20376
- _proto._onDestroy = function _onDestroy() {
20457
+ /**
20458
+ * @internal
20459
+ */ _proto._onDestroy = function _onDestroy() {
20377
20460
  ReferResource.prototype._onDestroy.call(this);
20378
20461
  this._texture = null;
20379
20462
  };
@@ -21111,11 +21194,15 @@ var TiledType;
21111
21194
  target._assembler.resetData(target);
21112
21195
  target.sprite = this._sprite;
21113
21196
  };
21114
- _proto._updateShaderData = function _updateShaderData(context) {
21197
+ /**
21198
+ * @internal
21199
+ */ _proto._updateShaderData = function _updateShaderData(context) {
21115
21200
  // @ts-ignore
21116
21201
  this._updateTransformShaderData(context, engineMath.Matrix._identity);
21117
21202
  };
21118
- _proto._updateBounds = function _updateBounds(worldBounds) {
21203
+ /**
21204
+ * @internal
21205
+ */ _proto._updateBounds = function _updateBounds(worldBounds) {
21119
21206
  var _this_sprite;
21120
21207
  if (!((_this_sprite = this.sprite) == null ? void 0 : _this_sprite.texture) || !this.width || !this.height) {
21121
21208
  worldBounds.min.set(0, 0, 0);
@@ -21124,7 +21211,9 @@ var TiledType;
21124
21211
  this._assembler.updatePositions(this);
21125
21212
  }
21126
21213
  };
21127
- _proto._render = function _render(context) {
21214
+ /**
21215
+ * @internal
21216
+ */ _proto._render = function _render(context) {
21128
21217
  var _this_sprite;
21129
21218
  if (!((_this_sprite = this.sprite) == null ? void 0 : _this_sprite.texture) || !this.width || !this.height) {
21130
21219
  return;
@@ -21535,7 +21624,9 @@ var /**
21535
21624
  this._font._addReferCount(1);
21536
21625
  this.setMaterial(engine._spriteDefaultMaterial);
21537
21626
  };
21538
- _proto._onDestroy = function _onDestroy() {
21627
+ /**
21628
+ * @internal
21629
+ */ _proto._onDestroy = function _onDestroy() {
21539
21630
  Renderer.prototype._onDestroy.call(this);
21540
21631
  // Clear render data.
21541
21632
  var charRenderDatas = this._charRenderDatas;
@@ -21570,14 +21661,20 @@ var /**
21570
21661
  */ _proto._setDirtyFlagFalse = function _setDirtyFlagFalse(type) {
21571
21662
  this._dirtyFlag &= ~type;
21572
21663
  };
21573
- _proto._updateShaderData = function _updateShaderData(context) {
21664
+ /**
21665
+ * @internal
21666
+ */ _proto._updateShaderData = function _updateShaderData(context) {
21574
21667
  // @ts-ignore
21575
21668
  this._updateTransformShaderData(context, engineMath.Matrix._identity);
21576
21669
  };
21577
- _proto._updateBounds = function _updateBounds(worldBounds) {
21670
+ /**
21671
+ * @internal
21672
+ */ _proto._updateBounds = function _updateBounds(worldBounds) {
21578
21673
  engineMath.BoundingBox.transform(this._localBounds, this._entity.transform.worldMatrix, worldBounds);
21579
21674
  };
21580
- _proto._render = function _render(context) {
21675
+ /**
21676
+ * @internal
21677
+ */ _proto._render = function _render(context) {
21581
21678
  if (this._text === "" || this.enableWrapping && this.width <= 0 || this.overflowMode === exports.OverflowMode.Truncate && this.height <= 0) {
21582
21679
  return;
21583
21680
  }
@@ -21760,7 +21857,9 @@ var /**
21760
21857
  return a.texture.instanceId - b.texture.instanceId;
21761
21858
  });
21762
21859
  };
21763
- _proto._onTransformChanged = function _onTransformChanged(bit) {
21860
+ /**
21861
+ * @internal
21862
+ */ _proto._onTransformChanged = function _onTransformChanged(bit) {
21764
21863
  Renderer.prototype._onTransformChanged.call(this, bit);
21765
21864
  this._setDirtyFlagTrue(0x4 | 0x8);
21766
21865
  };
@@ -25530,7 +25629,9 @@ var _tempVector3 = new engineMath.Vector3();
25530
25629
  this.getMaterial().shaderData.setTexture("u_texture", texture);
25531
25630
  }
25532
25631
  };
25533
- _proto._render = function _render(context) {
25632
+ /**
25633
+ * @internal
25634
+ */ _proto._render = function _render(context) {
25534
25635
  this._updateStrapVertices(context.camera, this._points);
25535
25636
  this._updateStrapCoords();
25536
25637
  this._vertexBuffer.setData(this._vertices);
@@ -25724,7 +25825,7 @@ var cacheDir = new engineMath.Vector3();
25724
25825
  /**
25725
25826
  * The position of the probe can be set, the default is the origin [0,0,0].
25726
25827
  */ _this.position = new engineMath.Vector3(0, 0, 0);
25727
- _this._isCube = true;
25828
+ /** @internal */ _this._isCube = true;
25728
25829
  _this.oriViewMatrix = new engineMath.Matrix();
25729
25830
  return _this;
25730
25831
  }