@galacean/engine 0.0.0-experimental-animator-additive.3 → 0.0.0-experimental-animator-additive.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/browser.js CHANGED
@@ -12275,8 +12275,8 @@
12275
12275
  var noise_simplex_3D = "#define GLSLIFY 1\nfloat simplex(vec3 v){const vec2 C=vec2(1.0/6.0,1.0/3.0);const vec4 D=vec4(0.0,0.5,1.0,2.0);vec3 i=floor(v+dot(v,C.yyy));vec3 x0=v-i+dot(i,C.xxx);vec3 g=step(x0.yzx,x0.xyz);vec3 l=1.0-g;vec3 i1=min(g.xyz,l.zxy);vec3 i2=max(g.xyz,l.zxy);vec3 x1=x0-i1+C.xxx;vec3 x2=x0-i2+C.yyy;vec3 x3=x0-D.yyy;i=mod289(i);vec4 p=permute(permute(permute(i.z+vec4(0.0,i1.z,i2.z,1.0))+i.y+vec4(0.0,i1.y,i2.y,1.0))+i.x+vec4(0.0,i1.x,i2.x,1.0));float n_=0.142857142857;vec3 ns=n_*D.wyz-D.xzx;vec4 j=p-49.0*floor(p*ns.z*ns.z);vec4 x_=floor(j*ns.z);vec4 y_=floor(j-7.0*x_);vec4 x=x_*ns.x+ns.yyyy;vec4 y=y_*ns.x+ns.yyyy;vec4 h=1.0-abs(x)-abs(y);vec4 b0=vec4(x.xy,y.xy);vec4 b1=vec4(x.zw,y.zw);vec4 s0=floor(b0)*2.0+1.0;vec4 s1=floor(b1)*2.0+1.0;vec4 sh=-step(h,vec4(0.0));vec4 a0=b0.xzyw+s0.xzyw*sh.xxyy;vec4 a1=b1.xzyw+s1.xzyw*sh.zzww;vec3 p0=vec3(a0.xy,h.x);vec3 p1=vec3(a0.zw,h.y);vec3 p2=vec3(a1.xy,h.z);vec3 p3=vec3(a1.zw,h.w);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;vec4 m=max(0.6-vec4(dot(x0,x0),dot(x1,x1),dot(x2,x2),dot(x3,x3)),0.0);m=m*m;return 42.0*dot(m*m,vec4(dot(p0,x0),dot(p1,x1),dot(p2,x2),dot(p3,x3)));}"; // eslint-disable-line
12276
12276
  var noise_simplex_3D_grad = "#define GLSLIFY 1\nfloat simplex(vec3 v,out vec3 gradient){const vec2 C=vec2(1.0/6.0,1.0/3.0);const vec4 D=vec4(0.0,0.5,1.0,2.0);vec3 i=floor(v+dot(v,C.yyy));vec3 x0=v-i+dot(i,C.xxx);vec3 g=step(x0.yzx,x0.xyz);vec3 l=1.0-g;vec3 i1=min(g.xyz,l.zxy);vec3 i2=max(g.xyz,l.zxy);vec3 x1=x0-i1+C.xxx;vec3 x2=x0-i2+C.yyy;vec3 x3=x0-D.yyy;i=mod289(i);vec4 p=permute(permute(permute(i.z+vec4(0.0,i1.z,i2.z,1.0))+i.y+vec4(0.0,i1.y,i2.y,1.0))+i.x+vec4(0.0,i1.x,i2.x,1.0));float n_=0.142857142857;vec3 ns=n_*D.wyz-D.xzx;vec4 j=p-49.0*floor(p*ns.z*ns.z);vec4 x_=floor(j*ns.z);vec4 y_=floor(j-7.0*x_);vec4 x=x_*ns.x+ns.yyyy;vec4 y=y_*ns.x+ns.yyyy;vec4 h=1.0-abs(x)-abs(y);vec4 b0=vec4(x.xy,y.xy);vec4 b1=vec4(x.zw,y.zw);vec4 s0=floor(b0)*2.0+1.0;vec4 s1=floor(b1)*2.0+1.0;vec4 sh=-step(h,vec4(0.0));vec4 a0=b0.xzyw+s0.xzyw*sh.xxyy;vec4 a1=b1.xzyw+s1.xzyw*sh.zzww;vec3 p0=vec3(a0.xy,h.x);vec3 p1=vec3(a0.zw,h.y);vec3 p2=vec3(a1.xy,h.z);vec3 p3=vec3(a1.zw,h.w);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;vec4 m=max(0.6-vec4(dot(x0,x0),dot(x1,x1),dot(x2,x2),dot(x3,x3)),0.0);vec4 m2=m*m;vec4 m4=m2*m2;vec4 pdotx=vec4(dot(p0,x0),dot(p1,x1),dot(p2,x2),dot(p3,x3));vec4 temp=m2*m*pdotx;gradient=-8.0*(temp.x*x0+temp.y*x1+temp.z*x2+temp.w*x3);gradient+=m4.x*p0+m4.y*p1+m4.z*p2+m4.w*p3;gradient*=42.0;return 42.0*dot(m4,pdotx);}"; // eslint-disable-line
12277
12277
  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
12278
- var pbr_frag_define = "#define GLSLIFY 1\nuniform float u_alphaCutoff;uniform vec4 u_baseColor;uniform float u_metal;uniform float u_roughness;uniform vec3 u_PBRSpecularColor;uniform float u_glossiness;uniform vec3 u_emissiveColor;\n#ifdef CLEARCOAT\nuniform float u_clearCoat;uniform float u_clearCoatRoughness;\n#endif\nuniform float u_normalIntensity;uniform float u_occlusionIntensity;uniform float u_occlusionTextureCoord;\n#ifdef BASETEXTURE\nuniform sampler2D u_baseTexture;\n#endif\n#ifdef NORMALTEXTURE\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef EMISSIVETEXTURE\nuniform sampler2D u_emissiveTexture;\n#endif\n#ifdef ROUGHNESSMETALLICTEXTURE\nuniform sampler2D u_roughnessMetallicTexture;\n#endif\n#ifdef SPECULARGLOSSINESSTEXTURE\nuniform sampler2D u_specularGlossinessTexture;\n#endif\n#ifdef OCCLUSIONTEXTURE\nuniform sampler2D u_occlusionTexture;\n#endif\n#ifdef HAS_CLEARCOATTEXTURE\nuniform sampler2D u_clearCoatTexture;\n#endif\n#ifdef HAS_CLEARCOATROUGHNESSTEXTURE\nuniform sampler2D u_clearCoatRoughnessTexture;\n#endif\n#ifdef HAS_CLEARCOATNORMALTEXTURE\nuniform sampler2D u_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 CLEARCOAT\nvec3 clearCoatNormal;float clearCoatDotNV;\n#endif\n};struct Material{vec3 diffuseColor;float roughness;vec3 specularColor;float opacity;\n#ifdef CLEARCOAT\nfloat clearCoat;float clearCoatRoughness;\n#endif\n};"; // eslint-disable-line
12279
- 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(u_cameraPos-v_pos);\n#if defined(NORMALTEXTURE) || defined(HAS_CLEARCOATNORMALTEXTURE)\nmat3 tbn=getTBN();\n#endif\n#ifdef NORMALTEXTURE\ngeometry.normal=getNormalByNormalTexture(tbn,u_normalTexture,u_normalIntensity,v_uv);\n#else\ngeometry.normal=getNormal();\n#endif\ngeometry.dotNV=saturate(dot(geometry.normal,geometry.viewDir));\n#ifdef CLEARCOAT\n#ifdef HAS_CLEARCOATNORMALTEXTURE\ngeometry.clearCoatNormal=getNormalByNormalTexture(tbn,u_clearCoatNormalTexture,u_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=u_baseColor;float metal=u_metal;float roughness=u_roughness;vec3 specularColor=u_PBRSpecularColor;float glossiness=u_glossiness;float alphaCutoff=u_alphaCutoff;\n#ifdef BASETEXTURE\nvec4 baseTextureColor=texture2D(u_baseTexture,v_uv);\n#ifndef OASIS_COLORSPACE_GAMMA\nbaseTextureColor=gammaToLinear(baseTextureColor);\n#endif\nbaseColor*=baseTextureColor;\n#endif\n#ifdef O3_HAS_VERTEXCOLOR\nbaseColor*=v_color;\n#endif\n#ifdef ALPHA_CUTOFF\nif(baseColor.a<alphaCutoff){discard;}\n#endif\n#ifdef ROUGHNESSMETALLICTEXTURE\nvec4 metalRoughMapColor=texture2D(u_roughnessMetallicTexture,v_uv);roughness*=metalRoughMapColor.g;metal*=metalRoughMapColor.b;\n#endif\n#ifdef SPECULARGLOSSINESSTEXTURE\nvec4 specularGlossinessColor=texture2D(u_specularGlossinessTexture,v_uv);\n#ifndef OASIS_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 CLEARCOAT\nmaterial.clearCoat=u_clearCoat;material.clearCoatRoughness=u_clearCoatRoughness;\n#ifdef HAS_CLEARCOATTEXTURE\nmaterial.clearCoat*=texture2D(u_clearCoatTexture,v_uv).r;\n#endif\n#ifdef HAS_CLEARCOATROUGHNESSTEXTURE\nmaterial.clearCoatRoughness*=texture2D(u_clearCoatRoughnessTexture,v_uv).g;\n#endif\nmaterial.clearCoat=saturate(material.clearCoat);material.clearCoatRoughness=max(material.clearCoatRoughness,getAARoughnessFactor(geometry.clearCoatNormal));\n#endif\n#ifdef OASIS_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
12278
+ var pbr_frag_define = "#define GLSLIFY 1\nuniform float u_alphaCutoff;uniform vec4 u_baseColor;uniform float u_metal;uniform float u_roughness;uniform vec3 u_PBRSpecularColor;uniform float u_glossiness;uniform vec3 u_emissiveColor;\n#ifdef CLEARCOAT\nuniform float u_clearCoat;uniform float u_clearCoatRoughness;\n#endif\nuniform float u_normalIntensity;uniform float u_occlusionIntensity;uniform float u_occlusionTextureCoord;\n#ifdef BASETEXTURE\nuniform sampler2D u_baseTexture;\n#endif\n#ifdef NORMALTEXTURE\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef EMISSIVETEXTURE\nuniform sampler2D u_emissiveTexture;\n#endif\n#ifdef ROUGHNESSMETALLICTEXTURE\nuniform sampler2D u_roughnessMetallicTexture;\n#endif\n#ifdef SPECULARGLOSSINESSTEXTURE\nuniform sampler2D u_specularGlossinessTexture;\n#endif\n#ifdef OCCLUSIONTEXTURE\nuniform sampler2D u_occlusionTexture;\n#endif\n#ifdef HAS_CLEARCOATTEXTURE\nuniform sampler2D u_clearCoatTexture;\n#endif\n#ifdef HAS_CLEARCOATROUGHNESSTEXTURE\nuniform sampler2D u_clearCoatRoughnessTexture;\n#endif\n#ifdef HAS_CLEARCOATNORMALTEXTURE\nuniform sampler2D u_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 CLEARCOAT\nvec3 clearCoatNormal;float clearCoatDotNV;\n#endif\n};struct Material{vec3 diffuseColor;float roughness;vec3 specularColor;float opacity;\n#ifdef CLEARCOAT\nfloat clearCoat;float clearCoatRoughness;\n#endif\n};uniform float material_IOR;"; // eslint-disable-line
12279
+ 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(u_cameraPos-v_pos);\n#if defined(NORMALTEXTURE) || defined(HAS_CLEARCOATNORMALTEXTURE)\nmat3 tbn=getTBN();\n#endif\n#ifdef NORMALTEXTURE\ngeometry.normal=getNormalByNormalTexture(tbn,u_normalTexture,u_normalIntensity,v_uv);\n#else\ngeometry.normal=getNormal();\n#endif\ngeometry.dotNV=saturate(dot(geometry.normal,geometry.viewDir));\n#ifdef CLEARCOAT\n#ifdef HAS_CLEARCOATNORMALTEXTURE\ngeometry.clearCoatNormal=getNormalByNormalTexture(tbn,u_clearCoatNormalTexture,u_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=u_baseColor;float metal=u_metal;float roughness=u_roughness;vec3 specularColor=u_PBRSpecularColor;float glossiness=u_glossiness;float alphaCutoff=u_alphaCutoff;float F0=pow2((material_IOR-1.0)/(material_IOR+1.0));\n#ifdef BASETEXTURE\nvec4 baseTextureColor=texture2D(u_baseTexture,v_uv);\n#ifndef OASIS_COLORSPACE_GAMMA\nbaseTextureColor=gammaToLinear(baseTextureColor);\n#endif\nbaseColor*=baseTextureColor;\n#endif\n#ifdef O3_HAS_VERTEXCOLOR\nbaseColor*=v_color;\n#endif\n#ifdef ALPHA_CUTOFF\nif(baseColor.a<alphaCutoff){discard;}\n#endif\n#ifdef ROUGHNESSMETALLICTEXTURE\nvec4 metalRoughMapColor=texture2D(u_roughnessMetallicTexture,v_uv);roughness*=metalRoughMapColor.g;metal*=metalRoughMapColor.b;\n#endif\n#ifdef SPECULARGLOSSINESSTEXTURE\nvec4 specularGlossinessColor=texture2D(u_specularGlossinessTexture,v_uv);\n#ifndef OASIS_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 CLEARCOAT\nmaterial.clearCoat=u_clearCoat;material.clearCoatRoughness=u_clearCoatRoughness;\n#ifdef HAS_CLEARCOATTEXTURE\nmaterial.clearCoat*=texture2D(u_clearCoatTexture,v_uv).r;\n#endif\n#ifdef HAS_CLEARCOATROUGHNESSTEXTURE\nmaterial.clearCoatRoughness*=texture2D(u_clearCoatRoughnessTexture,v_uv).g;\n#endif\nmaterial.clearCoat=saturate(material.clearCoat);material.clearCoatRoughness=max(material.clearCoatRoughness,getAARoughnessFactor(geometry.clearCoatNormal));\n#endif\n#ifdef OASIS_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
12280
12280
  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
12281
12281
  var direct_irradiance_frag_define = "#define GLSLIFY 1\n#include <ShadowFragmentDeclaration>\nvoid addDirectRadiance(vec3 incidentDirection,vec3 color,Geometry geometry,Material material,inout ReflectedLight reflectedLight){float attenuation=1.0;\n#ifdef CLEARCOAT\nfloat clearCoatDotNL=saturate(dot(geometry.clearCoatNormal,incidentDirection));vec3 clearCoatIrradiance=clearCoatDotNL*color;reflectedLight.directSpecular+=material.clearCoat*clearCoatIrradiance*BRDF_Specular_GGX(incidentDirection,geometry.viewDir,geometry.clearCoatNormal,vec3(0.04),material.clearCoatRoughness);attenuation-=material.clearCoat*F_Schlick(geometry.clearCoatDotNV);\n#endif\nfloat dotNL=saturate(dot(geometry.normal,incidentDirection));vec3 irradiance=dotNL*color*PI;reflectedLight.directSpecular+=attenuation*irradiance*BRDF_Specular_GGX(incidentDirection,geometry.viewDir,geometry.normal,material.specularColor,material.roughness);reflectedLight.directDiffuse+=attenuation*irradiance*BRDF_Diffuse_Lambert(material.diffuseColor);}\n#ifdef O3_DIRECT_LIGHT_COUNT\nvoid addDirectionalDirectLightRadiance(DirectLight directionalLight,Geometry geometry,Material material,inout ReflectedLight reflectedLight){vec3 color=directionalLight.color;vec3 direction=-directionalLight.direction;addDirectRadiance(direction,color,geometry,material,reflectedLight);}\n#endif\n#ifdef O3_POINT_LIGHT_COUNT\nvoid addPointDirectLightRadiance(PointLight pointLight,Geometry geometry,Material material,inout ReflectedLight reflectedLight){vec3 lVector=pointLight.position-geometry.position;vec3 direction=normalize(lVector);float lightDistance=length(lVector);vec3 color=pointLight.color;color*=clamp(1.0-pow(lightDistance/pointLight.distance,4.0),0.0,1.0);addDirectRadiance(direction,color,geometry,material,reflectedLight);}\n#endif\n#ifdef O3_SPOT_LIGHT_COUNT\nvoid addSpotDirectLightRadiance(SpotLight spotLight,Geometry geometry,Material material,inout ReflectedLight reflectedLight){vec3 lVector=spotLight.position-geometry.position;vec3 direction=normalize(lVector);float lightDistance=length(lVector);float angleCos=dot(direction,-spotLight.direction);float spotEffect=smoothstep(spotLight.penumbraCos,spotLight.angleCos,angleCos);float decayEffect=clamp(1.0-pow(lightDistance/spotLight.distance,4.0),0.0,1.0);vec3 color=spotLight.color;color*=spotEffect*decayEffect;addDirectRadiance(direction,color,geometry,material,reflectedLight);}\n#endif\nvoid addTotalDirectRadiance(Geometry geometry,Material material,inout ReflectedLight reflectedLight){float shadowAttenuation=1.0;\n#ifdef O3_DIRECT_LIGHT_COUNT\nshadowAttenuation=1.0;\n#ifdef OASIS_CALCULATE_SHADOWS\nshadowAttenuation*=sampleShadowMap();int sunIndex=int(u_shadowInfo.z);\n#endif\nDirectLight directionalLight;for(int i=0;i<O3_DIRECT_LIGHT_COUNT;i++){if(isRendererCulledByLight(oasis_RendererLayer.xy,u_directLightCullingMask[i]))continue;directionalLight.color=u_directLightColor[i];\n#ifdef OASIS_CALCULATE_SHADOWS\nif(i==sunIndex){directionalLight.color*=shadowAttenuation;}\n#endif\ndirectionalLight.direction=u_directLightDirection[i];addDirectionalDirectLightRadiance(directionalLight,geometry,material,reflectedLight);}\n#endif\n#ifdef O3_POINT_LIGHT_COUNT\nPointLight pointLight;for(int i=0;i<O3_POINT_LIGHT_COUNT;i++){if(isRendererCulledByLight(oasis_RendererLayer.xy,u_pointLightCullingMask[i]))continue;pointLight.color=u_pointLightColor[i];pointLight.position=u_pointLightPosition[i];pointLight.distance=u_pointLightDistance[i];addPointDirectLightRadiance(pointLight,geometry,material,reflectedLight);}\n#endif\n#ifdef O3_SPOT_LIGHT_COUNT\nSpotLight spotLight;for(int i=0;i<O3_SPOT_LIGHT_COUNT;i++){if(isRendererCulledByLight(oasis_RendererLayer.xy,u_spotLightCullingMask[i]))continue;spotLight.color=u_spotLightColor[i];spotLight.position=u_spotLightPosition[i];spotLight.direction=u_spotLightDirection[i];spotLight.distance=u_spotLightDistance[i];spotLight.angleCos=u_spotLightAngleCos[i];spotLight.penumbraCos=u_spotLightPenumbraCos[i];addSpotDirectLightRadiance(spotLight,geometry,material,reflectedLight);}\n#endif\n}"; // eslint-disable-line
12282
12282
  var ibl_frag_define = "#define GLSLIFY 1\nvec3 getLightProbeIrradiance(vec3 sh[9],vec3 normal){normal.x=-normal.x;vec3 result=sh[0]+sh[1]*(normal.y)+sh[2]*(normal.z)+sh[3]*(normal.x)+sh[4]*(normal.y*normal.x)+sh[5]*(normal.y*normal.z)+sh[6]*(3.0*normal.z*normal.z-1.0)+sh[7]*(normal.z*normal.x)+sh[8]*(normal.x*normal.x-normal.y*normal.y);return max(result,vec3(0.0));}vec3 envBRDFApprox(vec3 specularColor,float roughness,float dotNV){const vec4 c0=vec4(-1,-0.0275,-0.572,0.022);const vec4 c1=vec4(1,0.0425,1.04,-0.04);vec4 r=roughness*c0+c1;float a004=min(r.x*r.x,exp2(-9.28*dotNV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}float getSpecularMIPLevel(float roughness,int maxMIPLevel){return roughness*float(maxMIPLevel);}vec3 getLightProbeRadiance(vec3 viewDir,vec3 normal,float roughness,int maxMIPLevel,float specularIntensity){\n#ifndef O3_USE_SPECULAR_ENV\nreturn vec3(0);\n#else\nvec3 reflectVec=reflect(-viewDir,normal);reflectVec.x=-reflectVec.x;float specularMIPLevel=getSpecularMIPLevel(roughness,maxMIPLevel);\n#ifdef HAS_TEX_LOD\nvec4 envMapColor=textureCubeLodEXT(u_env_specularSampler,reflectVec,specularMIPLevel);\n#else\nvec4 envMapColor=textureCube(u_env_specularSampler,reflectVec,specularMIPLevel);\n#endif\n#ifdef O3_DECODE_ENV_RGBM\nenvMapColor.rgb=RGBMToLinear(envMapColor,5.0).rgb;\n#ifdef OASIS_COLORSPACE_GAMMA\nenvMapColor=linearToGamma(envMapColor);\n#endif\n#else\n#ifndef OASIS_COLORSPACE_GAMMA\nenvMapColor=gammaToLinear(envMapColor);\n#endif\n#endif\nreturn envMapColor.rgb*specularIntensity;\n#endif\n}"; // eslint-disable-line
@@ -17507,6 +17507,7 @@
17507
17507
  var MeshRenderer = function MeshRenderer(entity) {
17508
17508
  var _this;
17509
17509
  _this = Renderer.call(this, entity) || this;
17510
+ _this._enableVertexColor = false;
17510
17511
  _this._onMeshChanged = _this._onMeshChanged.bind(_assert_this_initialized(_this));
17511
17512
  return _this;
17512
17513
  };
@@ -17569,7 +17570,7 @@
17569
17570
  shaderData.enableMacro(MeshRenderer._tangentMacro);
17570
17571
  break;
17571
17572
  case "COLOR_0":
17572
- shaderData.enableMacro(MeshRenderer._vertexColorMacro);
17573
+ this.enableVertexColor && shaderData.enableMacro(MeshRenderer._vertexColorMacro);
17573
17574
  break;
17574
17575
  }
17575
17576
  }
@@ -17624,6 +17625,20 @@
17624
17625
  this._setMesh(value);
17625
17626
  }
17626
17627
  }
17628
+ },
17629
+ {
17630
+ key: "enableVertexColor",
17631
+ get: /**
17632
+ * Whether enable vertex color.
17633
+ */ function get() {
17634
+ return this._enableVertexColor;
17635
+ },
17636
+ set: function set(value) {
17637
+ if (value !== this._enableVertexColor) {
17638
+ this._dirtyUpdateFlag |= 0x2;
17639
+ this._enableVertexColor = value;
17640
+ }
17641
+ }
17627
17642
  }
17628
17643
  ]);
17629
17644
  return MeshRenderer;
@@ -18992,7 +19007,7 @@
18992
19007
  // vertices
18993
19008
  this._vertexBuffers[index] = new Buffer(engine, exports.BufferBindFlag.VertexBuffer, MAX_VERTEX_COUNT * 4 * vertexStride, exports.BufferUsage.Dynamic);
18994
19009
  // indices
18995
- this._indiceBuffers[index] = new Buffer(engine, exports.BufferBindFlag.IndexBuffer, MAX_VERTEX_COUNT * 3, exports.BufferUsage.Dynamic);
19010
+ this._indiceBuffers[index] = new Buffer(engine, exports.BufferBindFlag.IndexBuffer, MAX_VERTEX_COUNT * 2 * 3, exports.BufferUsage.Dynamic);
18996
19011
  mesh.setVertexBufferBinding(this._vertexBuffers[index], vertexStride);
18997
19012
  mesh.setIndexBufferBinding(this._indiceBuffers[index], exports.IndexFormat.UInt16);
18998
19013
  mesh.setVertexElements(vertexElements);
@@ -21668,7 +21683,7 @@
21668
21683
  // prepare render target
21669
21684
  var renderTarget = this._getAvailableRenderTarget();
21670
21685
  // @todo: shouldn't set viewport and scissor in activeRenderTarget
21671
- rhi.activeRenderTarget(renderTarget, null, 0);
21686
+ rhi.activeRenderTarget(renderTarget, CascadedShadowCasterPass._viewport, 0);
21672
21687
  if (this._supportDepthTexture) {
21673
21688
  rhi.clearRenderTarget(engine, exports.CameraClearFlags.Depth, null);
21674
21689
  } else {
@@ -21872,6 +21887,9 @@
21872
21887
  (function() {
21873
21888
  CascadedShadowCasterPass._cascadesSplitDistance = new Array(CascadedShadowCasterPass._maxCascades + 1);
21874
21889
  })();
21890
+ (function() {
21891
+ CascadedShadowCasterPass._viewport = new Vector4(0, 0, 1, 1);
21892
+ })();
21875
21893
  (function() {
21876
21894
  CascadedShadowCasterPass._clearColor = new Color$1(1, 1, 1, 1);
21877
21895
  })();
@@ -23533,6 +23551,7 @@
23533
23551
  _this = PBRBaseMaterial.call(this, engine, Shader.find("pbr")) || this;
23534
23552
  _this.shaderData.setFloat(PBRMaterial._metallicProp, 1);
23535
23553
  _this.shaderData.setFloat(PBRMaterial._roughnessProp, 1);
23554
+ _this.shaderData.setFloat(PBRMaterial._iorProp, 1.5);
23536
23555
  return _this;
23537
23556
  }
23538
23557
  var _proto = PBRMaterial.prototype;
@@ -23544,10 +23563,23 @@
23544
23563
  return dest;
23545
23564
  };
23546
23565
  _create_class$3(PBRMaterial, [
23566
+ {
23567
+ key: "ior",
23568
+ get: /**
23569
+ * Index Of Refraction.
23570
+ * @defaultValue `1.5`
23571
+ */ function get() {
23572
+ return this.shaderData.getFloat(PBRMaterial._iorProp);
23573
+ },
23574
+ set: function set(v) {
23575
+ this.shaderData.setFloat(PBRMaterial._iorProp, Math.max(v, 0));
23576
+ }
23577
+ },
23547
23578
  {
23548
23579
  key: "metallic",
23549
23580
  get: /**
23550
- * Metallic, default 1.0.
23581
+ * Metallic.
23582
+ * @defaultValue `1.0`
23551
23583
  */ function get() {
23552
23584
  return this.shaderData.getFloat(PBRMaterial._metallicProp);
23553
23585
  },
@@ -23558,7 +23590,8 @@
23558
23590
  {
23559
23591
  key: "roughness",
23560
23592
  get: /**
23561
- * Roughness, default 1.0.
23593
+ * Roughness. default 1.0.
23594
+ * @defaultValue `1.0`
23562
23595
  */ function get() {
23563
23596
  return this.shaderData.getFloat(PBRMaterial._roughnessProp);
23564
23597
  },
@@ -23595,6 +23628,9 @@
23595
23628
  (function() {
23596
23629
  PBRMaterial._roughnessMetallicTextureProp = Shader.getPropertyByName("u_roughnessMetallicTexture");
23597
23630
  })();
23631
+ (function() {
23632
+ PBRMaterial._iorProp = Shader.getPropertyByName("material_IOR");
23633
+ })();
23598
23634
  /**
23599
23635
  * PBR (Specular-Glossiness Workflow) Material.
23600
23636
  */ var PBRSpecularMaterial = /*#__PURE__*/ function(PBRBaseMaterial) {
@@ -27296,6 +27332,12 @@
27296
27332
  }
27297
27333
  var srcClipTime = srcPlayData.clipTime;
27298
27334
  var destClipTime = destPlayData.clipTime;
27335
+ for(var i = crossOwnerCollection.length - 1; i >= 0; i--){
27336
+ var crossOwner = crossOwnerCollection[i];
27337
+ var srcCurveIndex = crossOwner.crossSrcCurveIndices[layerIndex];
27338
+ var destCurveIndex = crossOwner.crossDestCurveIndices[layerIndex];
27339
+ crossOwner.crossFadeAndApplyValue(srcCurveIndex >= 0 ? srcCurves[srcCurveIndex].curve : null, destCurveIndex >= 0 ? destCurves[destCurveIndex].curve : null, srcClipTime, destClipTime, crossWeight, weight, additive);
27340
+ }
27299
27341
  srcEventHandlers.length && this._fireAnimationEvents(srcPlayData, srcEventHandlers, lastSrcClipTime, srcClipTime);
27300
27342
  destEventHandlers.length && this._fireAnimationEvents(destPlayData, destEventHandlers, lastDestClipTime, destClipTime);
27301
27343
  if (lastSrcPlayState === AnimatorStatePlayState.UnStarted) {
@@ -27314,12 +27356,6 @@
27314
27356
  } else {
27315
27357
  this._callAnimatorScriptOnUpdate(destState, layerIndex);
27316
27358
  }
27317
- for(var i = crossOwnerCollection.length - 1; i >= 0; i--){
27318
- var crossOwner = crossOwnerCollection[i];
27319
- var srcCurveIndex = crossOwner.crossSrcCurveIndices[layerIndex];
27320
- var destCurveIndex = crossOwner.crossDestCurveIndices[layerIndex];
27321
- crossOwner.crossFadeAndApplyValue(srcCurveIndex >= 0 ? srcCurves[srcCurveIndex].curve : null, destCurveIndex >= 0 ? destCurves[destCurveIndex].curve : null, srcClipTime, destClipTime, crossWeight, weight, additive);
27322
- }
27323
27359
  };
27324
27360
  _proto._updateCrossFadeFromPose = function _updateCrossFadeFromPose(destPlayData, layerData, layerIndex, layerWeight, delta, additive, aniUpdate) {
27325
27361
  var crossOwnerCollection = layerData.crossOwnerCollection;
@@ -27336,6 +27372,12 @@
27336
27372
  return;
27337
27373
  }
27338
27374
  var destClipTime = destPlayData.clipTime;
27375
+ for(var i = crossOwnerCollection.length - 1; i >= 0; i--){
27376
+ var crossOwner = crossOwnerCollection[i];
27377
+ var crossDestCurveIndices = crossOwner.crossDestCurveIndices;
27378
+ var curveIndex = crossDestCurveIndices[layerIndex];
27379
+ crossOwner.crossFadeFromPoseAndApplyValue(curveIndex >= 0 ? curveBindings[curveIndex].curve : null, destClipTime, crossWeight, layerWeight, additive);
27380
+ }
27339
27381
  //TODO: srcState 少了最新一段时间的判断
27340
27382
  eventHandlers.length && this._fireAnimationEvents(destPlayData, eventHandlers, lastDestClipTime, destClipTime);
27341
27383
  if (lastPlayState === AnimatorStatePlayState.UnStarted) {
@@ -27346,12 +27388,6 @@
27346
27388
  } else {
27347
27389
  this._callAnimatorScriptOnUpdate(state, layerIndex);
27348
27390
  }
27349
- for(var i = crossOwnerCollection.length - 1; i >= 0; i--){
27350
- var crossOwner = crossOwnerCollection[i];
27351
- var crossDestCurveIndices = crossOwner.crossDestCurveIndices;
27352
- var curveIndex = crossDestCurveIndices[layerIndex];
27353
- crossOwner.crossFadeFromPoseAndApplyValue(curveIndex >= 0 ? curveBindings[curveIndex].curve : null, destClipTime, crossWeight, layerWeight, additive);
27354
- }
27355
27391
  };
27356
27392
  _proto._updateCrossFadeData = function _updateCrossFadeData(layerData, crossWeight, delta, fixed) {
27357
27393
  var destPlayData = layerData.destPlayData;
@@ -31220,23 +31256,23 @@
31220
31256
  };
31221
31257
  _proto.activeRenderTarget = function activeRenderTarget(renderTarget, viewport, mipLevel) {
31222
31258
  var gl = this._gl;
31259
+ var bufferWidth, bufferHeight;
31223
31260
  if (renderTarget) {
31224
31261
  var /** @ts-ignore */ _renderTarget__platformRenderTarget;
31225
31262
  (_renderTarget__platformRenderTarget = renderTarget._platformRenderTarget) == null ? void 0 : _renderTarget__platformRenderTarget._activeRenderTarget();
31226
- var width = renderTarget.width >> mipLevel;
31227
- var height = renderTarget.height >> mipLevel;
31228
- this.viewport(0, 0, width, height);
31229
- this.scissor(0, 0, width, height);
31263
+ bufferWidth = renderTarget.width >> mipLevel;
31264
+ bufferHeight = renderTarget.height >> mipLevel;
31230
31265
  } else {
31231
31266
  gl.bindFramebuffer(gl.FRAMEBUFFER, null);
31232
- var drawingBufferWidth = gl.drawingBufferWidth, drawingBufferHeight = gl.drawingBufferHeight;
31233
- var width1 = drawingBufferWidth * viewport.z;
31234
- var height1 = drawingBufferHeight * viewport.w;
31235
- var x = viewport.x * drawingBufferWidth;
31236
- var y = drawingBufferHeight - viewport.y * drawingBufferHeight - height1;
31237
- this.viewport(x, y, width1, height1);
31238
- this.scissor(x, y, width1, height1);
31267
+ bufferWidth = gl.drawingBufferWidth;
31268
+ bufferHeight = gl.drawingBufferHeight;
31239
31269
  }
31270
+ var width = bufferWidth * viewport.z;
31271
+ var height = bufferHeight * viewport.w;
31272
+ var x = viewport.x * bufferWidth;
31273
+ var y = bufferHeight - viewport.y * bufferHeight - height;
31274
+ this.viewport(x, y, width, height);
31275
+ this.scissor(x, y, width, height);
31240
31276
  };
31241
31277
  _proto.activeTexture = function activeTexture(textureID) {
31242
31278
  if (this._activeTextureID !== textureID) {
@@ -32507,7 +32543,7 @@
32507
32543
  var materials = [];
32508
32544
  for(var i = 0; i < gltf.materials.length; i++){
32509
32545
  var _gltf_materials_i = gltf.materials[i], _gltf_materials_i_extensions = _gltf_materials_i.extensions, extensions = _gltf_materials_i_extensions === void 0 ? {} : _gltf_materials_i_extensions, pbrMetallicRoughness = _gltf_materials_i.pbrMetallicRoughness, normalTexture = _gltf_materials_i.normalTexture, occlusionTexture = _gltf_materials_i.occlusionTexture, emissiveTexture = _gltf_materials_i.emissiveTexture, emissiveFactor = _gltf_materials_i.emissiveFactor, alphaMode = _gltf_materials_i.alphaMode, alphaCutoff = _gltf_materials_i.alphaCutoff, doubleSided = _gltf_materials_i.doubleSided, _gltf_materials_i_name = _gltf_materials_i.name, name = _gltf_materials_i_name === void 0 ? "" : _gltf_materials_i_name;
32510
- var KHR_materials_unlit = extensions.KHR_materials_unlit, KHR_materials_pbrSpecularGlossiness = extensions.KHR_materials_pbrSpecularGlossiness, KHR_materials_clearcoat = extensions.KHR_materials_clearcoat, OASIS_materials_remap = extensions.OASIS_materials_remap;
32546
+ var KHR_materials_unlit = extensions.KHR_materials_unlit, KHR_materials_pbrSpecularGlossiness = extensions.KHR_materials_pbrSpecularGlossiness, KHR_materials_clearcoat = extensions.KHR_materials_clearcoat, KHR_materials_ior = extensions.KHR_materials_ior, OASIS_materials_remap = extensions.OASIS_materials_remap;
32511
32547
  var material = null;
32512
32548
  if (KHR_materials_unlit) {
32513
32549
  material = Parser.createEngineResource("KHR_materials_unlit", KHR_materials_unlit, context);
@@ -32520,6 +32556,9 @@
32520
32556
  if (KHR_materials_clearcoat) {
32521
32557
  Parser.parseEngineResource("KHR_materials_clearcoat", KHR_materials_clearcoat, material, context);
32522
32558
  }
32559
+ if (KHR_materials_ior) {
32560
+ Parser.parseEngineResource("KHR_materials_ior", KHR_materials_ior, material, context);
32561
+ }
32523
32562
  if (pbrMetallicRoughness) {
32524
32563
  var baseColorFactor = pbrMetallicRoughness.baseColorFactor, baseColorTexture = pbrMetallicRoughness.baseColorTexture, metallicFactor = pbrMetallicRoughness.metallicFactor, roughnessFactor = pbrMetallicRoughness.roughnessFactor, metallicRoughnessTexture = pbrMetallicRoughness.metallicRoughnessTexture;
32525
32564
  if (baseColorFactor) {
@@ -32637,6 +32676,21 @@
32637
32676
  KHR_materials_clearcoat = __decorate([
32638
32677
  registerExtension("KHR_materials_clearcoat")
32639
32678
  ], KHR_materials_clearcoat);
32679
+ var KHR_materials_ior = /*#__PURE__*/ function(ExtensionParser) {
32680
+ var KHR_materials_ior = function KHR_materials_ior() {
32681
+ return ExtensionParser.apply(this, arguments);
32682
+ };
32683
+ _inherits(KHR_materials_ior, ExtensionParser);
32684
+ var _proto = KHR_materials_ior.prototype;
32685
+ _proto.parseEngineResource = function parseEngineResource(schema, material, context) {
32686
+ var _schema_ior = schema.ior, ior = _schema_ior === void 0 ? 1.5 : _schema_ior;
32687
+ material.ior = ior;
32688
+ };
32689
+ return KHR_materials_ior;
32690
+ }(ExtensionParser);
32691
+ KHR_materials_ior = __decorate([
32692
+ registerExtension("KHR_materials_ior")
32693
+ ], KHR_materials_ior);
32640
32694
  var KHR_materials_pbrSpecularGlossiness = /*#__PURE__*/ function(ExtensionParser) {
32641
32695
  var KHR_materials_pbrSpecularGlossiness = function KHR_materials_pbrSpecularGlossiness() {
32642
32696
  return ExtensionParser.apply(this, arguments);
@@ -33502,6 +33556,12 @@
33502
33556
  } else {
33503
33557
  var material = (materials == null ? void 0 : materials[materialIndex]) || SceneParser._getDefaultMaterial(engine);
33504
33558
  renderer.setMaterial(material);
33559
+ // Enable vertex color if mesh has COLOR_0 vertex element
33560
+ mesh.vertexElements.forEach(function(element) {
33561
+ if (element.semantic === "COLOR_0") {
33562
+ renderer.enableVertexColor = true;
33563
+ }
33564
+ });
33505
33565
  }
33506
33566
  var _gltfMeshPrimitives_i = gltfMeshPrimitives[i], _gltfMeshPrimitives_i_extensions = _gltfMeshPrimitives_i.extensions, extensions = _gltfMeshPrimitives_i_extensions === void 0 ? {} : _gltfMeshPrimitives_i_extensions;
33507
33567
  var KHR_materials_variants = extensions.KHR_materials_variants;
@@ -35704,6 +35764,29 @@
35704
35764
  ""
35705
35765
  ])
35706
35766
  ], TextureCubeLoader);
35767
+ var AnimationClipLoader = /*#__PURE__*/ function(Loader) {
35768
+ var AnimationClipLoader = function AnimationClipLoader() {
35769
+ return Loader.apply(this, arguments);
35770
+ };
35771
+ _inherits(AnimationClipLoader, Loader);
35772
+ var _proto = AnimationClipLoader.prototype;
35773
+ _proto.load = function load(item, resourceManager) {
35774
+ var _this = this;
35775
+ return new AssetPromise(function(resolve, reject) {
35776
+ _this.request(item.url, _extends({}, item, {
35777
+ type: "arraybuffer"
35778
+ })).then(function(data) {
35779
+ return decode(data, resourceManager.engine).then(resolve);
35780
+ }).catch(reject);
35781
+ });
35782
+ };
35783
+ return AnimationClipLoader;
35784
+ }(Loader);
35785
+ AnimationClipLoader = __decorate([
35786
+ resourceLoader(exports.AssetType.AnimationClip, [
35787
+ "ani"
35788
+ ])
35789
+ ], AnimationClipLoader);
35707
35790
  var SceneLoader = /*#__PURE__*/ function(Loader) {
35708
35791
  var SceneLoader = function SceneLoader() {
35709
35792
  return Loader.apply(this, arguments);
@@ -35772,6 +35855,14 @@
35772
35855
  if (shadow.shadowDistance != undefined) scene.shadowDistance = shadow.shadowDistance;
35773
35856
  if (shadow.shadowCascades != undefined) scene.shadowCascades = shadow.shadowCascades;
35774
35857
  }
35858
+ var fog = data.scene.fog;
35859
+ if (fog) {
35860
+ if (fog.fogMode != undefined) scene.fogMode = fog.fogMode;
35861
+ if (fog.fogStart != undefined) scene.fogStart = fog.fogStart;
35862
+ if (fog.fogEnd != undefined) scene.fogEnd = fog.fogEnd;
35863
+ if (fog.fogDensity != undefined) scene.fogDensity = fog.fogDensity;
35864
+ if (fog.fogColor != undefined) scene.fogColor.copyFrom(fog.fogColor);
35865
+ }
35775
35866
  return Promise.all([
35776
35867
  ambientLightPromise,
35777
35868
  backgroundPromise
@@ -35805,7 +35896,7 @@
35805
35896
  }));
35806
35897
 
35807
35898
  //@ts-ignore
35808
- var version = "0.0.0-experimental-animator-additive.3";
35899
+ var version = "0.0.0-experimental-animator-additive.4";
35809
35900
  console.log("Galacean engine version: " + version);
35810
35901
  for(var key in CoreObjects){
35811
35902
  Loader.registerClass(key, CoreObjects[key]);