@galacean/engine-core 1.6.0-alpha.2 → 1.6.0-beta.1

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/module.js CHANGED
@@ -4261,6 +4261,15 @@ __decorate([
4261
4261
  return CullMode;
4262
4262
  }({});
4263
4263
 
4264
+ /**
4265
+ * Render queue type.
4266
+ */ var RenderQueueType = /*#__PURE__*/ function(RenderQueueType) {
4267
+ /** Opaque queue. */ RenderQueueType[RenderQueueType["Opaque"] = 0] = "Opaque";
4268
+ /** Opaque queue, alpha cutoff. */ RenderQueueType[RenderQueueType["AlphaTest"] = 1] = "AlphaTest";
4269
+ /** Transparent queue, rendering from back to front to ensure correct rendering of transparent objects. */ RenderQueueType[RenderQueueType["Transparent"] = 2] = "Transparent";
4270
+ return RenderQueueType;
4271
+ }({});
4272
+
4264
4273
  var RenderStateElementKey = /*#__PURE__*/ function(RenderStateElementKey) {
4265
4274
  /** Blend state enabled for target 0 key. */ RenderStateElementKey[RenderStateElementKey["BlendStateEnabled0"] = 0] = "BlendStateEnabled0";
4266
4275
  /** Blend state color blend operation for target 0 key. */ RenderStateElementKey[RenderStateElementKey["BlendStateColorBlendOperation0"] = 1] = "BlendStateColorBlendOperation0";
@@ -4294,15 +4303,6 @@ var RenderStateElementKey = /*#__PURE__*/ function(RenderStateElementKey) {
4294
4303
  return RenderStateElementKey;
4295
4304
  }({});
4296
4305
 
4297
- /**
4298
- * Render queue type.
4299
- */ var RenderQueueType = /*#__PURE__*/ function(RenderQueueType) {
4300
- /** Opaque queue. */ RenderQueueType[RenderQueueType["Opaque"] = 0] = "Opaque";
4301
- /** Opaque queue, alpha cutoff. */ RenderQueueType[RenderQueueType["AlphaTest"] = 1] = "AlphaTest";
4302
- /** Transparent queue, rendering from back to front to ensure correct rendering of transparent objects. */ RenderQueueType[RenderQueueType["Transparent"] = 2] = "Transparent";
4303
- return RenderQueueType;
4304
- }({});
4305
-
4306
4306
  /**
4307
4307
  * Shader data grouping.
4308
4308
  */ var ShaderDataGroup = /*#__PURE__*/ function(ShaderDataGroup) {
@@ -4314,6 +4314,14 @@ var RenderStateElementKey = /*#__PURE__*/ function(RenderStateElementKey) {
4314
4314
  return ShaderDataGroup;
4315
4315
  }({});
4316
4316
 
4317
+ /**
4318
+ * Shader language belongs to.
4319
+ */ var ShaderLanguage = /*#__PURE__*/ function(ShaderLanguage) {
4320
+ /** GLSL ES 100. */ ShaderLanguage[ShaderLanguage["GLSLES100"] = 0] = "GLSLES100";
4321
+ /** GLSL ES 300. */ ShaderLanguage[ShaderLanguage["GLSLES300"] = 1] = "GLSLES300";
4322
+ return ShaderLanguage;
4323
+ }({});
4324
+
4317
4325
  /**
4318
4326
  * Shader Property type.
4319
4327
  */ var ShaderPropertyType = /*#__PURE__*/ function(ShaderPropertyType) {
@@ -4346,51 +4354,6 @@ var RenderStateElementKey = /*#__PURE__*/ function(RenderStateElementKey) {
4346
4354
  return StencilOperation;
4347
4355
  }({});
4348
4356
 
4349
- var ShaderPlatformTarget = /*#__PURE__*/ function(ShaderPlatformTarget) {
4350
- ShaderPlatformTarget[ShaderPlatformTarget["GLES100"] = 0] = "GLES100";
4351
- ShaderPlatformTarget[ShaderPlatformTarget["GLES300"] = 1] = "GLES300";
4352
- return ShaderPlatformTarget;
4353
- }({});
4354
-
4355
- function _array_like_to_array(arr, len) {
4356
- if (len == null || len > arr.length) len = arr.length;
4357
-
4358
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
4359
-
4360
- return arr2;
4361
- }
4362
-
4363
- function _unsupported_iterable_to_array(o, minLen) {
4364
- if (!o) return;
4365
- if (typeof o === "string") return _array_like_to_array(o, minLen);
4366
-
4367
- var n = Object.prototype.toString.call(o).slice(8, -1);
4368
-
4369
- if (n === "Object" && o.constructor) n = o.constructor.name;
4370
- if (n === "Map" || n === "Set") return Array.from(n);
4371
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
4372
- }
4373
-
4374
- function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
4375
- var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
4376
-
4377
- if (it) return (it = it.call(o)).next.bind(it);
4378
- // Fallback for engines without symbol support
4379
- if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
4380
- if (it) o = it;
4381
-
4382
- var i = 0;
4383
-
4384
- return function() {
4385
- if (i >= o.length) return { done: true };
4386
-
4387
- return { done: false, value: o[i++] };
4388
- };
4389
- }
4390
-
4391
- throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4392
- }
4393
-
4394
4357
  /**
4395
4358
  * Shader macro。
4396
4359
  */ var ShaderMacro = /*#__PURE__*/ function() {
@@ -4624,7 +4587,7 @@ function _extends() {
4624
4587
 
4625
4588
  var camera_declare = "uniform vec3 camera_Position;\nuniform vec3 camera_Forward; "; // eslint-disable-line
4626
4589
 
4627
- var common = "#define PI 3.14159265359\n#define RECIPROCAL_PI 0.31830988618\n#define EPSILON 1e-6\n#define LOG2 1.442695\n#define HALF_MIN 6.103515625e-5 // 2^-14, the same value for 10, 11 and 16-bit: https://www.khronos.org/opengl/wiki/Small_Float_Formats\n#define HALF_EPS 4.8828125e-4 // 2^-11, machine epsilon: 1 + EPS = 1 (half of the ULP for 1.0f)\n\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n\nfloat pow2(float x ) {\n return x * x;\n}\n\nvec4 RGBMToLinear(vec4 value, float maxRange ) {\n return vec4( value.rgb * value.a * maxRange, 1.0 );\n}\n\nvec4 gammaToLinear(vec4 value){\n return vec4( pow(value.rgb, vec3(2.2)), value.a);\n}\n\nvec4 linearToGamma(vec4 value){\n\tvalue = max(value, 0.0);\n return vec4( pow(value.rgb, vec3(1.0 / 2.2)), value.a);\n}\n\n\n// https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_framebuffer_sRGB.txt\n// https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_texture_sRGB_decode.txt\nfloat sRGBToLinear(float value){\n float linearRGBLo = value / 12.92;\n float linearRGBHi = pow((value + 0.055) / 1.055, 2.4);\n float linearRGB = (value <= 0.04045) ? linearRGBLo : linearRGBHi;\n return linearRGB;\n}\n\nvec4 sRGBToLinear(vec4 value){\n return vec4(sRGBToLinear(value.r), sRGBToLinear(value.g), sRGBToLinear(value.b), value.a);\n}\n\nfloat linearToSRGB(float value){\n\tvalue = max(value, 0.0);\n return (value <= 0.0031308) ? (value * 12.9232102) : 1.055 * pow(value, 1.0 / 2.4) - 0.055;\n}\n\nvec4 linearToSRGB(vec4 value){\n return vec4(linearToSRGB(value.r), linearToSRGB(value.g), linearToSRGB(value.b), value.a);\n}\n\n// Compatible with devices that do not even support EXT_sRGB in WebGL1.0.\nvec4 texture2DSRGB(sampler2D tex, vec2 uv) {\n\tvec4 color = texture2D(tex, uv);\n\t#ifdef ENGINE_NO_SRGB\n\t\tcolor = sRGBToLinear(color);\n\t#endif\n\treturn color;\n}\n\n#ifdef HAS_TEX_LOD\n\tvec4 texture2DLodSRGB(sampler2D tex, vec2 uv, float lod) {\n\t\tvec4 color = texture2DLodEXT(tex, uv, lod);\n\t\t#ifdef ENGINE_NO_SRGB\n\t\t\tcolor = sRGBToLinear(color);\n\t\t#endif\n\t\treturn color;\n\t}\n#endif\n\n\nvec4 outputSRGBCorrection(vec4 linearIn){\n #ifdef ENGINE_OUTPUT_SRGB_CORRECT\n \treturn linearToSRGB(linearIn);\n #else \n \treturn linearIn;\n #endif\n}\n\n\nuniform vec4 camera_DepthBufferParams;\nuniform vec4 camera_ProjectionParams;\n\nfloat remapDepthBufferLinear01(float depth){\n\treturn 1.0 / (camera_DepthBufferParams.x * depth + camera_DepthBufferParams.y);\n}\n\nfloat remapDepthBufferEyeDepth(float depth){\n\t#ifdef CAMERA_ORTHOGRAPHIC\n\t\treturn camera_ProjectionParams.y + (camera_ProjectionParams.z - camera_ProjectionParams.y) * depth;\n\t#else\n\t\treturn 1.0 / (camera_DepthBufferParams.z * depth + camera_DepthBufferParams.w);\n\t#endif\n}\n\n// From Next Generation Post Processing in Call of Duty: Advanced Warfare [Jimenez 2014]\n// http://advances.realtimerendering.com/s2014/index.html\n// sampleCoord must not be normalized (e.g. window coordinates)\nfloat interleavedGradientNoise(vec2 sampleCoord)\n{\n\tconst vec3 magic = vec3(0.06711056, 0.00583715, 52.9829189);\n\treturn fract(magic.z * fract(dot(sampleCoord, magic.xy)));\n}\n\n#ifdef GRAPHICS_API_WEBGL2\n\t#define INVERSE_MAT(mat) inverse(mat)\n#else\n\tmat2 inverseMat(mat2 m) {\n\t\treturn mat2(m[1][1],-m[0][1],\n\t\t\t\t-m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n\t}\n\tmat3 inverseMat(mat3 m) {\n\t\tfloat a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n\t\tfloat a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n\t\tfloat a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n\t\tfloat b01 = a22 * a11 - a12 * a21;\n\t\tfloat b11 = -a22 * a10 + a12 * a20;\n\t\tfloat b21 = a21 * a10 - a11 * a20;\n\n\t\tfloat det = a00 * b01 + a01 * b11 + a02 * b21;\n\n\t\treturn mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n\t\t\t\t\tb11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n\t\t\t\t\tb21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n\t}\n\tmat4 inverseMat(mat4 m) {\n\t\tfloat a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n\t\t\ta10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n\t\t\ta20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n\t\t\ta30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n\t\t\tb00 = a00 * a11 - a01 * a10,\n\t\t\tb01 = a00 * a12 - a02 * a10,\n\t\t\tb02 = a00 * a13 - a03 * a10,\n\t\t\tb03 = a01 * a12 - a02 * a11,\n\t\t\tb04 = a01 * a13 - a03 * a11,\n\t\t\tb05 = a02 * a13 - a03 * a12,\n\t\t\tb06 = a20 * a31 - a21 * a30,\n\t\t\tb07 = a20 * a32 - a22 * a30,\n\t\t\tb08 = a20 * a33 - a23 * a30,\n\t\t\tb09 = a21 * a32 - a22 * a31,\n\t\t\tb10 = a21 * a33 - a23 * a31,\n\t\t\tb11 = a22 * a33 - a23 * a32,\n\n\t\t\tdet = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n\t\treturn mat4(\n\t\t\ta11 * b11 - a12 * b10 + a13 * b09,\n\t\t\ta02 * b10 - a01 * b11 - a03 * b09,\n\t\t\ta31 * b05 - a32 * b04 + a33 * b03,\n\t\t\ta22 * b04 - a21 * b05 - a23 * b03,\n\t\t\ta12 * b08 - a10 * b11 - a13 * b07,\n\t\t\ta00 * b11 - a02 * b08 + a03 * b07,\n\t\t\ta32 * b02 - a30 * b05 - a33 * b01,\n\t\t\ta20 * b05 - a22 * b02 + a23 * b01,\n\t\t\ta10 * b10 - a11 * b08 + a13 * b06,\n\t\t\ta01 * b08 - a00 * b10 - a03 * b06,\n\t\t\ta30 * b04 - a31 * b02 + a33 * b00,\n\t\t\ta21 * b02 - a20 * b04 - a23 * b00,\n\t\t\ta11 * b07 - a10 * b09 - a12 * b06,\n\t\t\ta00 * b09 - a01 * b07 + a02 * b06,\n\t\t\ta31 * b01 - a30 * b03 - a32 * b00,\n\t\t\ta20 * b03 - a21 * b01 + a22 * b00) / det;\n\t}\n\n\t#define INVERSE_MAT(mat) inverseMat(mat)\n#endif\n\n\nvec3 safeNormalize(vec3 inVec) {\n float dp3 = max(float(HALF_MIN), dot(inVec, inVec));\n return inVec * inversesqrt(dp3);\n}\n"; // eslint-disable-line
4590
+ var common = "#define PI 3.14159265359\n#define RECIPROCAL_PI 0.31830988618\n#define EPSILON 1e-6\n#define LOG2 1.442695\n#define HALF_MIN 6.103515625e-5 // 2^-14, the same value for 10, 11 and 16-bit: https://www.khronos.org/opengl/wiki/Small_Float_Formats\n#define HALF_EPS 4.8828125e-4 // 2^-11, machine epsilon: 1 + EPS = 1 (half of the ULP for 1.0f)\n\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n\nfloat pow2(float x ) {\n return x * x;\n}\n\nvec4 RGBMToLinear(vec4 value, float maxRange ) {\n return vec4( value.rgb * value.a * maxRange, 1.0 );\n}\n\nvec4 gammaToLinear(vec4 value){\n return vec4( pow(value.rgb, vec3(2.2)), value.a);\n}\n\nvec4 linearToGamma(vec4 value){\n\tvalue = max(value, 0.0);\n return vec4( pow(value.rgb, vec3(1.0 / 2.2)), value.a);\n}\n\n\n// https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_framebuffer_sRGB.txt\n// https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_texture_sRGB_decode.txt\nfloat sRGBToLinear(float value){\n float linearRGBLo = value / 12.92;\n float linearRGBHi = pow((value + 0.055) / 1.055, 2.4);\n float linearRGB = (value <= 0.04045) ? linearRGBLo : linearRGBHi;\n return linearRGB;\n}\n\nvec4 sRGBToLinear(vec4 value){\n return vec4(sRGBToLinear(value.r), sRGBToLinear(value.g), sRGBToLinear(value.b), value.a);\n}\n\nfloat linearToSRGB(float value){\n\tvalue = max(value, 0.0);\n return (value <= 0.0031308) ? (value * 12.9232102) : 1.055 * pow(value, 1.0 / 2.4) - 0.055;\n}\n\nvec4 linearToSRGB(vec4 value){\n return vec4(linearToSRGB(value.r), linearToSRGB(value.g), linearToSRGB(value.b), value.a);\n}\n\n// Compatible with devices that do not even support EXT_sRGB in WebGL1.0.\nvec4 texture2DSRGB(sampler2D tex, vec2 uv) {\n\tvec4 color = texture2D(tex, uv);\n\t#ifdef ENGINE_NO_SRGB\n\t\tcolor = sRGBToLinear(color);\n\t#endif\n\treturn color;\n}\n\nvec4 outputSRGBCorrection(vec4 linearIn){\n #ifdef ENGINE_OUTPUT_SRGB_CORRECT\n \treturn linearToSRGB(linearIn);\n #else \n \treturn linearIn;\n #endif\n}\n\n\nuniform vec4 camera_DepthBufferParams;\nuniform vec4 camera_ProjectionParams;\n\nfloat remapDepthBufferLinear01(float depth){\n\treturn 1.0 / (camera_DepthBufferParams.x * depth + camera_DepthBufferParams.y);\n}\n\nfloat remapDepthBufferEyeDepth(float depth){\n\t#ifdef CAMERA_ORTHOGRAPHIC\n\t\treturn camera_ProjectionParams.y + (camera_ProjectionParams.z - camera_ProjectionParams.y) * depth;\n\t#else\n\t\treturn 1.0 / (camera_DepthBufferParams.z * depth + camera_DepthBufferParams.w);\n\t#endif\n}\n\n// From Next Generation Post Processing in Call of Duty: Advanced Warfare [Jimenez 2014]\n// http://advances.realtimerendering.com/s2014/index.html\n// sampleCoord must not be normalized (e.g. window coordinates)\nfloat interleavedGradientNoise(vec2 sampleCoord)\n{\n\tconst vec3 magic = vec3(0.06711056, 0.00583715, 52.9829189);\n\treturn fract(magic.z * fract(dot(sampleCoord, magic.xy)));\n}\n\n#ifdef GRAPHICS_API_WEBGL2\n\t#define INVERSE_MAT(mat) inverse(mat)\n#else\n\tmat2 inverseMat(mat2 m) {\n\t\treturn mat2(m[1][1],-m[0][1],\n\t\t\t\t-m[1][0], m[0][0]) / (m[0][0]*m[1][1] - m[0][1]*m[1][0]);\n\t}\n\tmat3 inverseMat(mat3 m) {\n\t\tfloat a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];\n\t\tfloat a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];\n\t\tfloat a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];\n\n\t\tfloat b01 = a22 * a11 - a12 * a21;\n\t\tfloat b11 = -a22 * a10 + a12 * a20;\n\t\tfloat b21 = a21 * a10 - a11 * a20;\n\n\t\tfloat det = a00 * b01 + a01 * b11 + a02 * b21;\n\n\t\treturn mat3(b01, (-a22 * a01 + a02 * a21), (a12 * a01 - a02 * a11),\n\t\t\t\t\tb11, (a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),\n\t\t\t\t\tb21, (-a21 * a00 + a01 * a20), (a11 * a00 - a01 * a10)) / det;\n\t}\n\tmat4 inverseMat(mat4 m) {\n\t\tfloat a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n\t\t\ta10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n\t\t\ta20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n\t\t\ta30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3],\n\n\t\t\tb00 = a00 * a11 - a01 * a10,\n\t\t\tb01 = a00 * a12 - a02 * a10,\n\t\t\tb02 = a00 * a13 - a03 * a10,\n\t\t\tb03 = a01 * a12 - a02 * a11,\n\t\t\tb04 = a01 * a13 - a03 * a11,\n\t\t\tb05 = a02 * a13 - a03 * a12,\n\t\t\tb06 = a20 * a31 - a21 * a30,\n\t\t\tb07 = a20 * a32 - a22 * a30,\n\t\t\tb08 = a20 * a33 - a23 * a30,\n\t\t\tb09 = a21 * a32 - a22 * a31,\n\t\t\tb10 = a21 * a33 - a23 * a31,\n\t\t\tb11 = a22 * a33 - a23 * a32,\n\n\t\t\tdet = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n\t\treturn mat4(\n\t\t\ta11 * b11 - a12 * b10 + a13 * b09,\n\t\t\ta02 * b10 - a01 * b11 - a03 * b09,\n\t\t\ta31 * b05 - a32 * b04 + a33 * b03,\n\t\t\ta22 * b04 - a21 * b05 - a23 * b03,\n\t\t\ta12 * b08 - a10 * b11 - a13 * b07,\n\t\t\ta00 * b11 - a02 * b08 + a03 * b07,\n\t\t\ta32 * b02 - a30 * b05 - a33 * b01,\n\t\t\ta20 * b05 - a22 * b02 + a23 * b01,\n\t\t\ta10 * b10 - a11 * b08 + a13 * b06,\n\t\t\ta01 * b08 - a00 * b10 - a03 * b06,\n\t\t\ta30 * b04 - a31 * b02 + a33 * b00,\n\t\t\ta21 * b02 - a20 * b04 - a23 * b00,\n\t\t\ta11 * b07 - a10 * b09 - a12 * b06,\n\t\t\ta00 * b09 - a01 * b07 + a02 * b06,\n\t\t\ta31 * b01 - a30 * b03 - a32 * b00,\n\t\t\ta20 * b03 - a21 * b01 + a22 * b00) / det;\n\t}\n\n\t#define INVERSE_MAT(mat) inverseMat(mat)\n#endif\n\n\nvec3 safeNormalize(vec3 inVec) {\n float dp3 = max(float(HALF_MIN), dot(inVec, inVec));\n return inVec * inversesqrt(dp3);\n}\n"; // eslint-disable-line
4628
4591
 
4629
4592
  var common_vert = "attribute vec3 POSITION;\n\n#ifdef RENDERER_HAS_UV\n attribute vec2 TEXCOORD_0;\n#endif\n\n#ifdef RENDERER_HAS_UV1\n attribute vec2 TEXCOORD_1;\n#endif\n\n#ifdef RENDERER_HAS_SKIN\n attribute vec4 JOINTS_0;\n attribute vec4 WEIGHTS_0;\n\n #ifdef RENDERER_USE_JOINT_TEXTURE\n uniform sampler2D renderer_JointSampler;\n uniform float renderer_JointCount;\n\n mat4 getJointMatrix(sampler2D smp, float index)\n {\n float base = index / renderer_JointCount;\n float hf = 0.5 / renderer_JointCount;\n float v = base + hf;\n\n vec4 m0 = texture2D(smp, vec2(0.125, v ));\n vec4 m1 = texture2D(smp, vec2(0.375, v ));\n vec4 m2 = texture2D(smp, vec2(0.625, v ));\n vec4 m3 = texture2D(smp, vec2(0.875, v ));\n\n return mat4(m0, m1, m2, m3);\n\n }\n\n #else\n uniform mat4 renderer_JointMatrix[ RENDERER_JOINTS_NUM ];\n #endif\n#endif\n\n#ifdef RENDERER_ENABLE_VERTEXCOLOR\n attribute vec4 COLOR_0;\n#endif\n\n\n#include <transform_declare>\n#include <camera_declare>\n\nuniform vec4 material_TilingOffset;\n\n\n#ifndef MATERIAL_OMIT_NORMAL\n #ifdef RENDERER_HAS_NORMAL\n attribute vec3 NORMAL;\n #endif\n\n #ifdef RENDERER_HAS_TANGENT\n attribute vec4 TANGENT;\n #endif\n#endif"; // eslint-disable-line
4630
4593
 
@@ -4714,7 +4677,7 @@ var noise_simplex_4D = "//\n// Description : Array and textureless GLSL 2D/3D/4D
4714
4677
 
4715
4678
  var pbr_frag_define = "#define MIN_PERCEPTUAL_ROUGHNESS 0.045\n#define MIN_ROUGHNESS 0.002025\n\nuniform float material_AlphaCutoff;\nuniform vec4 material_BaseColor;\nuniform float material_Metal;\nuniform float material_Roughness;\nuniform float material_IOR;\nuniform vec3 material_PBRSpecularColor;\nuniform float material_Glossiness;\nuniform vec3 material_EmissiveColor;\nuniform float material_NormalIntensity;\nuniform float material_OcclusionIntensity;\nuniform float material_OcclusionTextureCoord;\n\n#ifdef MATERIAL_ENABLE_CLEAR_COAT\n uniform float material_ClearCoat;\n uniform float material_ClearCoatRoughness;\n\n #ifdef MATERIAL_HAS_CLEAR_COAT_TEXTURE\n uniform sampler2D material_ClearCoatTexture;\n #endif\n\n #ifdef MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE\n uniform sampler2D material_ClearCoatRoughnessTexture;\n #endif\n\n #ifdef MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE\n uniform sampler2D material_ClearCoatNormalTexture;\n #endif\n#endif\n\n#ifdef MATERIAL_ENABLE_ANISOTROPY\n uniform vec3 material_AnisotropyInfo;\n #ifdef MATERIAL_HAS_ANISOTROPY_TEXTURE\n uniform sampler2D material_AnisotropyTexture;\n #endif\n#endif\n\n// Texture\n#ifdef MATERIAL_HAS_BASETEXTURE\n uniform sampler2D material_BaseTexture;\n#endif\n\n#ifdef MATERIAL_HAS_NORMALTEXTURE\n uniform sampler2D material_NormalTexture;\n#endif\n\n#ifdef MATERIAL_HAS_EMISSIVETEXTURE\n uniform sampler2D material_EmissiveTexture;\n#endif\n\n#ifdef MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE\n uniform sampler2D material_RoughnessMetallicTexture;\n#endif\n\n\n#ifdef MATERIAL_HAS_SPECULAR_GLOSSINESS_TEXTURE\n uniform sampler2D material_SpecularGlossinessTexture;\n#endif\n\n#ifdef MATERIAL_HAS_OCCLUSION_TEXTURE\n uniform sampler2D material_OcclusionTexture;\n#endif\n\n\n#ifdef MATERIAL_ENABLE_SHEEN\n uniform float material_SheenRoughness;\n uniform vec3 material_SheenColor;\n #ifdef MATERIAL_HAS_SHEEN_TEXTURE\n uniform sampler2D material_SheenTexture;\n #endif\n\n #ifdef MATERIAL_HAS_SHEEN_ROUGHNESS_TEXTURE\n uniform sampler2D material_SheenRoughnessTexture;\n #endif\n#endif\n\n\n#ifdef MATERIAL_ENABLE_IRIDESCENCE\n uniform vec4 material_IridescenceInfo;\n #ifdef MATERIAL_HAS_IRIDESCENCE_THICKNESS_TEXTURE\n uniform sampler2D material_IridescenceThicknessTexture;\n #endif\n\n #ifdef MATERIAL_HAS_IRIDESCENCE_TEXTURE\n uniform sampler2D material_IridescenceTexture;\n #endif\n#endif\n\n#ifdef MATERIAL_ENABLE_TRANSMISSION\n uniform float material_Transmission;\n #ifdef MATERIAL_HAS_TRANSMISSION_TEXTURE\n uniform sampler2D material_TransmissionTexture;\n #endif\n\n #ifdef MATERIAL_HAS_THICKNESS\n uniform vec3 material_AttenuationColor;\n uniform float material_AttenuationDistance;\n uniform float material_Thickness;\n\n #ifdef MATERIAL_HAS_THICKNESS_TEXTURE\n uniform sampler2D material_ThicknessTexture;\n #endif\n #endif\n#endif\n\n// Runtime\nstruct ReflectedLight {\n vec3 directDiffuse;\n vec3 directSpecular;\n vec3 indirectDiffuse;\n vec3 indirectSpecular;\n};\n\nstruct Geometry {\n vec3 position;\n vec3 normal;\n vec3 viewDir;\n float dotNV;\n \n #ifdef MATERIAL_ENABLE_CLEAR_COAT\n vec3 clearCoatNormal;\n float clearCoatDotNV;\n #endif\n\n #ifdef MATERIAL_ENABLE_ANISOTROPY\n vec3 anisotropicT;\n vec3 anisotropicB;\n vec3 anisotropicN;\n float anisotropy;\n #endif\n};\n\nstruct Material {\n vec3 diffuseColor;\n float roughness;\n vec3 specularColor;\n float opacity;\n float f0;\n float diffuseAO;\n float specularAO;\n vec3 envSpecularDFG;\n float IOR;\n\n #ifdef MATERIAL_ENABLE_CLEAR_COAT\n float clearCoat;\n float clearCoatRoughness;\n #endif\n\n #ifdef MATERIAL_ENABLE_IRIDESCENCE\n float iridescenceIOR;\n float iridescenceFactor;\n float iridescenceThickness;\n vec3 iridescenceSpecularColor;\n #endif\n\n #ifdef MATERIAL_ENABLE_SHEEN\n float sheenRoughness;\n vec3 sheenColor;\n float sheenScaling;\n float approxIBLSheenDG;\n #endif\n\n #ifdef MATERIAL_ENABLE_TRANSMISSION \n vec3 absorptionCoefficient;\n float transmission;\n float thickness;\n #endif\n};"; // eslint-disable-line
4716
4679
 
4717
- var pbr_helper = "#include <normal_get>\n#include <brdf>\n#include <btdf>\n\n// direct + indirect\n#include <direct_irradiance_frag_define>\n#include <ibl_frag_define>\n\nuniform sampler2D camera_AOTexture;\n\nfloat computeSpecularOcclusion(float ambientOcclusion, float roughness, float dotNV ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n\nfloat getAARoughnessFactor(vec3 normal) {\n // Kaplanyan 2016, \"Stable specular highlights\"\n // Tokuyoshi 2017, \"Error Reduction and Simplification for Shading Anti-Aliasing\"\n // Tokuyoshi and Kaplanyan 2019, \"Improved Geometric Specular Antialiasing\"\n #ifdef HAS_DERIVATIVES\n vec3 dxy = max( abs(dFdx(normal)), abs(dFdy(normal)) );\n return max( max(dxy.x, dxy.y), dxy.z );\n #else\n return 0.0;\n #endif\n}\n\n#ifdef MATERIAL_ENABLE_ANISOTROPY\n // Aniso Bent Normals\n // Mc Alley https://www.gdcvault.com/play/1022235/Rendering-the-World-of-Far \n vec3 getAnisotropicBentNormal(Geometry geometry, vec3 n, float roughness) {\n vec3 anisotropyDirection = geometry.anisotropy >= 0.0 ? geometry.anisotropicB : geometry.anisotropicT;\n vec3 anisotropicTangent = cross(anisotropyDirection, geometry.viewDir);\n vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);\n // reduce stretching for (roughness < 0.2), refer to https://advances.realtimerendering.com/s2018/Siggraph%202018%20HDRP%20talk_with%20notes.pdf 80\n vec3 bentNormal = normalize( mix(n, anisotropicNormal, abs(geometry.anisotropy) * saturate( 5.0 * roughness)) );\n\n return bentNormal;\n }\n#endif\n\nvoid initGeometry(out Geometry geometry, bool isFrontFacing){\n geometry.position = v_pos;\n #ifdef CAMERA_ORTHOGRAPHIC\n geometry.viewDir = -camera_Forward;\n #else\n geometry.viewDir = normalize(camera_Position - v_pos);\n #endif\n #if defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) || defined(MATERIAL_ENABLE_ANISOTROPY)\n mat3 tbn = getTBN(isFrontFacing);\n #endif\n\n #ifdef MATERIAL_HAS_NORMALTEXTURE\n geometry.normal = getNormalByNormalTexture(tbn, material_NormalTexture, material_NormalIntensity, v_uv, isFrontFacing);\n #else\n geometry.normal = getNormal(isFrontFacing);\n #endif\n\n geometry.dotNV = saturate( dot(geometry.normal, geometry.viewDir) );\n\n\n #ifdef MATERIAL_ENABLE_CLEAR_COAT\n #ifdef MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE\n geometry.clearCoatNormal = getNormalByNormalTexture(tbn, material_ClearCoatNormalTexture, material_NormalIntensity, v_uv, isFrontFacing);\n #else\n geometry.clearCoatNormal = getNormal(isFrontFacing);\n #endif\n geometry.clearCoatDotNV = saturate( dot(geometry.clearCoatNormal, geometry.viewDir) );\n #endif\n\n #ifdef MATERIAL_ENABLE_ANISOTROPY\n float anisotropy = material_AnisotropyInfo.z;\n vec3 anisotropicDirection = vec3(material_AnisotropyInfo.xy, 0.0);\n #ifdef MATERIAL_HAS_ANISOTROPY_TEXTURE\n vec3 anisotropyTextureInfo = texture2D( material_AnisotropyTexture, v_uv ).rgb;\n anisotropy *= anisotropyTextureInfo.b;\n anisotropicDirection.xy *= anisotropyTextureInfo.rg * 2.0 - 1.0;\n #endif\n\n geometry.anisotropy = anisotropy;\n geometry.anisotropicT = normalize(tbn * anisotropicDirection);\n geometry.anisotropicB = normalize(cross(geometry.normal, geometry.anisotropicT));\n #endif\n}\n\nvoid initMaterial(out Material material, inout Geometry geometry){\n vec4 baseColor = material_BaseColor;\n float metal = material_Metal;\n float roughness = material_Roughness;\n vec3 specularColor = material_PBRSpecularColor;\n float glossiness = material_Glossiness;\n float alphaCutoff = material_AlphaCutoff;\n float f0 = pow2( (material_IOR - 1.0) / (material_IOR + 1.0) );\n\n material.f0 = f0;\n material.IOR = material_IOR;\n\n #ifdef MATERIAL_HAS_BASETEXTURE\n baseColor *= texture2DSRGB(material_BaseTexture, v_uv);\n #endif\n\n #ifdef RENDERER_ENABLE_VERTEXCOLOR\n baseColor *= v_color;\n #endif\n\n\n #ifdef MATERIAL_IS_ALPHA_CUTOFF\n if( baseColor.a < alphaCutoff ) {\n discard;\n }\n #endif\n\n #ifdef MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE\n vec4 metalRoughMapColor = texture2D( material_RoughnessMetallicTexture, v_uv );\n roughness *= metalRoughMapColor.g;\n metal *= metalRoughMapColor.b;\n #endif\n\n #ifdef MATERIAL_HAS_SPECULAR_GLOSSINESS_TEXTURE\n vec4 specularGlossinessColor = texture2DSRGB(material_SpecularGlossinessTexture, v_uv);\n specularColor *= specularGlossinessColor.rgb;\n glossiness *= specularGlossinessColor.a;\n #endif\n\n\n #ifdef IS_METALLIC_WORKFLOW\n material.diffuseColor = baseColor.rgb * ( 1.0 - metal );\n material.specularColor = mix( vec3(f0), baseColor.rgb, metal );\n material.roughness = roughness;\n #else\n float specularStrength = max( max( specularColor.r, specularColor.g ), specularColor.b );\n material.diffuseColor = baseColor.rgb * ( 1.0 - specularStrength );\n material.specularColor = specularColor;\n material.roughness = 1.0 - glossiness;\n #endif\n\n material.roughness = max(MIN_PERCEPTUAL_ROUGHNESS, min(material.roughness + getAARoughnessFactor(geometry.normal), 1.0));\n\n #ifdef MATERIAL_ENABLE_CLEAR_COAT\n material.clearCoat = material_ClearCoat;\n material.clearCoatRoughness = material_ClearCoatRoughness;\n #ifdef MATERIAL_HAS_CLEAR_COAT_TEXTURE\n material.clearCoat *= texture2D( material_ClearCoatTexture, v_uv ).r;\n #endif\n #ifdef MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE\n material.clearCoatRoughness *= texture2D( material_ClearCoatRoughnessTexture, v_uv ).g;\n #endif\n material.clearCoat = saturate( material.clearCoat );\n material.clearCoatRoughness = max(MIN_PERCEPTUAL_ROUGHNESS, min(material.clearCoatRoughness + getAARoughnessFactor(geometry.clearCoatNormal), 1.0));\n #endif\n\n #ifdef MATERIAL_IS_TRANSPARENT\n material.opacity = baseColor.a;\n #else\n material.opacity = 1.0;\n #endif\n #ifdef MATERIAL_ENABLE_ANISOTROPY\n geometry.anisotropicN = getAnisotropicBentNormal(geometry, geometry.normal, material.roughness);\n #endif\n\n material.envSpecularDFG = envBRDFApprox(material.specularColor, material.roughness, geometry.dotNV );\n\n // AO\n float diffuseAO = 1.0;\n float specularAO = 1.0;\n\n #ifdef MATERIAL_HAS_OCCLUSION_TEXTURE\n vec2 aoUV = v_uv;\n #ifdef RENDERER_HAS_UV1\n if(material_OcclusionTextureCoord == 1.0){\n aoUV = v_uv1;\n }\n #endif\n diffuseAO = ((texture2D(material_OcclusionTexture, aoUV)).r - 1.0) * material_OcclusionIntensity + 1.0;\n #endif\n\n #ifdef SCENE_ENABLE_AMBIENT_OCCLUSION \n float ambientAO = texture2D(camera_AOTexture,(v_PositionCS.xy / v_PositionCS.w) * 0.5 + 0.5).r;\n diffuseAO = min(diffuseAO, ambientAO);\n #endif\n\n #if (defined(MATERIAL_HAS_OCCLUSION_TEXTURE) || defined(SCENE_ENABLE_AMBIENT_OCCLUSION))&& defined(SCENE_USE_SPECULAR_ENV) \n specularAO = saturate( pow( geometry.dotNV + diffuseAO, exp2( - 16.0 * material.roughness - 1.0 ) ) - 1.0 + diffuseAO );\n #endif\n\n material.diffuseAO = diffuseAO;\n material.specularAO = specularAO;\n\n // Sheen\n #ifdef MATERIAL_ENABLE_SHEEN\n vec3 sheenColor = material_SheenColor;\n #ifdef MATERIAL_HAS_SHEEN_TEXTURE\n sheenColor *= texture2DSRGB(material_SheenTexture, v_uv).rgb;\n #endif\n material.sheenColor = sheenColor;\n\n material.sheenRoughness = material_SheenRoughness;\n #ifdef MATERIAL_HAS_SHEEN_ROUGHNESS_TEXTURE\n material.sheenRoughness *= texture2D(material_SheenRoughnessTexture, v_uv).a;\n #endif\n\n material.sheenRoughness = max(MIN_PERCEPTUAL_ROUGHNESS, min(material.sheenRoughness + getAARoughnessFactor(geometry.normal), 1.0));\n material.approxIBLSheenDG = prefilteredSheenDFG(geometry.dotNV, material.sheenRoughness);\n material.sheenScaling = 1.0 - material.approxIBLSheenDG * max(max(material.sheenColor.r, material.sheenColor.g), material.sheenColor.b);\n #endif\n\n // Iridescence\n #ifdef MATERIAL_ENABLE_IRIDESCENCE\n material.iridescenceFactor = material_IridescenceInfo.x;\n material.iridescenceIOR = material_IridescenceInfo.y;\n\n #ifdef MATERIAL_HAS_IRIDESCENCE_THICKNESS_TEXTURE\n float iridescenceThicknessWeight = texture2D( material_IridescenceThicknessTexture, v_uv).g;\n material.iridescenceThickness = mix(material_IridescenceInfo.z, material_IridescenceInfo.w, iridescenceThicknessWeight);\n #else\n material.iridescenceThickness = material_IridescenceInfo.w;\n #endif\n\n #ifdef MATERIAL_HAS_IRIDESCENCE_TEXTURE\n material.iridescenceFactor *= texture2D( material_IridescenceTexture, v_uv).r;\n #endif\n \n #ifdef MATERIAL_ENABLE_IRIDESCENCE\n float topIOR = 1.0;\n material.iridescenceSpecularColor = evalIridescenceSpecular(topIOR, geometry.dotNV, material.iridescenceIOR, material.specularColor, material.iridescenceThickness); \n #endif\n #endif\n\n // Transmission\n #ifdef MATERIAL_ENABLE_TRANSMISSION \n material.transmission = material_Transmission;\n #ifdef MATERIAL_HAS_TRANSMISSION_TEXTURE\n material.transmission *= texture2D(material_TransmissionTexture, v_uv).r;\n #endif\n\n #ifdef MATERIAL_HAS_THICKNESS\n material.absorptionCoefficient = -log(material_AttenuationColor + HALF_EPS) / max(HALF_EPS, material_AttenuationDistance);\n material.thickness = max(material_Thickness, 0.0001);\n #ifdef MATERIAL_HAS_THICKNESS_TEXTURE\n material.thickness *= texture2D( material_ThicknessTexture, v_uv).g;\n #endif\n #endif \n #endif\n\n}\n\n\n"; // eslint-disable-line
4680
+ var pbr_helper = "#include <normal_get>\n#include <brdf>\n#include <btdf>\n\n// direct + indirect\n#include <direct_irradiance_frag_define>\n#include <ibl_frag_define>\n\nuniform sampler2D camera_AOTexture;\n\nfloat evaluateAmbientOcclusion(vec2 uv)\n{\n #ifdef MATERIAL_IS_TRANSPARENT\n return 1.0;\n #else\n return texture2D(camera_AOTexture, uv).r;\n #endif\n}\n\n\nfloat computeSpecularOcclusion(float ambientOcclusion, float roughness, float dotNV ) {\n return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n\nfloat getAARoughnessFactor(vec3 normal) {\n // Kaplanyan 2016, \"Stable specular highlights\"\n // Tokuyoshi 2017, \"Error Reduction and Simplification for Shading Anti-Aliasing\"\n // Tokuyoshi and Kaplanyan 2019, \"Improved Geometric Specular Antialiasing\"\n #ifdef HAS_DERIVATIVES\n vec3 dxy = max( abs(dFdx(normal)), abs(dFdy(normal)) );\n return max( max(dxy.x, dxy.y), dxy.z );\n #else\n return 0.0;\n #endif\n}\n\n#ifdef MATERIAL_ENABLE_ANISOTROPY\n // Aniso Bent Normals\n // Mc Alley https://www.gdcvault.com/play/1022235/Rendering-the-World-of-Far \n vec3 getAnisotropicBentNormal(Geometry geometry, vec3 n, float roughness) {\n vec3 anisotropyDirection = geometry.anisotropy >= 0.0 ? geometry.anisotropicB : geometry.anisotropicT;\n vec3 anisotropicTangent = cross(anisotropyDirection, geometry.viewDir);\n vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);\n // reduce stretching for (roughness < 0.2), refer to https://advances.realtimerendering.com/s2018/Siggraph%202018%20HDRP%20talk_with%20notes.pdf 80\n vec3 bentNormal = normalize( mix(n, anisotropicNormal, abs(geometry.anisotropy) * saturate( 5.0 * roughness)) );\n\n return bentNormal;\n }\n#endif\n\nvoid initGeometry(out Geometry geometry, bool isFrontFacing){\n geometry.position = v_pos;\n #ifdef CAMERA_ORTHOGRAPHIC\n geometry.viewDir = -camera_Forward;\n #else\n geometry.viewDir = normalize(camera_Position - v_pos);\n #endif\n #if defined(MATERIAL_HAS_NORMALTEXTURE) || defined(MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE) || defined(MATERIAL_ENABLE_ANISOTROPY)\n mat3 tbn = getTBN(isFrontFacing);\n #endif\n\n #ifdef MATERIAL_HAS_NORMALTEXTURE\n geometry.normal = getNormalByNormalTexture(tbn, material_NormalTexture, material_NormalIntensity, v_uv, isFrontFacing);\n #else\n geometry.normal = getNormal(isFrontFacing);\n #endif\n\n geometry.dotNV = saturate( dot(geometry.normal, geometry.viewDir) );\n\n\n #ifdef MATERIAL_ENABLE_CLEAR_COAT\n #ifdef MATERIAL_HAS_CLEAR_COAT_NORMAL_TEXTURE\n geometry.clearCoatNormal = getNormalByNormalTexture(tbn, material_ClearCoatNormalTexture, material_NormalIntensity, v_uv, isFrontFacing);\n #else\n geometry.clearCoatNormal = getNormal(isFrontFacing);\n #endif\n geometry.clearCoatDotNV = saturate( dot(geometry.clearCoatNormal, geometry.viewDir) );\n #endif\n\n #ifdef MATERIAL_ENABLE_ANISOTROPY\n float anisotropy = material_AnisotropyInfo.z;\n vec3 anisotropicDirection = vec3(material_AnisotropyInfo.xy, 0.0);\n #ifdef MATERIAL_HAS_ANISOTROPY_TEXTURE\n vec3 anisotropyTextureInfo = texture2D( material_AnisotropyTexture, v_uv ).rgb;\n anisotropy *= anisotropyTextureInfo.b;\n anisotropicDirection.xy *= anisotropyTextureInfo.rg * 2.0 - 1.0;\n #endif\n\n geometry.anisotropy = anisotropy;\n geometry.anisotropicT = normalize(tbn * anisotropicDirection);\n geometry.anisotropicB = normalize(cross(geometry.normal, geometry.anisotropicT));\n #endif\n}\n\nvoid initMaterial(out Material material, inout Geometry geometry){\n vec4 baseColor = material_BaseColor;\n float metal = material_Metal;\n float roughness = material_Roughness;\n vec3 specularColor = material_PBRSpecularColor;\n float glossiness = material_Glossiness;\n float alphaCutoff = material_AlphaCutoff;\n float f0 = pow2( (material_IOR - 1.0) / (material_IOR + 1.0) );\n\n material.f0 = f0;\n material.IOR = material_IOR;\n\n #ifdef MATERIAL_HAS_BASETEXTURE\n baseColor *= texture2DSRGB(material_BaseTexture, v_uv);\n #endif\n\n #ifdef RENDERER_ENABLE_VERTEXCOLOR\n baseColor *= v_color;\n #endif\n\n\n #ifdef MATERIAL_IS_ALPHA_CUTOFF\n if( baseColor.a < alphaCutoff ) {\n discard;\n }\n #endif\n\n #ifdef MATERIAL_HAS_ROUGHNESS_METALLIC_TEXTURE\n vec4 metalRoughMapColor = texture2D( material_RoughnessMetallicTexture, v_uv );\n roughness *= metalRoughMapColor.g;\n metal *= metalRoughMapColor.b;\n #endif\n\n #ifdef MATERIAL_HAS_SPECULAR_GLOSSINESS_TEXTURE\n vec4 specularGlossinessColor = texture2DSRGB(material_SpecularGlossinessTexture, v_uv);\n specularColor *= specularGlossinessColor.rgb;\n glossiness *= specularGlossinessColor.a;\n #endif\n\n\n #ifdef IS_METALLIC_WORKFLOW\n material.diffuseColor = baseColor.rgb * ( 1.0 - metal );\n material.specularColor = mix( vec3(f0), baseColor.rgb, metal );\n material.roughness = roughness;\n #else\n float specularStrength = max( max( specularColor.r, specularColor.g ), specularColor.b );\n material.diffuseColor = baseColor.rgb * ( 1.0 - specularStrength );\n material.specularColor = specularColor;\n material.roughness = 1.0 - glossiness;\n #endif\n\n material.roughness = max(MIN_PERCEPTUAL_ROUGHNESS, min(material.roughness + getAARoughnessFactor(geometry.normal), 1.0));\n\n #ifdef MATERIAL_ENABLE_CLEAR_COAT\n material.clearCoat = material_ClearCoat;\n material.clearCoatRoughness = material_ClearCoatRoughness;\n #ifdef MATERIAL_HAS_CLEAR_COAT_TEXTURE\n material.clearCoat *= texture2D( material_ClearCoatTexture, v_uv ).r;\n #endif\n #ifdef MATERIAL_HAS_CLEAR_COAT_ROUGHNESS_TEXTURE\n material.clearCoatRoughness *= texture2D( material_ClearCoatRoughnessTexture, v_uv ).g;\n #endif\n material.clearCoat = saturate( material.clearCoat );\n material.clearCoatRoughness = max(MIN_PERCEPTUAL_ROUGHNESS, min(material.clearCoatRoughness + getAARoughnessFactor(geometry.clearCoatNormal), 1.0));\n #endif\n\n #ifdef MATERIAL_IS_TRANSPARENT\n material.opacity = baseColor.a;\n #else\n material.opacity = 1.0;\n #endif\n #ifdef MATERIAL_ENABLE_ANISOTROPY\n geometry.anisotropicN = getAnisotropicBentNormal(geometry, geometry.normal, material.roughness);\n #endif\n\n material.envSpecularDFG = envBRDFApprox(material.specularColor, material.roughness, geometry.dotNV );\n\n // AO\n float diffuseAO = 1.0;\n float specularAO = 1.0;\n\n #ifdef MATERIAL_HAS_OCCLUSION_TEXTURE\n vec2 aoUV = v_uv;\n #ifdef RENDERER_HAS_UV1\n if(material_OcclusionTextureCoord == 1.0){\n aoUV = v_uv1;\n }\n #endif\n diffuseAO = ((texture2D(material_OcclusionTexture, aoUV)).r - 1.0) * material_OcclusionIntensity + 1.0;\n #endif\n\n #ifdef SCENE_ENABLE_AMBIENT_OCCLUSION\n float ambientAO = evaluateAmbientOcclusion((v_PositionCS.xy / v_PositionCS.w) * 0.5 + 0.5);\n diffuseAO = min(diffuseAO, ambientAO);\n #endif\n\n #if (defined(MATERIAL_HAS_OCCLUSION_TEXTURE) || defined(SCENE_ENABLE_AMBIENT_OCCLUSION))&& defined(SCENE_USE_SPECULAR_ENV) \n specularAO = saturate( pow( geometry.dotNV + diffuseAO, exp2( - 16.0 * material.roughness - 1.0 ) ) - 1.0 + diffuseAO );\n #endif\n\n material.diffuseAO = diffuseAO;\n material.specularAO = specularAO;\n\n // Sheen\n #ifdef MATERIAL_ENABLE_SHEEN\n vec3 sheenColor = material_SheenColor;\n #ifdef MATERIAL_HAS_SHEEN_TEXTURE\n sheenColor *= texture2DSRGB(material_SheenTexture, v_uv).rgb;\n #endif\n material.sheenColor = sheenColor;\n\n material.sheenRoughness = material_SheenRoughness;\n #ifdef MATERIAL_HAS_SHEEN_ROUGHNESS_TEXTURE\n material.sheenRoughness *= texture2D(material_SheenRoughnessTexture, v_uv).a;\n #endif\n\n material.sheenRoughness = max(MIN_PERCEPTUAL_ROUGHNESS, min(material.sheenRoughness + getAARoughnessFactor(geometry.normal), 1.0));\n material.approxIBLSheenDG = prefilteredSheenDFG(geometry.dotNV, material.sheenRoughness);\n material.sheenScaling = 1.0 - material.approxIBLSheenDG * max(max(material.sheenColor.r, material.sheenColor.g), material.sheenColor.b);\n #endif\n\n // Iridescence\n #ifdef MATERIAL_ENABLE_IRIDESCENCE\n material.iridescenceFactor = material_IridescenceInfo.x;\n material.iridescenceIOR = material_IridescenceInfo.y;\n\n #ifdef MATERIAL_HAS_IRIDESCENCE_THICKNESS_TEXTURE\n float iridescenceThicknessWeight = texture2D( material_IridescenceThicknessTexture, v_uv).g;\n material.iridescenceThickness = mix(material_IridescenceInfo.z, material_IridescenceInfo.w, iridescenceThicknessWeight);\n #else\n material.iridescenceThickness = material_IridescenceInfo.w;\n #endif\n\n #ifdef MATERIAL_HAS_IRIDESCENCE_TEXTURE\n material.iridescenceFactor *= texture2D( material_IridescenceTexture, v_uv).r;\n #endif\n \n #ifdef MATERIAL_ENABLE_IRIDESCENCE\n float topIOR = 1.0;\n material.iridescenceSpecularColor = evalIridescenceSpecular(topIOR, geometry.dotNV, material.iridescenceIOR, material.specularColor, material.iridescenceThickness); \n #endif\n #endif\n\n // Transmission\n #ifdef MATERIAL_ENABLE_TRANSMISSION \n material.transmission = material_Transmission;\n #ifdef MATERIAL_HAS_TRANSMISSION_TEXTURE\n material.transmission *= texture2D(material_TransmissionTexture, v_uv).r;\n #endif\n\n #ifdef MATERIAL_HAS_THICKNESS\n material.absorptionCoefficient = -log(material_AttenuationColor + HALF_EPS) / max(HALF_EPS, material_AttenuationDistance);\n material.thickness = max(material_Thickness, 0.0001);\n #ifdef MATERIAL_HAS_THICKNESS_TEXTURE\n material.thickness *= texture2D( material_ThicknessTexture, v_uv).g;\n #endif\n #endif \n #endif\n}\n\n\n\n"; // eslint-disable-line
4718
4681
 
4719
4682
  var brdf = "\n#ifdef MATERIAL_ENABLE_SHEEN\n uniform sampler2D scene_PrefilteredDFG;\n#endif\n\nfloat F_Schlick(float f0, float dotLH) {\n\treturn f0 + 0.96 * (pow(1.0 - dotLH, 5.0));\n}\n\nvec3 F_Schlick(vec3 specularColor, float dotLH ) {\n\n\t// Original approximation by Christophe Schlick '94\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH '13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n\n}\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat G_GGX_SmithCorrelated(float alpha, float dotNL, float dotNV ) {\n\n\tfloat a2 = pow2( alpha );\n\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\n\treturn 0.5 / max( gv + gl, EPSILON );\n\n}\n\n#ifdef MATERIAL_ENABLE_ANISOTROPY\n // Heitz 2014, \"Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs\"\n // Heitz http://jcgt.org/published/0003/02/03/paper.pdf\n float G_GGX_SmithCorrelated_Anisotropic(float at, float ab, float ToV, float BoV, float ToL, float BoL, float NoV, float NoL) {\n float lambdaV = NoL * length(vec3(at * ToV, ab * BoV, NoV));\n float lambdaL = NoV * length(vec3(at * ToL, ab * BoL, NoL));\n return 0.5 / max(lambdaV + lambdaL, EPSILON);\n }\n#endif\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is \"roughness squared\" in Disney’s reparameterization\nfloat D_GGX(float alpha, float dotNH ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\n\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n\n}\n\n#ifdef MATERIAL_ENABLE_SHEEN\n // http://www.aconty.com/pdf/s2017_pbs_imageworks_sheen.pdf\n float D_Charlie(float roughness, float dotNH) {\n float invAlpha = 1.0 / roughness;\n float cos2h = dotNH * dotNH;\n float sin2h = max(1.0 - cos2h, 0.0078125); // 2^(-14/2), so sin2h^2 > 0 in fp16\n return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n }\n\n // Neubelt and Pettineo 2013, \"Crafting a Next-gen Material Pipeline for The Order: 1886\".\n float V_Neubelt(float NoV, float NoL) {\n return saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n }\n\n vec3 sheenBRDF(vec3 incidentDirection, Geometry geometry, vec3 sheenColor, float sheenRoughness) {\n vec3 halfDir = normalize(incidentDirection + geometry.viewDir);\n float dotNL = saturate(dot(geometry.normal, incidentDirection));\n float dotNH = saturate(dot(geometry.normal, halfDir));\n float D = D_Charlie(sheenRoughness, dotNH);\n float V = V_Neubelt(geometry.dotNV, dotNL);\n vec3 F = sheenColor;\n return D * V * F;\n }\n\n float prefilteredSheenDFG(float dotNV, float sheenRoughness) {\n #ifdef HAS_TEX_LOD\n return texture2DLodEXT(scene_PrefilteredDFG, vec2(dotNV, sheenRoughness), 0.0).b;\n #else\n return texture2D(scene_PrefilteredDFG, vec2(dotNV, sheenRoughness),0.0).b;\n #endif \n }\n#endif\n\n#ifdef MATERIAL_ENABLE_ANISOTROPY\n // GGX Distribution Anisotropic\n // https://blog.selfshadow.com/publications/s2012-shading-course/burley/s2012_pbs_disney_brdf_notes_v3.pdf Addenda\n float D_GGX_Anisotropic(float at, float ab, float ToH, float BoH, float NoH) {\n float a2 = at * ab;\n vec3 d = vec3(ab * ToH, at * BoH, a2 * NoH);\n float d2 = dot(d, d);\n float b2 = a2 / d2;\n return a2 * b2 * b2 * RECIPROCAL_PI;\n }\n#endif\n\nfloat DG_GGX(float alpha, float dotNV, float dotNL, float dotNH) {\n\tfloat D = D_GGX( alpha, dotNH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n return G * D;\n}\n\n#ifdef MATERIAL_ENABLE_ANISOTROPY\n float DG_GGX_anisotropic(vec3 h, vec3 l, Geometry geometry, float alpha, float dotNV, float dotNL, float dotNH) {\n vec3 t = geometry.anisotropicT;\n vec3 b = geometry.anisotropicB;\n vec3 v = geometry.viewDir;\n\n float dotTV = dot(t, v);\n float dotBV = dot(b, v);\n float dotTL = dot(t, l);\n float dotBL = dot(b, l);\n float dotTH = dot(t, h);\n float dotBH = dot(b, h);\n\n // Aniso parameter remapping\n // https://blog.selfshadow.com/publications/s2017-shading-course/imageworks/s2017_pbs_imageworks_slides_v2.pdf page 24\n float at = max(alpha * (1.0 + geometry.anisotropy), MIN_ROUGHNESS);\n float ab = max(alpha * (1.0 - geometry.anisotropy), MIN_ROUGHNESS);\n\n // specular anisotropic BRDF\n float D = D_GGX_Anisotropic(at, ab, dotTH, dotBH, dotNH);\n float G = G_GGX_SmithCorrelated_Anisotropic(at, ab, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL);\n\n return G * D;\n }\n#endif\n\n#ifdef MATERIAL_ENABLE_IRIDESCENCE\n vec3 iorToFresnel0(vec3 transmittedIOR, float incidentIOR) {\n return pow((transmittedIOR - incidentIOR) / (transmittedIOR + incidentIOR),vec3(2.0));\n } \n\n float iorToFresnel0(float transmittedIOR, float incidentIOR) {\n return pow((transmittedIOR - incidentIOR) / (transmittedIOR + incidentIOR),2.0);\n } \n\n // Assume air interface for top\n // Note: We don't handle the case fresnel0 == 1\n vec3 fresnelToIOR(vec3 f0){\n vec3 sqrtF0 = sqrt(f0);\n return (vec3(1.0) + sqrtF0) / (vec3(1.0) - sqrtF0);\n }\n\n // Fresnel equations for dielectric/dielectric interfaces.\n // Ref: https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html\n // Evaluation XYZ sensitivity curves in Fourier space\n vec3 evalSensitivity(float opd, vec3 shift){\n // Use Gaussian fits, given by 3 parameters: val, pos and var\n float phase = 2.0 * PI * opd * 1.0e-9;\n const vec3 val = vec3(5.4856e-13, 4.4201e-13, 5.2481e-13);\n const vec3 pos = vec3(1.6810e+06, 1.7953e+06, 2.2084e+06);\n const vec3 var = vec3(4.3278e+09, 9.3046e+09, 6.6121e+09);\n vec3 xyz = val * sqrt(2.0 * PI * var) * cos(pos * phase + shift) * exp(-var * pow2(phase));\n xyz.x += 9.7470e-14 * sqrt(2.0 * PI * 4.5282e+09) * cos(2.2399e+06 * phase + shift[0]) * exp(-4.5282e+09 * pow2(phase));\n xyz /= 1.0685e-7;\n // XYZ to RGB color space\n const mat3 XYZ_TO_RGB = mat3( 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252);\n vec3 rgb = XYZ_TO_RGB * xyz;\n return rgb;\n }\n\n vec3 evalIridescenceSpecular(float outsideIOR, float dotNV, float thinIOR, vec3 baseF0,float iridescenceThickness){ \n vec3 iridescence = vec3(1.0);\n // Force iridescenceIOR -> outsideIOR when thinFilmThickness -> 0.0\n float iridescenceIOR = mix( outsideIOR, thinIOR, smoothstep( 0.0, 0.03, iridescenceThickness ) );\n // Evaluate the cosTheta on the base layer (Snell law)\n float sinTheta2Sq = pow( outsideIOR / iridescenceIOR, 2.0) * (1.0 - pow( dotNV, 2.0));\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n // Handle total internal reflection\n if (cosTheta2Sq < 0.0) {\n return iridescence;\n }\n float cosTheta2 = sqrt(cosTheta2Sq);\n \n // First interface\n float f0 = iorToFresnel0(iridescenceIOR, outsideIOR);\n float reflectance = F_Schlick(f0, dotNV);\n float t121 = 1.0 - reflectance;\n float phi12 = 0.0;\n // iridescenceIOR has limited greater than 1.0\n // if (iridescenceIOR < outsideIOR) {phi12 = PI;} \n float phi21 = PI - phi12;\n \n // Second interface\n vec3 baseIOR = fresnelToIOR(clamp(baseF0, 0.0, 0.9999)); // guard against 1.0\n vec3 r1 = iorToFresnel0(baseIOR, iridescenceIOR);\n vec3 r23 = F_Schlick(r1, cosTheta2);\n vec3 phi23 =vec3(0.0);\n if (baseIOR[0] < iridescenceIOR) {phi23[0] = PI;}\n if (baseIOR[1] < iridescenceIOR) {phi23[1] = PI;}\n if (baseIOR[2] < iridescenceIOR) {phi23[2] = PI;}\n \n // Phase shift\n float opd = 2.0 * iridescenceIOR * iridescenceThickness * cosTheta2;\n vec3 phi = vec3(phi21) + phi23;\n \n // Compound terms\n vec3 r123 = clamp(reflectance * r23, 1e-5, 0.9999);\n vec3 sr123 = sqrt(r123);\n vec3 rs = pow2(t121) * r23 / (vec3(1.0) - r123);\n // Reflectance term for m = 0 (DC term amplitude)\n vec3 c0 = reflectance + rs;\n iridescence = c0;\n // Reflectance term for m > 0 (pairs of diracs)\n vec3 cm = rs - t121;\n for (int m = 1; m <= 2; ++m) {\n cm *= sr123;\n vec3 sm = 2.0 * evalSensitivity(float(m) * opd, float(m) * phi);\n iridescence += cm * sm;\n }\n return iridescence = max(iridescence, vec3(0.0)); \n }\n#endif\n\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\nvec3 BRDF_Specular_GGX(vec3 incidentDirection, Geometry geometry, Material material, vec3 normal, vec3 specularColor, float roughness ) {\n\n\tfloat alpha = pow2( roughness ); // UE4's roughness\n\n\tvec3 halfDir = normalize( incidentDirection + geometry.viewDir );\n\n\tfloat dotNL = saturate( dot( normal, incidentDirection ) );\n\tfloat dotNV = saturate( dot( normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentDirection, halfDir ) );\n\n vec3 F = F_Schlick( specularColor, dotLH );\n #ifdef MATERIAL_ENABLE_IRIDESCENCE\n F = mix(F, material.iridescenceSpecularColor, material.iridescenceFactor);\n #endif\n\n #ifdef MATERIAL_ENABLE_ANISOTROPY\n float GD = DG_GGX_anisotropic(halfDir, incidentDirection, geometry, alpha, dotNV, dotNL, dotNH);\n #else\n float GD = DG_GGX(alpha, dotNV, dotNL, dotNH);\n #endif\n\n return F * GD;\n}\n\nvec3 BRDF_Diffuse_Lambert(vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\n"; // eslint-disable-line
4720
4683
 
@@ -4887,11 +4850,11 @@ var ShaderFactory = /*#__PURE__*/ function() {
4887
4850
  shader = shader.replace(/\bvarying\b/g, isFrag ? "in" : "out");
4888
4851
  shader = shader.replace(/\btexture(2D|Cube)\b/g, "texture");
4889
4852
  shader = shader.replace(/\btexture2DProj\b/g, "textureProj");
4853
+ shader = shader.replace(/\btexture(2D|Cube)LodEXT\b/g, "textureLod");
4854
+ shader = shader.replace(/\btexture(2D|Cube)GradEXT\b/g, "textureGrad");
4855
+ shader = shader.replace(/\btexture2DProjLodEXT\b/g, "textureProjLod");
4856
+ shader = shader.replace(/\btexture2DProjGradEXT\b/g, "textureProjGrad");
4890
4857
  if (isFrag) {
4891
- shader = shader.replace(/\btexture(2D|Cube)LodEXT\b/g, "textureLod");
4892
- shader = shader.replace(/\btexture(2D|Cube)GradEXT\b/g, "textureGrad");
4893
- shader = shader.replace(/\btexture2DProjLodEXT\b/g, "textureProjLod");
4894
- shader = shader.replace(/\btexture2DProjGradEXT\b/g, "textureProjGrad");
4895
4858
  shader = shader.replace(/\bgl_FragDepthEXT\b/g, "gl_FragDepth");
4896
4859
  if (!ShaderFactory._has300Output(shader)) {
4897
4860
  var isMRT = /\bgl_FragData\[.+?\]/g.test(shader);
@@ -4900,7 +4863,7 @@ var ShaderFactory = /*#__PURE__*/ function() {
4900
4863
  var result = shader.match(/\bgl_FragData\[.+?\]/g);
4901
4864
  shader = this._replaceMRTShader(shader, result);
4902
4865
  } else {
4903
- shader = shader.replace(/void\s+?main\s*\(/g, "out vec4 glFragColor;\nvoid main(");
4866
+ shader = "out vec4 glFragColor;\n" + shader;
4904
4867
  shader = shader.replace(/\bgl_FragColor\b/g, "glFragColor");
4905
4868
  }
4906
4869
  }
@@ -5597,47 +5560,29 @@ ShaderTagKey._nameMap = Object.create(null);
5597
5560
  }();
5598
5561
  ShaderProgram._counter = 0;
5599
5562
 
5600
- /**
5601
- * @internal
5602
- * Shader pass type
5603
- */ var ShaderType = /*#__PURE__*/ function(ShaderType) {
5604
- /** init by glsl */ ShaderType[ShaderType["Canonical"] = 0] = "Canonical";
5605
- /** init by shader-lab */ ShaderType[ShaderType["ShaderLab"] = 1] = "ShaderLab";
5606
- return ShaderType;
5607
- }({});
5608
-
5563
+ var precisionStr = "\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n #else\n precision mediump float;\n precision mediump int;\n #endif\n ";
5609
5564
  /**
5610
5565
  * Shader pass containing vertex and fragment source.
5611
5566
  */ var ShaderPass = /*#__PURE__*/ function(ShaderPart) {
5612
5567
  _inherits(ShaderPass, ShaderPart);
5613
- function ShaderPass(nameOrVertexSource, vertexSourceOrFragmentSourceOrCode, fragmentSourceOrTagsOrVertexEntry, fragmentEntryOrTags, tags) {
5568
+ function ShaderPass(nameOrVertexSource, vertexSourceOrFragmentSource, fragmentSourceOrTags, tags) {
5614
5569
  var _this;
5615
- _this = ShaderPart.call(this) || this, /** @internal */ _this._shaderPassId = 0, /** @internal */ _this._renderStateDataMap = {}, /** @internal */ _this._shaderProgramPools = [], /** @internal */ _this._path = "", _this._platformMacros = [];
5570
+ _this = ShaderPart.call(this) || this, /** @internal */ _this._shaderPassId = 0, /** @internal */ _this._renderStateDataMap = {}, /** @internal */ _this._shaderProgramPools = [];
5616
5571
  _this._shaderPassId = ShaderPass._shaderPassCounter++;
5617
- _this._type = ShaderType.Canonical;
5618
- if (typeof fragmentEntryOrTags === "string") {
5572
+ if (typeof fragmentSourceOrTags === "string") {
5619
5573
  _this._name = nameOrVertexSource;
5620
- _this._shaderLabSource = vertexSourceOrFragmentSourceOrCode;
5621
- _this._vertexEntry = fragmentSourceOrTagsOrVertexEntry;
5622
- _this._fragmentEntry = fragmentEntryOrTags;
5574
+ _this._vertexSource = vertexSourceOrFragmentSource;
5575
+ _this._fragmentSource = fragmentSourceOrTags;
5623
5576
  tags = _extends({
5624
5577
  pipelineStage: PipelineStage.Forward
5625
5578
  }, tags);
5626
- _this._type = ShaderType.ShaderLab;
5627
- } else if (typeof fragmentSourceOrTagsOrVertexEntry === "string") {
5628
- _this._name = nameOrVertexSource;
5629
- _this._vertexSource = vertexSourceOrFragmentSourceOrCode;
5630
- _this._fragmentSource = fragmentSourceOrTagsOrVertexEntry;
5631
- tags = fragmentEntryOrTags != null ? fragmentEntryOrTags : {
5632
- pipelineStage: PipelineStage.Forward
5633
- };
5634
5579
  } else {
5635
5580
  _this._name = "Default";
5636
5581
  _this._vertexSource = nameOrVertexSource;
5637
- _this._fragmentSource = vertexSourceOrFragmentSourceOrCode;
5638
- tags = fragmentSourceOrTagsOrVertexEntry != null ? fragmentSourceOrTagsOrVertexEntry : {
5582
+ _this._fragmentSource = vertexSourceOrFragmentSource;
5583
+ tags = _extends({
5639
5584
  pipelineStage: PipelineStage.Forward
5640
- };
5585
+ }, fragmentSourceOrTags);
5641
5586
  }
5642
5587
  for(var key in tags){
5643
5588
  _this.setTag(key, tags[key]);
@@ -5653,11 +5598,7 @@ ShaderProgram._counter = 0;
5653
5598
  if (shaderProgram) {
5654
5599
  return shaderProgram;
5655
5600
  }
5656
- if (this._type === ShaderType.Canonical) {
5657
- shaderProgram = this._getCanonicalShaderProgram(engine, macroCollection);
5658
- } else {
5659
- shaderProgram = this._compileShaderProgram(engine, macroCollection, this._vertexEntry, this._fragmentEntry);
5660
- }
5601
+ shaderProgram = this._getCanonicalShaderProgram(engine, macroCollection);
5661
5602
  shaderProgramPool.cache(shaderProgram);
5662
5603
  return shaderProgram;
5663
5604
  };
@@ -5673,55 +5614,37 @@ ShaderProgram._counter = 0;
5673
5614
  // Clear array storing multiple engine shader program pools
5674
5615
  shaderProgramPools.length = 0;
5675
5616
  };
5676
- /**
5677
- * Shader Lab compilation
5678
- */ _proto._compileShaderProgram = function _compileShaderProgram(engine, macroCollection, vertexEntry, fragmentEntry) {
5679
- var _this = this, path = _this._path, platformMacros = _this._platformMacros;
5617
+ _proto._getCanonicalShaderProgram = function _getCanonicalShaderProgram(engine, macroCollection) {
5680
5618
  var isWebGL2 = engine._hardwareRenderer.isWebGL2;
5681
- var macros = new Array();
5682
- ShaderMacro._getMacrosElements(macroCollection, macros);
5683
- platformMacros.length = 0;
5619
+ var shaderMacroList = new Array();
5620
+ ShaderMacro._getMacrosElements(macroCollection, shaderMacroList);
5621
+ shaderMacroList.push(ShaderMacro.getByName(isWebGL2 ? "GRAPHICS_API_WEBGL2" : "GRAPHICS_API_WEBGL1"));
5684
5622
  if (engine._hardwareRenderer.canIUse(GLCapabilityType.shaderTextureLod)) {
5685
- platformMacros.push("HAS_TEX_LOD");
5623
+ shaderMacroList.push(ShaderMacro.getByName("HAS_TEX_LOD"));
5686
5624
  }
5687
5625
  if (engine._hardwareRenderer.canIUse(GLCapabilityType.standardDerivatives)) {
5688
- platformMacros.push("HAS_DERIVATIVES");
5689
- }
5690
- if (isWebGL2) {
5691
- platformMacros.push("GRAPHICS_API_WEBGL2");
5626
+ shaderMacroList.push(ShaderMacro.getByName("HAS_DERIVATIVES"));
5627
+ }
5628
+ // Compatible with non-shaderlab syntax
5629
+ var noIncludeVertex = ShaderFactory.parseIncludes(this._vertexSource);
5630
+ var noIncludeFrag = ShaderFactory.parseIncludes(this._fragmentSource);
5631
+ // Parse macros when use shaderlab
5632
+ if (this._platformTarget != undefined) {
5633
+ noIncludeVertex = Shader._shaderLab._parseMacros(noIncludeVertex, shaderMacroList);
5634
+ noIncludeFrag = Shader._shaderLab._parseMacros(noIncludeFrag, shaderMacroList);
5692
5635
  } else {
5693
- platformMacros.push("GRAPHICS_API_WEBGL1");
5636
+ var macroNameStr = ShaderFactory.parseCustomMacros(shaderMacroList);
5637
+ noIncludeVertex = macroNameStr + noIncludeVertex;
5638
+ noIncludeFrag = macroNameStr + noIncludeFrag;
5694
5639
  }
5695
- var start = performance.now();
5696
- var shaderProgramSource = Shader._shaderLab._parseShaderPass(this._shaderLabSource, vertexEntry, fragmentEntry, macros, isWebGL2 ? ShaderPlatformTarget.GLES300 : ShaderPlatformTarget.GLES100, platformMacros, new URL(path, ShaderPass._shaderRootPath).href);
5697
- Logger.info("[ShaderLab compilation] cost time: " + (performance.now() - start) + "ms");
5698
- if (shaderProgramSource) {
5699
- return new ShaderProgram(engine, shaderProgramSource.vertex, shaderProgramSource.fragment);
5700
- } else {
5701
- return new ShaderProgram(engine, "", "");
5640
+ // Need to convert to 300 es when the target is GLSL ES 100 or unkdown
5641
+ if (isWebGL2 && (this._platformTarget == undefined || this._platformTarget === ShaderLanguage.GLSLES100)) {
5642
+ noIncludeVertex = ShaderFactory.convertTo300(noIncludeVertex);
5643
+ noIncludeFrag = ShaderFactory.convertTo300(noIncludeFrag, true);
5702
5644
  }
5703
- };
5704
- // TODO: remove it after migrate all shader to `ShaderLab`.
5705
- _proto._getCanonicalShaderProgram = function _getCanonicalShaderProgram(engine, macroCollection) {
5706
- var isWebGL2 = engine._hardwareRenderer.isWebGL2;
5707
- var macroNameList = new Array();
5708
- ShaderMacro._getMacrosElements(macroCollection, macroNameList);
5709
- var macroNameStr = ShaderFactory.parseCustomMacros(macroNameList);
5710
5645
  var versionStr = isWebGL2 ? "#version 300 es" : "#version 100";
5711
- var graphicAPI = isWebGL2 ? "#define GRAPHICS_API_WEBGL2" : "#define GRAPHICS_API_WEBGL1";
5712
- var precisionStr = "\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n #else\n precision mediump float;\n precision mediump int;\n #endif\n ";
5713
- if (engine._hardwareRenderer.canIUse(GLCapabilityType.shaderTextureLod)) {
5714
- precisionStr += "#define HAS_TEX_LOD\n";
5715
- }
5716
- if (engine._hardwareRenderer.canIUse(GLCapabilityType.standardDerivatives)) {
5717
- precisionStr += "#define HAS_DERIVATIVES\n";
5718
- }
5719
- var vertexSource = " " + versionStr + "\n " + graphicAPI + "\n " + macroNameStr + "\n " + ShaderFactory.parseIncludes(this._vertexSource);
5720
- var fragmentSource = " " + versionStr + "\n " + graphicAPI + "\n " + (isWebGL2 ? "" : ShaderFactory._shaderExtension) + "\n " + precisionStr + "\n " + macroNameStr + "\n " + ShaderFactory.parseIncludes(this._fragmentSource);
5721
- if (isWebGL2) {
5722
- vertexSource = ShaderFactory.convertTo300(vertexSource);
5723
- fragmentSource = ShaderFactory.convertTo300(fragmentSource, true);
5724
- }
5646
+ var vertexSource = " " + versionStr + " \n " + noIncludeVertex + "\n ";
5647
+ var fragmentSource = " " + versionStr + "\n " + (isWebGL2 ? "" : ShaderFactory._shaderExtension) + "\n " + precisionStr + "\n " + noIncludeFrag + "\n ";
5725
5648
  var shaderProgram = new ShaderProgram(engine, vertexSource, fragmentSource);
5726
5649
  return shaderProgram;
5727
5650
  };
@@ -6403,18 +6326,6 @@ __decorate([
6403
6326
  }
6404
6327
  var _proto = Shader.prototype;
6405
6328
  /**
6406
- * @internal
6407
- * path should follow the specifications of [URL.origin](https://developer.mozilla.org/en-US/docs/Web/API/URL/origin), like: `shaders://root/`
6408
- */ _proto._registerPath = function _registerPath(path) {
6409
- for(var _iterator = _create_for_of_iterator_helper_loose(this._subShaders), _step; !(_step = _iterator()).done;){
6410
- var subShader = _step.value;
6411
- for(var _iterator1 = _create_for_of_iterator_helper_loose(subShader.passes), _step1; !(_step1 = _iterator1()).done;){
6412
- var shaderPass = _step1.value;
6413
- shaderPass._path = path;
6414
- }
6415
- }
6416
- };
6417
- /**
6418
6329
  * Compile shader variant by macro name list.
6419
6330
  *
6420
6331
  * @remarks
@@ -6470,74 +6381,82 @@ __decorate([
6470
6381
  */ _proto._addReferCount = function _addReferCount(value) {
6471
6382
  this._refCount += value;
6472
6383
  };
6473
- Shader.create = function create(nameOrShaderSource, vertexSourceOrShaderPassesOrSubShaders, fragmentSource) {
6384
+ Shader.create = function create(nameOrShaderSource, vertexSourceOrShaderPassesOrSubShadersOrPlatformTarget, fragmentSourceOrPath) {
6474
6385
  var shader;
6475
6386
  var shaderMap = Shader._shaderMap;
6476
- if (!vertexSourceOrShaderPassesOrSubShaders) {
6477
- if (!Shader._shaderLab) {
6387
+ if (vertexSourceOrShaderPassesOrSubShadersOrPlatformTarget == undefined) {
6388
+ vertexSourceOrShaderPassesOrSubShadersOrPlatformTarget = ShaderLanguage.GLSLES100;
6389
+ }
6390
+ if (typeof vertexSourceOrShaderPassesOrSubShadersOrPlatformTarget === "number") {
6391
+ var shaderLab = Shader._shaderLab;
6392
+ if (!shaderLab) {
6478
6393
  throw "ShaderLab has not been set up yet.";
6479
6394
  }
6480
- var shaderContent = Shader._shaderLab._parseShaderContent(nameOrShaderSource);
6481
- if (shaderMap[shaderContent.name]) {
6482
- console.error('Shader named "' + shaderContent.name + '" already exists.');
6395
+ var shaderSource = shaderLab._parseShaderSource(nameOrShaderSource);
6396
+ if (shaderMap[shaderSource.name]) {
6397
+ console.error('Shader named "' + shaderSource.name + '" already exists.');
6483
6398
  return;
6484
6399
  }
6485
- var subShaderList = shaderContent.subShaders.map(function(subShaderContent) {
6486
- var passList = subShaderContent.passes.map(function(passInfo) {
6487
- if (passInfo.isUsePass) {
6400
+ var subShaderList = shaderSource.subShaders.map(function(subShaderSource) {
6401
+ var passList = subShaderSource.passes.map(function(passSource) {
6402
+ if (passSource.isUsePass) {
6488
6403
  var _Shader_find_subShaders_find, _Shader_find;
6489
- // Use pass reference
6490
- var paths = passInfo.name.split("/");
6491
- return (_Shader_find = Shader.find(paths[0])) == null ? void 0 : (_Shader_find_subShaders_find = _Shader_find.subShaders.find(function(subShader) {
6492
- return subShader.name === paths[1];
6404
+ var _passSource_name_split = passSource.name.split("/"), shaderName = _passSource_name_split[0], subShaderName = _passSource_name_split[1], passName = _passSource_name_split[2];
6405
+ return (_Shader_find = Shader.find(shaderName)) == null ? void 0 : (_Shader_find_subShaders_find = _Shader_find.subShaders.find(function(subShader) {
6406
+ return subShader.name === subShaderName;
6493
6407
  })) == null ? void 0 : _Shader_find_subShaders_find.passes.find(function(pass) {
6494
- return pass.name === paths[2];
6408
+ return pass.name === passName;
6495
6409
  });
6496
6410
  }
6497
- var shaderPassContent = new ShaderPass(passInfo.name, passInfo.contents, passInfo.vertexEntry, passInfo.fragmentEntry, passInfo.tags);
6498
- var _passInfo_renderStates = passInfo.renderStates, constantMap = _passInfo_renderStates.constantMap, variableMap = _passInfo_renderStates.variableMap;
6411
+ var shaderPassSource = Shader._shaderLab._parseShaderPass(passSource.contents, passSource.vertexEntry, passSource.fragmentEntry, vertexSourceOrShaderPassesOrSubShadersOrPlatformTarget, new URL(fragmentSourceOrPath != null ? fragmentSourceOrPath : "", ShaderPass._shaderRootPath).href);
6412
+ if (!shaderPassSource) {
6413
+ throw 'Shader pass "' + shaderSource.name + "." + subShaderSource.name + "." + passSource.name + '" parse failed, please check the shader source code.';
6414
+ }
6415
+ var shaderPass = new ShaderPass(passSource.name, shaderPassSource.vertex, shaderPassSource.fragment, passSource.tags);
6416
+ shaderPass._platformTarget = vertexSourceOrShaderPassesOrSubShadersOrPlatformTarget;
6417
+ var _passSource_renderStates = passSource.renderStates, constantMap = _passSource_renderStates.constantMap, variableMap = _passSource_renderStates.variableMap;
6499
6418
  // Compatible shader lab no render state use material `renderState` to modify render state
6500
6419
  if (Object.keys(constantMap).length > 0 || Object.keys(variableMap).length > 0) {
6501
6420
  // Parse const render state
6502
6421
  var renderState = new RenderState();
6503
- shaderPassContent._renderState = renderState;
6504
6422
  for(var k in constantMap){
6505
- Shader._applyConstRenderStates(renderState, parseInt(k), constantMap[k]);
6423
+ Shader._applyConstRenderStates(renderState, +k, constantMap[k]);
6506
6424
  }
6425
+ shaderPass._renderState = renderState;
6507
6426
  // Parse variable render state
6508
6427
  var renderStateDataMap = {};
6509
6428
  for(var k1 in variableMap){
6510
6429
  renderStateDataMap[k1] = ShaderProperty.getByName(variableMap[k1]);
6511
6430
  }
6512
- shaderPassContent._renderStateDataMap = renderStateDataMap;
6431
+ shaderPass._renderStateDataMap = renderStateDataMap;
6513
6432
  }
6514
- return shaderPassContent;
6433
+ return shaderPass;
6515
6434
  });
6516
- return new SubShader(subShaderContent.name, passList, subShaderContent.tags);
6435
+ return new SubShader(subShaderSource.name, passList, subShaderSource.tags);
6517
6436
  });
6518
- shader = new Shader(shaderContent.name, subShaderList);
6519
- shaderMap[shaderContent.name] = shader;
6437
+ shader = new Shader(shaderSource.name, subShaderList);
6438
+ shaderMap[shaderSource.name] = shader;
6520
6439
  return shader;
6521
6440
  } else {
6522
6441
  if (shaderMap[nameOrShaderSource]) {
6523
6442
  console.error('Shader named "' + nameOrShaderSource + '" already exists.');
6524
6443
  return;
6525
6444
  }
6526
- if (typeof vertexSourceOrShaderPassesOrSubShaders === "string") {
6527
- var shaderPass = new ShaderPass(vertexSourceOrShaderPassesOrSubShaders, fragmentSource);
6445
+ if (typeof vertexSourceOrShaderPassesOrSubShadersOrPlatformTarget === "string") {
6446
+ var shaderPass = new ShaderPass(vertexSourceOrShaderPassesOrSubShadersOrPlatformTarget, fragmentSourceOrPath);
6528
6447
  shader = new Shader(nameOrShaderSource, [
6529
6448
  new SubShader("Default", [
6530
6449
  shaderPass
6531
6450
  ])
6532
6451
  ]);
6533
6452
  } else {
6534
- if (vertexSourceOrShaderPassesOrSubShaders.length > 0) {
6535
- if (vertexSourceOrShaderPassesOrSubShaders[0].constructor === ShaderPass) {
6453
+ if (vertexSourceOrShaderPassesOrSubShadersOrPlatformTarget.length > 0) {
6454
+ if (vertexSourceOrShaderPassesOrSubShadersOrPlatformTarget[0].constructor === ShaderPass) {
6536
6455
  shader = new Shader(nameOrShaderSource, [
6537
- new SubShader("Default", vertexSourceOrShaderPassesOrSubShaders)
6456
+ new SubShader("Default", vertexSourceOrShaderPassesOrSubShadersOrPlatformTarget)
6538
6457
  ]);
6539
6458
  } else {
6540
- shader = new Shader(nameOrShaderSource, vertexSourceOrShaderPassesOrSubShaders.slice());
6459
+ shader = new Shader(nameOrShaderSource, vertexSourceOrShaderPassesOrSubShadersOrPlatformTarget.slice());
6541
6460
  }
6542
6461
  } else {
6543
6462
  throw "SubShader or ShaderPass count must large than 0.";
@@ -9469,6 +9388,7 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
9469
9388
  var shaderData = _this.shaderData;
9470
9389
  shaderData.setFloat(BaseMaterial._alphaCutoffProp, 0);
9471
9390
  shaderData.setFloat(BaseMaterial._shadowCasterRenderQueueProp, RenderQueueType.Opaque);
9391
+ shaderData.setFloat(BaseMaterial._depthOnlyRenderQueueProp, RenderQueueType.Opaque);
9472
9392
  return _this;
9473
9393
  }
9474
9394
  var _proto = BaseMaterial.prototype;
@@ -9561,44 +9481,48 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
9561
9481
  };
9562
9482
  _proto._seIsTransparent = function _seIsTransparent(value) {
9563
9483
  if (value !== this._isTransparent) {
9484
+ // Forward pass
9564
9485
  this.setIsTransparent(0, value);
9486
+ // Shadow caster pass and depth only pass
9565
9487
  var shaderData = this.shaderData;
9566
9488
  if (value) {
9567
- // Use alpha test queue to simulate transparent shadow
9489
+ // Shadow caster render queue, use alpha test queue to simulate transparent shadow
9568
9490
  shaderData.setFloat(BaseMaterial._shadowCasterRenderQueueProp, RenderQueueType.AlphaTest);
9491
+ // Depth only render queue
9492
+ shaderData.setFloat(BaseMaterial._depthOnlyRenderQueueProp, RenderQueueType.Transparent);
9569
9493
  } else {
9570
9494
  var alphaCutoff = shaderData.getFloat(BaseMaterial._alphaCutoffProp);
9571
- if (alphaCutoff) {
9572
- shaderData.setFloat(BaseMaterial._shadowCasterRenderQueueProp, RenderQueueType.AlphaTest);
9573
- } else {
9574
- shaderData.setFloat(BaseMaterial._shadowCasterRenderQueueProp, RenderQueueType.Opaque);
9575
- }
9495
+ var renderQueueType = alphaCutoff ? RenderQueueType.AlphaTest : RenderQueueType.Opaque;
9496
+ // Shadow caster render queue
9497
+ shaderData.setFloat(BaseMaterial._shadowCasterRenderQueueProp, renderQueueType);
9498
+ // Depth only render queue
9499
+ shaderData.setFloat(BaseMaterial._depthOnlyRenderQueueProp, renderQueueType);
9576
9500
  }
9577
9501
  this._isTransparent = value;
9578
9502
  }
9579
9503
  };
9580
9504
  _proto._setAlphaCutoff = function _setAlphaCutoff(value) {
9581
- var shaderData = this.shaderData;
9505
+ var _this = this, shaderData = _this.shaderData, isTransparent = _this._isTransparent;
9582
9506
  if (shaderData.getFloat(BaseMaterial._alphaCutoffProp) !== value) {
9583
9507
  if (value) {
9584
9508
  shaderData.enableMacro(BaseMaterial._alphaCutoffMacro);
9509
+ // Forward render queue
9510
+ var forwardQueue = isTransparent ? RenderQueueType.Transparent : RenderQueueType.AlphaTest;
9511
+ this.renderStates[0].renderQueueType = forwardQueue;
9512
+ // Shadow caster render queue
9585
9513
  shaderData.setFloat(BaseMaterial._shadowCasterRenderQueueProp, RenderQueueType.AlphaTest);
9514
+ // Depth only render queue
9515
+ shaderData.setFloat(BaseMaterial._depthOnlyRenderQueueProp, forwardQueue);
9586
9516
  } else {
9587
9517
  shaderData.disableMacro(BaseMaterial._alphaCutoffMacro);
9588
- if (this._isTransparent) {
9589
- shaderData.setFloat(BaseMaterial._shadowCasterRenderQueueProp, RenderQueueType.AlphaTest);
9590
- } else {
9591
- shaderData.setFloat(BaseMaterial._shadowCasterRenderQueueProp, RenderQueueType.Opaque);
9592
- }
9593
- }
9594
- var renderStates = this.renderStates;
9595
- for(var i = 0, n = renderStates.length; i < n; i++){
9596
- var renderState = renderStates[i];
9597
- if (value > 0) {
9598
- renderState.renderQueueType = renderState.blendState.targetBlendState.enabled ? RenderQueueType.Transparent : RenderQueueType.AlphaTest;
9599
- } else {
9600
- renderState.renderQueueType = renderState.blendState.targetBlendState.enabled ? RenderQueueType.Transparent : RenderQueueType.Opaque;
9601
- }
9518
+ // Forward render queue
9519
+ var forwardQueue1 = isTransparent ? RenderQueueType.Transparent : RenderQueueType.Opaque;
9520
+ this.renderStates[0].renderQueueType = forwardQueue1;
9521
+ // Shadow caster render queue
9522
+ var shadowCasterQueue = isTransparent ? RenderQueueType.AlphaTest : RenderQueueType.Opaque;
9523
+ shaderData.setFloat(BaseMaterial._shadowCasterRenderQueueProp, shadowCasterQueue);
9524
+ // Depth only render queue
9525
+ shaderData.setFloat(BaseMaterial._depthOnlyRenderQueueProp, forwardQueue1);
9602
9526
  }
9603
9527
  shaderData.setFloat(BaseMaterial._alphaCutoffProp, value);
9604
9528
  }
@@ -9694,6 +9618,7 @@ var BaseMaterial = /*#__PURE__*/ function(Material) {
9694
9618
  return BaseMaterial;
9695
9619
  }(Material);
9696
9620
  /** @internal */ BaseMaterial._shadowCasterRenderQueueProp = ShaderProperty.getByName("material_ShadowCasterRenderQueue");
9621
+ /** @internal */ BaseMaterial._depthOnlyRenderQueueProp = ShaderProperty.getByName("material_DepthOnlyRenderQueue");
9697
9622
  BaseMaterial._baseTextureMacro = ShaderMacro.getByName("MATERIAL_HAS_BASETEXTURE");
9698
9623
  BaseMaterial._normalTextureMacro = ShaderMacro.getByName("MATERIAL_HAS_NORMALTEXTURE");
9699
9624
  BaseMaterial._emissiveTextureMacro = ShaderMacro.getByName("MATERIAL_HAS_EMISSIVETEXTURE");
@@ -12628,65 +12553,91 @@ __decorate([
12628
12553
  }
12629
12554
  return result;
12630
12555
  };
12631
- /**
12632
- * Casts a box through the Scene and returns true if there is any hit.
12633
- * @param center - The center of the box
12634
- * @param halfExtents - Half the size of the box in each dimension
12635
- * @param direction - The direction to sweep along
12636
- * @param orientation - The rotation of the box. @defaultValue `Quaternion(0, 0, 0, 1)`
12637
- * @param distance - The max distance to sweep. @defaultValue `Number.MAX_VALUE`
12638
- * @param layerMask - Layer mask that is used to selectively ignore Colliders when sweeping. @defaultValue `Layer.Everything`
12639
- * @param outHitResult - Optional HitResult object to store detailed hit information
12640
- * @returns Returns true if the box intersects with any collider, otherwise false
12641
- */ _proto.boxCast = function boxCast(center, halfExtents, direction, orientation, distance, layerMask, outHitResult) {
12642
- if (orientation === void 0) orientation = PhysicsScene._identityQuaternion;
12643
- if (distance === void 0) distance = Number.MAX_VALUE;
12644
- if (layerMask === void 0) layerMask = Layer.Everything;
12556
+ _proto.boxCast = function boxCast(center, halfExtents, direction, orientationOrDistanceOrResult, distanceOrResult, layerMaskOrResult, outHitResult) {
12557
+ var hitResult;
12558
+ var orientation = PhysicsScene._identityQuaternion;
12559
+ var distance = Number.MAX_VALUE;
12560
+ var layerMask = Layer.Everything;
12561
+ // Parse parameters based on new overload patterns
12562
+ if (typeof orientationOrDistanceOrResult === "number") {
12563
+ distance = orientationOrDistanceOrResult;
12564
+ if ((distanceOrResult == null ? void 0 : distanceOrResult.constructor) === HitResult) {
12565
+ hitResult = distanceOrResult;
12566
+ }
12567
+ } else if ((orientationOrDistanceOrResult == null ? void 0 : orientationOrDistanceOrResult.constructor) === HitResult) {
12568
+ hitResult = orientationOrDistanceOrResult;
12569
+ } else if ((orientationOrDistanceOrResult == null ? void 0 : orientationOrDistanceOrResult.constructor) === Quaternion) {
12570
+ orientation = orientationOrDistanceOrResult;
12571
+ if (typeof distanceOrResult === "number") {
12572
+ distance = distanceOrResult;
12573
+ if (typeof layerMaskOrResult === "number") {
12574
+ layerMask = layerMaskOrResult;
12575
+ }
12576
+ }
12577
+ }
12578
+ if (outHitResult) {
12579
+ hitResult = outHitResult;
12580
+ }
12645
12581
  var preFilter = this._createPreFilter(layerMask);
12646
- var result = this._nativePhysicsScene.boxCast(center, orientation, halfExtents, direction, distance, preFilter, outHitResult ? this._createHitCallback(outHitResult) : undefined);
12647
- if (!result && outHitResult) {
12648
- this._clearHitResult(outHitResult);
12582
+ var result = this._nativePhysicsScene.boxCast(center, orientation, halfExtents, direction, distance, preFilter, hitResult ? this._createHitCallback(hitResult) : undefined);
12583
+ if (!result && hitResult) {
12584
+ this._clearHitResult(hitResult);
12649
12585
  }
12650
12586
  return result;
12651
12587
  };
12652
- /**
12653
- * Casts a sphere through the Scene and returns true if there is any hit.
12654
- * @param center - The center of the sphere
12655
- * @param radius - The radius of the sphere
12656
- * @param direction - The direction to sweep along
12657
- * @param distance - The max distance to sweep. @defaultValue `Number.MAX_VALUE`
12658
- * @param layerMask - Layer mask that is used to selectively ignore Colliders when sweeping. @defaultValue `Layer.Everything`
12659
- * @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
12660
- * @returns Returns True if the sphere intersects with any collider, otherwise false
12661
- */ _proto.sphereCast = function sphereCast(center, radius, direction, distance, layerMask, outHitResult) {
12662
- if (distance === void 0) distance = Number.MAX_VALUE;
12663
- if (layerMask === void 0) layerMask = Layer.Everything;
12588
+ _proto.sphereCast = function sphereCast(center, radius, direction, distanceOrResult, layerMaskOrResult, outHitResult) {
12589
+ var hitResult;
12590
+ var distance = Number.MAX_VALUE;
12591
+ var layerMask = Layer.Everything;
12592
+ // Parse parameters based on new overload patterns
12593
+ if (typeof distanceOrResult === "number") {
12594
+ distance = distanceOrResult;
12595
+ if ((layerMaskOrResult == null ? void 0 : layerMaskOrResult.constructor) === HitResult) {
12596
+ hitResult = layerMaskOrResult;
12597
+ } else if (typeof layerMaskOrResult === "number") {
12598
+ layerMask = layerMaskOrResult;
12599
+ }
12600
+ } else if ((distanceOrResult == null ? void 0 : distanceOrResult.constructor) === HitResult) {
12601
+ hitResult = distanceOrResult;
12602
+ }
12603
+ if (outHitResult) {
12604
+ hitResult = outHitResult;
12605
+ }
12664
12606
  var preFilter = this._createPreFilter(layerMask);
12665
- var result = this._nativePhysicsScene.sphereCast(center, radius, direction, distance, preFilter, outHitResult ? this._createHitCallback(outHitResult) : undefined);
12666
- if (!result && outHitResult) {
12667
- this._clearHitResult(outHitResult);
12607
+ var result = this._nativePhysicsScene.sphereCast(center, radius, direction, distance, preFilter, hitResult ? this._createHitCallback(hitResult) : undefined);
12608
+ if (!result && hitResult) {
12609
+ this._clearHitResult(hitResult);
12668
12610
  }
12669
12611
  return result;
12670
12612
  };
12671
- /**
12672
- * Casts a capsule through the Scene and returns true if there is any hit.
12673
- * @param center - The center of the capsule
12674
- * @param radius - The radius of the capsule
12675
- * @param height - The height of the capsule
12676
- * @param direction - The direction to sweep along
12677
- * @param orientation - The rotation of the capsule. @defaultValue `Quaternion(0, 0, 0, 1)`
12678
- * @param distance - The max distance to sweep. @defaultValue `Number.MAX_VALUE`
12679
- * @param layerMask - Layer mask that is used to selectively ignore Colliders when sweeping. @defaultValue `Layer.Everything`
12680
- * @param outHitResult - If true is returned, outHitResult will contain more detailed collision information
12681
- * @returns Returns True if the capsule intersects with any collider, otherwise false
12682
- */ _proto.capsuleCast = function capsuleCast(center, radius, height, direction, orientation, distance, layerMask, outHitResult) {
12683
- if (orientation === void 0) orientation = PhysicsScene._identityQuaternion;
12684
- if (distance === void 0) distance = Number.MAX_VALUE;
12685
- if (layerMask === void 0) layerMask = Layer.Everything;
12613
+ _proto.capsuleCast = function capsuleCast(center, radius, height, direction, orientationOrDistanceOrResult, distanceOrResult, layerMaskOrResult, outHitResult) {
12614
+ var hitResult;
12615
+ var orientation = PhysicsScene._identityQuaternion;
12616
+ var distance = Number.MAX_VALUE;
12617
+ var layerMask = Layer.Everything;
12618
+ if (typeof orientationOrDistanceOrResult === "number") {
12619
+ distance = orientationOrDistanceOrResult;
12620
+ if ((distanceOrResult == null ? void 0 : distanceOrResult.constructor) === HitResult) {
12621
+ hitResult = distanceOrResult;
12622
+ }
12623
+ } else if ((orientationOrDistanceOrResult == null ? void 0 : orientationOrDistanceOrResult.constructor) === HitResult) {
12624
+ hitResult = orientationOrDistanceOrResult;
12625
+ } else if ((orientationOrDistanceOrResult == null ? void 0 : orientationOrDistanceOrResult.constructor) === Quaternion) {
12626
+ orientation = orientationOrDistanceOrResult;
12627
+ if (typeof distanceOrResult === "number") {
12628
+ distance = distanceOrResult;
12629
+ if (typeof layerMaskOrResult === "number") {
12630
+ layerMask = layerMaskOrResult;
12631
+ }
12632
+ }
12633
+ }
12634
+ if (outHitResult) {
12635
+ hitResult = outHitResult;
12636
+ }
12686
12637
  var preFilter = this._createPreFilter(layerMask);
12687
- var result = this._nativePhysicsScene.capsuleCast(center, radius, height, orientation, direction, distance, preFilter, outHitResult ? this._createHitCallback(outHitResult) : undefined);
12688
- if (!result && outHitResult) {
12689
- this._clearHitResult(outHitResult);
12638
+ var result = this._nativePhysicsScene.capsuleCast(center, radius, height, orientation, direction, distance, preFilter, hitResult ? this._createHitCallback(hitResult) : undefined);
12639
+ if (!result && hitResult) {
12640
+ this._clearHitResult(hitResult);
12690
12641
  }
12691
12642
  return result;
12692
12643
  };
@@ -25789,9 +25740,9 @@ ParticleBufferUtils.boundsFloatStride = 8;
25789
25740
  ParticleBufferUtils.boundsTimeOffset = 6;
25790
25741
  ParticleBufferUtils.boundsMaxLifetimeOffset = 7;
25791
25742
 
25792
- var blitFs = "#include <common>\n\nuniform mediump sampler2D renderer_BlitTexture;\n#ifdef HAS_TEX_LOD\n\tuniform float renderer_BlitMipLevel;\n#endif\n\nuniform vec4 renderer_SourceScaleOffset;\n\nvarying vec2 v_uv;\n\nvoid main() {\n\tvec2 uv = v_uv;\n\tuv = uv * renderer_SourceScaleOffset.xy + renderer_SourceScaleOffset.zw;\n\n\t#ifdef HAS_TEX_LOD\n\t\tgl_FragColor = texture2DLodSRGB( renderer_BlitTexture, uv, renderer_BlitMipLevel );\n\t#else\n\t\tgl_FragColor = texture2DSRGB( renderer_BlitTexture, uv );\n\t#endif\n}\n\n"; // eslint-disable-line
25743
+ var blitFs = "#include <common>\n\nuniform mediump sampler2D renderer_BlitTexture;\n#ifdef HAS_TEX_LOD\n\tuniform float renderer_BlitMipLevel;\n#endif\n\nuniform vec4 renderer_SourceScaleOffset;\n\nvarying vec2 v_uv;\n\n#ifdef HAS_TEX_LOD\n\tvec4 texture2DLodSRGB(sampler2D tex, vec2 uv, float lod) {\n\t\tvec4 color = texture2DLodEXT(tex, uv, lod);\n\t\t#ifdef ENGINE_NO_SRGB\n\t\t\tcolor = sRGBToLinear(color);\n\t\t#endif\n\t\treturn color;\n\t}\n#endif\n\nvoid main() {\n\tvec2 uv = v_uv;\n\tuv = uv * renderer_SourceScaleOffset.xy + renderer_SourceScaleOffset.zw;\n\n\t#ifdef HAS_TEX_LOD\n\t\tgl_FragColor = texture2DLodSRGB( renderer_BlitTexture, uv, renderer_BlitMipLevel );\n\t#else\n\t\tgl_FragColor = texture2DSRGB( renderer_BlitTexture, uv );\n\t#endif\n}\n\n"; // eslint-disable-line
25793
25744
 
25794
- var blitScreenFs = "#include <common>\n\nuniform mediump sampler2D renderer_BlitTexture;\n#ifdef HAS_TEX_LOD\n\tuniform float renderer_BlitMipLevel;\n#endif\n\nvarying vec2 v_uv;\n\nvoid main() {\n\tvec2 uv = v_uv;\n\t// Screen uv is flipped\n\tuv.y = 1.0 - uv.y;\n\n\t#ifdef HAS_TEX_LOD\n\t\tgl_FragColor = texture2DLodSRGB( renderer_BlitTexture, uv, renderer_BlitMipLevel );\n\t#else\n\t\tgl_FragColor = texture2D( renderer_BlitTexture, uv );\n\t#endif\n\n\t// Color space in screen is in gamma space but without sRGB texture, so we need to convert it to linear space manually\n\tgl_FragColor = sRGBToLinear(gl_FragColor);\n}\n\n"; // eslint-disable-line
25745
+ var blitScreenFs = "#include <common>\n\nuniform mediump sampler2D renderer_BlitTexture;\n#ifdef HAS_TEX_LOD\n\tuniform float renderer_BlitMipLevel;\n#endif\n\nvarying vec2 v_uv;\n\n#ifdef HAS_TEX_LOD\n\tvec4 texture2DLodSRGB(sampler2D tex, vec2 uv, float lod) {\n\t\tvec4 color = texture2DLodEXT(tex, uv, lod);\n\t\t#ifdef ENGINE_NO_SRGB\n\t\t\tcolor = sRGBToLinear(color);\n\t\t#endif\n\t\treturn color;\n\t}\n#endif\n\nvoid main() {\n\tvec2 uv = v_uv;\n\t// Screen uv is flipped\n\tuv.y = 1.0 - uv.y;\n\n\t#ifdef HAS_TEX_LOD\n\t\tgl_FragColor = texture2DLodSRGB( renderer_BlitTexture, uv, renderer_BlitMipLevel );\n\t#else\n\t\tgl_FragColor = texture2D( renderer_BlitTexture, uv );\n\t#endif\n\n\t// Color space in screen is in gamma space but without sRGB texture, so we need to convert it to linear space manually\n\tgl_FragColor = sRGBToLinear(gl_FragColor);\n}\n\n"; // eslint-disable-line
25795
25746
 
25796
25747
  var skyProceduralFs = "// This code uses the Unity skybox-Procedural shader algorithm, developed by Unity and licensed under the Unity Companion License. \n// The original implementation can be found at unity build-in shader(DefaultResourcesExtra/Skybox-Procedural.shader)\n\n#include <common>\n\nconst float MIE_G = -0.990;\nconst float MIE_G2 = 0.9801;\nconst float SKY_GROUND_THRESHOLD = 0.02;\n\nuniform float material_SunSize;\nuniform float material_SunSizeConvergence;\nuniform vec4 scene_SunlightColor;\nuniform vec3 scene_SunlightDirection;\n\nvarying vec3 v_GroundColor;\nvarying vec3 v_SkyColor;\n\n#ifdef MATERIAL_SUN_HIGH_QUALITY\n\tvarying vec3 v_Vertex;\n#elif defined(MATERIAL_SUN_SIMPLE)\n\tvarying vec3 v_RayDir;\n#else\n\tvarying float v_SkyGroundFactor;\n#endif\n\n#if defined(MATERIAL_SUN_HIGH_QUALITY)||defined(MATERIAL_SUN_SIMPLE)\n\tvarying vec3 v_SunColor;\n#endif\n\n// Calculates the Mie phase function\nfloat getMiePhase(float eyeCos, float eyeCos2) {\n\tfloat temp = 1.0 + MIE_G2 - 2.0 * MIE_G * eyeCos;\n\ttemp = pow(temp, pow(material_SunSize,0.65) * 10.0);\n\ttemp = max(temp,1.0e-4); // prevent division by zero, esp. in half precision\n\ttemp = 1.5 * ((1.0 - MIE_G2) / (2.0 + MIE_G2)) * (1.0 + eyeCos2) / temp;\n\treturn temp;\n}\n\n// Calculates the sun shape\nfloat calcSunAttenuation(vec3 lightPos, vec3 ray) {\n\t#ifdef MATERIAL_SUN_HIGH_QUALITY\n\t\tfloat focusedEyeCos = pow(clamp(dot(lightPos, ray),0.0,1.0), material_SunSizeConvergence);\n\t\treturn getMiePhase(-focusedEyeCos, focusedEyeCos * focusedEyeCos);\n\t#else //MATERIAL_SUN_SIMPLE\n\t\tvec3 delta = lightPos - ray;\n\t\tfloat dist = length(delta);\n\t\tfloat spot = 1.0 - smoothstep(0.0, material_SunSize, dist);\n\t\treturn spot * spot;\n\t#endif\n}\n\nvoid main() {\n\t// if y > 1 [eyeRay.y < -SKY_GROUND_THRESHOLD] - ground\n\t// if y >= 0 and < 1 [eyeRay.y <= 0 and > -SKY_GROUND_THRESHOLD] - horizon\n\t// if y < 0 [eyeRay.y > 0] - sky\n\tvec3 col = vec3(0.0, 0.0, 0.0);\n\n\t#ifdef MATERIAL_SUN_HIGH_QUALITY\n\t\tvec3 ray = normalize(v_Vertex);\n\t\tfloat y = ray.y / SKY_GROUND_THRESHOLD;\n\t#elif defined(MATERIAL_SUN_SIMPLE) \n\t\tvec3 ray = v_RayDir;\n\t\tfloat y = ray.y / SKY_GROUND_THRESHOLD;\t\n\t#else\n\t\tfloat y = v_SkyGroundFactor;\n\t#endif\n\n\t// if we did precalculate color in vprog: just do lerp between them\n\tcol = mix(v_SkyColor, v_GroundColor, clamp(y,0.0,1.0));\n\n\t#if defined(MATERIAL_SUN_HIGH_QUALITY)||defined(MATERIAL_SUN_SIMPLE)\n\t\tif (y < 0.0)\n\t\t\tcol += v_SunColor * calcSunAttenuation(-scene_SunlightDirection, -ray);\n\t#endif\n\n\n\tgl_FragColor = vec4(col, 1.0);\n}\n\n"; // eslint-disable-line
25797
25748
 
@@ -25857,6 +25808,8 @@ var unlitVs = "#include <common>\n#include <common_vert>\n#include <blendShape_i
25857
25808
  var depthOnlyPass = new ShaderPass("DepthOnly", depthOnlyVs, depthOnlyFs, {
25858
25809
  pipelineStage: PipelineStage.DepthOnly
25859
25810
  });
25811
+ depthOnlyPass._renderState = new RenderState();
25812
+ depthOnlyPass._renderStateDataMap[RenderStateElementKey.RenderQueueType] = BaseMaterial._depthOnlyRenderQueueProp;
25860
25813
  var basePasses = [
25861
25814
  shadowCasterPass,
25862
25815
  depthOnlyPass
@@ -28259,6 +28212,45 @@ Scene._fogColorProperty = ShaderProperty.getByName("scene_FogColor");
28259
28212
  Scene._fogParamsProperty = ShaderProperty.getByName("scene_FogParams");
28260
28213
  Scene._prefilterdDFGProperty = ShaderProperty.getByName("scene_PrefilteredDFG");
28261
28214
 
28215
+ function _array_like_to_array(arr, len) {
28216
+ if (len == null || len > arr.length) len = arr.length;
28217
+
28218
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
28219
+
28220
+ return arr2;
28221
+ }
28222
+
28223
+ function _unsupported_iterable_to_array(o, minLen) {
28224
+ if (!o) return;
28225
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
28226
+
28227
+ var n = Object.prototype.toString.call(o).slice(8, -1);
28228
+
28229
+ if (n === "Object" && o.constructor) n = o.constructor.name;
28230
+ if (n === "Map" || n === "Set") return Array.from(n);
28231
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
28232
+ }
28233
+
28234
+ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
28235
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
28236
+
28237
+ if (it) return (it = it.call(o)).next.bind(it);
28238
+ // Fallback for engines without symbol support
28239
+ if (Array.isArray(o) || (it = _unsupported_iterable_to_array(o)) || allowArrayLike && o && typeof o.length === "number") {
28240
+ if (it) o = it;
28241
+
28242
+ var i = 0;
28243
+
28244
+ return function() {
28245
+ if (i >= o.length) return { done: true };
28246
+
28247
+ return { done: false, value: o[i++] };
28248
+ };
28249
+ }
28250
+
28251
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
28252
+ }
28253
+
28262
28254
  /**
28263
28255
  * Script class, used for logic writing.
28264
28256
  */ var Script = /*#__PURE__*/ function(Component) {
@@ -37243,5 +37235,5 @@ __decorate([
37243
37235
 
37244
37236
  Polyfill.registerPolyfill();
37245
37237
 
37246
- export { AmbientLight, AmbientOcclusion, AmbientOcclusionQuality, AnimationArrayCurve, AnimationBoolCurve, AnimationClip, AnimationClipCurveBinding, AnimationColorCurve, AnimationCurve, AnimationEvent, AnimationFloatArrayCurve, AnimationFloatCurve, AnimationQuaternionCurve, AnimationRectCurve, AnimationRefCurve, AnimationStringCurve, AnimationVector2Curve, AnimationVector3Curve, AnimationVector4Curve, Animator, AnimatorCondition, AnimatorConditionMode, AnimatorController, AnimatorControllerLayer, AnimatorControllerParameter, AnimatorCullingMode, AnimatorLayerBlendingMode, AnimatorLayerMask, AnimatorState, AnimatorStateMachine, AnimatorStateTransition, AntiAliasing, AssetPromise, AssetType, AudioClip, AudioManager, AudioSource, Background, BackgroundMode, BackgroundTextureFillMode, BaseMaterial, BasicRenderPipeline, BatchUtils, BlendFactor, BlendMode, BlendOperation, BlendShape, BlendShapeFrame, BlendState, BlinnPhongMaterial, Blitter, BloomDownScaleMode, BloomEffect, BoolUpdateFlag, BoxColliderShape, BoxShape, Buffer, BufferBindFlag, BufferMesh, BufferUsage, BufferUtil, Burst, Camera, CameraClearFlags, CameraModifyFlags, CameraType, Canvas, CapsuleColliderShape, CharRenderInfo, CharacterController, CircleShape, ClearableObjectPool, CloneManager, Collider, ColliderShape, ColliderShapeUpAxis, Collision, CollisionDetectionMode, ColorOverLifetimeModule, ColorWriteMask, CompareFunction, Component, ConeEmitType, ConeShape, ContactPoint, ContentRestorer, ControllerCollisionFlag, ControllerNonWalkableMode, CubeProbe, CullMode, CurveKey, DataType, DependentMode, DepthState, DepthTextureMode, DiffuseMode, DirectLight, DisorderedArray, Downsampling, DynamicCollider, DynamicColliderConstraints, EmissionModule, Engine, EngineObject, Entity, EntityModifyFlags, EventDispatcher, FinalPass, FixedJoint, FogMode, Font, FontStyle, GLCapabilityType, GradientAlphaKey, GradientColorKey, HemisphereShape, HingeJoint, HitResult, IndexBufferBinding, IndexFormat, InputManager, InterpolationType, Joint, JointLimits, JointMotor, Keyframe, Keys, Layer, LayerPathMask, Light, Loader, Logger, MSAASamples, MainModule, Material, Mesh, MeshRenderer, MeshShape, MeshTopology, ModelMesh, OverflowMode, PBRMaterial, ParticleCompositeCurve, ParticleCompositeGradient, ParticleCurve, ParticleCurveMode, ParticleGenerator, ParticleGradient, ParticleGradientMode, ParticleMaterial, ParticleRenderMode, ParticleRenderer, ParticleScaleMode, ParticleShapeArcMode, ParticleShapeType, ParticleSimulationSpace, ParticleStopMode, PhysicsMaterial, PhysicsMaterialCombineMode, PhysicsScene, PipelineStage, PlaneColliderShape, Platform, PointLight, Pointer, PointerButton, PointerEventData, PointerEventEmitter, PointerPhase, PostProcess, PostProcessEffect, PostProcessEffectBoolParameter, PostProcessEffectColorParameter, PostProcessEffectEnumParameter, PostProcessEffectFloatParameter, PostProcessEffectParameter, PostProcessEffectTextureParameter, PostProcessEffectVector2Parameter, PostProcessEffectVector3Parameter, PostProcessEffectVector4Parameter, PostProcessManager, PostProcessPass, PostProcessPassEvent, PostProcessUberPass, Primitive, PrimitiveMesh, Probe, RasterState, ReferResource, RefractionMode, RenderBufferDepthFormat, RenderFace, RenderQueue, RenderQueueFlags, RenderQueueType, RenderState, RenderStateElementKey as RenderStateDataKey, RenderTarget, RenderTargetBlendState, Renderer, RendererUpdateFlags, ReplacementFailureStrategy, ResourceManager, ReturnableObjectPool, RotationOverLifetimeModule, SafeLoopArray, Scene, SceneManager, Script, SetDataOptions, Shader, ShaderData, ShaderDataGroup, ShaderFactory, ShaderLib, ShaderMacro, ShaderMacroCollection, ShaderPass, ShaderPlatformTarget, ShaderProperty, ShaderPropertyType, ShaderTagKey, ShadowCascadesMode, ShadowResolution, ShadowType, SimpleSpriteAssembler, SizeOverLifetimeModule, Skin, SkinnedMeshRenderer, Sky, SkyBoxMaterial, SkyProceduralMaterial, SlicedSpriteAssembler, SphereColliderShape, SphereShape, SpotLight, SpringJoint, Sprite, SpriteAtlas, SpriteDrawMode, SpriteMask, SpriteMaskInteraction, SpriteMaskLayer, SpriteModifyFlags, SpriteRenderer, SpriteTileMode, StateMachineScript, StaticCollider, StencilOperation, StencilState, SubFont, SubMesh, SubPrimitive, SubShader, SunMode, SystemInfo, TextHorizontalAlignment, TextRenderer, TextUtils, TextVerticalAlignment, Texture, Texture2D, Texture2DArray, TextureCoordinate, TextureCube, TextureCubeFace, TextureDepthCompareFunction, TextureFilterMode, TextureFormat, TextureSheetAnimationModule, TextureUsage, TextureUtils, TextureWrapMode, TiledSpriteAssembler, Time, TonemappingEffect, TonemappingMode, TrailMaterial, TrailRenderer, Transform, TransformModifyFlags, UnlitMaterial, Utils, VelocityOverLifetimeModule, VertexAttribute, VertexBufferBinding, VertexElement, VertexElementFormat, WrapMode, XRManager, assignmentClone, deepClone, dependentComponents, ignoreClone, registerPointerEventEmitter, request, resourceLoader, shallowClone };
37238
+ export { AmbientLight, AmbientOcclusion, AmbientOcclusionQuality, AnimationArrayCurve, AnimationBoolCurve, AnimationClip, AnimationClipCurveBinding, AnimationColorCurve, AnimationCurve, AnimationEvent, AnimationFloatArrayCurve, AnimationFloatCurve, AnimationQuaternionCurve, AnimationRectCurve, AnimationRefCurve, AnimationStringCurve, AnimationVector2Curve, AnimationVector3Curve, AnimationVector4Curve, Animator, AnimatorCondition, AnimatorConditionMode, AnimatorController, AnimatorControllerLayer, AnimatorControllerParameter, AnimatorCullingMode, AnimatorLayerBlendingMode, AnimatorLayerMask, AnimatorState, AnimatorStateMachine, AnimatorStateTransition, AntiAliasing, AssetPromise, AssetType, AudioClip, AudioManager, AudioSource, Background, BackgroundMode, BackgroundTextureFillMode, BaseMaterial, BasicRenderPipeline, BatchUtils, BlendFactor, BlendMode, BlendOperation, BlendShape, BlendShapeFrame, BlendState, BlinnPhongMaterial, Blitter, BloomDownScaleMode, BloomEffect, BoolUpdateFlag, BoxColliderShape, BoxShape, Buffer, BufferBindFlag, BufferMesh, BufferUsage, BufferUtil, Burst, Camera, CameraClearFlags, CameraModifyFlags, CameraType, Canvas, CapsuleColliderShape, CharRenderInfo, CharacterController, CircleShape, ClearableObjectPool, CloneManager, Collider, ColliderShape, ColliderShapeUpAxis, Collision, CollisionDetectionMode, ColorOverLifetimeModule, ColorWriteMask, CompareFunction, Component, ConeEmitType, ConeShape, ContactPoint, ContentRestorer, ControllerCollisionFlag, ControllerNonWalkableMode, CubeProbe, CullMode, CurveKey, DataType, DependentMode, DepthState, DepthTextureMode, DiffuseMode, DirectLight, DisorderedArray, Downsampling, DynamicCollider, DynamicColliderConstraints, EmissionModule, Engine, EngineObject, Entity, EntityModifyFlags, EventDispatcher, FinalPass, FixedJoint, FogMode, Font, FontStyle, GLCapabilityType, GradientAlphaKey, GradientColorKey, HemisphereShape, HingeJoint, HitResult, IndexBufferBinding, IndexFormat, InputManager, InterpolationType, Joint, JointLimits, JointMotor, Keyframe, Keys, Layer, LayerPathMask, Light, Loader, Logger, MSAASamples, MainModule, Material, Mesh, MeshRenderer, MeshShape, MeshTopology, ModelMesh, OverflowMode, PBRMaterial, ParticleCompositeCurve, ParticleCompositeGradient, ParticleCurve, ParticleCurveMode, ParticleGenerator, ParticleGradient, ParticleGradientMode, ParticleMaterial, ParticleRenderMode, ParticleRenderer, ParticleScaleMode, ParticleShapeArcMode, ParticleShapeType, ParticleSimulationSpace, ParticleStopMode, PhysicsMaterial, PhysicsMaterialCombineMode, PhysicsScene, PipelineStage, PlaneColliderShape, Platform, PointLight, Pointer, PointerButton, PointerEventData, PointerEventEmitter, PointerPhase, PostProcess, PostProcessEffect, PostProcessEffectBoolParameter, PostProcessEffectColorParameter, PostProcessEffectEnumParameter, PostProcessEffectFloatParameter, PostProcessEffectParameter, PostProcessEffectTextureParameter, PostProcessEffectVector2Parameter, PostProcessEffectVector3Parameter, PostProcessEffectVector4Parameter, PostProcessManager, PostProcessPass, PostProcessPassEvent, PostProcessUberPass, Primitive, PrimitiveMesh, Probe, RasterState, ReferResource, RefractionMode, RenderBufferDepthFormat, RenderFace, RenderQueue, RenderQueueFlags, RenderQueueType, RenderState, RenderStateElementKey, RenderTarget, RenderTargetBlendState, Renderer, RendererUpdateFlags, ReplacementFailureStrategy, ResourceManager, ReturnableObjectPool, RotationOverLifetimeModule, SafeLoopArray, Scene, SceneManager, Script, SetDataOptions, Shader, ShaderData, ShaderDataGroup, ShaderFactory, ShaderLanguage, ShaderLib, ShaderMacro, ShaderMacroCollection, ShaderPass, ShaderProperty, ShaderPropertyType, ShaderTagKey, ShadowCascadesMode, ShadowResolution, ShadowType, SimpleSpriteAssembler, SizeOverLifetimeModule, Skin, SkinnedMeshRenderer, Sky, SkyBoxMaterial, SkyProceduralMaterial, SlicedSpriteAssembler, SphereColliderShape, SphereShape, SpotLight, SpringJoint, Sprite, SpriteAtlas, SpriteDrawMode, SpriteMask, SpriteMaskInteraction, SpriteMaskLayer, SpriteModifyFlags, SpriteRenderer, SpriteTileMode, StateMachineScript, StaticCollider, StencilOperation, StencilState, SubFont, SubMesh, SubPrimitive, SubShader, SunMode, SystemInfo, TextHorizontalAlignment, TextRenderer, TextUtils, TextVerticalAlignment, Texture, Texture2D, Texture2DArray, TextureCoordinate, TextureCube, TextureCubeFace, TextureDepthCompareFunction, TextureFilterMode, TextureFormat, TextureSheetAnimationModule, TextureUsage, TextureUtils, TextureWrapMode, TiledSpriteAssembler, Time, TonemappingEffect, TonemappingMode, TrailMaterial, TrailRenderer, Transform, TransformModifyFlags, UnlitMaterial, Utils, VelocityOverLifetimeModule, VertexAttribute, VertexBufferBinding, VertexElement, VertexElementFormat, WrapMode, XRManager, assignmentClone, deepClone, dependentComponents, ignoreClone, registerPointerEventEmitter, request, resourceLoader, shallowClone };
37247
37239
  //# sourceMappingURL=module.js.map