From 8061169e850396aacbd483e189fa3f5c51d0d83c Mon Sep 17 00:00:00 2001 From: cx20 Date: Sat, 9 Sep 2023 23:02:44 +0900 Subject: [PATCH] Added physics engine support with Rhodonite --- libs/rhodonite/v0.11.7/esm/index.js | 2 +- libs/rhodonite/v0.11.7/rhodonite.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/rhodonite/v0.11.7/esm/index.js b/libs/rhodonite/v0.11.7/esm/index.js index 515a9ea4..79078ef4 100644 --- a/libs/rhodonite/v0.11.7/esm/index.js +++ b/libs/rhodonite/v0.11.7/esm/index.js @@ -1,2 +1,2 @@ /*! For license information please see index.js.LICENSE.txt */ -var __webpack_modules__={4878:(e,t,n)=>{n.d(t,{Z:()=>r});const r={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec2 v_texcoord_0;\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec3 v_position_inWorld;\n\nuniform int u_envHdriFormat; // initialValue=0\nuniform float u_envRotation; // initialValue=0\nuniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)\nuniform samplerCube u_colorEnvTexture; // initialValue=(0,black)\nuniform bool u_makeOutputSrgb; // initialValue=true\nuniform bool u_inverseEnvironment; // initialValue=true\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\nvoid main() {\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // diffuseColor\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture\n\n // adapt OpenGL (RenderMan) CubeMap convention\n float envRotation = get_envRotation(materialSID, 0);\n float rot = envRotation + 3.1415;\n mat3 rotEnvMatrix = mat3(cos(rot), 0.0, -sin(rot), 0.0, 1.0, 0.0, sin(rot), 0.0, cos(rot));\n vec3 envNormal = normalize(rotEnvMatrix * v_position_inWorld);\n\n if (get_inverseEnvironment(materialSID, 0)) {\n envNormal.x *= -1.0;\n }\n\n vec4 diffuseTexel = texture(u_colorEnvTexture, envNormal);\n vec3 textureColor;\n int EnvHdriFormat = get_envHdriFormat(materialSID, 0);\n if (EnvHdriFormat == 0) { // LDR_SRGB\n textureColor = srgbToLinear(diffuseTexel.rgb);\n } else if (EnvHdriFormat == 3) { // RGBE\n textureColor = diffuseTexel.rgb * pow(2.0, diffuseTexel.a*255.0-128.0);\n } else {\n textureColor = diffuseTexel.rgb;\n }\n diffuseColor *= textureColor;\n\n rt0 = vec4(diffuseColor, alpha);\n\nfloat makeOutputSrgb = float(get_makeOutputSrgb(materialSID, 0));\nrt0.rgb = mix(rt0.rgb, linearToSrgb(rt0.rgb), makeOutputSrgb);\n\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0}},5757:(e,t,n)=>{n.d(t,{Z:()=>r});const r={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\n\nout vec2 v_texcoord_0;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec3 v_position_inWorld;\n\nuniform bool u_enableViewMatrix; // initialValue=true\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n\n if (get_enableViewMatrix(materialSID, 0)) {\n mat4 rotateMatrix = viewMatrix;\n rotateMatrix[3][0] = 0.0;\n rotateMatrix[3][1] = 0.0;\n rotateMatrix[3][2] = 0.0;\n gl_Position = projectionMatrix * rotateMatrix * worldMatrix * vec4(a_position, 1.0);\n } else {\n gl_Position = projectionMatrix * worldMatrix * vec4(a_position, 1.0);\n }\n\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n v_normal_inWorld = normalMatrix * a_normal;\n\n v_color = a_color;\n v_position_inWorld = (worldMatrix * vec4(a_position, 1.0)).xyz;\n v_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1}},3034:e=>{e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./../../dist/",n(n.s="./src/index.ts")}({"./src/index.ts":function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n("./src/main/Shaderity.ts"));t.default=o.default},"./src/main/Reflection.ts":function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(e,t){this.__attributeSemanticsMap=new Map,this.__uniformSemanticsMap=new Map,this.__attributes=[],this.__varyings=[],this.__uniforms=[],this.__splittedShaderCode=e,this.__shaderStage=t,this.__setDefaultAttributeAndUniformSemanticsMap()}get attributes(){return this.__attributes}get varyings(){return this.__varyings}get uniforms(){return this.__uniforms}get attributesNames(){return this.__attributes.map((e=>e.name))}get attributesSemantics(){return this.__attributes.map((e=>e.semantic))}get attributesTypes(){return this.__attributes.map((e=>e.type))}addAttributeSemanticsMap(e){this.__attributeSemanticsMap=new Map([...this.__attributeSemanticsMap,...e])}addUniformSemanticsMap(e){this.__uniformSemanticsMap=new Map([...this.__uniformSemanticsMap,...e])}addAttributeSemantics(e,t){this.__attributeSemanticsMap.set(e,t)}addUniformSemantics(e,t){this.__uniformSemanticsMap.set(e,t)}resetAttributeSemantics(){this.__attributeSemanticsMap=new Map}resetUniformSemantics(){this.__uniformSemanticsMap=new Map}reflect(){const e=this.__splittedShaderCode,t=this.__shaderStage;for(const n of e)this.__matchAttribute(n,t)?this.__addAttribute(n):this.__matchVarying(n,t)?this.__addVarying(n,t):n.match(/^(?![\/])[\t ]*uniform[\t ]+/)&&this.__addUniform(n)}__setDefaultAttributeAndUniformSemanticsMap(){this.__attributeSemanticsMap.set("position","POSITION"),this.__attributeSemanticsMap.set("color$","COLOR_0"),this.__attributeSemanticsMap.set("color_?0","COLOR_0"),this.__attributeSemanticsMap.set("texcoord$","TEXCOORD_0"),this.__attributeSemanticsMap.set("texcoord_?0","TEXCOORD_0"),this.__attributeSemanticsMap.set("texcoord_?1","TEXCOORD_1"),this.__attributeSemanticsMap.set("texcoord_?2","TEXCOORD_2"),this.__attributeSemanticsMap.set("normal","NORMAL"),this.__attributeSemanticsMap.set("tangent","TANGENT"),this.__attributeSemanticsMap.set("joint$","JOINTS_0"),this.__attributeSemanticsMap.set("bone$","JOINTS_0"),this.__attributeSemanticsMap.set("joint_?0","JOINTS_0"),this.__attributeSemanticsMap.set("bone_?0","JOINTS_0"),this.__attributeSemanticsMap.set("weight$","WEIGHTS_0"),this.__attributeSemanticsMap.set("weight_?0","WEIGHTS_0"),this.__uniformSemanticsMap.set("worldmatrix","WorldMatrix"),this.__uniformSemanticsMap.set("normalmatrix","NormalMatrix"),this.__uniformSemanticsMap.set("viewmatrix","ViewMatrix"),this.__uniformSemanticsMap.set("projectionmatrix","ProjectionMatrix"),this.__uniformSemanticsMap.set("modelviewmatrix","ModelViewMatrix")}__matchAttribute(e,t){return"vertex"===t&&e.match(/^(?![\/])[\t ]*(attribute|in)[\t ]+.+;/)}__addAttribute(e){const t={name:"",type:"float",semantic:"UNKNOWN"},n=e.match(r.attributeAndVaryingTypeRegExp);if(n){const o=n[1];t.type=o;const i=n[2];t.name=i;const a=e.match(r.semanticRegExp);if(a)t.semantic=a[1];else for(let[e,n]of this.__attributeSemanticsMap)i.match(new RegExp(e,"i"))&&(t.semantic=n)}this.__attributes.push(t)}__matchVarying(e,t){return"vertex"===t?e.match(/^(?![\/])[\t ]*(varying|out)[\t ]+.+;/):e.match(/^(?![\/])[\t ]*(varying|in)[\t ]+.+;/)}__addVarying(e,t){const n={name:"",type:"float",inout:"in"},o=e.match(r.attributeAndVaryingTypeRegExp);if(o){const e=o[1];n.type=e;const r=o[2];n.name=r,n.inout="vertex"===t?"out":"in"}this.__varyings.push(n)}__addUniform(e){const t={name:"",type:"float",semantic:"UNKNOWN"},n=e.match(r.uniformTypeRegExp);if(n){const o=n[1];t.type=o;const i=n[2];t.name=i;const a=e.match(r.semanticRegExp);if(a)t.semantic=a[1];else for(let[e,n]of this.__uniformSemanticsMap)i.match(new RegExp(e,"i"))&&(t.semantic=n)}this.__uniforms.push(t)}}t.default=r,r.attributeAndVaryingTypeRegExp=/[\t ]+(float|int|vec2|vec3|vec4|mat2|mat3|mat4|ivec2|ivec3|ivec4)[\t ]+(\w+);/,r.uniformTypeRegExp=/[\t ]+(float|int|vec2|vec3|vec4|mat2|mat3|mat4|ivec2|ivec3|ivec4|sampler2D|samplerCube|sampler3D)[\t ]+(\w+);/,r.semanticRegExp=/<.*semantic[\t ]*=[\t ]*(\w+).*>/},"./src/main/ShaderEditor.ts":function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static _insertDefinition(e,t){const n=t.replace(/#define[\t ]+/,"");e.unshift(`#define ${n}`)}static _fillTemplate(e,t){const n=e.replace(/\/\*[\t ]*shaderity:[\t ]*(@{[\t ]*)(\S+)([\t ]*})[\t ]*\*\//g,"${this.$2}");return new Function("return `"+n+"`;").call(t)}}},"./src/main/ShaderTransformer.ts":function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static _transformToGLSLES1(e,t,n){return this.__convertOrInsertVersionGLSLES1(e),this.__removeES3Qualifier(e,n),this.__convertIn(e,t),this.__convertOut(e,t,n),this.__removePrecisionForES3(e),this.__convertTextureFunctionToES1(e,t,n),e}static _transformToGLSLES3(e,t){return this.__convertOrInsertVersionGLSLES3(e),this.__convertAttribute(e,t),this.__convertVarying(e,t),this.__convertTextureCube(e),this.__convertTexture2D(e),this.__convertTexture2DProd(e),this.__convertTexture3D(e),this.__convertTexture3DProd(e),e}static _transformTo(e,t,n,r){return e.match(/webgl2|es3/i)?this._transformToGLSLES3(t,n):e.match(/webgl1|es1/i)?this._transformToGLSLES1(t,n,r):(console.error("Invalid Version"),t)}static __convertOrInsertVersionGLSLES1(e){this.__removeFirstMatchingLine(e,/^(?![\/])[\t ]*#[\t ]*version[\t ]+.*/),e.unshift("#version 100")}static __convertOrInsertVersionGLSLES3(e){this.__removeFirstMatchingLine(e,/^(?![\/])[\t ]*#[\t ]*version[\t ]+.*/),e.unshift("#define GLSL_ES3"),e.unshift("#version 300 es")}static __convertIn(e,t){let n;n=t?function(e,t){return"varying "+t}:function(e,t){return"attribute "+t},this.__replaceLine(e,/^(?![\/])[\t ]*in[\t ]+((highp|mediump|lowp|)[\t ]*\w+[\t ]*\w+[\t ]*;)/,n)}static __convertOut(e,t,n){if(t){const t=this.__removeOutQualifier(e,n);if(null==t)return;this.__addGLFragColor(t,e,n)}else{const t=/^(?![\/])[\t ]*out[\t ]+((highp|mediump|lowp|)[\t ]*\w+[\t ]*\w+[\t ]*;)/,n=function(e,t){return"varying "+t};this.__replaceLine(e,t,n)}}static __removeOutQualifier(e,t){const n=/^(?![\/])[\t ]*out[\t ]+((highp|mediump|lowp|)[\t ]*\w+[\t ]*(\w+)[\t ]*;)/;let r;for(let t=0;t=0;e--){const n=t[e];if(!s&&n.match(r)&&(t[e]=n.replace(r,`$1\n${a}\n}\n`),s=!0),n.match(o)&&t.splice(e,0,a),n.match(i))break}if(!s){const e="__removeOutQualifier: Not found the closing brackets for the main function";this.__outError(t,t.length,e,n)}}static __removeES3Qualifier(e,t){this.__removeVaryingQualifier(e,t),this.__removeLayout(e)}static __removeVaryingQualifier(e,t){const n=/^(?![\/])[\t ]*(flat|smooth)[\t ]*((in|out)[\t ]+.*)/;for(let r=0;r"flat"===o?(this.__outError(e,r+1,"__removeVaryingQualifier: glsl es1 does not support flat qualifier",t),n):i))}static __removeLayout(e){this.__replaceLine(e,/^(?![\/])[\t ]*layout[\t ]*\([\t ]*location[\t ]*\=[\t ]*\d[\t ]*\)[\t ]+/g,"")}static __removePrecisionForES3(e){const t=/^(?![\/])[\t ]*precision[\t ]+(highp|mediump|lowp)[\t ]+(\w+)[\t ]*;/;for(let n=0;n=0;a--){if(!e[a].match(/\{/))continue;const t=null===(r=this.__getBracketSection(e,a).match(/.*\((.*)\)/))||void 0===r?void 0:r[1];if(null==t)return;const s=t.split(","),c=/[\n\t ]*(highp|mediump|lowp|)[\n\t ]*(sampler\w+)[\n\t ]*(\w+)[\n\t ]*/;if(null!==(o=s[0].match(c))&&void 0!==o?o:s[0].match(/^[\n\t ]*$/)){for(const t of s){const r=t.match(c);if(null==r)continue;const o=r[2],s=r[3];if(i.get(s)){const t="__createArgumentSamplerMap: duplicate variable name";this.__outError(e,a,t,n)}i.set(s,o)}break}}return i}static __getBracketSection(e,t){let n=0;for(let r=t;r>=0;r--)if(e[r].match(/\(/)){n=r;break}let r="";for(let o=n;o<=t;o++)r+=e[o];return r}static __convertAttribute(e,t){t||this.__replaceLine(e,/^(?![\/])[\t ]*attribute[\t ]+/g,"in ")}static __convertVarying(e,t){const n=t?"in ":"out ";this.__replaceLine(e,/^(?![\/])[\t ]*varying[\t ]+/g,n)}static __convertTextureCube(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(textureCube)(${t}+)`,"g");this.__replaceLine(e,n,"$1texture$3")}static __convertTexture2D(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture2D)(${t}+)`,"g");this.__replaceLine(e,n,"$1texture$3")}static __convertTexture2DProd(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture2DProj)(${t}+)`,"g");this.__replaceLine(e,n,"$1textureProj$3")}static __convertTexture3D(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture3D)(${t}+)`,"g");this.__replaceLine(e,n,"$1texture$3")}static __convertTexture3DProd(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture3DProj)(${t}+)`,"g");this.__replaceLine(e,n,"$1textureProj$3")}static __regSymbols(){return"[!\"#$%&'()*+-.,/:;<=>?@[\\]^`{|}~\t\n ]"}static __replaceLine(e,t,n){for(let r=0;r=0&&!e[t].match(o);t--)if(e[t]===r)return;console.error(n),e.push(r)}}}},"./src/main/Shaderity.ts":function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n("./src/main/Reflection.ts")),i=r(n("./src/main/ShaderTransformer.ts")),a=r(n("./src/main/ShaderEditor.ts")),s=r(n("./src/main/Utility.ts")),c=r(n("./src/main/ShaderityObjectCreator.ts"));t.default=class{static transformToGLSLES1(e,t=!1){const n=s.default._splitByLineFeedCode(e.code),r=i.default._transformToGLSLES1(n,e.isFragmentShader,t);return{code:s.default._joinSplittedLine(r),shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}static transformToGLSLES3(e){const t=s.default._splitByLineFeedCode(e.code),n=i.default._transformToGLSLES3(t,e.isFragmentShader);return{code:s.default._joinSplittedLine(n),shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}static transformTo(e,t,n=!1){const r=s.default._splitByLineFeedCode(t.code),o=i.default._transformTo(e,r,t.isFragmentShader,n);return{code:s.default._joinSplittedLine(o),shaderStage:t.shaderStage,isFragmentShader:t.isFragmentShader}}static createShaderityObjectCreator(e){return new c.default(e)}static fillTemplate(e,t){const n=this.__copyShaderityObject(e);return n.code=a.default._fillTemplate(n.code,t),n}static insertDefinition(e,t){const n=this.__copyShaderityObject(e),r=s.default._splitByLineFeedCode(e.code);return a.default._insertDefinition(r,t),n.code=s.default._joinSplittedLine(r),n}static createReflectionObject(e){const t=s.default._splitByLineFeedCode(e.code);return new o.default(t,e.shaderStage)}static __copyShaderityObject(e){return{code:e.code,shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}}},"./src/main/ShaderityObjectCreator.ts":function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n("./src/main/Utility.ts"));class i{constructor(e){this.__functionIdCount=0,this.__defineDirectiveNames=[],this.__extensions=[],this.__globalPrecision={int:"highp",float:"highp",sampler2D:"highp",samplerCube:"highp",sampler3D:"highp",sampler2DArray:"highp",isampler2D:"highp",isamplerCube:"highp",isampler3D:"highp",isampler2DArray:"highp",usampler2D:"highp",usamplerCube:"highp",usampler3D:"highp",usampler2DArray:"highp",sampler2DShadow:"highp",samplerCubeShadow:"highp",sampler2DArrayShadow:"highp"},this.__structDefinitions=[],this.__globalConstantValues=[],this.__globalConstantStructValues=[],this.__attributes=[],this.__varyings=[],this.__uniforms=[],this.__uniformStructs=[],this.__uniformBufferObjects=[],this.__functions=[],this.__mainFunctionCode="void main() {}",this.__outputColorVariableName="renderTarget0",this.__shaderStage=e}addDefineDirective(e){this.__defineDirectiveNames.some((t=>t===e))?console.warn("addDefineDirective: this define directive is already set"):this.__defineDirectiveNames.push(e)}addExtension(e,t="enable"){this.__extensions.some((t=>t.extensionName===e))?console.warn("addExtension: this extension is already set"):this.__extensions.push({extensionName:e,behavior:t})}addStructDefinition(e,t){this.__structDefinitions.some((t=>t.structName===e))?console.error(`addStructDefinition: duplicate struct type name ${e}`):this.__structDefinitions.push({structName:e,memberObjects:t})}addGlobalConstantValue(e,t,n){this.__globalConstantValues.some((t=>t.variableName===e))?console.error(`addGlobalConstantValue: duplicate variable name ${e}`):o.default._isValidComponentCount(t,n)?(o.default._isIntType(t)&&i.__existNonIntegerValue(n)&&console.warn(`addGlobalConstantValue: non-integer value is set to ${e}`),this.__globalConstantValues.push({variableName:e,type:t,values:n})):console.error(`addGlobalConstantValue: the component count of ${e} is invalid`)}addGlobalConstantStructValue(e,t,n){this.__globalConstantStructValues.some((e=>e.variableName===t))?console.error(`addGlobalConstantStructValue: duplicate variable name ${t}`):this.__globalConstantStructValues.push({variableName:t,structName:e,values:n})}addAttributeDeclaration(e,t,n){"vertex"===this.__shaderStage?this.__attributes.some((t=>t.variableName===e))?console.error(`addAttribute: duplicate variable name ${e}`):this.__attributes.push({variableName:e,type:t,precision:null==n?void 0:n.precision,location:null==n?void 0:n.location}):console.error("addAttribute: this method is for vertex shader only")}addVaryingDeclaration(e,t,n){if(this.__varyings.some((t=>t.variableName===e)))return void console.error(`addVarying: duplicate variable name ${e}`);const r=o.default._isIntType(t);let i=null==n?void 0:n.interpolationType;if(r&&"flat"!==i){if(null!=i)return void console.error("addVarying: the interpolationType must be flat for integer types");console.warn("addVarying: set the interpolationType of integer types to flat to avoid compilation error"),i="flat"}this.__varyings.push({variableName:e,type:t,precision:null==n?void 0:n.precision,interpolationType:i})}addUniformDeclaration(e,t,n){this.__uniforms.some((t=>t.variableName===e))?console.error(`addUniform: duplicate variable name ${e}`):("bool"===t&&null!=(null==n?void 0:n.precision)&&(console.warn("addUniform: remove the specification of precision for bool type to avoid compilation error"),n.precision=void 0),this.__uniforms.push({variableName:e,type:t,precision:null==n?void 0:n.precision}))}addUniformStructDeclaration(e,t){this.__uniformStructs.some((e=>e.variableName===t))?console.error(`addUniformStructDeclaration: duplicate variable name ${t}`):this.__uniformStructs.push({variableName:t,structName:e})}addUniformBufferObjectDeclaration(e,t,n){if(this.__uniformBufferObjects.some((t=>t.blockName===e)))console.error(`addUniformBufferObjectDeclaration: duplicate block name ${e}`);else{for(const e of this.__uniformBufferObjects)for(const n of e.variableObjects)for(const e of t)if(n.variableName===e.variableName)return void console.error(`addUniformBufferObjectDeclaration: duplicate variable name ${e.variableName}`);this.__uniformBufferObjects.push({blockName:e,variableObjects:t,instanceName:null==n?void 0:n.instanceName})}}addFunctionDefinition(e,t){var n,r;const o=this.__functionIdCount++,i=null!==(n=null==t?void 0:t.dependencyLevel)&&void 0!==n?n:0;return this.__functions[i]=null!==(r=this.__functions[i])&&void 0!==r?r:[],this.__functions[i].push({functionCode:e,functionId:o}),o}updateGlobalPrecision(e){Object.assign(this.__globalPrecision,e)}updateStructDefinition(e,t){const n=this.__structDefinitions.findIndex((t=>t.structName===e));-1!==n?this.__structDefinitions[n].memberObjects=t:console.error(`updateStructDefinition: the struct type name ${e} is not exist`)}updateGlobalConstantValue(e,t){const n=this.__globalConstantValues.findIndex((t=>t.variableName===e));if(-1===n)return void console.warn(`updateGlobalConstantValue: the variable name ${e} is not exist`);const r=this.__globalConstantValues[n].type;o.default._isValidComponentCount(r,t)?(o.default._isIntType(r)&&i.__existNonIntegerValue(t)&&console.warn(`updateGlobalConstantValue: the ${e} has a non-integer value.`),this.__globalConstantValues[n].values=t):console.error("updateGlobalConstantValue: the component count is invalid")}updateGlobalConstantStructValue(e,t){const n=this.__globalConstantStructValues.findIndex((t=>t.variableName===e));-1!==n?this.__globalConstantStructValues[n].values=t:console.error(`updateGlobalConstantStructValue: the variable name ${e} is not exist`)}updateMainFunction(e){this.__mainFunctionCode=e}updateOutputColorVariableName(e){"fragment"===this.__shaderStage?0!==e.length?this.__outputColorVariableName=e:console.error("updateOutputColorVariableName: invalid outColorVariableName"):console.error("updateOutputColorVariableName: this method is for fragment shader only")}removeDefineDirective(e){const t=this.__defineDirectiveNames.indexOf(e);-1!==t?this.__defineDirectiveNames.splice(t,1):console.warn("removedDefineDirective: this define directive is not exist")}removeExtension(e){const t=this.__extensions.findIndex((t=>t.extensionName===e));-1!==t?this.__extensions.splice(t,1):console.warn("removeExtension: this extension is not exist")}removeStructDefinition(e){const t=this.__structDefinitions.findIndex((t=>t.structName===e));-1!==t?this.__structDefinitions.splice(t,1):console.error(`removeStructDefinition: the struct type name ${e} is not exist`)}removeGlobalConstantValue(e){const t=this.__globalConstantValues.findIndex((t=>t.variableName===e));-1!==t?this.__globalConstantValues.splice(t,1):console.warn(`removeGlobalConstantValue: the variable name ${e} is not exist`)}removeGlobalConstantStructValue(e){const t=this.__globalConstantStructValues.findIndex((t=>t.variableName===e));-1!==t?this.__globalConstantStructValues.splice(t,1):console.error(`updateGlobalConstantStructValue: the variable name ${e} is not exist`)}removeAttributeDeclaration(e){const t=this.__attributes.findIndex((t=>t.variableName===e));-1!==t?this.__attributes.splice(t,1):console.warn(`removeAttribute: the variable name ${e} is not exist`)}removeVaryingDeclaration(e){const t=this.__varyings.findIndex((t=>t.variableName===e));-1!==t?this.__varyings.splice(t,1):console.warn(`removeVarying: the variable name ${e} is not exist`)}removeUniformDeclaration(e){const t=this.__uniforms.findIndex((t=>t.variableName===e));-1!==t?this.__uniforms.splice(t,1):console.warn(`removeUniform: the variable name ${e} is not exist`)}removeUniformStructDeclaration(e){const t=this.__uniformStructs.findIndex((t=>t.variableName===e));-1!==t?this.__uniformStructs.splice(t,1):console.warn(`removeUniformStructDeclaration: the variable name ${e} is not exist`)}removeUniformBufferObjectDeclaration(e){const t=this.__uniformBufferObjects.findIndex((t=>t.blockName===e));-1!==t?this.__uniformBufferObjects.splice(t,1):console.warn(`removeUniformStructDeclaration: the variable name ${e} is not exist`)}removeFunctionDefinition(e){this.__fillEmptyFunctions(),(e<0||e>=this.__functionIdCount)&&console.warn("removeFunctionDefinition: invalid function id");for(const t of this.__functions){const n=t.findIndex((t=>t.functionId===e));if(-1!==n)return void t.splice(n,1)}console.warn(`removeFunctionDefinition: not found the function of functionId ${e}`)}createShaderityObject(){return{code:this.__createShaderCode(),shaderStage:this.__shaderStage,isFragmentShader:"fragment"===this.__shaderStage}}static __existNonIntegerValue(e){for(const t of e)if(!Number.isInteger(t))return!0;return!1}__createShaderCode(){return this.__fillEmptyFunctions(),"#version 300 es\n\n"+this.__createDefineDirectiveShaderCode()+this.__createExtensionShaderCode()+this.__createGlobalPrecisionShaderCode()+this.__createStructDefinitionShaderCode()+this.__createGlobalConstantValueShaderCode()+this.__createGlobalConstantStructValueShaderCode()+this.__createAttributeDeclarationShaderCode()+this.__createVaryingDeclarationShaderCode()+this.__createOutputColorDeclarationShaderCode()+this.__createUniformDeclarationShaderCode()+this.__createUniformStructDeclarationShaderCode()+this.__createUniformBufferObjectShaderCode()+this.__createFunctionDefinitionShaderCode()+this.__createMainFunctionDefinitionShaderCode()}__fillEmptyFunctions(){var e;for(let t=0;te.structName===t.structName));if(-1===n){console.error(`__createGlobalConstantStructValueShaderCode: the struct type ${t.structName} is not defined`);continue}e+=`const ${t.structName} ${t.variableName} = ${t.structName} (\n`;const r=this.__structDefinitions[n];if(r.memberObjects.length===Object.keys(t.values).length)if(r.memberObjects.some((e=>o.default._isSamplerType(e.type))))console.error(`__createGlobalConstantStructValueShaderCode: ConstantStructValue (${t.variableName}) cannot have sampler type parameter`);else{for(let n=0;ne.structName===n))?e+=`uniform ${n} ${t.variableName};\n`:console.error(`__createUniformStructDeclarationShaderCode: the struct type ${n} is not defined`)}return o.default._addLineFeedCodeIfNotNullString(e)}__createUniformBufferObjectShaderCode(){let e="";for(const t of this.__uniformBufferObjects){e+=`layout (std140) uniform ${t.blockName} {\n`;for(let n=0;n{n.d(t,{Z:()=>j});var r={};n.r(r),n.d(r,{AABB:()=>o.mNG,AABBGizmo:()=>o.qfN,AbsoluteAnimation:()=>o.lam,AbstractArrayBufferBaseMathNumber:()=>o.bCT,AbstractCameraController:()=>o.mC0,AbstractMaterialContent:()=>o.PxB,AbstractMatrix:()=>o.XAY,AbstractQuaternion:()=>o.lJH,AbstractShaderNode:()=>o.VI2,AbstractTexture:()=>o.yEY,AbstractVector:()=>o.OxW,Accessor:()=>o.U_s,AddShaderNode:()=>o.yd$,AlphaMode:()=>o.FvO,AnimationAssigner:()=>o.tVY,AnimationAttribute:()=>o.sdx,AnimationComponent:()=>o.cwg,AnimationInterpolation:()=>o.kOi,AttributeNormalShaderNode:()=>o.Sy_,AttributePositionShaderNode:()=>o.JRY,Axis:()=>o.RDh,BasisCompressionType:()=>o.l6R,BlendShapeComponent:()=>o.xTt,BlockBeginShader:()=>_.I,BlockBeginShaderNode:()=>o.afv,BlockEndShader:()=>h.$,BlockEndShaderNode:()=>o.fgK,BoneDataType:()=>o.Nh_,Buffer:()=>o.lWr,BufferUse:()=>o.$HW,BufferView:()=>o.qP0,CGAPIResourceRepository:()=>o.FOu,Cache:()=>o.CtF,CameraComponent:()=>o.Myt,CameraControllerComponent:()=>o.SPq,CameraControllerType:()=>o.MyC,CameraType:()=>o.iM5,ClassicShadingShader:()=>g,ColorGradingUsingLUTsMaterialContent:()=>o.h_U,ColorRgb:()=>o.sZ3,ColorRgba:()=>o.tWC,ComplexVertexAttribute:()=>o.et4,Component:()=>o.wA2,ComponentRepository:()=>o.C2e,ComponentType:()=>o.reR,CompositionType:()=>o.dh2,CompressionTextureType:()=>o.bfi,Config:()=>o.DeH,ConstRgbaBlack:()=>o.SGm,ConstRgbaWhite:()=>o.zUz,ConstVector2_0_0:()=>o.igI,ConstVector2_1_1:()=>o.HOX,ConstVector3_0_0_0:()=>o.R1o,ConstVector3_1_1_1:()=>o.p8_,ConstVector4_0_0_0_0:()=>o.GYQ,ConstVector4_0_0_0_1:()=>o.cV0,ConstVector4_1_1_1_1:()=>o.n9W,ConstantVariableShader:()=>x.i,ConstantVariableShaderNode:()=>o.GFx,Cube:()=>o.Xv,CubeTexture:()=>o.BtG,CustomMaterialContent:()=>o.fZl,DataUtil:()=>o.j4H,DepthEncodeMaterialContent:()=>o.Q5_,DetectHighLuminanceMaterialContent:()=>o.tlJ,DotProductShaderNode:()=>o.jLO,DrcPointCloudImporter:()=>o.c5O,EVENT_CLICK:()=>o.Lfs,EVENT_KEY_DOWN:()=>o._QQ,EVENT_KEY_PRESS:()=>o.lOB,EVENT_KEY_UP:()=>o.k$j,EVENT_MOUSE_DOWN:()=>o.zUJ,EVENT_MOUSE_ENTER:()=>o.ak0,EVENT_MOUSE_LEAVE:()=>o.n9,EVENT_MOUSE_MOVE:()=>o.k4,EVENT_MOUSE_OVER:()=>o.vE_,EVENT_MOUSE_UP:()=>o.cG$,EVENT_MOUSE_WHEEL:()=>o.Sss,EVENT_MSPOINTER_DOWN:()=>o.q7F,EVENT_MSPOINTER_MOVE:()=>o.cAE,EVENT_MSPOINTER_UP:()=>o.fAB,EVENT_ORIENTATION_CHANGE:()=>o.SGU,EVENT_POINTER_CANCEL:()=>o.cEP,EVENT_POINTER_DOWN:()=>o.cSB,EVENT_POINTER_ENTER:()=>o.lcf,EVENT_POINTER_LEAVE:()=>o.RyN,EVENT_POINTER_MOVE:()=>o._6o,EVENT_POINTER_OUT:()=>o.UB9,EVENT_POINTER_OVER:()=>o.Cfj,EVENT_POINTER_UP:()=>o.ROv,EVENT_RESIZE:()=>o.hDl,EVENT_TOUCH_CANCEL:()=>o.VS3,EVENT_TOUCH_DOUBLE_TAP:()=>o.Ywc,EVENT_TOUCH_DRAG:()=>o.pt8,EVENT_TOUCH_END:()=>o.p22,EVENT_TOUCH_ENTER:()=>o.jPE,EVENT_TOUCH_HOLD:()=>o.lv,EVENT_TOUCH_LEAVE:()=>o.adG,EVENT_TOUCH_LONG_TAP:()=>o.oM$,EVENT_TOUCH_MOVE:()=>o.jXG,EVENT_TOUCH_OUT:()=>o.fAN,EVENT_TOUCH_OVER:()=>o.KP1,EVENT_TOUCH_PINCH:()=>o.hdu,EVENT_TOUCH_START:()=>o.uso,EVENT_TOUCH_SWIPE:()=>o.yyZ,EVENT_TOUCH_TAP:()=>o.Rz4,Effekseer:()=>G.A,EffekseerComponent:()=>G.D,EndShader:()=>I.x,Entity:()=>o.JHW,EntityHelper:()=>o._nU,EntityRepository:()=>o.gIQ,EntityUIDOutputMaterialContent:()=>o.zFq,EnumClass:()=>o.Jxr,EnvConstantMaterialContent:()=>o.Zfh,Err:()=>o.UGl,EventPubSub:()=>o.U7Y,Expression:()=>o.A2z,FileType:()=>o.Tv5,ForwardRenderPipeline:()=>o.n8g,Frame:()=>o.RQC,FrameBuffer:()=>o.uLm,Frustum:()=>o.iWj,FurnaceTestMaterialContent:()=>o.bLY,GLSLShader:()=>f.m,GLTF2_EXPORT_DRACO:()=>o.Dy6,GLTF2_EXPORT_EMBEDDED:()=>o.jll,GLTF2_EXPORT_GLB:()=>o.Dbu,GLTF2_EXPORT_GLTF:()=>o.ESz,GLTF2_EXPORT_NO_DOWNLOAD:()=>o.S5k,GL_ACTIVE_ATTRIBUTES:()=>F._$8,GL_ACTIVE_TEXTURE:()=>F.lkt,GL_ACTIVE_UNIFORMS:()=>F.Td9,GL_ACTIVE_UNIFORM_BLOCKS:()=>F.wEd,GL_ALIASED_LINE_WIDTH_RANGE:()=>F.ogk,GL_ALIASED_POINT_SIZE_RANGE:()=>F.AY1,GL_ALPHA:()=>F.fNk,GL_ALPHA_BITS:()=>F.Y0n,GL_ALREADY_SIGNALED:()=>F.WPj,GL_ALWAYS:()=>F.gOo,GL_ANY_SAMPLES_PASSED:()=>F.$LR,GL_ANY_SAMPLES_PASSED_CONSERVATIVE:()=>F.faJ,GL_ARRAY_BUFFER:()=>F.TdU,GL_ARRAY_BUFFER_BINDING:()=>F.UAv,GL_ATTACHED_SHADERS:()=>F.Q$l,GL_BACK:()=>F.wIF,GL_BLEND:()=>F.ZXb,GL_BLEND_COLOR:()=>F.hzX,GL_BLEND_DST_ALPHA:()=>F.r9F,GL_BLEND_DST_RGB:()=>F.Kzo,GL_BLEND_EQUATION:()=>F.ttq,GL_BLEND_EQUATION_ALPHA:()=>F.XG_,GL_BLEND_EQUATION_RGB:()=>F.HPC,GL_BLEND_SRC_ALPHA:()=>F.QH$,GL_BLEND_SRC_RGB:()=>F._1o,GL_BLUE_BITS:()=>F.EZ0,GL_BOOL:()=>F.N9T,GL_BOOL_VEC2:()=>F.vgW,GL_BOOL_VEC3:()=>F.tqi,GL_BOOL_VEC4:()=>F.iU2,GL_BROWSER_DEFAULT_WEBGL:()=>F.BWL,GL_BUFFER_SIZE:()=>F.F_m,GL_BUFFER_USAGE:()=>F.$et,GL_CCW:()=>F.gx8,GL_CLAMP_TO_EDGE:()=>F.Y8m,GL_COLOR:()=>F.Wlc,GL_COLOR_ATTACHMENT0:()=>F.krQ,GL_COLOR_ATTACHMENT0_WEBGL:()=>F.YCV,GL_COLOR_ATTACHMENT1:()=>F.p7w,GL_COLOR_ATTACHMENT10:()=>F.Axb,GL_COLOR_ATTACHMENT10_WEBGL:()=>F.eqO,GL_COLOR_ATTACHMENT11:()=>F.gwn,GL_COLOR_ATTACHMENT11_WEBGL:()=>F.BM1,GL_COLOR_ATTACHMENT12:()=>F.w4x,GL_COLOR_ATTACHMENT12_WEBGL:()=>F.CCZ,GL_COLOR_ATTACHMENT13:()=>F.FQh,GL_COLOR_ATTACHMENT13_WEBGL:()=>F.AOk,GL_COLOR_ATTACHMENT14:()=>F.rjz,GL_COLOR_ATTACHMENT14_WEBGL:()=>F.LwI,GL_COLOR_ATTACHMENT15:()=>F._8G,GL_COLOR_ATTACHMENT15_WEBGL:()=>F.ZC4,GL_COLOR_ATTACHMENT1_WEBGL:()=>F.$9l,GL_COLOR_ATTACHMENT2:()=>F.Bky,GL_COLOR_ATTACHMENT2_WEBGL:()=>F.qNf,GL_COLOR_ATTACHMENT3:()=>F.I2u,GL_COLOR_ATTACHMENT3_WEBGL:()=>F.oC9,GL_COLOR_ATTACHMENT4:()=>F.ip$,GL_COLOR_ATTACHMENT4_WEBGL:()=>F.HBF,GL_COLOR_ATTACHMENT5:()=>F._Mr,GL_COLOR_ATTACHMENT5_WEBGL:()=>F.vpR,GL_COLOR_ATTACHMENT6:()=>F.w_G,GL_COLOR_ATTACHMENT6_WEBGL:()=>F.wpZ,GL_COLOR_ATTACHMENT7:()=>F.UBE,GL_COLOR_ATTACHMENT7_WEBGL:()=>F.L8z,GL_COLOR_ATTACHMENT8:()=>F.egt,GL_COLOR_ATTACHMENT8_WEBGL:()=>F.J6F,GL_COLOR_ATTACHMENT9:()=>F.O27,GL_COLOR_ATTACHMENT9_WEBGL:()=>F.L4c,GL_COLOR_BUFFER_BIT:()=>F.$FK,GL_COLOR_CLEAR_VALUE:()=>F.FEv,GL_COLOR_WRITEMASK:()=>F.Ut4,GL_COMPARE_REF_TO_TEXTURE:()=>F.M_A,GL_COMPILE_STATUS:()=>F.MKG,GL_COMPRESSED_R11_EAC:()=>F.d6W,GL_COMPRESSED_RG11_EAC:()=>F.y3r,GL_COMPRESSED_RGB8_ETC2:()=>F.L3p,GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:()=>F.aLt,GL_COMPRESSED_RGBA8_ETC2_EAC:()=>F.DM,GL_COMPRESSED_RGBA_ASTC_10X10_KHR:()=>F.Hfs,GL_COMPRESSED_RGBA_ASTC_10X5_KHR:()=>F.ObQ,GL_COMPRESSED_RGBA_ASTC_10X6_KHR:()=>F.Q2$,GL_COMPRESSED_RGBA_ASTC_10X8_KHR:()=>F.kvX,GL_COMPRESSED_RGBA_ASTC_12X10_KHR:()=>F.U05,GL_COMPRESSED_RGBA_ASTC_12X12_KHR:()=>F.nsH,GL_COMPRESSED_RGBA_ASTC_4X4_KHR:()=>F.mrS,GL_COMPRESSED_RGBA_ASTC_5X4_KHR:()=>F.yZM,GL_COMPRESSED_RGBA_ASTC_5X5_KHR:()=>F.ij3,GL_COMPRESSED_RGBA_ASTC_6X5_KHR:()=>F.qSO,GL_COMPRESSED_RGBA_ASTC_6X6_KHR:()=>F.Fh_,GL_COMPRESSED_RGBA_ASTC_8X5_KHR:()=>F._zC,GL_COMPRESSED_RGBA_ASTC_8X6_KHR:()=>F.$9u,GL_COMPRESSED_RGBA_ASTC_8X8_KHR:()=>F.Gow,GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:()=>F.$1s,GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:()=>F.$PT,GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:()=>F.fYk,GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:()=>F.DcX,GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:()=>F.bTO,GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:()=>F.TsK,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:()=>F.G00,GL_COMPRESSED_RGB_ATC_WEBGL:()=>F.xug,GL_COMPRESSED_RGB_ETC1_WEBGL:()=>F.mhR,GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG:()=>F.Awc,GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG:()=>F.EW4,GL_COMPRESSED_RGB_S3TC_DXT1_EXT:()=>F.suj,GL_COMPRESSED_SIGNED_R11_EAC:()=>F.SzQ,GL_COMPRESSED_SIGNED_RG11_EAC:()=>F.Y_Y,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:()=>F.dN8,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:()=>F.TY8,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:()=>F.EMZ,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:()=>F.DnL,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:()=>F.dpg,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:()=>F.kW3,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:()=>F.dcZ,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:()=>F.qfx,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:()=>F.a2d,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:()=>F.hRd,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:()=>F.Tkf,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:()=>F.EiH,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:()=>F.Ham,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:()=>F.kUS,GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:()=>F.iLk,GL_COMPRESSED_SRGB8_ETC2:()=>F.rZr,GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:()=>F.eyW,GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:()=>F.XY4,GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:()=>F.FyP,GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:()=>F.QrU,GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:()=>F.F8G,GL_COMPRESSED_TEXTURE_FORMATS:()=>F.r4j,GL_CONDITION_SATISFIED:()=>F.oRF,GL_CONSTANT_ALPHA:()=>F.HN$,GL_CONSTANT_COLOR:()=>F.obT,GL_CONTEXT_LOST_WEBGL:()=>F.Ahs,GL_COPY_READ_BUFFER:()=>F.jIl,GL_COPY_READ_BUFFER_BINDING:()=>F.F0I,GL_COPY_WRITE_BUFFER:()=>F.Pa5,GL_COPY_WRITE_BUFFER_BINDING:()=>F.$XJ,GL_CULL_FACE:()=>F.tef,GL_CULL_FACE_MODE:()=>F.lkd,GL_CURRENT_PROGRAM:()=>F.Gi2,GL_CURRENT_QUERY:()=>F.pcv,GL_CURRENT_QUERY_EXT:()=>F.bye,GL_CURRENT_VERTEX_ATTRIB:()=>F.tV_,GL_CW:()=>F.PU5,GL_DATA_BYTE:()=>F.q7Q,GL_DATA_FLOAT:()=>F.OT$,GL_DATA_INT:()=>F.Nq4,GL_DATA_SHORT:()=>F._TP,GL_DATA_UNSIGNED_BYTE:()=>F.Ywg,GL_DATA_UNSIGNED_INT:()=>F.M_8,GL_DATA_UNSIGNED_SHORT:()=>F.rkl,GL_DECR:()=>F.nTe,GL_DECR_WRAP:()=>F.k4y,GL_DELETE_STATUS:()=>F.Pw6,GL_DEPTH:()=>F.gLP,GL_DEPTH24_STENCIL8:()=>F.pmD,GL_DEPTH32F_STENCIL8:()=>F.WB9,GL_DEPTH_ATTACHMENT:()=>F.ksX,GL_DEPTH_BITS:()=>F.Ro9,GL_DEPTH_BUFFER_BIT:()=>F.GuG,GL_DEPTH_CLEAR_VALUE:()=>F.WRC,GL_DEPTH_COMPONENT:()=>F.pEo,GL_DEPTH_COMPONENT16:()=>F.r7P,GL_DEPTH_COMPONENT24:()=>F.LjI,GL_DEPTH_COMPONENT32F:()=>F.FcV,GL_DEPTH_FUNC:()=>F.hvl,GL_DEPTH_RANGE:()=>F.w97,GL_DEPTH_STENCIL:()=>F.Bwm,GL_DEPTH_STENCIL_ATTACHMENT:()=>F.y$A,GL_DEPTH_TEST:()=>F.oHv,GL_DEPTH_WRITEMASK:()=>F.b0C,GL_DITHER:()=>F.Rad,GL_DONT_CARE:()=>F.u3g,GL_DRAW_BUFFER0:()=>F.a36,GL_DRAW_BUFFER0_WEBGL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GL_ELEMENT_ARRAY_BUFFER_BINDING:()=>F.fMn,GL_EQUAL:()=>F.IuO,GL_FASTEST:()=>F.wGk,GL_FLOAT_32_UNSIGNED_INT_24_8_REV:()=>F.wER,GL_FLOAT_MAT2:()=>F.a$d,GL_FLOAT_MAT2X3:()=>F.h$M,GL_FLOAT_MAT2X4:()=>F.d8l,GL_FLOAT_MAT3:()=>F.ODf,GL_FLOAT_MAT3X2:()=>F.oud,GL_FLOAT_MAT3X4:()=>F.LhK,GL_FLOAT_MAT4:()=>F.wSW,GL_FLOAT_MAT4X2:()=>F.ozE,GL_FLOAT_MAT4X3:()=>F.Dq,GL_FLOAT_VEC2:()=>F.e3O,GL_FLOAT_VEC3:()=>F.qhU,GL_FLOAT_VEC4:()=>F.dtP,GL_FRAGMENT_SHADER:()=>F.QoZ,GL_FRAGMENT_SHADER_DERIVATIVE_HINT:()=>F.AQL,GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:()=>F.Qh0,GL_FRAMEBUFFER:()=>F.Iqe,GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:()=>F.vEJ,GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:()=>F.BSP,GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:()=>F.Yhe,GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:()=>F.U4r,GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:()=>F.MLp,GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:()=>F.$ri,GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:()=>F.hCR,GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:()=>F.y8S,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:()=>F.UlJ,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:()=>F.KY4,GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:()=>F.HHs,GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:()=>F.HGq,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:()=>F.jD8,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:()=>F.dIe,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:()=>F.$TT,GL_FRAMEBUFFER_BINDING:()=>F.F06,GL_FRAMEBUFFER_COMPLETE:()=>F.Erj,GL_FRAMEBUFFER_DEFAULT:()=>F.AjE,GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:()=>F.Qlq,GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:()=>F.URo,GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:()=>F.lmp,GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:()=>F.rfC,GL_FRAMEBUFFER_UNSUPPORTED:()=>F.JZg,GL_FRONT:()=>F.dte,GL_FRONT_AND_BACK:()=>F.cN,GL_FRONT_FACE:()=>F.gI2,GL_FUNC_ADD:()=>F.gNb,GL_FUNC_REVERSE_SUBTRACT:()=>F.lJZ,GL_FUNC_SUBSTRACT:()=>F.xHF,GL_GENERATE_MIPMAP_HINT:()=>F.NyC,GL_GEQUAL:()=>F.qbs,GL_GPU_DISJOINT_EXT:()=>F.FpK,GL_GREATER:()=>F.hys,GL_GREEN_BITS:()=>F.jtX,GL_HALF_FLOAT:()=>F.XpU,GL_HALF_FLOAT_OES:()=>F.fb9,GL_HIGH_FLOAT:()=>F.w8k,GL_HIGH_INT:()=>F.F8$,GL_IMPLEMENTATION_COLOR_READ_FORMAT:()=>F.az3,GL_IMPLEMENTATION_COLOR_READ_TYPE:()=>F.AKO,GL_INCR:()=>F.uyu,GL_INCR_WRAP:()=>F.It5,GL_INTERLEAVED_ATTRIBS:()=>F.MNF,GL_INT_2_10_10_10_REV:()=>F.Seb,GL_INT_SAMPLER_2D:()=>F.qiu,GL_INT_SAMPLER_2D_ARRAY:()=>F.uU2,GL_INT_SAMPLER_3D:()=>F.PnX,GL_INT_SAMPLER_CUBE:()=>F.WfD,GL_INT_VEC2:()=>F.RS3,GL_INT_VEC3:()=>F.yYj,GL_INT_VEC4:()=>F.xyr,GL_INVALID_ENUM:()=>F.JC7,GL_INVALID_FRAMEBUFFER_OPERATION:()=>F.aXw,GL_INVALID_INDEX:()=>F.h2K,GL_INVALID_OPERATION:()=>F.lZq,GL_INVALID_VALUE:()=>F.Qpw,GL_INVERT:()=>F.SUn,GL_KEEP:()=>F.Rk$,GL_LEQUAL:()=>F.Vfd,GL_LESS:()=>F.hyR,GL_LINEAR:()=>F.utc,GL_LINEAR_MIPMAP_LINEAR:()=>F.Onn,GL_LINEAR_MIPMAP_NEAREST:()=>F.D68,GL_LINES:()=>F.CB7,GL_LINE_LOOP:()=>F.Jxz,GL_LINE_STRIP:()=>F.M0t,GL_LINE_WIDTH:()=>F.uik,GL_LINK_STATUS:()=>F.WNe,GL_LOW_FLOAT:()=>F.B2j,GL_LOW_INT:()=>F.OJ6,GL_LUMINANCE:()=>F.y9I,GL_LUMINANCE_ALPHA:()=>F.VPl,GL_MAX:()=>F.bQw,GL_MAX_3D_TEXTURE_SIZE:()=>F.TSE,GL_MAX_ARRAY_TEXTURE_LAYERS:()=>F.Dn,GL_MAX_CLIENT_WAIT_TIMEOUT_WEBGL:()=>F.Tr4,GL_MAX_COLOR_ATTACHMENTS:()=>F.DM2,GL_MAX_COLOR_ATTACHMENTS_WEBGL:()=>F.AA5,GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:()=>F.lPV,GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:()=>F.QZz,GL_MAX_COMBINED_UNIFORM_BLOCKS:()=>F.PKw,GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:()=>F.Dgg,GL_MAX_CUBE_MAP_TEXTURE_SIZE:()=>F.ly5,GL_MAX_DRAW_BUFFERS:()=>F.TQ9,GL_MAX_DRAW_BUFFERS_WEBGL:()=>F.GuK,GL_MAX_ELEMENTS_INDICES:()=>F.iIj,GL_MAX_ELEMENTS_VERTICES:()=>F.$OY,GL_MAX_ELEMENT_INDEX:()=>F.SKn,GL_MAX_EXT:()=>F.VdM,GL_MAX_FRAGMENT_INPUT_COMPONENTS:()=>F.YNJ,GL_MAX_FRAGMENT_UNIFORM_BLOCKS:()=>F.PUO,GL_MAX_FRAGMENT_UNIFORM_COMPONENTS:()=>F.Jvo,GL_MAX_FRAGMENT_UNIFORM_VECTORS:()=>F.JJY,GL_MAX_PROGRAM_TEXEL_OFFSET:()=>F._b_,GL_MAX_RENDERBUFFER_SIZE:()=>F.ml9,GL_MAX_SAMPLES:()=>F.WBe,GL_MAX_SERVER_WAIT_TIMEOUT:()=>F.epv,GL_MAX_TEXTURE_IMAGE_UNITS:()=>F.D8i,GL_MAX_TEXTURE_LOD_BIAS:()=>F.kky,GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:()=>F.oR$,GL_MAX_TEXTURE_SIZE:()=>F.S1v,GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:()=>F.QkI,GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:()=>F._YZ,GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:()=>F.Mlt,GL_MAX_UNIFORM_BLOCK_SIZE:()=>F.uri,GL_MAX_UNIFORM_BUFFER_BINDINGS:()=>F.E6I,GL_MAX_VARYING_COMPONENTS:()=>F.Cj5,GL_MAX_VARYING_VECTORS:()=>F.jHY,GL_MAX_VERTEX_ATTRIBS:()=>F.hfp,GL_MAX_VERTEX_OUTPUT_COMPONENTS:()=>F.ksA,GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:()=>F.Rw3,GL_MAX_VERTEX_UNIFORM_BLOCKS:()=>F.SH3,GL_MAX_VERTEX_UNIFORM_COMPONENTS:()=>F.Ft1,GL_MAX_VERTEX_UNIFORM_VECTORS:()=>F.N8N,GL_MAX_VIEWPORT_DIMS:()=>F.oDL,GL_MEDIUM_FLOAT:()=>F.fL$,GL_MEDIUM_INT:()=>F.XEX,GL_MIN:()=>F.Awz,GL_MIN_EXT:()=>F.fxg,GL_MIN_PROGRAM_TEXEL_OFFSET:()=>F.pc5,GL_MIRRORED_REPEAT:()=>F.GjS,GL_NEAREST:()=>F.R1c,GL_NEAREST_MIPMAP_LINEAR:()=>F.vTv,GL_NEAREST_MIPMAP_NEAREST:()=>F.wWb,GL_NEVER:()=>F.shP,GL_NICEST:()=>F.wVD,GL_NONE:()=>F.Hh0,GL_NOTEQUAL:()=>F.UnN,GL_NO_ERROR:()=>F.Wen,GL_OBJECT_TYPE:()=>F.BHy,GL_ONE:()=>F.Qak,GL_ONE_MINUS_CONSTANT_ALPHA:()=>F.D__,GL_ONE_MINUS_CONSTANT_COLOR:()=>F.$rK,GL_ONE_MINUS_DST_ALPHA:()=>F.X5J,GL_ONE_MINUS_DST_COLOR:()=>F.hOW,GL_ONE_MINUS_SRC_ALPHA:()=>F.GR4,GL_ONE_MINUS_SRC_COLOR:()=>F.IDP,GL_OUT_OF_MEMORY:()=>F.gcz,GL_PACK_ALIGNMENT:()=>F.XPs,GL_PACK_ROW_LENGTH:()=>F.wMK,GL_PACK_SKIP_PIXELS:()=>F.voy,GL_PACK_SKIP_ROWS:()=>F.VNU,GL_PIXEL_PACK_BUFFER:()=>F.OAM,GL_PIXEL_PACK_BUFFER_BINDING:()=>F.vce,GL_PIXEL_UNPACK_BUFFER:()=>F.fsJ,GL_PIXEL_UNPACK_BUFFER_BINDING:()=>F.mED,GL_PIXEL_UNSIGNED_BYTE:()=>F.vnd,GL_PIXEL_UNSIGNED_SHORT_4_4_4_4:()=>F.yD3,GL_PIXEL_UNSIGNED_SHORT_5_5_5_1:()=>F.kyN,GL_PIXEL_UNSIGNED_SHORT_5_6_5:()=>F.nJx,GL_POINTS:()=>F.u$A,GL_POLYGON_OFFSET_FACTOR:()=>F.tzR,GL_POLYGON_OFFSET_FILL:()=>F.Lbl,GL_POLYGON_OFFSET_UNITS:()=>F.DEk,GL_QUERY_COUNTER_BITS_EXT:()=>F.HPM,GL_QUERY_RESULT:()=>F.dbf,GL_QUERY_RESULT_AVAILABLE:()=>F.vPW,GL_QUERY_RESULT_AVAILABLE_EXT:()=>F.KAt,GL_QUERY_RESULT_EXT:()=>F._UX,GL_R11F_G11F_B10F:()=>F.zsc,GL_R16F:()=>F.oY_,GL_R16I:()=>F.gj3,GL_R16UI:()=>F.oqe,GL_R32F:()=>F.uER,GL_R32I:()=>F._TF,GL_R32UI:()=>F.YlY,GL_R8:()=>F.cYm,GL_R8I:()=>F._EH,GL_R8UI:()=>F.S00,GL_R8_SNORM:()=>F.w9H,GL_RASTERIZER_DISCARD:()=>F.ZXo,GL_READ_BUFFER:()=>F._Ir,GL_READ_FRAMEBUFFER:()=>F.yun,GL_READ_FRAMEBUFFER_BINDING:()=>F.bXZ,GL_RED:()=>F.ZhV,GL_RED_BITS:()=>F.jZr,GL_RED_INTEGER:()=>F.iKz,GL_RENDERBUFFER:()=>F.vPm,GL_RENDERBUFFER_ALPHA_SIZE:()=>F.Ysb,GL_RENDERBUFFER_BINDING:()=>F.qk$,GL_RENDERBUFFER_BLUE_SIZE:()=>F.pBm,GL_RENDERBUFFER_DEPTH_SIZE:()=>F.lbA,GL_RENDERBUFFER_GREEN_SIZE:()=>F.OSM,GL_RENDERBUFFER_HEIGHT:()=>F.Bxb,GL_RENDERBUFFER_INTERNAL_FORMAT:()=>F.TpV,GL_RENDERBUFFER_RED_SIZE:()=>F.eco,GL_RENDERBUFFER_SAMPLES:()=>F.CW9,GL_RENDERBUFFER_STENCIL_SIZE:()=>F.Dm9,GL_RENDERBUFFER_WIDTH:()=>F._ZX,GL_RENDERER:()=>F.mfM,GL_REPEAT:()=>F.$7R,GL_REPLACE:()=>F.Snx,GL_RG:()=>F.SJU,GL_RG16F:()=>F.uLG,GL_RG16I:()=>F.XE4,GL_RG16UI:()=>F.r0$,GL_RG32F:()=>F.uM4,GL_RG32I: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S:()=>F.Od7,GL_SAMPLE_COVERAGE:()=>F.Nu1,GL_SAMPLE_COVERAGE_INVERT:()=>F.JGk,GL_SAMPLE_COVERAGE_VALUE:()=>F.VJW,GL_SCISSOR_BOX:()=>F.LCZ,GL_SCISSOR_TEST:()=>F.iku,GL_SEPARATE_ATTRIBS:()=>F.ixi,GL_SHADER_TYPE:()=>F.wrZ,GL_SHADING_LANGUAGE_VERSION:()=>F.SFW,GL_SIGNALED:()=>F._M2,GL_SIGNED_NORMALIZED:()=>F.oiY,GL_SRC_ALPHA:()=>F.B3l,GL_SRC_ALPHA_SATURATE:()=>F.JRp,GL_SRC_COLOR:()=>F.o9e,GL_SRGB:()=>F.GTV,GL_SRGB8:()=>F.LQI,GL_SRGB8_ALPHA8:()=>F.TsT,GL_SRGB8_ALPHA8_EXT:()=>F.SNQ,GL_SRGB_ALPHA_EXT:()=>F.VFW,GL_SRGB_EXT:()=>F.Hjq,GL_STATIC_COPY:()=>F.yZh,GL_STATIC_DRAW:()=>F.o4I,GL_STATIC_READ:()=>F.Spp,GL_STENCIL:()=>F.EH4,GL_STENCIL_ATTACHMENT:()=>F.m88,GL_STENCIL_BACK_FAIL:()=>F._5_,GL_STENCIL_BACK_FUNC:()=>F.xR7,GL_STENCIL_BACK_PASS_DEPTH_FAIL:()=>F.WK5,GL_STENCIL_BACK_PASS_DEPTH_PASS:()=>F.PNz,GL_STENCIL_BACK_REF:()=>F.hoP,GL_STENCIL_BACK_VALUE_MASK:()=>F.n0B,GL_STENCIL_BACK_WRITEMASK:()=>F.Z$r,GL_STENCIL_BITS:()=>F.ad4,GL_STENCIL_BUFFER_BIT:()=>F.BbZ,GL_STENCIL_CLEAR_VALUE:()=>F.zSL,GL_STENCIL_FAIL:()=>F.wce,GL_STENCIL_FUNC:()=>F.Qbd,GL_STENCIL_INDEX:()=>F.OBi,GL_STENCIL_INDEX8:()=>F.VX_,GL_STENCIL_PASS_DEPTH_FAIL:()=>F.O5p,GL_STENCIL_PASS_DEPTH_PASS:()=>F.OiW,GL_STENCIL_REF:()=>F.nVM,GL_STENCIL_TEST:()=>F.lxv,GL_STENCIL_VALUE_MASK:()=>F.b6i,GL_STENCIL_WRITEMASK:()=>F.Q$q,GL_STREAM_COPY:()=>F.kMJ,GL_STREAM_DRAW:()=>F.RIC,GL_STREAM_READ:()=>F.BTT,GL_SUBPIXEL_BITS:()=>F.xp,GL_SYNC_CONDITION:()=>F.vHc,GL_SYNC_FENCE:()=>F.YoK,GL_SYNC_FLAGS:()=>F.lF1,GL_SYNC_FLUSH_COMMANDS_BIT:()=>F.tFw,GL_SYNC_GPU_COMMANDS_COMPLETE:()=>F.z8r,GL_SYNC_STATUS:()=>F.wm0,GL_TEXTURE:()=>F.p8j,GL_TEXTURE0:()=>F.Lmx,GL_TEXTURE1:()=>F.ZrN,GL_TEXTURE10:()=>F.M1Q,GL_TEXTURE11:()=>F.nPy,GL_TEXTURE12:()=>F.SX1,GL_TEXTURE13:()=>F.pYl,GL_TEXTURE14:()=>F.EPR,GL_TEXTURE15:()=>F.kpL,GL_TEXTURE16:()=>F.RjA,GL_TEXTURE17:()=>F.uJm,GL_TEXTURE18:()=>F.Wtd,GL_TEXTURE19:()=>F.emu,GL_TEXTURE2:()=>F.Ehj,GL_TEXTURE20:()=>F.iVc,GL_TEXTURE21:()=>F.Bvy,GL_TEXTURE22:()=>F.pJJ,GL_TEXTURE23:()=>F.WQq,GL_TEXTURE24:()=>F.AC$,GL_TEXTURE25:()=>F.jol,GL_TEXTURE26:()=>F.kOB,GL_TEXTURE27:()=>F.RO1,GL_TEXTURE28:()=>F.Uu$,GL_TEXTURE29:()=>F.Kwr,GL_TEXTURE3:()=>F._mt,GL_TEXTURE30:()=>F.SEn,GL_TEXTURE31:()=>F.Guy,GL_TEXTURE4:()=>F.OG0,GL_TEXTURE5:()=>F.PHR,GL_TEXTURE6:()=>F.vC$,GL_TEXTURE7:()=>F.uzX,GL_TEXTURE8:()=>F.Ac_,GL_TEXTURE9:()=>F.Rtt,GL_TEXTURE_2D:()=>F.CbE,GL_TEXTURE_2D_ARRAY:()=>F.k0l,GL_TEXTURE_3D:()=>F.FU3,GL_TEXTURE_BASE_LEVEL:()=>F.qz_,GL_TEXTURE_BINDING_2D:()=>F.Fp$,GL_TEXTURE_BINDING_2D_ARRAY:()=>F.alV,GL_TEXTURE_BINDING_3D:()=>F.M0H,GL_TEXTURE_BINDING_CUBE_MAP:()=>F.YZ8,GL_TEXTURE_COMPARE_FUNC:()=>F.n3r,GL_TEXTURE_COMPARE_MODE:()=>F.dUx,GL_TEXTURE_CUBE_MAP:()=>F.oHN,GL_TEXTURE_CUBE_MAP_NEGATIVE_X:()=>F.KZB,GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:()=>F.Q4l,GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:()=>F.QJs,GL_TEXTURE_CUBE_MAP_POSITIVE_X:()=>F.tkF,GL_TEXTURE_CUBE_MAP_POSITIVE_Y:()=>F.AE4,GL_TEXTURE_CUBE_MAP_POSITIVE_Z:()=>F.UP3,GL_TEXTURE_IMMUTABLE_FORMAT:()=>F.YCj,GL_TEXTURE_IMMUTABLE_LEVELS:()=>F.cds,GL_TEXTURE_MAG_FILTER:()=>F.c6V,GL_TEXTURE_MAX_ANISOTROPY_EXT:()=>F.bmu,GL_TEXTURE_MAX_LEVEL:()=>F.JqA,GL_TEXTURE_MAX_LOD:()=>F.Yz$,GL_TEXTURE_MIN_FILTER:()=>F.Bc6,GL_TEXTURE_MIN_LOD:()=>F.RDW,GL_TEXTURE_WRAP_R:()=>F.gbE,GL_TEXTURE_WRAP_S:()=>F.OoY,GL_TEXTURE_WRAP_T:()=>F.heo,GL_TIMEOUT_EXPIRED:()=>F.aK$,GL_TIMEOUT_IGNORED:()=>F.eke,GL_TIMESTAMP_EXT:()=>F.Qt8,GL_TIME_ELAPSED_EXT:()=>F.sr4,GL_TRANSFORM_FEEDBACK:()=>F.Sa0,GL_TRANSFORM_FEEDBACK_ACTIVE:()=>F.vWN,GL_TRANSFORM_FEEDBACK_BINDING:()=>F.C6I,GL_TRANSFORM_FEEDBACK_BUFFER:()=>F.AQZ,GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:()=>F.x6H,GL_TRANSFORM_FEEDBACK_BUFFER_MODE:()=>F.H2K,GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:()=>F.f5L,GL_TRANSFORM_FEEDBACK_BUFFER_START:()=>F.ILt,GL_TRANSFORM_FEEDBACK_PAUSED:()=>F.ccF,GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:()=>F.VYu,GL_TRANSFORM_FEEDBACK_VARYINGS:()=>F.y3j,GL_TRIANGLES:()=>F.FgH,GL_TRIANGLE_FAN:()=>F.vtI,GL_TRIANGLE_STRIP:()=>F.uCq,GL_UNIFORM_ARRAY_STRIDE:()=>F.qWZ,GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS:()=>F.t75,GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:()=>F.Kzi,GL_UNIFORM_BLOCK_BINDING:()=>F.tNI,GL_UNIFORM_BLOCK_DATA_SIZE:()=>F.zfW,GL_UNIFORM_BLOCK_INDEX:()=>F.mcF,GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:()=>F.Nyi,GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:()=>F.sxC,GL_UNIFORM_BUFFER:()=>F.q__,GL_UNIFORM_BUFFER_BINDING:()=>F.DBb,GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:()=>F.mMN,GL_UNIFORM_BUFFER_SIZE:()=>F.rve,GL_UNIFORM_BUFFER_START:()=>F.o7C,GL_UNIFORM_IS_ROW_MAJOR:()=>F.HM$,GL_UNIFORM_MATRIX_STRIDE:()=>F.mS1,GL_UNIFORM_OFFSET:()=>F.xUI,GL_UNIFORM_SIZE:()=>F.djG,GL_UNIFORM_TYPE:()=>F.Kn4,GL_UNMASKED_RENDERER_WEBGL:()=>F.jGD,GL_UNMASKED_VENDOR_WEBGL:()=>F.ycd,GL_UNPACK_ALIGNMENT:()=>F.GM3,GL_UNPACK_COLORSPACE_CONVERSION_WEBGL:()=>F.XxT,GL_UNPACK_FLIP_Y_WEBGL:()=>F.PYx,GL_UNPACK_IMAGE_HEIGHT:()=>F.EVZ,GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL:()=>F.WYY,GL_UNPACK_ROW_LENGTH:()=>F.m7j,GL_UNPACK_SKIP_IMAGES:()=>F.SK7,GL_UNPACK_SKIP_PIXELS:()=>F.YrP,GL_UNPACK_SKIP_ROWS:()=>F.bd_,GL_UNSIGNALED:()=>F.n9O,GL_UNSIGNED_INT_10F_11F_11F_REV:()=>F.nQ9,GL_UNSIGNED_INT_24_8:()=>F.bTv,GL_UNSIGNED_INT_24_8_WEBGL:()=>F.iyB,GL_UNSIGNED_INT_2_10_10_10_REV:()=>F.LX0,GL_UNSIGNED_INT_5_9_9_9_REV:()=>F.vEp,GL_UNSIGNED_INT_SAMPLER_2D:()=>F.Zx4,GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:()=>F.yd2,GL_UNSIGNED_INT_SAMPLER_3D:()=>F.ZtN,GL_UNSIGNED_INT_SAMPLER_CUBE:()=>F.lg3,GL_UNSIGNED_INT_VEC2:()=>F.DAo,GL_UNSIGNED_INT_VEC3:()=>F.TAU,GL_UNSIGNED_INT_VEC4:()=>F.Ki3,GL_UNSIGNED_NORMALIZED:()=>F.Dr$,GL_UNSIGNED_NORMALIZED_EXT:()=>F.$z8,GL_VALIDATE_STATUS:()=>F.eQR,GL_VENDOR:()=>F.zSP,GL_VERSION:()=>F.$bm,GL_VERTEX_ARRAY_BINDING:()=>F.RGR,GL_VERTEX_ARRAY_BINDING_OES:()=>F.fsT,GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:()=>F.HRE,GL_VERTEX_ATTRIB_ARRAY_DIVISOR:()=>F.LUh,GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:()=>F.C9t,GL_VERTEX_ATTRIB_ARRAY_ENABLED:()=>F.I4M,GL_VERTEX_ATTRIB_ARRAY_INTEGER:()=>F.XZ2,GL_VERTEX_ATTRIB_ARRAY_NORMALIZED:()=>F.s7G,GL_VERTEX_ATTRIB_ARRAY_POINTER:()=>F.bsK,GL_VERTEX_ATTRIB_ARRAY_SIZE:()=>F.vEN,GL_VERTEX_ATTRIB_ARRAY_STRIDE:()=>F.cqm,GL_VERTEX_ATTRIB_ARRAY_TYPE:()=>F.eFf,GL_VERTEX_SHADER:()=>F.lQo,GL_VIEWPORT:()=>F.Ith,GL_WAIT_FAILED:()=>F.GIj,GL_ZERO:()=>F._sJ,GaussianBlurForEncodedDepthMaterialContent:()=>o._Bd,GaussianBlurMaterialContent:()=>o.WLX,GetComponentFromEntities:()=>o.swI,Gizmo:()=>o.tb4,GlobalDataRepository:()=>o.$jt,GlobalRetarget:()=>o.B5B,GlobalRetarget2:()=>o.xzS,Gltf2Exporter:()=>o.ObQ,Gltf2Importer:()=>o.Zb6,GltfImporter:()=>o.j6Y,GreaterShaderNode:()=>o.imh,Grid:()=>o.rjZ,HdriFormat:()=>o.czt,INPUT_HANDLING_STATE_CAMERA_CONTROLLER:()=>o.jOP,INPUT_HANDLING_STATE_GIZMO_SCALE:()=>o.K2G,INPUT_HANDLING_STATE_GIZMO_TRANSLATION:()=>o.KQz,INPUT_HANDLING_STATE_NONE:()=>o.Tr1,IShape:()=>o.ALp,IdentityMatrix33:()=>o.cmF,IdentityMatrix44:()=>o.aqQ,IfStatementShader:()=>E.p,IfStatementShaderNode:()=>o.uP$,ImageUtil:()=>o.LkB,InputManager:()=>o.$tz,Is:()=>o.Is,IsObj:()=>o.V5,Joint:()=>o.d90,KTX2TextureLoader:()=>C.N,LightComponent:()=>o.r0A,LightType:()=>o.vBC,Line:()=>o.x12,LocatorGizmo:()=>o.klP,LogQuaternion:()=>o.lW,MToonMaterialContent:()=>o.fQ$,MatCapMaterialContent:()=>o.Svh,Material:()=>o.F5T,MaterialHelper:()=>o.G$p,MaterialRepository:()=>o.rFg,MathClassUtil:()=>o.Db6,MathUtil:()=>o.kj,Matrix22:()=>o.ak,Matrix33:()=>o.haE,Matrix44:()=>o.Jeh,MemoryManager:()=>o.B_3,Mesh:()=>o.Kj0,MeshComponent:()=>o.$tA,MeshHelper:()=>o.tVI,MeshRendererComponent:()=>o.YZ_,MiscUtil:()=>o.KfE,ModelConverter:()=>o.eDb,ModuleManager:()=>o.xJl,MultiplyShaderNode:()=>o.P4J,MutableColorRgb:()=>o.CEM,MutableColorRgba:()=>o.l$X,MutableMatrix22:()=>o.f7L,MutableMatrix33:()=>o.xkj,MutableMatrix44:()=>o.ecr,MutableQuaternion:()=>o.yGy,MutableScalar:()=>o.DUM,MutableScalar_:()=>o.EtM,MutableScalard:()=>o.$_9,MutableVector2:()=>o.NRp,MutableVector2_:()=>o.elw,MutableVector2d:()=>o.th1,MutableVector3:()=>o.d6n,MutableVector3_:()=>o.I18,MutableVector3d:()=>o.oVE,MutableVector4:()=>o.xQg,MutableVector4_:()=>o.e2p,MutableVector4d:()=>o.hnX,None:()=>o.Hq9,NormalMatrixShaderNode:()=>o.fbG,NormalizeShaderNode:()=>o.dHi,Ok:()=>o.Ok,Option:()=>o.Wxm,OrbitCameraController:()=>o.jfW,OutColorShaderNode:()=>o.y8Z,OutPositionShaderNode:()=>o.Nus,PhysicsComponent:()=>o.ZeV,PixelFormat:()=>o.VIj,Plane:()=>o.JOQ,Primitive:()=>o.WV0,PrimitiveMode:()=>o.TcR,PrimitiveSortKey_BitLength_Depth:()=>o.Qob,PrimitiveSortKey_BitLength_Material:()=>o.xzx,PrimitiveSortKey_BitLength_PrimitiveType:()=>o.aKP,PrimitiveSortKey_BitLength_TranslucencyType:()=>o.IMH,PrimitiveSortKey_BitOffset_Material:()=>o.V_R,PrimitiveSortKey_BitOffset_PrimitiveType:()=>o.Y1P,PrimitiveSortKey_BitOffset_TranslucencyType:()=>o.Yxr,PrimitiveSortKey_BitOffset_ViewportLayer:()=>o.BHz,ProcessApproach:()=>o.V7o,ProcessApproachClass:()=>o.yvy,ProcessStage:()=>o.Iqz,ProjectionMatrixShaderNode:()=>o.DEK,Quaternion:()=>o._fP,RenderBuffer:()=>o.NiD,RenderBufferTarget:()=>o.G22,RenderPass:()=>o.CDd,RenderPassHelper:()=>o.$Og,RenderTargetTexture:()=>o._iX,RenderableHelper:()=>o.L0o,RhodoniteImportExtension:()=>o.zYy,RnException:()=>o.MrI,RnObject:()=>o.S7_,RnPromise:()=>o.niV,Scalar:()=>o.Rus,ScalarToVector4ShaderNode:()=>o.udm,Scalar_:()=>o.apw,Scalard:()=>o.kOh,ScaleGizmo:()=>o.que,SceneGraphComponent:()=>o.aj7,ShaderGraphResolver:()=>o.dBk,ShaderNode:()=>o.Zp7,ShaderSemantics:()=>o.f5e,ShaderSemanticsClass:()=>o.wyA,ShaderType:()=>o.HoG,ShaderVariableType:()=>o.LvG,ShaderVariableUpdateInterval:()=>o.axw,ShaderityMaterialContent:()=>o.unQ,ShaderityUtility:()=>o.QIo,ShadingModel:()=>o.DAE,ShadowMap:()=>o.l6Z,ShadowMapDecodeClassicMaterialContent:()=>o.RKA,SimpleVertexAttribute:()=>o.OCV,SkeletalComponent:()=>o.YbW,Some:()=>o.bDM,Sphere:()=>o.aLr,SphereCollider:()=>o.BMK,SymbolWeakMap:()=>o.bsk,SynthesizeHdrMaterialContent:()=>o.dob,System:()=>o.xP7,TagGltf2NodeIndex:()=>F.j3U,Texture:()=>o.xEZ,TextureDataFloat:()=>o.h36,TextureFetchMaterialNode:()=>o.IW4,TextureFetchShader:()=>w.S,TextureParameter:()=>o.dIQ,Time:()=>o.qpU,Transform3D:()=>o.WQ0,TransformComponent:()=>o.Uvn,TranslationGizmo:()=>o.ug2,UniformDataShader:()=>S.$,UniformDataShaderNode:()=>o.X1h,VERSION:()=>Q,VRMColliderGroup:()=>o.Dit,VRMSpringBoneGroup:()=>o.UUB,VRMSpringBonePhysicsStrategy:()=>o.tM2,VarianceShadowMapDecodeClassicMaterialContent:()=>o.Q_Q,VaryingInVariableShaderNode:()=>o.hLT,VaryingOutVariableShaderNode:()=>o.H9W,VaryingVariableShader:()=>T.e,Vector2:()=>o.FM8,Vector2_:()=>o.pV,Vector2d:()=>o.EYs,Vector3:()=>o.Pa4,Vector3AndScalarToVector4ShaderNode:()=>o.TaZ,Vector3_:()=>o.pg_,Vector3d:()=>o.UJ,Vector4:()=>o.Ltg,Vector4_:()=>o.rEL,Vector4d:()=>o.Tjf,VectorN:()=>o.j8u,VertexAttribute:()=>o.TaT,VertexAttributeClass:()=>o.x$u,VideoTexture:()=>o.fO1,ViewMatrixShaderNode:()=>o.UaW,Visibility:()=>o.EEb,Vrm0xImporter:()=>o.ao$,VrmComponent:()=>o.ZAV,VrmImporter:()=>o.pbL,WalkThroughCameraController:()=>o.IsZ,WeakNone:()=>o.Lq7,WeakOption:()=>o.lIh,WeakSome:()=>o.Bxs,WebGLContextWrapper:()=>i.d,WebGLExtension:()=>a.c,WebGLResourceRepository:()=>s.x,WebGLStrategyDataTexture:()=>l.X,WebGLStrategyUniform:()=>u.I,WebGpuDeviceWrapper:()=>R,WebGpuResourceRepository:()=>L,WebXRSystem:()=>z.X,WellKnownComponentTIDs:()=>o.zzN,WireframeMaterialNode:()=>o.sqk,WorldMatrixShaderNode:()=>o.KRN,_from:()=>o.lim,_fromString:()=>o.cuJ,_fromStringCaseSensitively:()=>o.bmc,_getPropertyIndex:()=>o.VlM,_getPropertyIndex2:()=>o.ULo,add2:()=>o.Zzs,add2_offset:()=>o.TLr,add3:()=>o.sZE,add3_offset:()=>o.jIe,add4:()=>o.F5f,add4_offset:()=>o.vPp,addLineNumberToCode:()=>o._zI,applyMixins:()=>o.efS,array3_lerp_offsetAsComposition:()=>o.to5,arrayN_lerp_offsetAsComposition:()=>o.wrt,assertDoesNotHave:()=>o.Waq,assertExist:()=>o.dKe,assertHas:()=>o.ZzZ,assertIsErr:()=>o.Z65,assertIsOk:()=>o.UDi,calcAlignedByteLength:()=>o.Kyk,combineImages:()=>o.U28,convertHTMLImageElementToCanvas:()=>o.ABp,createAndAddGltf2BufferView:()=>o.CTh,createEffekseer:()=>o.OHV,createMotionController:()=>V.RQ,deepCopyUsingJsonStringify:()=>o.j37,defaultAnimationTrackName:()=>o.vAU,defaultValue:()=>o.LSm,detectFormatByArrayBuffers:()=>o.Dhi,detectFormatByUri:()=>o.jeP,downloadArrayBuffer:()=>o.CWu,downloadTypedArray:()=>o.$z2,enhanceArray:()=>o.OTk,fromTensorToCompositionType:()=>F.bup,get1:()=>o.nnL,get1_offset:()=>o.w08,get1_offsetAsComposition:()=>o.GWg,get2:()=>o.t5w,get2_offset:()=>o.vk8,get2_offsetAsComposition:()=>o.PFe,get3:()=>o.Ffi,get3_offset:()=>o.Upt,get3_offsetAsComposition:()=>o.Dq2,get4:()=>o.VIV,get4_offset:()=>o.hxV,get4_offsetAsComposition:()=>o.JIQ,getEvent:()=>o.EYp,getMotionController:()=>V.sz,getN_offset:()=>o.fKE,getN_offsetAsComposition:()=>o.lxk,getWebXRSystem:()=>U,greaterThan:()=>o.tSN,ifDefinedThen:()=>o.JxS,ifDefinedThenWithReturn:()=>o.t0P,ifExistsThen:()=>o.fK9,ifExistsThenWithReturn:()=>o.OBD,ifNotExistsThen:()=>o.bhs,ifNotExistsThenWithReturn:()=>o.ZsA,ifUndefinedThen:()=>o.fYc,ifUndefinedThenWithReturn:()=>o.eD0,isSameGlTF2TextureSampler:()=>F.CLY,lessThan:()=>o.QjB,mulArray3WithScalar_offset:()=>o.nsy,mulArray4WithScalar_offset:()=>o.p8g,mulArrayNWithScalar_offset:()=>o.n5i,mulThatAndThisToOutAsMat44_offsetAsComposition:()=>o.QUJ,normalizeArray4:()=>o.XgD,nullishToEmptyArray:()=>o.vVE,nullishToEmptyMap:()=>o.YUA,objectCachify:()=>o.ozT,primitiveCachify1:()=>o.EY5,qlerp_offsetAsComposition:()=>o.Rlh,scalar_lerp_offsetAsComposition:()=>o._7O,setupShaderProgramForMeshComponent:()=>c.M,updateGamePad:()=>V.KA,updateMotionControllerModel:()=>V._0,valueWithCompensation:()=>o.wv6,valueWithDefault:()=>o.kSU});var o=n(1442),i=n(2129),a=n(1067),s=n(2166),c=n(9807),l=n(1623),u=n(733),f=(n(6014),n(8808)),_=n(4387),h=n(1256),d=n(9977),m=n(3740);function v(e,t){for(var n=0;n 0) {\n\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n for (int i = 0; i < ").concat(d.D.maxLightNumberInShader,"; i++) {\n if (i >= u_lightNumber) {\n break;\n }\n\n vec3 lightDirection = u_lights[i].lightDirection.xyz;\n float lightType = u_lights[i].lightPosition.w;\n float spotCosCutoff = u_lights[i].lightDirection.w;\n float spotExponent = u_lights[i].lightIntensity.w;\n\n if (0.75 < lightType) { // is pointlight or spotlight\n lightDirection = normalize(u_lights[i].lightPosition.xyz - position_inWorld.xyz);\n }\n float spotEffect = 1.0;\n if (lightType > 1.75) { // is spotlight\n spotEffect = dot(u_lights[i].lightDirection.xyz, lightDirection);\n if (spotEffect > spotCosCutoff) {\n spotEffect = pow(spotEffect, spotExponent);\n } else {\n spotEffect = 0.0;\n }\n }\n\n vec3 incidentLight = spotEffect * u_lights[i].lightIntensity.xyz;\n// incidentLight *= M_PI;\n\n normal_inWorld = normalize(normal_inWorld);\n\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, lightDirection)) * incidentLight;\n\n if (u_shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(u_viewPosition - position_inWorld.xyz);\n vec3 halfVector = normalize(lightDirection + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), u_shininess);\n } else if (u_shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(u_viewPosition - position_inWorld.xyz);\n vec3 R = reflect(lightDirection, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), u_shininess);\n }\n\n }\n\n outColor = diffuse + specular;\n } else {\n outColor = diffuseColor;\n }\n}\n\n ")}},{key:"pixelShaderBody",get:function(){return""}},{key:"attributeNames",get:function(){return[]}},{key:"attributeSemantics",get:function(){return[]}},{key:"attributeCompositions",get:function(){return[]}}])&&v(t.prototype,n),a}(f.m);g.materialElement=m.Z.PBRShading;var x=n(3389),I=n(6114),E=n(6080),w=n(2489),S=n(4200),T=n(2850),C=n(4436);function P(e,t){for(var n=0;n{n.d(t,{D:()=>I});var r=n(1410),o=n(2342),i=n(429),a=n(6815),s=n(1417),c=n(3279),l=n(6383),u=n(6174),f=n(4021),_=n(9977),h=n(8289),d=n(9197);function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var n=0;n0&&this.__handle.setRandomSeed(this.randomSeed),!0)},A.continue=function(){this.isPause=!1},A.pause=function(){d.Is.exist(this.__handle)&&(this.isPause=!0,clearInterval(this.__timer))},A.stop=function(){d.Is.exist(this.__handle)&&(this.__handle.stop(),this.isPause=!0,clearInterval(this.__timer))},A.setTime=function(e){if(!this.play())return!1;if(d.Is.not.exist(this.__context))return!1;var t=0,n=.0166;for(t=n;t<=e;)if(this.__context.update(t/n),e<(t+=n)){var r=n-(e-t);this.__context.update(r/n);break}return this.pause(),!0},A.$create=function(){this.__sceneGraphComponent=o.g.getComponentOfEntity(this.__entityUid,i.a),this.__transformComponent=o.g.getComponentOfEntity(this.__entityUid,s.U),this.moveStageTo(a.I.Load)},A.__createEffekseerContext=function(){var e=this;if(d.Is.not.exist(this.uri)&&d.Is.not.exist(this.arrayBuffer))return!1;if(effekseer.setImageCrossOrigin(this.isImageLoadWithCredential?"use-credentials":""),this.__context=effekseer.createContext(),d.Is.not.exist(this.__context))return console.error("Effekseer context creation fails"),!1;var t=f.F.getWebGLResourceRepository().currentWebGLContextWrapper;this.__isInitialized=!0;var r=t.getRawContext(),o=d.Is.exist(this.uri)?this.uri:this.arrayBuffer;this.__context.init(r,{enablePremultipliedAlpha:!0});var i=function(){e.playJustAfterLoaded&&(e.play(),e.moveStageTo(a.I.Logic))},s=function(e,t){console.error(e,t)};if("efkpkg"===this.type){if(d.Is.not.exist(n.Unzip))return console.error("Please Set an Unzip object to EffekseerComponent.Unzip"),!1;this.__effect=this.__context.loadEffectPackage(o,n.Unzip,1,i.bind(this),s.bind(this))}else this.__effect=this.__context.loadEffect(o,1,i.bind(this),s.bind(this));return!0},A.$load=function(){var e=this;this.__isInitialized||d.Is.not.exist(this.__context)&&d.Is.not.exist(this.__effect)&&(d.Is.exist(n.wasmModuleUri)?effekseer.initRuntime(n.wasmModuleUri,(function(){e.__createEffekseerContext()&&e.moveStageTo(a.I.Logic)}),(function(){console.error("Failed to initialize Effekseer")})):this.__createEffekseerContext()&&this.moveStageTo(a.I.Logic))},A.$logic=function(){if(this.isPause||d.Is.exist(this.__context)&&d.Is.false(this.isPause)&&this.__context.update(),null!=this.__handle){var e=n.__tmp_identityMatrix_0.copyComponents(this.__sceneGraphComponent.matrixInner);this.__handle.setMatrix(e._v),this.__handle.setSpeed(this.__speed)}this.isPause||this.isLoop&&(this.isPlay()||this.play()),this.moveStageTo(a.I.Render)},A._destroy=function(){d.Is.exist(this.__context)&&(this.__context.releaseEffect(!this.__effect),effekseer.releaseContext(this.__context),this.__context=void 0),d.Is.exist(this.__handle)&&(this.__handle=void 0),this.__effect=void 0},A.$render=function(){if(d.Is.not.exist(this.__effect))this.moveStageTo(a.I.Load);else{var e=l.C.getComponent(c.M,c.M.current),t=n.__tmp_identityMatrix_0,r=n.__tmp_identityMatrix_1;e?(t.copyComponents(e.viewMatrix),r.copyComponents(e.projectionMatrix)):(t.identity(),r.identity()),d.Is.exist(this.__context)&&(this.__context.setProjectionMatrix(r._v),this.__context.setCameraMatrix(t._v),this.__context.draw()),this.moveStageTo(a.I.Logic)}},A.addThisComponentToEntity=function(e,t){var r=function(e){y(r,e);var t=x(r);function r(e,n,o){return m(this,r),t.call(this,e,n,o)}return r.prototype.getEffekseer=function(){return this.getComponentByComponentTID(n.componentTID)},r}(e.constructor);return(0,o.e)(e,r),e},n.sort_$render=function(e){return d.Is.false(e.toRenderEffekseerEffects)?[]:l.C.getComponentsWithType(n).map((function(e){return e.componentSID}))},r=n,p=[{key:"componentTID",get:function(){return u.z.EffekseerComponentTID}}],(h=[{key:"playSpeed",get:function(){return this.__speed},set:function(e){this.__handle&&this.__handle.setSpeed(e),this.__speed=e}},{key:"translate",get:function(){return this.__transformComponent.localPosition},set:function(e){this.__handle&&this.__handle.setLocation(e.x,e.y,e.z),this.__transformComponent.localPosition=e}},{key:"rotate",get:function(){return this.__transformComponent.localEulerAngles},set:function(e){this.__handle&&this.__handle.setRotation(e.x,e.y,e.z),this.__transformComponent.localEulerAngles=e}},{key:"scale",get:function(){return this.__transformComponent.localScale},set:function(e){this.__handle&&this.__handle.setScale(e.x,e.y,e.z),this.__transformComponent.localScale=e}}])&&v(r.prototype,h),p&&v(r,p),n}(r.w);I.ANIMATION_EVENT_PLAY=0,I.ANIMATION_EVENT_PAUSE=1,I.ANIMATION_EVENT_END=2,I.wasmModuleUri=void 0,I.__tmp_identityMatrix_0=h.e.identity(),I.__tmp_identityMatrix_1=h.e.identity(),l.C.registerComponentClass(I)},5241:(e,t,n)=>{n.d(t,{A:()=>r.Effekseer,D:()=>o.D});var r=n(3479),o=n(5737)},3479:(e,t,n)=>{n.r(t),n.d(t,{Effekseer:()=>s});var r=n(5737),o=n(2342),i=n(1417),a=n(429),s=Object.freeze({EffekseerComponent:r.D,createEffekseerEntity:function(){var e=o.g.createEntity(),t=o.g.addComponentToEntity(i.U,e),n=o.g.addComponentToEntity(a.a,t);return o.g.addComponentToEntity(r.D,n)}})},4275:(e,t,n)=>{n.d(t,{m:()=>i});var r=n(6860),o=n(9197),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.zNearMax=.1,this.zFarScalingFactor=1e5,this.autoCalculateZNearAndZFar=!0}var t=e.prototype;return t._calcZNearInner=function(e,t,n){if(this.autoCalculateZNearAndZFar&&o.Is.exist(this.__targetEntity)){var i=this.__targetEntity.getSceneGraph().worldAABB,a=r.P.lengthBtw(t,i.centerPoint),s=i.centerPoint.x-t.x,c=i.centerPoint.y-t.y,l=i.centerPoint.z-t.z,u=(s*n.x+c*n.y+l*n.z)/(Math.hypot(s,c,l)*n.length());e.zNearInner=Math.max(Math.min(a*u-i.lengthCenterToCorner,this.zNearMax),.01)}else e.zNearInner=e.zNear},t._calcZFarInner=function(e){this.autoCalculateZNearAndZFar?e.zFarInner=e.zNearInner*this.zFarScalingFactor:e.zNearInner=e.zFar},e}()},7576:(e,t,n)=>{n.d(t,{j:()=>A});var r=n(6860),o=n(988),i=n(4969),a=n(2863),s=n(7468),c=n(8289),l=n(4275),u=n(9197),f=n(5511),_=n(9977);function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){for(var n=0;nthis.__maximum_y&&(this.__rot_y=this.__maximum_y),null!=this.__minimum_y&&this.__rot_y35&&(this.__pinchInOutOriginalDistance=t,this.__pinchInOutControl=!0)}else this.__pinchInOutOriginalDistance=this.__getTouchesDistance(e)},b.__pinchInOutEnd=function(e){e.touches.length<2&&(this.__pinchInOutControl=!1,this.__pinchInOutOriginalDistance=null)},b.__tryToPreventDefault=function(e){this.__doPreventDefault&&e.preventDefault()},b.__mouseWheel=function(e){this.__tryToPreventDefault(e),this.dolly+=Math.sign(e.deltaY)/200},b.__contextMenu=function(e){this.__tryToPreventDefault(e)},b.__mouseDblClick=function(e){e.shiftKey?this.__mouseTranslateVec.zero():e.ctrlKey&&(this.__rot_y=0,this.__rot_x=0,this.__rot_bgn_y=0,this.__rot_bgn_x=0)},b.__resetDollyAndPosition=function(e){if(!(e.touches.length>1)){var t=(new Date).getTime();t-this.__resetDollyTouchTime<300?(this.dolly=Math.pow(.5,1/2.2),this.__mouseTranslateVec.zero(),this.__rot_x=0,this.__rot_y=0):this.__resetDollyTouchTime=t}},b.__pressShift=function(e){!0===e.shiftKey&&(this.__isPressingShift=!0)},b.__releaseShift=function(e){!1===e.shiftKey&&(this.__isPressingShift=!1)},b.__pressCtrl=function(e){!0===e.ctrlKey&&(this.__isPressingCtrl=!0)},b.__releaseCtrl=function(e){!1===e.ctrlKey&&(this.__isPressingCtrl=!1)},b.registerEventListeners=function(){var e=window;u.Is.exist(_.D.eventTargetDom)&&(e=_.D.eventTargetDom),"ontouchend"in document?f.$t.register(f.jO,[{eventName:"touchstart",handler:this.__touchDownFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchmove",handler:this.__touchMoveFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchend",handler:this.__touchUpFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchmove",handler:this.__pinchInOutFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchend",handler:this.__pinchInOutEndFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchstart",handler:this.__resetDollyAndPositionFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"contextmenu",handler:this.__contextMenuFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"dblclick",handler:this.__mouseDblClickFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}]):f.$t.register(f.jO,[{eventName:"mousedown",handler:this.__mouseDownFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseup",handler:this.__mouseUpFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseleave",handler:this.__mouseUpFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mousemove",handler:this.__mouseMoveFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keydown",handler:this.__pressShiftFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keyup",handler:this.__releaseShiftFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keydown",handler:this.__pressCtrlFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keyup",handler:this.__releaseCtrlFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"contextmenu",handler:this.__contextMenuFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"wheel",handler:this.__mouseWheelFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"dblclick",handler:this.__mouseDblClickFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}])},b.unregisterEventListeners=function(){f.$t.unregister(f.jO)},b.__getFovyFromCamera=function(e){return e.fovy?e.fovy:i.k.radianToDegree(2*Math.atan(Math.abs(e.top-e.bottom)/(2*e.zNear)))},b.logic=function(e){this.__updated&&!this.autoUpdate||(this.__updateTargeting(e),this.__calculateInfluenceOfController(),this.__updateCameraComponent(e),this.__updated=!0)},b.__updateTargeting=function(e){var t=e.eye,n=e._direction,r=e._up,a=this.__eyeVec,c=this.__centerVec,u=this.__upVec.copyComponents(r);if(null==this.__targetEntity)a.copyComponents(t),c.copyComponents(n);else{if(null==this.__originalTargetAABB){var f=this.__targetEntity.tryToGetSceneGraph().worldAABB;this.__originalTargetAABB=f.clone()}if(this.followTargetAABB){var _=this.__targetEntity.tryToGetSceneGraph().worldAABB;c.copyComponents(_.centerPoint)}else c.copyComponents(this.__originalTargetAABB.centerPoint);var h=o.d6.subtractTo(t,n,a).normalize(),d=this.__fixedDolly?this.__fixedLengthOfCenterToEye:this.__originalTargetAABB.lengthCenterToCorner*(1+1/Math.tan(i.k.degreeToRadian(e.fovy/2)))*this.scaleOfLengthCenterToCamera;Math.abs(d)<1e-5&&(d=1),h.multiply(d).add(c);var m=e.entity.tryToGetSceneGraph();if(null!=m){var v=s.J.invertTo(m.matrixInner,l.__tmpMat44_0);v.multiplyVector3To(c,c),v.multiplyVector3To(a,a),v.multiplyVector3To(u,u)}}},b.__calculateInfluenceOfController=function(){var e=o.d6.subtractTo(this.__eyeVec,this.__centerVec,l.__tmpVec3_0);this.__fixedDolly?this.__lengthOfCenterToEye=this.__fixedLengthOfCenterToEye:(e.multiply(this.__dolly*this.dollyScale),this.__lengthOfCenterToEye=e.length());var t=this.__newUpVec,n=this.__newEyeVec,s=this.__newCenterVec,c=this.__newTangentVec;if(this.__isSymmetryMode){var u=l.__tmpVec3_1;u.setComponents(e.x,0,e.z);var f=r.P.angleOfVectors(u,l.__tmp_up);f*=Math.sign(u.cross(l.__tmp_up).y);var _=l.__tmp_rotateM_X,h=l.__tmp_rotateM_Y,d=l.__tmp_rotateM_Reset,m=l.__tmp_rotateM_Revert;_.rotateX(i.k.degreeToRadian(this.__rot_y)),h.rotateY(i.k.degreeToRadian(this.__rot_x)),d.rotateY(i.k.degreeToRadian(f)),m.rotateY(i.k.degreeToRadian(-f));var v=l.__tmp_rotateM;a.x.multiplyTo(_,d,v),v.multiplyByLeft(h),v.multiplyByLeft(m),v.multiplyVectorTo(this.__upVec,t),v.multiplyVectorTo(e,n).add(this.__centerVec),s.copyComponents(this.__centerVec);var p=l.__tmpVec3_2;o.d6.subtractTo(s,n,p),o.d6.crossTo(t,p,c),n.add(this.__mouseTranslateVec),s.add(this.__mouseTranslateVec)}else{var y=l.__tmp_rotateM_X,A=l.__tmp_rotateM_Y;y.rotateX(i.k.degreeToRadian(this.__rot_y)),A.rotateY(i.k.degreeToRadian(this.__rot_x));var b=a.x.multiplyTo(A,y,l.__tmp_rotateM);b.multiplyVectorTo(this.__upVec,t),b.multiplyVectorTo(e,n).add(this.__centerVec),s.copyComponents(this.__centerVec);var g=l.__tmpVec3_1;o.d6.subtractTo(s,n,g),o.d6.crossTo(t,g,c),n.add(this.__mouseTranslateVec),s.add(this.__mouseTranslateVec)}},b.__updateCameraComponent=function(e){var t=l.__tmpVec3_0.copyComponents(this.__newCenterVec);t.subtract(this.__newEyeVec).normalize(),this._calcZNearInner(e,this.__newEyeVec,t),this._calcZFarInner(e);var n=e.zFar/e.zNear/this.__scaleOfZNearAndZFar,r=e.left+n,o=e.right+n,a=e.top+n,s=e.bottom+n,c=this.__getFovyFromCamera(e);this.__fovyBias=Math.tan(i.k.degreeToRadian(c/2)),e.eyeInner=this.__newEyeVec,e.directionInner=this.__newCenterVec,e.upInner=this.__newUpVec,e.leftInner=r,e.rightInner=o,e.topInner=a,e.bottomInner=s,e.fovyInner=c},b.setFixedDollyTrue=function(e){this.__fixedLengthOfCenterToEye=e,this.__fixedDolly=!0},b.unsetFixedDolly=function(){this.__fixedDolly=!1},y=l,(A=[{key:"doPreventDefault",get:function(){return this.__doPreventDefault},set:function(e){this.__doPreventDefault=e}},{key:"rotX",get:function(){return this.__rot_x},set:function(e){this.__rot_x=e}},{key:"rotY",get:function(){return this.__rot_y},set:function(e){this.__rot_y=e}},{key:"maximumY",set:function(e){this.__maximum_y=e}},{key:"minimumY",set:function(e){this.__minimum_y=e}},{key:"dolly",get:function(){return Math.pow(this.__dolly,.2)},set:function(e){e=Math.min(e,1),e=Math.max(e,1e-4);var t=Math.pow(e,5);t=Math.max(t,1e-4),this.__dolly=t}},{key:"scaleOfZNearAndZFar",get:function(){return this.__scaleOfZNearAndZFar},set:function(e){this.__scaleOfZNearAndZFar=e}},{key:"isMouseDown",get:function(){return this.__isMouseDown}},{key:"lastMouseDownTimeStamp",get:function(){return this.__lastMouseDownTimeStamp}},{key:"lastMouseUpTimeStamp",get:function(){return this.__lastMouseUpTimeStamp}}])&&d(y.prototype,A),l}(l.m);A.__tmp_up=r.P.fromCopyArray([0,0,1]),A.__tmpVec3_0=o.d6.zero(),A.__tmpVec3_1=o.d6.zero(),A.__tmpVec3_2=o.d6.zero(),A.__tmp_rotateM_X=a.x.identity(),A.__tmp_rotateM_Y=a.x.identity(),A.__tmp_rotateM=a.x.identity(),A.__tmp_rotateM_Reset=a.x.identity(),A.__tmp_rotateM_Revert=a.x.identity(),A.__tmpMat44_0=c.e.identity()},8430:(e,t,n)=>{n.d(t,{I:()=>A});var r=n(7468),o=n(9409),i=n(988),a=n(2863),s=n(8289),c=n(4275),l=n(4969),u=n(9197),f=n(5511);function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{eventTargetDom:document,verticalSpeed:1,horizontalSpeed:1,turnSpeed:.25,mouseWheelSpeedScale:1,inverseVerticalRotating:!1,inverseHorizontalRotating:!1};h(this,s),(e=a.call(this))._isKeyDown=!1,e._isMouseDrag=!1,e._lastKeyCode=-1,e._currentDir=i.d6.fromCopyArray([0,0,-1]),e._currentPos=i.d6.fromCopyArray([0,0,0]),e._currentCenter=i.d6.fromCopyArray([0,0,-1]),e._currentHorizontalDir=i.d6.fromCopyArray([0,0,-1]),e._newDir=i.d6.fromCopyArray([0,0,-1]),e._isMouseDown=!1,e._clickedMouseXOnCanvas=-1,e._clickedMouseYOnCanvas=-1,e._draggedMouseXOnCanvas=-1,e._draggedMouseYOnCanvas=-1,e._deltaMouseXOnCanvas=-1,e._deltaMouseYOnCanvas=-1,e._mouseXAdjustScale=1,e._mouseYAdjustScale=1,e._deltaY=-1,e._deltaX=-1,e._mouseUpBind=e._mouseUp.bind(_(e)),e._mouseDownBind=e._mouseDown.bind(_(e)),e._mouseMoveBind=e._mouseMove.bind(_(e)),e._mouseWheelBind=e._mouseWheel.bind(_(e)),e.__doPreventDefault=!1,e._needInitialize=!0,e._horizontalSpeed=t.horizontalSpeed,e._verticalSpeed=t.verticalSpeed,e._turnSpeed=t.turnSpeed,e._mouseXAdjustScale=e._turnSpeed,e._mouseYAdjustScale=e._turnSpeed,e._mouseWheelSpeedScale=t.mouseWheelSpeedScale,e._inverseVerticalRotating=t.inverseVerticalRotating,e._inverseHorizontalRotating=t.inverseHorizontalRotating,e.reset(),e._onKeydown=function(t){e._isKeyDown=!0,e._lastKeyCode=t.keyCode},e._onKeyup=function(t){e._isKeyDown=!1,e._lastKeyCode=-1};var n=t.eventTargetDom;return e.registerEventListeners(n),e}var c,y,A=s.prototype;return A.registerEventListeners=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document;this._eventTargetDom=e;var t=[{eventName:"keydown",handler:this._onKeydown,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keyup",handler:this._onKeyup,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}];"ontouchend"in document&&t.push({eventName:"touchstart",handler:this._mouseDownBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchend",handler:this._mouseUpBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchmove",handler:this._mouseMoveBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}),"onmouseup"in document&&t.push({eventName:"mousedown",handler:this._mouseDownBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseup",handler:this._mouseUpBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseleave",handler:this._mouseUpBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mousemove",handler:this._mouseMoveBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}),"onwheel"in document&&t.push({eventName:"wheel",handler:this._mouseWheelBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}),f.$t.register(f.jO,t)},A.unregisterEventListeners=function(){f.$t.unregister(f.jO)},A.__tryToPreventDefault=function(e){this.__doPreventDefault&&e.preventDefault()},A._mouseWheel=function(e){if(null!==this._currentDir){var t=-1*Math.sign(e.deltaY)*this._mouseWheelSpeedScale*this._horizontalSpeed,n=s.__tmp_Vec3_0;n.setComponents(this._currentDir.x,0,this._currentDir.z).normalize();var r=i.d6.multiplyTo(n,t,s.__tmp_Vec3_1);this._currentPos.add(r),this._currentCenter.add(r)}},A._mouseDown=function(e){this.__tryToPreventDefault(e),this._isMouseDown=!0;var t=e.target.getBoundingClientRect();return this._clickedMouseXOnCanvas=e.clientX-t.left,this._clickedMouseYOnCanvas=e.clientY-t.top,!1},A._mouseMove=function(e){if(this.__tryToPreventDefault(e),this._isMouseDown){var t=e.target.getBoundingClientRect();this._draggedMouseXOnCanvas=e.clientX-t.left,this._draggedMouseYOnCanvas=e.clientY-t.top,this._deltaMouseXOnCanvas=this._draggedMouseXOnCanvas-this._clickedMouseXOnCanvas,this._deltaMouseYOnCanvas=this._draggedMouseYOnCanvas-this._clickedMouseYOnCanvas,this._isMouseDrag=!0}},A._mouseUp=function(e){this._isMouseDown=!1,this._isMouseDrag=!1;var t=e.target;if(null!=(null==t?void 0:t.getBoundingClientRect)){var n=t.getBoundingClientRect();this._clickedMouseXOnCanvas=e.clientX-n.left,this._clickedMouseYOnCanvas=e.clientY-n.top}},A.tryReset=function(){},A.reset=function(){this._isKeyDown=!1,this._lastKeyCode=-1,this._currentPos.zero(),this._currentCenter.setComponents(0,0,-1),this._currentDir.setComponents(0,0,-1),this._currentHorizontalDir.setComponents(0,0,-1),this._isMouseDown=!1,this._isMouseDrag=!1,this._draggedMouseXOnCanvas=-1,this._draggedMouseYOnCanvas=-1,this._deltaMouseXOnCanvas=-1,this._deltaMouseYOnCanvas=-1,this._mouseXAdjustScale=this._turnSpeed,this._mouseYAdjustScale=this._turnSpeed,this._deltaY=0,this._deltaX=0,this._newDir.setComponents(0,0,-1)},A.logic=function(e){this.__updateCameraComponent(e)},A.__updateCameraComponent=function(e){var t=this.__targetEntity.getSceneGraph().worldAABB;if(this._needInitialize&&null!=t){var n=t.lengthCenterToCorner*(1+1/Math.tan(l.k.degreeToRadian(e.fovy/2)));this._currentPos.copyComponents(t.centerPoint),this._currentPos.z+=n,this._currentCenter.copyComponents(t.centerPoint),this._currentDir.setComponents(0,0,-1);var o=e.entity.tryToGetSceneGraph();if(u.Is.exist(o)){var a=r.J.invertTo(o.matrixInner,s.__tmpInvMat);a.multiplyVector3To(this._currentPos,this._currentPos),a.multiplyVector3To(this._currentCenter,this._currentCenter)}this._needInitialize=!1}var c=this._deltaY/90;this._newDir.x=this._currentDir.x*(1-c),this._newDir.y=c,this._newDir.z=this._currentDir.z*(1-c),this._newDir.normalize(),this._currentHorizontalDir.x=this._currentDir.x,this._currentHorizontalDir.y=0,this._currentHorizontalDir.z=this._currentDir.z,this._currentHorizontalDir.normalize();var f=s.__tmp_Vec3_0.zero();switch(this._lastKeyCode){case 87:case 38:f.x=this._currentHorizontalDir.x*this._horizontalSpeed,f.z=this._currentHorizontalDir.z*this._horizontalSpeed;break;case 65:case 37:f.x=this._currentHorizontalDir.z*this._horizontalSpeed,f.z=-this._currentHorizontalDir.x*this._horizontalSpeed;break;case 83:case 40:f.x=-this._currentHorizontalDir.x*this._horizontalSpeed,f.z=-this._currentHorizontalDir.z*this._horizontalSpeed;break;case 68:case 39:f.x=-this._currentHorizontalDir.z*this._horizontalSpeed,f.z=this._currentHorizontalDir.x*this._horizontalSpeed;break;case 81:f.x=-this._newDir.x*this._horizontalSpeed,f.y=-this._newDir.y*this._horizontalSpeed,f.z=-this._newDir.z*this._horizontalSpeed;break;case 69:f.x=this._newDir.x*this._horizontalSpeed,f.y=this._newDir.y*this._horizontalSpeed,f.z=this._newDir.z*this._horizontalSpeed;break;case 82:f.y=this._verticalSpeed;break;case 70:f.y=-this._verticalSpeed}if(this._currentPos.add(f),this._currentCenter.add(f),this._isMouseDrag){this._inverseHorizontalRotating?this._deltaX=this._deltaMouseXOnCanvas*this._mouseXAdjustScale:this._deltaX=-this._deltaMouseXOnCanvas*this._mouseXAdjustScale,this._inverseVerticalRotating?this._deltaY+=this._deltaMouseYOnCanvas*this._mouseYAdjustScale:this._deltaY+=-this._deltaMouseYOnCanvas*this._mouseYAdjustScale,this._deltaY=Math.max(-120,Math.min(50,this._deltaY));var _=s.__tmpRotateMat.rotateY(l.k.degreeToRadian(this._deltaX));_.multiplyVectorTo(this._currentDir,this._currentDir);var h=i.d6.subtractTo(this._currentCenter,this._currentPos,s.__tmp_Vec3_1);_.multiplyVectorTo(h,h),h.x=h.x*(1-c),h.y=c,h.z=h.z*(1-c),h.normalize(),this._currentCenter.copyComponents(this._currentPos),this._currentCenter.add(h),this._clickedMouseXOnCanvas=this._draggedMouseXOnCanvas,this._clickedMouseYOnCanvas=this._draggedMouseYOnCanvas,this._deltaMouseXOnCanvas=0,this._deltaMouseYOnCanvas=0}e.eyeInner=this._currentPos,e.directionInner=this._currentCenter,e.upInner=e._up,e.leftInner=e.left,e.rightInner=e.right,e.topInner=e.top,e.bottomInner=e.bottom,e.fovyInner=e.fovy,this._calcZNearInner(e,this._currentPos,this._newDir),this._calcZFarInner(e)},A.getDirection=function(){return null!==this._currentCenter?this._newDir.clone():null},A.setTarget=function(e){var t=e.tryToGetSceneGraph().worldAABB.lengthCenterToCorner/10;this.verticalSpeed=t,this.horizontalSpeed=t,this.__targetEntity=e,this._needInitialize=!0},A.getTarget=function(){return this.__targetEntity},c=s,(y=[{key:"horizontalSpeed",get:function(){return this._horizontalSpeed},set:function(e){this._horizontalSpeed=e}},{key:"verticalSpeed",get:function(){return this._verticalSpeed},set:function(e){this._verticalSpeed=e}},{key:"mouseWheelSpeed",get:function(){return this._mouseWheelSpeedScale},set:function(e){this._mouseWheelSpeedScale=e}},{key:"allInfo",get:function(){var e={};return e.verticalSpeed=this.verticalSpeed,e.horizontalSpeed=this.horizontalSpeed,e._turnSpeed=this._turnSpeed,this._currentPos&&(e._currentPos=this._currentPos.clone()),this._currentCenter&&(e._currentCenter=this._currentCenter.clone()),this._currentDir&&(e._currentDir=this._currentDir.clone()),e._deltaY=this._deltaY,e._newDir=this._newDir.clone(),e},set:function(e){var t=e;for(var n in"string"==typeof e&&(t=JSON.parse(e)),t)t.hasOwnProperty(n)&&n in this&&(this[n]="quaternion"===n?o.D.cloneOfMathObjects(o.D.arrayToQuaternion(t[n])):o.D.cloneOfMathObjects(o.D.arrayToVectorOrMatrix(t[n])))}}])&&d(c.prototype,y),s}(c.m);A.__tmpInvMat=s.e.identity(),A.__tmpRotateMat=a.x.identity(),A.__tmp_Vec3_0=i.d6.zero(),A.__tmp_Vec3_1=i.d6.zero()},5054:(e,t,n)=>{n.d(t,{c:()=>O});var r=n(1410),o=n(6383),i=n(2342),a=n(6174),s=n(9611),c=n(166),l=n(1417),u=n(6815),f=n(1274),_=n(7906),h=n(5233),d=n(7058),m=n(6860),v=n(9197),p=n(5241),y=n(1855),A=n(9958);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n.5?0===this.__isEffekseerState&&(null===(d=this.__effekseerComponent)||void 0===d||d.play()):1===this.__isEffekseerState&&(null===(v=this.__effekseerComponent)||void 0===v||v.pause()),this.__isEffekseerState=_[0]}}}catch(e){r=!0,o=e}finally{try{t||null==a.return||a.return()}finally{if(r)throw o}}}}},I.setIsAnimating=function(e){this.__isAnimating=e},I.setActiveAnimationTrack=function(e){return!!this.__animationTracks.has(e)&&(this.__currentActiveAnimationTrackName=e,!0)},I.getActiveAnimationTrack=function(){return this.__currentActiveAnimationTrackName},I.hasAnimation=function(e,t){var n=this.__animationTracks.get(e);return!v.Is.not.exist(n)&&n.has(t)},I.setAnimation=function(e,t,r,o,a,s){var c,u=!(arguments.length>6&&void 0!==arguments[6])||arguments[6];this.__currentActiveAnimationTrackName=u?e:(0,f.kS)({value:this.__currentActiveAnimationTrackName,defaultValue:e});var _={sampler:{input:r,output:o,outputComponentN:a,interpolationMethod:s},target:{pathName:t,entity:this.entity},belongTrackName:e},h=this.__animationTracks.get(e);v.Is.not.exist(h)&&(h=new Map,this.__animationTracks.set(e,h)),h.set(t,_);var d=r[0],m=r[r.length-1],p=(0,f.kS)({value:n.__animationGlobalInfo.get(e),defaultValue:M}),y=p.maxStartInputTime,A=p.maxEndInputTime,b=(0,f.Qj)(y,d),g=(0,f.tS)(m,A);if(b.result||g.result){var x={name:e,maxStartInputTime:b.less,maxEndInputTime:g.greater};n.__animationGlobalInfo.set(e,x),n.__pubsub.publishAsync(n.Event.ChangeAnimationInfo,{infoMap:new Map(n.__animationGlobalInfo)})}this.__transformComponent=i.g.getComponentOfEntity(this.__entityUid,l.U),null===(c=this.__transformComponent)||void 0===c||c._backupTransformAsRest()},I.getStartInputValueOfAnimation=function(e){var t=null!=e?e:this.__currentActiveAnimationTrackName;if(void 0===t){var r=Array.from(n.__animationGlobalInfo.values());return 0===r.length?0:r[0].maxEndInputTime}return(0,f.kS)({value:n.__animationGlobalInfo.get(t),defaultValue:M}).maxStartInputTime},I.getEndInputValueOfAnimation=function(e){var t=null!=e?e:this.__currentActiveAnimationTrackName;if(void 0===t){var r=Array.from(n.__animationGlobalInfo.values());return 0===r.length?0:r[0].maxEndInputTime}return(0,f.kS)({value:n.__animationGlobalInfo.get(t),defaultValue:M}).maxEndInputTime},I.getAnimationTrackNames=function(){return Array.from(this.__animationTracks.keys())},I.getAnimationChannelsOfTrack=function(e){return this.__animationTracks.get(e)},I.addThisComponentToEntity=function(e,t){var n=function(e){E(n,e);var t=D(n);function n(e,r,o){return g(this,n),t.call(this,e,r,o)}return n.prototype.getAnimation=function(){return this.getComponentByComponentTID(a.z.AnimationComponentTID)},n}(e.constructor);return(0,i.e)(e,n),e},I.addKeyFrame=function(e,t,r,o){var i=r/o,a=i,s=(r+1)/o,l=this.__animationTracks.get(e);if(v.Is.not.exist(l))return!1;var u=l.get(t);if(v.Is.not.exist(u))return!1;ArrayBuffer.isView(u.sampler.input)&&(u.sampler.input=Array.from(u.sampler.input)),ArrayBuffer.isView(u.sampler.output)&&(u.sampler.output=Array.from(u.sampler.output));var f,_=c.s.fromString(t).index,h=n.__interpolate(u,n.globalTime,_);if(0===u.sampler.input.length)u.sampler.input.push(a),(f=u.sampler.output).push.apply(f,C(h));else if(1===u.sampler.input.length){var d,m=u.sampler.input[0];if(s>1)]=e[r]&&t<=e[o];)if(e[n=Math.floor(r+(t-e[r])*(o-r)/(e[o]-e[r]))]{n.d(t,{x:()=>v});var r=n(1410),o=n(6383),i=n(2342),a=n(6174),s=n(6815);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n{n.d(t,{M:()=>N});var r=n(6383),o=n(1410),i=n(2342),a=n(6174),s=n(6860),c=n(6264),l=n(2637),u=n(7468),f=n(429),_=n(5171),h=n(2535),d=n(8289),m=n(6815),v=n(2328),p=n(988),y=n(1560),A=n(9977),b=n(9481),g=n(7416),x=n(4969),I=n(178),E=n(9197),w=n(9805);function S(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e,t){for(var n=0;n{n.d(t,{S:()=>b});var r=n(1410),o=n(2342),i=n(3279),a=n(6815),s=n(6383),c=n(6174),l=n(7576),u=n(8430),f=n(5674);function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n{n.d(t,{r:()=>E});var r=n(6383),o=n(1410),i=n(2342),a=n(6174),s=n(9805),c=n(6860),l=n(429),u=n(6815),f=n(9977),_=n(9481),h=n(7416),d=n(2328),m=n(2175);function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p(e,t){for(var n=0;n{n.d(t,{$:()=>S});var r=n(6383),o=n(1410),i=n(2342),a=n(6174),s=n(6815),c=n(6860),l=n(6264),u=n(429),f=n(7468),_=n(8289),h=n(9409),d=n(988),m=n(9197),v=n(9958),p=n(1274);function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0;if(this.__mesh){var r=e,o=t;if(this.__sceneGraphComponent){var i=f.J.invert(this.__sceneGraphComponent.matrixInner);r=c.P.fromCopyVector4(i.multiplyVector(l.Lt.fromCopyVector3(e)));var a=c.P.add(e,t),s=c.P.fromCopyVector4(i.multiplyVector(l.Lt.fromCopyVector3(a)));o=c.P.normalize(c.P.subtract(s,r));var u=this.__mesh.castRay(r,o,n),_=null;if(m.Is.defined(u.data)&&u.data.t>=0)return _=c.P.fromCopyVector4(this.__sceneGraphComponent.matrixInner.multiplyVector(l.Lt.fromCopyVector3(u.data.position))),{result:!0,data:{t:u.data.t,u:u.data.u,v:u.data.v,position:_}}}}return{result:!1}},I.castRayFromScreenInLocal=function(e,t,r,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(this.__mesh&&this.__sceneGraphComponent){var a=_.e.multiplyTo(r.projectionMatrix,r.viewMatrix,n.__tmpMatrix44_0).multiply(this.__sceneGraphComponent.matrixInner).invert(),s=h.D.unProjectTo(e,t,0,a,o,n.__tmpVector3_0),c=h.D.unProjectTo(e,t,1,a,o,n.__tmpVector3_1),l=d.d6.subtractTo(c,s,n.__tmpVector3_2).normalize(),u=this.__mesh.castRay(s,l,i);if(m.Is.defined(u.data)&&u.data.t>=0)return{result:!0,data:{t:u.data.t,u:u.data.u,v:u.data.v,position:u.data.position}}}return{result:!1}},I.castRayFromScreenInWorld=function(e,t,r,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=this.castRayFromScreenInLocal(e,t,r,o,i);if(this.__mesh&&this.__sceneGraphComponent&&a.result){(0,p.dK)(a.data);var s=this.__sceneGraphComponent.matrixInner.multiplyVector3To(a.data.position,n.__returnVector3);return{result:!0,data:{t:a.data.t,u:a.data.u,v:a.data.v,position:s}}}return a},I.$create=function(){this.__blendShapeComponent=i.g.getComponentOfEntity(this.__entityUid,v.x),this.__sceneGraphComponent=i.g.getComponentOfEntity(this.__entityUid,u.a),this.moveStageTo(s.I.Load)},I.$load=function(){null!=this.__mesh&&(this.__mesh._calcTangents(),this.__mesh._calcFaceNormalsIfNonNormal(),this.__blendShapeComponent&&this.__blendShapeComponent.weights.length>0&&this.__mesh._calcBaryCentricCoord(),this.moveStageTo(s.I.Logic))},I.$logic=function(){},I._shallowCopyFrom=function(e){var t=e;this.__viewDepth=t.__viewDepth,m.Is.exist(t.__mesh)&&this.setMesh(t.__mesh),this.isPickable=t.isPickable},I.addThisComponentToEntity=function(e,t){var n=function(e){g(n,e);var t=w(n);function n(e,r,o){return y(this,n),t.call(this,e,r,o)}return n.prototype.getMesh=function(){return this.getComponentByComponentTID(a.z.MeshComponentTID)},n}(e.constructor);return(0,i.e)(e,n),e},n.alertNoMeshSet=function(e){console.debug("No mesh is set on this MeshComponent:"+e.componentSID)},n.common_$load=function(e){e.processApproach;var t=r.C.getComponentsWithType(n),o=!0,i=!1,a=void 0;try{for(var c,l=t[Symbol.iterator]();!(o=(c=l.next()).done);o=!0){var u=c.value,f=u.mesh;if(m.Is.exist(f))for(var _=f.getPrimitiveNumber(),h=0;h<_;h++){var d=f.getPrimitiveAt(h);if(d.positionAccessorVersion!==n.__latestPrimitivePositionAccessorVersion){var v=u.entity.tryToGetMeshRenderer();null==v||v.moveStageTo(s.I.Load),n.__latestPrimitivePositionAccessorVersion=d.positionAccessorVersion}}}}catch(e){i=!0,a=e}finally{try{o||null==l.return||l.return()}finally{if(i)throw a}}},o=n,x=[{key:"componentTID",get:function(){return a.z.MeshComponentTID}}],(b=[{key:"mesh",get:function(){return this.__mesh}},{key:"viewDepth",get:function(){return this.__viewDepth}},{key:"entity",get:function(){return i.g.getEntity(this.__entityUid)}}])&&A(o.prototype,b),x&&A(o,x),n}(o.w);S.__tmpVector3_0=d.d6.zero(),S.__tmpVector3_1=d.d6.zero(),S.__tmpVector3_2=d.d6.zero(),S.__returnVector3=d.d6.zero(),S.__tmpMatrix44_0=_.e.zero(),S.__latestPrimitivePositionAccessorVersion=0,r.C.registerComponentClass(S)},6807:(e,t,n)=>{n.d(t,{Y:()=>g});var r=n(6383),o=n(1410),i=n(9856),a=n(6815),s=n(2342),c=n(6174),l=n(3279),u=n(178),f=n(5653),_=n(9807);function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var n=0;n>u&1){n._lastOpaqueIndex=s-1,n._firstTransparentSortKey=c._sortkey;break}}return-1===n._lastOpaqueIndex&&(n._lastOpaqueIndex=o.length-1),o.length>0&&(n._lastTransparentIndex=o.length-1,n._lastTransparentSortKey=o[o.length-1]._sortkey),a},n.__cullingWithViewFrustum=function(e,t,r){var o=[];if(e&&n.isViewFrustumCullingEnabled){e.updateFrustum();var i=e.frustum,a=function(e,t){if("background-assets"===e.entity.getTagValue("type")||i.culling(e)){t.push(e),e.entity.getSceneGraph()._isCulled=!1;var n=e.entity.tryToGetSkeletal();void 0!==n&&(n._isCulled=!1)}else{e.entity.getSceneGraph()._isCulled=!0;var r=e.entity.tryToGetSkeletal();void 0!==r&&(r._isCulled=!0)}},s=!0,c=!1,l=void 0;try{for(var u,f=t[Symbol.iterator]();!(s=(u=f.next()).done);s=!0)a(u.value,o)}catch(e){c=!0,l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}}else o=r.meshComponents;for(var h=[],d=0;d{n.d(t,{Z:()=>p});var r=n(1410),o=n(6383),i=n(2342),a=n(6174),s=n(6815),c=n(3022);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n{n.d(t,{a:()=>M});var r=n(6383),o=n(1410),i=n(7468),a=n(2342),s=n(2535),c=n(6174),l=n(5171),u=n(6815),f=n(8289),_=n(2863),h=n(6860),d=n(6631),m=n(988),v=n(706),p=n(139),y=n(9197),A=n(3206),b=n(5914),g=n(1855);function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var n=0;n=0},r.setWorldMatrixRestDirty=function(){this.matrixRestInner,this.setWorldMatrixRestDirtyRecursively()},r.setWorldMatrixRestDirtyRecursively=function(){this.__isWorldMatrixRestUpToDate=!1,this.children.forEach((function(e){e.setWorldMatrixRestDirtyRecursively()}))},r.setWorldMatrixDirty=function(){var e;this.setWorldMatrixDirtyRecursively(),null===(e=this.parent)||void 0===e||e.setWorldAABBDirtyParentRecursively()},r.setWorldMatrixDirtyRecursively=function(){this.__isWorldMatrixUpToDate=!1,this.__isNormalMatrixUpToDate=!1,this.__isWorldAABBDirty=!0,this.children.forEach((function(e){e.setWorldMatrixDirtyRecursively()}))},r.setWorldAABBDirtyParentRecursively=function(){var e;this.__isWorldAABBDirty=!0,null===(e=this.parent)||void 0===e||e.setWorldAABBDirtyParentRecursively()},r.addChild=function(e){y.Is.exist(e.__parent)&&e.__parent.removeChild(e),e.__parent=this,this.__children.push(e)},r.removeChild=function(e){var t=this.__children.indexOf(e);t>=0&&this.__children.splice(t,1),e.__parent=void 0},r._addGizmoChild=function(e){e.__parent=this,this.__gizmoChildren.push(e)},r.isWorldMatrixUpToDateRecursively=function(){return!!this.__isWorldMatrixUpToDate&&(!this.__parent||this.__parent.isWorldMatrixUpToDateRecursively())},r.__calcWorldMatrixRecursively=function(){if(this.__isWorldMatrixUpToDate)return this._worldMatrix;var e=a.g.getEntity(this.__entityUid).getTransform();if(null==this.__parent||this.toMakeWorldMatrixTheSameAsLocalMatrix)return e.localMatrixInner;var t=this.__parent.__calcWorldMatrixRecursively();return f.e.multiplyTo(t,e.localMatrixInner,this.__tmpMatrix)},r.__calcWorldMatrixRestRecursively=function(){if(this.__isWorldMatrixRestUpToDate)return this._worldMatrixRest;var e=a.g.getEntity(this.__entityUid).getTransform();if(null==this.__parent||this.toMakeWorldMatrixTheSameAsLocalMatrix)return e.localMatrixRestInner;var t=this.__parent.__calcWorldMatrixRestRecursively();return f.e.multiplyTo(t,e.localMatrixRestInner,this.__tmpMatrix)},r.getQuaternionRecursively=function(){if(y.Is.not.exist(this.parent))return this.entity.getTransform().localRotation;var e=this.parent.getQuaternionRecursively();return g._f.multiply(e,this.entity.getTransform().localRotation)},r.getWorldPositionOf=function(e){return this.matrixInner.multiplyVector3(e)},r.getLocalPositionOf=function(e){return i.J.invert(this.matrixInner).multiplyVector3(e)},r.calcWorldAABB=function(){return this.__worldAABB.initialize(),function e(t){var n=t.entity.tryToGetMesh();y.Is.exist(n)&&y.Is.exist(n.mesh)&&d.m.multiplyMatrixTo(t.entityWorldMatrixInner,n.mesh.AABB,t.__worldAABB);for(var r=t.children,o=0;o2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=n.flattenHierarchy(this,!1),a=[],s=!0,c=!1,l=void 0;try{for(var u,f=i[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var _=u.value,h=_.entity.tryToGetMesh();h&&a.push(h)}}catch(e){c=!0,l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}var d=Number.MAX_VALUE,m=void 0,v=void 0,p=0,A=0,b=!0,g=!1,x=void 0;try{for(var I,E=a[Symbol.iterator]();!(b=(I=E.next()).done);b=!0){var w=I.value;if(w.entity.getSceneGraph().isVisible&&w.isPickable&&-1===o.indexOf(w)){var S=w.castRay(e,t,r);y.Is.defined(S.data)&&S.data.t4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[],s=n.flattenHierarchy(this,!1),c=[],l=!0,u=!1,f=void 0;try{for(var _,h=s[Symbol.iterator]();!(l=(_=h.next()).done);l=!0){var d=_.value,m=d.entity.tryToGetMesh();m&&c.push(m)}}catch(e){u=!0,f=e}finally{try{l||null==h.return||h.return()}finally{if(u)throw f}}var v=Number.MAX_VALUE,p=void 0,A=void 0,b=0,g=0,x=!0,I=!1,E=void 0;try{for(var w,S=c[Symbol.iterator]();!(x=(w=S.next()).done);x=!0){var T=w.value;if(T.entity.getSceneGraph().isVisible&&T.isPickable&&-1===a.indexOf(T)){var C=T.castRayFromScreenInWorld(e,t,r,o,i);y.Is.defined(C.data)&&C.data.t{n.d(t,{Y:()=>T});var r=n(6383),o=n(1410),i=n(2342),a=n(6174),s=n(7468),c=n(6815),l=n(988),u=n(8776),f=n(4969),_=n(2328),h=n(8289),d=n(7416),m=n(9481),v=n(9977),p=n(8468),y=n(7690);function A(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;nMath.abs(i.y)?Math.abs(i.x)>Math.abs(i.z)?i.x:i.z:Math.abs(i.y)>Math.abs(i.z)?i.y:i.z,this.__tsArray[4*e+3]=s}if(v.D.boneDataType===p.N.Vec4x2){var c=f.k.packNormalizedVec4ToVec2(a.x,a.y,a.z,a.w,Math.pow(2,12));this.__tqArray[4*e+0]=r.m03,this.__tqArray[4*e+1]=r.m13,this.__tqArray[4*e+2]=r.m23,this.__sqArray[4*e+0]=i.x,this.__sqArray[4*e+1]=i.y,this.__sqArray[4*e+2]=i.z,this.__tqArray[4*e+3]=c[0],this.__sqArray[4*e+3]=c[1]}else v.D.boneDataType===p.N.Vec4x2Old&&(this.__tsArray[4*e+0]=r.m03,this.__tsArray[4*e+1]=r.m13,this.__tsArray[4*e+2]=r.m23,this.__qArray[4*e+0]=a.x,this.__qArray[4*e+1]=a.y,this.__qArray[4*e+2]=a.z,this.__qArray[4*e+3]=a.w);if(v.D.boneDataType===p.N.Vec4x1){this.__tsArray[4*e+0]=r.m03,this.__tsArray[4*e+1]=r.m13,this.__tsArray[4*e+2]=r.m23;var l=f.k.packNormalizedVec4ToVec2(a.x,a.y,a.z,a.w,Math.pow(2,12));this.__qtsArray[4*e+0]=l[0],this.__qtsArray[4*e+1]=l[1]}}}if(v.D.boneDataType===p.N.Vec4x1){for(var u=1,_=1,d=1,m=0;mu&&(u=y);var A=Math.abs(this.__tsArray[4*m+1]);A>_&&(_=A);var b=Math.abs(this.__tsArray[4*m+2]);b>d&&(d=b)}this.__qtsInfo.x=u,this.__qtsInfo.y=_,this.__qtsInfo.z=d,this.__qtsInfo.w=1;for(var g=0;g{n.d(t,{U:()=>b});var r=n(1410),o=n(6383),i=n(2342),a=n(6174),s=n(6815),c=n(988),l=n(1855),u=n(7690);function f(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _(e,t){for(var n=0;n{n.d(t,{Z:()=>p});var r=n(1410),o=n(6383),i=n(2342),a=n(6815),s=n(7690),c=n(6174);function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n{n.d(t,{z:()=>r});var r=Object.freeze({AnimationComponentTID:1,TransformComponentTID:2,SceneGraphComponentTID:3,MeshComponentTID:4,MeshRendererComponentTID:5,LightComponentTID:6,CameraControllerComponentTID:7,CameraComponentTID:8,SkeletalComponentTID:9,BlendShapeComponentTID:10,PhysicsComponentTID:11,EffekseerComponentTID:12,VrmComponentTID:13,maxWellKnownTidNumber:13})},1905:(e,t,n)=>{n.d(t,{l:()=>p,cw:()=>r.c,xT:()=>i.x,My:()=>a.M,SP:()=>s.S,B5:()=>m,xz:()=>v,r0:()=>c.r,$t:()=>l.$,YZ:()=>u.Y,Ze:()=>f.Z,aj:()=>_.a,Yb:()=>y.Y,Uv:()=>A.U,ZA:()=>b.Z,zz:()=>g.z,vA:()=>o});var r=n(5054),o="Default",i=n(9958),a=n(3279),s=n(6696),c=n(4654),l=n(9856),u=n(6807),f=n(2670),_=n(429),h=n(1855),d=n(9197),m=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__srcEntity=t}var t=e.prototype;return t.getSrcPGRestQ=function(e){var t=e.getSceneGraph().parent;return d.Is.exist(t)?t.rotationRest:h._f.identity()},t.getDstPGRestQ=function(e){var t=e.getSceneGraph().parent;return d.Is.exist(t)?t.rotationRest:h._f.identity()},t.retargetQuaternion=function(e){var t=this.__srcEntity,n=t.getTransform().localRotationInner,r=t.getTransform().localRotationRestInner,o=this.getSrcPGRestQ(t),i=h._f.multiply(o,h._f.multiply(n,h._f.multiply(h._f.invert(r),h._f.invert(o)))),a=e.getTransform().localRotationRestInner,s=this.getDstPGRestQ(e);return h._f.multiply(h._f.invert(s),h._f.multiply(i,h._f.multiply(s,a)))},t.retargetTranslate=function(e){var t=this.__srcEntity,n=t.getTransform().localPositionInner,r=t.getTransform().localPositionRestInner,o=this.getSrcPGRestQ(t),i=h.P.subtract(n,r),a=o.transformVector3(i),s=e.getTransform().localPositionRestInner,c=this.getDstPGRestQ(e);return h.P.add(c.transformVector3Inverse(a),s)},t.retargetScale=function(e){return this.__srcEntity.getTransform().localScaleInner},e}(),v=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__srcEntity=t}var t=e.prototype;return t.retargetQuaternion=function(e){var t,n,r,o=this.__srcEntity,i=d.Is.exist(o.tryToGetAnimation())?o.tryToGetAnimation().inverseBindMatrix:h.Je.identity(),a=o.getSceneGraph().matrixInner,s=h.Je.multiply(a,i),c=d.Is.exist(null===(t=e.tryToGetAnimation())||void 0===t?void 0:t.inverseBindMatrix)?h.Je.invert(e.tryToGetAnimation().inverseBindMatrix):h.Je.identity(),l=d.Is.exist(null===(n=null===(r=e.getSceneGraph().parent)||void 0===r?void 0:r.entity.tryToGetAnimation())||void 0===n?void 0:n.inverseBindMatrix)?e.getSceneGraph().parent.entity.tryToGetAnimation().inverseBindMatrix:h.Je.identity(),u=h.Je.multiply(l,h.Je.multiply(s,c));return h._f.fromMatrix(u)},t.retargetTranslate=function(e){var t,n,r,o=this.__srcEntity,i=d.Is.exist(o.tryToGetAnimation())?o.tryToGetAnimation().inverseBindMatrix:h.Je.identity(),a=o.getSceneGraph().matrixInner,s=h.Je.multiply(a,i),c=d.Is.exist(null===(t=e.tryToGetAnimation())||void 0===t?void 0:t.inverseBindMatrix)?h.Je.invert(e.tryToGetAnimation().inverseBindMatrix):h.Je.identity(),l=d.Is.exist(null===(n=null===(r=e.getSceneGraph().parent)||void 0===r?void 0:r.entity.tryToGetAnimation())||void 0===n?void 0:n.inverseBindMatrix)?e.getSceneGraph().parent.entity.tryToGetAnimation().inverseBindMatrix:h.Je.identity();return h.Je.multiply(l,h.Je.multiply(s,c)).getTranslate()},t.retargetScale=function(e){return this.__srcEntity.getTransform().localScaleInner},e}(),p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__srcEntity=t}var t=e.prototype;return t.retargetQuaternion=function(e){return this.__srcEntity.getTransform().localRotationInner},t.retargetTranslate=function(e){return this.__srcEntity.getTransform().localPositionInner},t.retargetScale=function(e){return this.__srcEntity.getTransform().localScaleInner},e}(),y=n(1625),A=n(1417),b=n(8169),g=n(6174)},1410:(e,t,n)=>{n.d(t,{w:()=>d});var r=n(4395),o=n(2342),i=n(6815),a=n(6383),s=n(9977),c=n(9315);function l(e,t){for(var n=0;n{n.d(t,{C:()=>s});var r=n(1410),o=n(9197),i=n(9977),a=n(6174),s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.registerComponentClass=function(t){e.__componentClasses.set(t.componentTID,t)},e.deregisterComponentClass=function(t){e.__componentClasses.delete(t)},e.getComponentClass=function(e){return this.__componentClasses.get(e)},e.createComponent=function(t,n,i){var a=e.__componentClasses.get(t);if(o.Is.exist(a)){var s=this.__component_sid_count_map.get(t);o.Is.not.exist(s)&&(this.__component_sid_count_map.set(t,0),s=r.w.invalidComponentSID),this.__component_sid_count_map.set(t,++s);var c=new a(n,s,i);return this.__components.has(t)||this.__components.set(t,[]),this.__components.get(t)[c.componentSID]=c,c}throw new Error("The Component Class object is invalid.")},e.getComponent=function(e,t){return this.getComponentFromComponentTID(e.componentTID,t)},e.getComponentFromComponentTID=function(e,t){var n=this.__components.get(e);if(null!=n)return null!=n[t]?n[t]:void 0},e._getComponents=function(e){var t=this.__components.get(e.componentTID);return null==t?void 0:t.filter((function(e){return e._isAlive}))},e._getComponentsIncludingDead=function(e){return this.__components.get(e.componentTID)},e.getMemoryBeginIndex=function(t){for(var n=0,r=0;r{n.d(t,{D:()=>u});var r=n(8468),o=n(7690),i=41,a=33,s=Math.pow(2,12),c=Math.pow(2,12),l=r.N.Mat44x1;"undefined"!=typeof navigator&&(o.Kf.isMobile()||o.Kf.isMobileVr())&&(i=4,a=32,s=Math.pow(2,9),c=Math.pow(2,9));var u={maxEntityNumber:5e3,maxLightNumberInShader:4,maxVertexMorphNumberInShader:i,maxMaterialInstanceForEachType:10,boneDataType:l,maxSkeletonNumber:a,maxCameraNumber:20,maxSizeLimitOfNonCompressedTexture:512,maxSkeletalBoneNumber:300,maxSkeletalBoneNumberForUniformMode:50,dataTextureWidth:s,dataTextureHeight:c,noWebGLTex2DStateCache:!1,maxMorphTargetNumber:4,totalSizeOfGPUShaderDataStorageExceptMorphData:0,isUboEnabled:!1,eventTargetDom:void 0}},3856:(e,t,n)=>{n.d(t,{J:()=>f});var r=n(9315),o=n(9197),i=n(6174);function a(e,t){for(var n=0;n{n.d(t,{e:()=>l,g:()=>c});var r=n(3856),o=n(6383),i=n(1274),a=n(9197),s=n(6174),c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.createEntity=function(){var e=new r.J(++this.__entity_uid_count,!0);return this.__entities[this.__entity_uid_count]=e,e},e.shallowCopyEntity=function(t){var n=e._shallowCopyEntityInner(t);return this.__setJoints(t),this.__handleTagData(n),n},e.__setJoints=function(t){var n=e.getEntity(t._myLatestCopyEntityUID).getComponentByComponentTID(s.z.SkeletalComponentTID),r=t.getComponentByComponentTID(s.z.SkeletalComponentTID);if(a.Is.exist(n)&&a.Is.exist(r)){var o=r.getJoints().map((function(t){return e.getEntity(t.entity._myLatestCopyEntityUID).tryToGetSceneGraph()}));n.setJoints(o)}var i=t.tryToGetSceneGraph();a.Is.exist(i)&&i.children.forEach((function(t){e.__setJoints(t.entity)}))},e._shallowCopyEntityInner=function(e){var t=this.createEntity();t._tags=Object.assign({},e._tags),e._myLatestCopyEntityUID=t.entityUID;for(var n=1;n<=s.z.maxWellKnownTidNumber;n++){var r=e.getComponentByComponentTID(n);if(a.Is.exist(r)){this.tryToAddComponentToEntityByTID(n,t);var o=t.getComponentByComponentTID(n);a.Is.exist(o)&&o._shallowCopyFrom(r)}}return t},e.__handleTagData=function(t){var n=t._tags;if(a.Is.exist(n)){var r=Object.keys(n),o=!0,i=!1,s=void 0;try{for(var c,l=function(){var n=c.value;if("rnEntities"===n){var r=t.getTagValue("rnEntities").map((function(t){return e.getEntity(t._myLatestCopyEntityUID)}));t.tryToSetTag({tag:"rnEntities",value:r})}if("rnEntitiesByNames"===n){var o=t.getTagValue("rnEntitiesByNames"),i=!0,a=!1,s=void 0;try{for(var l,u=Object.keys(o)[Symbol.iterator]();!(i=(l=u.next()).done);i=!0){var f=l.value,_=o.get(f);o.set(f,e.getEntity(_._myLatestCopyEntityUID))}}catch(e){a=!0,s=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw s}}t.tryToSetTag({tag:"rnEntitiesByNames",value:o})}},u=r[Symbol.iterator]();!(o=(c=u.next()).done);o=!0)l()}catch(e){i=!0,s=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw s}}}var f=t.tryToGetSceneGraph();a.Is.exist(f)&&f.children.forEach((function(t){e.__handleTagData(t.entity)}))},e.tryToAddComponentToEntityByTID=function(e,t){var n=o.C.getComponentClass(e);return a.Is.not.exist(n)?t:this.addComponentToEntity(n,t)},e.addComponentToEntity=function(e,t){var n=this;if(t.hasComponent(e))return console.log("This entity already has the Component."),t;var r=o.C.createComponent(e.componentTID,t.entityUID,this);return(0,i.wv)({value:this._components[t.entityUID],compensation:function(){var e=new Map;return n._components[t.entityUID]=e,e}}).set(e.componentTID,r),r.addThisComponentToEntity(t,e),t._setComponent(e,r),t},e.removeComponentFromEntity=function(e,t){var n=this._components[t.entityUID];null==n&&(n=new Map,this._components[t.entityUID]=n);var r=n.get(e.componentTID);return a.Is.exist(r)&&(r._destroy(),n.delete(e.componentTID),t._removeComponent(e.componentTID)),t},e.getEntity=function(e){return this.__entities[e]},e.getComponentOfEntity=function(e,t){var n=this._components[e],r=null;return null!=n?null!=(r=n.get(t.componentTID))?r:null:r},e.searchByTags=function(e){var t=[],n=!0,r=!1,o=void 0;try{for(var i,a=this.__entities[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;s.matchTags(e)&&t.push(s)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return t},e.getEntityByUniqueName=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.__entities[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;if(a.uniqueName===e)return a}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}},e._getEntities=function(){return this.__entities.filter((function(e){return e._isAlive}))},e.getEntitiesNumber=function(){return this.__entities.filter((function(e){return e._isAlive})).length},e}();function l(e,t){Object.getOwnPropertyNames(t.prototype).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t.prototype,n)||Object.create(null))}))}c.__entity_uid_count=r.J.invalidEntityUID,c.__entities=[],c._components=[]},9481:(e,t,n)=>{n.d(t,{$:()=>I});var r=n(7416),o=n(5171),i=n(4395),a=n(3932),s=n(2535),c=n(9409),l=n(4021),u=n(5685),f=n(2175),_=n(678),h=n(9977),d=n(1811),m=n(6264),v=n(6860),p=n(8289),y=n(6174),A=n(8468),b=n(7042),g=n(3138),x=n(1855),I=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__fields=new Map}var t=e.prototype;return t.initialize=function(e){var t={semantic:r.f5.CurrentComponentSIDs,compositionType:a.d.ScalarArray,componentType:s.r.Float,arrayLength:y.z.maxWellKnownTidNumber,stage:u.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,needUniformInDataTextureMode:!0,initialValue:new f.j(new Float32Array(y.z.maxWellKnownTidNumber))};this.__registerProperty(t,1),this.takeOne(r.f5.CurrentComponentSIDs);var n={semantic:r.f5.ViewMatrix,compositionType:a.d.Mat4,componentType:s.r.Float,stage:u.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,initialValue:p.e.identity()},o={semantic:r.f5.ProjectionMatrix,compositionType:a.d.Mat4,componentType:s.r.Float,stage:u.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,initialValue:p.e.identity()},i={semantic:r.f5.ViewPosition,compositionType:a.d.Vec3,componentType:s.r.Float,stage:u.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.FirstTimeOnly,initialValue:v.P.fromCopyArray([0,0,1])};this.__registerProperty(n,h.D.maxCameraNumber),this.__registerProperty(o,h.D.maxCameraNumber),this.__registerProperty(i,h.D.maxCameraNumber);var c=b.V.isUniformApproach(e)?h.D.maxSkeletalBoneNumberForUniformMode:h.D.maxSkeletalBoneNumber,l={semantic:r.f5.BoneMatrix,compositionType:a.d.Mat4Array,arrayLength:c,componentType:s.r.Float,stage:u.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.FirstTimeOnly,soloDatum:!0,initialValue:new f.j(new Float32Array(0))},g={semantic:r.f5.BoneQuaternion,compositionType:a.d.Vec4Array,arrayLength:c,componentType:s.r.Float,stage:u.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.FirstTimeOnly,soloDatum:!0,initialValue:new f.j(new Float32Array(0))},I={semantic:r.f5.BoneTranslateScale,compositionType:a.d.Vec4Array,arrayLength:c,componentType:s.r.Float,soloDatum:!0,stage:u.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.FirstTimeOnly,initialValue:new f.j(new Float32Array(0))},E={semantic:r.f5.BoneTranslatePackedQuat,compositionType:a.d.Vec4Array,arrayLength:c,componentType:s.r.Float,stage:u.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.FirstTimeOnly,soloDatum:!0,initialValue:new f.j(new Float32Array(0))},w={semantic:r.f5.BoneScalePackedQuat,compositionType:a.d.Vec4Array,arrayLength:c,componentType:s.r.Float,soloDatum:!0,stage:u.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.FirstTimeOnly,initialValue:new f.j(new Float32Array(0))},S={semantic:r.f5.BoneCompressedChunk,compositionType:a.d.Vec4Array,arrayLength:c,componentType:s.r.Float,soloDatum:!0,stage:u.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.FirstTimeOnly,initialValue:new f.j(new Float32Array(0))},T={semantic:r.f5.BoneCompressedInfo,compositionType:a.d.Vec4,componentType:s.r.Float,soloDatum:!0,stage:u.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.FirstTimeOnly,initialValue:m.Lt.zero()},C={semantic:r.f5.SkinningMode,compositionType:a.d.Scalar,componentType:s.r.Int,stage:u.H.VertexAndPixelShader,min:0,max:1,isCustomSetting:!0,updateInterval:_.a.EveryTime,initialValue:d.Ru.fromCopyNumber(-1)};h.D.boneDataType===A.N.Mat44x1?this.__registerProperty(l,h.D.maxSkeletonNumber):h.D.boneDataType===A.N.Vec4x2?(this.__registerProperty(E,h.D.maxSkeletonNumber),this.__registerProperty(w,h.D.maxSkeletonNumber)):h.D.boneDataType===A.N.Vec4x2Old?(this.__registerProperty(g,h.D.maxSkeletonNumber),this.__registerProperty(I,h.D.maxSkeletonNumber)):h.D.boneDataType===A.N.Vec4x1&&(this.__registerProperty(I,h.D.maxSkeletonNumber),this.__registerProperty(S,h.D.maxSkeletonNumber),this.__registerProperty(T,1),this.takeOne(r.f5.BoneCompressedInfo)),this.__registerProperty(C,1),this.takeOne(r.f5.SkinningMode);var P={semantic:r.f5.LightPosition,compositionType:a.d.Vec3Array,componentType:s.r.Float,stage:u.H.PixelShader,arrayLength:h.D.maxLightNumberInShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.EveryTime,initialValue:new f.j(new Float32Array(h.D.maxLightNumberInShader))},R={semantic:r.f5.LightDirection,compositionType:a.d.Vec3Array,componentType:s.r.Float,stage:u.H.PixelShader,arrayLength:h.D.maxLightNumberInShader,min:-1,max:1,isCustomSetting:!0,initialValue:new f.j(new Float32Array(h.D.maxLightNumberInShader)),updateInterval:_.a.EveryTime},D={semantic:r.f5.LightIntensity,compositionType:a.d.Vec3Array,componentType:s.r.Float,stage:u.H.PixelShader,arrayLength:h.D.maxLightNumberInShader,min:0,max:10,isCustomSetting:!0,initialValue:new f.j(new Float32Array(h.D.maxLightNumberInShader)),updateInterval:_.a.EveryTime},M={semantic:r.f5.LightProperty,compositionType:a.d.Vec4Array,componentType:s.r.Float,stage:u.H.PixelShader,arrayLength:h.D.maxLightNumberInShader,min:0,max:10,isCustomSetting:!0,initialValue:new f.j(new Float32Array(h.D.maxLightNumberInShader)),updateInterval:_.a.EveryTime};this.__registerProperty(P,1),this.__registerProperty(R,1),this.__registerProperty(D,1),this.__registerProperty(M,1),this.takeOne(r.f5.LightDirection),this.takeOne(r.f5.LightIntensity),this.takeOne(r.f5.LightPosition),this.takeOne(r.f5.LightProperty);var B={semantic:r.f5.LightNumber,compositionType:a.d.Scalar,componentType:s.r.Int,stage:u.H.VertexAndPixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isCustomSetting:!0,updateInterval:_.a.FirstTimeOnly,initialValue:d.Ru.fromCopyNumber(0)};this.__registerProperty(B,1),this.takeOne(r.f5.LightNumber);var N={semantic:r.f5.BackBufferTextureSize,compositionType:a.d.Vec2,componentType:s.r.Float,stage:u.H.PixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isCustomSetting:!0,needUniformInDataTextureMode:!0,updateInterval:_.a.EveryTime,initialValue:x.FM.fromCopy2(0,0)};this.__registerProperty(N,1),this.takeOne(r.f5.BackBufferTextureSize);var O={semantic:r.f5.VrState,compositionType:a.d.Vec2,componentType:s.r.Int,stage:u.H.PixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isCustomSetting:!0,needUniformInDataTextureMode:!0,updateInterval:_.a.EveryTime,initialValue:x.FM.fromCopy2(0,0)};this.__registerProperty(O,1),this.takeOne(r.f5.VrState)},t.__registerProperty=function(e,t){var n=(0,g.V)(e),r=i.B.getInstance().createOrGetBuffer(o.$.GPUInstanceData),c=(0,g.K)(e),l=r.takeBufferView({byteLengthToNeed:c*t,byteStride:0}).unwrapForce(),u=e.arrayLength;a.d.isArray(e.compositionType)&&null==u&&(u=100);var f={shaderSemanticsInfo:e,values:[],maxCount:t,accessor:l.takeAccessor({compositionType:e.compositionType,componentType:s.r.Float,count:t,byteStride:c,arrayLength:u}).unwrapForce()};this.__fields.set(n,f)},t.takeOne=function(e){var t=(0,r.UL)(e),n=this.__fields.get(t);if(n){var o=n.shaderSemanticsInfo,i=n.accessor.takeOne(),a=n.values.length,s=c.D.initWithFloat32Array(o.initialValue,o.initialValue,i,o.compositionType);return n.values[a]=s,s}},t.setValue=function(e,t,n){var o=(0,r.UL)(e),i=this.__fields.get(o);if(i){var a=i.values[t];c.D._setForce(a,n)}},t.getValue=function(e,t){var n=(0,r.UL)(e),o=this.__fields.get(n);if(o)return o.values[t]},t.getGlobalPropertyStruct=function(e){return this.__fields.get(e)},t.getGlobalProperties=function(){return Array.from(this.__fields.values())},t._setUniformLocationsForUniformModeOnly=function(e){var t=l.F.getWebGLResourceRepository(),n=[];this.__fields.forEach((function(e,t){var r=e.shaderSemanticsInfo;n.push(r)})),t.setupUniformLocations(e,n,!0)},t._setUniformLocationsForDataTextureModeOnly=function(e){var t=l.F.getWebGLResourceRepository(),n=[];this.__fields.forEach((function(e,t){var r=e.shaderSemanticsInfo;r.needUniformInDataTextureMode&&n.push(r)})),t.setupUniformLocations(e,n,!0)},t.setUniformValues=function(e){var t=l.F.getWebGLResourceRepository();this.__fields.forEach((function(n,r){for(var o=n.shaderSemanticsInfo,i=n.values,a=0;a{n.d(t,{B:()=>c});var r=n(5527),o=n(5171),i=n(9977),a=n(1274);function s(e,t){for(var n=0;n{n.d(t,{S:()=>i});var r=n(1274);function o(e,t){for(var n=0;n?@\[\\\]^`{|}~]/g).test(e)},i.tryToSetTag=function(e){return!!this.validateTagString(e.tag)&&(this.hasTag(e.tag)&&this.removeTag(e.tag),this._tags[e.tag]=e.value,this.__combinedTagString+="".concat(e.tag,":").concat(e.value)+" ",!0)},i.getTagValue=function(e){return this._tags[e]},i.getTag=function(e){return{tag:e,value:this._tags[e]}},i.hasTag=function(e){return null!=this._tags[e]},i.removeTag=function(e){"".concat(e,":").concat(this._tags[e]),this.__combinedTagString.replace(this.__combinedTagString,""),delete this._tags[e]},i.matchTag=function(e,t){return this._tags[e]===t},i.matchTagsAsFreeStrings=function(e){for(var t="^",n=0;n{n.d(t,{F:()=>d});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s.prototype.toGltfString=function(){return"TRANSLUCENT"===this.str?"BLEND":this.str},s}(r.Jx),l=new c({index:0,str:"OPAQUE"}),u=new c({index:1,str:"MASK"}),f=new c({index:2,str:"TRANSLUCENT"}),_=new c({index:3,str:"ADDITIVE"}),h=[l,u,f,_],d=Object.freeze({Opaque:l,Mask:u,Translucent:f,Additive:_,from:function(e){return(0,r.li)({typeList:h,index:e})},fromString:function(e){return(0,r.cu)({typeList:h,str:e})},fromGlTFString:function(e){return"BLEND"===e?f:(0,r.cu)({typeList:h,str:e})}})},166:(e,t,n)=>{n.d(t,{s:()=>m});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:0,str:"Quaternion"}),u=new c({index:1,str:"Translate"}),f=new c({index:2,str:"Scale"}),_=new c({index:3,str:"Weights"}),h=new c({index:4,str:"Effekseer"}),d=[l,u,f,_,h],m=Object.freeze({Quaternion:l,Translate:u,Scale:f,Weights:_,Effekseer:h,from:function(e){return(0,r.li)({typeList:d,index:e})},fromString:function(e){return(0,r.cu)({typeList:d,str:e})}})},9611:(e,t,n)=>{n.d(t,{k:()=>d});var r=n(3100);function o(e,t){for(var n=0;n{n.d(t,{l:()=>T});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:0,str:"ETC1"}),u=new c({index:1,str:"ETC2"}),f=new c({index:2,str:"BC1"}),_=new c({index:3,str:"BC3"}),h=new c({index:4,str:"BC4"}),d=new c({index:5,str:"BC5"}),m=new c({index:6,str:"BC7_M6_OPAQUE"}),v=new c({index:7,str:"BC7_M5"}),p=new c({index:8,str:"PVRTC1_RGB"}),y=new c({index:9,str:"PVRTC1_RGBA"}),A=new c({index:10,str:"ASTC"}),b=new c({index:11,str:"ATC_RGB"}),g=new c({index:12,str:"ATC_RGBA"}),x=new c({index:13,str:"RGBA32"}),I=new c({index:14,str:"RGB565"}),E=new c({index:15,str:"BGR565"}),w=new c({index:16,str:"RGBA4444"}),S=[l,u,f,_,h,d,v,m,p,y,A,b,g,x,I,E,w],T=Object.freeze({ETC1:l,ETC2:u,BC1:f,BC3:_,BC4:h,BC5:d,BC7_M5:v,BC7_M6_OPAQUE:m,PVRTC1_RGB:p,PVRTC1_RGBA:y,ASTC:A,ATC_RGB:b,ATC_RGBA:g,RGBA32:x,RGB565:I,BGR565:E,RGBA4444:w,from:function(e){return(0,r.li)({typeList:S,index:e})},fromString:function(e){return(0,r.cu)({typeList:S,str:e})}})},8468:(e,t,n)=>{n.d(t,{N:()=>d});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:0,str:"Mat44x1"}),u=new c({index:1,str:"Vec4x2"}),f=new c({index:2,str:"Vec4x2Old"}),_=new c({index:3,str:"Vec4x1"}),h=[l,u,_],d=Object.freeze({Mat44x1:l,Vec4x2:u,Vec4x2Old:f,Vec4x1:_,from:function(e){return(0,r.li)({typeList:h,index:e})},fromString:function(e){return(0,r.cu)({typeList:h,str:e})}})},5171:(e,t,n)=>{n.d(t,{$:()=>d});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:0,str:"GPUInstanceData"}),u=new c({index:1,str:"GPUVertexData"}),f=new c({index:2,str:"UBOGeneric"}),_=new c({index:3,str:"CPUGeneric"}),h=[l,u,f,_],d=Object.freeze({GPUInstanceData:l,GPUVertexData:u,UBOGeneric:f,CPUGeneric:_,from:function(e){return(0,r.li)({typeList:h,index:e})},fromString:function(e){return(0,r.cu)({typeList:h,str:e})}})},5674:(e,t,n)=>{n.d(t,{M:()=>_});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:0,str:"Orbit"}),u=new c({index:1,str:"WalkThrough"}),f=[l,u],_=Object.freeze({Orbit:l,WalkThrough:u,from:function(e){return(0,r.li)({typeList:f,index:e})},fromString:function(e){return(0,r.cu)({typeList:f,str:e})}})},2637:(e,t,n)=>{n.d(t,{i:()=>h});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:0,str:"Perspective"}),u=new c({index:1,str:"Orthographic"}),f=new c({index:2,str:"Frustum"}),_=[l,u,f],h=Object.freeze({Perspective:l,Orthographic:u,Frustum:f,from:function(e){return(0,r.li)({typeList:_,index:e})},fromString:function(e){return(0,r.cu)({typeList:_,str:e})}})},2535:(e,t,n)=>{n.d(t,{r:()=>x});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function a(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(i,e);var t,n,r=(t=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var i=o(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return a(this,e)});function i(e){var t,n=e.index,o=e.str,a=e.sizeInBytes;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=r.call(this,{index:n,str:o})).__sizeInBytes=a,t}var c=i.prototype;return c.getSizeInBytes=function(){return this.__sizeInBytes},c.isFloatingPoint=function(){return 5126===this.index||5127===this.index||36193===this.index},c.isInteger=function(){return 5120===this.index||5121===this.index||5122===this.index||5123===this.index||5124===this.index||5125===this.index},i}(r.Jx),u=new l({index:5119,str:"UNKNOWN",sizeInBytes:0}),f=new l({index:5120,str:"BYTE",sizeInBytes:1}),_=new l({index:5121,str:"UNSIGNED_BYTE",sizeInBytes:1}),h=new l({index:5122,str:"SHORT",sizeInBytes:2}),d=new l({index:5123,str:"UNSIGNED_SHORT",sizeInBytes:2}),m=new l({index:5124,str:"INT",sizeInBytes:4}),v=new l({index:5125,str:"UNSIGNED_INT",sizeInBytes:4}),p=new l({index:5126,str:"FLOAT",sizeInBytes:4}),y=new l({index:5127,str:"DOUBLE",sizeInBytes:8}),A=new l({index:35670,str:"BOOL",sizeInBytes:1}),b=new l({index:5131,str:"HALF_FLOAT",sizeInBytes:2}),g=[u,f,_,h,d,m,v,p,y,b,A],x=Object.freeze({Unknown:u,Byte:f,UnsignedByte:_,Short:h,UnsignedShort:d,Int:m,UnsignedInt:v,Float:p,Double:y,Bool:A,HalfFloat:b,from:function(e){return(0,r.li)({typeList:g,index:e})},fromTypedArray:function(e){return i(e,Int8Array)?f:i(e,Uint8Array)||i(e,Uint8ClampedArray)?_:i(e,Int16Array)?h:i(e,Uint16Array)?d:i(e,Int32Array)?m:i(e,Uint32Array)?v:i(e,Float32Array)?p:i(e,Float64Array)?y:u},toTypedArray:function(e){return e===f?Int8Array:e===_?Uint8Array:e===h?Int16Array:e===d?Uint16Array:e===m?Int32Array:e===v?Uint32Array:e===p?Float32Array:e===y?Float64Array:void 0},toGltf2AccessorComponentType:function(e){return e.index},fromString:function(e){return(0,r.cu)({typeList:g,str:e})},fromGlslString:function(e){var t=e;switch(e){case"bool":t="BOOL";break;case"int":case"ivec2":case"ivec3":case"ivec4":case"sampler2D":case"sampler2DShadow":case"sampler2DRect":case"sampler3D":case"samplerCube":t="INT";break;case"float":case"vec2":case"vec3":case"vec4":case"mat2":case"mat3":case"mat4":t="FLOAT"}return(0,r.cu)({typeList:g,str:t})}})},3932:(e,t,n)=>{n.d(t,{d:()=>P});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t,n=e.index,o=e.str,i=e.glslStr,a=e.hlslStr,c=e.numberOfComponents,l=e.vec4SizeOfProperty,u=e.isArray,f=void 0!==u&&u;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,{index:n,str:o})).__numberOfComponents=c,t.__glslStr=i,t.__hlslStr=a,t.__vec4SizeOfProperty=l,t.__isArray=f,t}var c=s.prototype;return c.getNumberOfComponents=function(){return this.__numberOfComponents},c.getGlslStr=function(e){return 5126===e.index||5127===e.index||this===P.Texture2D||this===P.Texture2DShadow||this===P.Texture2DRect||this===P.TextureCube?this.__glslStr:5120===e.index||5122===e.index||5124===e.index?this===P.Scalar||this===P.ScalarArray?"int":"i"+this.__glslStr:35670===e.index?"bool":"unknown"},c.getGlslInitialValue=function(e){if(5126===e.index||5127===e.index){if(this===P.Scalar)return"0.0";if(2===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0)";if(3===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0)";if(4===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0, 0.0)";if(9===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)";if(16===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)"}else if(5120===e.index||5122===e.index||5124===e.index){if(this===P.Scalar)return"0";if(2===this.__numberOfComponents)return this.__glslStr+"(0, 0)";if(3===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0)";if(4===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0, 0)";if(9===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0, 0, 0, 0, 0, 0, 0)";if(16===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"}else if(35670===e.index){if(this===P.Scalar)return"false";if(2===this.__numberOfComponents)return this.__glslStr+"(false, false)";if(3===this.__numberOfComponents)return this.__glslStr+"(false, false, false)";if(4===this.__numberOfComponents)return this.__glslStr+"(false, false, false, false)"}return"unknown"},c.getVec4SizeOfProperty=function(){return this.__vec4SizeOfProperty},s}(r.Jx),l=new c({index:-1,str:"UNKNOWN",glslStr:"unknown",hlslStr:"unknown",numberOfComponents:0,vec4SizeOfProperty:0}),u=new c({index:0,str:"SCALAR",glslStr:"float",hlslStr:"float",numberOfComponents:1,vec4SizeOfProperty:1}),f=new c({index:1,str:"VEC2",glslStr:"vec2",hlslStr:"float2",numberOfComponents:2,vec4SizeOfProperty:1}),_=new c({index:2,str:"VEC3",glslStr:"vec3",hlslStr:"float3",numberOfComponents:3,vec4SizeOfProperty:1}),h=new c({index:3,str:"VEC4",glslStr:"vec4",hlslStr:"float4",numberOfComponents:4,vec4SizeOfProperty:1}),d=new c({index:4,str:"MAT2",glslStr:"mat2",hlslStr:"float2x2",numberOfComponents:4,vec4SizeOfProperty:2}),m=new c({index:5,str:"MAT3",glslStr:"mat3",hlslStr:"float3x3",numberOfComponents:9,vec4SizeOfProperty:3}),v=new c({index:6,str:"MAT4",glslStr:"mat4",hlslStr:"float4x4",numberOfComponents:16,vec4SizeOfProperty:4}),p=new c({index:7,str:"TEXTURE_2D",glslStr:"sampler2D",hlslStr:"Texture2D",numberOfComponents:1,vec4SizeOfProperty:1}),y=new c({index:8,str:"TEXTURE_CUBE_MAP",glslStr:"samplerCube",hlslStr:"TextureCube",numberOfComponents:1,vec4SizeOfProperty:1}),A=new c({index:9,str:"SCALAR_ARRAY",glslStr:"float",hlslStr:"float",numberOfComponents:1,vec4SizeOfProperty:1,isArray:!0}),b=new c({index:10,str:"VEC2_ARRAY",glslStr:"vec2",hlslStr:"float2",numberOfComponents:2,vec4SizeOfProperty:1,isArray:!0}),g=new c({index:11,str:"VEC3_ARRAY",glslStr:"vec3",hlslStr:"float3",numberOfComponents:3,vec4SizeOfProperty:1,isArray:!0}),x=new c({index:12,str:"VEC4_ARRAY",glslStr:"vec4",hlslStr:"float4",numberOfComponents:4,vec4SizeOfProperty:1,isArray:!0}),I=new c({index:13,str:"MAT4_ARRAY",glslStr:"mat4",hlslStr:"float4x4",numberOfComponents:16,vec4SizeOfProperty:4,isArray:!0}),E=new c({index:14,str:"MAT3_ARRAY",glslStr:"mat3",hlslStr:"float3x3",numberOfComponents:9,vec4SizeOfProperty:3,isArray:!0}),w=new c({index:15,str:"MAT2_ARRAY",glslStr:"mat2",hlslStr:"float2x2",numberOfComponents:4,vec4SizeOfProperty:2,isArray:!0}),S=new c({index:16,str:"TEXTURE_2D_SHADOW",glslStr:"highp sampler2DShadow",hlslStr:"Texture2D",numberOfComponents:1,vec4SizeOfProperty:1}),T=new c({index:17,str:"TEXTURE_2D_RECT",glslStr:"sampler2DRect",hlslStr:"Texture2D",numberOfComponents:1,vec4SizeOfProperty:1}),C=[l,u,f,_,h,d,m,v,b,g,x,A,w,E,I,p,S,T,y],P=Object.freeze({Unknown:l,Scalar:u,Vec2:f,Vec3:_,Vec4:h,Mat2:d,Mat3:m,Mat4:v,ScalarArray:A,Vec2Array:b,Vec3Array:g,Vec4Array:x,Mat2Array:w,Mat3Array:E,Mat4Array:I,Texture2D:p,Texture2DShadow:S,TextureCube:y,Texture2DRect:T,from:function(e){return(0,r.li)({typeList:C,index:e})},fromString:function(e){return(0,r.cu)({typeList:C,str:e})},vectorFrom:function(e){var t="";switch(e){case 1:t="scalar";break;case 2:t="vec2";break;case 3:t="vec3";break;case 4:t="vec4";break;default:console.error("not found appropriate Vectors")}return(0,r.cu)({typeList:C,str:t})},fromGlslString:function(e){var t=e;switch(e){case"bool":case"int":case"float":t="scalar";break;case"ivec2":t="vec2";break;case"ivec3":t="vec3";break;case"ivec4":t="vec4";break;case"sampler2D":t="TEXTURE_2D";break;case"sampler2DShadow":t="TEXTURE_2D_SHADOW";break;case"sampler2DRect":t="TEXTURE_2D_RECT";break;case"samplerCube":t="TEXTURE_CUBE_MAP"}return(0,r.cu)({typeList:C,str:t})},isArray:function(e){return e===A||e===b||e===g||e===x||e===I||e===E||e===w},isTexture:function(e){return e===p||e===y||e===S||e===T},toGltf2AnimationAccessorCompositionType:function(e){switch(e){case 1:return u;case 2:return f;case 3:return _;case 4:return h;default:throw new Error("Invalid componentN")}},toGltf2AccessorCompositionTypeString:function(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";case 9:return"MAT3";case 16:return"MAT4";default:throw new Error("Invalid componentN")}},toGltf2AnimationAccessorCompositionTypeString:function(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";default:throw new Error("Invalid componentN")}},toGltf2SquareMatrixAccessorCompositionTypeString:function(e){switch(e){case 4:return"VEC4";case 9:return"MAT3";case 16:return"MAT4";default:throw new Error("Invalid componentN")}}})},1903:(e,t,n)=>{n.d(t,{b:()=>Y});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:37808,str:"COMPRESSED_RGBA_ASTC_4x4_KHR"}),u=new c({index:37809,str:"COMPRESSED_RGBA_ASTC_5x4_KHR"}),f=new c({index:37810,str:"COMPRESSED_RGBA_ASTC_5x5_KHR"}),_=new c({index:37811,str:"COMPRESSED_RGBA_ASTC_6x5_KHR"}),h=new c({index:37812,str:"COMPRESSED_RGBA_ASTC_6x6_KHR"}),d=new c({index:37813,str:"COMPRESSED_RGBA_ASTC_8x5_KHR"}),m=new c({index:37814,str:"COMPRESSED_RGBA_ASTC_8x6_KHR"}),v=new c({index:37815,str:"COMPRESSED_RGBA_ASTC_8x8_KHR"}),p=new c({index:37816,str:"COMPRESSED_RGBA_ASTC_10x5_KHR"}),y=new c({index:37817,str:"COMPRESSED_RGBA_ASTC_10x6_KHR"}),A=new c({index:37818,str:"COMPRESSED_RGBA_ASTC_10x8_KHR"}),b=new c({index:37819,str:"COMPRESSED_RGBA_ASTC_10x10_KHR"}),g=new c({index:37820,str:"COMPRESSED_RGBA_ASTC_12x10_KHR"}),x=new c({index:37821,str:"COMPRESSED_RGBA_ASTC_12x12_KHR"}),I=new c({index:37840,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR"}),E=new c({index:37841,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR"}),w=new c({index:37842,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR"}),S=new c({index:37843,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR"}),T=new c({index:37844,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR"}),C=new c({index:37845,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR"}),P=new c({index:37846,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR"}),R=new c({index:37847,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR"}),D=new c({index:37848,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR"}),M=new c({index:37849,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR"}),B=new c({index:37850,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR"}),N=new c({index:37851,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR"}),O=new c({index:37852,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR"}),L=new c({index:37853,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR"}),F=new c({index:33776,str:"COMPRESSED_RGB_S3TC_DXT1_EXT"}),G=new c({index:33777,str:"COMPRESSED_RGBA_S3TC_DXT1_EXT"}),V=new c({index:33778,str:"COMPRESSED_RGBA_S3TC_DXT3_EXT"}),z=new c({index:33779,str:"COMPRESSED_RGBA_S3TC_DXT5_EXT"}),k=new c({index:36492,str:"COMPRESSED_RGBA_BPTC_UNORM_EXT"}),U=new c({index:35842,str:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"}),Q=new c({index:35840,str:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG"}),j=new c({index:37496,str:"COMPRESSED_RGBA8_ETC2_EAC"}),W=new c({index:37492,str:"COMPRESSED_RGB8_ETC2"}),X=new c({index:36196,str:"COMPRESSED_RGB_ETC1_WEBGL"}),H=new c({index:32856,str:"RGBA8_EXT"}),q=[l,u,f,_,h,d,m,v,p,y,A,b,g,x,I,E,w,S,T,C,P,R,D,M,B,N,O,L,F,G,V,z,k,U,Q,j,W,X,H],Y=Object.freeze({ASTC_RGBA_4x4:l,ASTC_RGBA_5x4:u,ASTC_RGBA_5x5:f,ASTC_RGBA_6x5:_,ASTC_RGBA_6x6:h,ASTC_RGBA_8x5:d,ASTC_RGBA_8x6:m,ASTC_RGBA_8x8:v,ASTC_RGBA_10x5:p,ASTC_RGBA_10x6:y,ASTC_RGBA_10x8:A,ASTC_RGBA_10x10:b,ASTC_RGBA_12x10:g,ASTC_RGBA_12x12:x,ASTC_SRGB_4x4:I,ASTC_SRGB_5x4:E,ASTC_SRGB_5x5:w,ASTC_SRGB_6x5:S,ASTC_SRGB_6x6:T,ASTC_SRGB_8x5:C,ASTC_SRGB_8x6:P,ASTC_SRGB_8x8:R,ASTC_SRGB_10x5:D,ASTC_SRGB_10x6:M,ASTC_SRGB_10x8:B,ASTC_SRGB_10x10:N,ASTC_SRGB_12x10:O,ASTC_SRGB_12x12:L,S3TC_RGB_DXT1:F,S3TC_RGBA_DXT1:G,S3TC_RGBA_DXT3:V,S3TC_RGBA_DXT5:z,BPTC_RGBA:k,PVRTC_RGBA_4BPPV1:U,PVRTC_RGB_4BPPV1:Q,ETC2_RGBA8_EAC:j,ETC2_RGB8:W,ETC1_RGB:X,RGBA8_EXT:H,from:function(e){return(0,r.li)({typeList:q,index:e})},fromString:function(e){return(0,r.cu)({typeList:q,str:e})}})},5274:(e,t,n)=>{n.d(t,{T:()=>v});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t,n=e.index,o=e.str,i=e.ext,a=e.brand;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,{index:n,str:o})).extension=i,t.brand=a,t}return s}(r.Jx),l=new c({index:-1,str:"unknown",ext:"unknown",brand:"UnKnown"}),u=new c({index:0,str:"gltf",ext:"gltf",brand:"glTF"}),f=new c({index:1,str:"glb",ext:"glb",brand:"glTF"}),_=new c({index:2,str:"vrm",ext:"vrm",brand:"VRM"}),h=new c({index:3,str:"drc",ext:"drc",brand:"Draco"}),d=new c({index:4,str:"efk",ext:"efk",brand:"EffekseerEffect"}),m=[l,u,f,_,h,d],v=Object.freeze({Unknown:l,Gltf:u,GltfBinary:f,VRM:_,Draco:h,EffekseerEffect:d,from:function(e){return(0,r.li)({typeList:m,index:e})},fromString:function(e){var t=(0,r.cu)({typeList:m,str:e});return null!=t?t:l},isGltfOrGlb:function(e){return e===u||e===f}})},6558:(e,t,n)=>{n.d(t,{c:()=>v});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:0,str:".ldr_srgb"}),u=new c({index:1,str:".ldr_linear"}),f=new c({index:2,str:".hdr"}),_=new c({index:3,str:".rgbe.png"}),h=new c({index:4,str:".rgb9_e5.png"}),d=new c({index:5,str:".exr"}),m=[l,u,f,_,h,d],v=Object.freeze({LDR_SRGB:l,LDR_LINEAR:u,HDR_LINEAR:f,RGBE_PNG:_,RGB9_E5_PNG:h,OpenEXR:d,from:function(e){return(0,r.li)({typeList:m,index:e})},fromString:function(e){return(0,r.cu)({typeList:m,str:e})}})},9805:(e,t,n)=>{n.d(t,{v:()=>d});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:0,str:"Directional"}),u=new c({index:1,str:"Point"}),f=new c({index:2,str:"Spot"}),_=new c({index:3,str:"Ambient"}),h=[u,l,f,_],d=Object.freeze({Point:u,Directional:l,Spot:f,Ambient:_,from:function(e){return(0,r.li)({typeList:h,index:e})},fromString:function(e){return(0,r.cu)({typeList:h,str:e})}})},4543:(e,t,n)=>{n.d(t,{V:()=>p});var r=n(2142),o=n(3100);function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function a(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=i(t);if(n){var o=i(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return a(this,e)});function o(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,{index:t,str:n})}return o}(o.Jx),u=new l({index:6402,str:"DEPTH_COMPONENT"}),f=new l({index:6406,str:"ALPHA"}),_=new l({index:r.SJU,str:"RG"}),h=new l({index:6407,str:"RGB"}),d=new l({index:6408,str:"RGBA"}),m=new l({index:6409,str:"LUMINANCE"}),v=new l({index:6410,str:"LUMINANCE_ALPHA"}),p=Object.freeze({DepthComponent:u,Alpha:f,RG:_,RGB:h,RGBA:d,Luminance:m,LuminanceAlpha:v})},361:(e,t,n)=>{n.d(t,{T:()=>y});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:-1,str:"UNKNOWN"}),u=new c({index:0,str:"POINTS"}),f=new c({index:1,str:"LINES"}),_=new c({index:2,str:"LINE_LOOP"}),h=new c({index:3,str:"LINE_STRIP"}),d=new c({index:4,str:"TRIANGLES"}),m=new c({index:5,str:"TRIANGLE_STRIP"}),v=new c({index:6,str:"TRIANGLE_FAN"}),p=[l,u,f,_,h,d,m,v],y=Object.freeze({Unknown:l,Points:u,Lines:f,LineLoop:_,LineStrip:h,Triangles:d,TriangleStrip:m,TriangleFan:v,from:function(e){return(0,r.li)({typeList:p,index:e})}})},7042:(e,t,n)=>{n.d(t,{V:()=>h,y:()=>l});var r=n(3100);function o(e,t){for(var n=0;n{n.d(t,{I:()=>A});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t,n=e.index,o=e.str,i=e.methodName;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,{index:n,str:o})).methodName=i,t}return s}(r.Jx),l=new c({index:-1,str:"UNKNOWN",methodName:"$unknown"}),u=new c({index:0,str:"CREATE",methodName:"$create"}),f=new c({index:1,str:"LOAD",methodName:"$load"}),_=new c({index:2,str:"MOUNT",methodName:"$mount"}),h=new c({index:3,str:"LOGIC",methodName:"$logic"}),d=new c({index:4,str:"PRE_RENDER",methodName:"$prerender"}),m=new c({index:5,str:"RENDER",methodName:"$render"}),v=new c({index:6,str:"UNMOUNT",methodName:"$unmount"}),p=new c({index:7,str:"DISCARD",methodName:"$discard"}),y=[l,u,f,_,h,d,m,v,p],A=Object.freeze({Unknown:l,Create:u,Load:f,Mount:_,Logic:h,PreRender:d,Render:m,Unmount:v,Discard:p,from:function(e){return(0,r.li)({typeList:y,index:e})}})},7952:(e,t,n)=>{n.d(t,{G:()=>C});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s.prototype.webGLConstantValue=function(){return-2===this.index?0:-1===this.index?1029:36064+this.index},s}(r.Jx),l=new c({index:-2,str:"NONE"}),u=new c({index:-1,str:"BACK"}),f=new c({index:0,str:"COLOR_ATTACHMENT0"}),_=new c({index:1,str:"COLOR_ATTACHMENT1"}),h=new c({index:2,str:"COLOR_ATTACHMENT2"}),d=new c({index:3,str:"COLOR_ATTACHMENT3"}),m=new c({index:4,str:"COLOR_ATTACHMENT4"}),v=new c({index:5,str:"COLOR_ATTACHMENT5"}),p=new c({index:6,str:"COLOR_ATTACHMENT6"}),y=new c({index:7,str:"COLOR_ATTACHMENT7"}),A=new c({index:8,str:"COLOR_ATTACHMENT8"}),b=new c({index:9,str:"COLOR_ATTACHMENT9"}),g=new c({index:10,str:"COLOR_ATTACHMENT10"}),x=new c({index:11,str:"COLOR_ATTACHMENT11"}),I=new c({index:12,str:"COLOR_ATTACHMENT12"}),E=new c({index:13,str:"COLOR_ATTACHMENT13"}),w=new c({index:14,str:"COLOR_ATTACHMENT14"}),S=new c({index:15,str:"COLOR_ATTACHMENT15"}),T=[l,u,f,_,h,d,m,v,p,y,A,b,g,x,I,E,w,S],C=Object.freeze({None:l,Back:u,ColorAttachment0:f,ColorAttachment1:_,ColorAttachment2:h,ColorAttachment3:d,ColorAttachment4:m,ColorAttachment5:v,ColorAttachment6:p,ColorAttachment7:y,ColorAttachment8:A,ColorAttachment9:b,ColorAttachment10:g,ColorAttachment11:x,ColorAttachment12:I,ColorAttachment13:E,ColorAttachment14:w,ColorAttachment15:S,from:function(e){return(0,r.li)({typeList:T,index:e})}})},3740:(e,t,n)=>{n.d(t,{Z:()=>_});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:0,str:"ClassicShading"}),u=new c({index:1,str:"PBRShading"}),f=(new c({index:2,str:"Lerp"}),new c({index:3,str:"Add"}),[l,u]),_=Object.freeze({ClassicShading:l,PBRShading:u,from:function(e){return(0,r.li)({typeList:f,index:e})},fromString:function(e){return(0,r.cu)({typeList:f,str:e})}})},7416:(e,t,n)=>{n.d(t,{UL:()=>wt,f5:()=>St,wy:()=>u});var r=n(3100),o=n(3932);function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function s(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?i(e):t}function c(e,t){return c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},c(e,t)}var l=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=a(t);if(n){var o=a(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return s(this,e)});function o(e){var t,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=r.call(this,{index:++o.__indexCount*o._scale,str:n,noCheckStrUnique:!0}),o.__classes[t.index]=i(t),t}return o.getShaderSemanticByIndex=function(e){return this.__classes[Math.abs(e)-Math.abs(e)%this._scale]},o.isNonArrayShaderSemanticIndex=function(e){return e>=this._scale},o.isArrayAndZeroIndexShaderSemanticIndex=function(e){return e<0&&Math.abs(e)%o._scale==0},o.isArrayAndNonZeroIndexShaderSemanticIndex=function(e){return e<0&&Math.abs(e)%o._scale!=0},o.getIndexCount=function(){return o.__indexCount},o}(r.Jx);u.__indexCount=-1,u._scale=1e4,u.__classes=[];var f=new u({str:"worldMatrix"}),_=new u({str:"viewMatrix"}),h=new u({str:"isBillboard"}),d=new u({str:"enableViewMatrix"}),m=new u({str:"projectionMatrix"}),v=new u({str:"normalMatrix"}),p=new u({str:"boneMatrix"}),y=new u({str:"baseColorFactor"}),A=new u({str:"baseColorTexture"}),b=new u({str:"normalTexture"}),g=new u({str:"metallicRoughnessTexture"}),x=new u({str:"occlusionTexture"}),I=new u({str:"emissiveFactor"}),E=new u({str:"emissiveTexture"}),w=new u({str:"lightNumber"}),S=new u({str:"lightPosition"}),T=new u({str:"lightDirection"}),C=new u({str:"lightIntensity"}),P=new u({str:"lightProperty"}),R=new u({str:"metallicRoughnessFactor"}),D=new u({str:"brdfLutTexture"}),M=new u({str:"diffuseEnvTexture"}),B=new u({str:"specularEnvTexture"}),N=new u({str:"inverseEnvironment"}),O=new u({str:"iblParameter"}),L=new u({str:"viewPosition"}),F=new u({str:"wireframe"}),G=new u({str:"diffuseColorFactor"}),V=new u({str:"diffuseColorTexture"}),z=new u({str:"shininess"}),k=new u({str:"shadingModel"}),U=new u({str:"skinningMode"}),Q=new u({str:"generalTexture"}),j=new u({str:"vertexAttributesExistenceArray"}),W=new u({str:"boneQuaternion"}),X=new u({str:"boneTranslateScale"}),H=new u({str:"boneTranslatePackedQuat"}),q=new u({str:"boneScalePackedQuat"}),Y=new u({str:"boneCompressedChunk"}),K=new u({str:"boneCompressedInfo"}),J=new u({str:"pointSize"}),Z=new u({str:"colorEnvTexture"}),$=new u({str:"pointDistanceAttenuation"}),ee=new u({str:"hdriFormat"}),te=new u({str:"screenInfo"}),ne=new u({str:"depthTexture"}),re=new u({str:"lightViewProjectionMatrix"}),oe=new u({str:"anisotropy"}),ie=new u({str:"clearcoatParameter"}),ae=new u({str:"sheenColorFactor"}),se=new u({str:"sheenColorTexture"}),ce=new u({str:"sheenRoughnessFactor"}),le=new u({str:"sheenRoughnessTexture"}),ue=new u({str:"sheenLutTexture"}),fe=new u({str:"specularGlossinessFactor"}),_e=new u({str:"specularGlossinessTexture"}),he=new u({str:"entityUID"}),de=new u({str:"morphTargetNumber"}),me=new u({str:"dataTextureMorphOffsetPosition"}),ve=new u({str:"morphWeights"}),pe=new u({str:"currentComponentSIDs"}),ye=new u({str:"alphaCutoff"}),Ae=new u({str:"alphaTexture"}),be=new u({str:"makeOutputSrgb"}),ge=new u({str:"framebufferWidth"}),xe=new u({str:"clearCoatFactor"}),Ie=new u({str:"clearCoatTexture"}),Ee=new u({str:"clearCoatRoughnessFactor"}),we=new u({str:"clearCoatRoughnessTexture"}),Se=new u({str:"clearCoatNormalTexture"}),Te=new u({str:"transmissionFactor"}),Ce=new u({str:"transmissionTexture"}),Pe=new u({str:"backBufferTexture"}),Re=new u({str:"backBufferTextureSize"}),De=new u({str:"thicknessFactor"}),Me=new u({str:"thicknessTexture"}),Be=new u({str:"attenuationDistance"}),Ne=new u({str:"attenuationColor"}),Oe=new u({str:"isOutputHDR"}),Le=new u({str:"baseColorTextureTransform"}),Fe=new u({str:"baseColorTextureRotation"}),Ge=new u({str:"normalTextureTransform"}),Ve=new u({str:"normalTextureRotation"}),ze=new u({str:"metallicRoughnessTextureTransform"}),ke=new u({str:"metallicRoughnessTextureRotation"}),Ue=new u({str:"normalTexcoordIndex"}),Qe=new u({str:"baseColorTexcoordIndex"}),je=new u({str:"metallicRoughnessTexcoordIndex"}),We=new u({str:"occlusionTexcoordIndex"}),Xe=new u({str:"occlusionTextureTransform"}),He=new u({str:"occlusionTextureRotation"}),qe=new u({str:"emissiveTexcoordIndex"}),Ye=new u({str:"emissiveTextureTransform"}),Ke=new u({str:"emissiveTextureRotation"}),Je=new u({str:"normalScale"}),Ze=new u({str:"occlusionStrength"}),$e=new u({str:"envRotation"}),et=new u({str:"envHdriFormat"}),tt=new u({str:"vrState"}),nt=new u({str:"enableLinearToSrgb"}),rt=new u({str:"specularFactor"}),ot=new u({str:"specularTexture"}),it=new u({str:"specularColorFactor"}),at=new u({str:"specularColorTexture"}),st=new u({str:"ior"}),ct=new u({str:"depthBiasPV"}),lt=new u({str:"clearCoatTextureTransform"}),ut=new u({str:"clearCoatTextureRotation"}),ft=new u({str:"clearCoatRoughnessTextureTransform"}),_t=new u({str:"clearCoatRoughnessTextureRotation"}),ht=new u({str:"clearCoatNormalTextureTransform"}),dt=new u({str:"clearCoatNormalTextureRotation"}),mt=new u({str:"clearCoatTexcoordIndex"}),vt=new u({str:"clearCoatRoughnessTexcoordIndex"}),pt=new u({str:"clearCoatNormalTexcoordIndex"}),yt=new u({str:"iridescenceFactor"}),At=new u({str:"iridescenceTexture"}),bt=new u({str:"iridescenceIor"}),gt=new u({str:"iridescenceThicknessMinimum"}),xt=new u({str:"iridescenceThicknessMaximum"}),It=new u({str:"iridescenceThicknessTexture"}),Et=[f,_,h,d,m,v,p,y,A,b,g,x,I,E,w,S,T,C,P,R,D,M,B,N,O,L,F,G,V,z,k,U,Q,j,W,X,H,q,Y,K,J,Z,$,ee,te,ne,re,oe,ie,ae,se,ce,le,ue,fe,_e,he,de,me,ve,pe,ye,Ae,be,ge,xe,Ie,Ee,we,Se,Te,Ce,Pe,Re,De,Me,Be,Ne,Oe,Le,Fe,Ge,Ve,ze,ke,Ue,Qe,je,We,Xe,He,qe,Ye,Ke,Je,Ze,$e,et,tt,nt,rt,ot,it,at,st,ct,lt,ut,ft,_t,ht,dt,mt,vt,pt,yt,At,bt,gt,xt,It];function wt(e){return e.index}var St=Object.freeze({from:function(e){return(0,r.li)({typeList:Et,index:e})},fromString:function(e){return(0,r.cu)({typeList:Et,str:e})},fromStringCaseSensitively:function(e){return(0,r.bm)({typeList:Et,str:e})},WorldMatrix:f,ViewMatrix:_,IsBillboard:h,EnableViewMatrix:d,ProjectionMatrix:m,NormalMatrix:v,BoneMatrix:p,BaseColorFactor:y,BaseColorTexture:A,NormalTexture:b,MetallicRoughnessTexture:g,OcclusionTexture:x,EmissiveFactor:I,EmissiveTexture:E,LightNumber:w,LightPosition:S,LightDirection:T,LightIntensity:C,LightProperty:P,MetallicRoughnessFactor:R,BrdfLutTexture:D,DiffuseEnvTexture:M,SpecularEnvTexture:B,InverseEnvironment:N,IBLParameter:O,ViewPosition:L,Wireframe:F,DiffuseColorFactor:G,DiffuseColorTexture:V,Shininess:z,ShadingModel:k,SkinningMode:U,GeneralTexture:Q,VertexAttributesExistenceArray:j,BoneQuaternion:W,BoneTranslateScale:X,BoneTranslatePackedQuat:H,BoneScalePackedQuat:q,BoneCompressedChunk:Y,BoneCompressedInfo:K,PointSize:J,ColorEnvTexture:Z,PointDistanceAttenuation:$,HDRIFormat:ee,ScreenInfo:te,DepthTexture:ne,LightViewProjectionMatrix:re,Anisotropy:oe,ClearCoatParameter:ie,SheenColorFactor:ae,SheenColorTexture:se,SheenRoughnessFactor:ce,SheenRoughnessTexture:le,SheenLutTexture:ue,SpecularGlossinessFactor:fe,SpecularGlossinessTexture:_e,ClearCoatFactor:xe,ClearCoatTexture:Ie,ClearCoatRoughnessFactor:Ee,ClearCoatRoughnessTexture:we,ClearCoatNormalTexture:Se,TransmissionFactor:Te,TransmissionTexture:Ce,BackBufferTexture:Pe,BackBufferTextureSize:Re,ThicknessFactor:De,ThicknessTexture:Me,AttenuationDistance:Be,AttenuationColor:Ne,fullSemanticStr:function(e){var t="";return null!=e.prefix&&(t=e.prefix),t+e.semantic.str},getShaderProperty:function(e,t,n,r,i){if(t.isComponentData)return"";var a=t.compositionType.getGlslStr(t.componentType),s=St.fullSemanticStr(t),c=t.compositionType.getGlslStr(t.componentType),l="";t.arrayLength&&(l="[".concat(t.arrayLength,"]"));var f=" uniform ".concat(c," u_").concat(s).concat(l,";\n"),_="";if(n<0||o.d.isArray(t.compositionType)){if(Math.abs(n)%u._scale!=0&&!o.d.isArray(t.compositionType))return"";s.match(/\[.+?\]/)?s=s.replace(/\[.+?\]/g,"[i]"):s+="[i]",_+=i?"\n ".concat(a," val;\n int i = index;\n return u_").concat(s,";\n "):"\n ".concat(a," val;\n for (int i=0; i<").concat(t.arrayLength,"; i++) {\n if (i == index) {\n val = u_").concat(s,";\n break;\n }\n }\n return val;\n ")}else _+="return u_".concat(s,";");var h="";return o.d.isTexture(t.compositionType)||(h="\n ".concat(a," get_").concat(t.semantic.str,"(float instanceId, int index) {\n ").concat(_,"\n }\n")),"".concat(f).concat(h)},EntityUID:he,MorphTargetNumber:de,DataTextureMorphOffsetPosition:me,MorphWeights:ve,CurrentComponentSIDs:pe,AlphaCutoff:ye,AlphaTexture:Ae,MakeOutputSrgb:be,FramebufferWidth:ge,IsOutputHDR:Oe,BaseColorTextureTransform:Le,BaseColorTextureRotation:Fe,NormalTextureTransform:Ge,NormalTextureRotation:Ve,MetallicRoughnessTextureTransform:ze,MetallicRoughnessTextureRotation:ke,NormalTexcoordIndex:Ue,BaseColorTexcoordIndex:Qe,MetallicRoughnessTexcoordIndex:je,OcclusionTexcoordIndex:We,OcclusionTextureTransform:Xe,OcclusionTextureRotation:He,EmissiveTexcoordIndex:qe,EmissiveTextureTransform:Ye,EmissiveTextureRotation:Ke,NormalScale:Je,OcclusionStrength:Ze,envRotation:$e,EnvHdriFormat:et,VrState:tt,EnableLinearToSrgb:nt,SpecularFactor:rt,SpecularTexture:ot,SpecularColorFactor:it,SpecularColorTexture:at,Ior:st,DepthBiasPV:ct,ClearCoatTextureTransform:lt,ClearCoatTextureRotation:ut,ClearCoatRoughnessTextureTransform:ft,ClearCoatRoughnessTextureRotation:_t,ClearCoatNormalTextureTransform:ht,ClearCoatNormalTextureRotation:dt,ClearCoatTexcoordIndex:mt,ClearCoatRoughnessTexcoordIndex:vt,ClearCoatNormalTexcoordIndex:pt,IridescenceFactor:yt,IridescenceTexture:At,IridescenceIor:bt,IridescenceThicknessMinimum:gt,IridescenceThicknessMaximum:xt,IridescenceThicknessTexture:It})},3138:(e,t,n)=>{n.d(t,{K:()=>o,V:()=>i});var r=n(3932);function o(e){var t=e.compositionType.getNumberOfComponents()*e.componentType.getSizeInBytes(),n=t;if(n%16!=0&&(n=t+16-t%16),r.d.isArray(e.compositionType)){var o=e.arrayLength;null!=o?n*=o:(console.error("semanticInfo has invalid maxIndex!"),n*=100)}return n}function i(e){return e.semantic.index}},5685:(e,t,n)=>{n.d(t,{H:()=>d});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:1,str:"VertexShader"}),u=new c({index:2,str:"PixelShader"}),f=new c({index:3,str:"VertexAndPixelShader"}),_=new c({index:4,str:"ComputeShader"}),h=[l,u,f,_],d=Object.freeze({VertexShader:l,PixelShader:u,VertexAndPixelShader:f,ComputeShader:_,from:function(e){return(0,r.li)({typeList:h,index:e})},fromString:function(e){return(0,r.cu)({typeList:h,str:e})}})},678:(e,t,n)=>{n.d(t,{a:()=>h});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:0,str:"FirstTimeOnly"}),u=new c({index:1,str:"EveryTime"}),f=new c({index:2,str:"RenderPass"}),_=[l,u,f],h=Object.freeze({FirstTimeOnly:l,EveryTime:u,RenderPass:f,from:function(e){return(0,r.li)({typeList:_,index:e})},fromString:function(e){return(0,r.cu)({typeList:_,str:e})}})},7364:(e,t,n)=>{n.d(t,{D:()=>m});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:-1,str:"UNKNOWN"}),u=new c({index:0,str:"CONSTANT"}),f=new c({index:1,str:"LAMBERT"}),_=new c({index:2,str:"BLINN"}),h=new c({index:3,str:"PHONG"}),d=[l,u,f,_,h],m=Object.freeze({Unknown:l,Constant:u,Lambert:f,BlinnPhong:_,Phong:h,from:function(e){return(0,r.li)({typeList:d,index:e})}})},7102:(e,t,n)=>{n.d(t,{d:()=>j});var r=n(2142),o=n(3100),i=n(4543);function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function s(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e,t){return c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},c(e,t)}var l=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=a(t);if(n){var o=a(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return s(this,e)});function o(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,{index:t,str:n})}return o}(o.Jx),f=new u({index:9728,str:"NEAREST"}),_=new u({index:9729,str:"LINEAR"}),h=new u({index:9984,str:"NEAREST_MIPMAP_NEAREST"}),d=new u({index:9985,str:"LINEAR_MIPMAP_NEAREST"}),m=new u({index:9986,str:"NEAREST_MIPMAP_LINEAR"}),v=new u({index:9987,str:"LINEAR_MIPMAP_LINEAR"}),p=new u({index:10240,str:"TEXTURE_MAG_FILTER"}),y=new u({index:10241,str:"TEXTURE_MIN_FILTER"}),A=new u({index:10242,str:"TEXTURE_WRAP_S"}),b=new u({index:10243,str:"TEXTURE_WRAP_T"}),g=new u({index:3553,str:"TEXTURE_2D"}),x=new u({index:5890,str:"TEXTURE"}),I=new u({index:33984,str:"TEXTURE0"}),E=new u({index:33985,str:"TEXTURE1"}),w=new u({index:34016,str:"ACTIVE_TEXTURE"}),S=new u({index:10497,str:"REPEAT"}),T=new u({index:33071,str:"CLAMP_TO_EDGE"}),C=new u({index:33648,str:"MIRRORED_REPEAT"}),P=new u({index:32849,str:"RGB8"}),R=new u({index:32856,str:"RGBA8"}),D=new u({index:32857,str:"RGB10_A2"}),M=new u({index:r.uLG,str:"RG16F"}),B=new u({index:r.uM4,str:"RG32F"}),N=new u({index:34843,str:"RGB16F"}),O=new u({index:34837,str:"RGB32F"}),L=new u({index:34842,str:"RGBA16F"}),F=new u({index:34836,str:"RGBA32F"}),G=new u({index:33189,str:"DEPTH_COMPONENT16"}),V=new u({index:33190,str:"DEPTH_COMPONENT24"}),z=new u({index:36012,str:"DEPTH_COMPONENT32F"}),k=new u({index:35056,str:"DEPTH24_STENCIL8"}),U=new u({index:36013,str:"DEPTH32F_STENCIL8"}),Q=[f,_,h,d,m,v,p,y,A,b,g,x,I,E,w,S,T,C,P,R,D,M,B,N,O,L,F,G,V,z,k,U],j=Object.freeze({Nearest:f,Linear:_,NearestMipmapNearest:h,LinearMipmapNearest:d,NearestMipmapLinear:m,LinearMipmapLinear:v,TextureMagFilter:p,TextureMinFilter:y,TextureWrapS:A,TextureWrapT:b,Texture2D:g,Texture:x,Texture0:I,Texture1:E,ActiveTexture:w,Repeat:S,ClampToEdge:T,MirroredRepeat:C,RGB8:P,RGBA8:R,RGB10_A2:D,RG16F:M,RG32F:B,RGB16F:N,RGB32F:O,RGBA16F:L,RGBA32F:F,Depth16:G,Depth24:V,Depth32F:z,Depth24Stencil8:k,Depth32FStencil8:U,from:function(e){return(0,o.li)({typeList:Q,index:e})},migrateToWebGL1InternalFormat:function(e){if(e.index===R.index)return i.V.RGBA;if(e.index===P.index)return i.V.RGB;throw new Error("Unsupported texture parameter")}})},6221:(e,t,n)=>{n.d(t,{T:()=>S,x:()=>u});var r=n(3100),o=n(3116);function i(e,t){for(var n=0;n{n.d(t,{Fv:()=>r.F,sd:()=>o.s,kO:()=>i.k,l6:()=>a.l,Nh:()=>s.N,$H:()=>c.$,My:()=>l.M,iM:()=>u.i,re:()=>f.r,dh:()=>_.d,bf:()=>h.b,Tv:()=>d.T,cz:()=>m.c,vB:()=>v.v,VI:()=>p.V,Tc:()=>y.T,V7:()=>A.V,yv:()=>A.y,Iq:()=>b.I,G2:()=>g.G,Zp:()=>x.Z,f5:()=>I.f5,wy:()=>I.wy,Ho:()=>w.H,Lv:()=>O,ax:()=>L.a,DA:()=>F.D,J1:()=>X,dI:()=>H.d,T:()=>q.T,x$:()=>q.x,EE:()=>oe,Vl:()=>E.V,UL:()=>I.UL,Ky:()=>E.K});var r=n(3650),o=n(166),i=n(9611),a=n(2503),s=n(8468),c=n(5171),l=n(5674),u=n(2637),f=n(2535),_=n(3932),h=n(1903),d=n(5274),m=n(6558),v=n(9805),p=n(4543),y=n(361),A=n(7042),b=n(6815),g=n(7952),x=n(3740),I=n(7416),E=n(3138),w=n(5685),S=n(3100);function T(e){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},T(e)}function C(e,t){return!t||"object"!==R(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function P(e,t){return P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},P(e,t)}var R=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var D=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=T(t);if(n){var o=T(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return C(this,e)});function o(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,{index:t,str:n})}return o}(S.Jx),M=new D({index:1,str:"Varying"}),B=new D({index:2,str:"ReadOnlyData"}),N=[M,B],O=Object.freeze({Varying:M,ReadOnlyData:B,from:function(e){return(0,S.li)({typeList:N,index:e})},fromString:function(e){return(0,S.cu)({typeList:N,str:e})}}),L=n(678),F=n(7364);function G(e){return G=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},G(e)}function V(e,t){return!t||"object"!==k(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function z(e,t){return z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},z(e,t)}var k=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var U=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=G(t);if(n){var o=G(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return V(this,e)});function o(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,{index:t,str:n})}return o}(S.Jx),Q=new U({index:0,str:"Standard"}),j=new U({index:1,str:"Variance"}),W=[Q,j],X=Object.freeze({Standard:Q,Variance:j,from:function(e){return(0,S.li)({typeList:W,index:e})},fromString:function(e){return(0,S.cu)({typeList:W,str:e})}}),H=n(7102),q=n(6221);function Y(e){return Y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Y(e)}function K(e,t){return!t||"object"!==Z(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function J(e,t){return J=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},J(e,t)}var Z=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var $=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&J(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Y(t);if(n){var o=Y(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return K(this,e)});function o(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r.call(this,{index:t,str:n})}return o}(S.Jx),ee=new $({index:0,str:"Neutral"}),te=new $({index:1,str:"Visible"}),ne=new $({index:-1,str:"Invisible"}),re=[te,ne,ee],oe=Object.freeze({Visible:te,Invisible:ne,Neutral:ee,from:function(e){return(0,S.li)({typeList:re,index:e})},fromString:function(e){return(0,S.cu)({typeList:re,str:e})}})},1560:(e,t,n)=>{n.d(t,{i:()=>s});var r=n(6264),o=n(7468),i=n(8289),a=n(2328),s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.top=a.xQ.zero(),this.bottom=a.xQ.zero(),this.right=a.xQ.zero(),this.left=a.xQ.zero(),this.zNear=a.xQ.zero(),this.zFar=a.xQ.zero(),this.__updated=!1,this.__vp=i.e.zero(),this.__invProjMat=i.e.zero(),this.__invViewMat=i.e.zero(),this.corners=[]}var t=e.prototype;return t.update=function(e,t){o.J.multiplyTo(t,e,this.__vp),this.zNear.x=this.__vp.m20+this.__vp.m30,this.zNear.y=this.__vp.m21+this.__vp.m31,this.zNear.z=this.__vp.m22+this.__vp.m32,this.zNear.w=this.__vp.m23+this.__vp.m33,this.zNear.normalize3(),this.zFar.x=-this.__vp.m20+this.__vp.m30,this.zFar.y=-this.__vp.m21+this.__vp.m31,this.zFar.z=-this.__vp.m22+this.__vp.m32,this.zFar.w=-this.__vp.m23+this.__vp.m33,this.zFar.normalize3(),this.bottom.x=this.__vp.m10+this.__vp.m30,this.bottom.y=this.__vp.m11+this.__vp.m31,this.bottom.z=this.__vp.m12+this.__vp.m32,this.bottom.w=this.__vp.m13+this.__vp.m33,this.bottom.normalize3(),this.top.x=-this.__vp.m10+this.__vp.m30,this.top.y=-this.__vp.m11+this.__vp.m31,this.top.z=-this.__vp.m12+this.__vp.m32,this.top.w=-this.__vp.m13+this.__vp.m33,this.top.normalize3(),this.left.x=this.__vp.m00+this.__vp.m30,this.left.y=this.__vp.m01+this.__vp.m31,this.left.z=this.__vp.m02+this.__vp.m32,this.left.w=this.__vp.m03+this.__vp.m33,this.left.normalize3(),this.right.x=-this.__vp.m00+this.__vp.m30,this.right.y=-this.__vp.m01+this.__vp.m31,this.right.z=-this.__vp.m02+this.__vp.m32,this.right.w=-this.__vp.m03+this.__vp.m33,this.right.normalize3();var n=[r.Lt.fromCopy4(-1,1,1,1),r.Lt.fromCopy4(1,1,1,1),r.Lt.fromCopy4(1,-1,1,1),r.Lt.fromCopy4(-1,-1,1,1),r.Lt.fromCopy4(-1,1,-1,1),r.Lt.fromCopy4(1,1,-1,1),r.Lt.fromCopy4(1,-1,-1,1),r.Lt.fromCopy4(-1,-1,-1,1)];o.J.invertTo(t,this.__invProjMat),o.J.invertTo(e,this.__invViewMat);for(var i=0;i<8;i++)n[i]=this.__invProjMat.multiplyVector(n[i]),n[i]=r.Lt.fromCopy4(n[i].x/n[i].w,n[i].y/n[i].w,n[i].z/n[i].w,1),this.corners[i]=this.__invViewMat.multiplyVector(n[i])},t.culling=function(e){for(var t=e.entity.getSceneGraph().worldAABB,n=0;n<6;n++){var r=0,o=this.getPlane(n);if(r+=o.x*t.minPoint.x+o.y*t.minPoint.y+o.z*t.minPoint.z+o.w<0?1:0,r+=o.x*t.maxPoint.x+o.y*t.minPoint.y+o.z*t.minPoint.z+o.w<0?1:0,r+=o.x*t.minPoint.x+o.y*t.maxPoint.y+o.z*t.minPoint.z+o.w<0?1:0,r+=o.x*t.maxPoint.x+o.y*t.maxPoint.y+o.z*t.minPoint.z+o.w<0?1:0,r+=o.x*t.minPoint.x+o.y*t.minPoint.y+o.z*t.maxPoint.z+o.w<0?1:0,r+=o.x*t.maxPoint.x+o.y*t.minPoint.y+o.z*t.maxPoint.z+o.w<0?1:0,r+=o.x*t.minPoint.x+o.y*t.maxPoint.y+o.z*t.maxPoint.z+o.w<0?1:0,8===(r+=o.x*t.maxPoint.x+o.y*t.maxPoint.y+o.z*t.maxPoint.z+o.w<0?1:0))return!1}var i=0;i=0;for(var a=0;a<8;a++)i+=this.corners[a].x>t.maxPoint.x?1:0;if(8===i)return!1;i=0;for(var s=0;s<8;s++)i+=this.corners[s].xt.maxPoint.y?1:0;if(8===i)return!1;i=0;for(var l=0;l<8;l++)i+=this.corners[l].yt.maxPoint.z?1:0;if(8===i)return!1;i=0;for(var f=0;f<8;f++)i+=this.corners[f].z{n.d(t,{K:()=>m});var r=n(6221),o=n(361),i=n(4395),a=n(5171),s=n(2535),c=n(3932),l=n(6860),u=n(6631),f=n(4021),_=n(988),h=n(9197);function d(e,t){for(var n=0;n0&&0===this.__opaquePrimitives.length},m.isBlendPartially=function(){return this.__transparentPrimitives.length>0&&this.__opaquePrimitives.length>0},m.isOpaque=function(){return 0===this.__transparentPrimitives.length&&this.__opaquePrimitives.length>0},m.getPrimitiveAt=function(e){return this.__primitives[e]},m.getPrimitiveNumber=function(){return this.__primitives.length},m.updateVariationVBO=function(){var e=f.F.getWebGLResourceRepository();this.__variationVBOUid!==f.F.InvalidCGAPIResourceUid&&e.deleteVertexBuffer(this.__variationVBOUid);for(var t=this.__belongToEntities.length,n=new Float32Array(4*t),r=0;r2&&void 0!==arguments[2]?arguments[2]:0,o=Number.MAX_VALUE,i=0,a=0,s=!0,c=!1,l=void 0;try{for(var u,f=this.__primitives[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var _,d=u.value,m=d.castRay(e,t,!0,!0,r,this.__hasFaceNormal);h.Is.defined(m.data)&&(null===(_=m.data)||void 0===_?void 0:_.t){n.d(t,{W:()=>I});var r=n(361),o=n(6221),i=n(9315),a=n(2535),s=n(4395),c=n(3932),l=n(6631),u=n(6382),f=n(4021),_=n(6860),h=n(988),d=n(9197),m=n(5653),v=n(9425),p=n(2879);function y(e,t){for(var n=0;nf.elementCount-1)break;var v=f.getScalar(m,{}),p=f.getScalar(m+1,{}),y=f.getScalar(m+2,{}),A=this.__castRayInnerTomasMoller(e,t,h,v,p,y,n,o,i,a);d.Is.false(A)||d.Is.not.exist(A.data)||A.data.t-l&&!c)return{result:!1}}}var m=this.__attributes.get(o.T.Position.XYZ),v=m.getVec3(r,{}),p=m.getVec3(i,{}),y=m.getVec3(a,{}),A=h.d6.zero(),b=h.d6.zero(),g=h.d6.zero(),x=h.d6.zero(),I=h.d6.zero(),E=0,w=0;h.d6.subtractTo(p,v,A),h.d6.subtractTo(y,v,b),h.d6.crossTo(t,b,g);var S=_.P.dot(A,g);if(S>1e-4){if(h.d6.subtractTo(e,v,x),(E=_.P.dot(x,g))<0||E>S)return{result:!1};if(h.d6.crossTo(x,A,I),(w=_.P.dot(t,I))<0||E+w>S)return{result:!1}}else{if(!(S<-1e-4))return{result:!1};if(h.d6.subtractTo(e,v,x),(E=_.P.dot(x,g))>0||E0||E+w{n.d(t,{X:()=>h});var r=n(361),o=n(6221),i=n(6860),a=n(9197),s=n(8118);function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function u(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}var _=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(_,e);var t,n,s=(t=_,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=l(t);if(n){var o=l(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return u(this,e)});function _(){return c(this,_),s.apply(this,arguments)}return _.prototype.generate=function(e){var t,n={widthVector:null!==(t=e.widthVector)&&void 0!==t?t:i.P.fromCopy3(1,1,1),color:e.color,material:e.material},s=[-n.widthVector.x,n.widthVector.y,-n.widthVector.z,n.widthVector.x,n.widthVector.y,-n.widthVector.z,n.widthVector.x,n.widthVector.y,n.widthVector.z,-n.widthVector.x,n.widthVector.y,n.widthVector.z,-n.widthVector.x,-n.widthVector.y,-n.widthVector.z,n.widthVector.x,-n.widthVector.y,-n.widthVector.z,n.widthVector.x,-n.widthVector.y,n.widthVector.z,-n.widthVector.x,-n.widthVector.y,n.widthVector.z,-n.widthVector.x,-n.widthVector.y,n.widthVector.z,n.widthVector.x,-n.widthVector.y,n.widthVector.z,n.widthVector.x,n.widthVector.y,n.widthVector.z,-n.widthVector.x,n.widthVector.y,n.widthVector.z,-n.widthVector.x,-n.widthVector.y,-n.widthVector.z,n.widthVector.x,-n.widthVector.y,-n.widthVector.z,n.widthVector.x,n.widthVector.y,-n.widthVector.z,-n.widthVector.x,n.widthVector.y,-n.widthVector.z,n.widthVector.x,-n.widthVector.y,-n.widthVector.z,n.widthVector.x,-n.widthVector.y,n.widthVector.z,n.widthVector.x,n.widthVector.y,n.widthVector.z,n.widthVector.x,n.widthVector.y,-n.widthVector.z,-n.widthVector.x,-n.widthVector.y,-n.widthVector.z,-n.widthVector.x,-n.widthVector.y,n.widthVector.z,-n.widthVector.x,n.widthVector.y,n.widthVector.z,-n.widthVector.x,n.widthVector.y,-n.widthVector.z],c=a.Is.not.exist(n.color)?[]:[n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a],l=[o.T.Position.XYZ,o.T.Normal.XYZ,o.T.Texcoord0.XY],u=[new Float32Array(s),new Float32Array([0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),new Float32Array([0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1])];a.Is.exist(n.color)&&(l.push(o.T.Color0.XYZ),u.push(new Float32Array(c)));var f=r.T.Triangles;this.copyVertexData({attributes:u,attributeSemantics:l,primitiveMode:f,indices:new Uint16Array([3,1,0,2,1,3,4,5,7,7,5,6,8,9,11,11,9,10,15,13,12,14,13,15,19,17,16,18,17,19,20,21,23,23,21,22]),material:n.material})},_}(s.W)},485:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(8118);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function a(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e,t){return s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},s(e,t)}var c=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(c,e);var t,n,r=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=i(t);if(n){var o=i(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return a(this,e)});function c(){return o(this,c),r.apply(this,arguments)}return c}(r.W)},3999:(e,t,n)=>{n.d(t,{J:()=>f});var r=n(6221),o=n(361),i=n(485);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function c(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e,t){return l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},l(e,t)}var u=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(u,e);var t,n,i=(t=u,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s(t);if(n){var o=s(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return c(this,e)});function u(){return a(this,u),i.apply(this,arguments)}return u.prototype.generate=function(e){for(var t,n,i,a,s,c,l={width:null!==(t=e.width)&&void 0!==t?t:1,height:null!==(n=e.height)&&void 0!==n?n:1,uSpan:null!==(i=e.uSpan)&&void 0!==i?i:1,vSpan:null!==(a=e.vSpan)&&void 0!==a?a:1,isUVRepeat:null!==(s=e.isUVRepeat)&&void 0!==s&&s,flipTextureCoordinateY:null!==(c=e.flipTextureCoordinateY)&&void 0!==c&&c,material:e.material},u=[],f=0;f<=l.vSpan;f++)for(var _=0;_<=l.uSpan;_++)u.push((_/l.uSpan-.5)*l.width),u.push(0),u.push((f/l.vSpan-.5)*l.height);for(var h=[],d=0;d{n.d(t,{BH:()=>l,IM:()=>i,Qo:()=>u,V_:()=>s,Y1:()=>a,Yx:()=>c,aK:()=>r,xz:()=>o});var r=3,o=10,i=2,a=0,s=r,c=r+o,l=r+o+i,u=32},706:(e,t,n)=>{n.d(t,{q:()=>m});var r=n(5478),o=n(361),i=n(6221),a=n(8118),s=n(6860),c=n(6601),l=n(524);function u(e,t){for(var n=0;n{n.d(t,{t:()=>u});var r=n(9315),o=n(429);function i(e,t){for(var n=0;n{n.d(t,{k:()=>m});var r=n(361),o=n(6221),i=n(6601),a=n(8118),s=n(524),c=n(6860),l=n(5478);function u(e,t){for(var n=0;n{n.d(t,{q:()=>B});var r=n(3279),o=n(6383),i=n(9977),a=n(3650),s=n(361),c=n(7416),l=n(6221),u=n(6601),f=n(8118),_=n(189),h=n(3999),d=n(524),m=n(6382),v=n(4969),p=n(6386),y=n(7468),A=n(2863),b=n(5233),g=n(6860),x=n(6264),I=n(9197),E=n(1274),w=n(5511),S=n(5478);function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e,t){for(var n=0;n{n.d(t,{u:()=>B});var r=n(3279),o=n(6383),i=n(9977),a=n(3650),s=n(361),c=n(7416),l=n(6221),u=n(6601),f=n(8118),_=n(189),h=n(3999),d=n(524),m=n(6382),v=n(7468),p=n(4969),y=n(6386),A=n(2863),b=n(5233),g=n(6860),x=n(6264),I=n(9197),E=n(1274),w=n(5511),S=n(5478);function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function C(e,t){for(var n=0;n{n.d(t,{_:()=>v});var r=n(2342),o=n(1417),i=n(429),a=n(9856),s=n(6807),c=n(6696),l=n(1625),u=n(2670),f=n(3279),_=n(4654);function h(){var e=r.g.createEntity();return r.g.addComponentToEntity(o.U,e)}function d(){var e=h();return r.g.addComponentToEntity(i.a,e)}function m(){var e=d();return r.g.addComponentToEntity(f.M,e)}var v=Object.freeze({createEntity:function(){return r.g.createEntity()},createTransformEntity:h,createGroupEntity:d,createMeshEntity:function(){var e=d(),t=r.g.addComponentToEntity(a.$,e);return r.g.addComponentToEntity(s.Y,t)},createCameraEntity:m,createCameraControllerEntity:function(){var e=m();return r.g.addComponentToEntity(c.S,e)},createSkeletalEntity:function(){var e=d();return r.g.addComponentToEntity(l.Y,e)},createLightEntity:function(){var e=d();return r.g.addComponentToEntity(_.r,e)},createLightWithCameraEntity:function(){var e=d(),t=r.g.addComponentToEntity(_.r,e),n=r.g.addComponentToEntity(f.M,t);return n.getCamera().isSyncToLight=!0,n},createPhysicsEntity:function(){var e=d();return r.g.addComponentToEntity(u.Z,e)}})},6382:(e,t,n)=>{n.d(t,{G:()=>W});var r=n(9977),o=n(7011),i=n(9305),a=n(7862),s=n(7403),c=n(6105),l=n(6165),u=n(6815),f=n(8563),_=n(1668),h=n(1349),d=n(5995),m=n(2653),v=n(3297),p=n(1181),y=n(9573),A=n(3673),b=n(7416),g=n(2535),x=n(3932),I=n(5685),E=n(2175);const w={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec3 v_baryCentricCoord;\nout vec4 v_shadowCoord;\n\nuniform float u_pointSize; // initialValue=30\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0,0.1,0.01)\n\n// BiasMatrix * LightProjectionMatrix * LightViewMatrix, See: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/#basic-shader\nuniform mat4 u_depthBiasPV; // initialValue=(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n\n v_color = a_color;\n v_normal_inWorld = normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n v_shadowCoord = get_depthBiasPV(materialSID, 0) * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},S={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec3 v_baryCentricCoord;\nin vec4 v_shadowCoord;\n\nuniform int u_shadingModel; // initialValue=0\nuniform float u_alphaCutoff; // initialValue=0.01\nuniform float u_shininess; // initialValue=5\nuniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)\nuniform sampler2D u_diffuseColorTexture; // initialValue=(0,white)\nuniform sampler2D u_normalTexture; // initialValue=(1,blue)\nuniform vec4 u_diffuseColorTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_diffuseColorTextureRotation; // initialValue=0\nuniform sampler2DShadow u_depthTexture; // initialValue=(2,white)\n\n/* shaderity: @{renderTargetBegin} */\n\n// #pragma shaderity: require(../common/deliot2019SeamlessTexture.glsl)\n// uniform sampler2D u_tInvTexture; // initialValue=(1,white)\n// uniform vec3 u_colorSpaceOrigin;\n// uniform vec3 u_colorSpaceVector1;\n// uniform vec3 u_colorSpaceVector2;\n// uniform vec3 u_colorSpaceVector3;\n// uniform vec4 u_scaleTranslate;\n\n\nvec2 uvTransform(vec2 scale, vec2 offset, float rotation, vec2 uv) {\n mat3 translationMat = mat3(1,0,0, 0,1,0, offset.x, offset.y, 1);\n mat3 rotationMat = mat3(\n cos(rotation), -sin(rotation), 0,\n sin(rotation), cos(rotation), 0,\n 0, 0, 1\n );\n mat3 scaleMat = mat3(scale.x,0,0, 0,scale.y,0, 0,0,1);\n\n mat3 matrix = translationMat * rotationMat * scaleMat;\n vec2 uvTransformed = ( matrix * vec3(uv.xy, 1) ).xy;\n\n return uvTransformed;\n}\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n\n\n // diffuseColor (Considered to be premultiplied alpha)\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture (Considered to be premultiplied alpha)\n vec4 diffuseColorTextureTransform = get_diffuseColorTextureTransform(materialSID, 0);\n float diffuseColorTextureRotation = get_diffuseColorTextureRotation(materialSID, 0);\n vec2 diffuseColorTexUv = uvTransform(diffuseColorTextureTransform.xy, diffuseColorTextureTransform.zw, diffuseColorTextureRotation, v_texcoord_0);\n vec4 textureColor = texture(u_diffuseColorTexture, diffuseColorTexUv);\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n\n#ifdef RN_IS_ALPHAMODE_MASK\n float alphaCutoff = get_alphaCutoff(materialSID, 0);\n if (alpha < alphaCutoff) {\n discard;\n }\n#endif\n\n\n // Lighting\n vec3 shadingColor = vec3(0.0, 0.0, 0.0);\n#ifdef RN_IS_LIGHTING\n int shadingModel = get_shadingModel(materialSID, 0);\n if (shadingModel > 0) {\n\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */ ; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n // Diffuse\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, light.direction)) * light.attenuatedIntensity;\n\n float shininess = get_shininess(materialSID, 0);\n int shadingModel = get_shadingModel(materialSID, 0);\n\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n\n // Specular\n if (shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 halfVector = normalize(light.direction + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), shininess);\n } else if (shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 R = reflect(light.direction, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), shininess);\n }\n\n }\n\n shadingColor = diffuse + specular;\n } else {\n shadingColor = diffuseColor;\n }\n#else\n shadingColor = diffuseColor;\n#endif\n\n // Shadow\n#ifdef RN_USE_SHADOW_MAPPING\n float visibility = 1.0;\n float bias = 0.001;\n\n // Non PCF\n // if ( textureProj( u_depthTexture, v_shadowCoord ).r < (v_shadowCoord.z - bias) / v_shadowCoord.w ) {\n // visibility = 0.5;\n // }\n // shadingColor *= visibility;\n\n // Hardware PCF\n vec4 shadowCoord = v_shadowCoord;\n shadowCoord.z -= bias;\n shadingColor *= textureProj( u_depthTexture, shadowCoord ) * 0.5 + 0.5;\n\n // shadingColor.rgb = texture( u_depthTexture, v_shadowCoord.xy ).rrr;\n // shadingColor.rgb = vec3(v_shadowCoord.xy, 0.0);\n // shadingColor.rgb = vec3(diffuseColorTexUv, 0.0);\n // shadingColor.rgb = vec3(texture( u_depthTexture, diffuseColorTexUv).rrr);\n // shadingColor.rgb = texture( u_depthTexture, diffuseColorTexUv).rgb;\n // shadingColor.rgb = vec3(textureProj( u_depthTexture, v_shadowCoord ).z, 0.0, 0.0);\n alpha = 1.0;\n#endif\n\n rt0 = vec4(shadingColor * alpha, alpha);\n // rt0 = vec4(u_lightNumber, 0.0, 0.0, 1.0);\n // rt0 = vec4(1.0, 0.0, 0.0, 1.0);\n // rt0 = vec4(normal_inWorld*0.5+0.5, 1.0);\n\n#ifdef RN_IS_ALPHAMODE_OPAQUE\n rt0.a = 1.0;\n#elif defined(RN_IS_ALPHAMODE_MASK)\n rt0.a = 1.0;\n#endif\n\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},T={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec2 a_texcoord_1;\nin vec2 a_texcoord_2;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec2 v_texcoord_1;\nout vec2 v_texcoord_2;\nout vec3 v_baryCentricCoord;\nout float v_instanceInfo;\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n in vec4 a_tangent;\n out vec3 v_tangent_inWorld;\n out vec3 v_binormal_inWorld;\n#endif\n#ifdef RN_USE_SHADOW_MAPPING\n out vec4 v_shadowCoord;\n#endif\n\nuniform float u_pointSize; // initialValue=30, soloDatum=true\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0.0, 0.1, 0.01), soloDatum=true\n\n#ifdef RN_IS_MORPHING\nuniform int u_morphTargetNumber; // initialValue=0, isCustomSetting=true, soloDatum=true, needUniformInDataTextureMode=true\n// uniform int u_dataTextureMorphOffsetPosition[];\n// uniform int u_morphWeights[]; //\n#endif\n\n// BiasMatrix * LightProjectionMatrix * LightViewMatrix, See: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/#basic-shader\nuniform mat4 u_depthBiasPV; // initialValue=(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n v_color = a_color;\n\n bool isSkinning = false;\n\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n v_texcoord_0 = a_texcoord_0;\n v_texcoord_1 = a_texcoord_1;\n v_texcoord_2 = a_texcoord_2;\n\n #ifdef RN_USE_TANGENT_ATTRIBUTE\n v_tangent_inWorld = normalMatrix * a_tangent.xyz;\n v_binormal_inWorld = cross(v_tangent_inWorld, v_normal_inWorld) * a_tangent.w;\n #endif\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n\n v_instanceInfo = a_instanceInfo.x;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n#ifdef RN_USE_SHADOW_MAPPING\n v_shadowCoord = get_depthBiasPV(materialSID, 0) * v_position_inWorld;\n#endif\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},C={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec2 v_texcoord_1;\nin vec2 v_texcoord_2;\nin vec3 v_baryCentricCoord;\nin float v_instanceInfo;\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n in vec3 v_tangent_inWorld;\n in vec3 v_binormal_inWorld;\n#endif\n\n#ifdef RN_USE_SHADOW_MAPPING\nin vec4 v_shadowCoord;\n#endif\n\nuniform vec4 u_baseColorFactor; // initialValue=(1,1,1,1)\nuniform sampler2D u_baseColorTexture; // initialValue=(0,white)\nuniform vec2 u_metallicRoughnessFactor; // initialValue=(1,1)\nuniform sampler2D u_metallicRoughnessTexture; // initialValue=(1,white)\nuniform sampler2D u_occlusionTexture; // initialValue=(3,white)\nuniform vec3 u_emissiveFactor; // initialValue=(0,0,0)\nuniform sampler2D u_emissiveTexture; // initialValue=(4,white)\nuniform vec3 u_wireframe; // initialValue=(0,0,1)\nuniform bool u_isOutputHDR; // initialValue=0\nuniform bool u_makeOutputSrgb; // initialValue=1\nuniform vec4 u_iblParameter; // initialValue=(1,1,1,1), isCustomSetting=true\nuniform ivec2 u_hdriFormat; // initialValue=(0,0), isCustomSetting=true\nuniform samplerCube u_diffuseEnvTexture; // initialValue=(5,white), isCustomSetting=true\nuniform samplerCube u_specularEnvTexture; // initialValue=(6,white), isCustomSetting=true\nuniform vec4 u_baseColorTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_baseColorTextureRotation; // initialValue=0\nuniform vec4 u_metallicRoughnessTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_metallicRoughnessTextureRotation; // initialValue=0\nuniform int u_baseColorTexcoordIndex; // initialValue=0\nuniform int u_metallicRoughnessTexcoordIndex; // initialValue=0\nuniform int u_occlusionTexcoordIndex; // initialValue=0\nuniform vec4 u_occlusionTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_occlusionTextureRotation; // initialValue=0\nuniform int u_emissiveTexcoordIndex; // initialValue=0\nuniform vec4 u_emissiveTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_emissiveTextureRotation; // initialValue=0\nuniform float u_occlusionStrength; // initialValue=1\nuniform bool u_inverseEnvironment; // initialValue=true\nuniform float u_ior; // initialValue=1.5\n\n#ifdef RN_USE_NORMAL_TEXTURE\n uniform sampler2D u_normalTexture; // initialValue=(2,black)\n uniform vec4 u_normalTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_normalTextureRotation; // initialValue=(0)\n uniform int u_normalTexcoordIndex; // initialValue=(0)\n uniform float u_normalScale; // initialValue=(1)\n#endif\n\n#ifdef RN_USE_CLEARCOAT\n uniform float u_clearCoatFactor; // initialValue=0\n uniform float u_clearCoatRoughnessFactor; // initialValue=0\n uniform vec4 u_clearCoatTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_clearCoatTextureRotation; // initialValue=0\n uniform vec4 u_clearCoatRoughnessTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_clearCoatRoughnessTextureRotation; // initialValue=0\n uniform vec4 u_clearCoatNormalTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_clearCoatNormalTextureRotation; // initialValue=0\n uniform int u_clearCoatTexcoordIndex; // initialValue=(0)\n uniform int u_clearCoatRoughnessTexcoordIndex; // initialValue=(0)\n uniform int u_clearCoatNormalTexcoordIndex; // initialValue=(0)\n#endif\n\n#ifdef RN_USE_TRANSMISSION\n uniform float u_transmissionFactor; // initialValue=(0)\n#endif\n\n#ifdef RN_USE_VOLUME\n uniform float u_thicknessFactor; // initialValue=(0)\n uniform float u_attenuationDistance; // initialValue=(0.000001)\n uniform vec3 u_attenuationColor; // initialValue=(1,1,1)\n#endif\n\n#ifdef RN_USE_SHEEN\n uniform vec3 u_sheenColorFactor; // initialValue=(0,0,0)\n uniform float u_sheenRoughnessFactor; // initialValue=(0)\n#endif\n\n#ifdef RN_USE_SPECULAR\n uniform float u_specularFactor; // initialValue=1.0\n uniform vec3 u_specularColorFactor; // initialValue=(1,1,1)\n#endif\n\n#ifdef RN_USE_IRIDESCENCE\n uniform float u_iridescenceFactor; // initialValue=0\n uniform float u_iridescenceIor; // initialValue=1.3\n uniform float u_iridescenceThicknessMinimum; // initialValue=100\n uniform float u_iridescenceThicknessMaximum; // initialValue=400\n#endif\n\nuniform float u_alphaCutoff; // initialValue=(0.01)\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float M_PI = 3.141592653589793;\nconst float RECIPROCAL_PI = 0.3183098861837907;\nconst float c_MinRoughness = 0.04;\n\nfloat angular_n_h(float NH) {\n return acos(NH);\n}\n\nfloat d_phong(float NH, float c1) {\n return pow(\n cos(acos(NH))\n , c1\n );\n}\n\n// this is from https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 envBRDFApprox( float Roughness, float NoV ) {\n const vec4 c0 = vec4(-1, -0.0275, -0.572, 0.022 );\n const vec4 c1 = vec4(1, 0.0425, 1.04, -0.04 );\n vec4 r = Roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( -9.28 * NoV ) ) * r.x + r.y;\n vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n return AB;\n}\n\n// GGX NDF\nfloat d_ggx(float NH, float alphaRoughness) {\n float roughnessSqr = alphaRoughness * alphaRoughness;\n float f = (roughnessSqr - 1.0) * NH * NH + 1.0;\n return roughnessSqr / (M_PI * f * f);\n}\n\nfloat d_torrance_reiz(float NH, float c3) {\n float CosSquared = NH*NH;\n float TanSquared = (1.0 - CosSquared)/CosSquared;\n //return (1.0/M_PI) * sq(c3/(CosSquared * (c3*c3 + TanSquared))); // gamma = 2, aka GGX\n return (1.0/sqrt(M_PI)) * (sq(c3)/(CosSquared * (c3*c3 + TanSquared))); // gamma = 1, D_Berry\n}\n\nfloat d_beckmann(float NH, float m) {\n float co = 1.0 / (4.0 * m * m * NH * NH * NH * NH);\n float expx = exp((NH * NH - 1.0) / (m * m * NH * NH));\n return co * expx;\n}\n\n// the same as glTF WebGL sample\n// https://github.com/KhronosGroup/glTF-WebGL-PBR/blob/88eda8c5358efe03128b72b6c5f5f6e5b6d023e1/shaders/pbr-frag.glsl#L188\n// That is, Unreal Engine based approach, but modified to use alphaRoughness (squared artist's roughness parameter),\n// and based on 'Separable Masking and Shadowing' approximation (propesed by Christophe Schlick)\n// https://www.cs.virginia.edu/~jdl/bib/appearance/analytic%20models/schlick94b.pdf\nfloat g_shielding(float NL, float NV, float alphaRoughness) {\n float r = alphaRoughness;\n\n // Local Shadowing using \"Schlick-Smith\" Masking Function\n float localShadowing = 2.0 * NL / (NL + sqrt(r * r + (1.0 - r * r) * (NL * NL)));\n\n // Local Masking using \"Schlick-Smith\" Masking Function\n float localMasking = 2.0 * NV / (NV + sqrt(r * r + (1.0 - r * r) * (NV * NV)));\n\n return localShadowing * localMasking;\n}\n\n// The code from https://google.github.io/filament/Filament.html#listing_approximatedspecularv\n// The idea is from [Heitz14] Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs.\nfloat v_SmithGGXCorrelated(float NL, float NV, float alphaRoughness) {\n float a2 = alphaRoughness * alphaRoughness;\n float GGXV = NL * sqrt(NV * NV * (1.0 - a2) + a2);\n float GGXL = NV * sqrt(NL * NL * (1.0 - a2) + a2);\n return 0.5 / (GGXV + GGXL);\n}\n\nfloat v_SmithGGXCorrelatedFast(float NL, float NV, float alphaRoughness) {\n float a = alphaRoughness;\n float GGXV = NL * (NV * (1.0 - a) + a);\n float GGXL = NV * (NL * (1.0 - a) + a);\n return 0.5 / (GGXV + GGXL);\n}\n\n// The Schlick Approximation to Fresnel\nfloat fresnel(float f0, float f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = x * x2 * x2;\n return f0 + (f90 - f0) * x5;\n}\n\nvec3 fresnel(vec3 f0, vec3 f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = x * x2 * x2;\n return f0 + (f90 - f0) * x5;\n}\n\nvec3 fresnel(vec3 f0, float f90, float VdotH)\n{\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = x * x2 * x2;\n return f0 + (f90 - f0) * x5;\n}\n\nfloat fresnel(float f0, float VdotH)\n{\n float f90 = 1.0; //clamp(50.0 * f0, 0.0, 1.0);\n return fresnel(f0, f90, VdotH);\n}\nvec3 fresnel(vec3 f0, float VdotH)\n{\n float f90 = 1.0; //clamp(50.0 * f0, 0.0, 1.0);\n return fresnel(f0, f90, VdotH);\n}\n\nvec3 cook_torrance_specular_brdf(float NH, float NL, float NV, vec3 F, float alphaRoughness) {\n float D = d_ggx(NH, alphaRoughness);\n float V = v_SmithGGXCorrelated(NL, NV, alphaRoughness);\n return vec3(D)*vec3(V)*F;\n// float G = g_shielding(NL, NV, alphaRoughness);\n// return vec3(D)*vec3(G)*F/vec3(4.0*NL*NV);\n\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#diffuse-brdf\nvec3 diffuse_brdf(vec3 albedo)\n{\n // (1/pi) * diffuseAlbedo\n return RECIPROCAL_PI * albedo;\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#specular-brdf\nfloat specular_brdf(float alphaRoughness, float NdotL, float NdotV, float NdotH) {\n float V = v_SmithGGXCorrelated(NdotL, NdotV, alphaRoughness);\n float D = d_ggx(NdotH, alphaRoughness);\n return V * D;\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_transmission#implementation-notes\nfloat specular_btdf(float alphaRoughness, float NdotL, float NdotV, float NdotHt) {\n float V = v_SmithGGXCorrelated(NdotL, NdotV, alphaRoughness);\n float D = d_ggx(NdotHt, alphaRoughness);\n return V * D;\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#fresnel\nvec3 conductor_fresnel(vec3 f0, float brdf, float alphaRoughness, float VdotH) {\n return vec3(brdf) * (f0.rgb + (vec3(1.0) - f0.rgb) * vec3(pow(1.0 - abs(VdotH), 5.0)));\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#fresnel\nvec3 fresnel_mix(float ior, vec3 base, vec3 layer, float VdotH) {\n float f0 = pow((1.0 - ior)/(1.0 + ior), 2.0);\n float fr = f0 + (1.0 - f0) * pow(1.0 - abs(VdotH), 5.0);\n return mix(base, layer, fr);\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#metal-brdf-and-dielectric-brdf\nvec3 metal_brdf(float perceptualRoughness, vec3 baseColor, float NdotL, float NdotV, float NdotH, float VdotH) {\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n return conductor_fresnel(\n baseColor,\n specular_brdf(alphaRoughness, NdotL, NdotV, NdotH),\n alphaRoughness,\n VdotH\n );\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#metal-brdf-and-dielectric-brdf\nvec3 dielectric_brdf(float ior, vec3 baseColor, float perceptualRoughness, float NdotL, float NdotV, float NdotH, float VdotH) {\n vec3 base = diffuse_brdf(baseColor);\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n vec3 layer = vec3(specular_brdf(alphaRoughness, NdotL, NdotV, NdotH));\n return fresnel_mix(ior, base, layer, VdotH);\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat#layering\nvec3 coated_material_s(vec3 base, float perceptualRoughness, float clearcoatRoughness, float clearcoat, float VdotNc, float LdotNc, float NdotHc) {\n float clearcoatFresnel = 0.04 + (1.0 - 0.04) * pow(1.0 - abs(VdotNc), 5.0);\n float clearcoatAlpha = clearcoatRoughness * clearcoatRoughness;\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n float D = d_ggx(NdotHc, clearcoatAlpha);\n float V = v_SmithGGXCorrelated(LdotNc, VdotNc, clearcoatAlpha);\n float f_clearcoat = clearcoatFresnel * D * V;\n\n // base = (f_diffuse + f_specular) in https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat#layering\n return base * vec3(1.0 - clearcoat * clearcoatFresnel) + vec3(f_clearcoat * clearcoat);\n}\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\nfloat srgbToLinear(float value) {\n return pow(value, 2.2);\n}\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nfloat linearToSrgb(float value) {\n return pow(value, 1.0/2.2);\n}\n\n// Roughness Dependent Fresnel\n// https://www.jcgt.org/published/0008/01/03/paper.pdf\nvec3 fresnelSchlickRoughness(vec3 F0, float cosTheta, float roughness)\n{\n vec3 Fr = max(vec3(1.0 - roughness), F0) - F0;\n vec3 k_S = F0 + Fr * pow(1.0 - cosTheta, 5.0);\n return k_S;\n}\n\nvec3 fresnelSchlickRoughnessWithIridescence(\n vec3 F0, float cosTheta, float roughness,\n vec3 iridescenceFresnel, float iridescence\n )\n{\n vec3 Fr = max(vec3(1.0 - roughness), F0) - F0;\n vec3 k_S = mix(F0 + Fr * pow(1.0 - cosTheta, 5.0), iridescenceFresnel, iridescence);\n return k_S;\n}\n\n// From: https://github.com/KhronosGroup/glTF-Sample-Viewer/blob/e2c7b8c8bd12916c1a387cd41f9ef061edc718df/source/Renderer/shaders/brdf.glsl#L44-L66\nvec3 Schlick_to_F0(vec3 f, vec3 f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = clamp(x * x2 * x2, 0.0, 0.9999);\n\n return (f - f90 * x5) / (1.0 - x5);\n}\n\nfloat Schlick_to_F0(float f, float f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = clamp(x * x2 * x2, 0.0, 0.9999);\n\n return (f - f90 * x5) / (1.0 - x5);\n}\n\nvec3 Schlick_to_F0(vec3 f, float VdotH) {\n return Schlick_to_F0(f, vec3(1.0), VdotH);\n}\n\nfloat Schlick_to_F0(float f, float VdotH) {\n return Schlick_to_F0(f, 1.0, VdotH);\n}\n\nvec3 normalBlendingUDN(sampler2D baseMap, sampler2D detailMap, vec2 baseUv, vec2 detailUv) {\n vec3 t = texture(baseMap, baseUv).xyz * 2.0 - 1.0;\n vec3 u = texture(detailMap, detailUv).xyz * 2.0 - 1.0;\n vec3 r = normalize(vec3(t.xy + u.xy, t.z));\n return r;\n}\n\nvec2 uvTransform(vec2 scale, vec2 offset, float rotation, vec2 uv) {\n mat3 translationMat = mat3(1,0,0, 0,1,0, offset.x, offset.y, 1);\n mat3 rotationMat = mat3(\n cos(rotation), -sin(rotation), 0,\n sin(rotation), cos(rotation), 0,\n 0, 0, 1\n );\n mat3 scaleMat = mat3(scale.x,0,0, 0,scale.y,0, 0,0,1);\n\n mat3 matrix = translationMat * rotationMat * scaleMat;\n vec2 uvTransformed = ( matrix * vec3(uv.xy, 1) ).xy;\n\n return uvTransformed;\n}\n\n// https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_volume/README.md#attenuation\nvec3 volumeAttenuation(vec3 attenuationColor, float attenuationDistance, vec3 intensity, float transmissionDistance)\n{\n if (attenuationDistance == 0.0) { // means Infinite distance\n return intensity; // No attenuation\n } else {\n vec3 attenuationCo = -log(attenuationColor) / attenuationDistance;\n vec3 attenuatedTransmittance = exp(-attenuationCo * transmissionDistance);\n return intensity * attenuatedTransmittance;\n }\n}\n\n#ifdef RN_USE_SHEEN\nfloat d_Charlie(float sheenPerceptualRoughness, float NoH) {\n // Estevez and Kulla 2017, \"Production Friendly Microfacet Sheen BRDF\"\n float alphaG = sheenPerceptualRoughness * sheenPerceptualRoughness;\n float invAlpha = 1.0 / alphaG;\n float cos2h = NoH * NoH;\n float sin2h = 1.0 - cos2h;\n return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen#sheen-visibility\nfloat sheenSimpleVisibility(float NdotL, float NdotV) {\n return 1.0 / (4.0 * (NdotL + NdotV - NdotL * NdotV));\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen#sheen-visibility\nfloat charlieL(float x, float alphaG) {\n float oneMinusAlphaSq = (1.0 - alphaG) * (1.0 - alphaG);\n float a = mix(21.5473, 25.3245, oneMinusAlphaSq);\n float b = mix(3.82987, 3.32435, oneMinusAlphaSq);\n float c = mix(0.19823, 0.16801, oneMinusAlphaSq);\n float d = mix(-1.97760, -1.27393, oneMinusAlphaSq);\n float e = mix(-4.32054, -4.85967, oneMinusAlphaSq);\n return a / (1.0 + b * pow(x, c)) + d * x + e;\n}\n\nfloat lambdaSheen(float cosTheta, float alphaG)\n{\n return abs(cosTheta) < 0.5 ? exp(charlieL(cosTheta, alphaG)) : exp(2.0 * charlieL(0.5, alphaG) - charlieL(1.0 - cosTheta, alphaG));\n}\n\nfloat sheenCharlieVisibility(float NdotL, float NdotV, float sheenPerceptualRoughness) {\n float alphaG = sheenPerceptualRoughness * sheenPerceptualRoughness;\n float sheenVisibility = 1.0 / ((1.0 + lambdaSheen(NdotV, alphaG) + lambdaSheen(NdotL, alphaG)) * (4.0 * NdotV * NdotL));\n return sheenVisibility;\n}\n\nvec3 sheen_brdf(vec3 sheenColor, float sheenPerceptualRoughness, float NdotL, float NdotV, float NdotH) {\n float sheenDistribution = d_Charlie(sheenPerceptualRoughness, NdotH);\n float sheenVisibility = sheenCharlieVisibility(NdotL, NdotV, sheenPerceptualRoughness);\n return sheenColor * sheenDistribution * sheenVisibility;\n}\n\n#endif\n#ifdef RN_USE_IRIDESCENCE\n\n// XYZ to REC709(sRGB) conversion matrix\nconst mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n);\n\n// Assume air interface for top\nvec3 Fresnel0ToIor(vec3 F0) {\n vec3 sqrtF0 = sqrt(F0);\n return (vec3(1.0) + sqrtF0) / (vec3(1.0) - sqrtF0);\n}\n\n// Conversion from IOR to F0\n// ior is a value between 1.0 and 3.0. 1.0 is air interface\nvec3 IorToFresnel0(vec3 transmittedIor, float incidentIor) {\n return sq((transmittedIor - vec3(incidentIor)) / (transmittedIor + vec3(incidentIor)));\n}\nfloat IorToFresnel0(float transmittedIor, float incidentIor) {\n return sq((transmittedIor - incidentIor) / (transmittedIor + incidentIor));\n}\n\n/**\n * From: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_iridescence#analytic-spectral-integration\n */\nvec3 evalSensitivity(float OPD, vec3 shift) {\n float phase = 2.0 * M_PI * OPD * 1.0e-9;\n vec3 val = vec3(5.4856e-13, 4.4201e-13, 5.2481e-13);\n vec3 pos = vec3(1.6810e+06, 1.7953e+06, 2.2084e+06);\n vec3 var = vec3(4.3278e+09, 9.3046e+09, 6.6121e+09);\n\n vec3 xyz = val * sqrt(2.0 * M_PI * var) * cos(pos * phase + shift) * exp(-(phase * phase) * var);\n xyz.x += 9.7470e-14 * sqrt(2.0 * M_PI * 4.5282e+09) * cos(2.2399e+06 * phase + shift[0]) * exp(-4.5282e+09 * (phase * phase));\n xyz /= 1.0685e-7;\n\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n}\n\n\n/**\n * From: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_iridescence#iridescence-fresnel\n */\nvec3 calcIridescence(float outsideIor, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0) {\n\n\n // iridescenceIor is the index of refraction of the thin-film layer\n // Force iridescenceIor -> outsideIOR when thinFilmThickness -> 0.0\n float iridescenceIor = mix(outsideIor, eta2, smoothstep(0.0, 0.03, thinFilmThickness));\n\n // To calculate the reflectances R12 and R23 at the viewing angles (angle hitting the thin-film layer)\n // and (angle after refraction in the thin-film) Schlick Fresnel is again used.\n // This approximation allows to eliminate the split into S and P polarization for the exact Fresnel equations.\n // can be calculated using Snell's law (with being outsideIor and being iridescenceIor):\n float sinTheta2Sq = sq(outsideIor / iridescenceIor) * (1.0 - sq(cosTheta1));\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n\n // Handle total internal reflection\n if (cosTheta2Sq < 0.0) {\n return vec3(1.0);\n }\n\n float cosTheta2 = sqrt(cosTheta2Sq);\n\n /// Material Interfaces\n // The iridescence model defined by Belcour/Barla models two material interfaces\n // - one from the outside to the thin-film layer\n // and another one from the thin-film to the base material. These two interfaces are defined as follows:\n\n // First interface (from the outside to the thin-film layer)\n float R0 = IorToFresnel0(iridescenceIor, outsideIor);\n float R12 = fresnel(R0, cosTheta1);\n float R21 = R12;\n float T121 = 1.0 - R12;\n\n // Second interface (from the thin-film to the base material)\n vec3 baseIor = Fresnel0ToIor(baseF0 + 0.0001); // guard against 1.0\n vec3 R1 = IorToFresnel0(baseIor, iridescenceIor);\n vec3 R23 = fresnel(R1, cosTheta2);\n\n // phi12 and phi23 define the base phases per interface and are approximated with 0.0\n // if the IOR of the hit material (iridescenceIor or baseIor) is higher\n // than the IOR of the previous material (outsideIor or iridescenceIor) and π otherwise.\n // Also here, polarization is ignored. float phi12 = 0.0;\n\n // First interface (from the outside to the thin-film layer)\n float phi12 = 0.0;\n if (iridescenceIor < outsideIor) phi12 = M_PI;\n float phi21 = M_PI - phi12;\n\n // Second interface (from the thin-film to the base material)\n vec3 phi23 = vec3(0.0);\n if (baseIor[0] < iridescenceIor) phi23[0] = M_PI;\n if (baseIor[1] < iridescenceIor) phi23[1] = M_PI;\n if (baseIor[2] < iridescenceIor) phi23[2] = M_PI;\n\n // OPD (optical path difference)\n float OPD = 2.0 * iridescenceIor * thinFilmThickness * cosTheta2;\n // Phase shift\n vec3 phi = vec3(phi21) + phi23;\n\n // Compound terms\n vec3 R123 = clamp(R12 * R23, 1e-5, 0.9999);\n vec3 r123 = sqrt(R123);\n vec3 Rs = (T121 * T121) * R23 / (vec3(1.0) - R123);\n\n // Reflectance term for m = 0 (DC term amplitude)\n vec3 C0 = R12 + Rs;\n vec3 I = C0;\n\n // Reflectance term for m > 0 (pairs of diracs)\n vec3 Cm = Rs - T121;\n for (int m = 1; m <= 2; ++m)\n {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity(float(m) * OPD, float(m) * phi);\n I += Cm * Sm;\n }\n\n vec3 F_iridescence = max(I, vec3(0.0));\n\n return F_iridescence;\n}\n\n#endif\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\n#ifdef RN_USE_SHADOW_MAPPING\n\nconst float g_minVariance = 0.0;\n\nfloat chebyshevUpperBound(vec2 moments, float t) {\n float p = (t <= moments.x) ? 1.0 : 0.0;\n\n float variance = moments.y - sq(moments.x);\n variance = max(variance, g_minVariance);\n\n float d = t - moments.x;\n float p_max = variance / (variance + sq(d));\n\n return max(p, p_max);\n}\n\nfloat varianceShadowContribution(vec2 lightTexCoord, float distanceToLight) {\n vec2 moments = texture(u_depthTexture, lightTexCoord).xy;\n\n return chebyshevUpperBound(moments, distanceToLight);\n}\n\n#endif\n\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nvec3 get_irradiance(vec3 normal_forEnv, float materialSID, ivec2 hdriFormat) {\n vec4 diffuseTexel = texture(u_diffuseEnvTexture, normal_forEnv);\n\n vec3 irradiance;\n if (hdriFormat.x == 0) {\n // LDR_SRGB\n irradiance = srgbToLinear(diffuseTexel.rgb);\n }\n else if (hdriFormat.x == 3) {\n // RGBE\n irradiance = diffuseTexel.rgb * pow(2.0, diffuseTexel.a*255.0-128.0);\n }\n else {\n irradiance = diffuseTexel.rgb;\n }\n\n return irradiance;\n}\n\nfloat scaleForLod(float perceptualRoughness, float ior)\n{\n // Scale roughness to the range [0, 1],\n // ior=1.0 will be scale 0,\n // ior=1.5 will be scale 1.0,\n // ior=2 will be scale 1.0 (clamped)\n //\n\n float scale = clamp(ior * 2.0 - 2.0, 0.0, 1.0);\n return perceptualRoughness * scale;\n}\n\n#ifdef RN_USE_TRANSMISSION\nvec3 get_sample_from_backbuffer(float materialSID, vec2 sampleCoord, float perceptualRoughness, float ior) {\n ivec2 vrState = get_vrState(0.0, 0);\n vec2 backBufferTextureSize = get_backBufferTextureSize(materialSID, 0);\n float backBufferTextureLength = max(backBufferTextureSize.x, backBufferTextureSize.y);\n if (vrState.x == 1) { // For VR\n backBufferTextureLength = max(backBufferTextureSize.x / 2.0, backBufferTextureSize.y);\n sampleCoord.x = sampleCoord.x * 0.5;\n if (vrState.y == 1) { // For right eye\n sampleCoord.x += 0.5;\n }\n }\n float framebufferLod = log2(backBufferTextureLength) * scaleForLod(perceptualRoughness, ior);\n\n #ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n vec3 transmittedLight = texture2DLodEXT(u_backBufferTexture, sampleCoord, framebufferLod).rgb;\n #elif defined(GLSL_ES3)\n vec3 transmittedLight = textureLod(u_backBufferTexture, sampleCoord, framebufferLod).rgb;\n #else\n vec3 transmittedLight = texture(u_backBufferTexture, sampleCoord).rgb;\n #endif\n\n return transmittedLight;\n}\n#endif\n\nvec3 get_radiance(vec3 reflection, float lod, ivec2 hdriFormat) {\n #ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n vec4 specularTexel = textureCubeLodEXT(u_specularEnvTexture, reflection, lod);\n #elif defined(GLSL_ES3)\n vec4 specularTexel = textureLod(u_specularEnvTexture, reflection, lod);\n #else\n vec4 specularTexel = texture(u_specularEnvTexture, reflection);\n #endif\n\n// #pragma shaderity: require(./../common/fetchCubeTexture.glsl)\n\n vec3 radiance;\n if (hdriFormat.y == 0) {\n // LDR_SRGB\n radiance = srgbToLinear(specularTexel.rgb);\n }\n else if (hdriFormat.y == 3) {\n // RGBE\n radiance = specularTexel.rgb * pow(2.0, specularTexel.a*255.0-128.0);\n }\n else {\n radiance = specularTexel.rgb;\n }\n\n return radiance;\n}\n\n// from glTF Sample Viewer: https://github.com/KhronosGroup/glTF-Sample-Viewer\nvec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior)\n{\n vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior);\n mat4 worldMatrix = get_worldMatrix(v_instanceInfo);\n\n vec3 modelScale;\n modelScale.x = length(vec3(worldMatrix[0].xyz));\n modelScale.y = length(vec3(worldMatrix[1].xyz));\n modelScale.z = length(vec3(worldMatrix[2].xyz));\n\n return normalize(refractionVector) * thickness * modelScale;\n}\n\nstruct IblResult\n{\n vec3 specular;\n vec3 diffuse;\n vec3 FssEss;\n};\n\nIblResult getIBLRadianceGGX(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection)\n{\n // get radiance\n float mipCount = iblParameter.x;\n float lod = (perceptualRoughness * (mipCount - 1.0));\n vec3 radiance = get_radiance(reflection, lod, hdriFormat);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughness(F0, NdotV, perceptualRoughness);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Specular IBL\n vec3 specular = FssEss * radiance;\n\n // scale with user parameters\n float IBLSpecularContribution = iblParameter.z;\n specular *= IBLSpecularContribution;\n\n result.specular = specular;\n\n return result;\n}\n\nIblResult getIBLRadianceGGXWithIridescence(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection, vec3 iridescenceFresnel, float iridescence)\n{\n // get radiance\n float mipCount = iblParameter.x;\n float lod = (perceptualRoughness * (mipCount - 1.0));\n vec3 radiance = get_radiance(reflection, lod, hdriFormat);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughnessWithIridescence(F0, NdotV, perceptualRoughness, iridescenceFresnel, iridescence);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Specular IBL\n vec3 specular = FssEss * radiance;\n\n // scale with user parameters\n float IBLSpecularContribution = iblParameter.z;\n specular *= IBLSpecularContribution;\n\n result.specular = specular;\n\n return result;\n}\n\nIblResult getIBLRadianceLambertian(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection)\n{\n // get irradiance\n vec3 irradiance = get_irradiance(normal_forEnv, materialSID, hdriFormat);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughness(F0, NdotV, perceptualRoughness);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Multiple scattering, Fdez-Aguera's approach\n float Ems = (1.0 - (f_ab.x + f_ab.y));\n vec3 F_avg = F0 + (1.0 - F0) / 21.0;\n vec3 FmsEms = Ems * FssEss * F_avg / (1.0 - F_avg * Ems);\n vec3 k_D = albedo * (1.0 - FssEss - FmsEms);\n\n // Diffuse IBL\n vec3 diffuse = (FmsEms + k_D) * irradiance;\n\n // scale with user parameters\n float IBLDiffuseContribution = iblParameter.y;\n diffuse *= IBLDiffuseContribution;\n\n result.diffuse = diffuse;\n\n return result;\n}\n\nIblResult getIBLRadianceLambertianWithIridescence(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection, vec3 iridescenceF0, float iridescence)\n{\n // get irradiance\n vec3 irradiance = get_irradiance(normal_forEnv, materialSID, hdriFormat);\n\n // Use the maximum component of the iridescence Fresnel color\n // Maximum is used instead of the RGB value to not get inverse colors for the diffuse BRDF\n vec3 iridescenceF0Max = vec3(max(max(iridescenceF0.r, iridescenceF0.g), iridescenceF0.b));\n\n // Blend between base F0 and iridescence F0\n vec3 mixedF0 = mix(F0, iridescenceF0Max, iridescence);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughness(mixedF0, NdotV, perceptualRoughness);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Multiple scattering, Fdez-Aguera's approach\n float Ems = (1.0 - (f_ab.x + f_ab.y));\n vec3 F_avg = mixedF0 + (1.0 - mixedF0) / 21.0;\n vec3 FmsEms = Ems * FssEss * F_avg / (1.0 - F_avg * Ems);\n vec3 k_D = albedo * (1.0 - FssEss - FmsEms);\n\n // Diffuse IBL\n vec3 diffuse = (FmsEms + k_D) * irradiance;\n\n // scale with user parameters\n float IBLDiffuseContribution = iblParameter.y;\n diffuse *= IBLDiffuseContribution;\n\n result.diffuse = diffuse;\n\n return result;\n}\n\n#ifdef RN_USE_SHEEN\nvec3 sheenIBL(float NdotV, float sheenPerceptualRoughness, vec3 sheenColor, vec4 iblParameter, vec3 reflection, ivec2 hdriFormat)\n{\n float mipCount = iblParameter.x;\n float lod = (sheenPerceptualRoughness * (mipCount - 1.0));\n\n vec2 sheenLutUV = vec2(NdotV, sheenPerceptualRoughness);\n float brdf = texture(u_sheenLutTexture, sheenLutUV).b;\n vec3 sheenLight = get_radiance(reflection, lod, hdriFormat);\n float IBLSpecularContribution = iblParameter.z;\n sheenLight *= IBLSpecularContribution;\n\n return sheenLight * sheenColor * brdf;\n}\n#endif\n\nvec3 getNormalForEnv(mat3 rotEnvMatrix, vec3 normal_inWorld, float materialSID) {\n vec3 normal_forEnv = rotEnvMatrix * normal_inWorld;\n if (get_inverseEnvironment(materialSID, 0)) {\n normal_forEnv.x *= -1.0;\n }\n return normal_forEnv;\n}\n\nvec3 getReflection(mat3 rotEnvMatrix, vec3 viewDirection, vec3 normal_inWorld, float materialSID) {\n vec3 reflection = rotEnvMatrix * reflect(-viewDirection, normal_inWorld);\n if (get_inverseEnvironment(materialSID, 0)) {\n reflection.x *= -1.0;\n }\n return reflection;\n}\n\nvec3 IBLContribution(float materialSID, vec3 normal_inWorld, float NdotV, vec3 viewDirection,\n vec3 albedo, vec3 F0, float perceptualRoughness, float clearcoatRoughness, vec3 clearcoatNormal_inWorld,\n float clearcoat, float VdotNc, vec3 geomNormal_inWorld, float cameraSID, float transmission, vec3 v_position_inWorld,\n float thickness, vec3 sheenColor, float sheenRoughness, float albedoSheenScalingNdotV, float ior,\n vec3 iridescenceFresnel, vec3 iridescenceF0, float iridescence)\n{\n vec4 iblParameter = get_iblParameter(materialSID, 0);\n float rot = iblParameter.w + 3.1415;\n mat3 rotEnvMatrix = mat3(cos(rot), 0.0, -sin(rot), 0.0, 1.0, 0.0, sin(rot), 0.0, cos(rot));\n ivec2 hdriFormat = get_hdriFormat(materialSID, 0);\n\n vec3 normal_forEnv = getNormalForEnv(rotEnvMatrix, normal_inWorld, materialSID);\n vec3 reflection = getReflection(rotEnvMatrix, viewDirection, normal_inWorld, materialSID);\n\n // IBL\n #ifdef RN_USE_IRIDESCENCE\n IblResult baseRadianceResult = getIBLRadianceGGXWithIridescence(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection, iridescenceFresnel, iridescence);\n IblResult baseLambertianResult = getIBLRadianceLambertianWithIridescence(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection, iridescenceF0, iridescence);\n #else\n IblResult baseRadianceResult = getIBLRadianceGGX(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection);\n IblResult baseLambertianResult = getIBLRadianceLambertian(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection);\n #endif\n\n#ifdef RN_USE_TRANSMISSION\n vec3 refractedRay = getVolumeTransmissionRay(geomNormal_inWorld, viewDirection, thickness, ior);\n vec3 refractedRayFromVPosition = v_position_inWorld + refractedRay;\n vec4 ndcPoint = get_projectionMatrix(cameraSID, 0) * get_viewMatrix(cameraSID, 0) * vec4(refractedRayFromVPosition, 1.0);\n vec2 refractionCoords = ndcPoint.xy / ndcPoint.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec3 transmittedLight = get_sample_from_backbuffer(materialSID, refractionCoords, perceptualRoughness, ior);\n\n#ifdef RN_USE_VOLUME\n vec3 attenuationColor = get_attenuationColor(materialSID, 0);\n float attenuationDistance = get_attenuationDistance(materialSID, 0);\n transmittedLight = volumeAttenuation(attenuationColor, attenuationDistance, transmittedLight, length(refractedRay));\n#endif\n\n vec3 transmissionComp = (vec3(1.0) - baseRadianceResult.FssEss) * transmittedLight * albedo;\n vec3 diffuse = mix(baseLambertianResult.diffuse, transmissionComp, transmission);\n vec3 base = diffuse + baseRadianceResult.specular;\n#else\n vec3 base = baseLambertianResult.diffuse + baseRadianceResult.specular;\n#endif\n\n#ifdef RN_USE_SHEEN\n vec3 sheen = sheenIBL(NdotV, sheenRoughness, sheenColor, iblParameter, reflection, hdriFormat);\n vec3 color = sheen + base * albedoSheenScalingNdotV;\n#else\n vec3 color = base;\n#endif\n\n#ifdef RN_USE_CLEARCOAT\n float VdotNg = dot(geomNormal_inWorld, viewDirection);\n vec3 clearcoatNormal_forEnv = getNormalForEnv(rotEnvMatrix, normal_inWorld, materialSID);\n vec3 clearcoatReflection = getReflection(rotEnvMatrix, viewDirection, normal_inWorld, materialSID);\n IblResult coatResult = getIBLRadianceGGX(materialSID, VdotNc, viewDirection, vec3(0.0), F0,\n clearcoatRoughness, iblParameter, hdriFormat, rotEnvMatrix, clearcoatNormal_forEnv, clearcoatReflection);\n vec3 coatLayer = coatResult.specular;\n\n float clearcoatFresnel = 0.04 + (1.0 - 0.04) * pow(1.0 - abs(VdotNc), 5.0);\n vec3 coated = color * vec3(1.0 - clearcoat * clearcoatFresnel) + vec3(coatLayer * clearcoat);\n return coated;\n#else\n return color;\n#endif\n\n}\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvec2 getTexcoord(int texcoordIndex) {\n vec2 texcoord;\n if(texcoordIndex == 2){\n texcoord = v_texcoord_2;\n } else if(texcoordIndex == 1){\n texcoord = v_texcoord_1;\n }else{\n texcoord = v_texcoord_0;\n }\n return texcoord;\n}\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n vec3 perturb_normal(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord, vec3 normalTex) {\n vec3 tangent_inWorld = normalize(v_tangent_inWorld);\n vec3 binormal_inWorld = normalize(v_binormal_inWorld);\n mat3 tbnMat_tangent_to_world = mat3(tangent_inWorld, binormal_inWorld, normal_inWorld);\n\n return normalize(tbnMat_tangent_to_world * normalTex);\n }\n#else\n #ifdef RN_IS_SUPPORTING_STANDARD_DERIVATIVES\n // This is based on http://www.thetenthplanet.de/archives/1180\n mat3 cotangent_frame(vec3 normal_inWorld, vec3 position, vec2 uv) {\n uv = gl_FrontFacing ? uv : -uv;\n\n // get edge vectors of the pixel triangle\n vec3 dp1 = dFdx(position);\n vec3 dp2 = dFdy(position);\n vec2 duv1 = dFdx(uv);\n vec2 duv2 = dFdy(uv);\n\n // solve the linear system\n vec3 dp2perp = cross(dp2, normal_inWorld);\n vec3 dp1perp = cross(normal_inWorld, dp1);\n vec3 tangent = dp2perp * duv1.x + dp1perp * duv2.x;\n vec3 bitangent = dp2perp * duv1.y + dp1perp * duv2.y;\n bitangent *= -1.0;\n\n // construct a scale-invariant frame\n float invMat = inversesqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));\n return mat3(tangent * invMat, bitangent * invMat, normal_inWorld);\n }\n\n vec3 perturb_normal(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord, vec3 normalTex) {\n mat3 tbnMat_tangent_to_world = cotangent_frame(normal_inWorld, -viewVector, texcoord);\n if (texcoord.x > 0.0 || texcoord.y > 0.0) {\n return normalize(tbnMat_tangent_to_world * normalTex);\n } else {\n return normal_inWorld;\n }\n }\n #else\n vec3 perturb_normal(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord, vec3 normalTex) {\n return normal_inWorld;\n }\n #endif\n#endif\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // View vector\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n vec3 viewVector = viewPosition - v_position_inWorld.xyz;\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n vec3 geomNormal_inWorld = normal_inWorld;\n vec4 normalTextureTransform = get_normalTextureTransform(materialSID, 0);\n float normalTextureRotation = get_normalTextureRotation(materialSID, 0);\n int normalTexcoordIndex = get_normalTexcoordIndex(materialSID, 0);\n vec2 normalTexcoord = getTexcoord(normalTexcoordIndex);\n vec2 normalTexUv = uvTransform(normalTextureTransform.xy, normalTextureTransform.zw, normalTextureRotation, normalTexcoord);\n #ifdef RN_USE_NORMAL_TEXTURE\n vec3 normalTexValue = texture(u_normalTexture, normalTexUv).xyz;\n if(normalTexValue.b >= 128.0 / 255.0) {\n // normal texture is existence\n vec3 normalTex = normalTexValue * 2.0 - 1.0;\n float normalScale = get_normalScale(materialSID, 0);\n vec3 scaledNormal = normalize(normalTex * vec3(normalScale, normalScale, 1.0));\n normal_inWorld = perturb_normal(normal_inWorld, viewVector, normalTexUv, scaledNormal);\n }\n #endif\n\n // BaseColorFactor\n vec3 baseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n vec4 baseColorFactor = get_baseColorFactor(materialSID, 0);\n if (v_color != baseColor && baseColorFactor.rgb != baseColor) {\n baseColor = v_color * baseColorFactor.rgb;\n alpha = baseColorFactor.a;\n } else if (v_color == baseColor) {\n baseColor = baseColorFactor.rgb;\n alpha = baseColorFactor.a;\n } else if (baseColorFactor.rgb == baseColor) {\n baseColor = v_color;\n } else {\n baseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // BaseColor (take account for BaseColorTexture)\n vec4 baseColorTextureTransform = get_baseColorTextureTransform(materialSID, 0);\n float baseColorTextureRotation = get_baseColorTextureRotation(materialSID, 0);\n int baseColorTexcoordIndex = get_baseColorTexcoordIndex(materialSID, 0);\n vec2 baseColorTexcoord = getTexcoord(baseColorTexcoordIndex);\n vec2 baseColorTexUv = uvTransform(baseColorTextureTransform.xy, baseColorTextureTransform.zw, baseColorTextureRotation, baseColorTexcoord);\n vec4 textureColor = texture(u_baseColorTexture, baseColorTexUv);\n baseColor *= srgbToLinear(textureColor.rgb);\n alpha *= textureColor.a;\n\n#ifdef RN_IS_ALPHAMODE_MASK\n float alphaCutoff = get_alphaCutoff(materialSID, 0);\n if (alpha < alphaCutoff) {\n discard;\n }\n#endif\n\n\n // NdotV\n vec3 viewDirection = normalize(viewVector);\n float NdotV = saturateEpsilonToOne(dot(normal_inWorld, viewDirection));\n\n // Clearcoat\n#ifdef RN_USE_CLEARCOAT\n float clearcoatFactor = get_clearCoatFactor(materialSID, 0);\n vec4 clearcoatTextureTransform = get_clearCoatTextureTransform(materialSID, 0);\n float clearcoatTextureRotation = get_clearCoatTextureRotation(materialSID, 0);\n int clearCoatTexcoordIndex = get_clearCoatTexcoordIndex(materialSID, 0);\n vec2 clearCoatTexcoord = getTexcoord(clearCoatTexcoordIndex);\n vec2 clearcoatTexUv = uvTransform(clearcoatTextureTransform.xy, clearcoatTextureTransform.zw, clearcoatTextureRotation, clearCoatTexcoord);\n float clearcoatTexture = texture(u_clearCoatTexture, clearcoatTexUv).r;\n float clearcoat = clearcoatFactor * clearcoatTexture;\n#else\n float clearcoat = 0.0;\n#endif // RN_USE_CLEARCOAT\n\n // Transmission\n#ifdef RN_USE_TRANSMISSION\n float transmissionFactor = get_transmissionFactor(materialSID, 0);\n float transmissionTexture = texture(u_transmissionTexture, baseColorTexUv).r;\n float transmission = transmissionFactor * transmissionTexture;\n // alpha *= transmission;\n#else\n float transmission = 0.0;\n#endif // RN_USE_TRANSMISSION\n\n#ifdef RN_IS_LIGHTING\n // Metallic & Roughness\n vec2 metallicRoughnessFactor = get_metallicRoughnessFactor(materialSID, 0);\n float perceptualRoughness = metallicRoughnessFactor.y;\n float metallic = metallicRoughnessFactor.x;\n\n vec4 metallicRoughnessTextureTransform = get_metallicRoughnessTextureTransform(materialSID, 0);\n float metallicRoughnessTextureRotation = get_metallicRoughnessTextureRotation(materialSID, 0);\n int metallicRoughnessTexcoordIndex = get_metallicRoughnessTexcoordIndex(materialSID, 0);\n vec2 metallicRoughnessTexcoord = getTexcoord(metallicRoughnessTexcoordIndex);\n vec2 metallicRoughnessTexUv = uvTransform(metallicRoughnessTextureTransform.xy, metallicRoughnessTextureTransform.zw, metallicRoughnessTextureRotation, metallicRoughnessTexcoord);\n vec4 ormTexel = texture(u_metallicRoughnessTexture, metallicRoughnessTexUv);\n perceptualRoughness = ormTexel.g * perceptualRoughness;\n metallic = ormTexel.b * metallic;\n\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n#ifdef RN_USE_SPECULAR\n float specularTexture = texture(u_specularTexture, baseColorTexUv).a;\n float specular = get_specularFactor(materialSID, 0) * specularTexture;\n vec3 specularColorTexture = srgbToLinear(texture(u_specularTexture, baseColorTexUv).rgb);\n vec3 specularColor = get_specularColorFactor(materialSID, 0) * specularColorTexture;\n#else\n float specular = 1.0;\n vec3 specularColor = vec3(1.0, 1.0, 1.0);\n#endif // RN_USE_SPECULAR\n\n // F0, F90\n float ior = get_ior(materialSID, 0);\n float outsideIor = 1.0;\n vec3 dielectricSpecularF0 = min(\n ((ior - outsideIor) / (ior + outsideIor)) * ((ior - outsideIor) / (ior + outsideIor)) * specularColor,\n vec3(1.0)\n ) * specular;\n vec3 dielectricSpecularF90 = vec3(specular);\n vec3 F0 = mix(dielectricSpecularF0, baseColor.rgb, metallic);\n vec3 F90 = mix(dielectricSpecularF90, vec3(1.0), metallic);\n\n // Albedo\n vec3 black = vec3(0.0);\n vec3 albedo = mix(baseColor.rgb, black, metallic);\n\n rt0 = vec4(0.0, 0.0, 0.0, alpha);\n\n// Iridescence\n#ifdef RN_USE_IRIDESCENCE\n float iridescenceFactor = get_iridescenceFactor(materialSID, 0);\n float iridescenceTexture = texture(u_iridescenceTexture, baseColorTexUv).r;\n float iridescence = iridescenceFactor * iridescenceTexture;\n float iridescenceIor = get_iridescenceIor(materialSID, 0);\n float thicknessRatio = texture(u_iridescenceThicknessTexture, baseColorTexUv).r;\n float iridescenceThicknessMinimum = get_iridescenceThicknessMinimum(materialSID, 0);\n float iridescenceThicknessMaximum = get_iridescenceThicknessMaximum(materialSID, 0);\n float iridescenceThickness = mix(iridescenceThicknessMinimum, iridescenceThicknessMaximum, thicknessRatio);\n\n vec3 iridescenceFresnel = calcIridescence(1.0, iridescenceIor, NdotV, iridescenceThickness, F0);\n vec3 iridescenceF0 = Schlick_to_F0(iridescenceFresnel, NdotV);\n\n#else\n float iridescence = 0.0;\n vec3 iridescenceFresnel = vec3(0.0);\n vec3 iridescenceF0 = F0;\n#endif // RN_USE_IRIDESCENCE\n\n#ifdef RN_USE_CLEARCOAT\n // Clearcoat\n float clearcoatRoughnessFactor = get_clearCoatRoughnessFactor(materialSID, 0);\n int clearCoatRoughnessTexcoordIndex = get_clearCoatRoughnessTexcoordIndex(materialSID, 0);\n vec2 clearCoatRoughnessTexcoord = getTexcoord(clearCoatRoughnessTexcoordIndex);\n vec4 clearcoatRoughnessTextureTransform = get_clearCoatRoughnessTextureTransform(materialSID, 0);\n float clearcoatRoughnessTextureRotation = get_clearCoatRoughnessTextureRotation(materialSID, 0);\n vec2 clearcoatRoughnessTexUv = uvTransform(clearcoatRoughnessTextureTransform.xy, clearcoatRoughnessTextureTransform.zw, clearcoatRoughnessTextureRotation, clearCoatRoughnessTexcoord);\n float textureRoughnessTexture = texture(u_clearCoatRoughnessTexture, clearcoatRoughnessTexUv).g;\n float clearcoatRoughness = clearcoatRoughnessFactor * textureRoughnessTexture;\n\n int clearCoatNormalTexcoordIndex = get_clearCoatNormalTexcoordIndex(materialSID, 0);\n vec2 clearCoatNormalTexcoord = getTexcoord(clearCoatNormalTexcoordIndex);\n vec4 clearcoatNormalTextureTransform = get_clearCoatNormalTextureTransform(materialSID, 0);\n float clearcoatNormalTextureRotation = get_clearCoatNormalTextureRotation(materialSID, 0);\n vec2 clearcoatNormalTexUv = uvTransform(clearcoatNormalTextureTransform.xy, clearcoatNormalTextureTransform.zw, clearcoatNormalTextureRotation, clearCoatNormalTexcoord);\n vec3 textureNormal_tangent = texture(u_clearCoatNormalTexture, clearcoatNormalTexUv).xyz * vec3(2.0) - vec3(1.0);\n vec3 clearcoatNormal_inWorld = perturb_normal(geomNormal_inWorld, viewVector, normalTexUv, textureNormal_tangent);\n float VdotNc = saturateEpsilonToOne(dot(viewDirection, clearcoatNormal_inWorld));\n#else\n float clearcoatRoughness = 0.0;\n vec3 clearcoatNormal_inWorld = vec3(0.0);\n float VdotNc = 0.0;\n#endif // RN_USE_CLEARCOAT\n\n#ifdef RN_USE_VOLUME\n // Volume\n float thicknessFactor = get_thicknessFactor(materialSID, 0);\n float thicknessTexture = texture(u_thicknessTexture, baseColorTexUv).g;\n float attenuationDistance = get_attenuationDistance(materialSID, 0);\n vec3 attenuationColor = get_attenuationColor(materialSID, 0);\n float thickness = thicknessFactor * thicknessTexture;\n#else\n float thickness = 0.0;\n vec3 attenuationColor = vec3(0.0);\n float attenuationDistance = 0.000001;\n#endif // RN_USE_VOLUME\n\n#ifdef RN_USE_SHEEN\n // Sheen\n vec3 sheenColorFactor = get_sheenColorFactor(materialSID, 0);\n vec3 sheenColorTexture = texture(u_sheenColorTexture, baseColorTexUv).rgb;\n float sheenRoughnessFactor = get_sheenRoughnessFactor(materialSID, 0);\n float sheenRoughnessTexture = texture(u_sheenRoughnessTexture, baseColorTexUv).a;\n vec3 sheenColor = sheenColorFactor * sheenColorTexture;\n float sheenRoughness = clamp(sheenRoughnessFactor * sheenRoughnessTexture, 0.000001, 1.0);\n float albedoSheenScalingNdotV = 1.0 - max3(sheenColor) * texture(u_sheenLutTexture, vec2(NdotV, sheenRoughness)).r;\n#else\n vec3 sheenColor = vec3(0.0);\n float sheenRoughness = 0.000001;\n float albedoSheenScalingNdotV = 1.0;\n#endif // RN_USE_SHEEN\n\n // Lighting\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n // Fresnel\n vec3 halfVector = normalize(light.direction + viewDirection);\n float VdotH = dot(viewDirection, halfVector);\n vec3 F = fresnel(F0, F90, VdotH);\n\n float NdotL = saturateEpsilonToOne(dot(normal_inWorld, light.direction));\n\n // Diffuse\n vec3 diffuseBrdf = diffuse_brdf(albedo);\n vec3 pureDiffuse = (vec3(1.0) - F) * diffuseBrdf * vec3(NdotL) * light.attenuatedIntensity;\n\n#ifdef RN_USE_TRANSMISSION\n vec3 refractionVector = refract(-viewDirection, normal_inWorld, 1.0 / ior);\n Light transmittedLightFromUnderSurface = light;\n transmittedLightFromUnderSurface.pointToLight -= refractionVector;\n vec3 transmittedLightDirectionFromUnderSurface = normalize(transmittedLightFromUnderSurface.pointToLight);\n transmittedLightFromUnderSurface.direction = transmittedLightDirectionFromUnderSurface;\n\n vec3 Ht = normalize(viewDirection + transmittedLightFromUnderSurface.direction);\n float NdotHt = saturateEpsilonToOne(dot(normal_inWorld, Ht));\n float NdotLt = saturateEpsilonToOne(dot(normal_inWorld, transmittedLightFromUnderSurface.direction));\n\n vec3 transmittedContrib = (vec3(1.0) - F) * specular_btdf(alphaRoughness, NdotLt, NdotV, NdotHt) * albedo * transmittedLightFromUnderSurface.attenuatedIntensity;\n\n#ifdef RN_USE_VOLUME\n vec3 attenuationColor = get_attenuationColor(materialSID, 0);\n float attenuationDistance = get_attenuationDistance(materialSID, 0);\n transmittedContrib = volumeAttenuation(attenuationColor, attenuationDistance, transmittedContrib, length(transmittedLightFromUnderSurface.pointToLight));\n#endif // RN_USE_VOLUME\n\n vec3 diffuseContrib = mix(pureDiffuse, vec3(transmittedContrib), transmission);\n#else\n vec3 diffuseContrib = pureDiffuse;\n#endif // RN_USE_TRANSMISSION\n\n // Specular\n float NdotH = saturateEpsilonToOne(dot(normal_inWorld, halfVector));\n vec3 specularContrib = cook_torrance_specular_brdf(NdotH, NdotL, NdotV, F, alphaRoughness) * vec3(NdotL) * light.attenuatedIntensity;\n\n // Base Layer\n vec3 baseLayer = diffuseContrib + specularContrib;\n\n#ifdef RN_USE_SHEEN\n // Sheen\n vec3 sheenContrib = sheen_brdf(sheenColor, sheenRoughness, NdotL, NdotV, NdotH) * NdotL * light.attenuatedIntensity;\n float albedoSheenScaling = min(\n albedoSheenScalingNdotV,\n 1.0 - max3(sheenColor) * texture(u_sheenLutTexture, vec2(NdotL, sheenRoughness)).r);\n vec3 color = sheenContrib + baseLayer * albedoSheenScaling;\n#else\n vec3 color = baseLayer;\n float albedoSheenScaling = 1.0;\n#endif // RN_USE_SHEEN\n\n#ifdef RN_USE_CLEARCOAT\n // Clear Coat Layer\n float NdotHc = saturateEpsilonToOne(dot(clearcoatNormal_inWorld, halfVector));\n float LdotNc = saturateEpsilonToOne(dot(light.direction, clearcoatNormal_inWorld));\n vec3 coated = coated_material_s(color, perceptualRoughness,\n clearcoatRoughness, clearcoat, VdotNc, LdotNc, NdotHc);\n rt0.xyz += coated;\n#else\n rt0.xyz += color;\n#endif // RN_USE_CLEARCOAT\n }\n\n#ifdef RN_USE_SHADOW_MAPPING\n float bias = 0.001;\n float shadowContribusion = varianceShadowContribution(v_shadowCoord.xy/v_shadowCoord.w, (v_shadowCoord.z - bias)/v_shadowCoord.w);\n // rt0.rgb = rt0.rgb * (0.5 + shadowContribusion * 0.5);\n rt0.rgb = rt0.rgb * shadowContribusion;\n#endif\n\n vec3 ibl = IBLContribution(materialSID, normal_inWorld, NdotV, viewDirection,\n albedo, F0, perceptualRoughness, clearcoatRoughness, clearcoatNormal_inWorld,\n clearcoat, VdotNc, geomNormal_inWorld, cameraSID, transmission, v_position_inWorld.xyz, thickness,\n sheenColor, sheenRoughness, albedoSheenScalingNdotV, ior, iridescenceFresnel, iridescenceF0, iridescence);\n\n int occlusionTexcoordIndex = get_occlusionTexcoordIndex(materialSID, 0);\n vec2 occlusionTexcoord = getTexcoord(occlusionTexcoordIndex);\n vec4 occlusionTextureTransform = get_occlusionTextureTransform(materialSID, 0);\n float occlusionTextureRotation = get_occlusionTextureRotation(materialSID, 0);\n vec2 occlusionTexUv = uvTransform(occlusionTextureTransform.xy, occlusionTextureTransform.zw, occlusionTextureRotation, occlusionTexcoord);\n float occlusion = texture(u_occlusionTexture, occlusionTexUv).r;\n float occlusionStrength = get_occlusionStrength(materialSID, 0);\n\n // Occlution to Indirect Lights\n rt0.xyz += mix(ibl, ibl * occlusion, occlusionStrength);\n#else\n rt0 = vec4(baseColor, alpha);\n#endif // RN_IS_LIGHTING\n\n // Emissive\n vec3 emissiveFactor = get_emissiveFactor(materialSID, 0);\n int emissiveTexcoordIndex = get_emissiveTexcoordIndex(materialSID, 0);\n vec2 emissiveTexcoord = getTexcoord(emissiveTexcoordIndex);\n vec4 emissiveTextureTransform = get_emissiveTextureTransform(materialSID, 0);\n float emissiveTextureRotation = get_emissiveTextureRotation(materialSID, 0);\n vec2 emissiveTexUv = uvTransform(emissiveTextureTransform.xy, emissiveTextureTransform.zw, emissiveTextureRotation, emissiveTexcoord);\n vec3 emissive = emissiveFactor * srgbToLinear(texture(u_emissiveTexture, emissiveTexUv).xyz);\n\n#ifdef RN_USE_CLEARCOAT\n vec3 coated_emissive = emissive * mix(vec3(1.0), vec3(0.04 + (1.0 - 0.04) * pow(1.0 - NdotV, 5.0)), clearcoat);\n rt0.xyz += coated_emissive;\n#else\n rt0.xyz += emissive;\n#endif // RN_USE_CLEARCOAT\n\n bool isOutputHDR = get_isOutputHDR(materialSID, 0);\n if(isOutputHDR){\n/* shaderity: @{renderTargetEnd} */\n\n return;\n }\n\n#ifdef RN_IS_ALPHAMODE_OPAQUE\n rt0.a = 1.0;\n#elif defined(RN_IS_ALPHAMODE_MASK)\n rt0.a = 1.0;\n#endif\n\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\n // rt0.rgb = vec3(texture(u_depthTexture, v_shadowCoord.xy/v_shadowCoord.w).r);\n\n // premultiplied alpha\n // rt0.rgb /= alpha;\n\nfloat makeOutputSrgb = float(get_makeOutputSrgb(materialSID, 0));\nrt0.rgb = mix(rt0.rgb, linearToSrgb(rt0.rgb), makeOutputSrgb);\n\nrt1 = rt0;\nrt2 = rt0;\nrt3 = rt0;\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var P=n(5757),R=n(4878);const D={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nout vec2 v_texcoord_0;\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n v_texcoord_0 = a_texcoord_0;\n}\n",shaderStage:"vertex",isFragmentShader:!1},M={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/**\n * This file contains source code provided by NVIDIA Corporation.\n * FXAA antialiasing is developed by NVIDIA.\n * The codes of this file is modified from original code to work on WebGL1.\n * The modification for GLSL 100 is referred from Three.js, https://github.com/mrdoob/three.js/blob/5ba4c25bcb74577e1b1e14906f345135610a94f3/examples/js/shaders/FXAAShader.js\n * The original FXAA code is https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/80e8ba8f5e8935821513207033490735dd3279d8/samples/es3-kepler/FXAA/FXAA3_11.h\n */\n\n//----------------------------------------------------------------------------------\n// File: es3-kepler\\FXAA/FXAA3_11.h\n// SDK Version: v3.00\n// Email: gameworks@nvidia.com\n// Site: http://developer.nvidia.com/\n//\n// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// * Neither the name of NVIDIA CORPORATION nor the names of its\n// contributors may be used to endorse or promote products derived\n// from this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 'AS IS' AND ANY\n// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//----------------------------------------------------------------------------------\n/*============================================================================\n NVIDIA FXAA 3.11 by TIMOTHY LOTTES\n============================================================================*/\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec2 v_texcoord_0;\n\nuniform sampler2D u_baseColorTexture; // initialValue=(0,white)\nuniform vec2 u_screenInfo; // initialValue=(0,0)\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\n\n\n #define FXAA_PC 1\n #define FXAA_QUALITYPRESET 39\n #define FXAA_GREEN_AS_LUMA 0\n #define FXAA_GLSL_100 1\n\n /*============================================================================\n INTEGRATION KNOBS\n ============================================================================*/\n //\n // FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE).\n // FXAA_360_OPT is a prototype for the new optimized 360 version.\n //\n // 1 = Use API.\n // 0 = Don't use API.\n //\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_PS3\n #define FXAA_PS3 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_360\n #define FXAA_360 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_360_OPT\n #define FXAA_360_OPT 0\n #endif\n /*==========================================================================*/\n #ifndef FXAA_PC\n //\n // FXAA Quality\n // The high quality PC algorithm.\n //\n #define FXAA_PC 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_PC_CONSOLE\n //\n // The console algorithm for PC is included\n // for developers targeting really low spec machines.\n // Likely better to just run FXAA_PC, and use a really low preset.\n //\n #define FXAA_PC_CONSOLE 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GLSL_120\n #define FXAA_GLSL_120 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GLSL_130\n #define FXAA_GLSL_130 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_3\n #define FXAA_HLSL_3 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_4\n #define FXAA_HLSL_4 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_5\n #define FXAA_HLSL_5 0\n #endif\n /*==========================================================================*/\n #ifndef FXAA_GREEN_AS_LUMA\n //\n // For those using non-linear color,\n // and either not able to get luma in alpha, or not wanting to,\n // this enables FXAA to run using green as a proxy for luma.\n // So with this enabled, no need to pack luma in alpha.\n //\n // This will turn off AA on anything which lacks some amount of green.\n // Pure red and blue or combination of only R and B, will get no AA.\n //\n // Might want to lower the settings for both,\n // fxaaConsoleEdgeThresholdMin\n // fxaaQualityEdgeThresholdMin\n // In order to insure AA does not get turned off on colors\n // which contain a minor amount of green.\n //\n // 1 = On.\n // 0 = Off.\n //\n #define FXAA_GREEN_AS_LUMA 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_EARLY_EXIT\n //\n // Controls algorithm's early exit path.\n // On PS3 turning this ON adds 2 cycles to the shader.\n // On 360 turning this OFF adds 10ths of a millisecond to the shader.\n // Turning this off on console will result in a more blurry image.\n // So this defaults to on.\n //\n // 1 = On.\n // 0 = Off.\n //\n #define FXAA_EARLY_EXIT 1\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_DISCARD\n //\n // Only valid for PC OpenGL currently.\n // Probably will not work when FXAA_GREEN_AS_LUMA = 1.\n //\n // 1 = Use discard on pixels which don't need AA.\n // For APIs which enable concurrent TEX+ROP from same surface.\n // 0 = Return unchanged color on pixels which don't need AA.\n //\n #define FXAA_DISCARD 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_FAST_PIXEL_OFFSET\n //\n // Used for GLSL 120 only.\n //\n // 1 = GL API supports fast pixel offsets\n // 0 = do not use fast pixel offsets\n //\n #ifdef GLEXT_gpu_shader4\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifdef GLNV_gpu_shader5\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifdef GLARB_gpu_shader5\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifndef FXAA_FAST_PIXEL_OFFSET\n #define FXAA_FAST_PIXEL_OFFSET 0\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GATHER4_ALPHA\n //\n // 1 = API supports gather4 on alpha channel.\n // 0 = API does not support gather4 on alpha channel.\n //\n #if (FXAA_HLSL_5 == 1)\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifdef GLARB_gpu_shader5\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifdef GLNV_gpu_shader5\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifndef FXAA_GATHER4_ALPHA\n #define FXAA_GATHER4_ALPHA 0\n #endif\n #endif\n\n /*============================================================================\n FXAA CONSOLE PS3 - TUNING KNOBS\n ============================================================================*/\n #ifndef FXAA_CONSOLEPS3_EDGE_SHARPNESS\n //\n // Consoles the sharpness of edges on PS3 only.\n // Non-PS3 tuning is done with shader input.\n //\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 4 and 8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n //\n // 8.0 is sharper\n // 4.0 is softer\n // 2.0 is really soft (good for vector graphics inputs)\n //\n #if 1\n #define FXAA_CONSOLEPS3_EDGE_SHARPNESS 8.0\n #endif\n #if 0\n #define FXAA_CONSOLEPS3_EDGE_SHARPNESS 4.0\n #endif\n #if 0\n #define FXAA_CONSOLEPS3_EDGE_SHARPNESS 2.0\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_CONSOLEPS3_EDGE_THRESHOLD\n //\n // Only effects PS3.\n // Non-PS3 tuning is done with shader input.\n //\n // The minimum amount of local contrast required to apply algorithm.\n // The console setting has a different mapping than the quality setting.\n //\n // This only applies when FXAA_EARLY_EXIT is 1.\n //\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 0.25 and 0.125.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n //\n // 0.125 leaves less aliasing, but is softer\n // 0.25 leaves more aliasing, and is sharper\n //\n #if 1\n #define FXAA_CONSOLEPS3_EDGE_THRESHOLD 0.125\n #else\n #define FXAA_CONSOLEPS3_EDGE_THRESHOLD 0.25\n #endif\n #endif\n\n /*============================================================================\n FXAA QUALITY - TUNING KNOBS\n ------------------------------------------------------------------------------\n NOTE the other tuning knobs are now in the shader function inputs!\n ============================================================================*/\n #ifndef FXAA_QUALITYPRESET\n //\n // Choose the quality preset.\n // This needs to be compiled into the shader as it effects code.\n // Best option to include multiple presets is to\n // in each shader define the preset, then include this file.\n //\n // OPTIONS\n // -----------------------------------------------------------------------\n // 10 to 15 - default medium dither (10=fastest, 15=highest quality)\n // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)\n // 39 - no dither, very expensive\n //\n // NOTES\n // -----------------------------------------------------------------------\n // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)\n // 13 = about same speed as FXAA 3.9 and better than 12\n // 23 = closest to FXAA 3.9 visually and performance wise\n // _ = the lowest digit is directly related to performance\n // _ = the highest digit is directly related to style\n //\n #define FXAA_QUALITYPRESET 12\n #endif\n\n\n /*============================================================================\n FXAA QUALITY - PRESETS\n ============================================================================*/\n\n /*============================================================================\n FXAA QUALITY - MEDIUM DITHER PRESETS\n ============================================================================*/\n #if(FXAA_QUALITYPRESET == 10)\n#define FXAA_QUALITYPS 3\n#define FXAA_QUALITYP0 1.5\n#define FXAA_QUALITYP1 3.0\n#define FXAA_QUALITYP2 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 11)\n#define FXAA_QUALITYPS 4\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 3.0\n#define FXAA_QUALITYP3 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 12)\n#define FXAA_QUALITYPS 5\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 4.0\n#define FXAA_QUALITYP4 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 13)\n#define FXAA_QUALITYPS 6\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 4.0\n#define FXAA_QUALITYP5 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 14)\n#define FXAA_QUALITYPS 7\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 4.0\n#define FXAA_QUALITYP6 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 15)\n#define FXAA_QUALITYPS 8\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 4.0\n#define FXAA_QUALITYP7 12.0\n#endif\n\n/*============================================================================\n FXAA QUALITY - LOW DITHER PRESETS\n============================================================================*/\n#if (FXAA_QUALITYPRESET == 20)\n#define FXAA_QUALITYPS 3\n#define FXAA_QUALITYP0 1.5\n#define FXAA_QUALITYP1 2.0\n#define FXAA_QUALITYP2 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 21)\n#define FXAA_QUALITYPS 4\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 22)\n#define FXAA_QUALITYPS 5\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 23)\n#define FXAA_QUALITYPS 6\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 24)\n#define FXAA_QUALITYPS 7\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 3.0\n#define FXAA_QUALITYP6 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 25)\n#define FXAA_QUALITYPS 8\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 4.0\n#define FXAA_QUALITYP7 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 26)\n#define FXAA_QUALITYPS 9\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 4.0\n#define FXAA_QUALITYP8 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 27)\n#define FXAA_QUALITYPS 10\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 4.0\n#define FXAA_QUALITYP9 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 28)\n#define FXAA_QUALITYPS 11\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 2.0\n#define FXAA_QUALITYP9 4.0\n#define FXAA_QUALITYP10 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 29)\n#define FXAA_QUALITYPS 12\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 2.0\n#define FXAA_QUALITYP9 2.0\n#define FXAA_QUALITYP10 4.0\n#define FXAA_QUALITYP11 8.0\n#endif\n\n/*============================================================================\n FXAA QUALITY - EXTREME QUALITY\n============================================================================*/\n#if (FXAA_QUALITYPRESET == 39)\n#define FXAA_QUALITYPS 12\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.0\n#define FXAA_QUALITYP2 1.0\n#define FXAA_QUALITYP3 1.0\n#define FXAA_QUALITYP4 1.0\n#define FXAA_QUALITYP5 1.5\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 2.0\n#define FXAA_QUALITYP9 2.0\n#define FXAA_QUALITYP10 4.0\n#define FXAA_QUALITYP11 8.0\n#endif\n\n\n\n/*============================================================================\n API PORTING\n============================================================================*/\n#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)\n#define FxaaBool bool\n#define FxaaDiscard discard\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 ivec2\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTex sampler2D\n#else\n#define FxaaBool bool\n#define FxaaDiscard clip(-1)\n#define FxaaFloat float\n#define FxaaFloat2 float2\n#define FxaaFloat3 float3\n#define FxaaFloat4 float4\n#define FxaaHalf half\n#define FxaaHalf2 half2\n#define FxaaHalf3 half3\n#define FxaaHalf4 half4\n#define FxaaSat(x) saturate(x)\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_GLSL_100 == 1)\n#define FxaaTexTop(t, p) texture(t, p, 0.0)\n#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r), 0.0)\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_GLSL_120 == 1)\n// Requires,\n// #version 120\n// And at least,\n// #extension GLEXT_gpu_shader4 : enable\n// (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)\n#define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)\n#if (FXAA_FAST_PIXEL_OFFSET == 1)\n#define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)\n#else\n#define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)\n#endif\n#if (FXAA_GATHER4_ALPHA == 1)\n// use #extension GLARB_gpu_shader5 : enable\n#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n#define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n#endif\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_GLSL_130 == 1)\n// Requires \"#version 130\" or better\n#define FxaaTexTop(t, p) textureLod(t, p, 0.0)\n#define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)\n#if (FXAA_GATHER4_ALPHA == 1)\n// use #extension GLARB_gpu_shader5 : enable\n#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n#define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n#endif\n#endif\n\n\n/*============================================================================\n GREEN AS LUMA OPTION SUPPORT FUNCTION\n============================================================================*/\n#if (FXAA_GREEN_AS_LUMA == 0)\n FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return dot(rgba.rgb, vec3(0.298912, 0.586611, 0.114478)); }\n // FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }\n#else\n FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\n#endif\n\n\n\n\n\n\n\n\n\n/*============================================================================\n FXAA3 QUALITY - PC\n============================================================================*/\n#if (FXAA_PC == 1)\n /*--------------------------------------------------------------------------*/\n FxaaFloat4 FxaaPixelShader(\n //\n // Use noperspective interpolation here (turn off perspective interpolation).\n // {xy} = center of pixel\n FxaaFloat2 pos,\n //\n // Used only for FXAA Console, and not used on the 360 version.\n // Use noperspective interpolation here (turn off perspective interpolation).\n // {xy} = upper left of pixel\n // {zw} = lower right of pixel\n FxaaFloat4 fxaaConsolePosPos,\n //\n // Input color texture.\n // {rgb_} = color in linear or perceptual color space\n // if (FXAA_GREEN_AS_LUMA == 0)\n // {_a} = luma in perceptual color space (not linear)\n FxaaTex tex,\n //\n // Only used on the optimized 360 version of FXAA Console.\n // For everything but 360, just use the same input here as for \"tex\".\n // For 360, same texture, just alias with a 2nd sampler.\n // This sampler needs to have an exponent bias of -1.\n FxaaTex fxaaConsole360TexExpBiasNegOne,\n //\n // Only used on the optimized 360 version of FXAA Console.\n // For everything but 360, just use the same input here as for \"tex\".\n // For 360, same texture, just alias with a 3nd sampler.\n // This sampler needs to have an exponent bias of -2.\n FxaaTex fxaaConsole360TexExpBiasNegTwo,\n //\n // Only used on FXAA Quality.\n // This must be from a constant/uniform.\n // {x_} = 1.0/screenWidthInPixels\n // {_y} = 1.0/screenHeightInPixels\n FxaaFloat2 fxaaQualityRcpFrame,\n //\n // Only used on FXAA Console.\n // This must be from a constant/uniform.\n // This effects sub-pixel AA quality and inversely sharpness.\n // Where N ranges between,\n // N = 0.50 (default)\n // N = 0.33 (sharper)\n // {x_} = -N/screenWidthInPixels\n // {_y} = -N/screenHeightInPixels\n // {z_} = N/screenWidthInPixels\n // {_w} = N/screenHeightInPixels\n FxaaFloat4 fxaaConsoleRcpFrameOpt,\n //\n // Only used on FXAA Console.\n // Not used on 360, but used on PS3 and PC.\n // This must be from a constant/uniform.\n // {x_} = -2.0/screenWidthInPixels\n // {_y} = -2.0/screenHeightInPixels\n // {z_} = 2.0/screenWidthInPixels\n // {_w} = 2.0/screenHeightInPixels\n FxaaFloat4 fxaaConsoleRcpFrameOpt2,\n //\n // Only used on FXAA Console.\n // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.\n // This must be from a constant/uniform.\n // {x_} = 8.0/screenWidthInPixels\n // {_y} = 8.0/screenHeightInPixels\n // {z_} = -4.0/screenWidthInPixels\n // {_w} = -4.0/screenHeightInPixels\n FxaaFloat4 fxaaConsole360RcpFrameOpt2,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITYSUBPIX define.\n // It is here now to allow easier tuning.\n // Choose the amount of sub-pixel aliasing removal.\n // This can effect sharpness.\n // 1.00 - upper limit (softer)\n // 0.75 - default amount of filtering\n // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)\n // 0.25 - almost off\n // 0.00 - completely off\n FxaaFloat fxaaQualitySubpix,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITYEDGE_THRESHOLD define.\n // It is here now to allow easier tuning.\n // The minimum amount of local contrast required to apply algorithm.\n // 0.333 - too little (faster)\n // 0.250 - low quality\n // 0.166 - default\n // 0.125 - high quality\n // 0.063 - overkill (slower)\n FxaaFloat fxaaQualityEdgeThreshold,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITYEDGE_THRESHOLD_MIN define.\n // It is here now to allow easier tuning.\n // Trims the algorithm from processing darks.\n // 0.0833 - upper limit (default, the start of visible unfiltered edges)\n // 0.0625 - high quality (faster)\n // 0.0312 - visible limit (slower)\n // Special notes when using FXAA_GREEN_AS_LUMA,\n // Likely want to set this to zero.\n // As colors that are mostly not-green\n // will appear very dark in the green channel!\n // Tune by looking at mostly non-green content,\n // then start at zero and increase until aliasing is a problem.\n FxaaFloat fxaaQualityEdgeThresholdMin,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLEEDGE_SHARPNESS define.\n // It is here now to allow easier tuning.\n // This does not effect PS3, as this needs to be compiled in.\n // Use FXAA_CONSOLEPS3_EDGE_SHARPNESS for PS3.\n // Due to the PS3 being ALU bound,\n // there are only three safe values here: 2 and 4 and 8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n // For all other platforms can be a non-power of two.\n // 8.0 is sharper (default!!!)\n // 4.0 is softer\n // 2.0 is really soft (good only for vector graphics inputs)\n FxaaFloat fxaaConsoleEdgeSharpness,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLEEDGE_THRESHOLD define.\n // It is here now to allow easier tuning.\n // This does not effect PS3, as this needs to be compiled in.\n // Use FXAA_CONSOLEPS3_EDGE_THRESHOLD for PS3.\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 1/4 and 1/8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n // The console setting has a different mapping than the quality setting.\n // Other platforms can use other values.\n // 0.125 leaves less aliasing, but is softer (default!!!)\n // 0.25 leaves more aliasing, and is sharper\n FxaaFloat fxaaConsoleEdgeThreshold,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLEEDGE_THRESHOLD_MIN define.\n // It is here now to allow easier tuning.\n // Trims the algorithm from processing darks.\n // The console setting has a different mapping than the quality setting.\n // This only applies when FXAA_EARLY_EXIT is 1.\n // This does not apply to PS3,\n // PS3 was simplified to avoid more shader instructions.\n // 0.06 - faster but more aliasing in darks\n // 0.05 - default\n // 0.04 - slower and less aliasing in darks\n // Special notes when using FXAA_GREEN_AS_LUMA,\n // Likely want to set this to zero.\n // As colors that are mostly not-green\n // will appear very dark in the green channel!\n // Tune by looking at mostly non-green content,\n // then start at zero and increase until aliasing is a problem.\n FxaaFloat fxaaConsoleEdgeThresholdMin,\n //\n // Extra constants for 360 FXAA Console only.\n // Use zeros or anything else for other platforms.\n // These must be in physical constant registers and NOT immedates.\n // Immedates will result in compiler un-optimizing.\n // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)\n FxaaFloat4 fxaaConsole360ConstDir\n ) {\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posM;\n posM.x = pos.x;\n posM.y = pos.y;\n #if (FXAA_GATHER4_ALPHA == 1)\n #if (FXAA_DISCARD == 0)\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #if (FXAA_GREEN_AS_LUMA == 0)\n #define lumaM rgbyM.w\n #else\n #define lumaM rgbyM.y\n #endif\n #endif\n #if (FXAA_GREEN_AS_LUMA == 0)\n FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);\n FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));\n #else\n FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);\n FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));\n #endif\n #if (FXAA_DISCARD == 1)\n #define lumaM luma4A.w\n #endif\n #define lumaE luma4A.z\n #define lumaS luma4A.x\n #define lumaSE luma4A.y\n #define lumaNW luma4B.w\n #define lumaN luma4B.z\n #define lumaW luma4B.x\n #else\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #if (FXAA_GREEN_AS_LUMA == 0)\n #define lumaM rgbyM.w\n #else\n #define lumaM rgbyM.y\n #endif\n #if (FXAA_GLSL_100 == 1)\n FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(0.0, 1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(1.0, 0.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(0.0, -1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));\n #else\n FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(0, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, 0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(0, -1), fxaaQualityRcpFrame.xy));\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n FxaaFloat maxSM = max(lumaS, lumaM);\n FxaaFloat minSM = min(lumaS, lumaM);\n FxaaFloat maxESM = max(lumaE, maxSM);\n FxaaFloat minESM = min(lumaE, minSM);\n FxaaFloat maxWN = max(lumaN, lumaW);\n FxaaFloat minWN = min(lumaN, lumaW);\n FxaaFloat rangeMax = max(maxWN, maxESM);\n FxaaFloat rangeMin = min(minWN, minESM);\n FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\n FxaaFloat range = rangeMax - rangeMin;\n FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\n FxaaBool earlyExit = range < rangeMaxClamped;\n /*--------------------------------------------------------------------------*/\n if (earlyExit)\n #if (FXAA_DISCARD == 1)\n FxaaDiscard;\n #else\n return rgbyM;\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_GATHER4_ALPHA == 0)\n #if (FXAA_GLSL_100 == 1)\n FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, -1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(1.0, 1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(1.0, -1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));\n #else\n FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n #endif\n #else\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n #endif\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNS = lumaN + lumaS;\n FxaaFloat lumaWE = lumaW + lumaE;\n FxaaFloat subpixRcpRange = 1.0 / range;\n FxaaFloat subpixNSWE = lumaNS + lumaWE;\n FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\n FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNESE = lumaNE + lumaSE;\n FxaaFloat lumaNWNE = lumaNW + lumaNE;\n FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\n FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNWSW = lumaNW + lumaSW;\n FxaaFloat lumaSWSE = lumaSW + lumaSE;\n FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\n FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\n FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\n FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\n FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\n FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\n /*--------------------------------------------------------------------------*/\n FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\n FxaaFloat lengthSign = fxaaQualityRcpFrame.x;\n FxaaBool horzSpan = edgeHorz >= edgeVert;\n FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\n /*--------------------------------------------------------------------------*/\n if (!horzSpan) lumaN = lumaW;\n if (!horzSpan) lumaS = lumaE;\n if (horzSpan) lengthSign = fxaaQualityRcpFrame.y;\n FxaaFloat subpixB = (subpixA * (1.0 / 12.0)) - lumaM;\n /*--------------------------------------------------------------------------*/\n FxaaFloat gradientN = lumaN - lumaM;\n FxaaFloat gradientS = lumaS - lumaM;\n FxaaFloat lumaNN = lumaN + lumaM;\n FxaaFloat lumaSS = lumaS + lumaM;\n FxaaBool pairN = abs(gradientN) >= abs(gradientS);\n FxaaFloat gradient = max(abs(gradientN), abs(gradientS));\n if (pairN) lengthSign = -lengthSign;\n FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posB;\n posB.x = posM.x;\n posB.y = posM.y;\n FxaaFloat2 offNP;\n offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n offNP.y = (horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n if (!horzSpan) posB.x += lengthSign * 0.5;\n if (horzSpan) posB.y += lengthSign * 0.5;\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posN;\n posN.x = posB.x - offNP.x * FXAA_QUALITYP0;\n posN.y = posB.y - offNP.y * FXAA_QUALITYP0;\n FxaaFloat2 posP;\n posP.x = posB.x + offNP.x * FXAA_QUALITYP0;\n posP.y = posB.y + offNP.y * FXAA_QUALITYP0;\n FxaaFloat subpixD = ((-2.0) * subpixC) + 3.0;\n FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\n FxaaFloat subpixE = subpixC * subpixC;\n FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\n /*--------------------------------------------------------------------------*/\n if (!pairN) lumaNN = lumaSS;\n FxaaFloat gradientScaled = gradient * 1.0 / 4.0;\n FxaaFloat lumaMM = lumaM - lumaNN * 0.5;\n FxaaFloat subpixF = subpixD * subpixE;\n FxaaBool lumaMLTZero = lumaMM < 0.0;\n /*--------------------------------------------------------------------------*/\n lumaEndN -= lumaNN * 0.5;\n lumaEndP -= lumaNN * 0.5;\n FxaaBool doneN = abs(lumaEndN) >= gradientScaled;\n FxaaBool doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP1;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP1;\n FxaaBool doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP1;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP1;\n /*--------------------------------------------------------------------------*/\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP2;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP2;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP2;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP2;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 3)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP3;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP3;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP3;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP3;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 4)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP4;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP4;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP4;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP4;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 5)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP5;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP5;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP5;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP5;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 6)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP6;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP6;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP6;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP6;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 7)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP7;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP7;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP7;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP7;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 8)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP8;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP8;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP8;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP8;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 9)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP9;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP9;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP9;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP9;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 10)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP10;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP10;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP10;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP10;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 11)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP11;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP11;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP11;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP11;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 12)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP12;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP12;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP12;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP12;\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n /*--------------------------------------------------------------------------*/\n FxaaFloat dstN = posM.x - posN.x;\n FxaaFloat dstP = posP.x - posM.x;\n if (!horzSpan) dstN = posM.y - posN.y;\n if (!horzSpan) dstP = posP.y - posM.y;\n /*--------------------------------------------------------------------------*/\n FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\n FxaaFloat spanLength = (dstP + dstN);\n FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\n FxaaFloat spanLengthRcp = 1.0 / spanLength;\n /*--------------------------------------------------------------------------*/\n FxaaBool directionN = dstN < dstP;\n FxaaFloat dst = min(dstN, dstP);\n FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\n FxaaFloat subpixG = subpixF * subpixF;\n FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\n FxaaFloat subpixH = subpixG * fxaaQualitySubpix;\n /*--------------------------------------------------------------------------*/\n FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\n FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\n if (!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\n if (horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\n #if (FXAA_DISCARD == 1)\n return FxaaTexTop(tex, posM);\n #else\n return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n #endif\n}\n/*==========================================================================*/\n#endif\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec2 screenInfo = get_screenInfo(materialSID, 0);\n rt0 = FxaaPixelShader(\n v_texcoord_0,\n vec4(0.0),\n u_baseColorTexture,\n u_baseColorTexture,\n u_baseColorTexture,\n 1.0 / screenInfo,\n vec4(0.0),\n vec4(0.0),\n vec4(0.0),\n 0.75,\n 0.166,\n 0.0833,\n 0.0,\n 0.0,\n 0.0,\n vec4(0.0)\n );\n rt0.a = 1.0;\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},B={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nout vec2 v_texcoord_0;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\nv_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},N={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec2 v_texcoord_0;\n\nuniform sampler2D u_baseColorTexture; // initialValue=(0,white)\nuniform bool u_enableLinearToSrgb; // initialValue=true\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nvec4 baseColor = texture(u_baseColorTexture, v_texcoord_0);\n\nif (get_enableLinearToSrgb(materialSID, 0)) {\n baseColor.rgb = linearToSrgb(baseColor.rgb);\n}\n\nrt0 = baseColor;\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},O={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nout vec2 v_texcoord_0;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\nv_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},L={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec2 v_texcoord_0;\n\nuniform sampler2DRect u_baseColorTexture; // initialValue=(0,white)\nuniform float u_count; // initialValue=0.0\nuniform float u_direction; // initialValue=0.0\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nfloat i = get_count(materialSID, 0);\nfloat dir = get_direction(materialSID, 0);\n\nrt0 = texture(u_baseColorTexture, gl_FragCoord.xy);\n\nif (dir > 0.0) {\n // horizontal\n rt0 += texture(u_baseColorTexture, vec2(gl_FragCoord.x + pow(2.0, i), gl_FragCoord.y));\n} else {\n // virtical\n rt0 += texture(u_baseColorTexture, vec2(gl_FragCoord.x, gl_FragCoord.y + pow(2.0, i)));\n}\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},F={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec3 v_baryCentricCoord;\n\nuniform float u_pointSize; // initialValue=30\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0,0.1,0.01)\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n\n v_color = a_color;\n v_normal_inWorld = normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},G={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec3 v_baryCentricCoord;\n\nuniform int u_shadingModel; // initialValue=0\nuniform float u_alphaCutoff; // initialValue=0.01\nuniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)\nuniform sampler2D u_diffuseColorTexture; // initialValue=(0,white)\nuniform sampler2D u_normalTexture; // initialValue=(1,blue)\nuniform vec4 u_diffuseColorTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_diffuseColorTextureRotation; // initialValue=0\n\n/* shaderity: @{renderTargetBegin} */\n\n\n\nvec2 uvTransform(vec2 scale, vec2 offset, float rotation, vec2 uv) {\n mat3 translationMat = mat3(1,0,0, 0,1,0, offset.x, offset.y, 1);\n mat3 rotationMat = mat3(\n cos(rotation), -sin(rotation), 0,\n sin(rotation), cos(rotation), 0,\n 0, 0, 1\n );\n mat3 scaleMat = mat3(scale.x,0,0, 0,scale.y,0, 0,0,1);\n\n mat3 matrix = translationMat * rotationMat * scaleMat;\n vec2 uvTransformed = ( matrix * vec3(uv.xy, 1) ).xy;\n\n return uvTransformed;\n}\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n\n\n // diffuseColor (Considered to be premultiplied alpha)\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture (Considered to be premultiplied alpha)\n vec4 diffuseColorTextureTransform = get_diffuseColorTextureTransform(materialSID, 0);\n float diffuseColorTextureRotation = get_diffuseColorTextureRotation(materialSID, 0);\n vec2 diffuseColorTexUv = uvTransform(diffuseColorTextureTransform.xy, diffuseColorTextureTransform.zw, diffuseColorTextureRotation, v_texcoord_0);\n vec4 textureColor = texture(u_diffuseColorTexture, diffuseColorTexUv);\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n\n// #pragma shaderity: require(../common/alphaMask.glsl)\n\n // rt0 = vec4(diffuseColor * alpha, alpha);\n rt0 = vec4(1.0, 0.0, 0.0, 1.0);\n\n// #pragma shaderity: require(../common/setAlphaIfNotInAlphaBlendMode.glsl)\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n\n",shaderStage:"fragment",isFragmentShader:!0},V={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec2 a_texcoord_1;\nin vec2 a_texcoord_2;\nin vec4 a_joint;\nin vec4 a_weight;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\nuniform float u_pointSize; // initialValue=30, soloDatum=true\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0.0, 0.1, 0.01), soloDatum=true\n\n#ifdef RN_IS_MORPHING\nuniform int u_morphTargetNumber; // initialValue=0, isCustomSetting=true, soloDatum=true, needUniformInDataTextureMode=true\n#endif\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n v_color = a_color;\n\n bool isSkinning = false;\n\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n\n",shaderStage:"vertex",isFragmentShader:!1},z={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\n\nvoid main (){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float depth = gl_FragCoord.z;\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n\n rt0.x = depth; // M1\n rt0.y = sq(depth) + 0.25 * (sq(dx) + sq(dy)); // M2\n rt0.z = 0.0;\n rt0.w = 1.0;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n\n",shaderStage:"fragment",isFragmentShader:!0};var k=n(678),U=n(2603);function Q(e,t,n){var r=0,o=!1;do{var i=e+"__".concat(r);if(!(o=U.r.isFullOrOverOfThisMaterialType(i)))return U.r.registerMaterial(i,t,n),U.r.createMaterial(i,t);r++}while(o);return U.r.isRegisteredMaterialType(e)||U.r.registerMaterial(e,t,n),U.r.createMaterial(e,t)}function j(e,t,n){return U.r.forceRegisterMaterial(e,t,n),U.r.createMaterial(e,t)}var W=Object.freeze({createMaterial:Q,recreateMaterial:j,recreateCustomMaterial:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.additionalName,i=void 0===o?"":o,a=n.isSkinning,s=void 0===a||a,c=n.isLighting,u=void 0!==c&&c,f=n.isMorphing,_=void 0!==f&&f,h=n.maxInstancesNumber,d=void 0===h?r.D.maxMaterialInstanceForEachType:h,m="Custom"+"_".concat(i,"_")+(_?"+morphing":"")+(s?"+skinning":"")+(u?"":"-lighting"),v=new l.f({name:m,isSkinning:s,isLighting:u,isMorphing:_,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:{code:e,shaderStage:"vertex",isFragmentShader:!1},pixelShader:{code:t,shaderStage:"fragment",isFragmentShader:!0},noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});v.isSingleOperation=!0;var p=j(m,v,d);return p},recreateShaderityMaterial:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.additionalName,i=void 0===o?"":o,a=n.maxInstancesNumber,s=void 0===a?r.D.maxMaterialInstanceForEachType:a,c="Shaderity_".concat(i),l=new A.u({name:c,vertexShaderityObj:e,pixelShaderityObj:t});l.isSingleOperation=!0;var u=j(c,l,s);return u},createEmptyMaterial:function(){var e=Q("Empty",void 0,r.D.maxMaterialInstanceForEachType);return e.tryToSetUniqueName("EmptyMaterial",!0),e},createClassicUberMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,o=e.isSkinning,i=void 0===o||o,a=e.isLighting,s=void 0!==a&&a,c=e.isMorphing,u=void 0!==c&&c,f=e.isShadow,_=void 0!==f&&f,h=e.maxInstancesNumber,d=void 0===h?r.D.maxMaterialInstanceForEachType:h,m="ClassicUber"+"_".concat(n,"_")+(i?"+skinning":"")+(s?"":"-lighting"),v=new l.f({name:"ClassicUber",isSkinning:i,isLighting:s,isMorphing:u,isShadow:_,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:w,pixelShader:S,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});v.isSingleOperation=!0;var p=Q(m,v,d);return p},createDepthMomentEncodeMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,o=e.isSkinning,i=void 0===o||o,a=e.isMorphing,s=void 0!==a&&a,c=e.maxInstancesNumber,u=void 0===c?r.D.maxMaterialInstanceForEachType:c,f="DepthMomentEncode"+"_".concat(n,"_"),_=new l.f({name:"DepthMomentEncode",isSkinning:i,isLighting:!1,isMorphing:s,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:V,pixelShader:z,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});_.isSingleOperation=!0;var h=Q(f,_,u);return h},createFlatMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,o=e.isSkinning,i=void 0===o||o,a=e.isMorphing,s=void 0!==a&&a,c=e.maxInstancesNumber,u=void 0===c?r.D.maxMaterialInstanceForEachType:c,f="Flat"+"_".concat(n,"_")+(i?"+skinning":""),_=new l.f({name:"Flat",isSkinning:i,isLighting:!1,isMorphing:s,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:F,pixelShader:G,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});_.isSingleOperation=!0;var h=Q(f,_,u);return h},createPbrUberMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,i=e.isMorphing,a=void 0===i||i,s=e.isSkinning,c=void 0===s||s,u=e.isLighting,f=void 0===u||u,_=e.isClearCoat,h=void 0!==_&&_,d=e.isTransmission,m=void 0!==d&&d,v=e.isVolume,p=void 0!==v&&v,y=e.isSheen,A=void 0!==y&&y,w=e.isSpecular,S=void 0!==w&&w,P=e.isIridescence,R=void 0!==P&&P,D=e.isShadow,M=void 0!==D&&D,B=e.useTangentAttribute,N=void 0!==B&&B,O=e.useNormalTexture,L=void 0===O||O,F=e.maxInstancesNumber,G=void 0===F?r.D.maxMaterialInstanceForEachType:F,V="PbrUber"+"_".concat(n,"_")+(a?"+morphing":"")+(c?"+skinning":"")+(f?"":"-lighting")+(h?"+clearcoat":"")+(m?"+transmission":"")+(p?"+volume":"")+(A?"+sheen":"")+(S?"+specular":"")+(R?"+iridescence":"")+(N?"+tangentAttribute":"")+(L?"":"-normalTexture"),z=[];a&&(z=[{semantic:b.f5.DataTextureMorphOffsetPosition,componentType:g.r.Int,compositionType:x.d.ScalarArray,arrayLength:r.D.maxVertexMorphNumberInShader,stage:I.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new E.j(new Int32Array(r.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:b.f5.MorphWeights,componentType:g.r.Float,compositionType:x.d.ScalarArray,arrayLength:r.D.maxVertexMorphNumberInShader,stage:I.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new E.j(new Float32Array(r.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0}]);var U=8;h&&(z.push({semantic:b.f5.ClearCoatTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.dummyWhiteTexture],min:0,max:Number.MAX_VALUE}),z.push({semantic:b.f5.ClearCoatRoughnessTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.dummyWhiteTexture],min:0,max:Number.MAX_VALUE}),z.push({semantic:b.f5.ClearCoatNormalTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.dummyBlueTexture],min:0,max:Number.MAX_VALUE})),m&&(z.push({semantic:b.f5.TransmissionTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.dummyWhiteTexture],min:0,max:Number.MAX_VALUE}),z.push({semantic:b.f5.BackBufferTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.dummyBlackTexture],min:0,max:Number.MAX_VALUE})),p&&z.push({semantic:b.f5.ThicknessTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.dummyWhiteTexture],min:0,max:Number.MAX_VALUE}),A&&(z.push({semantic:b.f5.SheenColorTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,soloDatum:!1,initialValue:[U++,o.P.dummyWhiteTexture],min:0,max:Number.MAX_VALUE}),z.push({semantic:b.f5.SheenRoughnessTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.dummyWhiteTexture],min:0,max:Number.MAX_VALUE}),z.push({semantic:b.f5.SheenLutTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.__sheenLutTextureUid],min:0,max:Number.MAX_VALUE})),S&&(z.push({semantic:b.f5.SpecularTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.dummyWhiteTexture],min:0,max:Number.MAX_VALUE}),z.push({semantic:b.f5.SpecularColorTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.dummyWhiteTexture],min:0,max:Number.MAX_VALUE})),R&&(z.push({semantic:b.f5.IridescenceTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.dummyWhiteTexture],min:0,max:Number.MAX_VALUE}),z.push({semantic:b.f5.IridescenceThicknessTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.dummyWhiteTexture],min:0,max:Number.MAX_VALUE})),M&&z.push({semantic:b.f5.DepthTexture,componentType:g.r.Int,compositionType:x.d.Texture2D,stage:I.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[U++,o.P.dummyWhiteTexture],min:0,max:Number.MAX_VALUE});var j=new l.f({name:"PbrUber",isSkinning:c,isLighting:f,isMorphing:a,isClearCoat:h,isTransmission:m,isVolume:p,isSheen:A,isSpecular:S,isIridescence:R,isShadow:M,useTangentAttribute:N,useNormalTexture:L,vertexShader:T,pixelShader:C,noUseCameraTransform:!1,additionalShaderSemanticInfo:z});j.isSingleOperation=!0;var W=Q(V,j,G);return W},createEnvConstantMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,r=e.maxInstancesNumber,o=void 0===r?5:r,i=e.makeOutputSrgb,a=void 0===i||i,s="EnvConstant"+"_".concat(n),c=new l.f({name:s,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!1,vertexShader:P.Z,pixelShader:R.Z,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});c.isSingleOperation=!0;var u=Q(s,c,o);return u.setParameter(b.f5.MakeOutputSrgb,a?1:0),u},createFXAA3QualityMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,r=e.maxInstancesNumber,o=void 0===r?1:r,i=e.noUseCameraTransform,a=void 0!==i&&i,s="FXAA3Quality"+"_".concat(n),c=new l.f({name:s,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:D,pixelShader:M,noUseCameraTransform:a,additionalShaderSemanticInfo:[]});c.isSingleOperation=!0;var u=Q(s,c,o);return u},createDepthEncodeMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,r=e.isSkinning,o=void 0!==r&&r,a=e.depthPow,s=void 0===a?1:a,c=e.maxInstancesNumber,l=void 0===c?10:c,u="DepthEncode"+"_".concat(n,"_")+(o?"+skinning":""),f=new i.Q(s,{isSkinning:o});f.isSingleOperation=!0;var _=Q(u,f,l);return _},createShadowMapDecodeClassicSingleMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,r=e.isMorphing,o=void 0!==r&&r,i=e.isSkinning,s=void 0!==i&&i,c=e.isLighting,l=void 0===c||c,u=e.isDebugging,f=void 0!==u&&u,_=e.colorAttachmentsNumber,h=void 0===_?0:_,d=e.maxInstancesNumber,m=void 0===d?20:d,v=arguments.length>1?arguments[1]:void 0,p="ShadowMapDecodeClassic"+"_".concat(n,"_")+(s?"+skinning":"")+(l?"":"-lighting"),y=new a.R({isMorphing:o,isSkinning:s,isLighting:l,isDebugging:f,colorAttachmentsNumber:h},v);y.isSingleOperation=!0;var A=Q(p,y,m);return A},createGammaCorrectionMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,r=e.maxInstancesNumber,o=void 0===r?1:r,i=e.noUseCameraTransform,a=void 0!==i&&i,s="GammaCorrection"+"_".concat(n),c=new l.f({name:s,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:B,pixelShader:N,noUseCameraTransform:a,additionalShaderSemanticInfo:[]});c.isSingleOperation=!0;var u=Q(s,c,o);return u},createSummedAreaTableMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,r=e.maxInstancesNumber,o=void 0===r?1:r,i=e.noUseCameraTransform,a=void 0!==i&&i,s="SummedAreaTable"+"_".concat(n),c=new l.f({name:s,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:O,pixelShader:L,noUseCameraTransform:a,additionalShaderSemanticInfo:[]});c.isSingleOperation=!0;var u=Q(s,c,o);return u},createVarianceShadowMapDecodeClassicSingleMaterial:function(e,t){var n=e.additionalName,r=void 0===n?"":n,o=e.isMorphing,i=void 0!==o&&o,a=e.isSkinning,s=void 0!==a&&a,c=e.isDebugging,l=void 0!==c&&c,u=e.isLighting,f=void 0===u||u,_=e.colorAttachmentsNumberDepth,h=void 0===_?0:_,d=e.colorAttachmentsNumberSquareDepth,m=void 0===d?0:d,v=e.depthCameraComponent,p=void 0===v?void 0:v,A=e.maxInstancesNumber,b=void 0===A?10:A,g="VarianceShadowMapDecodeShading"+"_".concat(r,"_")+(i?"+morphing":"")+(s?"+skinning":"")+(f?"":"-lighting")+(l?"":"+debugging"),x=new y.Q({isMorphing:i,isSkinning:s,isLighting:f,isDebugging:l,colorAttachmentsNumberDepth:h,colorAttachmentsNumberSquareDepth:m,depthCameraComponent:p},t);return x.isSingleOperation=!0,Q(g,x,b)},createEntityUIDOutputMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,r=e.maxInstancesNumber,o=void 0===r?10:r,i="EntityUIDOutput"+"_".concat(n),a=new s.z;a.isSingleOperation=!0;var c=Q(i,a,o);return c},createMToonMaterial:function(e){var t=e.additionalName,n=void 0===t?"":t,o=e.isMorphing,i=void 0!==o&&o,a=e.isSkinning,s=void 0!==a&&a,l=e.isLighting,u=void 0===l||l,f=e.useTangentAttribute,_=void 0!==f&&f,h=e.isOutline,d=void 0!==h&&h,m=e.materialProperties,v=e.textures,p=e.debugMode,y=e.maxInstancesNumber,A=void 0===y?r.D.maxMaterialInstanceForEachType:y,b=e.makeOutputSrgb,g=void 0===b||b,x="MToon"+"_".concat(n,"_")+(i?"+morphing":"")+(s?"+skinning":"")+(u?"":"-lighting")+(_?"+tangentAttribute":"")+(d?"-outline":""),I=new c.f(d,m,v,i,s,u,_,p,g);I.isSingleOperation=!0;var E=Q(x,I,A);return I.setMaterialParameters(E,d),E},createFurnaceTestMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,r=e.maxInstancesNumber,o=void 0===r?1:r,i="FurnaceTest"+"_".concat(n),a=new f.b;a.isSingleOperation=!0;var s=Q(i,a,o);return s},createGaussianBlurForEncodedDepthMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,r=e.maxInstancesNumber,o=void 0===r?10:r,i="GaussianBlurForEncodedDepth"+"_".concat(n),a=new _._;a.isSingleOperation=!0;var s=Q(i,a,o);return s},createDetectHighLuminanceMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,r=e.colorAttachmentsNumber,o=void 0===r?0:r,i=e.maxInstancesNumber,a=void 0===i?5:i,s=arguments.length>1?arguments[1]:void 0,c="DetectHighLuminance"+"_".concat(n,"_"),l=new d.t(s,o);l.isSingleOperation=!0;var u=Q(c,l,a);return u},createGaussianBlurMaterial:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.additionalName,n=void 0===t?"":t,r=e.maxInstancesNumber,o=void 0===r?10:r,i="GaussianBlur"+"_".concat(n),a=new h.W;a.isSingleOperation=!0;var s=Q(i,a,o);return s},createSynthesizeHDRMaterial:function(e,t){var n=e.additionalName,r=void 0===n?"":n,o=e.targetRegionTexture,i=e.maxInstancesNumber,a=void 0===i?1:i,s="SynthesizeHDR"+"_".concat(r),c=new m.d(t,o);return c.isSingleOperation=!0,Q(s,c,a)},createColorGradingUsingLUTsMaterial:function(e,t){var n=e.additionalName,r=void 0===n?"":n,o=e.colorAttachmentsNumber,i=void 0===o?0:o,a=e.uri,s=e.texture,c=e.maxInstancesNumber,l=void 0===c?1:c,u="ColorGradingUsingLUTs"+"_".concat(r),f=new v.h(t,i,a,s);return f.isSingleOperation=!0,Q(u,f,l)},createMatCapMaterial:function(e){var t=e.additionalName,n=void 0===t?"":t,r=e.isSkinning,o=void 0!==r&&r,i=e.uri,a=e.texture,s=e.maxInstancesNumber,c=void 0===s?10:s,l="MatCap"+"_".concat(n)+(o?"+skinning":""),u=new p.S(o,i,a);return u.isSingleOperation=!0,Q(l,u,c)},changeMaterial:function(e,t,n){var r=e.getMeshRenderer();t.material=n,r.moveStageTo(u.I.Load)}})},5936:(e,t,n)=>{n.d(t,{Z:()=>f});var r=n(5479),o=n(3363),i=n(9197),a=n(1274),s=n(3116);function c(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,s,"next",e)}function s(e){c(i,r,o,a,s,"throw",e)}a(void 0)}))}}var u=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=0){var F=e.accessors[L];F.extras={toGetAsTypedArray:!0,attributeName:O},N[O]=F}}d.targetsObjects.push(N)}}catch(e){P=!0,R=e}finally{try{C||null==M.return||M.return()}finally{if(P)throw R}}}}}catch(e){l=!0,u=e}finally{try{c||null==_.return||_.return()}finally{if(l)throw u}}}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}}},e._checkRnGltfLoaderOptionsExist=function(e){return!(!e.asset.extras||!e.asset.extras.rnLoaderOptions)},e._loadDependenciesOfMaterials=function(e){if(e.textures||(e.textures=[]),e.materials){var t=!0,n=!1,r=void 0;try{for(var o,a=e.materials[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var s=o.value;if(s.pbrMetallicRoughness){var c=s.pbrMetallicRoughness.baseColorTexture;void 0!==c&&(c.texture=e.textures[c.index]);var l=s.pbrMetallicRoughness.metallicRoughnessTexture;void 0!==l&&(l.texture=e.textures[l.index])}var u=s.normalTexture;void 0!==u&&(u.texture=e.textures[u.index]);var f=s.occlusionTexture;void 0!==f&&(f.texture=e.textures[f.index]);var _=s.emissiveTexture;if(void 0!==_&&(_.texture=e.textures[_.index]),this._checkRnGltfLoaderOptionsExist(e)&&e.asset.extras.rnLoaderOptions.loaderExtension&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures(e,s),i.Is.exist(s.extensions)){var h=s.extensions;if(i.Is.exist(h.KHR_materials_clearcoat)){var d=h.KHR_materials_clearcoat.clearcoatTexture;void 0!==d&&(d.texture=e.textures[d.index]);var m=h.KHR_materials_clearcoat.clearcoatRoughnessTexture;void 0!==m&&(m.texture=e.textures[m.index]);var v=h.KHR_materials_clearcoat.clearcoatNormalTexture;void 0!==v&&(v.texture=e.textures[v.index])}if(i.Is.exist(h.KHR_materials_transmission)){var p=h.KHR_materials_transmission.transmissionTexture;void 0!==p&&(p.texture=e.textures[p.index])}if(i.Is.exist(h.KHR_materials_volume)){var y=h.KHR_materials_volume.thicknessTexture;void 0!==y&&(y.texture=e.textures[y.index])}if(i.Is.exist(h.KHR_materials_sheen)){var A=h.KHR_materials_sheen.sheenColorTexture;void 0!==A&&(A.texture=e.textures[A.index]);var b=h.KHR_materials_sheen.sheenRoughnessTexture;void 0!==b&&(b.texture=e.textures[b.index])}if(i.Is.exist(h.KHR_materials_specular)){var g=h.KHR_materials_specular.specularTexture;void 0!==g&&(g.texture=e.textures[g.index]);var x=h.KHR_materials_specular.specularColorTexture;void 0!==x&&(x.texture=e.textures[x.index])}if(i.Is.exist(h.KHR_materials_iridescence)){var I=h.KHR_materials_iridescence.iridescenceTexture;void 0!==I&&(I.texture=e.textures[I.index]);var E=h.KHR_materials_iridescence.iridescenceThicknessTexture;void 0!==E&&(E.texture=e.textures[E.index])}}}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}}},e._loadDependenciesOfTextures=function(e){if(e.textures){var t=!0,n=!1,r=void 0;try{for(var o,i=function(){var t,n,r=o.value;(0,a.Jx)((function(t){return r.samplerObject=e.samplers[t]}),r.sampler),null!=(null===(t=r.extensions)||void 0===t||null===(n=t.KHR_texture_basisu)||void 0===n?void 0:n.source)?(r.extensions.KHR_texture_basisu.fallbackSourceIndex=r.source,r.source=r.extensions.KHR_texture_basisu.source,r.image=e.images[r.source]):void 0!==r.source&&(r.image=e.images[r.source])},s=e.textures[Symbol.iterator]();!(t=(o=s.next()).done);t=!0)i()}catch(e){n=!0,r=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw r}}}},e._loadDependenciesOfJoints=function(e){if(e.skins){var t=!0,n=!1,r=void 0;try{for(var o,a=e.skins[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var s=o.value;s.skeletonObject=e.nodes[s.skeleton],s.inverseBindMatricesObject=e.accessors[s.inverseBindMatrices],i.Is.not.exist(s.skeleton)&&(s.skeleton=s.joints[0],s.skeletonObject=e.nodes[s.skeleton]),s.jointsObjects=[];var c=!0,l=!1,u=void 0;try{for(var f,_=s.joints[Symbol.iterator]();!(c=(f=_.next()).done);c=!0){var h=f.value;s.jointsObjects.push(e.nodes[h])}}catch(e){l=!0,u=e}finally{try{c||null==_.return||_.return()}finally{if(l)throw u}}}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}}},e._loadDependenciesOfAnimations=function(e){if(e.animations){var t=!0,n=!1,r=void 0;try{for(var o,a=e.animations[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var s=o.value,c=!0,l=!1,u=void 0;try{for(var f,_=s.channels[Symbol.iterator]();!(c=(f=_.next()).done);c=!0){var h=f.value;if(i.Is.exist(h.sampler)){if(h.samplerObject=s.samplers[h.sampler],h.target.nodeObject=e.nodes[h.target.node],h.samplerObject.inputObject=e.accessors[h.samplerObject.input],h.samplerObject.outputObject=e.accessors[h.samplerObject.output],i.Is.undefined(h.samplerObject.outputObject.extras)&&(h.samplerObject.outputObject.extras={}),"weights"===h.target.path){var d=h.samplerObject.outputObject.count/h.samplerObject.inputObject.count;"CUBICSPLINE"===h.samplerObject.interpolation&&(d=h.samplerObject.outputObject.count/h.samplerObject.inputObject.count/3),h.samplerObject.outputObject.extras.weightsArrayLength=d}"rotation"===h.target.path&&(h.samplerObject.outputObject.extras.quaternionIfVec4=!0)}}}catch(e){l=!0,u=e}finally{try{c||null==_.return||_.return()}finally{if(l)throw u}}}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}}},e._loadDependenciesOfAccessors=function(e){var t=!0,n=!1,r=void 0;try{for(var o,a=e.accessors[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var s=o.value;if(null==s.bufferView&&(s.bufferView=0),s.bufferViewObject=e.bufferViews[s.bufferView],i.Is.exist(s.sparse)){var c=s.sparse;i.Is.exist(c)&&i.Is.exist(c.indices)&&i.Is.exist(c.values)&&(c.indices.bufferViewObject=e.bufferViews[c.indices.bufferView],c.values.bufferViewObject=e.bufferViews[c.values.bufferView])}}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}},e._loadDependenciesOfBufferViews=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e.bufferViews[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;void 0!==a.buffer&&(a.bufferObject=e.buffers[a.buffer])}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}},e._mergeExtendedJson=function(e,t){var n,o,i=null;if(n=t,null!=(o=ArrayBuffer)&&"undefined"!=typeof Symbol&&o[Symbol.hasInstance]?o[Symbol.hasInstance](n):n instanceof o){var a=r.j.arrayBufferToString(t);i=JSON.parse(a)}else"string"==typeof t?i=JSON.parse(t):"object"==typeof t&&(i=t);Object.assign(e,i)},e._loadResources=function(e,t,n,a,s,c){var l,u,f=this,_=[],h=!0,d=!1,m=void 0;try{for(var v,p=this,y=function(){var t=v.value,i="";if(t.uri){var a=t.uri.split("/");i=a[a.length-1]}l=void 0===t.uri?new o.n((function(n){t.buffer=e,n(e)})):t.uri.match(/^data:application\/(.*);base64,/)?new o.n((function(e){var n=r.j.dataUriToArrayBuffer(t.uri);t.buffer=new Uint8Array(n),e(n)})):n&&p.__containsFileName(n,i)?new o.n((function(e){var r=f.__getFullPathOfFileName(n,i),o=n[r];t.buffer=new Uint8Array(o),e(o)})):new o.n(r.j.loadResourceAsync(s+t.uri,!0,(function(e,n){t.buffer=new Uint8Array(n),e(n)}),(function(e,t){e("HTTP Error Status:"+t)}))),t.bufferPromise=l,_.push(l)},A=t.buffers[Symbol.iterator]();!(h=(v=A.next()).done);h=!0)y()}catch(e){d=!0,m=e}finally{try{h||null==A.return||A.return()}finally{if(d)throw m}}var b=!0,g=!1,x=void 0;try{for(var I,E=this,w=function(){var a=I.value;if(null==a.uri)if(i.Is.exist(e)){var c=r.j.createUint8ArrayFromBufferViewInfo(t,a.bufferView,e),l=r.j.createBlobImageUriFromUint8Array(c,a.mimeType);_.push(E.__loadImageUri(l,a,n))}else{var u=t.bufferViews[a.bufferView].bufferObject;if(i.Is.not.exist(u))return console.error("gltf2BufferView.bufferObject not found"),"continue";var h=u.bufferPromise,d=new o.n((function(e){h.then((function(o){var i=r.j.createUint8ArrayFromBufferViewInfo(t,a.bufferView,o),s=r.j.createBlobImageUriFromUint8Array(i,a.mimeType);f.__loadImageUri(s,a,n).then((function(){e(o)}))}))})),m=_.indexOf(h);_[m]=d,u.bufferPromise=d}else{var v=a.uri,p=v.split("/"),y=p[p.length-1],A=void 0;if(n&&E.__containsFileName(n,y)){var b=E.__getFullPathOfFileName(n,y),g=n[b];A=r.j.createBlobImageUriFromUint8Array(new Uint8Array(g),a.mimeType)}else A=v.match(/^data:/)?v:s+v;_.push(E.__loadImageUri(A,a,n))}},S=(null!==(u=t.images)&&void 0!==u?u:[])[Symbol.iterator]();!(b=(I=S.next()).done);b=!0)w()}catch(e){g=!0,x=e}finally{try{b||null==S.return||S.return()}finally{if(g)throw x}}if(a.defaultTextures){var T=a.defaultTextures.basePath,C=a.defaultTextures.textureInfos,P=!0,R=!1,D=void 0;try{for(var M,B=function(){var e=M.value,t=e.fileName,n=T+t,o=r.j.getExtension(t),i=r.j.getMimeTypeFromExtension(o),a=r.j.createImageFromUri(n,i).then((function(t){return t.crossOrigin="Anonymous",e.image={image:t},e.image}));_.push(a)},N=C[Symbol.iterator]();!(P=(M=N.next()).done);P=!0)B()}catch(e){R=!0,D=e}finally{try{P||null==N.return||N.return()}finally{if(R)throw D}}}return o.n.all(_,c).catch((function(e){console.log("Promise.all error",e)}))},e.__containsFileName=function(e,t){for(var n in e){var r=n.split("/");if(r[r.length-1]===t)return!0}return!1},e.__getFullPathOfFileName=function(e,t){for(var n in e){var r=n.split("/");if(r[r.length-1]===t)return n}},e.__loadImageUri=function(e,t,n){var i,a;return e.match(/basis$/)?new o.n((function(n){fetch(e,{mode:"cors"}).then((function(e){e.arrayBuffer().then((function(e){var r=new Uint8Array(e);t.basis=r,n(t)}))}))})):(null===(i=t.uri)||void 0===i?void 0:i.match(/basis$/))?new o.n((function(e){t.basis=new Uint8Array(n[t.uri]),e(t)})):e.match(/\.ktx2$/)||e.match(/^data:image\/ktx2/)||null!=t.bufferView&&"image/ktx2"===t.mimeType?new o.n((function(n){fetch(e,{mode:"cors"}).then((function(e){e.arrayBuffer().then((function(e){var r=new Uint8Array(e);t.ktx2=r,n(t)}))}))})):(null===(a=t.uri)||void 0===a?void 0:a.match(/ktx2$/))?new o.n((function(e){t.ktx2=new Uint8Array(n[t.uri]),e(t)})):r.j.createImageFromUri(e,t.mimeType).then((function(e){return e.crossOrigin="Anonymous",t.image=e,t}))},e}()},9645:(e,t,n)=>{n.d(t,{e:()=>W});var r=n(2342),o=n(9856),i=n(6860),a=n(5233),s=n(7468),c=n(8118),l=n(5527),u=n(361),f=n(3932),_=n(2535),h=n(6221),d=n(2637),m=n(9294),v=n(6264),p=n(5054),y=n(9611),A=n(4969),b=n(1625),g=n(3650),x=n(6382),I=n(7416),E=n(8020),w=n(7364),S=n(6601),T=n(2328),C=n(9805),P=n(9977),R=n(5171),D=n(4395),M=n(1811),B=n(7102),N=n(4021),O=n(9197),L=n(5479),F=n(3884),G=n(524),V=n(9958),z=n(4654),k=n(4398),U=n(7302),Q=n(8289);function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var v=!0,A=!1,b=void 0;try{for(var g,x=e.animations[Symbol.iterator]();!(v=(g=x.next()).done);v=!0){var I=g.value,E=!0,w=!1,S=void 0;try{for(var T,C=I.channels[Symbol.iterator]();!(E=(T=C.next()).done);E=!0){var P=T.value;if(O.Is.exist(P.samplerObject)){var R,D,M=P.samplerObject.inputObject.extras.typedDataArray,B=P.samplerObject.outputObject.extras.typedDataArray,N=null!==(R=P.samplerObject.interpolation)&&void 0!==R?R:"LINEAR";D="translation"===P.target.path?"translate":"rotation"===P.target.path?"quaternion":P.target.path;var L=t[P.target.node];if(O.Is.exist(L)){var F=L.tryToGetAnimation();if(O.Is.not.exist(F)&&(F=r.g.addComponentToEntity(p.c,L).getAnimation()),O.Is.exist(F)){var G=P.samplerObject.outputObject.extras.componentN;F.setAnimation(O.Is.exist(I.name)?I.name:"Untitled_Animation",D,M,B,G,y.k.fromString(N))}}}}}catch(e){w=!0,S=e}finally{try{E||null==C.return||C.return()}finally{if(w)throw S}}}}catch(e){A=!0,b=e}finally{try{v||null==x.return||x.return()}finally{if(A)throw b}}}},e._setupSkeleton=function(e,t,n){if(null!=e.skins)for(var o in e.nodes){var i=e.nodes[o],a=t[o].getSceneGraph(),c=void 0;if(O.Is.exist(i.skinObject)){var l=t[o];if(c=r.g.addComponentToEntity(b.Y,l).getSkeletal(),O.Is.exist(i.skinObject.bindShapeMatrix)&&(c._bindShapeMatrix=s.J.fromCopyArrayColumnMajor(i.skinObject.bindShapeMatrix)),O.Is.exist(i.skinObject.skeleton)&&(a.isRootJoint=!0,O.Is.exist(i.mesh))){var u=[],f=!0,_=!1,h=void 0;try{for(var d,m=i.skinObject.joints[Symbol.iterator]();!(f=(d=m.next()).done);f=!0){var v=d.value;u.push(t[v].getSceneGraph())}}catch(e){_=!0,h=e}finally{try{f||null==m.return||m.return()}finally{if(_)throw h}}c.setJoints(u),O.Is.exist(i.skinObject.skeleton)?c.topOfJointsHierarchy=t[i.skinObject.skeleton].getSceneGraph():c.topOfJointsHierarchy=u[0]}var p=!0,y=!1,A=void 0;try{for(var g,x=i.skinObject.joints[Symbol.iterator]();!(p=(g=x.next()).done);p=!0){var I=g.value;t[I].getSceneGraph().jointIndex=I}}catch(e){y=!0,A=e}finally{try{p||null==x.return||x.return()}finally{if(y)throw A}}var E=i.skinObject.inverseBindMatricesObject;if(O.Is.exist(E)){var w=this.__getRnBufferViewAndRnAccessor(E,n[E.bufferViewObject.buffer]);c.setInverseBindMatricesAccessor(w)}}}},e.__setupObjects=function(e,t){var n=[],i=new Map;for(var a in e.nodes){var s,c=e.nodes[parseInt(a)],l=void 0;if(null!=c.mesh){var u,f=c.mesh,_=this.__setupMesh(c,c.meshObject,f,t,e);c.name&&_.tryToSetUniqueName(c.name,!0),(null===(u=c.meshObject)||void 0===u?void 0:u.name)&&_.getComponent(o.$).tryToSetUniqueName(c.meshObject.name,!0),l=_}else if(null!=c.cameraObject){var h=this.__setupCamera(c.cameraObject,e);c.name&&h.tryToSetUniqueName(c.name,!0),l=h}else if(null===(s=c.extensions)||void 0===s?void 0:s.KHR_lights_punctual)l=this.__setupLight(c.extensions.KHR_lights_punctual.light,e);else{var d=this.__generateGroupEntity(e);c.name&&d.tryToSetUniqueName(c.name,!0),l=d}if(this.__isMorphing(c,e)){var m,v,p,y=[];if(c.weights)y=c.weights;else if(null===(m=c.meshObject)||void 0===m?void 0:m.weights)y=c.meshObject.weights;else{var A=0,b=!0,g=!1,x=void 0;try{for(var I,E=c.meshObject.primitives[Symbol.iterator]();!(b=(I=E.next()).done);b=!0){var w=I.value;O.Is.exist(w.targets)&&w.targets.length>A&&(A=w.targets.length)}}catch(e){g=!0,x=e}finally{try{b||null==E.return||E.return()}finally{if(g)throw x}}y=new Array(A).fill(0)}var S=(l=r.g.addComponentToEntity(V.x,l)).getBlendShape();S.weights=y,(null===(v=null===(p=c.meshObject)||void 0===p?void 0:p.primitives[0].extras)||void 0===v?void 0:v.targetNames)&&(S.targetNames=c.meshObject.primitives[0].extras.targetNames)}l.tryToSetTag({tag:F.j,value:a}),n.push(l),i.set(c.name,l)}return{rnEntities:n,rnEntitiesByNames:i}},e.__isMorphing=function(e,t){var n,r,o,i=null===(n=t.asset.extras)||void 0===n||null===(r=n.rnLoaderOptions)||void 0===r?void 0:r.defaultMaterialHelperArgumentArray[0];return!1!==(null==i?void 0:i.isMorphing)&&null!=(null===(o=e.meshObject)||void 0===o?void 0:o.primitives[0].targets)},e.__setupLight=function(e,t){var n=this.__generateLightEntity(t),r=n.getComponent(z.r);if(null!=e.name){r.tryToSetUniqueName(e.name,!0),r.type=C.v.fromString(e.type);var o,a,s=i.P.fromCopyArray3([1,1,1]),c=1;null!=e.color&&(s=i.P.fromCopyArray3(e.color)),null!=e.intensity&&(c=e.intensity),r.intensity=i.P.multiply(s,c),null!=e.range&&(r.range=e.range),"spot"===e.type&&(null!=(null===(o=e.spot)||void 0===o?void 0:o.innerConeAngle)&&(r.innerConeAngle=e.spot.innerConeAngle),null!=(null===(a=e.spot)||void 0===a?void 0:a.outerConeAngle)&&(r.outerConeAngle=e.spot.outerConeAngle))}return n},e.__setupCamera=function(e,t){var n=this.__generateCameraEntity(t),r=n.getCamera();return r.direction=i.P.fromCopyArray([0,0,-1]),t.asset&&t.asset.LastSaved_ApplicationVendor&&(r.direction=i.P.fromCopyArray([1,0,0]),r.directionInner=i.P.fromCopyArray([1,0,0])),r.up=i.P.fromCopyArray([0,1,0]),r.type=d.i.fromString(e.type),r.type===d.i.Perspective?(r.aspect=e.perspective.aspectRatio?e.perspective.aspectRatio:1,r.setFovyAndChangeFocalLength(A.k.radianToDegree(e.perspective.yfov)),r.zNear=e.perspective.znear,r.zFar=e.perspective.zfar?e.perspective.zfar:1e5,r.tryToSetTag({tag:"OriginalFovY",value:r.fovy})):r.type===d.i.Orthographic&&(r.xMag=e.orthographic.xmag,r.yMag=e.orthographic.ymag,r.zNear=e.orthographic.znear,r.zFar=e.orthographic.zfar,r.tryToSetTag({tag:"OriginalXMag",value:r.xMag}),r.tryToSetTag({tag:"OriginalYMag",value:r.yMag})),r.tryToSetTag({tag:"OriginalAspect",value:r.aspect}),n},e.__setupMesh=function(t,n,r,o,i){var a=this,s=this.__generateMeshEntity(i),l=i.asset.extras.rnMeshesAtGltMeshIdx[r],f=u.T.Triangles,_=s.getMesh();if(null!=l)_.setMesh(l);else{var d=new S.K,m=i.asset.extras.rnLoaderOptions;null!=(null==m?void 0:m.tangentCalculationMode)&&(d.tangentCalculationMode=m.tangentCalculationMode);var v=function(n,r){var o=a.__setupMaterial(n,t,i,r,r.materialObject);return!1===o.isEmptyMaterial()&&e.setDefaultTextures(o,i),o},p=function(n,r){var o=r.materialVariants;if(!O.Is.not.exist(o)){var s=!0,c=!1,l=void 0;try{for(var u,f=o[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var _=u.value,h=a.__setupMaterial(n,t,i,r,_.materialObject);!1===h.isEmptyMaterial()&&e.setDefaultTextures(h,i);var d=!0,m=!1,v=void 0;try{for(var p,y=_.variants[Symbol.iterator]();!(d=(p=y.next()).done);d=!0){var A=p.value;n.setMaterialVariant(A,h)}}catch(e){m=!0,v=e}finally{try{d||null==y.return||y.return()}finally{if(m)throw v}}}}catch(e){c=!0,l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}}};for(var y in n.primitives){var A,b=n.primitives[y];null!=b.mode&&(f=u.T.from(b.mode));var g=new c.W,x=v(g,b);p(g,b);var I=void 0,E=new Map;if(null===(A=b.extensions)||void 0===A?void 0:A.KHR_draco_mesh_compression){if(I=this.__decodeDraco(b,o,i,E),O.Is.not.exist(I))break}else{O.Is.exist(b.indices)&&(I=this.__getRnBufferViewAndRnAccessor(b.indicesObject,o[b.indicesObject.bufferViewObject.buffer]));var w=new Map;for(var T in b.attributesObjects){var C=b.attributesObjects[T],R=o[C.bufferViewObject.buffer],D=void 0;O.Is.exist(C.bufferView)?(D=w.get(C.bufferView),O.Is.not.exist(D)&&(D=this.__getRnBufferView(C.bufferViewObject,R),w.set(C.bufferView,D))):D=R.takeBufferView({byteLengthToNeed:0,byteStride:0}).unwrapForce();var M=this.__getRnAccessor(C,D),B=h.T.toVertexAttributeSemanticJoinedStringAsGltfStyle(h.T.fromString(C.extras.attributeName));E.set(B,M)}}if(g.setData(E,f,x,I),null!=b.targets){var N=P.D.maxMorphTargetNumber;null!=(null==m?void 0:m.maxMorphTargetNumber)&&(N=m.maxMorphTargetNumber);for(var L=[],F=0;F=N);F++){var G=b.targetsObjects[F],V=new Map;for(var z in G){var k=G[z],U=this.__getRnBufferViewAndRnAccessor(k,o[k.bufferViewObject.buffer]),Q=this.__copyRnAccessorAndBufferView(U),j=h.T.fromString(z),W=h.T.toVertexAttributeSemanticJoinedStringAsGltfStyle(j);V.set(W,Q)}L.push(V)}g.setBlendShapeTargets(L)}d.addPrimitive(g)}_.setMesh(d),i.asset.extras.rnMeshesAtGltMeshIdx[r]=d}return s},e.setSparseAccessor=function(e,t){for(var n,r,o,i,a=e.bufferViewObject.bufferObject.buffer,s=e.sparse.count,c=e.sparse.indices,l=(null!==(n=c.bufferViewObject.byteOffset)&&void 0!==n?n:0)+(null!==(r=c.byteOffset)&&void 0!==r?r:0),u=this._checkBytesPerComponent(c),f=u*s,_=new DataView(a.buffer,l+a.byteOffset,f),h=this._checkDataViewMethod(c),d=e.sparse.values,m=(null!==(o=d.bufferViewObject.byteOffset)&&void 0!==o?o:0)+(null!==(i=d.byteOffset)&&void 0!==i?i:0),v=this._checkBytesPerComponent(e),p=this._checkComponentNumber(e),y=v*p*s,A=new DataView(a.buffer,m+a.byteOffset,y),b=this._checkDataViewMethod(e),g=t.getTypedArray(),x=0;x=2){var M,B,N,L,F,G,V,z,k=null!==(z=null===(M=n.asset.extras)||void 0===M?void 0:M.rnLoaderOptions)&&void 0!==z?z:{},U=this.__useTangentAttribute(n,r),Q=this.__useNormalTexture(n),W=x.G.createPbrUberMaterial({isMorphing:A,isSkinning:b,isLighting:E,isClearCoat:O.Is.exist(null==o||null===(B=o.extensions)||void 0===B?void 0:B.KHR_materials_clearcoat),isTransmission:O.Is.exist(null==o||null===(N=o.extensions)||void 0===N?void 0:N.KHR_materials_transmission),isVolume:O.Is.exist(null==o||null===(L=o.extensions)||void 0===L?void 0:L.KHR_materials_volume),isSheen:O.Is.exist(null==o||null===(F=o.extensions)||void 0===F?void 0:F.KHR_materials_sheen),isSpecular:O.Is.exist(null==o||null===(G=o.extensions)||void 0===G?void 0:G.KHR_materials_specular),isIridescence:O.Is.exist(null==o||null===(V=o.extensions)||void 0===V?void 0:V.KHR_materials_iridescence),isShadow:!!k.shadow,useTangentAttribute:U,useNormalTexture:Q,additionalName:T,maxInstancesNumber:D}),X=this.__makeOutputSrgb(n);return O.Is.exist(X)&&W.setParameter(I.f5.MakeOutputSrgb,X),W}return x.G.createClassicUberMaterial({isSkinning:b,isLighting:E,additionalName:T,maxInstancesNumber:D})},e.__isLighting=function(e,t){var n,r,o,i,a=null==e||null===(n=e.asset)||void 0===n||null===(r=n.extras)||void 0===r||null===(o=r.rnLoaderOptions)||void 0===o?void 0:o.defaultMaterialHelperArgumentArray[0];return null!=(null==a?void 0:a.isLighting)?a.isLighting:null==(null==t||null===(i=t.extensions)||void 0===i?void 0:i.KHR_materials_unlit)},e.__isSkinning=function(e,t){var n,r,o,i=null==t||null===(n=t.asset)||void 0===n||null===(r=n.extras)||void 0===r||null===(o=r.rnLoaderOptions)||void 0===o?void 0:o.defaultMaterialHelperArgumentArray[0];return!1!==(null==i?void 0:i.isSkinning)&&null!=e.skin},e.__useTangentAttribute=function(e,t){var n,r,o;switch(null==e||null===(n=e.asset)||void 0===n||null===(r=n.extras)||void 0===r||null===(o=r.rnLoaderOptions)||void 0===o?void 0:o.tangentCalculationMode){case 0:case 3:return!1;case 1:break;case 2:case 4:return!0}for(var i in t.attributes)if("TANGENT"===i)return!0;return!1},e.__useNormalTexture=function(e){var t,n,r,o,i,a,s=null==e||null===(t=e.asset)||void 0===t||null===(n=t.extras)||void 0===n||null===(r=n.rnLoaderOptions)||void 0===r?void 0:r.defaultMaterialHelperArgumentArray[0];return!1!==(null==s?void 0:s.useNormalTexture)&&0!==(null==e||null===(o=e.asset)||void 0===o||null===(i=o.extras)||void 0===i||null===(a=i.rnLoaderOptions)||void 0===a?void 0:a.tangentCalculationMode)},e.__makeOutputSrgb=function(e){var t,n,r,o=null==e||null===(t=e.asset)||void 0===t||null===(n=t.extras)||void 0===n||null===(r=n.rnLoaderOptions)||void 0===r?void 0:r.defaultMaterialHelperArgumentArray[0];return null==o?void 0:o.makeOutputSrgb},e.__getMaterialHash=function(e,t,n,r){return n.material+"_isSkinning_"+this.__isSkinning(e,t)+"_isMorphing_"+this.__isMorphing(e,t)+"_isLighting_"+this.__isLighting(t,r)+"_useTangentAttribute_"+this.__useTangentAttribute(t,n)},e.__setupMaterial=function(t,n,r,o,a){var s,c,l=null!=(null==a||null===(s=a.extensions)||void 0===s?void 0:s.KHR_materials_unlit),u=this.__generateAppropriateMaterial(t,n,r,o,a);if(!this.__needParameterInitialization(a,u.materialTypeName))return u;var f=r.asset.extras.rnLoaderOptions,_=null==a?void 0:a.pbrMetallicRoughness;if(null!=_)X(_,u,r,f,a);else{var h,d=w.D.Phong.index;if(null==a||null===(h=a.extras)||void 0===h?void 0:h.technique){switch(a.extras.technique){case w.D.Constant.str:d=w.D.Constant.index;break;case w.D.Lambert.str:d=w.D.Lambert.index;break;case w.D.BlinnPhong.str:d=w.D.BlinnPhong.index;break;case w.D.Phong.str:d=w.D.Phong.index}u.setParameter(I.f5.ShadingModel,M.Ru.fromCopyNumber(d))}}var m=l?[0,0,0]:null==a?void 0:a.emissiveFactor;null!=m&&u.setParameter(I.f5.EmissiveFactor,i.P.fromCopyArray3(m));var p=null==a?void 0:a.emissiveTexture;if(null!=p&&O.Is.falsy(l)){var y,A=e._createTexture(p.texture,r);u.setTextureParameter(I.f5.EmissiveTexture,A),parseFloat(null===(y=r.asset)||void 0===y?void 0:y.version)>=2&&null!=p.texCoord&&u.setParameter(I.f5.EmissiveTexcoordIndex,p.texCoord),e._setupTextureTransform(p,u,I.f5.EmissiveTextureTransform,I.f5.EmissiveTextureRotation)}var b,x,E,S=null==a?void 0:a.alphaMode;(null==f?void 0:f.alphaMode)&&(S=f.alphaMode),null!=S&&(u.alphaMode=g.F.fromGlTFString(S),u.alphaMode!==g.F.Mask||(null===(b=r.asset.extras)||void 0===b||null===(x=b.rnLoaderOptions)||void 0===x?void 0:x.__isImportVRM0x)||u.setParameter(I.f5.AlphaCutoff,M.Ru.fromCopyNumber(null!==(E=null==a?void 0:a.alphaCutoff)&&void 0!==E?E:.5))),O.Is.exist(null==a||null===(c=a.extensions)||void 0===c?void 0:c.KHR_materials_transmission)&&(u.alphaMode=g.F.Translucent);var T=null==a?void 0:a.doubleSided;if(null!=T&&(u.cullFace=!T),O.Is.exist(a.diffuseColorTexture)){var C,P,R=a.diffuseColorTexture,D=e._createTexture(R,r,{autoDetectTransparency:null==f?void 0:f.autoDetectTextureTransparency});if(u.setTextureParameter(I.f5.DiffuseColorTexture,D),this._checkRnGltfLoaderOptionsExist(r)&&(null===(C=r.asset.extras)||void 0===C||null===(P=C.rnLoaderOptions)||void 0===P?void 0:P.loaderExtension)){var B=r.asset.extras.rnLoaderOptions.loaderExtension;B.setUVTransformToTexture&&B.setUVTransformToTexture(u,R.samplerObject)}}if(O.Is.exist(null==a?void 0:a.diffuseColorFactor)){var N=null==a?void 0:a.diffuseColorFactor;u.setParameter(I.f5.DiffuseColorFactor,v.Lt.fromCopyArray4(N))}var L=null==a?void 0:a.normalTexture;if(null!=L&&O.Is.falsy(l)){var F,G=e._createTexture(L.texture,r);u.setTextureParameter(I.f5.NormalTexture,G),parseFloat(null===(F=r.asset)||void 0===F?void 0:F.version)>=2&&(null!=L.texCoord&&u.setParameter(I.f5.NormalTexcoordIndex,L.texCoord),null!=L.scale&&u.setParameter(I.f5.NormalScale,L.scale))}if(e._setupTextureTransform(L,u,I.f5.NormalTextureTransform,I.f5.NormalTextureRotation),this._checkRnGltfLoaderOptionsExist(r)){var V,z,k=null===(V=r.asset.extras)||void 0===V||null===(z=V.rnLoaderOptions)||void 0===z?void 0:z.loaderExtension;null!=(null==k?void 0:k.setupMaterial)&&k.setupMaterial(r,a,u)}return u},e._createTexture=function(e,t){var n,r,o,i,a,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},c=s.autoDetectTransparency,l=void 0!==c&&c,u=null===(n=t.asset.extras)||void 0===n?void 0:n.rnLoaderOptions,f=new m.x;f.autoDetectTransparency=l,f.autoResize=!0===(null==u?void 0:u.autoResizeTexture);var _={magFilter:O.Is.exist(null===(r=e.samplerObject)||void 0===r?void 0:r.magFilter)?B.d.from(e.samplerObject.magFilter):B.d.Linear,minFilter:O.Is.exist(null===(o=e.samplerObject)||void 0===o?void 0:o.minFilter)?B.d.from(e.samplerObject.minFilter):B.d.Linear,wrapS:O.Is.exist(null===(i=e.samplerObject)||void 0===i?void 0:i.wrapS)?B.d.from(e.samplerObject.wrapS):B.d.Repeat,wrapT:O.Is.exist(null===(a=e.samplerObject)||void 0===a?void 0:a.wrapT)?B.d.from(e.samplerObject.wrapT):B.d.Repeat},h=e.image;if(h.image){var d,v=h.image,p=N.F.getWebGLResourceRepository(),y=!(null===(d=p.currentWebGLContextWrapper)||void 0===d?void 0:d.isWebGL2);y&&!this.__sizeIsPowerOfTwo(v)&&this.__needResizeToPowerOfTwoOnWebGl1(_)&&(f.autoResize=!0),f.generateTextureFromImage(v,_)}else h.basis?f.generateTextureFromBasis(h.basis,_):h.ktx2&&f.generateTextureFromKTX2(h.ktx2,_);if(h.uri)f.name=h.uri;else{var A,b=null===(A=h.mimeType)||void 0===A?void 0:A.split("/")[1];f.name=h.name+".".concat(b)}return f},e.__needResizeToPowerOfTwoOnWebGl1=function(e){return e.wrapS!==B.d.ClampToEdge||e.wrapT!==B.d.ClampToEdge||e.minFilter!==B.d.Linear&&e.minFilter!==B.d.Nearest},e.__sizeIsPowerOfTwo=function(e){var t=e.width,n=e.height;return 0==(t&t-1)&&0==(n&n-1)},e.__needParameterInitialization=function(e,t){return null!=e&&(null!=t.match(/PbrUber/)||null!=t.match(/ClassicUber/))},e._checkRnGltfLoaderOptionsExist=function(e){var t;return!!(null===(t=e.asset.extras)||void 0===t?void 0:t.rnLoaderOptions)},e.__rewrapWithTypedArray=function(e,t,n,r){return new e(t.buffer,n+t.byteOffset,r)},e._checkBytesPerComponent=function(e){var t=0;switch(e.componentType){case 5120:case 5121:t=1;break;case 5122:case 5123:t=2;break;case 5124:case 5125:case 5126:t=4}return t},e._checkComponentNumber=function(e){var t=0;switch(e.type){case"SCALAR":t=1;break;case"VEC2":t=2;break;case"VEC3":t=3;break;case"VEC4":t=4;break;case"MAT4":t=16}return t},e._checkDataViewMethod=function(e){var t="";switch(e.componentType){case 5120:t="getInt8";break;case 5121:t="getUint8";break;case 5122:t="getInt16";break;case 5123:t="getUint16";break;case 5124:t="getInt32";break;case 5125:t="getUint32";break;case 5126:t="getFloat32"}return t},e._isSystemLittleEndian=function(){return!!new Uint8Array(new Uint16Array([255]).buffer)[0]},e._readBinaryFromAccessorAndSetItToAccessorExtras=function(t,n){var r,o,i,a=t.bufferViewObject,s=(null!==(o=a.byteOffset)&&void 0!==o?o:0)+(null!==(i=t.byteOffset)&&void 0!==i?i:0),c=a.bufferObject.buffer,l=this._checkComponentNumber(t),u=this._checkBytesPerComponent(t),f=this._checkDataViewMethod(t);O.Is.not.exist(t.extras)&&(t.extras={attributeName:"",toGetAsTypedArray:!0,typedDataArray:new Float32Array,componentN:0,componentBytes:4,dataViewMethod:""}),t.extras.componentN=O.Is.exist(null===(r=t.extras)||void 0===r?void 0:r.weightsArrayLength)?t.extras.weightsArrayLength:l,t.extras.componentBytes=u,t.extras.dataViewMethod=f;var _=u*l*t.count;if(O.Is.exist(n)){var h=n[t.bufferViewObject.buffer],d=this.__getRnBufferView(a,h);c=this.__getRnAccessor(t,d).getUint8Array(),s=0}var m=new Float32Array,v=[];if(e._isSystemLittleEndian()){var p=new Float32Array;"getFloat32"===f?p=this.__rewrapWithTypedArray(Float32Array,c,s,_/u):"getInt8"===f?p=new Int8Array(c,s,_/u):"getUint8"===f?p=new Uint8Array(c,s,_/u):"getInt16"===f?p=this.__rewrapWithTypedArray(Int16Array,c,s,_/u):"getUint16"===f?p=this.__rewrapWithTypedArray(Uint16Array,c,s,_/u):"getInt32"===f?p=this.__rewrapWithTypedArray(Int32Array,c,s,_/u):"getUint32"===f&&(p=this.__rewrapWithTypedArray(Uint32Array,c,s,_/u)),m=this.__normalizeTypedArrayToFloat32Array(f,p)}else{for(var y=new DataView(c.buffer,s+c.byteOffset,_),A=u*l,b=!0,g=0;g<_;g+=A)switch(t.type){case"SCALAR":v.push(y[f](g,b));break;case"VEC2":v.push(y[f](g,b)),v.push(y[f](g+u,b));break;case"VEC3":v.push(y[f](g,b)),v.push(y[f](g+u,b)),v.push(y[f](g+2*u,b));break;case"VEC4":for(var x=0;x<4;x++)v.push(y[f](g+u*x,b));break;case"MAT4":for(var I=0;I<16;I++)v.push(y[f](g+u*I,b))}m=this.__normalizeTypedArrayToFloat32Array(f,v)}return t.extras.typedDataArray=m,m},e.__normalizeTypedArrayToFloat32Array=function(e,t){return"getInt8"===e?L.j.normalizedInt8ArrayToFloat32Array(t):"getUint8"===e?L.j.normalizedUint8ArrayToFloat32Array(t):"getInt16"===e?L.j.normalizedInt16ArrayToFloat32Array(t):"getUint16"===e?L.j.normalizedUint16ArrayToFloat32Array(t):"getInt32"===e||"getUint32"===e?(console.error("Not considered"),new Float32Array):"getFloat32"===e?new Float32Array(t):(console.error("Not considered"),new Float32Array)},e.__addOffsetToIndices=function(e){for(var t=e.mesh.getPrimitiveNumber(),n=0,r=0;r{n.d(t,{z:()=>l});var r=n(5737),o=n(1905),i=n(2342),a=n(9076),s=n(5479),c=n(9197),l=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.importBillboard=function(e,t){if(!c.Is.not.exist(e.extensionsUsed)&&-1!==e.extensionsUsed.findIndex((function(e){return"RHODONITE_billboard"===e})))for(var n in e.nodes){var r=t[n],o=e.nodes[n],i=r.getSceneGraph();void 0!==o.extensions&&void 0!==o.extensions.RHODONITE_billboard&&!0===o.extensions.RHODONITE_billboard.isBillboard&&(i.isBillboard=!0)}},e.importEffect=function(e,t){if(!c.Is.not.exist(e.extensions)&&!c.Is.not.exist(e.extensions.RHODONITE_effekseer)&&-1!==e.extensionsUsed.findIndex((function(e){return"RHODONITE_effekseer"===e}))){var l=t.getTagValue("rnEntities"),u=e.extensions.RHODONITE_effekseer.effects,f=!0,_=!1,h=void 0;try{for(var d,m=function(){var t=d.value,u=l[t.node],f=i.g.addComponentToEntity(r.D,u),_=f.getEffekseer();_.playJustAfterLoaded=!0,_.isLoop=!0,c.Is.exist(t.bufferView)?e.buffers[0].bufferPromise.then((function(n){var r=s.j.createUint8ArrayFromBufferViewInfo(e,t.bufferView,n);_.arrayBuffer=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),_.type="efkpkg"})):c.Is.exist(t.uri)?(_.uri=t.uri,_.type="efk"):console.error("No real effect data."),function(e,t){var n=e.getComponentByComponentTID(o.zz.EffekseerComponentTID);if(c.Is.exist(n)&&(n.playJustAfterLoaded=!0,n.isLoop=!0,c.Is.exist(t.timelines))){var r=t.timelines,s=!0,l=!1,u=void 0;try{for(var f,_=r[Symbol.iterator]();!(s=(f=_.next()).done);s=!0){var h=f.value,d=h.values,m=h.name,v=d.map((function(e){return{input:e.input,event:e.event}})),p=e.tryToGetAnimation(),y=void 0;c.Is.not.exist(p)&&(y=i.g.addComponentToEntity(o.cw,e)),(p=y.getAnimation()).setAnimation(c.Is.exist(m)?m:"Default","effekseer",new Float32Array(v.map((function(e){return e.input}))),new Float32Array(v.map((function(e){return"play"===e.event?1:(e.event,0)}))),1,a.kO.Step,!0)}}catch(e){l=!0,u=e}finally{try{s||null==_.return||_.return()}finally{if(l)throw u}}}}(f,t);var h=n(6893).Zlib.Unzip;r.D.Unzip=h},v=u[Symbol.iterator]();!(f=(d=v.next()).done);f=!0)m()}catch(e){_=!0,h=e}finally{try{f||null==v.return||v.return()}finally{if(_)throw h}}}},e}()},1442:(e,t,n)=>{n.d(t,{mNG:()=>D.mN,qfN:()=>rt.q,lam:()=>a.l,bCT:()=>D.bC,mC0:()=>r.m,PxB:()=>Ln.P,XAY:()=>D.XA,lJH:()=>D.lJ,VI2:()=>Qn,yEY:()=>Hi.y,OxW:()=>D.Ox,U_s:()=>Ui.U,yd$:()=>tr,FvO:()=>m.Fv,tVY:()=>$t,sdx:()=>m.sd,cwg:()=>a.cw,kOi:()=>m.kO,Sy_:()=>ar,JRY:()=>fr,RDh:()=>ye,l6R:()=>m.l6,xTt:()=>a.xT,afv:()=>pr,fgK:()=>Ir,Nh_:()=>m.Nh,lWr:()=>Qi.l,$HW:()=>m.$H,qP0:()=>ji.q,FOu:()=>ht.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kSU:()=>ut.kS});var r=n(4275),o=n(7576),i=n(8430),a=n(1905),s=n(1410),c=n(6383),l=n(9977),u=n(3856),f=n(2342),_=n(9481),h=n(4395),d=n(9315),m=n(9076),v=Symbol();var p=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__raw=t};Object.defineProperty(p.prototype,"getComponentFromEntities",{enumerable:!1,writable:!1,configurable:!0,value:function(e){var t=this.__raw,n=[];return t.forEach((function(t){var r=t.getComponentByComponentTID(e.componentTID);null!=r&&n.push(r)})),n}});var y=function(){Object.defineProperty(Array.prototype,"Rn",{enumerable:!1,configurable:!1,get:function(){return new p(this)}})},A=n(7416),b=n(9197),g=n(3884),x=n(2535),I=n(5479),E=n(92),w=n(3932),S=n(429),T=n(6174);function C(e,t){for(var n=!1,r=e.extras.bufferViewByteLengthAccumulatedArray.length-1,o=[],i=0;i.5?"play":"pause"};g.push(I)}var E={name:u,values:g};o.push(E)}}}catch(e){d=!0,m=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw m}}}}}}catch(e){a=!0,s=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw s}}t.timelines=o}}var R=n(6264),D=n(1855);function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1&&void 0!==arguments[1]?arguments[1]:{entities:void 0,type:z},n=this;return N((function(){var r,o,i,a,s,c,l,u;return F(this,(function(f){switch(f.label){case 0:return r=n.__collectEntities(t),o=r.collectedEntities,i=r.topLevelEntities,a=n.__createJsonBase(e),s=a.json,c=a.fileName,n.__createBufferViewsAndAccessors(s,o),n.__createNodes(s,o,i),[4,n.__createMaterials(s,o,t)];case 1:return f.sent(),C(s,o),l=n.__createBinary(s),n.__deleteEmptyArrays(s),u=W(s,l),t.type===z?n.__downloadGlb(s,c,u):t.type===V&&n.__downloadGltf(s,c,l),[2,u]}}))}))()},e.__deleteEmptyArrays=function(e){0===e.accessors.length&&delete e.accessors,0===e.bufferViews.length&&delete e.bufferViews,0===e.materials.length&&delete e.materials,0===e.meshes.length&&delete e.meshes,0===e.skins.length&&delete e.skins,0===e.textures.length&&delete e.textures,0===e.images.length&&delete e.images,0===e.animations.length&&delete e.animations,b.Is.exist(e.extensionsUsed)&&0===e.extensionsUsed.length&&delete e.extensionsUsed,0===e.cameras.length&&delete e.cameras,delete e.extras},e.__collectEntities=function(e){var t=function(t){if(b.Is.exist(e)&&b.Is.exist(e.excludeTags)){var n=!0,r=!1,o=void 0;try{for(var i,a=e.excludeTags[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;if(t.matchTag(s.tag,s.value))return!1}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}if(t.matchTag("Being","gizmo"))return!0}return!0},n=function(t){if(b.Is.exist(e)&&b.Is.exist(e.excludeTags)){var n=!0,r=!1,o=void 0;try{for(var i,a=e.excludeTags[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;if(t.matchTag(s.tag,s.value))return[]}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}}return[t]},r=function(e,t){var o=e.getSceneGraph();if(o.children.length>0){for(var i=t?[]:n(e),a=0;a0){var o=e.entities.flatMap((function(e){return r(e,!0)})),i=[];e.entities.forEach((function(e){-1===o.indexOf(e)&&t(e)&&i.push(e)}));var a=e.entities.concat();return Array.prototype.push.apply(a,o),a=O(new Set(a)),0===i.length&&(i=a),{collectedEntities:a,topLevelEntities:i}}var s=f.g._getEntities();s=s.filter((function(e){return t(e)}));var c=S.a.getTopLevelComponents().flatMap((function(e){return e.entity}));return c=c.filter((function(e){return t(e)})),s=s.flatMap((function(e){return r(e,!0)})),Array.prototype.push.apply(s,c),{collectedEntities:s=O(new Set(s)),topLevelEntities:c}},e.__createJsonBase=function(e){var t=e||"Rhodonite_"+(new Date).getTime();return{json:{asset:{version:"2.0",generator:"Rhodonite (".concat(G.version,")")},buffers:[{uri:t+".bin",byteLength:0}],bufferViews:[],accessors:[],animations:[],meshes:[],skins:[],materials:[{pbrMetallicRoughness:{baseColorFactor:[1,1,1,1]}}],textures:[],images:[],extensionsUsed:[],extensions:{},extras:{rnSkins:[],bufferViewByteLengthAccumulatedArray:[]},cameras:[],samplers:[]},fileName:t}},e.__createBufferViewsAndAccessors=function(e,t){var n=[],r=[],o=[];!function(e,t,n,r,o){for(var i=0;i=0?y:void 0,bindShapeMatrix:null==p?void 0:p.flattenAsArray()};e.skins.push(g)},a=0;a0){c.children=[];for(var f=0;f0&&(c.weights=p)}var y=s.tryToGetSkeletal();if(b.Is.exist(y)){var A=e.extras.rnSkins.indexOf(y.entity);A>=0&&(c.skin=A)}var g=s.tryToGetCamera();if(b.Is.exist(g)){var x=void 0;if(g.type===m.iM.Perspective){var I=g.getTagValue("OriginalAspect"),E=g.getTagValue("OriginalFovY");x={name:g.entity.uniqueName,type:"perspective",perspective:{aspectRatio:b.Is.exist(I)?I:g.aspect,yfov:b.Is.exist(E)?D.kj.degreeToRadian(E):D.kj.degreeToRadian(g.fovy),znear:g.zNear,zfar:g.zFar}}}else if(g.type===m.iM.Orthographic){var w=g.getTagValue("OriginalXMag"),S=g.getTagValue("OriginalYMag");x={name:g.entity.uniqueName,type:"orthographic",orthographic:{xmag:b.Is.exist(w)?w:g.xMag,ymag:b.Is.exist(S)?S:g.yMag,znear:g.zNear,zfar:g.zFar}}}e.cameras.push(x),c.camera=e.cameras.length-1}}n.forEach((function(e,n){var o=t.indexOf(e);o>=0&&r.nodes.push(o)}))},e.__createMaterials=function(e,t,n){return N((function(){var r,o,i,a,s;return F(this,(function(c){for(r=function(r){var s=t[r].tryToGetMesh();if(s&&s.mesh)for(var c=function(t){var r=s.mesh.getPrimitiveAt(t),o=l.primitives[t],c=r.material,u={pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}},f=void 0;if(b.Is.exist(c)){b.Is.false(c.isLighting)&&(b.Is.not.exist(u.extensions)&&(u.extensions={}),u.extensions.KHR_materials_unlit={},e.extensionsUsed.indexOf("KHR_materials_unlit")<0&&e.extensionsUsed.push("KHR_materials_unlit")),f=c.getParameter(A.f5.BaseColorFactor),b.Is.not.exist(f)?(f=c.getParameter(A.f5.DiffuseColorFactor),b.Is.not.exist(f)&&(f=R.Lt.fromCopy4(1,1,1,1))):(u.pbrMetallicRoughness.metallicFactor=c.getParameter(A.f5.MetallicRoughnessFactor).x,u.pbrMetallicRoughness.roughnessFactor=c.getParameter(A.f5.MetallicRoughnessFactor).y),u.pbrMetallicRoughness.baseColorFactor=Array.prototype.slice.call(f._v),u.alphaMode=c.alphaMode.toGltfString();var _=[],h=function(t){if(t&&t.width>1&&t.height>1){for(var r=e.images.length,o=!1,s=0;s0&&(e.buffers[0].byteLength=t+I.j.calcPaddingBytes(t,4));for(var n=new ArrayBuffer(e.buffers[0].byteLength),r=0,o=0;o0){for(var i=0;i.4&&(s=Se.P.fromCopyArray3([1,0,0]),c=Se.P.fromCopyArray3([-1,0,0])),Math.abs(Se.P.dot(i,s))>.4&&(s=Se.P.fromCopyArray3([0,0,1]),c=Se.P.fromCopyArray3([0,0,-1]));var l=Se.P.multiply(Se.P.normalize(Se.P.cross(i,s)),n),u=Se.P.multiply(Se.P.normalize(Se.P.cross(i,l)),n),f=Se.P.multiply(Se.P.normalize(Se.P.cross(i,c)),n),_=Se.P.multiply(Se.P.normalize(Se.P.cross(i,f)),n),h=Se.P.add(a,l),d=Se.P.add(a,u),m=Se.P.add(a,f),v=Se.P.add(a,_),p=[];p.push(this.__worldPositionOfThisJoint),p.push(h),p.push(this.__worldPositionOfThisJoint),p.push(d),p.push(this.__worldPositionOfThisJoint),p.push(m),p.push(this.__worldPositionOfThisJoint),p.push(v),p.push(h),p.push(d),p.push(d),p.push(m),p.push(m),p.push(v),p.push(v),p.push(h),p.push(this.__worldPositionOfParentJoint),p.push(h),p.push(this.__worldPositionOfParentJoint),p.push(d),p.push(this.__worldPositionOfParentJoint),p.push(m),p.push(this.__worldPositionOfParentJoint),p.push(v);var y=[];p.map((function(e){Array.prototype.push.apply(y,e.flattenAsArray())}));var A=[new Float32Array(y)],b=[ue.T.Position.XYZ];this.copyVertexData({attributes:A,attributeSemantics:b,primitiveMode:fe.T.Lines,material:null==e?void 0:e.material})},o}(_e.A);function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:{},t=new ke.J;t.generate(e);var n=ft(t);return ut.Is.not.exist(e.direction)&&(e.direction="xz"),"xy"===e.direction?n.localEulerAngles=Se.P.fromCopy3(Math.PI/2,0,0):"yz"===e.direction&&(n.localEulerAngles=Se.P.fromCopy3(0,0,Math.PI/2)),n},createLine:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new ze;t.generate(e);var n=ft(t);return n},createGrid:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new we;t.generate(e);var n=ft(t);return n},createCube:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new Ae.X;t.generate(e);var n=ft(t);return n},createSphere:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new Xe;t.generate(e);var n=ft(t);return n},createJoint:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new Me;t.generate(e);var n=ft(t);return n},createAxis:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new ye;t.generate(e);var n=ft(t);return n},createShape:ft}),ht=n(4021),dt=n(7952),mt=n(9978);function vt(e,t){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:{},o=r.isMSAA,i=void 0!==o&&o,a=r.sampleCountMSAA,s=void 0===a?this.__sampleCountMSAA:a;this.width=e,this.height=t,this.__isMSAA=i,this.__sampleCountMSAA=s,this.__internalFormat=n;var c=ht.F.getWebGLResourceRepository();this._textureResourceUid=c.createRenderBuffer(e,t,n,i,s)},s.resize=function(e,t){this.destroy3DAPIResources(),this.create(e,t,this.__internalFormat,{isMSAA:this.__isMSAA})},s.destroy3DAPIResources=function(){return this.width=0,this.height=0,ht.F.getWebGLResourceRepository().deleteRenderBuffer(this._textureResourceUid),this._textureResourceUid=ht.F.InvalidCGAPIResourceUid,!0},i=o,(a=[{key:"_fbo",set:function(e){this.__fbo=e}},{key:"fbo",get:function(){return this.__fbo}}])&&wt(i.prototype,a),o}(d.S),Dt=Object.freeze({createTexturesForRenderTarget:function(e,t,n,r){var o=r.level,i=void 0===o?0:o,a=r.internalFormat,s=void 0===a?It.d.RGBA8:a,c=r.format,l=void 0===c?Et.V.RGBA:c,u=r.type,f=void 0===u?x.r.UnsignedByte:u,_=r.magFilter,h=void 0===_?It.d.Linear:_,d=r.minFilter,m=void 0===d?It.d.Linear:d,v=r.wrapS,p=void 0===v?It.d.ClampToEdge:v,y=r.wrapT,A=void 0===y?It.d.ClampToEdge:y,b=r.createDepthBuffer,g=void 0===b||b,I=r.isMSAA,E=void 0!==I&&I,w=r.sampleCountMSAA,S=void 0===w?4:w,T=r.anisotropy,C=void 0!==T&&T,P=new xt;P.create(e,t);for(var R=0;R0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]2&&void 0!==arguments[2]?arguments[2]:{},r=n.isShadow,o=void 0!==r&&r,i=n.shadowMapSize,a=void 0===i?1024:i,s=this;return kt((function(){var n,r,i,c,l,u,f,_,h;return Xt(this,(function(d){switch(d.label){case 0:return s.__width=e,s.__height=t,s.__shadowMapSize=a,s.__oFrame.has()?[2,new Ft.UG({message:"Already setup",error:void 0})]:(n=new Mt.bD(new Ot.R),s.__oFrame=n,r=s.__createRenderTargets(e,t),i=r.framebufferMsaa,c=r.framebufferResolve,l=r.framebufferResolveForReference,o&&(s.__isShadow=!0,s.__oFrameDepthMoment=s.__setupDepthMomentFramebuffer(a)),u=s.__setupInitialExpression(i,s.__oFrameDepthMoment),s.__oInitialExpression=new Mt.bD(u),f=s.__setupMsaaResolveExpression(n,i,c,l),s.__oMsaaResolveExpression=new Mt.bD(f),s.__oFrameBufferMsaa=new Mt.bD(i),s.__oFrameBufferResolve=new Mt.bD(c),s.__oFrameBufferResolveForReference=new Mt.bD(l),_=s.__setupGammaExpression(n,c,e/t),s.__oGammaExpression=new Mt.bD(_),[4,Vt.x.getInstance().getModule("xr")]);case 1:return h=d.sent(),b.Is.exist(h)&&(s.__oWebXRSystem=new Mt.bD(h.WebXRSystem.getInstance())),[2,new Ft.Ok]}}))}))()},i.setExpressions=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{isTransmission:!0};this.__setExpressionsInner(e,{isTransmission:t.isTransmission});var n=e.map((function(e){return e.clone()}));t.isTransmission&&this.__setTransparentExpressionsForTransmission(n),this.__setDepthTextureToEntityMaterials()},i.__setDepthTextureToEntityMaterials=function(){if(!b.Is.false(this.__isShadow)){this.__depthMomentExpressions=[];var e=!0,t=!1,n=void 0;try{for(var r,o=this.__expressions[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;this.__depthMomentExpressions.push(i.clone())}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}var a=lt.G.createDepthMomentEncodeMaterial(),s=!0,c=!1,l=void 0;try{for(var u,f=this.__depthMomentExpressions[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var _=u.value,h=!0,d=!1,m=void 0;try{for(var v,p=_.renderPasses[Symbol.iterator]();!(h=(v=p.next()).done);h=!0){var y=v.value;y.setFramebuffer(this.__oFrameDepthMoment.unwrapForce()),y.toClearColorBuffer=!0,y.toClearDepthBuffer=!0,y.toRenderTransparentPrimitives=!1,y.setMaterial(a)}}catch(e){d=!0,m=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw m}}}}catch(e){c=!0,l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}var g=!0,x=!1,I=void 0;try{for(var E,w=this.__expressions[Symbol.iterator]();!(g=(E=w.next()).done);g=!0){var S=E.value,T=!0,C=!1,P=void 0;try{for(var R,D=S.renderPasses[Symbol.iterator]();!(T=(R=D.next()).done);T=!0){var M=R.value.entities,B=!0,N=!1,O=void 0;try{for(var L,F=M[Symbol.iterator]();!(B=(L=F.next()).done);B=!0){var G=L.value.tryToGetMesh();if(b.Is.exist(G)){var V=G.mesh;if(b.Is.exist(V)){var z=V.primitives,k=!0,U=!1,Q=void 0;try{for(var j,W=z[Symbol.iterator]();!(k=(j=W.next()).done);k=!0)j.value.material.setTextureParameter(A.f5.DepthTexture,this.__oFrameDepthMoment.unwrapForce().getColorAttachedRenderTargetTexture(0))}catch(e){U=!0,Q=e}finally{try{k||null==W.return||W.return()}finally{if(U)throw Q}}}}}}catch(e){N=!0,O=e}finally{try{B||null==F.return||F.return()}finally{if(N)throw O}}}}catch(e){C=!0,P=e}finally{try{T||null==D.return||D.return()}finally{if(C)throw P}}}}catch(e){x=!0,I=e}finally{try{g||null==w.return||w.return()}finally{if(x)throw I}}this.__setDepthMomentRenderPassesAndDepthTextureToEntityMaterials()}},i.startRenderLoop=function(e){var t=this;return this.__oFrame.doesNotHave()?new Ft.UG({message:"not initialized.",error:void 0}):(this.__oDrawFunc=new Mt.bD(e),Gt.x.startRenderLoop((function(){t.__setExpressions(),e(t.__oFrame.unwrapForce())})),new Ft.Ok)},i.draw=function(){this.__oDrawFunc.unwrapForce()(this.__oFrame.unwrapForce())},i.resize=function(e,t){if(this.__oFrame.doesNotHave())return new Ft.UG({message:"not initialized.",error:void 0});(0,Mt.Zz)(this.__oFrame),(0,Mt.Zz)(this.__oFrameBufferMsaa),(0,Mt.Zz)(this.__oFrameBufferResolve),(0,Mt.Zz)(this.__oFrameBufferResolveForReference),(0,Mt.Zz)(this.__oGammaExpression),(0,Mt.Zz)(this.__oGammaBoardEntity);var n=this.__oWebXRSystem.unwrapOrUndefined();return b.Is.exist(n)&&n.isWebXRMode&&(e=n.getCanvasWidthForVr(),t=n.getCanvasHeightForVr()),Gt.x.resizeCanvas(e,t),this.__oFrame.get().setViewport(R.Lt.fromCopy4(0,0,e,t)),this.__oFrameDepthMoment.has()&&this.__oFrameDepthMoment.get().resize(Math.floor(this.__shadowMapSize*(this.__width/this.__height)),this.__shadowMapSize),this.__oFrameBufferMsaa.get().resize(e,t),this.__oFrameBufferResolve.get().resize(e,t),this.__oFrameBufferResolveForReference.get().resize(e,t),this.__oGammaExpression.get().renderPasses[0].setViewport(R.Lt.fromCopy4(0,0,e,t)),new Ft.Ok},i.setIBL=function(e){var t=new Bt.B;t.baseUriToLoad=e.diffuse.baseUri,t.hdriFormat=e.diffuse.hdriFormat,t.isNamePosNeg=e.diffuse.isNamePosNeg,t.mipmapLevelNumber=e.diffuse.mipmapLevelNumber,t.loadTextureImagesAsync(),this.__oDiffuseCubeTexture=new Mt.bD(t);var n=new Bt.B;n.baseUriToLoad=e.specular.baseUri,n.isNamePosNeg=e.specular.isNamePosNeg,n.hdriFormat=e.specular.hdriFormat,n.mipmapLevelNumber=e.specular.mipmapLevelNumber,n.loadTextureImagesAsync(),this.__oSpecularCubeTexture=new Mt.bD(n),this.__setIblInner(),this.__setIblInnerForTransparentOnly()},i.setIBLTextures=function(e,t){this.__oDiffuseCubeTexture=new Mt.bD(e),this.__oSpecularCubeTexture=new Mt.bD(t),this.__setIblInner(),this.__setIblInnerForTransparentOnly()},i.getInitialExpression=function(){return this.__oInitialExpression.unwrapOrUndefined()},i.getMsaaResolveExpression=function(){return this.__oMsaaResolveExpression.unwrapOrUndefined()},i.getGammaExpression=function(){return this.__oGammaExpression.unwrapOrUndefined()},i.setDiffuseIBLContribution=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.__expressions[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,s=!0,c=!1,l=void 0;try{for(var u,f=a.renderPasses[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var _=u.value,h=!0,d=!1,m=void 0;try{for(var v,p=_.entities[Symbol.iterator]();!(h=(v=p.next()).done);h=!0){var y=v.value.tryToGetMeshRenderer();b.Is.exist(y)&&(y.diffuseCubeMapContribution=e)}}catch(e){d=!0,m=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw m}}}}catch(e){c=!0,l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}var A=!0,g=!1,x=void 0;try{for(var I,E=this.__transparentOnlyExpressions[Symbol.iterator]();!(A=(I=E.next()).done);A=!0){var w=I.value,S=!0,T=!1,C=void 0;try{for(var P,R=w.renderPasses[Symbol.iterator]();!(S=(P=R.next()).done);S=!0){var D=P.value,M=!0,B=!1,N=void 0;try{for(var O,L=D.entities[Symbol.iterator]();!(M=(O=L.next()).done);M=!0){var F=O.value.tryToGetMeshRenderer();b.Is.exist(F)&&(F.diffuseCubeMapContribution=e)}}catch(e){B=!0,N=e}finally{try{M||null==L.return||L.return()}finally{if(B)throw N}}}}catch(e){T=!0,C=e}finally{try{S||null==R.return||R.return()}finally{if(T)throw C}}}}catch(e){g=!0,x=e}finally{try{A||null==E.return||E.return()}finally{if(g)throw x}}},i.setSpecularIBLContribution=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.__expressions[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,s=!0,c=!1,l=void 0;try{for(var u,f=a.renderPasses[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var _=u.value,h=!0,d=!1,m=void 0;try{for(var v,p=_.entities[Symbol.iterator]();!(h=(v=p.next()).done);h=!0){var y=v.value.tryToGetMeshRenderer();b.Is.exist(y)&&(y.specularCubeMapContribution=e)}}catch(e){d=!0,m=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw m}}}}catch(e){c=!0,l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}var A=!0,g=!1,x=void 0;try{for(var I,E=this.__transparentOnlyExpressions[Symbol.iterator]();!(A=(I=E.next()).done);A=!0){var w=I.value,S=!0,T=!1,C=void 0;try{for(var P,R=w.renderPasses[Symbol.iterator]();!(S=(P=R.next()).done);S=!0){var D=P.value,M=!0,B=!1,N=void 0;try{for(var O,L=D.entities[Symbol.iterator]();!(M=(O=L.next()).done);M=!0){var F=O.value.tryToGetMeshRenderer();b.Is.exist(F)&&(F.specularCubeMapContribution=e)}}catch(e){B=!0,N=e}finally{try{M||null==L.return||L.return()}finally{if(B)throw N}}}}catch(e){T=!0,C=e}finally{try{S||null==R.return||R.return()}finally{if(T)throw C}}}}catch(e){g=!0,x=e}finally{try{A||null==E.return||E.return()}finally{if(g)throw x}}},i.setIBLRotation=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.__expressions[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,s=!0,c=!1,l=void 0;try{for(var u,f=a.renderPasses[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var _=u.value,h=!0,d=!1,m=void 0;try{for(var v,p=_.entities[Symbol.iterator]();!(h=(v=p.next()).done);h=!0){var y=v.value.tryToGetMeshRenderer();b.Is.exist(y)&&(y.rotationOfCubeMap=e)}}catch(e){d=!0,m=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw m}}}}catch(e){c=!0,l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}},i.setCameraComponentOfLight=function(e){if(this.__isShadow){var t=!0,n=!1,r=void 0;try{for(var o,i=this.__depthMomentExpressions[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,s=!0,c=!1,l=void 0;try{for(var u,f=a.renderPasses[Symbol.iterator]();!(s=(u=f.next()).done);s=!0)u.value.cameraComponent=e}catch(e){c=!0,l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}var _=!0,h=!1,d=void 0;try{for(var m,v=this.__expressions[Symbol.iterator]();!(_=(m=v.next()).done);_=!0){var p=m.value,y=!0,g=!1,x=void 0;try{for(var I,E=function(){var t=I.value;t.setPostRenderFunction((function(){var n=t.entities,r=!0,o=!1,i=void 0;try{for(var a,s=n[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value.tryToGetMesh();if(b.Is.exist(c)){var l=c.mesh;if(b.Is.exist(l)){var u=l.primitives,f=!0,_=!1,h=void 0;try{for(var d,m=u[Symbol.iterator]();!(f=(d=m.next()).done);f=!0)d.value.material.setParameter(A.f5.DepthBiasPV,e.biasViewProjectionMatrix)}catch(e){_=!0,h=e}finally{try{f||null==m.return||m.return()}finally{if(_)throw h}}}}}}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}}))},w=p.renderPasses[Symbol.iterator]();!(y=(I=w.next()).done);y=!0)E()}catch(e){g=!0,x=e}finally{try{y||null==w.return||w.return()}finally{if(g)throw x}}}}catch(e){h=!0,d=e}finally{try{_||null==v.return||v.return()}finally{if(h)throw d}}}},i.__setExpressionsInner=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{isTransmission:!0},n=!0,r=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value,c=!0,l=!1,u=void 0;try{for(var f,_=s.renderPasses[Symbol.iterator]();!(c=(f=_.next()).done);c=!0){var h=f.value;h.toRenderOpaquePrimitives=!0,t.isTransmission?h.toRenderTransparentPrimitives=!1:h.toRenderTransparentPrimitives=!0,h.toClearDepthBuffer=!1,h.setFramebuffer(this.__oFrameBufferMsaa.unwrapForce())}}catch(e){l=!0,u=e}finally{try{c||null==_.return||_.return()}finally{if(l)throw u}}}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}this.__expressions=e,this.__setIblInner()},i.__setTransparentExpressionsForTransmission=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;a.tryToSetUniqueName("modelTransparentForTransmission",!0);var s=!0,c=!1,l=void 0;try{for(var u,f=a.renderPasses[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var _=u.value;_.toRenderOpaquePrimitives=!1,_.toRenderTransparentPrimitives=!0,_.toClearDepthBuffer=!1,_.setFramebuffer(this.__oFrameBufferMsaa.unwrapForce());var h=!0,d=!1,m=void 0;try{for(var v,p=_.entities[Symbol.iterator]();!(h=(v=p.next()).done);h=!0){var y=v.value.tryToGetMesh();if(b.Is.exist(y)){var g=y.mesh;if(b.Is.exist(g))for(var x=0;x4&&void 0!==arguments[4]?arguments[4]:"none",i=arguments.length>5?arguments[5]:void 0;return this.__setupAnimationForSameSkeleton(e,t,n,r,o,i),e},t.__getCorrespondingEntity=function(e,t,n,r,o,i){if(i){var a=e.getTagValue("rnEntitiesByNames"),s=t.nodes[r];return a.get(s.name)}if(b.Is.exist(n.extensions.VRM)){var c,l=n.extensions.VRM.humanoid.humanBones,u=new Map,f=new Map,_=!0,h=!1,d=void 0;try{for(var m,v=l[Symbol.iterator]();!(_=(m=v.next()).done);_=!0){var p=m.value;u.set(p.node,p.bone),f.set(p.name,p.bone)}}catch(e){h=!0,d=e}finally{try{_||null==v.return||v.return()}finally{if(h)throw d}}null!=o&&null==(c=f.get(o))&&(c=u.get(r));var y=e.getTagValue("humanoid_map_name_nodeId").get(c);return null!=y?e.getTagValue("rnEntities")[y]:void console.log("humanoidBoneName: ".concat(c,", nodeIndex: ").concat(r,", nodeName: ").concat(o))}if(b.Is.exist(n.extensions.VRMC_vrm)){var A,g=n.extensions.VRMC_vrm.humanoid.humanBones,x=new Map;for(var I in g){var E=g[I];x.set(E.node,I)}null!=o&&(A=x.get(r));var w=e.getTagValue("humanoid_map_name_nodeId").get(A);return null!=w?e.getTagValue("rnEntities")[w]:void console.log("humanoidBoneName: ".concat(A,", nodeIndex: ").concat(r,", nodeName: ").concat(o))}},t.__isHips=function(e,t,n){var r=new Map;if(b.Is.exist(t.extensions.VRM)){var o=t.extensions.VRM.humanoid.humanBones,i=!0,a=!1,s=void 0;try{for(var c,l=o[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var u=c.value;r.set(u.node,u.bone)}}catch(e){a=!0,s=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw s}}}else if(b.Is.exist(t.extensions.VRMC_vrm)){var f=t.extensions.VRMC_vrm.humanoid.humanBones;for(var _ in f){var h=f[_];r.set(h.node,_)}}return e.getTagValue("humanoid_map_name_nodeId"),"hips"===r.get(n)},t.__setupAnimationForSameSkeleton=function(e,t,n,r,o,i){if(t.animations){var s=!0,c=!1,l=void 0;try{for(var u,_=t.animations[Symbol.iterator]();!(s=(u=_.next()).done);s=!0){var h=u.value,d=!0,m=!1,v=void 0;try{for(var p,y=h.samplers[Symbol.iterator]();!(d=(p=y.next()).done);d=!0){var A=p.value;Kt.e._readBinaryFromAccessorAndSetItToAccessorExtras(A.inputObject),Kt.e._readBinaryFromAccessorAndSetItToAccessorExtras(A.outputObject)}}catch(e){m=!0,v=e}finally{try{d||null==y.return||y.return()}finally{if(m)throw v}}}}catch(e){c=!0,l=e}finally{try{s||null==_.return||_.return()}finally{if(c)throw l}}}if(t.animations&&t.animations.length>0){var g=!0,x=!1,I=void 0;try{for(var E,w=t.animations[Symbol.iterator]();!(g=(E=w.next()).done);g=!0){var S=E.value,T=!0,C=!1,P=void 0;try{for(var R,D=S.channels[Symbol.iterator]();!(T=(R=D.next()).done);T=!0){var M,B,N,O,L=R.value,F=null===(M=L.samplerObject)||void 0===M||null===(B=M.inputObject)||void 0===B?void 0:B.extras.typedDataArray,G=null===(N=L.samplerObject)||void 0===N||null===(O=N.outputObject)||void 0===O?void 0:O.extras.typedDataArray,V=null!=L.samplerObject.interpolation?L.samplerObject.interpolation:"LINEAR",z=t.nodes[L.target.node],k=this.__getCorrespondingEntity(e,t,n,L.target.node,z.name,r);if(k){var U,Q=f.g.addComponentToEntity(Jt.c,k).getAnimation();if("quaternion"===(U="translation"===L.target.path?"translate":"rotation"===L.target.path?"quaternion":L.target.path)?Q.setAnimation(b.Is.exist(S.name)?S.name:"Untitled",U,F,G,4,Zt.k.fromString(V)):"translate"===U&&this.__isHips(e,n,L.target.node)&&Q.setAnimation(b.Is.exist(S.name)?S.name:"Untitled",U,F,G,3,Zt.k.fromString(V)),"none"!==o&&b.Is.exist(i)){var j=t.extras.rnEntities[L.target.node],W=void 0;if("global"===o)W=new a.B5(j);else if("global2"===o)W=new a.xz(j);else{if("absolute"!==o)throw new Error("unknown retarget mode");W=new a.l(j)}Q._animationRetarget=W}}}}catch(e){C=!0,P=e}finally{try{T||null==D.return||D.return()}finally{if(C)throw P}}}}catch(e){x=!0,I=e}finally{try{g||null==w.return||w.return()}finally{if(x)throw I}}}},e.getInstance=function(){return this.__instance||(this.__instance=new e),this.__instance},e}(),en=n(3363),tn=n(1274);function nn(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function rn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){nn(i,r,o,a,s,"next",e)}function s(e){nn(i,r,o,a,s,"throw",e)}a(void 0)}))}}var on=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=0){var w=e.accessors[E];w.extras={toGetAsTypedArray:!0,attributeName:I},x[I]=w}}_.targetsObjects.push(x)}}catch(e){p=!0,y=e}finally{try{v||null==b.return||b.return()}finally{if(p)throw y}}}}}catch(e){c=!0,l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}},t._checkRnGltfLoaderOptionsExist=function(e){return!(!e.asset.extras||!e.asset.extras.rnLoaderOptions)},t._loadDependenciesOfMaterials=function(e){if(e.textures||(e.textures=[]),e.materials){var t=!0,n=!1,r=void 0;try{for(var o,i=e.materials[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;if(a.pbrMetallicRoughness){var s=a.pbrMetallicRoughness.baseColorTexture;void 0!==s&&(s.texture=e.textures[s.index]);var c=a.pbrMetallicRoughness.metallicRoughnessTexture;void 0!==c&&(c.texture=e.textures[c.index])}var l=a.normalTexture;void 0!==l&&(l.texture=e.textures[l.index]);var u=a.occlusionTexture;void 0!==u&&(u.texture=e.textures[u.index]);var f=a.emissiveTexture;void 0!==f&&(f.texture=e.textures[f.index]),this._checkRnGltfLoaderOptionsExist(e)&&e.asset.extras.rnLoaderOptions.loaderExtension&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures(e,a)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}},t._loadDependenciesOfTextures=function(e){if(e.textures){var t=!0,n=!1,r=void 0;try{for(var o,i=function(){var t=o.value;(0,tn.Jx)((function(n){t.samplerObject=e.samplers[n]}),t.sampler),void 0!==t.source&&(t.image=e.images[t.source])},a=e.textures[Symbol.iterator]();!(t=(o=a.next()).done);t=!0)i()}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}}},t._loadDependenciesOfJoints=function(e){if(e.skins){var t=!0,n=!1,r=void 0;try{for(var o,i=function(){var t=o.value;if(b.Is.exist(t.skeleton)){t.skeletonObject=e.nodes[t.skeleton],(0,tn.Jx)((function(n){return t.inverseBindMatricesObject=e.accessors[n]}),t.inverseBindMatrices),(0,tn.fY)((function(){return t.skeletonObject=e.nodes[t.joints[0]]}),t.skeleton),t.jointsObjects=[];var n=!0,r=!1,i=void 0;try{for(var a,s=t.joints[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var c=a.value;t.jointsObjects.push(e.nodes[c])}}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}}},a=e.skins[Symbol.iterator]();!(t=(o=a.next()).done);t=!0)i()}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}}},t._loadDependenciesOfAnimations=function(e){if(e.animations){var t=!0,n=!1,r=void 0;try{for(var o,i=e.animations[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value,s=!0,c=!1,l=void 0;try{for(var u,f=a.channels[Symbol.iterator]();!(s=(u=f.next()).done);s=!0){var _=u.value;_.samplerObject=a.samplers[_.sampler],_.target.nodeObject=e.nodes[_.target.node]}}catch(e){c=!0,l=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw l}}var h=!0,d=!1,m=void 0;try{for(var v,p=a.channels[Symbol.iterator]();!(h=(v=p.next()).done);h=!0){var y=v.value;if(b.Is.exist(y.samplerObject)&&(y.samplerObject.inputObject=e.accessors[y.samplerObject.input],y.samplerObject.outputObject=e.accessors[y.samplerObject.output],void 0===y.samplerObject.outputObject.extras&&(y.samplerObject.outputObject.extras={}),"rotation"===y.target.path&&(y.samplerObject.outputObject.extras.quaternionIfVec4=!0),"weights"===y.target.path)){var A=y.samplerObject.outputObject.count/y.samplerObject.inputObject.count;y.samplerObject.outputObject.extras.weightsArrayLength=A}}}catch(e){d=!0,m=e}finally{try{h||null==p.return||p.return()}finally{if(d)throw m}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}},t._loadDependenciesOfAccessors=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e.accessors[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;if(null==a.bufferView&&(a.bufferView=0),a.bufferViewObject=e.bufferViews[a.bufferView],null!=a.sparse){var s=a.sparse;s.indices.bufferViewObject=e.bufferViews[s.indices.bufferView],s.values.bufferViewObject=e.bufferViews[s.values.bufferView]}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}},t._loadDependenciesOfBufferViews=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=e.bufferViews[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;void 0!==a.buffer&&(a.bufferObject=e.buffers[a.buffer])}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}},t._mergeExtendedJson=function(e,t){var n,r,o=null;if(n=t,null!=(r=ArrayBuffer)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r){var i=I.j.arrayBufferToString(t);o=JSON.parse(i)}else"string"==typeof t?o=JSON.parse(t):"object"==typeof t&&(o=t);Object.assign(e,o)},t._loadResources=function(e,t,n,r,o){var i,a=function(a){var s=n.buffers[a],l=void 0,u=void 0;s.uri&&(l=s.uri.split("/"),u=l[l.length-1]),i=void 0===s.uri?new en.n((function(t,n){o.buffers[a]=e,s.buffer=e,t(e)})):s.uri.match(/^data:application\/(.*);base64,/)?new en.n((function(e,t){var n=I.j.dataUriToArrayBuffer(s.uri);o.buffers[a]=new Uint8Array(n),s.buffer=new Uint8Array(n),e(n)})):r.files&&r.files[u]?new en.n((function(e,t){var n=r.files[u];o.buffers[a]=new Uint8Array(n),s.buffer=new Uint8Array(n),e(n)})):new en.n(I.j.loadResourceAsync(t+s.uri,!0,(function(e,t){o.buffers[a]=new Uint8Array(t),s.buffer=new Uint8Array(t),e(t)}),(function(e,t){}))),s.bufferPromise=i,c.push(i)},s=function(i){var a=i,s=n.images[a],l=void 0;if(void 0===s.uri){null==e&&n.bufferViews[s.bufferView].bufferObject.buffer;var u=I.j.createUint8ArrayFromBufferViewInfo(n,s.bufferView,e);l=I.j.createBlobImageUriFromUint8Array(u,s.mimeType)}else{var f=s.uri,_=f.split("/"),h=_[_.length-1];if(r.files&&r.files[h]){var d=r.files[h];l=I.j.createBlobImageUriFromUint8Array(new Uint8Array(d),s.mimeType)}else l=f.match(/^data:/)?f:t+f}var m=I.j.createImageFromUri(l,s.mimeType).then((function(e){e.crossOrigin="Anonymous",o.images[a]=e,s.image=e}));c.push(m)},c=[];for(var l in n.buffers)a(l);for(var u in n.images)s(u);if(r.defaultTextures){var f=r.defaultTextures.basePath,_=r.defaultTextures.textureInfos,h=!0,d=!1,m=void 0;try{for(var v,p=function(){var e=v.value,t=e.fileName,n=f+t,r=I.j.getExtension(t),o=I.j.getMimeTypeFromExtension(r),i=I.j.createImageFromUri(n,o).then((function(t){t.crossOrigin="Anonymous",e.image={image:t}}));c.push(i)},y=_[Symbol.iterator]();!(h=(v=y.next()).done);h=!0)p()}catch(e){d=!0,m=e}finally{try{h||null==y.return||y.return()}finally{if(d)throw m}}}return Promise.all(c).catch((function(e){console.log("Promise.all error",e)}))},t.__decodeDraco=function(e,t,n,r){var o=this;return this.__decodeBuffer(e).then((function(e){var i=JSON.stringify(e),a=JSON.parse(i);return o._loadAsTextJson(a,r,t,n).catch((function(e){console.log("this.__loadAsTextJson error",e)}))}))},t.__decodeBuffer=function(e){var t=new DracoDecoderModule,n=new t.Decoder,r=this.__getGeometryFromDracoBuffer(t,n,e);if(null==r)throw new Error("invalid dracoGeometry.");if(r.geometryType!==t.POINT_CLOUD)throw new Error("invalid geometryType of drc file.");if(-1===n.GetAttributeId(r,t.POSITION))throw t.destroy(n),t.destroy(r),new Error("Draco: No position attribute found.");for(var o=["POSITION","NORMAL","COLOR","TEX_COORD","GENERIC"],i=r.num_points(),a=[],s=[],c=0,l=0;l0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0){var r=!0,o=!1,i=void 0;try{for(var a,s=t.children[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value;this.__addPhysicsComponentRecursively(e,c)}}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}}},e._createTextures=function(e){e.textures||(e.textures=[]);for(var t=e.textures,n=[],r=0;r0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0){var r=!0,o=!1,i=void 0;try{for(var a,s=t.children[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var c=a.value;this.__addPhysicsComponentRecursively(e,c)}}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}}},e._createTextures=function(e){e.textures||(e.textures=[]);for(var t=e.textures,n=[],r=0;r0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0?(n.__isImportVRM0x=!1,y.asset.extras.rnLoaderOptions.__isImportVRM0x=!1,n.__importedType="vrm1",[4,Pn.__importVRM(y,t)]):[3,10]:[3,13];case 9:return A.sent(),[3,12];case 10:return y.extensionsUsed.indexOf("VRM")>0?(n.__importedType="vrm0x",[4,wn.__importVRM0x(y,t)]):[3,12];case 11:A.sent(),A.label=12;case 12:return[2,new Ft.Ok];case 13:return(0,Ft.Z6)(p),[2,new Ft.UG({message:p.getRnError().message,error:void 0})];case 14:return[2,new Ft.UG({message:"detect invalid format",error:void 0})];case 15:return[2]}}))}))()},e.__getFileTypeFromFilePromise=function(e,t,n){return null!=n?sn.T.fromString(n):cn((r={},o=e,i=t.files[e],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i,r));var r,o,i},e}(),On=n(4398),Ln=n(7011);function Fn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Gn(e,t){for(var n=0;n=0&&null==o[c-1]&&(o[c-1]=[]);for(var u=l.inputConnections,f=0;f=0&&o[c-1].push(R),s.set(T.shaderNodeUid,R)}a.push(T.shaderNodeUid)}}}}for(var D="",M=0;M0){O+="".concat(N,"(");for(var F=0;F rhs;\n}\n\nvoid greater(in int lhs, in int rhs, out bool outValue) {\n outValue = lhs > rhs;\n}\n")).__inputs.push({compositionType:e,componentType:t,name:"lhs"}),n.__inputs.push({compositionType:e,componentType:x.r.Float,name:"rhs"}),n.__outputs.push({compositionType:w.d.Scalar,componentType:x.r.Bool,name:"outValue"}),n}return o}(Qn),zr=n(6080);function kr(e){return kr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},kr(e)}function Ur(e,t){return!t||"object"!==jr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Qr(e,t){return Qr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Qr(e,t)}var jr=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var Wr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Qr(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=kr(t);if(n){var o=kr(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Ur(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,"ifStatement",void 0,new zr.p)).__inputs.push({compositionType:w.d.Scalar,componentType:x.r.Bool,name:"condition"}),e.__outputs.push({compositionType:w.d.Unknown,componentType:x.r.Unknown,name:"ifStart"}),e}return o}(Qn);function Xr(e){return Xr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Xr(e)}function Hr(e,t){return!t||"object"!==Yr(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function qr(e,t){return qr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},qr(e,t)}var Yr=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var Kr=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&qr(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Xr(t);if(n){var o=Xr(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Hr(this,e)});function o(e,t,n,i){var a;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),a=r.call(this,"multiply","\nvoid multiply(in float lfs, in float rhs, out float outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in int lfs, in int rhs, out int outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat2 lfs, in mat2 rhs, out mat2 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat3 lfs, in mat3 rhs, out mat3 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat4 lfs, in mat4 rhs, out mat4 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat3 lfs, in vec3 rhs, out vec3 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat4 lfs, in vec4 rhs, out vec4 outValue) {\n outValue = lfs * rhs;\n}\n\n");var s=w.d.Unknown;return e===w.d.Mat4&&n===w.d.Mat4?s=w.d.Mat4:e===w.d.Mat4&&n===w.d.Vec4?s=w.d.Vec4:e===w.d.Scalar&&n===w.d.Scalar&&(s=w.d.Scalar),a.__inputs.push({compositionType:e,componentType:t,name:"lhs"}),a.__inputs.push({compositionType:n,componentType:i,name:"rhs"}),a.__outputs.push({compositionType:s,componentType:t,name:"outValue"}),a}return o}(Qn);function Jr(e){return Jr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Jr(e)}function Zr(e,t){return!t||"object"!==eo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function $r(e,t){return $r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},$r(e,t)}var eo=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var to=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$r(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Jr(t);if(n){var o=Jr(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Zr(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,"normalMatrix","\nvoid normalMatrix(out mat3 outValue) {\n outValue = get_normalMatrix(a_instanceInfo.x);\n}\n")).__outputs.push({compositionType:w.d.Mat3,componentType:x.r.Float,name:"outValue"}),e}return o}(Qn);function no(e){return no=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},no(e)}function ro(e,t){return!t||"object"!==io(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function oo(e,t){return oo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},oo(e,t)}var io=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var ao=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&oo(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=no(t);if(n){var o=no(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return ro(this,e)});function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,"normalize","\nvoid normalize(in vec2 value, out vec2 outValue) {\n outValue = normalize(value);\n}\n\nvoid normalize(in vec3 value, out vec3 outValue) {\n outValue = normalize(value);\n}\n\nvoid normalize(in vec4 value, out vec4 outValue) {\n outValue = normalize(value);\n}\n")).__inputs.push({compositionType:e,componentType:t,name:"value"}),n.__outputs.push({compositionType:e,componentType:t,name:"outValue"}),n}return o}(Qn),so=n(6114);function co(e){return co=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},co(e)}function lo(e,t){return!t||"object"!==fo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function uo(e,t){return uo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},uo(e,t)}var fo=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var _o=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&uo(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=co(t);if(n){var o=co(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return lo(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,"outColor",void 0,so.x.getInstance())).__inputs.push({compositionType:w.d.Vec4,componentType:x.r.Float,name:"value"}),e}return o}(Qn);function ho(e){return ho=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ho(e)}function mo(e,t){return!t||"object"!==po(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function vo(e,t){return vo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},vo(e,t)}var po=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var yo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&vo(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=ho(t);if(n){var o=ho(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return mo(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,"outPosition",void 0,so.x.getInstance())).__inputs.push({compositionType:w.d.Vec4,componentType:x.r.Float,name:"value"}),e}return o}(Qn);function Ao(e){return Ao=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ao(e)}function bo(e,t){return!t||"object"!==xo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function go(e,t){return go=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},go(e,t)}var xo=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var Io=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&go(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Ao(t);if(n){var o=Ao(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return bo(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,"projectionMatrix","\nvoid projectionMatrix(out mat4 outValue) {\n float cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID}*/];\n outValue = get_projectionMatrix(cameraSID, 0);\n}\n")).__outputs.push({compositionType:w.d.Mat4,componentType:x.r.Float,name:"outValue"}),e}return o}(Qn);function Eo(e){return Eo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Eo(e)}function wo(e,t){return!t||"object"!==To(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function So(e,t){return So=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},So(e,t)}var To=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var Co=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&So(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Eo(t);if(n){var o=Eo(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return wo(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,"scalarToVector4","\nvoid scalarToVector4(in float x, in float y, in float z, in float w, out vec4 outValue) {\n outValue.x = x;\n outValue.y = y;\n outValue.z = z;\n outValue.w = w;\n}\n")).__inputs.push({compositionType:w.d.Scalar,componentType:x.r.Float,name:"x"}),e.__inputs.push({compositionType:w.d.Scalar,componentType:x.r.Float,name:"y"}),e.__inputs.push({compositionType:w.d.Scalar,componentType:x.r.Float,name:"z"}),e.__inputs.push({compositionType:w.d.Scalar,componentType:x.r.Float,name:"w"}),e.__outputs.push({compositionType:w.d.Vec4,componentType:x.r.Float,name:"outValue"}),e}return o}(Qn),Po=n(2489);function Ro(e){return Ro=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ro(e)}function Do(e,t){return!t||"object"!==Bo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Mo(e,t){return Mo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Mo(e,t)}var Bo=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var No=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Mo(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Ro(t);if(n){var o=Ro(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Do(this,e)});function o(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,new Po.S,"textureFetch")).generalTextureMaterialNodeUID=new A.wy({str:"generalTexture_".concat(e.materialNodeUid)});var t=[{semantic:e.generalTextureMaterialNodeUID,componentType:x.r.Int,compositionType:w.d.Texture2D,stage:Xn.H.PixelShader,isCustomSetting:!1,soloDatum:!1,min:0,max:Number.MAX_SAFE_INTEGER}];return e.setShaderSemanticsInfoArray(t),e.__vertexInputs.push({compositionType:w.d.Vec2,componentType:x.r.Float,name:"texcoord"}),e.__vertexOutputs.push({compositionType:w.d.Vec4,componentType:x.r.Float,name:"outColor"}),e}return o}(Ln.P),Oo=n(4200);function Lo(e){return Lo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Lo(e)}function Fo(e,t){return!t||"object"!==Vo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Go(e,t){return Go=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Go(e,t)}var Vo=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var zo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Go(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Lo(t);if(n){var o=Lo(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Fo(this,e)});function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,"uniformData")).__shaderFunctionName+="_"+n.__shaderNodeUid,n.__shader=new Oo.$(n.__shaderFunctionName,e,t),n.__outputs.push({compositionType:e,componentType:t,name:"outValue"}),n}var i=o.prototype;return i.setDefaultInputValue=function(e,t){"value"===e&&this.__shader.setDefaultValue(t)},i.setUniformDataName=function(e){this.__shader.setVariableName(e)},o}(Qn),ko=n(2850);function Uo(e){return Uo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Uo(e)}function Qo(e,t){return!t||"object"!==Wo(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function jo(e,t){return jo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},jo(e,t)}var Wo=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var Xo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jo(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Uo(t);if(n){var o=Uo(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Qo(this,e)});function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,"varyingInVariable")).__shaderFunctionName+="_"+n.__shaderNodeUid,n.__shader=new ko.e(n.__shaderFunctionName,e,t),n.__outputs.push({compositionType:e,componentType:t,name:"outValue",isClosed:!0}),n}return o.prototype.setVaryingVariableName=function(e){this.__shader.setVariableName(e)},o}(Qn);function Ho(e){return Ho=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ho(e)}function qo(e,t){return!t||"object"!==Ko(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Yo(e,t){return Yo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Yo(e,t)}var Ko=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var Jo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Yo(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Ho(t);if(n){var o=Ho(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return qo(this,e)});function o(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(n=r.call(this,"varyingOutVariable")).__shaderFunctionName+="_"+n.__shaderNodeUid,n.__shader=new ko.e(n.__shaderFunctionName,e,t),n.__inputs.push({compositionType:e,componentType:t,name:"value"}),n}return o.prototype.setVaryingVariableName=function(e){this.__shader.setVariableName(e)},o}(Qn);function Zo(e){return Zo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Zo(e)}function $o(e,t){return!t||"object"!==ti(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ei(e,t){return ei=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ei(e,t)}var ti=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var ni=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ei(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Zo(t);if(n){var o=Zo(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return $o(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,"vector3AndScalarToVector4","\nvoid vector3AndScalarToVector4(in vec3 xyz, in float w, out vec4 outValue) {\n outValue.x = xyz.x;\n outValue.y = xyz.y;\n outValue.z = xyz.z;\n outValue.w = w;\n}\n")).__inputs.push({compositionType:w.d.Vec3,componentType:x.r.Float,name:"xyz"}),e.__inputs.push({compositionType:w.d.Scalar,componentType:x.r.Float,name:"w"}),e.__outputs.push({compositionType:w.d.Vec4,componentType:x.r.Float,name:"outValue"}),e}return o}(Qn);function ri(e){return ri=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ri(e)}function oi(e,t){return!t||"object"!==ai(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ii(e,t){return ii=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ii(e,t)}var ai=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var si=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ii(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=ri(t);if(n){var o=ri(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return oi(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,"viewMatrix","\nvoid viewMatrix(out mat4 outValue) {\n float cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID}*/];\n outValue = get_viewMatrix(cameraSID, 0);\n}\n")).__outputs.push({compositionType:w.d.Mat4,componentType:x.r.Float,name:"outValue"}),e}return o}(Qn);function ci(e){return ci=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ci(e)}function li(e,t){return!t||"object"!==fi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function ui(e,t){return ui=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ui(e,t)}var fi=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var _i=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ui(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=ci(t);if(n){var o=ci(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return li(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,"wireframe","bool wireframe(\n in vec4 existingFragColor,\n in vec4 wireframeColor,\n out vec4 outColor\n) {\n vec3 wireframeInfo = get_wireframe(a_instanceInfo.x);\n\n // Wireframe\n float threshold = 0.001;\n float wireframeWidthInner = wireframeInfo.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframeInfo.x > 0.5 && wireframeInfo.y < 0.5) {\n outColor.a = 0.0;\n }\n vec4 wireframeResult = existingFragColor;\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + existingFragColor.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(existingFragColor.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframeInfo.x > 0.5) {\n outColor = wireframeResult;\n if (wireframeInfo.y < 0.5 && existingFragColor.a == 0.0) {\n discard;\n }\n }\n}\n")).__inputs.push({compositionType:w.d.Vec4,componentType:x.r.Float,name:"existingFragColor"}),e.__inputs.push({compositionType:w.d.Vec4,componentType:x.r.Float,name:"wireframeColor"}),e.__outputs.push({compositionType:w.d.Vec4,componentType:x.r.Float,name:"outColor"}),e}return o}(Qn);function hi(e){return hi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},hi(e)}function di(e,t){return!t||"object"!==vi(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function mi(e,t){return mi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},mi(e,t)}var vi=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var pi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&mi(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=hi(t);if(n){var o=hi(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return di(this,e)});function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=r.call(this,"worldMatrix","\nvoid worldMatrix(out mat4 outValue) {\n outValue = get_worldMatrix(a_instanceInfo.x);\n}\n")).__outputs.push({compositionType:w.d.Mat4,componentType:x.r.Float,name:"outValue"}),e}return o}(Qn),yi=n(3297),Ai=n(6165),bi=n(9305),gi=n(5995),xi=n(7403),Ii=n(1811),Ei=n(3279),wi=n(678),Si=n(5757),Ti=n(4878);function Ci(e){return Ci=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ci(e)}function Pi(e,t){return!t||"object"!==Di(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ri(e,t){return Ri=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ri(e,t)}var Di=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var Mi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ri(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Ci(t);if(n){var o=Ci(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Pi(this,e)});function o(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),e=r.call(this,null,"envConstantShading",{},Si.Z,Ti.Z);var t=[{semantic:o.EnvHdriFormat,componentType:x.r.Int,compositionType:w.d.Scalar,stage:Xn.H.PixelShader,isCustomSetting:!1,updateInterval:wi.a.EveryTime,soloDatum:!1,initialValue:Ii.Ru.fromCopyNumber(0),min:0,max:5},{semantic:o.envRotation,componentType:x.r.Float,compositionType:w.d.Scalar,stage:Xn.H.PixelShader,isCustomSetting:!1,updateInterval:wi.a.EveryTime,soloDatum:!1,initialValue:Ii.Ru.fromCopyNumber(0),min:-Math.PI,max:Math.PI},{semantic:A.f5.DiffuseColorFactor,componentType:x.r.Float,compositionType:w.d.Vec4,stage:Xn.H.PixelShader,isCustomSetting:!1,updateInterval:wi.a.EveryTime,soloDatum:!1,initialValue:R.Lt.fromCopyArray([1,1,1,1]),min:0,max:2},{semantic:A.f5.ColorEnvTexture,componentType:x.r.Int,compositionType:w.d.TextureCube,stage:Xn.H.PixelShader,isCustomSetting:!1,updateInterval:wi.a.EveryTime,initialValue:[0,Ln.P.__dummyBlackCubeTexture],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:A.f5.MakeOutputSrgb,compositionType:w.d.Scalar,componentType:x.r.Bool,stage:Xn.H.PixelShader,min:0,max:1,isCustomSetting:!1,updateInterval:wi.a.FirstTimeOnly,initialValue:Ii.Ru.fromCopyNumber(1)}];return e.setShaderSemanticsInfoArray(t),e}return o.prototype._setCustomSettingParametersToGpu=function(e){e.material;var t=e.shaderProgram,n=(e.firstTime,e.args);n.setUniform&&(this.setWorldMatrix(t,n.worldMatrix),this.setNormalMatrix(t,n.normalMatrix));var r=n.renderPass.cameraComponent;null==r&&(r=c.C.getComponent(Ei.M,Ei.M.current)),r&&(this.setViewInfo(t,r,n.isVr,n.displayIdx),this.setProjection(t,r,n.isVr,n.displayIdx))},o}(Ln.P);Mi.envRotation=new A.wy({str:"envRotation"}),Mi.EnvHdriFormat=new A.wy({str:"envHdriFormat"});var Bi=n(8563),Ni=n(1668),Oi=n(1349),Li=n(6105),Fi=n(1181),Gi=n(3673),Vi=n(7862),zi=n(2653),ki=n(9573),Ui=n(8355),Qi=n(5527),ji=n(4341),Wi=n(7906),Xi=n(5511),Hi=(n(2612),n(4356)),qi=n(1138);function Yi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ki(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Ji(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,Ki(e,t,"get"))}function Zi(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,Ki(e,t,"set"),n),n}function $i(e,t){for(var n=0;no?s=(a=Math.min(r,t))*i:a=(s=Math.min(o,t))/i,n.width=a,n.height=s;var c=n.getContext("2d");if(c.drawImage(e,0,0,e.width,e.height,0,0,a,s),this.autoDetectTransparency){this.__imageData=c.getImageData(0,0,a,s);for(var l=0;l1&&void 0!==arguments[1]?arguments[1]:{},n=t.level,r=void 0===n?0:n,o=t.internalFormat,i=void 0===o?It.d.RGBA8:o,a=t.format,s=void 0===a?Et.V.RGBA:a,c=t.type,l=void 0===c?x.r.UnsignedByte:c,u=t.magFilter,f=void 0===u?It.d.Linear:u,_=t.minFilter,h=void 0===_?It.d.Linear:_,d=t.wrapS,m=void 0===d?It.d.ClampToEdge:d,v=t.wrapT,p=void 0===v?It.d.ClampToEdge:v,y=t.generateMipmap,A=void 0!==y&&y,b=t.anisotropy,g=void 0!==b&&b,I=t.isPremultipliedAlpha,E=void 0!==I&&I,w=t.mutedAutoPlay,S=void 0===w||w;this.__startedToLoad=!0,Zi(this,oa,e),S&&(e.autoplay=!0,e.muted=!0);var T=e;this.__width=T.videoWidth,this.__height=T.videoHeight;var C=ht.F.getWebGLResourceRepository(),P=C.createTextureFromImageBitmapData(T,{level:r,internalFormat:i,width:this.__width,height:this.__height,border:0,format:s,type:l,magFilter:f,minFilter:h,wrapS:m,wrapT:p,generateMipmap:A,anisotropy:g,isPremultipliedAlpha:E}),R=P.textureHandle;P.samplerHandle,this._textureResourceUid=R,this.__isTextureReady=!0,this.__uri=e.src,Hi.y.__textureMap.set(R,this)},s.generateTextureFromUri=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.level,r=void 0===n?0:n,o=t.internalFormat,i=void 0===o?It.d.RGBA8:o,a=t.format,s=void 0===a?Et.V.RGBA:a,c=t.type,l=void 0===c?x.r.UnsignedByte:c,u=t.magFilter,f=void 0===u?It.d.Linear:u,_=t.minFilter,h=void 0===_?It.d.Linear:_,d=t.wrapS,m=void 0===d?It.d.ClampToEdge:d,v=t.wrapT,p=void 0===v?It.d.ClampToEdge:v,y=t.generateMipmap,A=void 0!==y&&y,b=t.anisotropy,g=void 0!==b&&b,I=t.isPremultipliedAlpha,E=void 0!==I&&I,w=t.mutedAutoPlay,S=void 0===w||w,T=t.playButtonDomElement,C=void 0===T?void 0:T,P=this;return this.__uri=e,this.__startedToLoad=!0,new Promise((function(t,n){var o=function(){P.__width=a.videoWidth,P.__height=a.videoHeight;var e=ht.F.getWebGLResourceRepository().createTextureFromImageBitmapData(a,{level:r,internalFormat:i,width:P.__width,height:P.__height,border:0,format:s,type:l,magFilter:f,minFilter:h,wrapS:m,wrapT:p,generateMipmap:A,anisotropy:g,isPremultipliedAlpha:E}),n=e.textureHandle;e.samplerHandle,P._textureResourceUid=n,P.__isTextureReady=!0,t()};null==C||C.addEventListener("click",(function(){o(),a.play()}),!0);var a=document.createElement("video");a.crossOrigin="anonymous",a.setAttribute("playsinline","playsinline"),S&&(a.autoplay=!0,a.muted=!0),a.preload="auto",Zi(P,oa,a),a.addEventListener("canplaythrough",(function(){o(),a.play()}),!0),a.addEventListener("ended",(function(){a.play()}),!0),a.src=e}))},s.updateTexture=function(){var e=ht.F.getWebGLResourceRepository();this.__isTextureReady&&Ji(this,oa)&&e.updateTexture(this._textureResourceUid,Ji(this,oa),{level:0,xoffset:0,yoffset:0,width:this.__width,height:this.__height,format:Et.V.RGBA,type:x.r.UnsignedByte})},s.getCurrentFramePixelData=function(){var e=void 0,t=ht.F.getWebGLResourceRepository();return this.__isTextureReady&&Ji(this,oa)&&(e=t.getPixelDataFromTexture(this._textureResourceUid,0,0,this.width,this.height)),[e,this.width,this.height]},s.play=function(){var e;null===(e=Ji(this,oa))||void 0===e||e.play()},s.pause=function(){Ji(this,oa).pause()},i=o,(a=[{key:"playbackRate",get:function(){var e,t=null===(e=Ji(this,oa))||void 0===e?void 0:e.playbackRate;return null!=t?t:1},set:function(e){Ji(this,oa)&&(Ji(this,oa).playbackRate=e)}}])&&$i(i.prototype,a),o}(Hi.y);ia.__loadedBasisFunc=!1},3297:(e,t,n)=>{n.d(t,{h:()=>g});var r=n(4356),o=n(3279),i=n(3932),a=n(6383),s=n(2535),c=n(7416),l=n(5685),u=n(678),f=n(9294),_=n(7102),h=n(7011);const d={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord;\nin vec3 a_position;\n\nout vec2 v_texcoord;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n v_texcoord = a_texcoord;\n}\n",shaderStage:"vertex",isFragmentShader:!1},m={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec2 v_texcoord;\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec4 textureColor = texture(u_baseColorTexture, v_texcoord);\n\n float r = textureColor.r;\n float g = textureColor.g;\n float b = textureColor.b;\n float r16 = r * 15.0;\n float g16 = g * 15.0;\n float b16 = b * 15.0;\n float rInt = floor(r16);\n float gInt = floor(g16);\n float bInt = floor(b16);\n\n float rRate, gRate, bRate;\n float rIntAdjust, gIntAdjust, bIntAdjust;\n\n vec3 newColor = vec3(0.0);\n for(int i=0; i<8; i++){\n rRate = 1.0 - fract(r16);\n gRate = 1.0 - fract(g16);\n bRate = 1.0 - fract(b16);\n rIntAdjust = rInt;\n gIntAdjust = gInt;\n bIntAdjust = bInt;\n\n if(fract(float(i) / 2.0) != 0.0){\n rIntAdjust += 1.0;\n rRate = 1.0 - rRate;\n }\n if(fract(float(i / 2) / 2.0) != 0.0){\n gIntAdjust += 1.0;\n gRate = 1.0 - gRate;\n }\n if(fract(float(i / 4) / 2.0) != 0.0){\n bIntAdjust += 1.0;\n bRate = 1.0 - bRate;\n }\n\n if( rRate * gRate * bRate != 0.0){\n newColor += texture(u_lookupTableTexture, vec2(rIntAdjust / 256.0 + bIntAdjust / 16.0 + 1.0 / 512.0, gIntAdjust / 16.0 + 1.0 / 32.0)).rgb * rRate * gRate * bRate;\n }\n }\n\n rt0 = vec4(newColor, 1.0);\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};function v(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function y(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e,t){return A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},A(e,t)}var b=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(g,e);var t,n,b=(t=g,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=p(t);if(n){var o=p(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y(this,e)});function g(e,t,n,o){var a,p;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g),a=b.call(this,null,"colorGradingUsingLUTsShading",{},d,m);var y,A,x,I,E,w=e.getFramebuffer();null!=w&&null!=w.colorAttachments[t]?p=w.colorAttachments[t]:(p=h.P.__dummyBlackTexture,null!=w?console.warn("renderPass does not have framebuffer.colorAttachments["+t+"]"):console.warn("renderPass does not have framebuffer")),"string"==typeof n?(y=new f.x,(I=function(e){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{n.d(t,{f:()=>m});var r=n(7416),o=n(7011),i=n(5685),a=n(6383),s=n(3279),c=n(6558),l=n(6670),u=n(9481);function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function _(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}var d=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(d,e);var t,n,u=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=f(t);if(n){var o=f(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return _(this,e)});function d(e){var t,n=e.name,r=e.isMorphing,a=e.isSkinning,s=e.isLighting,c=e.isClearCoat,f=e.isTransmission,_=e.isVolume,h=e.isSheen,m=e.isSpecular,v=e.isIridescence,p=e.isShadow,y=e.useTangentAttribute,A=e.useNormalTexture,b=e.vertexShader,g=e.pixelShader,x=e.noUseCameraTransform,I=e.additionalShaderSemanticInfo;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),t=u.call(this,null,n+(r?"+morphing":"")+(a?"+skinning":"")+(s?"":"-lighting")+(c?"+clearcoat":"")+(f?"+transmission":"")+(_?"+volume":"")+(m?"+specular":"")+(h?"+sheen":"")+(v?"+iridescence":"")+(y?"+tangentAttribute":""),{isMorphing:r,isSkinning:a,isLighting:s});var E=l.Q.getShaderDataReflection(b,o.P.__semanticsMap.get(t.shaderFunctionName)),w=l.Q.getShaderDataReflection(g,o.P.__semanticsMap.get(t.shaderFunctionName));t.__vertexShaderityObject=E.shaderityObject,t.__pixelShaderityObject=w.shaderityObject;var S=[],T=!0,C=!1,P=void 0;try{for(var R,D=E.shaderSemanticsInfoArray[Symbol.iterator]();!(T=(R=D.next()).done);T=!0){var M=R.value;M.stage=i.H.VertexShader,S.push(M)}}catch(e){C=!0,P=e}finally{try{T||null==D.return||D.return()}finally{if(C)throw P}}var B=!0,N=!1,O=void 0;try{for(var L,F=function(){var e=L.value,t=S.find((function(t){return t.semantic.str===e.semantic.str}));t?t.stage=i.H.VertexAndPixelShader:(e.stage=i.H.PixelShader,S.push(e))},G=w.shaderSemanticsInfoArray[Symbol.iterator]();!(B=(L=G.next()).done);B=!0)F()}catch(e){N=!0,O=e}finally{try{B||null==G.return||G.return()}finally{if(N)throw O}}return s&&(t.__definitions+="#define RN_IS_LIGHTING\n"),a&&(t.__definitions+="#define RN_IS_SKINNING\n"),r&&(t.__definitions+="#define RN_IS_MORPHING\n"),c&&(t.__definitions+="#define RN_USE_CLEARCOAT\n"),f&&(t.__definitions+="#define RN_USE_TRANSMISSION\n"),_&&(t.__definitions+="#define RN_USE_VOLUME\n"),h&&(t.__definitions+="#define RN_USE_SHEEN\n"),m&&(t.__definitions+="#define RN_USE_SPECULAR\n"),v&&(t.__definitions+="#define RN_USE_IRIDESCENCE\n"),p&&(t.__definitions+="#define RN_USE_SHADOW_MAPPING\n"),y&&(t.__definitions+="#define RN_USE_TANGENT_ATTRIBUTE\n"),A&&(t.__definitions+="#define RN_USE_NORMAL_TEXTURE\n"),x&&(t.__definitions+="#define RN_NO_CAMERA_TRANSFORM\n"),t.setShaderSemanticsInfoArray(S.concat(I)),t}return d.prototype._setCustomSettingParametersToGpu=function(e){var t=e.material,n=e.shaderProgram,i=e.firstTime,c=e.args;if(c.setUniform){if(this.setWorldMatrix(n,c.worldMatrix),this.setNormalMatrix(n,c.normalMatrix),this.setIsBillboard(n,c.isBillboard),i||c.isVr){var l=c.renderPass.cameraComponent;null==l&&(l=a.C.getComponent(s.M,s.M.current)),this.setViewInfo(n,l,c.isVr,c.displayIdx),this.setProjection(n,l,c.isVr,c.displayIdx)}i&&this.setLightsInfo(n,c.lightComponents,t,c.setUniform);var u=c.entity.tryToGetSkeletal();this.setSkinning(n,c.setUniform,u)}if(c.diffuseCube&&c.diffuseCube.isTextureReady?this.__webglResourceRepository.setUniformValue(n,r.f5.DiffuseEnvTexture.str,i,[5,c.diffuseCube]):this.__webglResourceRepository.setUniformValue(n,r.f5.DiffuseEnvTexture.str,i,[5,o.P.__dummyBlackCubeTexture]),c.specularCube&&c.specularCube.isTextureReady?this.__webglResourceRepository.setUniformValue(n,r.f5.SpecularEnvTexture.str,i,[6,c.specularCube]):this.__webglResourceRepository.setUniformValue(n,r.f5.SpecularEnvTexture.str,i,[6,o.P.__dummyBlackCubeTexture]),c.setUniform){if(i){var f=d.__setupHdriParameters(c),_=f.mipmapLevelNumber,h=f.meshRenderComponent,m=f.diffuseHdriType,v=f.specularHdriType;this.__webglResourceRepository.setUniformValue(n,r.f5.IBLParameter.str,i,{x:_,y:h.diffuseCubeMapContribution,z:h.specularCubeMapContribution,w:h.rotationOfCubeMap}),this.__webglResourceRepository.setUniformValue(n,r.f5.HDRIFormat.str,i,{x:m,y:v})}}else{var p=d.__setupHdriParameters(c),y=p.mipmapLevelNumber,A=p.meshRenderComponent,b=p.diffuseHdriType,g=p.specularHdriType,x=o.P.__tmp_vector4;x.x=y,x.y=A.diffuseCubeMapContribution,x.z=A.specularCubeMapContribution,x.w=A.rotationOfCubeMap,t.setParameter(r.f5.IBLParameter,x);var I=o.P.__tmp_vector2;I.x=b,I.y=g,t.setParameter(r.f5.HDRIFormat,I)}var E=c.entity.tryToGetBlendShape();this.setMorphInfo(n,c.entity.getMesh(),c.primitive,E);var w=c.glw.canvas.width,S=c.glw.canvas.height,T=d.__globalDataRepository.getValue(r.f5.BackBufferTextureSize,0);T._v[0]=w,T._v[1]=S,n._gl.uniform2fv(n.backBufferTextureSize,T._v);var C=d.__globalDataRepository.getValue(r.f5.VrState,0);C._v[0]=c.isVr?1:0,C._v[1]=c.displayIdx,n._gl.uniform2iv(n.vrState,C._v)},d.__setupHdriParameters=function(e){var t=1;e.specularCube&&(t=e.specularCube.mipmapLevelNumber);var n=e.entity.getMeshRenderer(),r=c.c.LDR_SRGB.index,o=c.c.LDR_SRGB.index;return n.diffuseCubeMap&&(r=n.diffuseCubeMap.hdriFormat.index),n.specularCubeMap&&(o=n.specularCubeMap.hdriFormat.index),{mipmapLevelNumber:t,meshRenderComponent:n,diffuseHdriType:r,specularHdriType:o}},d}(o.P);m.__globalDataRepository=u.$.getInstance()},9305:(e,t,n)=>{n.d(t,{Q:()=>A});var r=n(7011),o=n(3279),i=n(6383),a=n(2535),s=n(3932),c=n(1811),l=n(7416),u=n(5685),f=n(678),_=n(6860);const h={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec3 v_normal_inWorld;\nout vec4 v_position_inLocal;\nout vec4 v_position_inWorld;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n v_position_inLocal = gl_Position;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},d={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec4 v_position_inLocal;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvec4 encodeDepthToRGBA(float depth){\n float r = depth;\n float g = fract(r * 255.0);\n float b = fract(g * 255.0);\n float a = fract(b * 255.0);\n float coef = 1.0 / 255.0;\n r -= g * coef;\n g -= b * coef;\n b -= a * coef;\n return vec4(r, g, b, a);\n}\n\nvoid main (){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n float depth;\n bool isPointLight = get_isPointLight(materialSID, 0);\n if(isPointLight){\n float zNear = get_zNearInner(materialSID, 0);\n float zFar = get_zFarInner(materialSID, 0);\n float normalizationCoefficient = 1.0 / (zFar - zNear);\n depth = normalizationCoefficient * length(v_position_inLocal);\n }else{\n depth = gl_FragCoord.z;\n }\n\n float depthPow = get_depthPow(materialSID, 0);\n float depthData = pow(depth, depthPow);\n vec4 encodedDepth = encodeDepthToRGBA(depthData);\n\n rt0 = encodedDepth;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function v(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}var y=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(y,e);var t,n,r=(t=y,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var o=m(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return v(this,e)});function y(e,t){var n,o=t.isSkinning;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),(n=r.call(this,null,"depthEncodeShading"+(o?"+skinning":""),{isMorphing:!1,isSkinning:o,isLighting:!1},h,d)).__lastZNear=0,n.__lastZFar=0;var i=[{semantic:y.zNearInner,componentType:a.r.Float,compositionType:s.d.Scalar,stage:u.H.PixelShader,isCustomSetting:!0,updateInterval:f.a.FirstTimeOnly,soloDatum:!1,initialValue:c.Ru.fromCopyNumber(.1),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:y.zFarInner,componentType:a.r.Float,compositionType:s.d.Scalar,stage:u.H.PixelShader,isCustomSetting:!0,updateInterval:f.a.FirstTimeOnly,soloDatum:!1,initialValue:c.Ru.fromCopyNumber(1e4),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:y.isPointLight,componentType:a.r.Bool,compositionType:s.d.Scalar,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!1,initialValue:c.Ru.fromCopyNumber(1),min:0,max:1},{semantic:y.depthPow,componentType:a.r.Float,compositionType:s.d.Scalar,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!1,initialValue:c.Ru.fromCopyNumber(e),min:1,max:2},{semantic:l.f5.PointSize,componentType:a.r.Float,compositionType:s.d.Scalar,stage:u.H.VertexShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!0,initialValue:c.Ru.fromCopyNumber(30),min:0,max:100},{semantic:l.f5.PointDistanceAttenuation,componentType:a.r.Float,compositionType:s.d.Vec3,stage:u.H.VertexShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!0,initialValue:_.P.fromCopyArray([0,.1,.01]),min:0,max:1}];return o&&(n.__definitions+="#define RN_IS_SKINNING"),n.setShaderSemanticsInfoArray(i),n}return y.prototype._setCustomSettingParametersToGpu=function(e){var t=e.material,n=e.shaderProgram,r=e.firstTime,a=e.args,s=a.renderPass.cameraComponent;null==s&&(s=i.C.getComponent(o.M,o.M.current)),a.setUniform?(this.setWorldMatrix(n,a.worldMatrix),this.setNormalMatrix(n,a.normalMatrix),this.setViewInfo(n,s,a.isVr,a.displayIdx),this.setProjection(n,s,a.isVr,a.displayIdx),(r||this.__lastZNear!==s.zNearInner)&&(n._gl.uniform1f(n.zNearInner,s.zNearInner),this.__lastZNear=s.zNearInner),this.__lastZFar!==s.zFarInner&&(n._gl.uniform1f(n.zFarInner,s.zFarInner),this.__lastZFar=s.zFarInner)):(t.setParameter(y.zNearInner,s.zNearInner),t.setParameter(y.zFarInner,s.zFarInner));var c=a.entity.tryToGetSkeletal();this.setSkinning(n,a.setUniform,c)},y}(r.P);A.zNearInner=new l.wy({str:"zNearInner"}),A.zFarInner=new l.wy({str:"zFarInner"}),A.isPointLight=new l.wy({str:"isPointLight"}),A.depthPow=new l.wy({str:"depthPow"})},5995:(e,t,n)=>{n.d(t,{t:()=>y});var r=n(7416),o=n(3932),i=n(2535),a=n(5685),s=n(678),c=n(6383),l=n(3279),u=n(1811),f=n(7011);const _={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec3 a_position;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},h={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n\tfloat tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n vec4 baseColor = texture(u_baseColorTexture, offset * tFrag);\n\n float luminance = length(baseColor);\n\n float luminanceCriterion = get_luminanceCriterion(materialSID, 0);\n if(luminance < luminanceCriterion){\n baseColor = vec4(0.0);\n }else{\n float luminanceReduce = get_luminanceReduce(materialSID, 0);\n baseColor.rgb = pow(baseColor.rgb, vec3(luminanceReduce));\n }\n\n rt0 = baseColor;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function m(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}var p=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(y,e);var t,n,p=(t=y,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=d(t);if(n){var o=d(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return m(this,e)});function y(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),n=p.call(this,null,"HighLuminanceDetectShading",{},_,h);var c,l,d=[{semantic:y.LuminanceCriterion,componentType:i.r.Float,compositionType:o.d.Scalar,stage:a.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.FirstTimeOnly,soloDatum:!1,initialValue:u.Ru.fromCopyNumber(2),min:0,max:Number.MAX_VALUE},{semantic:y.LuminanceReduce,componentType:i.r.Float,compositionType:o.d.Scalar,stage:a.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.FirstTimeOnly,soloDatum:!1,initialValue:u.Ru.fromCopyNumber(.25),min:0,max:1}],m=e.getFramebuffer();return null!=m&&null!=m.colorAttachments[t]?(c=m.colorAttachments[t],l=m.width):(c=f.P.__dummyBlackTexture,l=1,null!=m?console.warn("renderPass does not have framebuffer.colorAttachments["+t+"]"):console.warn("renderPass does not have framebuffer")),d.push({semantic:r.f5.FramebufferWidth,componentType:i.r.Float,compositionType:o.d.Scalar,stage:a.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.EveryTime,soloDatum:!1,initialValue:u.Ru.fromCopyNumber(l),min:0,max:Number.MAX_VALUE},{semantic:r.f5.BaseColorTexture,componentType:i.r.Int,compositionType:o.d.Texture2D,stage:a.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.EveryTime,initialValue:[0,c],min:0,max:Number.MAX_SAFE_INTEGER}),n.setShaderSemanticsInfoArray(d),n}return y.prototype._setCustomSettingParametersToGpu=function(e){e.material;var t=e.shaderProgram,n=(e.firstTime,e.args);n.setUniform&&this.setWorldMatrix(t,n.worldMatrix);var r=n.renderPass.cameraComponent;null==r&&(r=c.C.getComponent(l.M,l.M.current)),r&&(this.setViewInfo(t,r,n.isVr,n.displayIdx),this.setProjection(t,r,n.isVr,n.displayIdx))},y}(f.P);y.LuminanceCriterion=new r.wy({str:"luminanceCriterion"}),y.LuminanceReduce=new r.wy({str:"luminanceReduce"}),y.FramebufferWidth=new r.wy({str:"framebufferWidth"})},7403:(e,t,n)=>{n.d(t,{z:()=>g});var r=n(7416),o=n(7011),i=n(3932),a=n(2535),s=n(6860),c=n(5685),l=n(1811),u=n(678),f=n(6383),_=n(3279),h=n(8289),d=n(2863);const m={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout float v_instanceInfo;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\n\nvoid main()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n v_instanceInfo = a_instanceInfo.x;\n}\n",shaderStage:"vertex",isFragmentShader:!1},v={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin float v_instanceInfo;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nconst vec4 bitEnc = vec4(1.,255.,65025.,16581375.);\nconst vec4 bitDec = 1./bitEnc;\n\nvec4 encodeFloatRGBA(float v) {\n float val = v;\n float r = mod(val, 255.0);\n val -= r;\n float g = mod(val, 65025.0);\n val -= g;\n float b = mod(val, 16581375.0);\n return vec4(r/255.0, g/65025.0, b/16581375.0, 1.0);\n}\n\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n rt0 = encodeFloatRGBA(v_instanceInfo);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function y(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e,t){return A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},A(e,t)}var b=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&A(e,t)}(b,e);var t,n,o=(t=b,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=p(t);if(n){var o=p(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return y(this,e)});function b(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,b),e=o.call(this,null,"entityUidOutputShading+skinning-lighting",{isMorphing:!1,isSkinning:!0,isLighting:!1},m,v);var t=[{semantic:r.f5.WorldMatrix,isComponentData:!0,compositionType:i.d.Mat4,componentType:a.r.Float,stage:c.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.EveryTime,initialValue:h.e.zero()},{semantic:r.f5.NormalMatrix,isComponentData:!0,compositionType:i.d.Mat3,componentType:a.r.Float,stage:c.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.EveryTime,initialValue:d.x.zero()},{semantic:r.f5.PointSize,componentType:a.r.Float,compositionType:i.d.Scalar,stage:c.H.VertexShader,isCustomSetting:!1,updateInterval:u.a.FirstTimeOnly,soloDatum:!0,initialValue:l.Ru.fromCopyNumber(30),min:0,max:100},{semantic:r.f5.PointDistanceAttenuation,componentType:a.r.Float,compositionType:i.d.Vec3,stage:c.H.VertexShader,isCustomSetting:!1,updateInterval:u.a.FirstTimeOnly,soloDatum:!0,initialValue:s.P.fromCopyArray([0,.1,.01]),min:0,max:1}];return e.__definitions+="#define RN_IS_SKINNING\n",e.setShaderSemanticsInfoArray(t),e}return b.prototype._setCustomSettingParametersToGpu=function(e){var t=e.material,n=e.shaderProgram,r=(e.firstTime,e.args);r.setUniform&&(this.setWorldMatrix(n,r.worldMatrix),this.setNormalMatrix(n,r.normalMatrix));var o=r.renderPass.cameraComponent;null==o&&(o=f.C.getComponent(_.M,_.M.current)),this.setViewInfo(n,o,r.isVr,r.displayIdx),this.setProjection(n,o,r.isVr,r.displayIdx);var i=r.entity.tryToGetSkeletal();this.setSkinning(n,r.setUniform,i),this.setLightsInfo(n,r.lightComponents,t,r.setUniform)},b}(o.P)},8563:(e,t,n)=>{n.d(t,{b:()=>A});var r=n(2535),o=n(3932),i=n(1811),a=n(7416),s=n(5685),c=n(678),l=n(8020),u=n(7011),f=n(6383),_=n(3279);const h={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord;\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec2 v_texcoord;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n v_normal_inWorld = normalMatrix * a_normal;\n v_position_inWorld = worldMatrix * vec4(a_position, 1.0);\n v_texcoord = a_texcoord;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},d={code:'\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec2 v_texcoord;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n\n/* shaderity: @{getters} */\n\n#define MATH_PI 3.141592\n\n// These codes are referenced from https://github.com/knarkowicz/FurnaceTest\nfloat roughnessRemap(float userRoughness) {\n return userRoughness * userRoughness;\n}\n\n// GGX NDF\nfloat d_ggx(float userRoughness, float NH) {\n float alphaRoughness = userRoughness * userRoughness;\n float roughnessSqr = alphaRoughness * alphaRoughness;\n float f = (roughnessSqr - 1.0) * NH * NH + 1.0;\n return roughnessSqr / (MATH_PI * f * f);\n}\n\n// this is from https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 envBRDFApprox( float Roughness, float NoV ) {\n const vec4 c0 = vec4(-1, -0.0275, -0.572, 0.022 );\n const vec4 c1 = vec4(1, 0.0425, 1.04, -0.04 );\n vec4 r = Roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( -9.28 * NoV ) ) * r.x + r.y;\n vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n return AB;\n}\n\nfloat specularIBL(float userRoughness, float NV, float f0) {\n /// Use specular BRDF LUT\n // vec3 brdf = texture(u_brdfLutTexture, vec2(NV, 1.0 - userRoughness)).rgb;\n // float specular = 1.0 * (f0 * brdf.x + brdf.y);\n\n /// Use specular BRDF Approx\n vec2 f_ab = envBRDFApprox(userRoughness, NV);\n vec3 specular = vec3(f0) * f_ab.x + f_ab.y;\n return specular.x;\n}\n\n// The Schlick Approximation to Fresnel\nfloat fresnel(float f0, float VH) {\n return f0 + (1.0 - f0) * pow(1.0 - VH, 5.0);\n}\n\nfloat smithG1(float roughness, float NoV)\n{\n\tfloat a = roughnessRemap( roughness );\n\tfloat a2 = a * a;\n\tfloat NoV2 = NoV * NoV;\n\tfloat lambda = (-1.0 + sqrt(1.0 + a2 * (1.0 - NoV2) / NoV2)) * 0.5;\n\treturn 1.0 / (1.0 + lambda);\n}\n\nfloat smithG(float roughness, float NoV, float NoL)\n{\n\tfloat a = roughnessRemap( roughness );\n\tfloat a2 = a * a;\n\tfloat NoV2 = NoV * NoV;\n\tfloat NoL2 = NoL * NoL;\n\tfloat lambdaV = (-1.0 + sqrt(1.0 + a2 * (1.0 - NoV2) / NoV2)) * 0.5;\n\tfloat lambdaL = (-1.0 + sqrt(1.0 + a2 * (1.0 - NoL2) / NoL2)) * 0.5;\n\treturn 1.0 / (1.0 + lambdaV + lambdaL);\n}\n\nfloat g_shieldingForWeak(float alphaRoughness, float NV, float NL) {\n float r = alphaRoughness;\n\n // Local Masking using "Schlick-Smith" Masking Function\n float localMasking = 2.0 * NV / (NV + sqrt(r * r + (1.0 - r * r) * (NV * NV)));\n\n return localMasking;\n}\n\n\nfloat g_shielding(float roughness, float NV, float NL) {\n float a = roughnessRemap( roughness );\n float r = a;\n\n // Local Shadowing using "Schlick-Smith" Masking Function\n float localShadowing = 2.0 * NL / (NL + sqrt(r * r + (1.0 - r * r) * (NL * NL)));\n\n // Local Masking using "Schlick-Smith" Masking Function\n float localMasking = 2.0 * NV / (NV + sqrt(r * r + (1.0 - r * r) * (NV * NV)));\n\n return localShadowing * localMasking;\n}\n\nfloat v_SmithGGXCorrelatedForWeak(float roughness, float NV, float NL) {\n float a = roughnessRemap( roughness );\n float a2 = a * a;\n float GGXV = NL * sqrt(NV * NV * (1.0 - a2) + a2);\n return 0.5 / (GGXV);\n}\n\nfloat v_SmithGGXCorrelated(float roughness, float NV, float NL) {\n float a = roughnessRemap( roughness );\n float a2 = a * a;\n float GGXV = NL * sqrt(NV * NV * (1.0 - a2) + a2);\n float GGXL = NV * sqrt(NL * NL * (1.0 - a2) + a2);\n return 0.5 / (GGXV + GGXL);\n}\n\n// this is from https://learnopengl.com/PBR/IBL/Specular-IBL\nfloat vanDerCorpus(int n, int base)\n{\n float invBase = 1.0 / float(base);\n float denom = 1.0;\n float result = 0.0;\n\n for(int i = 0; i < 32; ++i)\n {\n if(n > 0)\n {\n denom = mod(float(n), 2.0);\n result += denom * invBase;\n invBase = invBase / 2.0;\n n = int(float(n) / 2.0);\n }\n }\n\n return result;\n}\n\nvec2 hammersleyNoBitOps(int i, int N)\n{\n return vec2(float(i)/float(N), vanDerCorpus(i, 2));\n}\n\nfloat radicalInverse_VdC(uint bits)\n{\n bits = (bits << 16u) | (bits >> 16u);\n bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\n bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\n bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\n bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\n return float(bits) * 2.3283064365386963e-10; // / 0x100000000\n}\n// ----------------------------------------------------------------------------\nvec2 hammersley(uint i, uint N)\n{\n return vec2(float(i)/float(N), radicalInverse_VdC(i));\n}\n\nvec3 sampleHemisphereGGX(vec2 Xi, float roughness) {\n float a = roughnessRemap(roughness);\n\tfloat a2 = a * a;\n\n float phi = 2.0 * MATH_PI * Xi.x;\n float cosPhi = cos(phi);\n float sinPhi = sin(phi);\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a2 - 1.0) * Xi.y)); // GGX\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\n\n return vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\n}\n\nfloat weakWhiteFurnaceTest(float roughness, float NoV, float f0, int g_type, int disable_fresnel)\n{\n\tfloat vx = sqrt(1.0 - NoV * NoV);\n\tfloat vy = 0.0;\n\tfloat vz = NoV;\n\n\tfloat integral = 0.0;\n\tconst uint sampleNum = 2048u;\n\tfor (uint i = 0u; i < sampleNum; ++i)\n\t{\n vec2 Xi = hammersley(i, sampleNum);\n\n vec3 hvec = sampleHemisphereGGX(Xi, roughness);\n\n\t\tfloat VoHUnsat = vx * hvec.x + vy * hvec.y + vz * hvec.z;\n\n float lz = 2.0 * VoHUnsat * hvec.z - vz;\n\n float NoL = max(lz, 0.0);\n\t\tfloat NoH = max(hvec.z, 0.0);\n\t\tfloat VoH = max(VoHUnsat, 0.0);\n\n float f = fresnel(f0, VoH);\n\n float g1 = 0.0;\n if (g_type == 0) {\n g1 = smithG1(roughness, NoV);\n } else if (g_type == 1) {\n g1 = g_shieldingForWeak(roughness, NoV, NoL);\n } else if (g_type == 2) {\n g1 = v_SmithGGXCorrelatedForWeak(roughness, NoV, NoL) * 4.0 * NoV * NoL;\n }\n\n float pdf = 4.0 * VoH / NoH;\n float integralValue = (g1 * pdf) / (4.0 * NoV);\n if (disable_fresnel == 0) {\n integralValue *= f;\n }\n // integralValue *= 0.5; // Set furnace color 0.5\n\n integral += integralValue;\n\n\t}\n\tintegral /= float(sampleNum);\n\treturn clamp(integral, 0.0, 1.0);\n}\n\nfloat whiteFurnaceTest(float roughness, float NoV, float f0, int g_type, int disable_fresnel)\n{\n\tfloat vx = sqrt(1.0 - NoV * NoV);\n\tfloat vy = 0.0;\n\tfloat vz = NoV;\n\n\tfloat integral = 0.0;\n\tconst uint sampleNum = 4096u;\n\tfor (uint i = 0u; i < sampleNum; ++i)\n\t{\n\n vec2 Xi = hammersley(i, sampleNum);\n\n vec3 hvec = sampleHemisphereGGX(Xi, roughness);\n\n\t\tfloat VoHUnsat = vx * hvec.x + vy * hvec.y + vz * hvec.z;\n\t\tfloat lx = 2.0 * VoHUnsat * hvec.x - vx;\n\t\tfloat ly = 2.0 * VoHUnsat * hvec.y - vy;\n\t\tfloat lz = 2.0 * VoHUnsat * hvec.z - vz;\n\n\t\tfloat NoL = max(lz, 0.0);\n\t\tfloat NoH = max(hvec.z, 0.0);\n float VoH = max(VoHUnsat, 0.0);\n\n float f = fresnel(f0, VoH);\n\n float g = 0.0;\n if (g_type == 0) {\n g = smithG(roughness, NoV, NoL);\n } else if (g_type == 1){\n g = g_shielding(roughness, NoV, NoL);\n } else if (g_type == 2){\n g = v_SmithGGXCorrelated(roughness, NoV, NoL) * (4.0 * NoV * NoL);\n } else if (g_type == 3) {\n g = 0.0;\n }\n\n float pdf = 4.0 * VoH / NoH;\n float integralValue = (g * pdf) / (4.0 * NoV);\n if (disable_fresnel == 0 && g_type != 3) {\n integralValue *= f;\n }\n // integralValue *= 0.5; // Set furnace color 0.5\n integral += integralValue;\n\t}\n integral /= float(sampleNum);\n if (g_type == 3) {\n integral = specularIBL(roughness, NoV, f0);\n }\n\treturn clamp(integral, 0.0, 1.0);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec2 quadSizeInPixel = get_screenInfo(materialSID, 0);\n float roughness = 0.0;\n float NoV = 0.0; // normal dot view vector\n\n // 2D mode\n int mode = get_mode(materialSID, 0);\n if (mode == 0) {\n roughness = (gl_FragCoord.y) / quadSizeInPixel.y;\n NoV = (gl_FragCoord.x) / quadSizeInPixel.x;\n } else {\n // object mode\n // Roughness\n const float c_MinRoughness = 0.04;\n vec2 metallicRoughnessFactor = get_metallicRoughnessFactor(materialSID, 0);\n float userRoughness = metallicRoughnessFactor.y;\n float metallic = metallicRoughnessFactor.x;\n\n vec4 ormTexel = texture(u_metallicRoughnessTexture, v_texcoord);\n userRoughness = ormTexel.g * userRoughness;\n userRoughness = clamp(userRoughness, c_MinRoughness, 1.0);\n roughness = userRoughness;\n\n // vec3 viewVector = normalize(vec3(0.0, 0.0, 10.0) - v_position_inWorld.xyz);\n // vec3 viewVector = normalize(u_viewPosition - v_position_inWorld.xyz);\n vec3 viewVector = vec3(0.0, 0.0, 1.0);\n NoV = dot(v_normal_inWorld, viewVector);\n }\n\n int debugView = get_debugView(materialSID, 0);\n float f0 = get_f0(materialSID, 0);\n int g_type = get_g_type(materialSID, 0);\n int disable_fresnel = get_disable_fresnel(materialSID, 0);\n\n if (debugView == 0) {\n float whiteFurnaceResult = whiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n rt0 = vec4(whiteFurnaceResult, whiteFurnaceResult, whiteFurnaceResult, 1.0);\n\n } else if (debugView == 1) {\n float weakWhiteFurnaceResult = weakWhiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n rt0 = vec4(weakWhiteFurnaceResult, weakWhiteFurnaceResult, weakWhiteFurnaceResult, 1.0);\n\n } else if (debugView == 2){\n float nn = NoV*0.5+0.5;\n rt0 = vec4(nn, nn, nn, 1.0);\n\n } else if (debugView == 3){\n rt0 = vec4(v_normal_inWorld.xyz, 1.0);\n\n } else if (debugView == 4){\n float whiteFurnaceResult = whiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n float weakWhiteFurnaceResult = weakWhiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n rt0 = vec4(whiteFurnaceResult, weakWhiteFurnaceResult, 0.0, 1.0);\n\n } else if (debugView == 5){\n rt0 = vec4(roughness, NoV, 0.0, 1.0);\n\n } else {\n rt0 = vec4(1.0, 1.0, 1.0, 1.0);\n }\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n',shaderStage:"fragment",isFragmentShader:!0};function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function v(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}var y=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(A,e);var t,n,y=(t=A,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var o=m(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return v(this,e)});function A(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,A),e=y.call(this,null,"FurnaceTestShading",{},h,d);var t=[{semantic:A.debugView,componentType:r.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.FirstTimeOnly,soloDatum:!1,initialValue:i.Ru.fromCopyNumber(0),min:0,max:1},{semantic:A.disable_fresnel,componentType:r.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.FirstTimeOnly,soloDatum:!1,initialValue:i.Ru.fromCopyNumber(0),min:0,max:1},{semantic:A.f0,componentType:r.r.Float,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.FirstTimeOnly,soloDatum:!1,initialValue:i.Ru.fromCopyNumber(1),min:0,max:1},{semantic:A.g_type,componentType:r.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.FirstTimeOnly,soloDatum:!1,initialValue:i.Ru.fromCopyNumber(0),min:0,max:3},{semantic:A.mode,componentType:r.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.FirstTimeOnly,soloDatum:!1,initialValue:i.Ru.fromCopyNumber(0),min:0,max:1},{semantic:a.f5.ScreenInfo,componentType:r.r.Float,compositionType:o.d.Vec2,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.FirstTimeOnly,soloDatum:!1,initialValue:l.FM.fromCopyArray2([0,0]),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:a.f5.MetallicRoughnessFactor,componentType:r.r.Float,compositionType:o.d.Vec2,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.FirstTimeOnly,soloDatum:!1,initialValue:l.FM.fromCopyArray2([1,1]),min:0,max:2},{semantic:a.f5.MetallicRoughnessTexture,componentType:r.r.Int,compositionType:o.d.Texture2D,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.FirstTimeOnly,initialValue:[1,u.P.__dummyWhiteTexture],min:0,max:Number.MAX_SAFE_INTEGER}];return e.setShaderSemanticsInfoArray(t),e}return A.prototype._setCustomSettingParametersToGpu=function(e){var t=e.material,n=e.shaderProgram,r=e.firstTime,o=e.args;if(o.setUniform&&(this.setWorldMatrix(n,o.worldMatrix),this.setNormalMatrix(n,o.normalMatrix),r)){var i=o.renderPass.cameraComponent;null==i&&(i=f.C.getComponent(_.M,_.M.current)),this.setViewInfo(n,i,o.isVr,o.displayIdx),this.setProjection(n,i,o.isVr,o.displayIdx),this.setLightsInfo(n,o.lightComponents,t,o.setUniform)}},A}(u.P);A.mode=new a.wy({str:"mode"}),A.debugView=new a.wy({str:"debugView"}),A.g_type=new a.wy({str:"g_type"}),A.disable_fresnel=new a.wy({str:"disable_fresnel"}),A.f0=new a.wy({str:"f0"})},1668:(e,t,n)=>{n.d(t,{_:()=>A});var r=n(3279),o=n(3932),i=n(6383),a=n(2535),s=n(1811),c=n(7416),l=n(5685),u=n(678),f=n(7011),_=n(2175);const h={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec3 a_position;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},d={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\nfloat decodeRGBAToDepth(vec4 RGBA){\n const float rMask = 1.0;\n const float gMask = 1.0 / 255.0;\n const float bMask = 1.0 / (255.0 * 255.0);\n const float aMask = 1.0 / (255.0 * 255.0 * 255.0);\n float depth = dot(RGBA, vec4(rMask, gMask, bMask, aMask));\n return depth;\n}\n\nvec4 encodeDepthToRGBA(float depth){\n float r = depth;\n float g = fract(r * 255.0);\n float b = fract(g * 255.0);\n float a = fract(b * 255.0);\n float coef = 1.0 / 255.0;\n r -= g * coef;\n g -= b * coef;\n b -= a * coef;\n return vec4(r, g, b, a);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n\tfloat tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n\n vec2 blurDirection;\n bool isHorizontal = get_isHorizontal(materialSID, 0);\n if(isHorizontal){\n blurDirection = vec2(1.0,0.0);\n }else{\n blurDirection = vec2(0.0,1.0);\n }\n\n float depth = 0.0;\n int gaussianKernelSize = get_gaussianKernelSize(materialSID, 0);\n float minStrideLength = -float(gaussianKernelSize - 1) / 2.0;\n\n for(int i=0; i < 30; i++) {\n if(gaussianKernelSize == i) {\n break;\n }\n\n float strideLength = minStrideLength + float(i);\n vec2 stride = strideLength * blurDirection;\n float depthData = decodeRGBAToDepth(texture(u_baseColorTexture, (offset + stride) * tFrag));\n if(depthData > 1.0) depthData = 1.0;\n\n float gaussianRatio = u_gaussianRatio[i];\n depth += depthData * gaussianRatio;\n }\n\n rt0 = encodeDepthToRGBA(depth);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function v(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}var y=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(A,e);var t,n,y=(t=A,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var o=m(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return v(this,e)});function A(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,A),(e=y.call(this,null,"gaussianBlurForEncodedDepthShading",{},h,d)).frameBufferWidth=0;var t=new Float32Array(30);t[0]=1;var n=[{semantic:A.IsHorizontal,componentType:a.r.Bool,compositionType:o.d.Scalar,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:u.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Ru.fromCopyNumber(1),min:0,max:1},{semantic:A.GaussianRatio,componentType:a.r.Float,compositionType:o.d.ScalarArray,arrayLength:30,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:u.a.FirstTimeOnly,soloDatum:!1,initialValue:new _.j(t),min:0,max:1,needUniformInDataTextureMode:!0},{semantic:A.GaussianKernelSize,componentType:a.r.Int,compositionType:o.d.Scalar,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:u.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Ru.fromCopyNumber(1),min:1,max:30},{semantic:c.f5.FramebufferWidth,componentType:a.r.Float,compositionType:o.d.Scalar,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:u.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Ru.fromCopyNumber(1),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:c.f5.BaseColorTexture,componentType:a.r.Int,compositionType:o.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:u.a.EveryTime,initialValue:[0,f.P.__dummyBlackTexture],min:0,max:Number.MAX_SAFE_INTEGER}];return e.setShaderSemanticsInfoArray(n),e}return A.prototype._setCustomSettingParametersToGpu=function(e){var t=e.material,n=e.shaderProgram,o=(e.firstTime,e.args),a=t.getParameter(c.f5.BaseColorTexture)[1];a.width!==this.frameBufferWidth&&(t.setParameter(c.f5.FramebufferWidth,a.width),this.frameBufferWidth=a.width),o.setUniform?this.setWorldMatrix(n,o.worldMatrix):n._gl.uniform1fv(n.gaussianRatio,t.getParameter(A.GaussianRatio)._v);var s=o.renderPass.cameraComponent;null==s&&(s=i.C.getComponent(r.M,r.M.current)),s&&(this.setViewInfo(n,s,o.isVr,o.displayIdx),this.setProjection(n,s,o.isVr,o.displayIdx))},A}(f.P);A.GaussianKernelSize=new c.wy({str:"gaussianKernelSize"}),A.GaussianRatio=new c.wy({str:"gaussianRatio"}),A.IsHorizontal=new c.wy({str:"isHorizontal"})},1349:(e,t,n)=>{n.d(t,{W:()=>A});var r=n(3279),o=n(3932),i=n(6383),a=n(2535),s=n(1811),c=n(7416),l=n(5685),u=n(678),f=n(7011),_=n(2175);const h={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec3 a_position;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},d={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n\tfloat tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n\n vec2 blurDirection;\n bool isHorizontal = get_isHorizontal(materialSID, 0);\n if(isHorizontal){\n blurDirection = vec2(1.0,0.0);\n }else{\n blurDirection = vec2(0.0,1.0);\n }\n\n vec4 color = vec4(0.0);\n int gaussianKernelSize = get_gaussianKernelSize(materialSID, 0);\n float minStrideLength = -float(gaussianKernelSize - 1) / 2.0;\n\n for(int i=0; i < 30; i++) {\n if(gaussianKernelSize == i) {\n break;\n }\n\n float strideLength = minStrideLength + float(i);\n vec2 stride = strideLength * blurDirection;\n\n float gaussianRatio = u_gaussianRatio[i];\n color += texture(u_baseColorTexture, (offset + stride) * tFrag) * gaussianRatio;\n }\n\n rt0 = color;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function v(e,t){return!t||"object"!==y(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(e,t){return p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},p(e,t)}var y=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var A=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(A,e);var t,n,y=(t=A,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=m(t);if(n){var o=m(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return v(this,e)});function A(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,A),(e=y.call(this,null,"GaussianBlurShading",{},h,d)).frameBufferWidth=0;var t=new Float32Array(30);t[0]=1;var n=[{semantic:A.IsHorizontal,componentType:a.r.Bool,compositionType:o.d.Scalar,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:u.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Ru.fromCopyNumber(1),min:0,max:1},{semantic:A.GaussianRatio,componentType:a.r.Float,compositionType:o.d.ScalarArray,arrayLength:30,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:u.a.FirstTimeOnly,soloDatum:!1,initialValue:new _.j(t),min:0,max:1,needUniformInDataTextureMode:!0},{semantic:A.GaussianKernelSize,componentType:a.r.Int,compositionType:o.d.Scalar,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:u.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Ru.fromCopyNumber(1),min:1,max:30},{semantic:c.f5.FramebufferWidth,componentType:a.r.Float,compositionType:o.d.Scalar,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:u.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Ru.fromCopyNumber(1),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:c.f5.BaseColorTexture,componentType:a.r.Int,compositionType:o.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:u.a.EveryTime,initialValue:[0,f.P.__dummyBlackTexture],min:0,max:Number.MAX_SAFE_INTEGER}];return e.setShaderSemanticsInfoArray(n),e}return A.prototype._setCustomSettingParametersToGpu=function(e){var t=e.material,n=e.shaderProgram,o=(e.firstTime,e.args),a=t.getParameter(c.f5.BaseColorTexture)[1];a.width!==this.frameBufferWidth&&(t.setParameter(c.f5.FramebufferWidth,a.width),this.frameBufferWidth=a.width),o.setUniform?this.setWorldMatrix(n,o.worldMatrix):n._gl.uniform1fv(n.gaussianRatio,t.getParameter(A.GaussianRatio)._v);var s=o.renderPass.cameraComponent;null==s&&(s=i.C.getComponent(r.M,r.M.current)),s&&(this.setViewInfo(n,s,o.isVr,o.displayIdx),this.setProjection(n,s,o.isVr,o.displayIdx))},A}(f.P);A.GaussianKernelSize=new c.wy({str:"gaussianKernelSize"}),A.GaussianRatio=new c.wy({str:"gaussianRatio"}),A.IsHorizontal=new c.wy({str:"isHorizontal"})},6105:(e,t,n)=>{n.d(t,{f:()=>w});var r=n(7011),o=n(3650),i=n(3279),a=n(4021),s=n(6383),c=n(2535),l=n(3932),u=n(9977),f=n(1811),_=n(7416),h=n(5685),d=n(678),m=n(6860),v=n(6264),p=n(2175),y=n(2166);const A={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\n// This shader is based on https://github.com/Santarh/MToon\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nin vec3 a_normal;\nin vec4 a_baryCentricCoord;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec2 v_texcoord_0;\nout vec3 v_baryCentricCoord;\nout vec3 v_normal_inView;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\nin vec4 a_tangent;\nout vec3 v_tangent_inWorld;\nout vec3 v_binormal_inWorld; // bitangent_inWorld\n#endif\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_NONE\n return;\n #endif\n #endif\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isSkinning = false;\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n\n v_normal_inView = vec3(viewMatrix * vec4(v_normal_inWorld, 0.0));\n\n #ifndef RN_MTOON_IS_OUTLINE\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n #else\n #if defined(RN_MTOON_HAS_OUTLINE_WIDTH_TEXTURE)\n float outlineTex = texture(u_outlineWidthTexture, a_texcoord_0).r;\n #else\n float outlineTex = 1.0;\n #endif\n\n #if defined(RN_MTOON_OUTLINE_WIDTH_WORLD)\n float outlineWidth = get_outlineWidth(materialSID, 0);\n vec3 outlineOffset = 0.01 * outlineWidth * outlineTex * a_normal;\n vec4 worldOutlineOffset = worldMatrix * vec4(outlineOffset, 0.0);\n gl_Position = projectionMatrix * viewMatrix * (v_position_inWorld + worldOutlineOffset);\n\n #elif defined(RN_MTOON_OUTLINE_WIDTH_SCREEN)\n vec4 vertex = projectionMatrix * viewMatrix * v_position_inWorld;\n\n vec3 clipNormal = (projectionMatrix * vec4(v_normal_inView, 1.0)).xyz;\n vec2 projectedNormal = normalize(clipNormal.xy);\n float outlineScaledMaxDistance = get_outlineScaledMaxDistance(materialSID, 0);\n projectedNormal *= min(vertex.w, outlineScaledMaxDistance);\n float aspect = abs(get_aspect(0.0, 0)); //solo datum\n projectedNormal.x *= aspect;\n\n float outlineWidth = get_outlineWidth(materialSID, 0);\n vertex.xy += 0.01 * outlineWidth * outlineTex * projectedNormal * clamp(1.0 - abs(v_normal_inView.z), 0.0, 1.0); // ignore offset when normal toward camera\n\n gl_Position = vertex;\n #else\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n #endif\n #endif\n\n #ifdef RN_USE_TANGENT_ATTRIBUTE\n v_tangent_inWorld = normalMatrix * a_tangent.xyz;\n v_binormal_inWorld = cross(v_normal_inWorld, v_tangent_inWorld) * a_tangent.w;\n #endif\n\n v_texcoord_0 = a_texcoord_0;\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n}\n",shaderStage:"vertex",isFragmentShader:!1},b={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nconst float EPS_COL = 0.00001;\n\nin vec2 v_texcoord_0;\nin vec3 v_baryCentricCoord;\nin vec3 v_normal_inView;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n in vec3 v_tangent_inWorld;\n in vec3 v_binormal_inWorld; // bitangent_inWorld\n#endif\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n vec3 perturb_normal(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord, vec3 normalTex) {\n vec3 tangent_inWorld = normalize(v_tangent_inWorld);\n vec3 binormal_inWorld = normalize(v_binormal_inWorld);\n mat3 tbnMat_tangent_to_world = mat3(tangent_inWorld, binormal_inWorld, normal_inWorld);\n\n return normalize(tbnMat_tangent_to_world * normalTex);\n }\n#else\n #ifdef RN_IS_SUPPORTING_STANDARD_DERIVATIVES\n // This is based on http://www.thetenthplanet.de/archives/1180\n mat3 cotangent_frame(vec3 normal_inWorld, vec3 position, vec2 uv) {\n uv = gl_FrontFacing ? uv : -uv;\n\n // get edge vectors of the pixel triangle\n vec3 dp1 = dFdx(position);\n vec3 dp2 = dFdy(position);\n vec2 duv1 = dFdx(uv);\n vec2 duv2 = dFdy(uv);\n\n // solve the linear system\n vec3 dp2perp = cross(dp2, normal_inWorld);\n vec3 dp1perp = cross(normal_inWorld, dp1);\n vec3 tangent = dp2perp * duv1.x + dp1perp * duv2.x;\n vec3 bitangent = dp2perp * duv1.y + dp1perp * duv2.y;\n bitangent *= -1.0;\n\n // construct a scale-invariant frame\n float invMat = inversesqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));\n return mat3(tangent * invMat, bitangent * invMat, normal_inWorld);\n }\n\n vec3 perturb_normal(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord, vec3 normalTex) {\n mat3 tbnMat_tangent_to_world = cotangent_frame(normal_inWorld, -viewVector, texcoord);\n if (texcoord.x > 0.0 || texcoord.y > 0.0) {\n return normalize(tbnMat_tangent_to_world * normalTex);\n } else {\n return normal_inWorld;\n }\n }\n #else\n vec3 perturb_normal(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord, vec3 normalTex) {\n return normal_inWorld;\n }\n #endif\n#endif\n\n\nvoid main (){\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_NONE\n discard;\n #endif\n #endif\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n\n // TODO\n // uv transform\n\n // TODO\n // uv animation\n\n // main color\n vec4 litTextureColor = texture(u_litColorTexture, v_texcoord_0);\n vec4 litColorFactor = get_litColor(materialSID, 0);\n\n // alpha\n float alpha = 1.0;\n\n #ifdef RN_ALPHATEST_ON\n alpha = litTextureColor.a * litColorFactor.a;\n float cutoff = get_cutoff(materialSID, 0);\n if(alpha < cutoff) discard;\n #elif defined(RN_ALPHABLEND_ON)\n alpha = litTextureColor.a * litColorFactor.a;\n #endif\n\n if (alpha < 0.01) {\n discard;\n }else{\n rt0.w = alpha;\n }\n\n\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_COLOR_FIXED\n vec3 outlineColor = get_outlineColor(materialSID, 0);\n rt0.xyz = outlineColor;\n\n rt0.xyz = srgbToLinear(rt0.xyz);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n #endif\n #endif\n\n // view vector\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n vec3 viewVector = viewPosition - v_position_inWorld.xyz;\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n #ifdef RN_MTOON_HAS_BUMPMAP\n vec3 normal = texture(u_normalTexture, v_texcoord_0).xyz * 2.0 - 1.0;\n normal_inWorld = perturb_normal(normal_inWorld, viewVector, v_texcoord_0, normal);\n #endif\n\n #ifdef RN_MTOON_IS_OUTLINE\n normal_inWorld *= -1.0;\n #endif\n\n\n // Lighting, Direct Light\n\n float shadowAttenuation = 1.0;\n // TODO: shadowmap computation\n\n float receiveShadowRate = get_receiveShadowRate(materialSID, 0);\n float lightAttenuation = shadowAttenuation * mix(1.0, shadowAttenuation, receiveShadowRate * texture(u_receiveShadowTexture, v_texcoord_0).r);\n\n float shadingGradeRate = get_shadingGradeRate(materialSID, 0);\n float shadingGrade = 1.0 - shadingGradeRate * (1.0 - texture(u_shadingGradeTexture, v_texcoord_0).r);\n float lightColorAttenuation = get_lightColorAttenuation(materialSID, 0);\n\n vec3 shadeColorFactor = get_shadeColor(materialSID, 0);\n vec3 shadeColor = shadeColorFactor * texture(u_shadeColorTexture, v_texcoord_0).xyz;\n shadeColor.xyz = srgbToLinear(shadeColor.xyz);\n\n vec3 litColor = litColorFactor.xyz * litTextureColor.xyz;\n litColor.xyz = srgbToLinear(litColor.xyz);\n\n\n float shadeShift = get_shadeShift(materialSID, 0);\n float shadeToony = get_shadeToony(materialSID, 0);\n\n vec3 lightings[/* shaderity: @{Config.maxLightNumberInShader} */];\n #ifdef RN_MTOON_DEBUG_LITSHADERATE\n float lightIntensities[/* shaderity: @{Config.maxLightNumberInShader} */];\n #endif\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n // lightAttenuation *= distanceAttenuation * spotEffect;\n float dotNL = dot(light.direction, normal_inWorld);\n float lightIntensity = dotNL * 0.5 + 0.5; // from [-1, +1] to [0, 1]\n lightIntensity = lightIntensity * lightAttenuation; // TODO: receive shadow\n lightIntensity = lightIntensity * shadingGrade; // darker\n lightIntensity = lightIntensity * 2.0 - 1.0; // from [0, 1] to [-1, +1]\n\n // tooned. mapping from [minIntensityThreshold, maxIntensityThreshold] to [0, 1]\n float maxIntensityThreshold = mix(1.0, shadeShift, shadeToony);\n float minIntensityThreshold = shadeShift;\n lightIntensity = clamp((lightIntensity - minIntensityThreshold) / max(EPS_COL, (maxIntensityThreshold - minIntensityThreshold)), 0.0, 1.0);\n #ifdef RN_MTOON_DEBUG_LITSHADERATE\n lightIntensities[i] = lightIntensity;\n #endif\n\n // Albedo color\n vec3 col = mix(shadeColor, litColor, lightIntensity);\n\n // Direct Light\n vec3 lighting = light.attenuatedIntensity;\n lighting = mix(lighting, vec3(max(EPS_COL, max(lighting.x, max(lighting.y, lighting.z)))), lightColorAttenuation); // color atten\n\n\n if(i > 0){\n lighting *= 0.5; // darken if additional light.\n lighting *= min(0.0, dotNL) + 1.0; // darken dotNL < 0 area by using half lambert\n // lighting *= shadowAttenuation; // darken if receiving shadow\n #ifdef RN_ALPHABLEND_ON\n lighting *= step(0.0, dotNL); // darken if transparent. Because Unity's transparent material can't receive shadowAttenuation.\n #endif\n }\n\n col *= lighting;\n lightings[i] = lighting;\n\n rt0.xyz += col;\n\n lightAttenuation = 1.0;\n }\n\n\n // Indirect Light\n vec3 indirectLighting = get_ambientColor(materialSID, 0);\n indirectLighting = srgbToLinear(indirectLighting);\n indirectLighting = mix(indirectLighting, vec3(max(EPS_COL, max(indirectLighting.x, max(indirectLighting.y, indirectLighting.z)))), lightColorAttenuation); // color atten\n // TODO: use ShadeIrad in www.ppsloan.org/publications/StupidSH36.pdf\n\n rt0.xyz += indirectLighting * litColor;\n rt0.xyz = min(rt0.xyz, litColor); // comment out if you want to PBR absolutely.\n\n\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_COLOR_MIXED\n vec3 outlineColor = get_outlineColor(materialSID, 0);\n outlineColor = srgbToLinear(outlineColor);\n float outlineLightingMix = get_outlineLightingMix(materialSID, 0);\n rt0.xyz = outlineColor * mix(vec3(1.0), rt0.xyz, outlineLightingMix);\n #endif\n #else\n vec3 viewDirection = normalize(viewVector);\n\n float rimFresnelPower = get_rimFresnelPower(materialSID, 0);\n float rimLift = get_rimLift(materialSID, 0);\n vec3 rimColorFactor = get_rimColor(materialSID, 0);\n vec3 rimTextureColor = texture(u_rimTexture, v_texcoord_0).xyz;\n vec3 rimColor = srgbToLinear(rimColorFactor * rimTextureColor);\n vec3 rim = pow(clamp(1.0 - dot(normal_inWorld, viewDirection) + rimLift, 0.0, 1.0), rimFresnelPower) * rimColor;\n\n float staticRimLighting = 1.0;\n float rimLightingMix = get_rimLightingMix(materialSID, 0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) break;\n\n if(i > 0) staticRimLighting = 0.0;\n\n vec3 rimLighting = mix(vec3(staticRimLighting), lightings[i], vec3(rimLightingMix));\n rt0.xyz += rim * rimLighting;\n }\n\n // additive matcap\n vec3 cameraUp = get_cameraUp(0.0, 0); //solo datum\n vec3 worldViewUp = normalize(cameraUp - viewDirection * dot(viewDirection, cameraUp));\n vec3 worldViewRight = normalize(cross(viewDirection, worldViewUp));\n vec2 matcapUv = vec2(dot(worldViewRight, normal_inWorld), dot(worldViewUp, normal_inWorld)) * 0.5 + 0.5;\n vec3 matCapColor = srgbToLinear(texture(u_matCapTexture, matcapUv).xyz);\n rt0.xyz += matCapColor;\n\n\n // Emission\n vec3 emissionColor = get_emissionColor(materialSID, 0);\n vec3 emission = srgbToLinear(texture(u_emissionTexture, v_texcoord_0).xyz) * emissionColor;\n rt0.xyz += emission;\n #endif\n\n\n // debug\n #ifdef RN_MTOON_DEBUG_NORMAL\n rt0 = vec4(normal_inWorld * 0.5 + 0.5, alpha);\n\n rt0.xyz = srgbToLinear(rt0.xyz);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n #elif defined(RN_MTOON_DEBUG_LITSHADERATE)\n rt0 = vec4(0.0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) break;\n rt0 += vec4(lightIntensities[i] * lightings[i], alpha);\n }\n\n rt0.xyz = srgbToLinear(rt0.xyz);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n #endif\n\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\nfloat makeOutputSrgb = float(get_makeOutputSrgb(materialSID, 0));\nrt0.rgb = mix(rt0.rgb, linearToSrgb(rt0.rgb), makeOutputSrgb);\n\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function x(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function I(e,t){return I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},I(e,t)}var E=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}(w,e);var t,n,E=(t=w,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g(t);if(n){var o=g(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return x(this,e)});function w(e,t,n,o,i,a,s,y,g){var x;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,w),(x=E.call(this,null,"MToonShading"+(o?"+morphing":"")+(i?"+skinning":"")+(a?"":"-lighting")+(s?"+tangentAttribute":""),{isMorphing:o,isSkinning:i,isLighting:a},A,b)).__OutlineWidthModeIsScreen=!1,x.__floatProperties={},x.__vectorProperties={},x.__textureProperties={};var I=[];switch(null!=t?(x.__floatProperties=t.floatProperties,x.__vectorProperties=t.vectorProperties,x.__textureProperties=t.textureProperties):(x.__floatProperties._BlendMode=0,x.__floatProperties._BumpScale=1,x.__floatProperties._CullMode=2,x.__floatProperties._Cutoff=.5,x.__floatProperties._DebugMode=0,x.__floatProperties._DstBlend=0,x.__floatProperties._IndirectLightIntensity=.1,x.__floatProperties._LightColorAttenuation=0,x.__floatProperties._OutlineColorMode=0,x.__floatProperties._OutlineCullMode=1,x.__floatProperties._OutlineLightingMix=1,x.__floatProperties._OutlineScaledMaxDistance=1,x.__floatProperties._OutlineWidth=.5,x.__floatProperties._OutlineWidthMode=0,x.__floatProperties._ReceiveShadowRate=1,x.__floatProperties._RimFresnelPower=1,x.__floatProperties._RimLift=0,x.__floatProperties._RimLightingMix=0,x.__floatProperties._ShadeShift=0,x.__floatProperties._ShadeToony=.9,x.__floatProperties._ShadingGradeRate=1,x.__floatProperties._SrcBlend=1,x.__floatProperties._ZWrite=1,x.__vectorProperties._Color=[1,1,1,1],x.__vectorProperties._EmissionColor=[0,0,0],x.__vectorProperties._OutlineColor=[0,0,0,1],x.__vectorProperties._ShadeColor=[.97,.81,.86,1],x.__vectorProperties._RimColor=[0,0,0],x.__textureProperties._BumpMap=0,x.__textureProperties._EmissionMap=1,x.__textureProperties._MainTex=0,x.__textureProperties._OutlineWidthTexture=0,x.__textureProperties._ReceiveShadowTexture=0,x.__textureProperties._RimTexture=1,x.__textureProperties._ShadeTexture=0,x.__textureProperties._ShadingGradeTexture=0,x.__textureProperties._SphereAdd=1,n=[r.P.__dummyWhiteTexture,r.P.__dummyBlackTexture]),y&&(x.__floatProperties._DebugMode=y),I.push({semantic:w._Cutoff,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._Cutoff),min:0,max:1},{semantic:w._Color,componentType:c.r.Float,compositionType:l.d.Vec4,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:v.Lt.fromCopyArray(x.__vectorProperties._Color),min:0,max:1},{semantic:w._ShadeColor,componentType:c.r.Float,compositionType:l.d.Vec3,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:m.P.fromCopyArray(x.__vectorProperties._ShadeColor),min:0,max:1},{semantic:w._BumpScale,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._BumpScale),min:0,max:1},{semantic:w._ReceiveShadowRate,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._ReceiveShadowRate),min:0,max:1},{semantic:w._ShadingGradeRate,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._ShadingGradeRate),min:0,max:1},{semantic:w._ShadeShift,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._ShadeShift),min:0,max:1},{semantic:w._ShadeToony,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._ShadeToony),min:0,max:1},{semantic:w._LightColorAttenuation,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._LightColorAttenuation),min:0,max:1},{semantic:w._AmbientColor,componentType:c.r.Float,compositionType:l.d.Vec3,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:m.P.fromCopyArray([.5785,.5785,.5785]),min:0,max:1},{semantic:w._RimColor,componentType:c.r.Float,compositionType:l.d.Vec3,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:m.P.fromCopyArray(x.__vectorProperties._RimColor),min:0,max:1},{semantic:w._RimLightingMix,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._RimLightingMix),min:0,max:1},{semantic:w._RimFresnelPower,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._RimFresnelPower),min:0,max:1},{semantic:w._RimLift,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._RimLift),min:0,max:1},{semantic:w.CameraUp,componentType:c.r.Float,compositionType:l.d.Vec3,stage:h.H.PixelShader,isCustomSetting:!0,soloDatum:!0,initialValue:m.P.fromCopyArray([0,1,0]),min:0,max:1},{semantic:w._EmissionColor,componentType:c.r.Float,compositionType:l.d.Vec3,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:m.P.fromCopyArray(x.__vectorProperties._EmissionColor),min:0,max:1},{semantic:_.f5.Wireframe,componentType:c.r.Float,compositionType:l.d.Vec3,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:m.P.fromCopyArray([0,0,1]),min:0,max:10},{semantic:_.f5.MakeOutputSrgb,compositionType:l.d.Scalar,componentType:c.r.Bool,stage:h.H.PixelShader,min:0,max:1,isCustomSetting:!1,updateInterval:d.a.FirstTimeOnly,initialValue:f.Ru.fromCopyNumber(g?1:0)}),x.__floatProperties._DebugMode){case 1:x.__definitions+="#define RN_MTOON_DEBUG_NORMAL\n";break;case 2:x.__definitions+="#define RN_MTOON_DEBUG_LITSHADERATE\n"}if(e){switch(x.__definitions+="#define RN_MTOON_IS_OUTLINE\n",x.__floatProperties._OutlineWidthMode){case 0:x.__definitions+="#define RN_MTOON_OUTLINE_NONE\n";break;case 1:x.__definitions+="#define RN_MTOON_OUTLINE_WIDTH_WORLD\n";break;case 2:x.__definitions+="#define RN_MTOON_OUTLINE_WIDTH_SCREEN\n",x.__OutlineWidthModeIsScreen=!0}switch(x.__floatProperties._OutlineColorMode){case 0:x.__definitions+="#define RN_MTOON_OUTLINE_COLOR_FIXED\n";break;case 1:x.__definitions+="#define RN_MTOON_OUTLINE_COLOR_MIXED\n"}I.push({semantic:w._OutlineWidth,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.VertexShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._OutlineWidth),min:0,max:1},{semantic:w._OutlineScaledMaxDistance,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.VertexShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._OutlineScaledMaxDistance),min:0,max:1},{semantic:w._OutlineColor,componentType:c.r.Float,compositionType:l.d.Vec3,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:m.P.fromCopyArray(x.__vectorProperties._OutlineColor),min:0,max:1},{semantic:w._OutlineLightingMix,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(x.__floatProperties._OutlineLightingMix),min:0,max:1},{semantic:w.Aspect,componentType:c.r.Float,compositionType:l.d.Scalar,stage:h.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(1),min:0,max:1})}return a&&(x.__definitions+="#define RN_IS_LIGHTING\n"),i&&(x.__definitions+="#define RN_IS_SKINNING\n"),o&&(x.__definitions+="#define RN_IS_MORPHING\n",I.push({semantic:_.f5.MorphTargetNumber,componentType:c.r.Int,compositionType:l.d.Scalar,stage:h.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(0),min:0,max:u.D.maxVertexMorphNumberInShader,needUniformInDataTextureMode:!0},{semantic:_.f5.DataTextureMorphOffsetPosition,componentType:c.r.Int,compositionType:l.d.ScalarArray,arrayLength:u.D.maxVertexMorphNumberInShader,stage:h.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new p.j(new Int32Array(u.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:_.f5.MorphWeights,componentType:c.r.Float,compositionType:l.d.ScalarArray,arrayLength:u.D.maxVertexMorphNumberInShader,stage:h.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new p.j(new Float32Array(u.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0})),s&&(x.__definitions+="#define RN_USE_TANGENT_ATTRIBUTE\n"),x.__setTextures(n,I,e),x.setShaderSemanticsInfoArray(I),x}var S=w.prototype;return S.__setTextures=function(e,t,n){t.push({semantic:w._MainTex,componentType:c.r.Int,compositionType:l.d.Texture2D,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,initialValue:[0,e[this.__textureProperties._MainTex]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:w._ShadeTexture,componentType:c.r.Int,compositionType:l.d.Texture2D,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,initialValue:[1,e[this.__textureProperties._ShadeTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:w._ReceiveShadowTexture,componentType:c.r.Int,compositionType:l.d.Texture2D,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,initialValue:[2,e[this.__textureProperties._ReceiveShadowTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:w._ShadingGradeTexture,componentType:c.r.Int,compositionType:l.d.Texture2D,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,initialValue:[3,e[this.__textureProperties._ShadingGradeTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:w._RimTexture,componentType:c.r.Int,compositionType:l.d.Texture2D,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,initialValue:[4,e[this.__textureProperties._RimTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:w._SphereAdd,componentType:c.r.Int,compositionType:l.d.Texture2D,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,initialValue:[5,e[this.__textureProperties._SphereAdd]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:w._EmissionMap,componentType:c.r.Int,compositionType:l.d.Texture2D,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,initialValue:[6,e[this.__textureProperties._EmissionMap]],min:0,max:Number.MAX_SAFE_INTEGER});var r=y.x.getInstance().currentWebGLContextWrapper.getRawContext();r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS)>9&&(t.push({semantic:w._BumpMap,componentType:c.r.Int,compositionType:l.d.Texture2D,stage:h.H.PixelShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,initialValue:[8,e[this.__textureProperties._BumpMap]],min:0,max:Number.MAX_SAFE_INTEGER}),this.__textureProperties._BumpMap!==e.length-2&&(this.__definitions+="#define RN_MTOON_HAS_BUMPMAP\n"),n&&(t.push({semantic:w._OutlineWidthTexture,componentType:c.r.Int,compositionType:l.d.Texture2D,stage:h.H.VertexShader,isCustomSetting:!1,updateInterval:d.a.EveryTime,initialValue:[9,e[this.__textureProperties._OutlineWidthTexture]],min:0,max:Number.MAX_SAFE_INTEGER}),this.__textureProperties._OutlineWidthTexture!==e.length-2&&(this.__definitions+="#define RN_MTOON_HAS_OUTLINE_WIDTH_TEXTURE\n")))},S.setMaterialParameters=function(e,t){if(null==w.usableBlendEquationModeAlpha&&w.__initializeUsableBlendEquationModeAlpha(),0!==this.__floatProperties._BlendMode){switch(this.__floatProperties._BlendMode){case 1:this.__definitions+="#define RN_ALPHATEST_ON\n",e.alphaMode=o.F.Mask;break;case 2:case 3:this.__definitions+="#define RN_ALPHABLEND_ON\n",e.alphaMode=o.F.Translucent}var n=w.usableBlendEquationModeAlpha,r=w.unityBlendEnumCorrespondence(this.__floatProperties._SrcBlend),i=w.unityBlendEnumCorrespondence(this.__floatProperties._DstBlend);e.setBlendEquationMode(32774,n),e.setBlendFuncFactor(r,i)}if(t)switch(this.__floatProperties._OutlineCullMode){case 0:e.cullFace=!1;break;case 1:e.cullFace=!0,e.cullFrontFaceCCW=!1;break;case 2:e.cullFace=!0,e.cullFrontFaceCCW=!0}else switch(this.__floatProperties._CullMode){case 0:e.cullFace=!1;break;case 1:e.cullFace=!0,e.cullFrontFaceCCW=!1;break;case 2:e.cullFace=!0,e.cullFrontFaceCCW=!0}},S._setCustomSettingParametersToGpu=function(e){var t=e.material,n=e.shaderProgram,r=(e.firstTime,e.args),o=r.renderPass.cameraComponent;if(null==o&&(o=s.C.getComponent(i.M,i.M.current)),r.setUniform){this.setWorldMatrix(n,r.worldMatrix),this.setNormalMatrix(n,r.normalMatrix),this.setViewInfo(n,o,r.isVr,r.displayIdx),this.setProjection(n,o,r.isVr,r.displayIdx);var a=r.entity.tryToGetSkeletal();this.setSkinning(n,r.setUniform,a),this.setLightsInfo(n,r.lightComponents,t,r.setUniform),n._gl.uniform3fv(n.cameraUp,o.upInner._v),this.__OutlineWidthModeIsScreen&&n._gl.uniform1f(n.aspect,o.aspect)}else t.setParameter(w.CameraUp,o.upInner),this.__OutlineWidthModeIsScreen&&t.setParameter(w.Aspect,o.aspect);var c=r.entity.tryToGetBlendShape();this.setMorphInfo(n,r.entity.getMesh(),r.primitive,c)},w.__initializeUsableBlendEquationModeAlpha=function(){var e=a.F.getWebGLResourceRepository().currentWebGLContextWrapper,t=e.getRawContextAsWebGL2();e.isWebGL2?w.usableBlendEquationModeAlpha=t.MAX:e.webgl1ExtBM?w.usableBlendEquationModeAlpha=e.webgl1ExtBM.MAX_EXT:w.usableBlendEquationModeAlpha=t.FUNC_ADD},w.unityBlendEnumCorrespondence=function(e){var t=a.F.getWebGLResourceRepository().currentWebGLContextWrapper.getRawContext(),n=t.ZERO;switch(e){case 0:n=t.ZERO;break;case 1:n=t.ONE;break;case 2:n=t.DST_COLOR;break;case 3:n=t.SRC_COLOR;break;case 4:n=t.ONE_MINUS_DST_COLOR;break;case 5:n=t.SRC_ALPHA;break;case 6:n=t.ONE_MINUS_SRC_COLOR;break;case 7:n=t.DST_ALPHA;break;case 8:n=t.ONE_MINUS_DST_ALPHA;break;case 9:n=t.SRC_ALPHA_SATURATE;break;case 10:n=t.ONE_MINUS_SRC_ALPHA}return n},w}(r.P);w._Cutoff=new _.wy({str:"cutoff"}),w._Color=new _.wy({str:"litColor"}),w._ShadeColor=new _.wy({str:"shadeColor"}),w._MainTex=new _.wy({str:"litColorTexture"}),w._ShadeTexture=new _.wy({str:"shadeColorTexture"}),w._BumpScale=new _.wy({str:"normalScale"}),w._BumpMap=new _.wy({str:"normalTexture"}),w._ReceiveShadowRate=new _.wy({str:"receiveShadowRate"}),w._ReceiveShadowTexture=new _.wy({str:"receiveShadowTexture"}),w._ShadingGradeRate=new _.wy({str:"shadingGradeRate"}),w._ShadingGradeTexture=new _.wy({str:"shadingGradeTexture"}),w._ShadeShift=new _.wy({str:"shadeShift"}),w._ShadeToony=new _.wy({str:"shadeToony"}),w._LightColorAttenuation=new _.wy({str:"lightColorAttenuation"}),w._AmbientColor=new _.wy({str:"ambientColor"}),w._RimTexture=new _.wy({str:"rimTexture"}),w._RimColor=new _.wy({str:"rimColor"}),w._RimLightingMix=new _.wy({str:"rimLightingMix"}),w._RimFresnelPower=new _.wy({str:"rimFresnelPower"}),w._RimLift=new _.wy({str:"rimLift"}),w._SphereAdd=new _.wy({str:"matCapTexture"}),w._EmissionColor=new _.wy({str:"emissionColor"}),w._EmissionMap=new _.wy({str:"emissionTexture"}),w._OutlineWidthTexture=new _.wy({str:"outlineWidthTexture"}),w._OutlineWidth=new _.wy({str:"outlineWidth"}),w._OutlineScaledMaxDistance=new _.wy({str:"outlineScaledMaxDistance"}),w._OutlineColor=new _.wy({str:"outlineColor"}),w._OutlineLightingMix=new _.wy({str:"outlineLightingMix"}),w.Aspect=new _.wy({str:"aspect"}),w.CameraUp=new _.wy({str:"cameraUp"})},1181:(e,t,n)=>{n.d(t,{S:()=>I});var r=n(4356),o=n(3279),i=n(6383),a=n(2535),s=n(3932),c=n(1811),l=n(7416),u=n(5685),f=n(678),_=n(9294),h=n(7102),d=n(6860),m=n(7011);const v={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec3 a_baryCentricCoord;\nin vec3 a_position;\nin vec3 a_normal;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec3 v_baryCentricCoord;\nout vec3 v_normal_inView;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n\n bool isSkinning = false;\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n v_normal_inView = vec3(viewMatrix * vec4(normalMatrix * a_normal, 0.0));\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n v_baryCentricCoord = a_baryCentricCoord;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},p={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec3 v_baryCentricCoord;\nin vec3 v_normal_inView;\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec3 normal_inView = normalize(v_normal_inView);\n normal_inView.y *= -1.0;\n vec2 normalUVCordinate = normal_inView.xy * 0.5 + 0.5;\n vec4 matCapColor = texture(u_matCapTexture, normalUVCordinate);\n rt0 = matCapColor;\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};function y(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function A(e){return A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},A(e)}function b(e,t){return!t||"object"!==x(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(e,t)}var x=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}(I,e);var t,n,x=(t=I,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=A(t);if(n){var o=A(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return b(this,e)});function I(e,t,n){var o,i,A,b,g,E;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,I),o=x.call(this,null,"MatCapShading"+(e?"+skinning":""),{isSkinning:e},v,p),"string"==typeof t?(i=new _.x,(g=function(e){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{n.d(t,{u:()=>d});var r=n(7416),o=n(7011),i=n(6670),a=n(5685),s=n(6383),c=n(3279),l=n(9481);function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function f(e,t){return!t||"object"!==h(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _(e,t){return _=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_(e,t)}var h=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var d=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_(e,t)}(d,e);var t,n,h=(t=d,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=u(t);if(n){var o=u(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return f(this,e)});function d(e){var t,n=e.name,r=e.vertexShaderityObj,s=e.pixelShaderityObj;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),t=h.call(this,null,n,{});var c=i.Q.getShaderDataReflection(r,o.P.__semanticsMap.get(t.shaderFunctionName)),l=i.Q.getShaderDataReflection(s,o.P.__semanticsMap.get(t.shaderFunctionName));t.__vertexShaderityObject=r,t.__pixelShaderityObject=s;var u=c.shaderSemanticsInfoArray.concat(),f=!0,_=!1,m=void 0;try{for(var v,p=function(){var e=v.value,t=u.find((function(t){return t.semantic.str===e.semantic.str}));t?t.stage=a.H.VertexAndPixelShader:u.push(e)},y=l.shaderSemanticsInfoArray[Symbol.iterator]();!(f=(v=y.next()).done);f=!0)p()}catch(e){_=!0,m=e}finally{try{f||null==y.return||y.return()}finally{if(_)throw m}}return d.__removeUselessShaderSemantics(u),t.setShaderSemanticsInfoArray(u),t}return d.prototype._setCustomSettingParametersToGpu=function(e){var t=e.material,n=e.shaderProgram,r=e.firstTime,o=e.args;if(o.setUniform){if(this.setWorldMatrix(n,o.worldMatrix),this.setNormalMatrix(n,o.normalMatrix),r||o.isVr){var i=o.renderPass.cameraComponent;null==i&&(i=s.C.getComponent(c.M,c.M.current)),this.setViewInfo(n,i,o.isVr,o.displayIdx),this.setProjection(n,i,o.isVr,o.displayIdx)}r&&this.setLightsInfo(n,o.lightComponents,t,o.setUniform);var a=o.entity.tryToGetSkeletal();this.setSkinning(n,o.setUniform,a)}var l=o.entity.tryToGetBlendShape();this.setMorphInfo(n,o.entity.getMesh(),o.primitive,l)},d.__removeUselessShaderSemantics=function(e){var t=l.$.getInstance().getGlobalProperties(),n=!0,o=!1,i=void 0;try{for(var a,s=function(){var t=a.value.shaderSemanticsInfo,n=e.findIndex((function(e){return e.semantic.str===t.semantic.str}));-1!==n&&e.splice(n,1)},c=t[Symbol.iterator]();!(n=(a=c.next()).done);n=!0)s()}catch(e){o=!0,i=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw i}}var u=[r.f5.VertexAttributesExistenceArray,r.f5.WorldMatrix,r.f5.NormalMatrix,r.f5.PointSize,r.f5.PointDistanceAttenuation],f=!0,_=!1,h=void 0;try{for(var d,m=function(){var t=d.value,n=e.findIndex((function(e){return e.semantic.str===t.str}));-1!==n&&e.splice(n,1)},v=u[Symbol.iterator]();!(f=(d=v.next()).done);f=!0)m()}catch(e){_=!0,h=e}finally{try{f||null==v.return||v.return()}finally{if(_)throw h}}},d}(o.P)},7862:(e,t,n)=>{n.d(t,{R:()=>w});var r=n(7416),o=n(7011),i=n(3932),a=n(2535),s=n(6264),c=n(6860),l=n(7364),u=n(5685),f=n(678),_=n(6383),h=n(3279),d=n(2175),m=n(1811),v=n(9977),p=n(4021),y=n(8289);const A={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec2 a_texcoord_1;\nin vec4 a_joint;\nin vec4 a_weight;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec4 v_texcoord_1;\nout vec4 v_projPosition_from_light;\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n // Shadow mapping\n mat4 lightViewProjectionMatrix = get_lightViewProjectionMatrix(materialSID, 0);\n v_projPosition_from_light = lightViewProjectionMatrix * v_position_inWorld;\n\n // Following tMatrix is based on https://wgld.org/d/webgl/w051.html\n mat4 tMatrix = mat4(\n 0.5, 0.0, 0.0, 0.0,\n 0.0, 0.5, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.5, 0.5, 0.0, 1.0\n );\n v_texcoord_1 = tMatrix * v_projPosition_from_light;\n\n v_color = a_color;\n v_normal_inWorld = normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},b={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec4 v_texcoord_1;\nin vec4 v_projPosition_from_light;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nfloat decodeRGBAToDepth(vec4 RGBA){\n const float rMask = 1.0;\n const float gMask = 1.0 / 255.0;\n const float bMask = 1.0 / (255.0 * 255.0);\n const float aMask = 1.0 / (255.0 * 255.0 * 255.0);\n float depth = dot(RGBA, vec4(rMask, gMask, bMask, aMask));\n return depth;\n}\n\nvoid main (){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n // diffuseColor\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture\n vec4 textureColor = texture(u_diffuseColorTexture, v_texcoord_0);\n if (textureColor.r > 0.05) {\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n }\n\n // shadow mapping\n if(v_projPosition_from_light.w > 0.0){\n float zNear = get_zNearInner(materialSID, 0);\n float zFar = get_zFarInner(materialSID, 0);\n float normalizationCoefficient = 1.0 / (zFar - zNear);\n\n vec2 shadowMapUV = v_texcoord_1.xy / v_texcoord_1.w;\n\n #ifdef RN_IS_DEBUGGING\n bool inShadowMap = (shadowMapUV.x >= 0.0 && shadowMapUV.x <= 1.0) && (shadowMapUV.y >= 0.0 && shadowMapUV.y <= 1.0);\n if(inShadowMap == false){\n rt0 = get_debugColorFactor(materialSID, 0);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n }\n #endif\n\n float measureDepth = normalizationCoefficient * length(v_projPosition_from_light);\n float textureDepth = decodeRGBAToDepth(texture(u_depthTexture, shadowMapUV));\n float allowableDepthError = get_allowableDepthError(materialSID, 0);\n\n if(measureDepth > textureDepth + allowableDepthError){\n // case of shadow\n vec4 shadowColorFactor = get_shadowColorFactor(materialSID, 0);\n diffuseColor = shadowColorFactor.rgb;\n alpha = shadowColorFactor.a;\n }\n }\n\n // Lighting\n vec3 shadingColor = vec3(0.0, 0.0, 0.0);\n int shadingModel = get_shadingModel(materialSID, 0);\n if (shadingModel > 0) {\n\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n int lightNumber = get_lightNumber(materialSID, 0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, light.direction)) * light.attenuatedIntensity;\n\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n float shininess = get_shininess(materialSID, 0);\n if (shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 halfVector = normalize(light.direction + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), shininess);\n } else if (shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 R = reflect(light.direction, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), shininess);\n }\n\n }\n\n shadingColor = diffuse + specular;\n } else {\n shadingColor = diffuseColor;\n }\n\n rt0 = vec4(shadingColor, alpha);\n //rt0 = vec4(u_lightNumber, 0.0, 0.0, 1.0);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function x(e,t){return!t||"object"!==E(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function I(e,t){return I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},I(e,t)}var E=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}(w,e);var t,n,E=(t=w,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=g(t);if(n){var o=g(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return x(this,e)});function w(e,t){var n,_=e.isMorphing,h=e.isSkinning,p=e.isLighting,g=e.isDebugging,I=e.colorAttachmentsNumber;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,w),(n=E.call(this,null,"ShadowMapDecodeClassicShading"+(h?"+skinning":"")+(p?"":"-lighting"),{isMorphing:_,isSkinning:h,isLighting:p},A,b)).__encodedDepthRenderPass=t;var S=t.getFramebuffer();if(null==S)return console.error("encodedDepthRenderPass does not have framebuffer"),x(n);var T=S.colorAttachments[I],C=t.getViewport();C.setComponents(1,1,C.z-1,C.w-1),t.setViewport(C);var P=[{semantic:r.f5.LightViewProjectionMatrix,compositionType:i.d.Mat4,componentType:a.r.Float,stage:u.H.VertexShader,isCustomSetting:!0,updateInterval:f.a.EveryTime,soloDatum:!1,initialValue:y.e.zero(),min:-Number.MAX_VALUE,max:Number.MAX_VALUE},{semantic:r.f5.ShadingModel,compositionType:i.d.Scalar,componentType:a.r.Int,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!1,initialValue:m.Ru.fromCopyNumber(l.D.Constant.index),min:0,max:3},{semantic:r.f5.Shininess,compositionType:i.d.Scalar,componentType:a.r.Float,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!1,initialValue:m.Ru.fromCopyNumber(5),min:0,max:Number.MAX_VALUE},{semantic:w.AllowableDepthError,compositionType:i.d.Scalar,componentType:a.r.Float,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!1,initialValue:m.Ru.fromCopyNumber(1e-4),min:0,max:1},{semantic:w.ShadowColorFactor,compositionType:i.d.Vec4,componentType:a.r.Float,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([.5,.5,.5,1]),min:0,max:1},{semantic:r.f5.DiffuseColorFactor,compositionType:i.d.Vec4,componentType:a.r.Float,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,1,1,1]),min:0,max:2},{semantic:w.IsPointLight,componentType:a.r.Bool,compositionType:i.d.Scalar,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!1,initialValue:m.Ru.fromCopyNumber(1),min:0,max:1},{semantic:r.f5.Wireframe,componentType:a.r.Float,compositionType:i.d.Vec3,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.EveryTime,soloDatum:!1,initialValue:c.P.fromCopyArray([0,0,1]),min:0,max:10},{semantic:r.f5.NormalTexture,compositionType:i.d.Texture2D,componentType:a.r.Int,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.EveryTime,initialValue:[0,o.P.__dummyBlueTexture],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:r.f5.DepthTexture,compositionType:i.d.Texture2D,componentType:a.r.Int,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.EveryTime,initialValue:[0,T],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:r.f5.DiffuseColorTexture,compositionType:i.d.Texture2D,componentType:a.r.Int,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.EveryTime,initialValue:[1,o.P.__dummyWhiteTexture],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:w.zNearInner,componentType:a.r.Float,compositionType:i.d.Scalar,stage:u.H.PixelShader,isCustomSetting:!0,updateInterval:f.a.EveryTime,soloDatum:!1,initialValue:m.Ru.fromCopyNumber(.1),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:w.zFarInner,componentType:a.r.Float,compositionType:i.d.Scalar,stage:u.H.PixelShader,isCustomSetting:!0,updateInterval:f.a.EveryTime,soloDatum:!1,initialValue:m.Ru.fromCopyNumber(1e4),min:1e-4,max:Number.MAX_SAFE_INTEGER}];return P.push({semantic:r.f5.PointSize,componentType:a.r.Float,compositionType:i.d.Scalar,stage:u.H.VertexShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!0,initialValue:m.Ru.fromCopyNumber(30),min:0,max:100},{semantic:r.f5.PointDistanceAttenuation,componentType:a.r.Float,compositionType:i.d.Vec3,stage:u.H.VertexShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!0,initialValue:c.P.fromCopyArray([0,.1,.01]),min:0,max:1}),h&&(n.__definitions+="#define RN_IS_SKINNING\n"),p&&(n.__definitions+="#define RN_IS_LIGHTING\n"),_&&(n.__definitions+="#define RN_IS_MORPHING\n",P.push({semantic:r.f5.MorphTargetNumber,componentType:a.r.Int,compositionType:i.d.Scalar,stage:u.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:m.Ru.fromCopyNumber(0),min:0,max:v.D.maxVertexMorphNumberInShader,needUniformInDataTextureMode:!0},{semantic:r.f5.DataTextureMorphOffsetPosition,componentType:a.r.Int,compositionType:i.d.ScalarArray,arrayLength:v.D.maxVertexMorphNumberInShader,stage:u.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new d.j(new Int32Array(v.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:r.f5.MorphWeights,componentType:a.r.Float,compositionType:i.d.ScalarArray,arrayLength:v.D.maxVertexMorphNumberInShader,stage:u.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new d.j(new Float32Array(v.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0})),g&&(n.__definitions+="#define RN_IS_DEBUGGING\n",P.push({semantic:w.DebugColorFactor,compositionType:i.d.Vec4,componentType:a.r.Float,stage:u.H.PixelShader,isCustomSetting:!1,updateInterval:f.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,0,0,1]),min:0,max:2})),n.setShaderSemanticsInfoArray(P),n}return w.prototype._setCustomSettingParametersToGpu=function(e){var t=e.material,n=e.shaderProgram,o=(e.firstTime,e.args),i=o.renderPass.cameraComponent;null==i&&(i=_.C.getComponent(h.M,h.M.current));var a=this.__encodedDepthRenderPass.cameraComponent;o.setUniform?(this.setWorldMatrix(n,o.worldMatrix),this.setNormalMatrix(n,o.normalMatrix),this.setViewInfo(n,i,o.isVr,o.displayIdx),this.setProjection(n,i,o.isVr,o.displayIdx),w.__lastZNear!==a.zNearInner&&(n._gl.uniform1f(n.zNearInner,a.zNearInner),w.__lastZNear=a.zNearInner),w.__lastZFar!==a.zFarInner&&(n._gl.uniform1f(n.zFarInner,a.zFarInner),w.__lastZFar=a.zFarInner),p.F.getWebGLResourceRepository().setUniformValue(n,r.f5.LightViewProjectionMatrix.str,!0,this.__encodedDepthRenderPass.cameraComponent.viewProjectionMatrix)):(t.setParameter(w.zNearInner,a.zNearInner),t.setParameter(w.zFarInner,a.zFarInner),t.setParameter(r.f5.LightViewProjectionMatrix,this.__encodedDepthRenderPass.cameraComponent.viewProjectionMatrix));var s=o.entity.tryToGetSkeletal();this.setSkinning(n,o.setUniform,s),this.setLightsInfo(n,o.lightComponents,t,o.setUniform);var c=o.entity.tryToGetBlendShape();this.setMorphInfo(n,o.entity.getMesh(),o.primitive,c)},w}(o.P);w.ShadowColorFactor=new r.wy({str:"shadowColorFactor"}),w.ShadowAlpha=new r.wy({str:"shadowAlpha"}),w.NonShadowAlpha=new r.wy({str:"nonShadowAlpha"}),w.AllowableDepthError=new r.wy({str:"allowableDepthError"}),w.zNearInner=new r.wy({str:"zNearInner"}),w.zFarInner=new r.wy({str:"zFarInner"}),w.DebugColorFactor=new r.wy({str:"debugColorFactor"}),w.DepthTexture=new r.wy({str:"depthTexture"}),w.IsPointLight=new r.wy({str:"isPointLight"}),w.__lastZNear=0,w.__lastZFar=0},2653:(e,t,n)=>{n.d(t,{d:()=>g});var r=n(3279),o=n(6383),i=n(2535),a=n(3932),s=n(7416),c=n(5685),l=n(678),u=n(7011),f=n(2175),_=n(1811);const h={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec3 a_baryCentricCoord;\nin vec3 a_position;\n\nout vec3 v_baryCentricCoord;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n v_baryCentricCoord = a_baryCentricCoord;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},d={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec3 v_baryCentricCoord;\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3 + vec3(1.0 - wireframeWidthInner) * d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n float tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n\n float synthesizeCoefficient0 = u_synthesizeCoefficient[0];\n vec3 color = synthesizeCoefficient0 * texture(u_synthesizeTexture0, offset * tFrag).rgb;\n\n vec4 targetTextureColor = texture(u_targetRegionTexture, offset * tFrag);\n if (targetTextureColor != vec4(1.0, 1.0, 1.0, 1.0)) {\n float synthesizeCoefficient1 = u_synthesizeCoefficient[1];\n float synthesizeCoefficient2 = u_synthesizeCoefficient[2];\n float synthesizeCoefficient3 = u_synthesizeCoefficient[3];\n float synthesizeCoefficient4 = u_synthesizeCoefficient[4];\n float synthesizeCoefficient5 = u_synthesizeCoefficient[5];\n\n color += synthesizeCoefficient1 * texture(u_synthesizeTexture1, offset * tFrag).rgb;\n color += synthesizeCoefficient2 * texture(u_synthesizeTexture2, offset * tFrag).rgb;\n color += synthesizeCoefficient3 * texture(u_synthesizeTexture3, offset * tFrag).rgb;\n color += synthesizeCoefficient4 * texture(u_synthesizeTexture4, offset * tFrag).rgb;\n color += synthesizeCoefficient5 * texture(u_synthesizeTexture5, offset * tFrag).rgb;\n }\n\n rt0 = vec4(color, 1.0);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n\n",shaderStage:"fragment",isFragmentShader:!0};function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:u.P.dummyBlackTexture;m(this,I),(t=x.call(this,null,"synthesizeHDRTextureShading",{},h,d)).existTargetRegion=null!=A,t.textureNumber=e.length;var b=[{semantic:s.f5.FramebufferWidth,componentType:i.r.Float,compositionType:a.d.Scalar,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.EveryTime,soloDatum:!1,initialValue:_.Ru.fromCopyNumber(e[0].width),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.SynthesizeCoefficient,componentType:i.r.Float,compositionType:a.d.ScalarArray,arrayLength:6,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.EveryTime,soloDatum:!1,initialValue:new f.j(new Float32Array(6)),min:0,max:1,needUniformInDataTextureMode:!0},{semantic:I.SynthesizeTexture0,componentType:i.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.EveryTime,initialValue:[0,null!==(n=e[0])&&void 0!==n?n:u.P.dummyBlackTexture],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.SynthesizeTexture1,componentType:i.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.EveryTime,initialValue:[1,null!==(r=e[1])&&void 0!==r?r:u.P.dummyBlackTexture],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.SynthesizeTexture2,componentType:i.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.EveryTime,initialValue:[2,null!==(o=e[2])&&void 0!==o?o:u.P.dummyBlackTexture],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.SynthesizeTexture3,componentType:i.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.EveryTime,initialValue:[3,null!==(v=e[3])&&void 0!==v?v:u.P.dummyBlackTexture],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.SynthesizeTexture4,componentType:i.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.EveryTime,initialValue:[4,null!==(p=e[4])&&void 0!==p?p:u.P.dummyBlackTexture],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.SynthesizeTexture5,componentType:i.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.EveryTime,initialValue:[5,null!==(y=e[5])&&void 0!==y?y:u.P.dummyBlackTexture],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.TargetRegionTexture,componentType:i.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.EveryTime,initialValue:[6,A],min:0,max:Number.MAX_SAFE_INTEGER}];return t.setShaderSemanticsInfoArray(b),t}return I.prototype._setCustomSettingParametersToGpu=function(e){var t=e.material,n=e.shaderProgram,i=(e.firstTime,e.args);i.setUniform?this.setWorldMatrix(n,i.worldMatrix):n._gl.uniform1fv(n.synthesizeCoefficient,t.getParameter(I.SynthesizeCoefficient)._v);var a=i.renderPass.cameraComponent;null==a&&(a=o.C.getComponent(r.M,r.M.current)),a&&(this.setViewInfo(n,a,i.isVr,i.displayIdx),this.setProjection(n,a,i.isVr,i.displayIdx))},t=I,(n=[{key:"existTargetRegionTexture",get:function(){return this.existTargetRegion}},{key:"synthesizeTextureNumber",get:function(){return this.textureNumber}}])&&v(t.prototype,n),I}(u.P);g.SynthesizeCoefficient=new s.wy({str:"synthesizeCoefficient"}),g.TargetRegionTexture=new s.wy({str:"targetRegionTexture"}),g.SynthesizeTexture0=new s.wy({str:"synthesizeTexture0"}),g.SynthesizeTexture1=new s.wy({str:"synthesizeTexture1"}),g.SynthesizeTexture2=new s.wy({str:"synthesizeTexture2"}),g.SynthesizeTexture3=new s.wy({str:"synthesizeTexture3"}),g.SynthesizeTexture4=new s.wy({str:"synthesizeTexture4"}),g.SynthesizeTexture5=new s.wy({str:"synthesizeTexture5"})},9573:(e,t,n)=>{n.d(t,{Q:()=>S});var r=n(7416),o=n(7011),i=n(3932),a=n(2535),s=n(6264),c=n(6860),l=n(7364),u=n(5685),f=n(678),_=n(6383),h=n(3279),d=n(2175),m=n(1811),v=n(9977),p=n(4021),y=n(8289);const A={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec4 v_texcoord_1;\nout vec4 v_projPosition_from_light;\nout vec3 v_baryCentricCoord;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n\n bool isSkinning = false;\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n v_color = a_color;\n v_texcoord_0 = a_texcoord_0;\n\n // Shadow mapping\n mat4 lightViewProjectionMatrix = get_lightViewProjectionMatrix(materialSID, 0);\n v_projPosition_from_light = lightViewProjectionMatrix * v_position_inWorld;\n\n // Following tMatrix is based on https://wgld.org/d/webgl/w051.html\n mat4 tMatrix = mat4(\n 0.5, 0.0, 0.0, 0.0,\n 0.0, 0.5, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.5, 0.5, 0.0, 1.0\n );\n v_texcoord_1 = tMatrix * v_projPosition_from_light;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},b={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec4 v_texcoord_1;\nin vec4 v_projPosition_from_light;\nin vec3 v_baryCentricCoord;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nfloat decodeRGBAToDepth(vec4 RGBA){\n const float rMask = 1.0;\n const float gMask = 1.0 / 255.0;\n const float bMask = 1.0 / (255.0 * 255.0);\n const float aMask = 1.0 / (255.0 * 255.0 * 255.0);\n float depth = dot(RGBA, vec4(rMask, gMask, bMask, aMask));\n return depth;\n}\n\nfloat linstep(float min,float max,float v){\n return clamp((v-min)/(max-min),0.0,1.0);\n}\n\nfloat reduceLightBleeding(float p_max, float parameter){\n return linstep(parameter,1.0,p_max);\n}\n\nfloat chebyshevUpperBound(float materialSID){\n float textureDepth = decodeRGBAToDepth(texture2DProj(u_depthTexture, v_texcoord_1));\n float textureSquareDepth = decodeRGBAToDepth(texture2DProj(u_squareDepthTexture, v_texcoord_1));\n if(textureDepth == 1.0 || textureSquareDepth == 1.0){\n return 1.0;\n }\n\n float nonShadowProb = 1.0;\n\n if(v_projPosition_from_light.w > 0.0){\n float measureDepth;\n bool isPointLight = get_isPointLight(materialSID, 0);\n if(isPointLight){\n float zNear = get_zNearInner(materialSID, 0);\n float zFar = get_zFarInner(materialSID, 0);\n float normalizationCoefficient = 1.0 / (zFar - zNear);\n measureDepth = normalizationCoefficient * length(v_projPosition_from_light);\n }else{\n measureDepth = (v_projPosition_from_light / v_projPosition_from_light.w).z;\n }\n\n float depthAdjustment = get_depthAdjustment(materialSID, 0);\n measureDepth += depthAdjustment;\n\n float textureDepthAdjustment = get_textureDepthAdjustment(materialSID, 0);\n textureDepth += textureDepthAdjustment;\n\n float d = measureDepth - textureDepth;\n if(d < 0.0) return 1.0;\n\n float variance = textureSquareDepth - textureDepth * textureDepth;\n float minimumVariance = get_minimumVariance(materialSID, 0);\n variance = max(variance, minimumVariance);\n\n nonShadowProb = variance / (variance + d * d);\n\n\n float lightBleedingParameter = get_lightBleedingParameter(materialSID, 0);\n nonShadowProb = reduceLightBleeding(nonShadowProb, lightBleedingParameter);\n }\n return nonShadowProb;\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n // diffuseColor\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture\n vec4 textureColor = texture(u_diffuseColorTexture, v_texcoord_0);\n if (textureColor.r > 0.05) {\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n }\n\n // shadow mapping\n vec4 shadowColor = get_shadowColor(materialSID, 0);\n\n float nonShadowProb = chebyshevUpperBound(materialSID);\n diffuseColor = nonShadowProb * diffuseColor + (1.0 - nonShadowProb) * shadowColor.rgb;\n alpha = nonShadowProb * alpha + (1.0 - nonShadowProb) * shadowColor.a;\n\n // Lighting\n vec3 shadingColor = vec3(0.0, 0.0, 0.0);\n\n int shadingModel = get_shadingModel(materialSID, 0);\n if (shadingModel > 0) {\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n int lightNumber = get_lightNumber(materialSID, 0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */ ; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, light.direction)) * light.attenuatedIntensity;\n\n vec3 viewPosition = get_viewPosition(materialSID, 0);\n float shininess = get_shininess(materialSID, 0);\n if (shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 halfVector = normalize(light.direction + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), shininess);\n } else if (shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 R = reflect(light.direction, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), shininess);\n }\n\n }\n\n shadingColor = diffuse + specular;\n } else {\n shadingColor = diffuseColor;\n }\n\n rt0 = vec4(shadingColor, alpha);\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};function g(e,t){for(var n=0;n{n.d(t,{P:()=>R});var r=n(9315),o=n(2535),i=n(4021),a=n(9294),s=n(5983),c=n(9977),l=n(9513),u=n(2328),f=n(6860),_=n(8289),h=n(6221),d=n(7042),m=n(8468),v=n(2612),p=n(5685),y=n(178),A=n(6383),b=n(7102),g=n(4543);function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function E(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w(e,t){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:{},s=o.isMorphing,c=void 0!==s&&s,l=o.isSkinning,u=void 0!==l&&l,f=o.isLighting,_=void 0!==f&&f,h=arguments.length>3?arguments[3]:void 0,d=arguments.length>4?arguments[4]:void 0;return E(this,a),(n=r.call(this)).__semantics=[],n.__vertexInputs=[],n.__pixelInputs=[],n.__vertexOutputs=[],n.__pixelOutputs=[],n.__defaultInputValues=new Map,n.__vertexInputConnections=[],n.__pixelInputConnections=[],n.isSingleOperation=!1,n.__definitions="",n.shaderType=p.H.VertexAndPixelShader,n.__shaderFunctionName=t,n.__materialNodeUid=++a.__invalidMaterialNodeCount,a.materialNodes[a.__invalidMaterialNodeCount]=x(n),n.__isMorphing=c,n.__isSkinning=u,n.__isLighting=_,a.__dummyBlackTexture.tryToSetUniqueName("dummyBlackTexture",!0),a.__dummyWhiteTexture.tryToSetUniqueName("dummyWhiteTexture",!0),a.__dummyBlueTexture.tryToSetUniqueName("dummyBlueTexture",!0),a.__dummyBlackCubeTexture.tryToSetUniqueName("dummyBlackCubeTexture",!0),a.__dummySRGBGrayTexture.tryToSetUniqueName("dummySRGBGrayTexture",!0),a.__dummyPbrKelemenSzirmayKalosBrdfLutTexture.tryToSetUniqueName("dummyPbrKelemenSzirmayKalosBrdfLutTexture",!0),n.__vertexShaderityObject=h,n.__pixelShaderityObject=d,n.__webglResourceRepository=i.F.getWebGLResourceRepository(),n.__definitions+="#define RN_MATERIAL_NODE_NAME ".concat(t,"\n"),a.initDefaultTextures(),n}var s,l,u,P=a.prototype;return P.getDefinitions=function(e){return this.__definitions.concat()+"#define RN_IS_ALPHAMODE_"+e.alphaMode.str+"\n"},P.setShaderSemanticsInfoArray=function(e){var t=[],n=!0,r=!1,o=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done);n=!0){var c=i.value;t.push(c)}}catch(e){r=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw o}}this.__semantics=t,a.__semanticsMap.has(this.shaderFunctionName)||a.__semanticsMap.set(this.shaderFunctionName,new Map);var l=a.__semanticsMap.get(this.shaderFunctionName),u=!0,f=!1,_=void 0;try{for(var h,d=this.__semantics[Symbol.iterator]();!(u=(h=d.next()).done);u=!0){var m=h.value;l.set(m.semantic.str,m)}}catch(e){f=!0,_=e}finally{try{u||null==d.return||d.return()}finally{if(f)throw _}}},P.getShaderSemanticInfoFromName=function(e){return a.__semanticsMap.get(this.shaderFunctionName).get(e)},P.addVertexInputConnection=function(e,t,n){this.__vertexInputConnections.push({materialNodeUid:e.materialNodeUid,outputNameOfPrev:t,inputNameOfThis:n})},P.addPixelInputConnection=function(e,t,n){this.__pixelInputConnections.push({materialNodeUid:e.materialNodeUid,outputNameOfPrev:t,inputNameOfThis:n})},P.getVertexInput=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.__vertexInputs[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;if(a.name===e)return a}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}},P.getVertexInputs=function(){return this.__vertexInputs},P.getVertexOutput=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.__vertexOutputs[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;if(a.name===e)return a}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}},P.getVertexOutputs=function(){return this.__vertexOutputs},P.getPixelInput=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.__pixelInputs[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;if(a.name===e)return a}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}},P.getPixelInputs=function(){return this.__pixelInputs},P.getPixelOutput=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.__pixelOutputs[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;if(a.name===e)return a}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}},P.getPixelOutputs=function(){return this.__pixelOutputs},P.setupBasicInfo=function(e,t,n,r,o){if(e.setUniform){if(this.setWorldMatrix(t,e.worldMatrix),this.setNormalMatrix(t,e.normalMatrix),this.setIsBillboard(t,e.isBillboard),n||e.isVr){var i=e.renderPass.cameraComponent;null==i&&(i=A.C.getComponent(o,o.current)),this.setViewInfo(t,i,e.isVr,e.displayIdx),this.setProjection(t,i,e.isVr,e.displayIdx)}if(n){this.setLightsInfo(t,e.lightComponents,r,e.setUniform);var a=e.entity.tryToGetSkeletal();this.setSkinning(t,e.setUniform,a)}}var s=e.entity.tryToGetBlendShape();this.setMorphInfo(t,e.entity.getMesh(),e.primitive,s)},P.setWorldMatrix=function(e,t){e._gl.uniformMatrix4fv(e.worldMatrix,!1,t._v)},P.setNormalMatrix=function(e,t){e._gl.uniformMatrix3fv(e.normalMatrix,!1,t._v)},P.setIsBillboard=function(e,t){e._gl.uniform1i(e.isBillboard,t?1:0)},P.setViewInfo=function(e,t,n,r){var o,i;if(n){var a=y.x.getInstance().getModule("xr").WebXRSystem.getInstance();a.isWebXRMode&&(o=a._getViewMatrixAt(r),i=a._getCameraWorldPositionAt(r))}else t?(i=t.worldPosition,o=t.viewMatrix):(o=_.e.identity(),i=f.P.fromCopyArray([0,0,10]));e._gl.uniformMatrix4fv(e.viewMatrix,!1,o._v),e._gl.uniform3fv(e.viewPosition,i._v)},P.setProjection=function(e,t,n,r){var o;if(n){var i=y.x.getInstance().getModule("xr").WebXRSystem.getInstance();i.isWebXRMode&&(o=i._getProjectMatrixAt(r))}else o=t?t.projectionMatrix:_.e.identity();e._gl.uniformMatrix4fv(e.projectionMatrix,!1,o._v)},P.setSkinning=function(e,t,n){if(this.__isSkinning)if(n){if(t){if(c.D.boneDataType===m.N.Mat44x1){var r=n.jointMatricesArray;e._gl.uniformMatrix4fv(e.boneMatrix,!1,r)}else if(c.D.boneDataType===m.N.Vec4x2){var o=n.jointTranslatePackedQuat,i=n.jointScalePackedQuat;e._gl.uniform4fv(e.boneTranslatePackedQuat,o),e._gl.uniform4fv(e.boneScalePackedQuat,i)}else if(c.D.boneDataType===m.N.Vec4x2Old){var a=n.jointQuaternionArray,s=n.jointTranslateScaleArray;e._gl.uniform4fv(e.boneQuaternion,a),e._gl.uniform4fv(e.boneTranslateScale,s)}else if(c.D.boneDataType===m.N.Vec4x1){var l=n.jointCompressedChunk,u=n.jointCompressedInfo;e._gl.uniform4fv(e.boneCompressedChunk,l),e._gl.uniform4fv(e.boneCompressedInfo,u._v)}e._gl.uniform1i(e.skinningMode,n.componentSID)}}else t&&e._gl.uniform1i(e.skinningMode,-1)},P.setLightsInfo=function(e,t,n,r){if(this.__isLighting&&r){var o=t.filter((function(e){return e.enable}));e._gl.uniform1i(e.lightNumber,o.length);var i=Math.min(o.length,c.D.maxLightNumberInShader);a.__lightPositions.length!==3*i&&(a.__lightPositions=new Float32Array(3*i),a.__lightDirections=new Float32Array(3*i),a.__lightIntensities=new Float32Array(3*i),a.__lightProperties=new Float32Array(4*i));for(var s=0;s=c.D.maxLightNumberInShader)&&null!=e.lightPosition;s++){var l=o[s],u=l.entity.getSceneGraph().worldPosition,f=l.direction,_=l.intensity;a.__lightPositions[3*s+0]=u.x,a.__lightPositions[3*s+1]=u.y,a.__lightPositions[3*s+2]=u.z;var h=1/Math.max(.001,Math.cos(l.innerConeAngle)-Math.cos(l.outerConeAngle)),d=-Math.cos(l.outerConeAngle)*h;a.__lightDirections[3*s+0]=f.x,a.__lightDirections[3*s+1]=f.y,a.__lightDirections[3*s+2]=f.z,a.__lightIntensities[3*s+0]=_.x,a.__lightIntensities[3*s+1]=_.y,a.__lightIntensities[3*s+2]=_.z,a.__lightProperties[4*s+0]=l.enable?l.type.index:-1,a.__lightProperties[4*s+1]=l.range,a.__lightProperties[4*s+2]=h,a.__lightProperties[4*s+3]=d}i>0&&(e._gl.uniform3fv(e.lightPosition,a.__lightPositions),e._gl.uniform3fv(e.lightDirection,a.__lightDirections),e._gl.uniform3fv(e.lightIntensity,a.__lightIntensities),e._gl.uniform4fv(e.lightProperty,a.__lightProperties))}},P.setMorphInfo=function(e,t,n,r){if(this.__isMorphing)if(0!==n.targets.length){e._gl.uniform1i(e.morphTargetNumber,n.targets.length);var o,i=n.targets.map((function(e){var t=e.get(h.T.Position.XYZ),n=0;return d.V.isDataTextureApproach(v.Z.currentProcessApproach)&&(n=c.D.totalSizeOfGPUShaderDataStorageExceptMorphData),(n+t.byteOffsetInBuffer)/4/4}));e._gl.uniform1iv(e.dataTextureMorphOffsetPosition,i),o=r.weights.length>0?r.weights:new Float32Array(n.targets.length),e._gl.uniform1fv(e.morphWeights,o)}else e._gl.uniform1i(e.morphTargetNumber,0)},P._setCustomSettingParametersToGpu=function(e){e.material,e.shaderProgram,e.firstTime,e.args},P.setDefaultInputValue=function(e,t){this.__defaultInputValues.set(e,t)},P.getDefinition=function(){return""},a.getMaterialNode=function(e){return a.materialNodes[e]},a.initDefaultTextures=function(){var e,t=this;return(e=function(){var e,n;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{n.d(t,{F:()=>S});var r=n(9315),o=n(3650),i=n(7416),a=n(3932),s=n(9409),c=n(4021),l=n(9977),u=n(5685),f=n(5479),_=n(9481),h=n(425),d=n(7042),m=n(8468),v=n(678),p=n(6670),y=n(9197),A=n(2142);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{n.d(t,{r:()=>_});var r=n(9977),o=n(4395),i=n(5171),a=n(2535),s=n(3932),c=n(3138),l=n(9409),u=n(9197),f=n(790),_=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.registerMaterial=function(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.D.maxMaterialInstanceForEachType;return e.__materialNodes.has(t)?(console.info("".concat(t," is already registered.")),!1):(e.__registerInner(t,n,o),!0)},e.forceRegisterMaterial=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r.D.maxMaterialInstanceForEachType;return this.__registerInner(e,t,n),!0},e.isRegisteredMaterialType=function(t){return e.__materialNodes.has(t)},e.getMaterialByMaterialUid=function(e){return this.__materialMap.get(e)},e.getAllMaterials=function(){return Array.from(e.__materialMap.values())},e.createMaterial=function(t,n){var r=n;r||(r=e.__materialNodes.get(t));var o=e.__materialInstanceCountOfType.get(t),i=new f.F(e.__materialTids.get(t),++e.__materialUidCount,o++,t,r);return this.__initialize(i,o),i},e.isFullOrOverOfThisMaterialType=function(t){var n=e.__materialInstanceCountOfType.get(t);if(u.Is.not.exist(n))return!1;var r=e.__maxInstances.get(t);return!u.Is.not.exist(r)&&n>=r},e.__initialize=function(t,n){t.tryToSetUniqueName(t.__materialTypeName,!0),e.__materialMap.set(t.materialUID,t);var r=e.__instances.get(t.__materialTypeName);if(u.Is.not.exist(r)&&(r=new Map,e.__instances.set(t.materialTypeName,r)),r.set(t.materialSID,t),e.__materialInstanceCountOfType.set(t.materialTypeName,n),u.Is.exist(t._materialContent)){var o=t._materialContent._semanticsInfoArray,i=e.__accessors.get(t.materialTypeName);o.forEach((function(n){var r=e._getPropertyIndex(n);if(t._allFieldsInfo.set(r,n),!n.soloDatum){var o=i.get(r).takeOne(),a={info:n,value:l.D.initWithFloat32Array(n.initialValue,n.initialValue,o,n.compositionType)};t._allFieldVariables.set(r,a),n.isCustomSetting||t._autoFieldVariablesOnly.set(r,a)}}))}},e.getLocationOffsetOfMemberOfMaterial=function(t,n){var r=e.__instances.get(t).get(0);return r._allFieldsInfo.get(n).soloDatum?f.F._soloDatumFields.get(r.materialTypeName).get(n).value._v.byteOffset/4/4:this.__accessors.get(t).get(n).byteOffsetInBuffer/4/4},e._getPropertyIndex=function(e){return e.semantic.index},e.__registerInner=function(t,n,r){var o=++e.__materialTidCount;e.__materialNodes.set(t,n),e.__materialTids.set(t,o),e.__maxInstances.set(t,r),u.Is.exist(n)&&e.__allocateBufferView(t,n),e.__materialInstanceCountOfType.set(t,0)},e.__allocateBufferView=function(t,n){var r=0,u=[],_=!0,h=!1,d=void 0;try{for(var m,v=n._semanticsInfoArray[Symbol.iterator]();!(_=(m=v.next()).done);_=!0){var p=m.value,y=(0,c.K)(p),A=1;p.soloDatum||(A=e.__maxInstances.get(t)),r+=y*A,u.push({alignedByte:y,semanticInfo:p})}}catch(e){h=!0,d=e}finally{try{_||null==v.return||v.return()}finally{if(h)throw d}}this.__accessors.has(t)||this.__accessors.set(t,new Map);var b,g=o.B.getInstance().createOrGetBuffer(i.$.GPUInstanceData);this.__bufferViews.has(t)?b=this.__bufferViews.get(t):(b=g.takeBufferView({byteLengthToNeed:r,byteStride:0}).unwrapForce(),this.__bufferViews.set(t,b));for(var x=0;x{n.d(t,{Q:()=>x});var r=n(3034),o=n.n(r),i=n(2535),a=n(3932),s=n(6221),c=n(4395),l=n(6174),u=n(9977),f=n(7416),_=n(678),h=n(7011),d=n(9513),m=n(988),v=n(2328),p=n(2863),y=n(8289),A=n(3764),b=n(2542),g=n(5685),x=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.fillTemplate=function(e,t){var n=Object.assign(t,{WellKnownComponentTIDs:l.z,widthOfDataTexture:"const int widthOfDataTexture = ".concat(c.B.bufferWidthLength,";"),heightOfDataTexture:"const int heightOfDataTexture = ".concat(c.B.bufferHeightLength,";"),Config:u.D});return o().fillTemplate(e,n)},e.transformWebGLVersion=function(e,t){return t?o().transformToGLSLES3(e):o().transformToGLSLES1(e,!0)},e.getAttributeReflection=function(e){var t=o().createReflectionObject(e);return this.__setDefaultAttributeSemanticMap(t),t.reflect(),{names:t.attributesNames,semantics:t.attributesSemantics.map((function(e){return s.T.fromString(e)})),compositions:t.attributesTypes.map((function(e){return a.d.fromGlslString(e)})),components:t.attributesTypes.map((function(e){return i.r.fromGlslString(e)}))}},e.__setDefaultAttributeSemanticMap=function(e){var t=new Map;t.set("instanceinfo","INSTANCE"),t.set("barycentriccoord","BARY_CENTRIC_COORD"),e.addAttributeSemanticsMap(t)},e.getShaderDataReflection=function(e,t){var n=this.__copyShaderityObject(e),r=e.code.split(/\r\n|\n/),o=[],i=[],a=!0,s=!1,c=void 0;try{for(var l,u=r[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var f=l.value,_=f.match(/^(?![/])[\t ]*uniform[\t ]+(\w+)[\t ]+(\w+);[\t ]*(\/\/)*[\t ]*(.*)/);if(_){var h=_[1],d=_[2],m=_[4];if(this.__ignoreThisUniformDeclaration(m)){o.push(f);continue}var v=this.__createShaderSemanticsInfo(h,d,m,e.isFragmentShader,t);i.push(v)}else o.push(f)}}catch(e){s=!0,c=e}finally{try{a||null==u.return||u.return()}finally{if(s)throw c}}return n.code=o.join("\n"),{shaderSemanticsInfoArray:i,shaderityObject:n}},e.__copyShaderityObject=function(e){return{code:e.code,shaderStage:e.shaderStage,isFragmentShader:"fragment"===e.shaderStage}},e.__ignoreThisUniformDeclaration=function(e){var t=e.match(/skipProcess[\t ]*=[\t ]*(\w+)[,\t ]*/);return"true"===(null==t?void 0:t[1])},e.__createShaderSemanticsInfo=function(e,t,n,r,o){var s=i.r.fromGlslString(e),c=a.d.fromGlslString(e),l=r?g.H.PixelShader:g.H.VertexShader,u=!0,_=t.match(/u_(\w+)/);_&&(t=_[1],u=!1);var h=f.f5.fromStringCaseSensitively(t);if(null==h){var d=null==o?void 0:o.get(t);h=null!=d?d.semantic:new f.wy({str:t})}var m={semantic:h,compositionType:c,componentType:s,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!1,stage:l,none_u_prefix:u};return this.__setRhodoniteOriginalParametersTo(m,n),m},e.__setRhodoniteOriginalParametersTo=function(e,t){var n,r=t.match(/soloDatum[\t ]*=[\t ]*(\w+)[,\t ]*/),o=!1;"true"===(null==r?void 0:r[1])&&(o=!0),e.soloDatum=o;var i=t.match(/isCustomSetting[\t ]*=[\t ]*(\w+)[,\t ]*/),a=!1;"true"===(null==i?void 0:i[1])&&(a=!0),e.isCustomSetting=a;var s=t.match(/updateInterval[\t ]*=[\t ]*(\w+)[,\t ]*/),c=_.a.FirstTimeOnly;"everytime"===(null==s||null===(n=s[1])||void 0===n?void 0:n.toLowerCase())&&(c=_.a.EveryTime),e.updateInterval=c;var l=t.match(/initialValue[\t ]*=[\t ]*(.+)[,\t ]*/);if(l){var u=l[1];e.initialValue=this.__getInitialValueFromText(e,u)}else e.initialValue=this.__getDefaultInitialValue(e);var f=t.match(/needUniformInDataTextureMode[\t ]*=[\t ]*(.+)[,\t ]*/);if(f){var h=!1;"true"===(null==f?void 0:f[1])&&(h=!0),e.needUniformInDataTextureMode=h}},e.__getInitialValueFromText=function(e,t){var n,r=t.match(/\(([\d\w., ]+)\)/),o=function(t){e.compositionType!==t&&console.error("component number of initialValue is invalid:"+e.semantic.str)};if(r){var i=r[1].split(",");switch(i.length){case 1:o(a.d.Scalar),n="true"===i[0]?new A.DU(new Float32Array([1])):"false"===i[0]?new A.DU(new Float32Array([0])):new A.DU(new Float32Array([parseFloat(i[0])]));break;case 2:if(e.compositionType===a.d.Texture2D||e.compositionType===a.d.Texture2DShadow){var s=i[1].charAt(0).toUpperCase()+i[1].slice(1);n=[parseInt(i[0]),h.P["dummy".concat(s,"Texture")]]}else if(e.compositionType===a.d.TextureCube){var c=i[1].charAt(0).toUpperCase()+i[1].slice(1);n=[parseInt(i[0]),h.P["dummy".concat(c,"CubeTexture")]]}else o(a.d.Vec2),n=d.NR.fromCopyArray([parseFloat(i[0]),parseFloat(i[1])]);break;case 3:o(a.d.Vec3),n=m.d6.fromCopyArray([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]);break;case 4:o(a.d.Vec4),n=v.xQ.fromCopyArray([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3])]);break;case 9:o(a.d.Mat3),n=p.x.fromCopy9RowMajor(parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3]),parseFloat(i[4]),parseFloat(i[5]),parseFloat(i[6]),parseFloat(i[7]),parseFloat(i[8]));break;case 16:o(a.d.Mat4),n=y.e.fromCopy16RowMajor(parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2]),parseFloat(i[3]),parseFloat(i[4]),parseFloat(i[5]),parseFloat(i[6]),parseFloat(i[7]),parseFloat(i[8]),parseFloat(i[9]),parseFloat(i[10]),parseFloat(i[11]),parseFloat(i[12]),parseFloat(i[13]),parseFloat(i[14]),parseFloat(i[15]));break;default:console.error("Invalid format")}}else o(a.d.Scalar),n="true"===t?new A.DU(new Float32Array([1])):"false"===t?new A.DU(new Float32Array([0])):new A.DU(new Float32Array([parseFloat(t)]));return n},e.__getDefaultInitialValue=function(e){return e.compositionType===a.d.Scalar?new A.DU(new Float32Array([0])):e.compositionType===a.d.Vec2?d.NR.zero():e.compositionType===a.d.Vec3?m.d6.zero():e.compositionType===a.d.Vec4?v.xQ.zero():e.compositionType===a.d.Mat2?b.f.identity():e.compositionType===a.d.Mat3?p.x.identity():e.compositionType===a.d.Mat4?y.e.identity():e.compositionType===a.d.Texture2D||e.compositionType===a.d.Texture2DShadow?[0,h.P.dummyWhiteTexture]:e.compositionType===a.d.TextureCube?[0,h.P.dummyBlackTexture]:void console.warn("initial value is not found")},e}()},6631:(e,t,n)=>{n.d(t,{m:()=>s});var r=n(6860),o=n(988),i=n(4969);function a(e,t){for(var n=0;n{function r(e,t){for(var n=0;no});var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._v=new Float32Array}var t,n,o=e.prototype;return o.at=function(e,t){throw new Error("Method not implemented.")},o.toString=function(){throw new Error("Method not implemented.")},o.toStringApproximately=function(){throw new Error("Method not implemented.")},o.flattenAsArray=function(){throw new Error("Method not implemented.")},o.isDummy=function(){return 0===this._v.length},o.v=function(e){return this._v[e]},o.determinant=function(){throw new Error("Method not implemented.")},o.isTheSourceSame=function(e){return this._v.buffer===e},t=e,(n=[{key:"className",get:function(){return this.constructor.name}},{key:"isIdentityMatrixClass",get:function(){return!1}}])&&r(t.prototype,n),e}()},7586:(e,t,n)=>{function r(e,t){for(var n=0;no});var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._v=new Float32Array}var t,n,o=e.prototype;return o.at=function(e){return this._v[e]},o.length=function(){return Math.hypot(this._v[0],this._v[1],this._v[2],this._v[3])},o.lengthSquared=function(){return Math.pow(this._v[0],2)+Math.pow(this._v[1],2)+Math.pow(this._v[2],2)+Math.pow(this._v[3],2)},o.toString=function(){throw new Error("Method not implemented.")},o.toStringApproximately=function(){throw new Error("Method not implemented.")},o.flattenAsArray=function(){throw new Error("Method not implemented.")},o.isDummy=function(){throw new Error("Method not implemented.")},o.isEqual=function(e,t){throw new Error("Method not implemented.")},o.isStrictEqual=function(e){throw new Error("Method not implemented.")},o.toEulerAnglesTo=function(e){throw new Error("Method not implemented.")},o.transformVector3=function(e){throw new Error("Method not implemented.")},o.transformVector3Inverse=function(e){throw new Error("Method not implemented.")},o.dot=function(e){return this._v[0]*e._v[0]+this._v[1]*e._v[1]+this._v[2]*e._v[2]+this._v[3]*e._v[3]},o.clone=function(){throw new Error("Method not implemented.")},t=e,(n=[{key:"className",get:function(){return this.constructor.name}},{key:"x",get:function(){return this._v[0]}},{key:"y",get:function(){return this._v[1]}},{key:"z",get:function(){return this._v[2]}},{key:"w",get:function(){return this._v[3]}}])&&r(t.prototype,n),e}()},2199:(e,t,n)=>{function r(e,t){for(var n=0;no});var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._v=new Float32Array}var t,n,o=e.prototype;return o.isEqual=function(e,t){throw new Error("Method not implemented.")},o.isStrictEqual=function(e){throw new Error("Method not implemented.")},o.length=function(){throw new Error("Method not implemented.")},o.lengthSquared=function(){throw new Error("Method not implemented.")},o.lengthTo=function(e){throw new Error("Method not implemented.")},o.dot=function(e){throw new Error("Method not implemented.")},o.at=function(e){return this._v[e]},o.toString=function(){throw new Error("Method not implemented.")},o.toStringApproximately=function(){throw new Error("Method not implemented.")},o.flattenAsArray=function(){throw new Error("Method not implemented.")},o.isDummy=function(){return 0===this._v.length},o.v=function(e){return this._v[e]},o.isTheSourceSame=function(e){return this._v.buffer===e},t=e,(n=[{key:"glslStrAsFloat",get:function(){throw new Error("Method not implemented.")}},{key:"glslStrAsInt",get:function(){throw new Error("Method not implemented.")}},{key:"className",get:function(){return this.constructor.name}},{key:"bytesPerComponent",get:function(){throw new Error("Method not implemented.")}}])&&r(t.prototype,n),e}()},8107:(e,t,n)=>{n.d(t,{s:()=>u});var r=n(6860);function o(e,t){for(var n=0;n{n.d(t,{c:()=>f});var r=n(3932),o=n(2507),i=n(6860);function a(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;return Math.abs(e.m00-1){n.d(t,{a:()=>f});var r=n(3932),o=n(2507),i=n(6860);function a(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;return Math.abs(e.m00-1){n.d(t,{D:()=>b});var r=n(8020),o=n(6860),i=n(6264),a=n(5233),s=n(6386),c=n(7468),l=n(3932),u=n(8289),f=n(2863),_=n(2328),h=n(988),d=n(9513),m=n(1811),v=n(8776),p=n(3764),y=n(2175);function A(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var b=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.arrayToVector=function(e){return Array.isArray(e)?void 0!==e[3]?i.Lt.fromCopyArray([e[0],e[1],e[2],e[3]]):void 0!==e[2]?o.P.fromCopyArray([e[0],e[1],e[2]]):r.FM.fromCopyArray2([e[0],e[1]]):e},e.arrayToVectorOrMatrix=function(e){return Array.isArray(e)?void 0!==e[15]?c.J.fromCopyArrayRowMajor(e):void 0!==e[8]?s.h.fromCopyArrayRowMajor(e):void 0!==e[3]?i.Lt.fromCopyArray([e[0],e[1],e[2],e[3]]):void 0!==e[2]?o.P.fromCopyArray([e[0],e[1],e[2]]):r.FM.fromCopyArray2([e[0],e[1]]):e},e.getImmutableValueClass=function(e){return e===l.d.Vec2?r.FM:e===l.d.Vec3?o.P:e===l.d.Vec4?i.Lt:e===l.d.Mat3?s.h:e===l.d.Mat4?c.J:void 0},e.getMutableValueClass=function(e){return e===l.d.Vec2?d.NR:e===l.d.Vec3?h.d6:e===l.d.Vec4?_.xQ:e===l.d.Mat3?f.x:e===l.d.Mat4?u.e:void 0},e.cloneOfMathObjects=function(e){return A(e,c.J)||A(e,s.h)||A(e,i.Lt)||A(e,o.P)||A(e,r.FM)?e.clone():e},e.isAcceptableArrayForQuaternion=function(e){return!(!Array.isArray(e)||void 0===e[3])},e.arrayToQuaternion=function(e){return a._.fromCopy4(e[0],e[1],e[2],e[3])},e.makeSubArray=function(e,t){return 4===t?[e[0],e[1],e[2],e[3]]:3===t?[e[0],e[1],e[2]]:2===t?[e[0],e[1]]:e[0]},e.vectorToArray=function(e){return A(e,r.FM)?[e.x,e.y]:A(e,o.P)?[e.x,e.y,e.z]:A(e,i.Lt)||A(e,a._)?[e.x,e.y,e.z,e.w]:e},e.componentNumberOfVector=function(e){return A(e,r.FM)?2:A(e,o.P)?3:A(e,i.Lt)||A(e,a._)?4:Array.isArray(e)?e.length:0},e.packNormalizedVec4ToVec2=function(e,t,n,r,o){return e=(e+1)/2,t=(t+1)/2,n=(n+1)/2,r=(r+1)/2,[(Math.floor(e*(o-1))*o+Math.floor(t*(o-1)))/o,(Math.floor(n*(o-1))*o+Math.floor(r*(o-1)))/o]},e.unProjectTo=function(e,t,n,r,o,i){var a=this.__tmpVector4_0.setComponents((e-o.x)/o.z*2-1,(t-o.y)/o.w*2-1,2*n-1,1),s=r.multiplyVectorTo(a,this.__tmpVector4_1);return 0===s.w&&console.error("0 division occurred!"),h.d6.multiplyTo(s,1/s.w,i)},e.add=function(e,t){if(isFinite(e))return e+t;if(A(e,r.FM))return r.FM.add(e,t);if(A(e,o.P))return o.P.add(e,t);if(A(e,i.Lt))return i.Lt.add(e,t);if(A(e,a._))return a._.add(e,t);if(Array.isArray(e)){for(var n=[],s=0;s{function r(e){return 0==(e&e-1)}n.d(t,{k:()=>o});var o=Object.freeze({radianToDegree:function(e){return 180*e/Math.PI},degreeToRadian:function(e){return e*Math.PI/180},toHalfFloat:function(){return function(e){var t=new Float32Array(1),n=new Int32Array(t.buffer);t[0]=e;var r=n[0],o=r>>16&32768,i=r>>12&2047,a=r>>23&255;return a<103?o:a>142?(o|=31744,o|=(255==a?0:1)&&8388607&r):a<113?o|=((i|=2048)>>114-a)+(i>>113-a&1):(o|=a-112<<10|i>>1,o+=1&i)}},isPowerOfTwo:r,isPowerOfTwoTexture:function(e,t){return r(e)&&r(t)},packNormalizedVec4ToVec2:function(e,t,n,r,o){return e=(e+1)/2,t=(t+1)/2,n=(n+1)/2,r=(r+1)/2,[(Math.floor(e*(o-1))*o+Math.floor(t*(o-1)))/o,(Math.floor(n*(o-1))*o+Math.floor(r*(o-1)))/o]},convertToStringAsGLSLFloat:function(e){return Number.isInteger(e)?"".concat(e,".0"):""+e},nearZeroToZero:function(e){return Math.abs(e)<1e-5?e=0:.999994&&Math.abs(n.at(b))+c==Math.abs(n.at(b))&&Math.abs(n.at(g))+c==Math.abs(n.at(g)))e.setAt(b,g,0);else if(Math.abs(e.at(b,g))>_){l=n.at(g)-n.at(b),i=(s=Math.abs(l)+c==Math.abs(l)?e.at(b,g)/l:(f=.5*l/e.at(b,g))<0?-1/(Math.sqrt(1+f*f)-f):1/(Math.sqrt(1+f*f)+f))*(a=1/Math.sqrt(1+s*s)),u=s*e.at(b,g),e.setAt(b,g,0),n.setAt(b,n.at(b)-u),n.setAt(g,n.at(g)+u);for(var x=0;x=0?" "+t:t}})},4191:(e,t,n)=>{n.d(t,{a:()=>_});var r=n(3932),o=n(8020),i=n(4969),a=n(2507);function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;return Math.abs(e._v[0]-this._v[0]){n.d(t,{h:()=>h});var r=n(6860),o=n(3932),i=n(4969),a=n(2507),s=n(344);function c(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;return Math.abs(e._v[0]-this._v[0]){n.d(t,{J:()=>m});var r=n(6860),o=n(6264),i=n(3932),a=n(4969),s=n(2424),c=n(2507),l=n(7058);function u(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON,n=e._v;return Math.abs(n[0]-this._v[0]){n.d(t,{f:()=>u});var r=n(4191);function o(e,t){for(var n=0;n{n.d(t,{x:()=>u});var r=n(6386);function o(e,t){for(var n=0;n{n.d(t,{e:()=>u});var r=n(7468);function o(e,t){for(var n=0;n{n.d(t,{y:()=>u});var r=n(5233);function o(e,t){for(var n=0;n1?r=.999:r<-1&&(r=-.999);var o,i=Math.acos(r);r<0&&i>Math.PI/2?(r=-e._v[3]*t._v[3]-e._v[0]*t._v[0]-e._v[1]*t._v[1]-e._v[2]*t._v[2],i=Math.acos(r),o=-1*Math.sin(i*n)/Math.sin(i)):o=Math.sin(i*n)/Math.sin(i);var a=Math.sin(i*(1-n))/Math.sin(i);return this._v[0]=e._v[0]*a+t._v[0]*o,this._v[1]=e._v[1]*a+t._v[1]*o,this._v[2]=e._v[2]*a+t._v[2]*o,this._v[3]=e._v[3]*a+t._v[3]*o,this},_.lerp=function(e,t,n){return this._v[0]=e._v[0]*(1-n)+t._v[0]*n,this._v[1]=e._v[1]*(1-n)+t._v[1]*n,this._v[2]=e._v[2]*(1-n)+t._v[2]*n,this._v[3]=e._v[3]*(1-n)+t._v[3]*n,this},_.axisAngle=function(e,t){var n=.5*t,r=Math.sin(n),o=e.length();return 0===o&&console.error("0 division occurred!"),this._v[3]=Math.cos(n),this._v[0]=r*e._v[0]/o,this._v[1]=r*e._v[1]/o,this._v[2]=r*e._v[2]/o,this},_.fromMatrix=function(e){var t=e.m00+e.m11+e.m22;if(t>0){var n=.5/Math.sqrt(t+1);this._v[0]=(e.m21-e.m12)*n,this._v[1]=(e.m02-e.m20)*n,this._v[2]=(e.m10-e.m01)*n,this._v[3]=.25/n}else if(e.m00>e.m11&&e.m00>e.m22){var r=2*Math.sqrt(1+e.m00-e.m11-e.m22);this._v[0]=.25*r,this._v[1]=(e.m01+e.m10)/r,this._v[2]=(e.m02+e.m20)/r,this._v[3]=(e.m21-e.m12)/r}else if(e.m11>e.m22){var o=2*Math.sqrt(1+e.m11-e.m00-e.m22);this._v[0]=(e.m01+e.m10)/o,this._v[1]=.25*o,this._v[2]=(e.m12+e.m21)/o,this._v[3]=(e.m02-e.m20)/o}else{var i=2*Math.sqrt(1+e.m22-e.m00-e.m11);this._v[0]=(e.m02+e.m20)/i,this._v[1]=(e.m12+e.m21)/i,this._v[2]=.25*i,this._v[3]=(e.m10-e.m01)/i}return this},_.fromPosition=function(e){return this.setComponents(e._v[0],e._v[1],e._v[2],0)},_.add=function(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this._v[2]+=e._v[2],this._v[3]+=e._v[3],this},_.subtract=function(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this._v[2]-=e._v[2],this._v[3]-=e._v[3],this},_.multiply=function(e){var t=e._v[3]*this._v[0]+e._v[2]*this._v[1]+e._v[1]*this._v[2]-e._v[0]*this._v[3],n=-e._v[2]*this._v[0]+e._v[3]*this._v[1]+e._v[0]*this._v[2]-e._v[1]*this._v[3],r=e._v[1]*this._v[0]+e._v[0]*this._v[1]+e._v[3]*this._v[2]-e._v[2]*this._v[3],o=-e._v[0]*this._v[0]-e._v[1]*this._v[1]-e._v[2]*this._v[2]-e._v[3]*this._v[3];return this.setComponents(t,n,r,o)},_.multiplyNumber=function(e){return this._v[0]*=e,this._v[1]*=e,this._v[2]*=e,this._v[3]*=e,this},_.divideNumber=function(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e,this._v[2]/=e,this._v[3]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0,this._v[2]=1/0,this._v[3]=1/0),this},_.clone=function(){return l.fromCopy4(this._v[0],this._v[1],this._v[2],this._v[3])},l.identity=function(){return l.fromCopy4(0,0,0,1)},l.dummy=function(){return new this(new Float32Array(0))},l.invert=function(e){return i(a(l),"invert",this).call(this,e)},l.qlerp=function(e,t,n){return i(a(l),"qlerp",this).call(this,e,t,n)},l.lerp=function(e,t,n){return i(a(l),"lerp",this).call(this,e,t,n)},l.axisAngle=function(e,t){return i(a(l),"axisAngle",this).call(this,e,t)},l.fromMatrix=function(e){return i(a(l),"fromMatrix",this).call(this,e)},l.fromPosition=function(e){return i(a(l),"fromPosition",this).call(this,e)},l.add=function(e,t){return i(a(l),"add",this).call(this,e,t)},l.subtract=function(e,t){return i(a(l),"subtract",this).call(this,e,t)},l.multiply=function(e,t){return i(a(l),"multiply",this).call(this,e,t)},l.multiplyNumber=function(e,t){return i(a(l),"multiplyNumber",this).call(this,e,t)},l.divideNumber=function(e,t){return i(a(l),"divideNumber",this).call(this,e,t)},l.fromFloat32Array=function(e){return new l(e)},l.fromCopyArray4=function(e){return new l(new Float32Array(e))},l.fromCopyArray=function(e){return new l(new Float32Array(e.slice(0,4)))},l.fromCopy4=function(e,t,n,r){return new l(new Float32Array([e,t,n,r]))},l.fromCopyQuaternion=function(e){var t=new Float32Array(4);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],t[3]=e._v[3],new l(t)},l.fromCopyVector4=function(e){var t=new Float32Array(4);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],t[3]=e._v[3],new l(t)},l.fromCopyLogQuaternion=function(e){var t=e._v[0]*e._v[0]+e._v[1]*e._v[1]+e._v[2]*e._v[2],n=Math.sin(t),r=new Float32Array(4);return r[0]=e._v[0]*(n/t),r[1]=e._v[1]*(n/t),r[2]=e._v[2]*(n/t),r[3]=Math.cos(t),new l(r)},u=l,(f=[{key:"x",get:function(){return this._v[0]},set:function(e){this._v[0]=e}},{key:"y",get:function(){return this._v[1]},set:function(e){this._v[1]=e}},{key:"z",get:function(){return this._v[2]},set:function(e){this._v[2]=e}},{key:"w",get:function(){return this._v[3]},set:function(e){this._v[3]=e}},{key:"className",get:function(){return"MutableQuaternion"}}])&&o(u.prototype,f),l}(r._)},3764:(e,t,n)=>{n.d(t,{$_:()=>v,DU:()=>m,Et:()=>d});var r=n(1811),o=n(3932);function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n{n.d(t,{NR:()=>m,el:()=>d,th:()=>v});var r=n(8020);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n{n.d(t,{I1:()=>d,d6:()=>m,oV:()=>v});var r=n(6860);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n{n.d(t,{e2:()=>d,hn:()=>v,xQ:()=>m});var r=n(6264);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n{n.d(t,{_:()=>h});var r=n(4969),o=n(3932),i=n(7586),a=n(6860),s=n(988);function c(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;return Math.abs(e._v[0]-this._v[0])=1?e._v[1]=Math.PI/2*Math.sign(r):e._v[1]=Math.asin(r);var o=2*(this._v[3]*this._v[2]+this._v[0]*this._v[1]),i=1-2*(this._v[1]*this._v[1]+this._v[2]*this._v[2]);return e._v[2]=Math.atan2(o,i),e},v.toEulerAngles=function(){var e=new a.P(new Float32Array(3)),t=2*(this._v[3]*this._v[0]+this._v[1]*this._v[2]),n=1-2*(this._v[0]*this._v[0]+this._v[1]*this._v[1]);e._v[0]=Math.atan2(t,n);var r=2*(this._v[3]*this._v[1]-this._v[2]*this._v[0]);Math.abs(r)>=1?e._v[1]=Math.PI/2*Math.sign(r):e._v[1]=Math.asin(r);var o=2*(this._v[3]*this._v[2]+this._v[0]*this._v[1]),i=1-2*(this._v[1]*this._v[1]+this._v[2]*this._v[2]);return e._v[2]=Math.atan2(o,i),e},v.fromToRotation=function(e,t){var n=s.d6.fromCopyVector3(e),r=s.d6.fromCopyVector3(t);n.normalize(),r.normalize();var o=n.dot(r);if(o>-1+Number.EPSILON){var i=Math.sqrt(2*(1+o)),c=1/i,l=a.P.multiply(n.cross(r),c);return this._v[0]=l.x,this._v[1]=l.y,this._v[2]=l.z,this._v[3]=.5*i,_.normalize(this)}var u=a.P.fromCopy3(0,1,0),f=n.cross(u);return f.length()1?r=.999:r<-1&&(r=-.999);var o,i=Math.acos(r),a=Math.sin(i);r<0?(r*=-1,i=Math.acos(r),o=-1*Math.sin(i*n)/a):o=Math.sin(i*n)/a;var s=Math.sin(i*(1-n))/a,c=e._v[0]*s+t._v[0]*o,l=e._v[1]*s+t._v[1]*o,u=e._v[2]*s+t._v[2]*o,f=e._v[3]*s+t._v[3]*o,h=Math.hypot(c,l,u,f);return c/=h,l/=h,u/=h,f/=h,_.fromCopy4(c,l,u,f)},_.qlerpTo=function(e,t,n,r){var o=e._v[0]*t._v[0]+e._v[1]*t._v[1]+e._v[2]*t._v[2]+e._v[3]*t._v[3];if(0==1-o*o)return r.copyComponents(e);o>1?o=.999:o<-1&&(o=-.999);var i,a=Math.acos(o),s=Math.sin(a);o<0?(o*=-1,a=Math.acos(o),i=-1*Math.sin(a*n)/s):i=Math.sin(a*n)/s;var c=Math.sin(a*(1-n))/s;return r._v[0]=e._v[0]*c+t._v[0]*i,r._v[1]=e._v[1]*c+t._v[1]*i,r._v[2]=e._v[2]*c+t._v[2]*i,r._v[3]=e._v[3]*c+t._v[3]*i,r.normalize()},_.lerp=function(e,t,n){var r=e._v[0]*(1-n)+t._v[0]*n,o=e._v[1]*(1-n)+t._v[1]*n,i=e._v[2]*(1-n)+t._v[2]*n,a=e._v[3]*(1-n)+t._v[3]*n;return _.fromCopy4(r,o,i,a)},_.lerpTo=function(e,t,n,r){return r._v[0]=e._v[0]*(1-n)+t._v[0]*n,r._v[1]=e._v[1]*(1-n)+t._v[1]*n,r._v[2]=e._v[2]*(1-n)+t._v[2]*n,r._v[3]=e._v[3]*(1-n)+t._v[3]*n,r},_.axisAngle=function(e,t){var n=.5*t,r=Math.sin(n),o=e.length();return 0===o&&console.error("0 division occurred!"),_.fromCopy4(r*e._v[0]/o,r*e._v[1]/o,r*e._v[2]/o,Math.cos(n))},_.fromMatrix=function(e){var t=_.fromCopy4(0,0,0,1),n=e.m00+e.m11+e.m22;if(n>0){var r=.5/Math.sqrt(n+1);t._v[3]=.25/r,t._v[0]=(e.m21-e.m12)*r,t._v[1]=(e.m02-e.m20)*r,t._v[2]=(e.m10-e.m01)*r}else if(e.m00>e.m11&&e.m00>e.m22){var o=2*Math.sqrt(1+e.m00-e.m11-e.m22);t._v[3]=(e.m21-e.m12)/o,t._v[0]=.25*o,t._v[1]=(e.m01+e.m10)/o,t._v[2]=(e.m02+e.m20)/o}else if(e.m11>e.m22){var i=2*Math.sqrt(1+e.m11-e.m00-e.m22);t._v[3]=(e.m02-e.m20)/i,t._v[0]=(e.m01+e.m10)/i,t._v[1]=.25*i,t._v[2]=(e.m12+e.m21)/i}else{var a=2*Math.sqrt(1+e.m22-e.m00-e.m11);t._v[3]=(e.m10-e.m01)/a,t._v[0]=(e.m02+e.m20)/a,t._v[1]=(e.m12+e.m21)/a,t._v[2]=.25*a}return t},_.fromMatrixTo=function(e,t){var n=e.m00+e.m11+e.m22;if(n>0){var r=.5/Math.sqrt(n+1);t._v[3]=.25/r,t._v[0]=(e.m21-e.m12)*r,t._v[1]=(e.m02-e.m20)*r,t._v[2]=(e.m10-e.m01)*r}else if(e.m00>e.m11&&e.m00>e.m22){var o=2*Math.sqrt(1+e.m00-e.m11-e.m22);t._v[3]=(e.m21-e.m12)/o,t._v[0]=.25*o,t._v[1]=(e.m01+e.m10)/o,t._v[2]=(e.m02+e.m20)/o}else if(e.m11>e.m22){var i=2*Math.sqrt(1+e.m11-e.m00-e.m22);t._v[3]=(e.m02-e.m20)/i,t._v[0]=(e.m01+e.m10)/i,t._v[1]=.25*i,t._v[2]=(e.m12+e.m21)/i}else{var a=2*Math.sqrt(1+e.m22-e.m00-e.m11);t._v[3]=(e.m10-e.m01)/a,t._v[0]=(e.m02+e.m20)/a,t._v[1]=(e.m12+e.m21)/a,t._v[2]=.25*a}return t},_.lookFromTo=function(e,t){return e.isEqual(t)?_.fromCopy4(0,0,0,1):this.qlerp(this.lookForward(e),this.lookForward(t),1)},_.lookForward=function(e){return null==_.__tmp_upVec&&(_.__tmp_upVec=new e.constructor(0,1,0)),this.lookForwardAccordingToThisUp(e,_.__tmp_upVec)},_.lookForwardAccordingToThisUp=function(e,t){var n=e.length();0===n&&console.error("0 division occurred!");var r=e._v[0]/n,o=e._v[1]/n,i=e._v[2]/n,a=t.length();0===a&&console.error("0 division occurred!");var s=t._v[0]/a,c=t._v[1]/a,l=t._v[2]/a,u=t._v[1]*e._v[2]-t._v[2]*e._v[1],f=t._v[2]*e._v[0]-t._v[0]*e._v[2],h=t._v[0]*e._v[1]-t._v[1]*e._v[0],d=Math.hypot(u,f,h);0===d&&console.error("0 division occurred!");var m=u/=d,v=f/=d,p=h/=d,y=s,A=c,b=l,g=r,x=o,I=i,E=m+A+I;if(E>0){var w=Math.sqrt(E+1),S=.5/w;return _.fromCopy4((b-x)*S,(g-p)*S,(v-y)*S,.5*w)}if(m>=A&&m>=I){var T=Math.sqrt(1+m-A-I),C=.5/T;return _.fromCopy4(.5*T,(v+y)*C,(p+g)*C,(b-x)*C)}if(A>I){var P=Math.sqrt(1+A-m-I),R=.5/P;return _.fromCopy4((y+v)*R,.5*P,(x+b)*R,(g-p)*R)}var D=Math.sqrt(1+I-m-A),M=.5/D;return _.fromCopy4((g+p)*M,(x+b)*M,.5*D,(v-y)*M)},_.fromPosition=function(e){return _.fromCopy4(e._v[0],e._v[1],e._v[2],0)},_.add=function(e,t){var n=e._v[0]+t._v[0],r=e._v[1]+t._v[1],o=e._v[2]+t._v[2],i=e._v[3]+t._v[3];return _.fromCopy4(n,r,o,i)},_.addTo=function(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n._v[2]=e._v[2]+t._v[2],n._v[3]=e._v[3]+t._v[3],n},_.subtract=function(e,t){var n=e._v[0]-t._v[0],r=e._v[1]-t._v[1],o=e._v[2]-t._v[2],i=e._v[3]-t._v[3];return _.fromCopy4(n,r,o,i)},_.subtractTo=function(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n._v[2]=e._v[2]-t._v[2],n._v[3]=e._v[3]-t._v[3],n},_.multiply=function(e,t){var n=t._v[3]*e._v[0]+t._v[2]*e._v[1]-t._v[1]*e._v[2]+t._v[0]*e._v[3],r=-t._v[2]*e._v[0]+t._v[3]*e._v[1]+t._v[0]*e._v[2]+t._v[1]*e._v[3],o=t._v[1]*e._v[0]-t._v[0]*e._v[1]+t._v[3]*e._v[2]+t._v[2]*e._v[3],i=-t._v[0]*e._v[0]-t._v[1]*e._v[1]-t._v[2]*e._v[2]+t._v[3]*e._v[3];return _.fromCopy4(n,r,o,i)},_.multiplyTo=function(e,t,n){var r=t._v[3]*e._v[0]+t._v[2]*e._v[1]-t._v[1]*e._v[2]+t._v[0]*e._v[3],o=-t._v[2]*e._v[0]+t._v[3]*e._v[1]+t._v[0]*e._v[2]+t._v[1]*e._v[3],i=t._v[1]*e._v[0]-t._v[0]*e._v[1]+t._v[3]*e._v[2]+t._v[2]*e._v[3],a=-t._v[0]*e._v[0]-t._v[1]*e._v[1]-t._v[2]*e._v[2]+t._v[3]*e._v[3];return n.setComponents(r,o,i,a)},_.multiplyNumber=function(e,t){var n=e._v[0]*t,r=e._v[1]*t,o=e._v[2]*t,i=e._v[3]*t;return _.fromCopy4(n,r,o,i)},_.multiplyNumberTo=function(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n._v[2]=e._v[2]*t,n._v[3]=e._v[3]*t,n},_.divideNumber=function(e,t){0===t&&console.error("0 division occurred!");var n=e._v[0]/t,r=e._v[1]/t,o=e._v[2]/t,i=e._v[3]/t;return _.fromCopy4(n,r,o,i)},_.divideNumberTo=function(e,t,n){return 0===t&&console.error("0 division occurred!"),n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t,n._v[2]=e._v[2]/t,n._v[3]=e._v[3]/t,n},_._divide=function(e,t){var n,r,o,i;return 0!==t?(n=e._v[0]/t,r=e._v[1]/t,o=e._v[2]/t,i=e._v[3]/t):(console.error("0 division occurred!"),n=1/0,r=1/0,o=1/0,i=1/0),_.fromCopy4(n,r,o,i)},_.normalize=function(e){var t=e.length();return this._divide(e,t)},_.fromToRotation=function(e,t){var n=s.d6.fromCopyVector3(e),r=s.d6.fromCopyVector3(t);n.normalize(),r.normalize();var o=n.dot(r);if(o>-1+Number.EPSILON){var i=Math.sqrt(2*(1+o)),c=1/i,l=a.P.multiply(n.cross(r),c);return _.fromCopy4(l.x,l.y,l.z,.5*i)}var u=a.P.fromCopy3(0,1,0),f=n.cross(u);return f.length(){n.d(t,{Ru:()=>p,ap:()=>v,kO:()=>y});var r=n(4969),o=n(2199),i=n(3932);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;return Math.abs(e.x-this.x){n.d(t,{EY:()=>y,FM:()=>p,HO:()=>A,ig:()=>b,pV:()=>v});var r=n(4969),o=n(3932),i=n(2199);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;return Math.abs(e._v[0]-this._v[0]){n.d(t,{P:()=>v,R1:()=>A,UJ:()=>p,p8:()=>y,pg:()=>m});var r=n(4969),o=n(3932),i=n(2199);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;return Math.abs(e._v[0]-this._v[0]){n.d(t,{GY:()=>b,Lt:()=>v,Tj:()=>p,cV:()=>A,n9:()=>y,rE:()=>m});var r=n(4969),o=n(3932),i=n(2199);function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;return Math.abs(e._v[0]-this._v[0]){n.d(t,{j:()=>r});var r=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._v=t}},1855:(e,t,n)=>{n.d(t,{mN:()=>o.m,bC:()=>i,XA:()=>a.X,lJ:()=>s.l,Ox:()=>c.O,sZ:()=>l.s,tW:()=>p,SG:()=>A,zU:()=>y,ig:()=>te.ig,HO:()=>te.HO,R1:()=>ne.R1,p8:()=>ne.p8,GY:()=>u.GY,cV:()=>u.cV,n9:()=>u.n9,cm:()=>b.c,aq:()=>g.a,lW:()=>E,Db:()=>w.D,kj:()=>S.k,ak:()=>T.a,h:()=>C.h,Je:()=>P.J,CE:()=>F,l$:()=>W,f7:()=>X.f,xk:()=>H.x,ec:()=>q.e,yG:()=>Y.y,DU:()=>K.DU,Et:()=>K.Et,$_:()=>K.$_,NR:()=>J.NR,el:()=>J.el,th:()=>J.th,d6:()=>R.d6,I1:()=>R.I1,oV:()=>R.oV,xQ:()=>G.xQ,e2:()=>G.e2,hn:()=>G.hn,_f:()=>x._,Ru:()=>Z.Ru,ap:()=>Z.ap,kO:()=>Z.kO,WQ:()=>ee,FM:()=>te.FM,pV:()=>te.pV,EY:()=>te.EY,P:()=>ne.P,pg:()=>ne.pg,UJ:()=>ne.UJ,Lt:()=>u.Lt,rE:()=>u.rE,Tj:()=>u.Tj,j8:()=>re.j,Zz:()=>r.Zz,TL:()=>r.TL,RZ:()=>r.sZ,jI:()=>r.jI,F5:()=>r.F5,vP:()=>r.vP,to:()=>r.to,wr:()=>r.wr,nn:()=>r.nn,w0:()=>r.w0,GW:()=>r.GW,t5:()=>r.t5,vk:()=>r.vk,PF:()=>r.PF,Ff:()=>r.Ff,Up:()=>r.Up,Dq:()=>r.Dq,VI:()=>r.VI,hx:()=>r.hx,JI:()=>r.JI,fK:()=>r.fK,lx:()=>r.lx,ns:()=>r.ns,eI:()=>r.p8,n5:()=>r.n5,QU:()=>r.QU,Xg:()=>r.Xg,Rl:()=>r.Rl,_7:()=>r._7});var r=n(7058),o=n(6631),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._v=new Float32Array}return e.prototype.isTheSourceSame=function(e){return this._v.buffer===e},e}(),a=n(2507),s=n(7586),c=n(2199),l=n(8107),u=n(6264);function f(e,t){for(var n=0;n{n.d(t,{Dq:()=>f,F5:()=>g,Ff:()=>l,GW:()=>i,JI:()=>d,PF:()=>c,QU:()=>w,Rl:()=>T,TL:()=>y,Up:()=>u,VI:()=>_,Xg:()=>D,Zz:()=>p,_7:()=>C,fK:()=>m,hx:()=>h,jI:()=>b,lx:()=>v,n5:()=>E,nn:()=>r,ns:()=>x,p8:()=>I,sZ:()=>A,t5:()=>a,to:()=>P,vP:()=>S,vk:()=>s,w0:()=>o,wr:()=>R});for(var r=Symbol("get1"),o=Symbol("get1_offset"),i=Symbol("get1_offsetAsComposition"),a=Symbol("get2"),s=Symbol("get2_offset"),c=Symbol("get2_offsetAsComposition"),l=Symbol("get3"),u=Symbol("get3_offset"),f=Symbol("get3_offsetAsComposition"),_=Symbol("get4"),h=Symbol("get4_offset"),d=Symbol("get4_offsetAsComposition"),m=Symbol("getN_offset"),v=Symbol("getN_offsetAsComposition"),p=Symbol("add2"),y=Symbol("add2_offset"),A=Symbol("add3"),b=Symbol("add3_offset"),g=Symbol("add4"),x=Symbol("mulArray3WithScalar_offset"),I=Symbol("mulArray4WithScalar_offset"),E=Symbol("mulArrayNWithScalar_offset"),w=Symbol("mulThatAndThisToOutAsMat44_offsetAsComposition"),S=Symbol("add4_offset"),T=Symbol("qlerp_offsetAsComposition"),C=Symbol("scalar_lerp_offsetAsComposition"),P=Symbol("array3_lerp_offsetAsComposition"),R=Symbol("arrayN_lerp_offsetAsComposition"),D=Symbol("normalizeArray4"),M=[Array,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array],B=[i,c,r,o,a,s,l,u,f,_,h,d,m,v,p,y,A,b,g,S,x,I,E,w,T,C,P,R,D],N=[function(e){return[this[e]]},function(e){return[this[2*e],this[2*e+1]]},function(){return[this[0]]},function(e){return[this[e]]},function(){return[this[0],this[1]]},function(e){return[this[e],this[e+1]]},function(){return[this[0],this[1],this[2]]},function(e){return[this[e],this[e+1],this[e+2]]},function(e){return[this[3*e],this[3*e+1],this[3*e+2]]},function(){return[this[0],this[1],this[2],this[3]]},function(e){return[this[e],this[e+1],this[e+2],this[e+3]]},function(e){return[this[4*e],this[4*e+1],this[4*e+2],this[4*e+3]]},function(e,t){for(var n=new Array(t),r=0;r1?i=.999:i<-1&&(i=-.999);var a,s=Math.acos(i),c=Math.sin(s);i<0?(i*=-1,s=Math.acos(i),a=-1*Math.sin(s*t)/c):a=Math.sin(s*t)/c;var l=Math.sin(s*(1-t))/c;o[0]=this[0+4*n]*l+e[0+4*r]*a,o[1]=this[1+4*n]*l+e[1+4*r]*a,o[2]=this[2+4*n]*l+e[2+4*r]*a,o[3]=this[3+4*n]*l+e[3+4*r]*a}return o},function(e,t,n,r){return this[n]*(1-t)+e[r]*t},function(e,t,n,r){for(var o=new Array(3),i=0;i<3;i++)o[i]=this[3*n+i]*(1-t)+e[3*r+i]*t;return o},function(e,t,n,r,o){for(var i=new Array(t),a=0;a{n.d(t,{U:()=>m});var r=n(2535),o=n(3932),i=n(8020),a=n(6860),s=n(6264),c=n(9513),l=n(988),u=n(2328),f=n(6386),_=n(8289),h=n(7690);function d(e,t){for(var n=0;n=this.__count&&console.error("You are trying to allocate more than you have secured.");var t=new this.__typedArrayClass(e,this.__byteOffsetInRawArrayBufferOfBuffer+this.__byteStride*this.__takenCount,this.__compositionType.getNumberOfComponents()*this.__arrayLength);return this.__takenCount+=1,t._accessor=this,t._idx_of_accessor=this.__takenCount,t},c.getTypedArray=function(){return this.__typedArray},c.getUint8Array=function(){return new Uint8Array(this.bufferView.buffer.getArrayBuffer(),this.byteOffsetInRawArrayBufferOfBuffer,this.byteLength)},c.getScalar=function(e,t){var n=t.indicesAccessor,r=t.endian,o=void 0===r||r,i=e;return n&&(i=n.getScalar(e,{})),this.__dataViewGetter(this.__byteStride*i,o)},c.getScalarAt=function(e,t,n){var r=n.indicesAccessor,o=n.endian,i=void 0===o||o,a=e;return r&&(a=r.getScalar(e,{})),this.__dataViewGetter(this.__byteStride*a+t,i)},c.getVec2AsArray=function(e,t){var n=t.indicesAccessor,r=t.endian,o=void 0===r||r,i=e;n&&(i=n.getScalar(e,{}));var a=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,o),this.__dataViewGetter(this.__byteStride*i+1*a,o)]},c.getVec3AsArray=function(e,t){var n=t.indicesAccessor,r=t.endian,o=void 0===r||r,i=e;n&&(i=n.getScalar(e,{}));var a=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,o),this.__dataViewGetter(this.__byteStride*i+1*a,o),this.__dataViewGetter(this.__byteStride*i+2*a,o)]},c.getVec4AsArray=function(e,t){var n=t.indicesAccessor,r=t.endian,o=void 0===r||r,i=e;n&&(i=n.getScalar(e,{}));var a=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,o),this.__dataViewGetter(this.__byteStride*i+1*a,o),this.__dataViewGetter(this.__byteStride*i+2*a,o),this.__dataViewGetter(this.__byteStride*i+3*a,o)]},c.getMat3AsArray=function(e,t){var n=t.indicesAccessor,r=t.endian,o=void 0===r||r,i=e;n&&(i=n.getScalar(e,{}));var a=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,o),this.__dataViewGetter(this.__byteStride*i+1*a,o),this.__dataViewGetter(this.__byteStride*i+2*a,o),this.__dataViewGetter(this.__byteStride*i+3*a,o),this.__dataViewGetter(this.__byteStride*i+4*a,o),this.__dataViewGetter(this.__byteStride*i+5*a,o),this.__dataViewGetter(this.__byteStride*i+6*a,o),this.__dataViewGetter(this.__byteStride*i+7*a,o),this.__dataViewGetter(this.__byteStride*i+8*a,o)]},c.getMat4AsArray=function(e,t){var n=t.indicesAccessor,r=t.endian,o=void 0===r||r,i=e;n&&(i=n.getScalar(e,{}));var a=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,o),this.__dataViewGetter(this.__byteStride*i+1*a,o),this.__dataViewGetter(this.__byteStride*i+2*a,o),this.__dataViewGetter(this.__byteStride*i+3*a,o),this.__dataViewGetter(this.__byteStride*i+4*a,o),this.__dataViewGetter(this.__byteStride*i+5*a,o),this.__dataViewGetter(this.__byteStride*i+6*a,o),this.__dataViewGetter(this.__byteStride*i+7*a,o),this.__dataViewGetter(this.__byteStride*i+8*a,o),this.__dataViewGetter(this.__byteStride*i+9*a,o),this.__dataViewGetter(this.__byteStride*i+10*a,o),this.__dataViewGetter(this.__byteStride*i+11*a,o),this.__dataViewGetter(this.__byteStride*i+12*a,o),this.__dataViewGetter(this.__byteStride*i+13*a,o),this.__dataViewGetter(this.__byteStride*i+14*a,o),this.__dataViewGetter(this.__byteStride*i+15*a,o)]},c.getVec2=function(e,t){var n=t.indicesAccessor,r=t.endian,o=void 0===r||r,a=e;n&&(a=n.getScalar(e,{}));var s=this.componentSizeInBytes;return i.FM.fromCopyArray2([this.__dataViewGetter(this.__byteStride*a,o),this.__dataViewGetter(this.__byteStride*a+1*s,o)])},c.getVec3=function(e,t){var n=t.indicesAccessor,r=t.endian,o=void 0===r||r,i=e;n&&(i=n.getScalar(e,{}));var s=this.componentSizeInBytes;return a.P.fromCopyArray([this.__dataViewGetter(this.__byteStride*i,o),this.__dataViewGetter(this.__byteStride*i+1*s,o),this.__dataViewGetter(this.__byteStride*i+2*s,o)])},c.getVec4=function(e,t){var n=t.indicesAccessor,r=t.endian,o=void 0===r||r,i=e;n&&(i=n.getScalar(e,{}));var a=this.componentSizeInBytes;return s.Lt.fromCopyArray([this.__dataViewGetter(this.__byteStride*i,o),this.__dataViewGetter(this.__byteStride*i+1*a,o),this.__dataViewGetter(this.__byteStride*i+2*a,o),this.__dataViewGetter(this.__byteStride*i+3*a,o)])},c.getMat3=function(e,t){var n=t.indicesAccessor,r=t.endian,o=void 0===r||r,i=e;n&&(i=n.getScalar(e,{}));var a=this.componentSizeInBytes;return f.h.fromCopy9RowMajor(this.__dataViewGetter(this.__byteStride*i,o),this.__dataViewGetter(this.__byteStride*i+1*a,o),this.__dataViewGetter(this.__byteStride*i+2*a,o),this.__dataViewGetter(this.__byteStride*i+3*a,o),this.__dataViewGetter(this.__byteStride*i+4*a,o),this.__dataViewGetter(this.__byteStride*i+5*a,o),this.__dataViewGetter(this.__byteStride*i+6*a,o),this.__dataViewGetter(this.__byteStride*i+7*a,o),this.__dataViewGetter(this.__byteStride*i+8*a,o))},c.getMat4=function(e,t){var n=t.indicesAccessor,r=t.endian,o=void 0===r||r,i=e;n&&(i=n.getScalar(e,{}));var a=this.componentSizeInBytes;return _.e.fromCopy16RowMajor(this.__dataViewGetter(this.__byteStride*i,o),this.__dataViewGetter(this.__byteStride*i+1*a,o),this.__dataViewGetter(this.__byteStride*i+2*a,o),this.__dataViewGetter(this.__byteStride*i+3*a,o),this.__dataViewGetter(this.__byteStride*i+4*a,o),this.__dataViewGetter(this.__byteStride*i+5*a,o),this.__dataViewGetter(this.__byteStride*i+6*a,o),this.__dataViewGetter(this.__byteStride*i+7*a,o),this.__dataViewGetter(this.__byteStride*i+8*a,o),this.__dataViewGetter(this.__byteStride*i+9*a,o),this.__dataViewGetter(this.__byteStride*i+10*a,o),this.__dataViewGetter(this.__byteStride*i+11*a,o),this.__dataViewGetter(this.__byteStride*i+12*a,o),this.__dataViewGetter(this.__byteStride*i+13*a,o),this.__dataViewGetter(this.__byteStride*i+14*a,o),this.__dataViewGetter(this.__byteStride*i+15*a,o))},c.getVec2To=function(e,t,n){var r=n.indicesAccessor,o=n.endian,i=void 0===o||o,a=e;r&&(a=r.getScalar(e,{}));var s=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*a,i),this.__dataViewGetter(this.__byteStride*a+1*s,i))},c.getVec3To=function(e,t,n){var r=n.indicesAccessor,o=n.endian,i=void 0===o||o,a=e;r&&(a=r.getScalar(e,{}));var s=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*a,i),this.__dataViewGetter(this.__byteStride*a+1*s,i),this.__dataViewGetter(this.__byteStride*a+2*s,i))},c.getVec4To=function(e,t,n){var r=n.indicesAccessor,o=n.endian,i=void 0===o||o,a=e;r&&(a=r.getScalar(e,{}));var s=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*a,i),this.__dataViewGetter(this.__byteStride*a+1*s,i),this.__dataViewGetter(this.__byteStride*a+2*s,i),this.__dataViewGetter(this.__byteStride*a+3*s,i))},c.getMat3To=function(e,t,n){var r=n.indicesAccessor,o=n.endian,i=void 0===o||o,a=e;r&&(a=r.getScalar(e,{}));var s=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*a,i),this.__dataViewGetter(this.__byteStride*a+1*s,i),this.__dataViewGetter(this.__byteStride*a+2*s,i),this.__dataViewGetter(this.__byteStride*a+3*s,i),this.__dataViewGetter(this.__byteStride*a+4*s,i),this.__dataViewGetter(this.__byteStride*a+5*s,i),this.__dataViewGetter(this.__byteStride*a+6*s,i),this.__dataViewGetter(this.__byteStride*a+7*s,i),this.__dataViewGetter(this.__byteStride*a+8*s,i))},c.getMat4To=function(e,t,n){var r=n.indicesAccessor,o=n.endian,i=void 0===o||o,a=e;r&&(a=r.getScalar(e,{}));var s=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*a,i),this.__dataViewGetter(this.__byteStride*a+1*s,i),this.__dataViewGetter(this.__byteStride*a+2*s,i),this.__dataViewGetter(this.__byteStride*a+3*s,i),this.__dataViewGetter(this.__byteStride*a+4*s,i),this.__dataViewGetter(this.__byteStride*a+5*s,i),this.__dataViewGetter(this.__byteStride*a+6*s,i),this.__dataViewGetter(this.__byteStride*a+7*s,i),this.__dataViewGetter(this.__byteStride*a+8*s,i),this.__dataViewGetter(this.__byteStride*a+9*s,i),this.__dataViewGetter(this.__byteStride*a+10*s,i),this.__dataViewGetter(this.__byteStride*a+11*s,i),this.__dataViewGetter(this.__byteStride*a+12*s,i),this.__dataViewGetter(this.__byteStride*a+13*s,i),this.__dataViewGetter(this.__byteStride*a+14*s,i),this.__dataViewGetter(this.__byteStride*a+15*s,i))},c.setScalar=function(e,t,n){var r=n.indicesAccessor,o=n.endian,i=void 0===o||o,a=e;r&&(a=r.getScalar(e,{})),this.__dataViewSetter(this.__byteStride*a,t,i),this.__isMinMixDirty=!0,this.__version++},c.setVec2=function(e,t,n,r){var o=r.indicesAccessor,i=r.endian,a=void 0===i||i,s=e;o&&(s=o.getScalar(e,{}));var c=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*s,t,a),this.__dataViewSetter(this.__byteStride*s+1*c,n,a),this.__isMinMixDirty=!0,this.__version++},c.setVec3=function(e,t,n,r,o){var i=o.indicesAccessor,a=o.endian,s=void 0===a||a,c=e;i&&(c=i.getScalar(e,{}));var l=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*c,t,s),this.__dataViewSetter(this.__byteStride*c+1*l,n,s),this.__dataViewSetter(this.__byteStride*c+2*l,r,s),this.__isMinMixDirty=!0,this.__version++},c.setVec4=function(e,t,n,r,o,i){var a=i.indicesAccessor,s=i.endian,c=void 0===s||s,l=e;a&&(l=a.getScalar(e,{}));var u=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*l,t,c),this.__dataViewSetter(this.__byteStride*l+1*u,n,c),this.__dataViewSetter(this.__byteStride*l+2*u,r,c),this.__dataViewSetter(this.__byteStride*l+3*u,o,c),this.__isMinMixDirty=!0,this.__version++},c.setMat4=function(e,t,n,r,o,i,a,s,c,l,u,f,_,h,d,m,v,p){var y=p.indicesAccessor,A=p.endian,b=void 0===A||A,g=e;y&&(g=y.getScalar(e,{}));var x=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*g,t,b),this.__dataViewSetter(this.__byteStride*g+1*x,n,b),this.__dataViewSetter(this.__byteStride*g+2*x,r,b),this.__dataViewSetter(this.__byteStride*g+3*x,o,b),this.__dataViewSetter(this.__byteStride*g+4*x,i,b),this.__dataViewSetter(this.__byteStride*g+5*x,a,b),this.__dataViewSetter(this.__byteStride*g+6*x,s,b),this.__dataViewSetter(this.__byteStride*g+7*x,c,b),this.__dataViewSetter(this.__byteStride*g+8*x,l,b),this.__dataViewSetter(this.__byteStride*g+9*x,u,b),this.__dataViewSetter(this.__byteStride*g+10*x,f,b),this.__dataViewSetter(this.__byteStride*g+11*x,_,b),this.__dataViewSetter(this.__byteStride*g+12*x,h,b),this.__dataViewSetter(this.__byteStride*g+13*x,d,b),this.__dataViewSetter(this.__byteStride*g+14*x,m,b),this.__dataViewSetter(this.__byteStride*g+15*x,v,b),this.__isMinMixDirty=!0,this.__version++},c.setVec2AsVector=function(e,t,n){var r=n.indicesAccessor,o=n.endian,i=void 0===o||o,a=e;r&&(a=r.getScalar(e,{}));var s=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*a,t.x,i),this.__dataViewSetter(this.__byteStride*a+1*s,t.y,i),this.__isMinMixDirty=!0,this.__version++},c.setVec3AsVector=function(e,t,n){var r=n.indicesAccessor,o=n.endian,i=void 0===o||o,a=e;r&&(a=r.getScalar(e,{}));var s=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*a,t.x,i),this.__dataViewSetter(this.__byteStride*a+1*s,t.y,i),this.__dataViewSetter(this.__byteStride*a+2*s,t.z,i),this.__isMinMixDirty=!0,this.__version++},c.setVec4AsVector=function(e,t,n){var r=n.indicesAccessor,o=n.endian,i=void 0===o||o,a=e;r&&(a=r.getScalar(e,{}));var s=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*a,t.x,i),this.__dataViewSetter(this.__byteStride*a+1*s,t.y,i),this.__dataViewSetter(this.__byteStride*a+2*s,t.z,i),this.__dataViewSetter(this.__byteStride*a+3*s,t.w,i),this.__isMinMixDirty=!0,this.__version++},c.setMat4AsMatrix44=function(e,t,n){var r=n.indicesAccessor,o=n.endian,i=void 0===o||o,a=e;r&&(a=r.getScalar(e,{}));var s=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*a,t._v[0],i),this.__dataViewSetter(this.__byteStride*a+1*s,t._v[1],i),this.__dataViewSetter(this.__byteStride*a+2*s,t._v[2],i),this.__dataViewSetter(this.__byteStride*a+3*s,t._v[3],i),this.__dataViewSetter(this.__byteStride*a+4*s,t._v[4],i),this.__dataViewSetter(this.__byteStride*a+5*s,t._v[5],i),this.__dataViewSetter(this.__byteStride*a+6*s,t._v[6],i),this.__dataViewSetter(this.__byteStride*a+7*s,t._v[7],i),this.__dataViewSetter(this.__byteStride*a+8*s,t._v[8],i),this.__dataViewSetter(this.__byteStride*a+9*s,t._v[9],i),this.__dataViewSetter(this.__byteStride*a+10*s,t._v[10],i),this.__dataViewSetter(this.__byteStride*a+11*s,t._v[11],i),this.__dataViewSetter(this.__byteStride*a+12*s,t._v[12],i),this.__dataViewSetter(this.__byteStride*a+13*s,t._v[13],i),this.__dataViewSetter(this.__byteStride*a+14*s,t._v[14],i),this.__dataViewSetter(this.__byteStride*a+15*s,t._v[15],i),this.__isMinMixDirty=!0,this.__version++},c.copyFromTypedArray=function(e){for(var t=this.numberOfComponents,n=0;n{n.d(t,{l:()=>l});var r=n(4341),o=n(3932),i=n(2535),a=n(5479),s=n(7690);function c(e,t){for(var n=0;n0&&console.info("Padding bytes added to takenBytesIndex."),n},l.takeBufferView=function(e){var t=e.byteLengthToNeed,n=e.byteStride,o=t;if(o+this.__takenBytesIndex>this.byteLength){var i="The size of the BufferView you are trying to take exceeds the byte length left in the Buffer.\nBuffer.byteLength: ".concat(this.byteLength,", Buffer.takenSizeInByte: ").concat(this.takenSizeInByte,",\nbyteSizeToTake: ").concat(o,", the byte length left in the Buffer: ").concat(this.__byteLength-this.__takenBytesIndex);return new s.UG({message:i,error:void 0})}var c=new r.q({buffer:this,byteOffsetInBuffer:this.__takenBytesIndex,defaultByteStride:n,byteLength:o,raw:this.__raw});return this.__takenBytesIndex+=o,this.__takenBytesIndex=a.j.addPaddingBytes(this.__takenBytesIndex,this.__byteAlign),this.__bufferViews.push(c),new s.Ok(c)},l.takeBufferViewWithByteOffset=function(e){var t=e.byteLengthToNeed,n=e.byteStride,o=e.byteOffset;if(t+o>this.byteLength){var i="The size of the BufferView you are trying to take exceeds the byte length left in the Buffer.\nBuffer.byteLength: ".concat(this.byteLength,", Buffer.takenSizeInByte: ").concat(this.takenSizeInByte,",\nbyteSizeToTake: ").concat(t,", the byte length left in the Buffer: ").concat(this.__byteLength-this.__takenBytesIndex);return new s.UG({message:i,error:void 0})}var a=new r.q({buffer:this,byteOffsetInBuffer:o,defaultByteStride:n,byteLength:t,raw:this.__raw}),c=Uint8Array.BYTES_PER_ELEMENT*t+o;return this.__takenBytesIndex3&&void 0!==arguments[3]?arguments[3]:100,a=i.r.toTypedArray(n);return void 0===a&&console.warn("componentType is Invalid"),o.d.isArray(t)?new a(this.__raw,this.__byteOffset+4*e,r):new a(this.__raw,this.__byteOffset+4*e,1)},l.isSame=function(e){return this.__raw===e.__raw},t=e,(n=[{key:"name",get:function(){return this.__name},set:function(e){this.__name=e}},{key:"byteLength",get:function(){return this.__byteLength}},{key:"takenSizeInByte",get:function(){return this.__takenBytesIndex}},{key:"byteOffsetInRawArrayBuffer",get:function(){return this.__byteOffset}}])&&c(t.prototype,n),e}()},4341:(e,t,n)=>{n.d(t,{q:()=>a});var r=n(8355),o=n(7690);function i(e,t){for(var n=0;nthis.byteLength){var h="The size of the Accessor you are trying to take exceeds the byte length left in the BufferView.\nBufferView.byteLength: ".concat(this.byteLength,", BufferView.takenSizeInByte: ").concat(this.__takenByte,", Accessor.byteStride: ").concat(a,", Accessor.count: ").concat(i,";\nbyteSizeToTake: ").concat(_*i,", the byte length left in the Buffer: ").concat(this.byteLength-this.__takenByte);return new o.UG({message:h,error:void 0})}var d=new r.U({bufferView:this,byteOffsetInBufferView:f,compositionType:t,componentType:n,byteStride:a,count:i,raw:this.__raw,max:s,min:c,arrayLength:l,normalized:u});return this.__accessors.push(d),this.__takenByte+=_*i,new o.Ok(d)},a.__takeAccessorInnerWithByteOffset=function(e){var t=e.compositionType,n=e.componentType,i=e.count,a=e.byteStride,s=e.byteOffsetInBufferView,c=e.max,l=e.min,u=e.normalized;if(this.__takenByte+a*(i-1)+n.getSizeInBytes()*t.getNumberOfComponents()>this.byteLength){var f="The size of the Accessor you are trying to take exceeds the byte length left in the BufferView.\nBufferView.byteLength: ".concat(this.byteLength,", BufferView.takenSizeInByte: ").concat(this.__takenByte,", Accessor.byteStride: ").concat(a,", Accessor.count: ").concat(i,";\nbyteSizeToTake: ").concat(a*i,", the byte length left in the Buffer: ").concat(this.byteLength-this.__takenByte);return new o.UG({message:f,error:void 0})}var _=new r.U({bufferView:this,byteOffsetInBufferView:s,compositionType:t,componentType:n,byteStride:a,count:i,raw:this.__raw,max:c,min:l,arrayLength:1,normalized:u});return this.__accessors.push(_),new o.Ok(_)},a.isSame=function(e){return this.byteLength===e.byteLength&&this.byteOffsetInRawArrayBufferOfBuffer===e.byteOffsetInRawArrayBufferOfBuffer&&this.defaultByteStride===e.defaultByteStride&&this.buffer.getArrayBuffer()===e.buffer.getArrayBuffer()},t=e,(n=[{key:"defaultByteStride",get:function(){return this.__defaultByteStride}},{key:"byteLength",get:function(){return this.__byteLength}},{key:"byteOffsetInBuffer",get:function(){return this.__byteOffsetInRawArrayBufferOfBuffer-this.__buffer.byteOffsetInRawArrayBuffer}},{key:"byteOffsetInRawArrayBufferOfBuffer",get:function(){return this.__byteOffsetInRawArrayBufferOfBuffer}},{key:"buffer",get:function(){return this.__buffer}},{key:"isSoA",get:function(){return!this.isAoS}},{key:"isAoS",get:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.__accessors[Symbol.iterator]();!(e=(r=o.next()).done);e=!0)if(r.value.isAoS)return!0}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return!1}}])&&i(t.prototype,n),e}()},5479:(e,t,n)=>{n.d(t,{j:()=>s});var r=n(3116),o=n(3363);function i(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function a(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.isNode=function(){return void 0===window&&"undefined"!=typeof process&&!0},e.btoa=function(t){return e.isNode()?(Buffer.isBuffer(t)?t:Buffer.from(t.toString(),"binary")).toString("base64"):btoa(t)},e.atob=function(t){return e.isNode()?Buffer.from(t,"base64").toString("binary"):atob(t)},e.dataUriToArrayBuffer=function(t){for(var n=t.split(","),r=e.atob(n[1]),o=r.length,i=new ArrayBuffer(o),a=new Uint8Array(i),s=0;s>>8^"0x"+r[255&(n^t.charCodeAt(o))];return(-1^n)>>>0},e.accessBinaryAsImage=function(e,t,n,r){var o=this.takeBufferViewAsUint8Array(t,e,n);return this.accessArrayBufferAsImage(o,r)},e.createBlobImageUriFromUint8Array=function(e,t){var n=new Blob([e],{type:t});return URL.createObjectURL(n)},e.takeBufferViewAsUint8Array=function(e,t,n){var r,o=e.bufferViews[t],i=null!==(r=o.byteOffset)&&void 0!==r?r:0,s=o.byteLength,c=n;return a(n,Uint8Array)&&(c=n.buffer,i+=n.byteOffset),new Uint8Array(c,i,s)},e.accessArrayBufferAsImage=function(t,n){var r=this.uint8ArrayToStringInner(new Uint8Array(t));return this.getImageType(n)+e.btoa(r)},e.uint8ArrayToStringInner=function(e){for(var t=new Array(e.byteLength),n=0;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]o?s=(a=Math.min(r,t))*i:a=(s=Math.min(o,t))/i,n.width=a,n.height=s,n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,a,s),[n,a,s]},e.detectTransparentPixelExistence=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=e.width,i=e.height;if(a(e,ImageData))n=e;else if(a(e,HTMLImageElement)){var s=document.createElement("canvas");(t=s.getContext("2d")).drawImage(e,0,0),n=t.getImageData(0,0,o,i)}else(t=e.getContext("2d")).drawImage(e,0,0),n=t.getImageData(0,0,o,i);for(var c=0;c{n.d(t,{Jx:()=>r,bm:()=>a,cu:()=>i,li:()=>o});var r=function(){function e(t){var n=t.index,r=t.str,o=t.noCheckStrUnique;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),null==e.__indices.get(this.constructor)&&e.__indices.set(this.constructor,[]),null==e.__strings.get(this.constructor)&&e.__strings.set(this.constructor,[]),-1!==e.__indices.get(this.constructor).indexOf(n))throw new Error("Dont use duplicate index.");if(!0!==o&&-1!==e.__strings.get(this.constructor).indexOf(r))throw new Error("Dont use duplicate str.");this.index=n,this.str=r,this.symbol=Symbol(r),e.__indices.get(this.constructor).push(n),e.__strings.get(this.constructor).push(r)}var t=e.prototype;return t.toString=function(){return this.str},t.toJSON=function(){return this.index},e}();function o(e){var t=e.typeList,n=e.index,r=t.find((function(e){return e.index===n}));if(r)return r}function i(e){var t=e.typeList,n=e.str,r=t.find((function(e){return e.str.toLowerCase()===n.toLowerCase()}));if(r)return r}function a(e){var t=e.typeList,n=e.str,r=t.find((function(e){return e.str===n}));if(r)return r}r.__indices=new Map,r.__strings=new Map},9197:(e,t,n)=>{n.d(t,{Is:()=>c,V:()=>r});var r={defined:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r{n.d(t,{$z:()=>S,CW:()=>w,Jx:()=>u,Kf:()=>T,LS:()=>v,OB:()=>l,Qj:()=>g,YU:()=>A,Zs:()=>m,_z:()=>x,bh:()=>d,dK:()=>I,eD:()=>h,fK:()=>c,fY:()=>_,j3:()=>E,kS:()=>s,t0:()=>f,tS:()=>b,vV:()=>y,wv:()=>p});var r=n(9197);function o(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}var i=function(){for(var e=["iPod","iPad","iPhone","Android"],t=0;t0)return!0;return a()},a=function(){return navigator.userAgent.indexOf("Macintosh")>-1&&"ontouchend"in document},s=function(e){var t=e.value,n=e.defaultValue;return null==t?n:t},c=function(e,t){return!!r.Is.exist(t)&&(e(t),!0)},l=function(e,t){return r.Is.exist(t)?e(t):t},u=function(e,t){return!!r.Is.exist(t)&&(e(t),!0)},f=function(e,t){return r.Is.exist(t)?e(t):t},_=function(e,t){return!r.Is.undefined(t)||(e(),!1)},h=function(e,t){return r.Is.undefined(t)?e():t},d=function(e,t){r.Is.undefined(t)&&e()},m=function(e,t){return r.Is.undefined(t)?e():t},v=function(e,t){return null==t?e:t},p=function(e){var t=e.value,n=e.compensation;return null==t?n():t},y=function(e){return null==e?[]:e},A=function(e){return null==e?new Map:e},b=function(e,t){return e>t?{result:!0,greater:e,less:t}:{result:!1,greater:t,less:e}},g=function(e,t){return e=100&&(i=": "),n+=o+i+t[r]+"\n"}return n};function I(e){if(null==e)throw new Error("Expected 'val' to be existed, but received ".concat(e))}function E(e){return JSON.parse(JSON.stringify(e))}function w(e,t){var n=document.createElement("a");n.download=e;var r=new Blob([t],{type:"octet/stream"}),o=URL.createObjectURL(r);n.href=o;var i=new MouseEvent("click");n.dispatchEvent(i),URL.revokeObjectURL(o)}function S(e,t){var n=document.createElement("a");n.download=e;var r=new Blob([t],{type:"octet/stream"}),o=URL.createObjectURL(r);n.href=o;var i=new MouseEvent("click");n.dispatchEvent(i),URL.revokeObjectURL(o)}var T=Object.freeze({isMobileVr:function(){return/(Pacific Build.+OculusBrowser.+SamsungBrowser.+)|(SamsungBrowser)|(Mobile VR)/i.test(window.navigator.userAgent)},isMobile:i,isIOS:function(){for(var e=["iPod","iPad","iPhone"],t=0;t0)return!0;return a()},isSafari:function(){return navigator.userAgent.indexOf("Safari")>0&&-1===navigator.userAgent.indexOf("Chrome")},preventDefaultForDesktopOnly:function(e){i()||e.preventDefault()},isObject:function(e){return!(!o(e,Object)||o(e,Array))},fillTemplate:function(e,t){return new Function("return `"+e+"`;").call(t)},isNode:function(){return"undefined"!=typeof process&&!0},concatArrayBuffers:function(e,t,n,r){for(var o,i=0,a=0;ar?c+e-r:0},c=0,l=function(t,r){var i=s(t);return i?(o.set(new Uint8Array(e[r],n[r],i),c),c+=i,!0):(o.set(new Uint8Array(e[r],n[r],t),c),c+=t,!1)},u=function(e){var t=s(e);return t?(o.set(new Uint8Array(t),c),c+=t,!0):(o.set(new Uint8Array(e),c),c+=e,!1)},f=0;f0?_:0;if(l(t[f]-h,f))return o.buffer;if(h>0&&u(h))return o.buffer}return null!=r&&c{n.d(t,{Hq:()=>c,W:()=>u,Wx:()=>a,Zz:()=>l,bD:()=>s});var r=n(9197);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i="The value does not exist!",a=function(){function e(t){o(this,e),this.value=t}var t=e.prototype;return t.set=function(e){this.value=e},t.then=function(e){return r.Is.exist(this.value)?e(this.value):new c},t.unwrapOrDefault=function(e){return r.Is.exist(this.value)?this.value:e},t.unwrapOrElse=function(e){return r.Is.exist(this.value)?this.value:e()},t.unwrapForce=function(){if(r.Is.exist(this.value))return this.value;throw new ReferenceError(i)},t.unwrapOrUndefined=function(){return r.Is.exist(this.value)?this.value:void 0},t.has=function(){return r.Is.exist(this.value)},t.doesNotHave=function(){return!r.Is.exist(this.value)},e}(),s=function(){function e(t){o(this,e),this.value=t}var t=e.prototype;return t.then=function(e){return e(this.value)},t.unwrapOrDefault=function(e){return this.value},t.unwrapOrElse=function(e){return this.value},t.unwrapForce=function(){return this.value},t.unwrapOrUndefined=function(){return this.value},t.get=function(){return this.value},t.has=function(){return!0},t.doesNotHave=function(){return!1},e}(),c=function(){function e(){o(this,e)}var t=e.prototype;return t.then=function(){return this},t.unwrapOrDefault=function(e){return e},t.unwrapOrElse=function(e){return e(void 0)},t.unwrapForce=function(){throw new ReferenceError(i)},t.unwrapOrUndefined=function(){},t.has=function(){return!1},t.doesNotHave=function(){return!0},e}();function l(e){if(!e.has())throw new ReferenceError(i)}function u(e){if(e.has())throw new ReferenceError(i)}},3116:(e,t,n)=>{n.d(t,{Mr:()=>b,Ok:()=>v,UD:()=>y,UG:()=>p,Z6:()=>A});var r=n(9197);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function a(e,t,n){return a=i()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&f(o,n.prototype),o},a.apply(null,arguments)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function l(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function u(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}var _=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function h(e){var t="function"==typeof Map?new Map:void 0;return h=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return a(e,arguments,s(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),f(r,e)},h(e)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var o=s(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return u(this,n)}}var m=function(){function e(t){o(this,e),this.val=t}var t=e.prototype;return t.match=function(e){l(this,v)?e.Ok(this.val):l(this,p)&&e.Err(this.val),r.Is.exist(e.Finally)&&e.Finally()},t.name=function(){return this.constructor.name},e}(),v=function(e){c(n,e);var t=d(n);function n(e){return o(this,n),t.call(this,e)}var r=n.prototype;return r.unwrap=function(e){return this.val},r.unwrapForce=function(){return this.val},r.true=function(){return!0},r.isOk=function(){return!0},r.isErr=function(){return!1},r.get=function(){return this.val},n}(m),p=function(e){c(n,e);var t=d(n);function n(e){var r;return o(this,n),(r=t.call(this,e)).__rnException=new b(r.val),r}var r=n.prototype;return r.unwrap=function(e){e(this.val)},r.unwrapForce=function(){throw this.__rnException},r.false=function(){return!1},r.isOk=function(){return!1},r.isErr=function(){return!0},r.getRnError=function(){return this.val},r.toString=function(){return this.__rnException.stack},n}(m);function y(e){if(e.isErr())throw new Error("This is Err. No Ok.")}function A(e){if(e.isOk())throw new Error("This is Ok. No Err.")}var b=function(e){c(n,e);var t=d(n);function n(e){var r;return o(this,n),(r=t.call(this,"\n message: ".concat(e.message,"\n error: ").concat(l(e.error,p)?"see below Exception ↓"+e.error:e.error,"\n"))).err=e,r.name=n._prefix,r}return n.prototype.getRnError=function(){return this.err},n}(h(Error));b._prefix="\nRhodonite Exception"},3363:(e,t,n)=>{function r(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function o(e,t,n){return o=r()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&c(o,n.prototype),o},o.apply(null,arguments)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function a(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function s(e,t){return!t||"object"!==l(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e,t){return c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},c(e,t)}n.d(t,{n:()=>f});var l=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return o(e,arguments,i(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)},u(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=i(t);if(n){var o=i(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return s(this,e)});function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=r.call(this,(function(e,t){}))).name="",t.__callbackObj={promiseAllNum:0,resolvedNum:0,rejectedNum:0,pendingNum:0,processedPromises:[]},a(e,Promise)?t.__promise=e:t.__promise=new Promise(e),t}var l=o.prototype;return l.then=function(e,t){var n,r=this;return e&&(n=function(t){return 0!==r.__callbackObj.promiseAllNum&&-1===r.__callbackObj.processedPromises.indexOf(r)&&(r.__callbackObj.pendingNum--,r.__callbackObj.resolvedNum++,r.__callbackObj.processedPromises.push(r)),r.__callback&&r.__callback(r.__callbackObj),e(t)}),this.__promise.then(n,t)},l.catch=function(e){return new o(this.__promise.catch(e))},l.finally=function(e){return this.__promise.finally(e)},o.resolve=function(e){if(a(e,Promise))return new o(e);if(a(e,o))return e;if(null!=e.then){var t=new o((function(t,n){t(e)}));return t.then=e.then,t}return new o((function(t,n){t(e)}))},o.all=function(e,t){if(t){var n=[],r={promiseAllNum:e.length,resolvedNum:0,rejectedNum:0,pendingNum:e.length,processedPromises:[]},i=!0,a=!1,s=void 0;try{for(var c,l=e[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var u=c.value,f=o.resolve(u);f.__callback=t,f.__callbackObj=r,n.push(f)}}catch(e){a=!0,s=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw s}}return new o(Promise.all(n))}return new o(Promise.all(e))},o.race=function(e){return new o(Promise.race(e))},o.reject=function(e){return new o(Promise.reject(e))},o}(u(Promise))},3359:(e,t,n)=>{function r(e,t){for(var n=0;no});var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return e._processBegin=function(){0===e.__currentProcessBeginTime&&(e.__systemStartTime=performance.now()),e.__currentProcessBeginTime=performance.now()},e._processEnd=function(){e.__lastProcessEndTime=performance.now(),e.__lastTickTimeInterval=e.__lastProcessEndTime-e.__currentProcessBeginTime},t=e,n=[{key:"timeFromSystemStart",get:function(){return e.__systemStartTime-performance.now()/1e3}},{key:"lastTickTimeInterval",get:function(){return e.__lastTickTimeInterval/1e3}}],null&&r(t.prototype,null),n&&r(t,n),e}();o.__currentProcessBeginTime=0,o.__lastProcessEndTime=0,o.__lastTickTimeInterval=0,o.__systemStartTime=0},9425:(e,t,n)=>{n.d(t,{Bx:()=>s,Lq:()=>c,lI:()=>a});var r=n(9197);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i="The value does not exist!",a=function(){function e(){o(this,e),this.__weakMap=new WeakMap}var t=e.prototype;return t.set=function(e,t){this.__weakMap.set(e,t)},t.unwrapOrDefault=function(e,t){var n=this.__weakMap.get(e);return r.Is.exist(n)?n:t},t.unwrapOrElse=function(e,t){var n=this.__weakMap.get(e);return r.Is.exist(n)?n:t()},t.unwrapForce=function(e){var t=this.__weakMap.get(e);if(r.Is.exist(t))return t;throw new ReferenceError(i)},t.unwrapOrUndefined=function(e){return this.__weakMap.get(e)},t.has=function(e){return this.__weakMap.has(e)},e}(),s=function(){function e(t,n){o(this,e),this.__weakMap=new WeakMap,this.__weakMap.set(t,n)}var t=e.prototype;return t.unwrapOrDefault=function(e,t){return this.__weakMap.get(e)},t.unwrapOrElse=function(e,t){return this.__weakMap.get(e)},t.unwrapForce=function(e){return this.__weakMap.get(e)},t.get=function(e){return this.__weakMap.get(e)},t.unwrapOrUndefined=function(e){return this.__weakMap.get(e)},t.has=function(e){return!0},e}(),c=function(){function e(){o(this,e)}var t=e.prototype;return t.then=function(){return this},t.unwrapOrDefault=function(e,t){return t},t.unwrapOrElse=function(e,t){return t(void 0)},t.unwrapForce=function(e){throw new ReferenceError(i)},t.unwrapOrUndefined=function(e){},t.has=function(){return!1},e}()},7690:(e,t,n)=>{n.d(t,{Ct:()=>i,j4:()=>c.j,Jx:()=>l.Jx,UG:()=>P.UG,Lk:()=>S,Is:()=>r.Is,V5:()=>r.V,Kf:()=>T.Kf,Hq:()=>C.Hq,Ok:()=>P.Ok,Wx:()=>C.Wx,Mr:()=>P.Mr,ni:()=>R.n,bD:()=>C.bD,bs:()=>o,qp:()=>D.q,Lq:()=>M.Lq,lI:()=>M.lI,Bx:()=>M.Bx,li:()=>l.li,cu:()=>l.cu,bm:()=>l.bm,_z:()=>T._z,W:()=>C.W,dK:()=>T.dK,Zz:()=>C.Zz,Z6:()=>P.Z6,UD:()=>P.UD,U2:()=>w,AB:()=>E,j3:()=>T.j3,LS:()=>T.LS,CW:()=>T.CW,$z:()=>T.$z,tS:()=>T.tS,WF:()=>T.Jx,t0:()=>T.t0,fK:()=>T.fK,OB:()=>T.OB,bh:()=>T.bh,Zs:()=>T.Zs,fY:()=>T.fY,eD:()=>T.eD,Qj:()=>T.Qj,vV:()=>T.vV,YU:()=>T.YU,oz:()=>a,EY:()=>s,wv:()=>T.wv,kS:()=>T.kS});var r=n(9197),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__weakMap=new WeakMap}var t=e.prototype;return t.set=function(e,t){return!this.__weakMap.has(e)&&(this.__weakMap.set(e,t),!0)},t.has=function(e){return!!this.__weakMap.has(e)},t.get=function(e){var t=this.__weakMap.get(e);if(!r.Is.not.exist(t))return this.__weakMap.get(e)},t.delete=function(e){return!!this.__weakMap.has(e)&&(this.__weakMap.delete(e),!0)},e}(),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__symbolWeakMap=new o}return e.prototype.register=function(e){this.__symbolWeakMap.set(Symbol(),e)},e}(),a=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}},s=function(e){var t=new Map;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}},c=n(5479),l=n(3100),u=n(6860),f=n(2863),_=n(4969),h=n(988),d=n(8107),m=n(9513),v=n(1138);function p(e,t,n,r,o,i){var a=[h.d6.zero(),h.d6.zero(),h.d6.zero()];!function(e,t){for(var n=0,r=0,o=0,i=0,a=0,s=0,c=0,l=0,m=0,v=0;v4&&void 0!==arguments[4]?arguments[4]:128,i=2*o,a=0,s=0;s3&&void 0!==arguments[3]?arguments[3]:.5,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.16666,i=g(e.height*e.width),a=0;at.value?1:0}));for(var c=0;c3&&void 0!==arguments[3]?arguments[3]:.5,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.16666,i=[],a=0;at?1:0}));for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:128,n={};n.lutWidth=t,n.colorSpaceVector1=h.d6.zero(),n.colorSpaceVector2=h.d6.zero(),n.colorSpaceVector3=h.d6.zero(),n.colorSpaceOrigin=h.d6.zero();var r=new v.h(e.width,e.height,3);p(e,r,n.colorSpaceVector1,n.colorSpaceVector2,n.colorSpaceVector3,n.colorSpaceOrigin);var o=new v.h(e.width,e.height,3);n.Tinput=o;for(var i=0;i<3;i++)x(r,o,i);var a=new v.h(t,1,3);n.Tinv=a;for(var s=0;s<3;s++)I(r,a,s);a.resize(a.width,Math.floor(Math.log(o.width)/Math.log(2)),3);for(var c=0;c<3;c++)b(o,a,c);return n}}),T=n(1274),C=n(2879),P=n(3116),R=n(3363),D=n(3359),M=n(9425)},3022:(e,t,n)=>{n.d(t,{t:()=>u});var r=n(6860),o=n(988),i=n(5233),a=n(7468),s=n(3359),c=n(8776);function l(e,t){for(var n=0;n0&&(this.head.children[0].entity.getTransform().localRotation=v)},c.applyRotation=function(e){return i._.fromToRotation(r.P.normalize(this.__boneAxis),r.P.normalize(this.head.getLocalPositionOf(e)))},c.collision=function(e,t,n){var o=!0,i=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var l=s.value,u=!0,f=!1,_=void 0;try{for(var h,d=l.colliders[Symbol.iterator]();!(u=(h=d.next()).done);u=!0){var m=h.value,v=l.baseSceneGraph.getWorldPositionOf(m.position),p=n+m.radius,y=r.P.subtract(t,v),A=p-y.length();if(A>=0){var b=r.P.normalize(y),g=r.P.multiply(r.P.add(v,b),A);return t=r.P.add(t,g)}}}catch(e){f=!0,_=e}finally{try{u||null==d.return||d.return()}finally{if(f)throw _}}}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}return t},e.update=function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.__boneGroups[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;this.updateInner(i.rootBones,i)}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}},e.updateInner=function(t,n){var o=n.dragForce,i=n.stiffnessForce*s.q.lastTickTimeInterval*1,a=r.P.multiply(n.gravityDir,n.gravityPower*s.q.lastTickTimeInterval*1),c=e.getColliderGroups(n.colliderGroupIndices),l=!0,u=!1,f=void 0;try{for(var _,h=t[Symbol.iterator]();!(l=(_=h.next()).done);l=!0){var d=_.value,m=d.entity.tryToGetPhysics();if(m){m.strategy.update(i,o,a,c,n.hitRadius,void 0);var v=d.children;v&&this.updateInner(v,n)}}}catch(e){u=!0,f=e}finally{try{l||null==h.return||h.return()}finally{if(u)throw f}}},e.initialize=function(e){var t=e.children,n=e.entity.tryToGetPhysics().strategy;if(t.length>0){var o=t[0].entity.getTransform();n.initialize(e,r.P.fromCopy3(o.localPosition.x*o.localScale.x,o.localPosition.y*o.localScale.y,o.localPosition.z*o.localScale.z),void 0)}else{var i=r.P.subtract(e.worldPosition,e.parent.worldPosition),s=r.P.fromCopyArray([1,1,1]);i.lengthSquared()>0&&(s=r.P.add(e.worldPosition,r.P.multiply(r.P.normalize(i),.07)));var c=a.J.invert(e.matrixInner).multiplyVector3(s);n.initialize(e,c,void 0)}},e.setBoneGroups=function(e){this.__boneGroups=e},e.addColliderGroup=function(e,t){this.__colliderGroups.set(e,t)},e.getColliderGroups=function(e){var t=[],n=!0,r=!1,o=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var s=i.value;t.push(this.__colliderGroups.get(s))}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return t},t=e,(n=[{key:"isInitialized",get:function(){return this.__initalized}},{key:"head",get:function(){return this.__transform}},{key:"tail",get:function(){return r.P.multiplyTo(this.__boneAxis,this.__length,e.__tmp_vec3),this.__transform.matrixInner.multiplyVector3To(e.__tmp_vec3,e.__tmp_vec3_2),e.__tmp_vec3_2}},{key:"parentRotation",get:function(){return null!=this.__transform.parent?i._.fromMatrix(this.__transform.parent.matrixInner):i._.fromCopy4(0,0,0,1)}}])&&l(t.prototype,n),e}();u.__tmp_vec3=o.d6.zero(),u.__tmp_vec3_2=o.d6.zero(),u.__tmp_quat=c.y.identity(),u.__boneGroups=[],u.__colliderGroups=new Map},4021:(e,t,n)=>{n.d(t,{F:()=>o});var r=n(178),o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.getWebGLResourceRepository=function(){return r.x.getInstance().getModule("webgl").WebGLResourceRepository.getInstance()},e}();o.InvalidCGAPIResourceUid=-1},8426:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(9315);function o(e,t){for(var n=0;n{n.d(t,{R:()=>_});var r=n(9315),o=n(9197);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1&&void 0!==arguments[1]?arguments[1]:{inputRenderPasses:[],outputs:[]},n=t.inputRenderPasses,i=t.outputs;if(o.Is.exist(i)){var a=!0,s=!1,c=void 0;try{for(var l,u=i[Symbol.iterator]();!(a=(l=u.next()).done);a=!0){var f=l.value,_=f.renderPass.instance;o.Is.exist(f.renderPass.instance)?_=f.renderPass.instance:o.Is.exist(f.renderPass.index)?_=e.renderPasses[f.renderPass.index]:o.Is.exist(f.renderPass.uniqueName)&&(_=r.S.getRnObjectByName(f.renderPass.uniqueName)),o.Is.exist(_)&&_.setFramebuffer(f.frameBuffer)}}catch(e){s=!0,c=e}finally{try{a||null==u.return||u.return()}finally{if(s)throw c}}}this.__expressions.push({expression:e,inputRenderPasses:o.Is.exist(n)?n:[]})},m.getColorAttachmentFromInputOf=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{renderPass:{index:0},colorAttachmentIndex:0,framebufferType:_.FrameBuffer},n=this,r=new Promise((function(r){var o=function(){var e;return f(this,(function(t){switch(t.label){case 0:return[4];case 1:return e=t.sent(),r(e),[2,e]}}))}();n.__expressionQueries.push([e,t.renderPass,t.colorAttachmentIndex,o,t.framebufferType])}));return r},m.resolve=function(){var e,t,n=!0,a=!1,s=void 0;try{for(var c,l=this.__expressionQueries[Symbol.iterator]();!(n=(c=l.next()).done);n=!0){var u=(e=c.value,t=5,function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=u[0],_=u[1],h=u[2],d=u[3],m=u[4],v=!0,p=!1,y=void 0;try{for(var A,b=this.__expressions[Symbol.iterator]();!(v=(A=b.next()).done);v=!0){var g=A.value;if(f===g.expression){var x=_.instance;o.Is.exist(_.instance)?x=_.instance:o.Is.exist(_.index)?x=g.inputRenderPasses[_.index]:o.Is.exist(_.uniqueName)&&(x=r.S.getRnObjectByName(_.uniqueName));var I=void 0;if("ResolveFrameBuffer2"===m?I=x.getResolveFramebuffer2():"ResolveFrameBuffer"===m?I=x.getResolveFramebuffer():"FrameBuffer"===m&&(I=x.getFramebuffer()),o.Is.exist(I)){var E=I.getColorAttachedRenderTargetTexture(h);o.Is.exist(E)&&(d.next(E),d.next(E))}}}}catch(e){p=!0,y=e}finally{try{v||null==b.return||b.return()}finally{if(p)throw y}}}}catch(e){a=!0,s=e}finally{try{n||null==l.return||l.return()}finally{if(a)throw s}}},m.clearExpressions=function(){this.__expressions.length=0},m.setViewport=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.__expressions[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)o.value.expression.setViewport(e)}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}},h=_,(d=[{key:"expressions",get:function(){return this.__expressions.map((function(e){return e.expression}))}}])&&a(h.prototype,d),_}(r.S);_.FrameBuffer="FrameBuffer",_.ResolveFrameBuffer="ResolveFrameBuffer",_.ResolveFrameBuffer2="ResolveFrameBuffer2"},2374:(e,t,n)=>{n.d(t,{C:()=>v});var r=n(9315),o=n(429),i=n(6264),a=n(425),s=n(178),c=n(2166),l=n(2328),u=n(6174);function f(e,t){for(var n=0;n{n.d(t,{U:()=>i});var r=n(9197),o=n(1274),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__subscriberMap=new Map}var t=e.prototype;return t.subscribe=function(e,t){var n=this.__subscriberMap.get(e);return r.Is.not.exist(n)&&(this.__subscriberMap.set(e,[]),n=this.__subscriberMap.get(e)),n.push(t)-1},t.unsubscribe=function(e,t){var n=this.__subscriberMap.get(e);null!=n&&n.splice(t,1)},t.unsubscribeAll=function(e){this.__subscriberMap.delete(e)},t.publishAsync=function(e,t){var n=0,r=(0,o.vV)(this.__subscriberMap.get(e)),i=!0,a=!1,s=void 0;try{for(var c,l=r[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var u=c.value;setTimeout(u.bind(this,t),0),n++}}catch(e){a=!0,s=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw s}}return n},t.publishSync=function(e,t){var n=0,r=(0,o.vV)(this.__subscriberMap.get(e)),i=!0,a=!1,s=void 0;try{for(var c,l=r[Symbol.iterator]();!(i=(c=l.next()).done);i=!0)(0,c.value)(t),n++}catch(e){a=!0,s=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw s}}return n},e}()},5511:(e,t,n)=>{n.d(t,{$t:()=>q,Cf:()=>E,EY:()=>Q,K2:()=>H,KA:()=>U,KP:()=>k,KQ:()=>X,Lf:()=>f,RO:()=>A,Ry:()=>I,Rz:()=>C,SG:()=>T,Ss:()=>s,Tr:()=>j,UB:()=>w,VS:()=>G,Yw:()=>P,_6:()=>p,_Q:()=>_,ad:()=>z,ak:()=>c,cA:()=>y,cE:()=>g,cG:()=>a,cS:()=>m,fA:()=>b,hD:()=>S,hd:()=>N,jO:()=>W,jP:()=>V,jX:()=>L,k$:()=>h,k4:()=>i,lO:()=>d,lc:()=>x,lv:()=>D,n9:()=>l,oM:()=>R,p2:()=>F,pt:()=>M,q7:()=>v,us:()=>O,vE:()=>u,yy:()=>B,zU:()=>o});var r=n(9197),o="mousedown",i="mousemove",a="mouseup",s="wheel",c="mouseenter",l="mouseleave",u="mouseover",f="click",_="keydown",h="keyup",d="keypress",m="pointerdown",v="MSPointerDown",p="pointermove",y="MSPointerMove",A="pointerup",b="MSPointerUp",g="pointercancel",x="pointerenter",I="pointerleave",E="pointerover",w="pointerout",S="resize",T="orientationchange",C="tap",P="doubletap",R="longtap",D="hold",M="drag",B="swipe",N="pinch",O="touchstart",L="touchmove",F="touchend",G="touchcancel",V="touchenter",z="touchleave",k="touchover",U="touchout";function Q(e){var t=void 0!==document.ontouchstart,n=window.navigator.pointerEnabled,r=window.navigator.msPointerEnabled;return{start:n?m:r?v:t?O:o,move:n?p:r?y:t?L:i,end:n?A:r?b:t?F:a,click:f}[e]}var j="None",W="CameraController",X="GizmoTranslation",H="GizmoScale",q=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return e.register=function(e,t){this.__inputHandlingStateMap.set(e,t),this.__activeMap.set(e,!0),this.__processEventListeners()},e.unregister=function(e){this.__activeMap.set(e,!1),this.__inputHandlingStateMap.delete(e),this.__processEventListeners()},e.setActive=function(e,t){this.__activeMap.set(e,t),e===X&&t?this.__activeMap.set(H,!1):e===H&&t&&this.__activeMap.set(X,!1),this.__processEventListeners()},e.__addEventListeners=function(t){var n=e.__inputHandlingStateMap.get(t);if(r.Is.exist(n)){var o=!0,i=!1,a=void 0;try{for(var s,c=n[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var l=s.value;l.eventTargetDom.addEventListener(l.eventName,l.handler,l.options)}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}},e.__removeEventListeners=function(t){var n=e.__inputHandlingStateMap.get(t);if(r.Is.exist(n)){var o=!0,i=!1,a=void 0;try{for(var s,c=n[Symbol.iterator]();!(o=(s=c.next()).done);o=!0){var l=s.value;l.eventTargetDom.removeEventListener(l.eventName,l.handler,l.options)}}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}},e.__processEventListeners=function(){var t=e.__inputHandlingStateMap.get(X),n=e.__inputHandlingStateMap.get(H);e.__inputHandlingStateMap.get(W)&&(this.__addEventListeners(W),this.__currentState=W),t&&(this.__addEventListeners(X),this.__removeEventListeners(H),this.__currentState=X),n&&(this.__addEventListeners(H),this.__removeEventListeners(X),this.__currentState=H)},e.enableCameraController=function(){this.__addEventListeners(W)},e.disableCameraController=function(){this.__removeEventListeners(W)},e.getCurrentState=function(){return this.__currentState},e}();q.__inputHandlingStateMap=new Map,q.__activeMap=new Map,q.__currentState=j},178:(e,t,n)=>{function r(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}n.d(t,{x:()=>o});var o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__modules=new Map}var t=e.prototype;return t.loadModule=function(e,t){var o,i=this;return(o=function(){var r;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{n.d(t,{x:()=>D});var r=n(6815),o=n(6383),i=n(7042),a=n(178),s=n(4021),c=n(1410),l=n(8426),u=n(2342),f=n(3279),_=n(4395),h=n(9481),d=n(6860),m=n(2637),v=n(3359),p=n(2612),y=n(1274),A=n(9197),b=n(524),g=n(9977),x=n(3663),I=n(6264),E=n(2374),w=n(6174),S=n(7011);function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t-1:0),r=1;r0&&void 0!==arguments[0]?arguments[0]:I.Lt.fromCopy4(0,0,0,1);if(A.Is.not.exist(e.__expressionForProcessAuto)){var n=new l.A,r=new E.C;r.toClearColorBuffer=!0,r.toClearDepthBuffer=!0,r.clearColor=t;var o=new E.C;n.addRenderPasses([r,o]),e.__expressionForProcessAuto=n,e.__renderPassForProcessAuto=o}e.__renderPassForProcessAuto.clearEntities();var i=u.g._getEntities();e.__renderPassForProcessAuto.addEntities(i),this.process([e.__expressionForProcessAuto])},e.process=function(t){if("undefined"!=typeof spector&&spector.setMarker("Rn#"),this.__processApproach===i.V.None)throw new Error("Choose a process approach first.");v.q._processBegin();var n,l,u=t;n=t,(null!=(l=x.R)&&"undefined"!=typeof Symbol&&l[Symbol.hasInstance]?l[Symbol.hasInstance](n):n instanceof l)&&(u=t.expressions),f.M.current===c.w.InvalidObjectUID&&e.createCamera();var _=s.F.getWebGLResourceRepository(),h=a.x.getInstance().getModule("xr"),d=o.C.getComponentTIDs(),m=o.C.getRenderingComponentTIDs(),p=!0,y=!1,A=void 0;try{for(var b,g=c.w._processStages[Symbol.iterator]();!(p=(b=g.next()).done);p=!0){var I=b.value,E="common_"+I.methodName;if(I===r.I.Render){var S=!0,T=!1,C=void 0;try{for(var P,R=u[Symbol.iterator]();!(S=(P=R.next()).done);S=!0){var D=P.value,M=!0,B=!1,N=void 0;try{for(var O,L=m[Symbol.iterator]();!(M=(O=L.next()).done);M=!0)for(var F=O.value,G=o.C.getComponentClass(F),V=D.renderPasses.length,z=0;z0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{n.d(t,{Z:()=>r});const r={currentProcessApproach:n(7042).V.None}},4356:(e,t,n)=>{n.d(t,{y:()=>m});var r=n(9315),o=n(4543),i=n(2535),a=n(7102),s=n(1138),c=n(3932),l=n(9197);function u(e,t){for(var n=0;n{n.d(t,{B:()=>_});var r=n(4356),o=n(6558),i=n(4021),a=n(7102);function s(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function c(e){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},c(e)}function l(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}var f=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var _=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(_,e);var t,n,f=(t=_,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=c(t);if(n){var o=c(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return l(this,e)});function _(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,_),(e=f.call(this)).mipmapLevelNumber=1,e.hdriFormat=o.c.LDR_SRGB,e.isNamePosNeg=!1,e}var h=_.prototype;return h.loadTextureImages=function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1&&void 0!==arguments[1]?arguments[1]:{},n=t.magFilter,r=void 0===n?a.d.Linear:n,o=t.minFilter,s=void 0===o?a.d.LinearMipmapLinear:o,c=t.wrapS,l=void 0===c?a.d.Repeat:c,u=t.wrapT,f=void 0===u?a.d.Repeat:u,_=this;this.__startedToLoad=!0,"undefined"==typeof BASIS&&console.error("Failed to call BASIS() function. Please check to import basis_transcoder.js."),BASIS().then((function(t){(0,t.initializeBasis)();var n=new(0,t.BasisFile)(e);if(!n.startTranscoding())return console.error("failed to start transcoding."),n.close(),void n.delete();var o=i.F.getWebGLResourceRepository().createCubeTextureFromBasis(n,{magFilter:r,minFilter:s,wrapS:l,wrapT:f});_._textureResourceUid=o,_.__isTextureReady=!0,n.close(),n.delete()}))},h.load1x1Texture=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"rgba(0,0,0,1)",t=document.createElement("canvas");t.width=1,t.height=1;var n=t.getContext("2d");n.fillStyle=e,n.fillRect(0,0,1,1);var r=i.F.getWebGLResourceRepository();this._textureResourceUid=r.createCubeTexture(1,[{posX:t,negX:t,posY:t,negY:t,posZ:t,negZ:t}],1,1),this.__isTextureReady=!0},h.generateTextureFromTypedArrays=function(e,t,n){var o=i.F.getWebGLResourceRepository();this._textureResourceUid=o.createCubeTexture(e.length,e,t,n),this.__isTextureReady=!0,this.__startedToLoad=!0,r.y.__textureMap.set(this._textureResourceUid,this)},h.importWebGLTextureDirectly=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.__width=t,this.__height=n;var o=i.F.getWebGLResourceRepository(),a=o.setWebGLTextureDirectly(e);this._textureResourceUid=a,this.__startedToLoad=!0,this.__isTextureReady=!0,r.y.__textureMap.set(a,this)},_}(r.y)},9978:(e,t,n)=>{n.d(t,{_:()=>d});var r=n(4356),o=n(7102),i=n(4543),a=n(2535),s=n(4021),c=n(6264);function l(e,t){for(var n=0;n{n.d(t,{x:()=>g});var r=n(4543),o=n(2535),i=n(7102),a=n(4356),s=n(4021),c=n(9977),l=n(5479),u=n(4436);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]1&&void 0!==arguments[1]?arguments[1]:{},n=(t.level,t.internalFormat),c=(void 0===n&&i.d.RGBA8,t.format),l=void 0===c?r.V.RGBA:c,u=t.type,f=void 0===u?o.r.UnsignedByte:u,h=t.magFilter,d=void 0===h?i.d.Linear:h,m=t.minFilter,v=void 0===m?i.d.LinearMipmapLinear:m,p=t.wrapS,y=void 0===p?i.d.Repeat:p,A=t.wrapT,b=void 0===A?i.d.Repeat:A,g=(t.generateMipmap,t.anisotropy),x=void 0===g||g,I=t.isPremultipliedAlpha,E=void 0!==I&&I;this.__startedToLoad=!0,this.__magFilter=d,this.__minFilter=v,this.__wrapS=y,this.__wrapT=b;var w=new _.__BasisFile(e);if(!w.startTranscoding())return console.error("failed to start transcoding."),w.close(),void w.delete();var S=s.F.getWebGLResourceRepository(),T=S.createCompressedTextureFromBasis(w,{border:0,format:l,type:f,magFilter:d,minFilter:v,wrapS:y,wrapT:b,anisotropy:x,isPremultipliedAlpha:E});this._textureResourceUid=T,this.__isTextureReady=!0,a.y.__textureMap.set(T,this),w.close(),w.delete()},A.generateTextureFromKTX2=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.magFilter,r=void 0===n?i.d.Linear:n,o=t.minFilter,a=void 0===o?i.d.LinearMipmapLinear:o,s=t.wrapS,c=void 0===s?i.d.Repeat:s,l=t.wrapT,f=void 0===l?i.d.Repeat:l,_=t.anisotropy,d=void 0===_||_,m=this;return h((function(){var t;return b(this,(function(n){switch(n.label){case 0:return m.__startedToLoad=!0,m.__magFilter=r,m.__minFilter=a,m.__wrapS=c,m.__wrapT=f,[4,u.N.getInstance().transcode(e)];case 1:return t=n.sent(),m.__width=t.width,m.__height=t.height,m.generateCompressedTextureWithMipmapFromTypedArray(t.mipmapData,t.compressionTextureType,{magFilter:r,minFilter:a,wrapS:c,wrapT:f,anisotropy:d}),[2]}}))}))()},A.generateTextureFromImage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.level,u=void 0===n?0:n,f=t.internalFormat,_=void 0===f?i.d.RGBA8:f,h=t.format,d=void 0===h?r.V.RGBA:h,v=t.type,p=void 0===v?o.r.UnsignedByte:v,A=t.magFilter,b=void 0===A?i.d.Linear:A,g=t.minFilter,x=void 0===g?i.d.Linear:g,I=t.wrapS,E=void 0===I?i.d.Repeat:I,w=t.wrapT,S=void 0===w?i.d.Repeat:w,T=t.generateMipmap,C=void 0===T||T,P=t.anisotropy,R=void 0===P||P,D=t.isPremultipliedAlpha,M=void 0!==D&&D;this.__magFilter=b,this.__minFilter=x,this.__wrapS=E,this.__wrapT=S,this.__startedToLoad=!0,this.__htmlImageElement=e;var B=e;if(this.autoResize){var N=y(l.j.getResizedCanvas(B,c.D.maxSizeLimitOfNonCompressedTexture),3),O=N[0],L=N[1],F=N[2];B=O,this.__width=L,this.__height=F,this.__htmlCanvasElement=O}this.autoDetectTransparency&&(this.__hasTransparentPixels=l.j.detectTransparentPixelExistence(B)),this.__width=B.width,this.__height=B.height;var G,V=s.F.getWebGLResourceRepository();if(m(B,HTMLImageElement))G=V.createTextureFromHTMLImageElement(B,{level:u,internalFormat:_,width:this.__width,height:this.__height,border:0,format:d,type:p,magFilter:b,minFilter:x,wrapS:E,wrapT:S,generateMipmap:C,anisotropy:R,isPremultipliedAlpha:M});else{if(!m(B,HTMLCanvasElement))throw new Error("Unsupported image type.");var z=V.createTextureFromImageBitmapData(B,{level:u,internalFormat:_,width:this.__width,height:this.__height,border:0,format:d,type:p,magFilter:b,minFilter:x,wrapS:E,wrapT:S,generateMipmap:C,anisotropy:R,isPremultipliedAlpha:M}),k=z.textureHandle;z.samplerHandle,G=k}this._textureResourceUid=G,this.__isTextureReady=!0,this.__uri=e.src,a.y.__textureMap.set(G,this)},A.generateTextureFromUri=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.level,u=void 0===n?0:n,f=t.internalFormat,_=void 0===f?i.d.RGBA8:f,h=t.format,d=void 0===h?r.V.RGBA:h,v=t.type,p=void 0===v?o.r.UnsignedByte:v,A=t.magFilter,b=void 0===A?i.d.Linear:A,g=t.minFilter,x=void 0===g?i.d.Linear:g,I=t.wrapS,E=void 0===I?i.d.Repeat:I,w=t.wrapT,S=void 0===w?i.d.Repeat:w,T=t.generateMipmap,C=void 0===T||T,P=t.anisotropy,R=void 0===P||P,D=t.isPremultipliedAlpha,M=void 0!==D&&D,B=this;return this.__uri=e,this.__startedToLoad=!0,new Promise((function(t,n){B.__img=new Image,e.match(/^data:/)||(B.__img.crossOrigin="Anonymous"),B.__img.onload=function(){B.__htmlImageElement=B.__img;var e=B.__img;if(B.autoResize){var n=y(l.j.getResizedCanvas(e,c.D.maxSizeLimitOfNonCompressedTexture),3),r=n[0],o=n[1],i=n[2];e=r,B.__width=o,B.__height=i,B.__htmlCanvasElement=r}B.autoDetectTransparency&&(B.__hasTransparentPixels=l.j.detectTransparentPixelExistence(e)),B.__width=e.width,B.__height=e.height;var f,h=s.F.getWebGLResourceRepository();if(m(e,HTMLImageElement))f=h.createTextureFromHTMLImageElement(e,{level:u,internalFormat:_,width:B.__width,height:B.__height,border:0,format:d,type:p,magFilter:b,minFilter:x,wrapS:E,wrapT:S,generateMipmap:C,anisotropy:R,isPremultipliedAlpha:M});else{if(!m(e,HTMLCanvasElement))throw new Error("Unsupported image type");var v=h.createTextureFromImageBitmapData(e,{level:u,internalFormat:_,width:B.__width,height:B.__height,border:0,format:d,type:p,magFilter:b,minFilter:x,wrapS:E,wrapT:S,generateMipmap:C,anisotropy:R,isPremultipliedAlpha:M}),A=v.textureHandle;v.samplerHandle,f=A}B._textureResourceUid=f,B.__isTextureReady=!0,a.y.__textureMap.set(f,B),t()},B.__img.src=e}))},A.generate1x1TextureFrom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"rgba(255,255,255,1)",t=document.createElement("canvas");t.width=1,t.height=1,this.__width=1,this.__height=1;var n=t.getContext("2d");n.fillStyle=e,n.fillRect(0,0,1,1);var c=s.F.getWebGLResourceRepository(),l=c.createTextureFromImageBitmapData(t,{level:0,internalFormat:i.d.RGBA8,width:1,height:1,border:0,format:r.V.RGBA,type:o.r.UnsignedByte,magFilter:i.d.Nearest,minFilter:i.d.Nearest,wrapS:i.d.ClampToEdge,wrapT:i.d.ClampToEdge,generateMipmap:!1,anisotropy:!1,isPremultipliedAlpha:!0}),u=l.textureHandle;l.samplerHandle,this._textureResourceUid=u,this.__isTextureReady=!0,a.y.__textureMap.set(u,this)},A.generateTextureFromTypedArray=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.level,c=void 0===n?0:n,l=t.internalFormat,u=void 0===l?i.d.RGBA8:l,f=t.format,_=void 0===f?r.V.RGBA:f,h=t.magFilter,d=void 0===h?i.d.Linear:h,m=t.minFilter,v=void 0===m?i.d.LinearMipmapLinear:m,p=t.wrapS,y=void 0===p?i.d.Repeat:p,A=t.wrapT,b=void 0===A?i.d.Repeat:A,g=t.generateMipmap,x=void 0===g||g,I=t.anisotropy,E=void 0===I||I,w=t.isPremultipliedAlpha,S=void 0!==w&&w;this.__magFilter=d,this.__minFilter=v,this.__wrapS=y,this.__wrapT=b;var T=o.r.fromTypedArray(e),C=s.F.getWebGLResourceRepository(),P=C.createTextureFromTypedArray(e,{level:c,internalFormat:u,width:this.__width,height:this.__height,border:0,format:_,type:T,magFilter:d,minFilter:v,wrapS:y,wrapT:b,generateMipmap:x,anisotropy:E,isPremultipliedAlpha:S});this._textureResourceUid=P,this.__isTextureReady=!0,a.y.__textureMap.set(P,this)},A.generateCompressedTextureFromTypedArray=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},c=o.magFilter,l=void 0===c?i.d.Linear:c,u=o.minFilter,f=void 0===u?i.d.LinearMipmapLinear:u,_=o.wrapS,h=void 0===_?i.d.ClampToEdge:_,d=o.wrapT,m=void 0===d?i.d.ClampToEdge:d,v=o.anisotropy,p=void 0===v||v;this.__width=t,this.__height=n,this.__magFilter=l,this.__minFilter=f,this.__wrapS=h,this.__wrapT=m;var y={level:0,width:t,height:n,buffer:e},A=s.F.getWebGLResourceRepository(),b=A.createCompressedTexture([y],r,{magFilter:l,minFilter:f,wrapS:h,wrapT:m,anisotropy:p});this._textureResourceUid=b,this.__isTextureReady=!0,a.y.__textureMap.set(b,this)},A.generateCompressedTextureWithMipmapFromTypedArray=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.magFilter,o=void 0===r?i.d.Linear:r,c=n.minFilter,l=void 0===c?i.d.LinearMipmapLinear:c,u=n.wrapS,f=void 0===u?i.d.ClampToEdge:u,_=n.wrapT,h=void 0===_?i.d.ClampToEdge:_,d=n.anisotropy,m=void 0===d||d;this.__magFilter=o,this.__minFilter=l,this.__wrapS=f,this.__wrapT=h;var v=e.find((function(e){return 0===e.level}));if(null==v)throw new Error("texture data with level 0 is not found");this.__width=v.width,this.__height=v.height;var p=s.F.getWebGLResourceRepository(),y=p.createCompressedTexture(e,t,{magFilter:o,minFilter:l,wrapS:f,wrapT:h,anisotropy:m});this._textureResourceUid=y,this.__isTextureReady=!0,a.y.__textureMap.set(y,this)},A.importWebGLTextureDirectly=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.__width=t,this.__height=n;var r=s.F.getWebGLResourceRepository(),o=r.setWebGLTextureDirectly(e);this._textureResourceUid=o,this.__startedToLoad=!0,this.__isTextureReady=!0,a.y.__textureMap.set(o,this)},A.destroy3DAPIResources=function(){return a.y.__textureMap.delete(this._textureResourceUid),s.F.getWebGLResourceRepository().deleteTexture(this._textureResourceUid),this._textureResourceUid=s.F.InvalidCGAPIResourceUid,this.__isTextureReady=!1,this.__startedToLoad=!1,!0},_}(a.y);g.__loadedBasisFunc=!1},1138:(e,t,n)=>{function r(e,t){for(var n=0;ni});var i=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__channels=r,this.__width=t,this.__height=n,this.__data=new Float32Array(t*n*r)}var t,n,i=e.prototype;return i.resize=function(t,n,r){this.__width=t,this.__height=n,this.__channels=r,this.__data=new Float32Array(e.transfer(this.__data.buffer,t*n*r*4))},i.setPixelAtChannel=function(e,t,n,r){this.__data[t*this.__width*this.__channels+e*this.__channels+n]=r},i.getPixel=function(e,t,n){return this.__data[t*this.__width*this.__channels+e*this.__channels+n]},i.getPixelAs=function(e,t,n,r){return 3===n?new r(new Float32Array([this.__data[t*this.__width*this.__channels+e*this.__channels+0],this.__data[t*this.__width*this.__channels+e*this.__channels+1],this.__data[t*this.__width*this.__channels+e*this.__channels+2]])):4===n?new r(new Float32Array([this.__data[t*this.__width*this.__channels+e*this.__channels+0],this.__data[t*this.__width*this.__channels+e*this.__channels+1],this.__data[t*this.__width*this.__channels+e*this.__channels+2],this.__data[t*this.__width*this.__channels+e*this.__channels+3]])):void 0},i.getPixelAsArray=function(e,t){for(var n=[],r=0;r=e.byteLength){var r=0,i=e.byteLength;[8,4,2,1].forEach((function(t){if(i>=t){var o=function(e,t,n,r,o){var i=Uint8Array;switch(e){case 8:i=Float64Array;break;case 4:i=Float32Array;break;case 2:i=Uint16Array;break;default:i=Uint8Array}for(var a=new i(t,r,Math.trunc(o/e)),s=new i(n,r,Math.trunc(o/e)),c=0;c{n.r(t),n.d(t,{default:()=>r});const r=Object.freeze({sheen_E_and_DGTerm:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGkmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4yLWMwMDAgNzkuNTY2ZWJjNWI0LCAyMDIyLzA1LzA5LTA4OjI1OjU1ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjMuNCAoTWFjaW50b3NoKSIgeG1wOkNyZWF0ZURhdGU9IjIwMjItMDctMTFUMDA6MDg6NDArMDk6MDAiIHht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:()=>Dr,y$A:()=>Ao,y1m:()=>ka,y3j:()=>Hs,y3r:()=>kl,y8S:()=>uc,y9I:()=>Lt,yD3:()=>Vt,yYj:()=>Rr,yZM:()=>ou,yZh:()=>yl,ycd:()=>Tl,yd2:()=>gs,yun:()=>yc,yx3:()=>Di,z8r:()=>tl,zSL:()=>K,zSP:()=>Ne,zfW:()=>Wc,zsc:()=>Ci});var r=256,o=1024,i=16384,a=0,s=1,c=2,l=3,u=4,f=5,_=6,h=0,d=1,m=768,v=769,p=770,y=771,A=772,b=773,g=774,x=775,I=776,E=32769,w=32770,S=32771,T=32772,C=32774,P=32778,R=32779,D=32777,M=32777,B=34877,N=32968,O=32969,L=32970,F=32971,G=32773,V=34964,z=34965,k=2849,U=33901,Q=33902,j=2885,W=2886,X=2928,H=2930,q=2931,Y=2932,K=2961,J=2962,Z=2964,$=2965,ee=2966,te=2967,ne=2963,re=2968,oe=34816,ie=34817,ae=34818,se=34819,ce=36003,le=36004,ue=36005,fe=2978,_e=3088,he=3106,de=3107,me=3317,ve=3333,pe=3379,ye=3386,Ae=3408,be=3410,ge=3411,xe=3412,Ie=3413,Ee=3414,we=3415,Se=10752,Te=32824,Ce=32873,Pe=32936,Re=32937,De=32938,Me=32939,Be=34467,Ne=7936,Oe=7937,Le=7938,Fe=35738,Ge=35739,Ve=37444,ze=35044,ke=35040,Ue=35048,Qe=34962,je=34963,We=34660,Xe=34661,He=34342,qe=34338,Ye=34339,Ke=34340,Je=34341,Ze=34922,$e=34373,et=34975,tt=2884,nt=1028,rt=1029,ot=1032,it=3042,at=2929,st=3024,ct=32823,lt=32926,ut=32928,ft=3089,_t=2960,ht=0,dt=1280,mt=1281,vt=1282,pt=1285,yt=37442,At=2304,bt=2305,gt=4352,xt=4353,It=4354,Et=33170,wt=5120,St=5121,Tt=5122,Ct=5123,Pt=5124,Rt=5125,Dt=5126,Mt=6402,Bt=6406,Nt=6407,Ot=6408,Lt=6409,Ft=6410,Gt=5121,Vt=32819,zt=32820,kt=33635,Ut=35632,Qt=35633,jt=35713,Wt=35712,Xt=35714,Ht=35715,qt=35717,Yt=35721,Kt=35718,Jt=34921,Zt=36347,$t=36348,en=35661,tn=35660,nn=34930,rn=36349,on=35663,an=35724,sn=35725,cn=512,ln=519,un=513,fn=514,_n=515,hn=516,dn=518,mn=517,vn=7680,pn=7681,yn=7682,An=7683,bn=5386,gn=34055,xn=34056,In=9728,En=9729,wn=9984,Sn=9985,Tn=9986,Cn=9987,Pn=10240,Rn=10241,Dn=10242,Mn=10243,Bn=3553,Nn=5890,On=34067,Ln=34068,Fn=34069,Gn=34070,Vn=34071,zn=34072,kn=34073,Un=34074,Qn=34076,jn=33984,Wn=33985,Xn=33986,Hn=33987,qn=33988,Yn=33989,Kn=33990,Jn=33991,Zn=33992,$n=33993,er=33994,tr=33995,nr=33996,rr=33997,or=33998,ir=33999,ar=34e3,sr=34001,cr=34002,lr=34003,ur=34004,fr=34005,_r=34006,hr=34007,dr=34008,mr=34009,vr=34010,pr=34011,yr=34012,Ar=34013,br=34014,gr=34015,xr=34016,Ir=10497,Er=33071,wr=33648,Sr=35664,Tr=35665,Cr=35666,Pr=35667,Rr=35668,Dr=35669,Mr=35670,Br=35671,Nr=35672,Or=35673,Lr=35674,Fr=35675,Gr=35676,Vr=35678,zr=35680,kr=36336,Ur=36337,Qr=36338,jr=36339,Wr=36340,Xr=36341,Hr=36160,qr=36161,Yr=32854,Kr=32855,Jr=36194,Zr=33189,$r=6401,eo=36168,to=34041,no=36162,ro=36163,oo=36164,io=36176,ao=36177,so=36178,co=36179,lo=36180,uo=36181,fo=36048,_o=36049,ho=36050,mo=36051,vo=36064,po=36096,yo=36128,Ao=33306,bo=0,go=36053,xo=36054,Io=36055,Eo=36057,wo=36061,So=36006,To=36007,Co=34024,Po=1286,Ro=37440,Do=37441,Mo=37443,Bo=3074,No=3314,Oo=3315,Lo=3316,Fo=3330,Go=3331,Vo=3332,zo=32874,ko=32877,Uo=32878,Qo=32883,jo=33e3,Wo=33001,Xo=34045,Ho=35657,qo=35658,Yo=35071,Ko=35076,Jo=35077,Zo=35659,$o=35723,ei=35977,ti=34229,ni=37154,ri=37157,oi=37137,ii=36203,ai=6403,si=32849,ci=32856,li=32857,ui=32879,fi=32882,_i=33082,hi=33083,di=33084,mi=33085,vi=34892,pi=34893,yi=35904,Ai=35905,bi=35907,gi=34894,xi=34836,Ii=34837,Ei=34842,wi=34843,Si=35866,Ti=35869,Ci=35898,Pi=35901,Ri=36208,Di=36209,Mi=36214,Bi=36215,Ni=36220,Oi=36221,Li=36226,Fi=36227,Gi=36232,Vi=36233,zi=36238,ki=36239,Ui=36244,Qi=36248,ji=36249,Wi=33321,Xi=33323,Hi=33325,qi=33326,Yi=33327,Ki=33328,Ji=33329,Zi=33330,$i=33331,ea=33332,ta=33333,na=33334,ra=33335,oa=33336,ia=33337,aa=33338,sa=33339,ca=33340,la=36756,ua=36757,fa=36758,_a=36759,ha=36975,da=37167,ma=33503,va=33640,pa=35899,ya=35902,Aa=36269,ba=34042,ga=5131,xa=33319,Ia=33320,Ea=36255,wa=34917,Sa=34918,Ta=34919,Ca=35887,Pa=36202,Ra=34852,Da=34853,Ma=34854,Ba=34855,Na=34856,Oa=34857,La=34858,Fa=34859,Ga=34860,Va=34861,za=34862,ka=34863,Ua=34864,Qa=34865,ja=34866,Wa=34867,Xa=34868,Ha=36063,qa=36065,Ya=36066,Ka=36067,Ja=36068,Za=36069,$a=36070,es=36071,ts=36072,ns=36073,rs=36074,os=36075,is=36076,as=36077,ss=36078,cs=36079,ls=35679,us=35682,fs=36289,_s=36292,hs=36293,ds=36298,ms=36299,vs=36300,ps=36303,ys=36306,As=36307,bs=36308,gs=36311,xs=36183,Is=35097,Es=35051,ws=35052,Ss=35053,Ts=35055,Cs=36662,Ps=36663,Rs=36662,Ds=36663,Ms=35685,Bs=35686,Ns=35687,Os=35688,Ls=35689,Fs=35690,Gs=36294,Vs=36295,zs=36296,ks=35863,Us=36764,Qs=35069,js=35070,Ws=35967,Xs=35968,Hs=35971,qs=35972,Ys=35973,Ks=35976,Js=35978,Zs=35979,$s=35980,ec=35981,tc=35982,nc=35983,rc=36386,oc=36387,ic=36388,ac=36389,sc=33296,cc=33297,lc=33298,uc=33299,fc=33300,_c=33301,hc=33302,dc=33303,mc=33304,vc=35056,pc=36006,yc=36008,Ac=36009,bc=36010,gc=36011,xc=36052,Ic=36182,Ec=35345,wc=35368,Sc=35369,Tc=35370,Cc=35371,Pc=35373,Rc=35374,Dc=35375,Mc=35376,Bc=35377,Nc=35379,Oc=35380,Lc=35382,Fc=35383,Gc=35384,Vc=35386,zc=35387,kc=35388,Uc=35389,Qc=35390,jc=35391,Wc=35392,Xc=35394,Hc=35395,qc=35396,Yc=35398,Kc=37138,Jc=37139,Zc=37140,$c=37141,el=37142,tl=37143,nl=37144,rl=37145,ol=37146,il=37147,al=37148,sl=37149,cl=1,ll=6144,ul=6145,fl=6146,_l=32775,hl=32776,dl=33190,ml=35041,vl=35042,pl=35045,yl=35046,Al=35049,bl=35050,gl=36012,xl=36013,Il=4294967295,El=-1,wl=37447,Sl=35070,Tl=37445,Cl=37446,Pl=34047,Rl=34046,Dl=33776,Ml=33777,Bl=33778,Nl=33779,Ol=35916,Ll=35917,Fl=35918,Gl=35919,Vl=37488,zl=37489,kl=37490,Ul=37491,Ql=37492,jl=37493,Wl=37494,Xl=37495,Hl=37496,ql=37497,Yl=35840,Kl=35842,Jl=35841,Zl=35843,$l=36196,eu=35986,tu=35986,nu=34798,ru=37808,ou=37809,iu=37810,au=37811,su=37812,cu=37813,lu=37814,uu=37815,fu=37816,_u=37817,hu=37818,du=37819,mu=37820,vu=37821,pu=37840,yu=37841,Au=37842,bu=37843,gu=37844,xu=37845,Iu=37846,Eu=37847,wu=37848,Su=37849,Tu=37850,Cu=37851,Pu=37852,Ru=37853,Du=34042,Mu=36193,Bu=34836,Nu=34837,Ou=33297,Lu=35863,Fu=32775,Gu=32776,Vu=35904,zu=35906,ku=35907,Uu=33296,Qu=35723,ju=36064,Wu=36065,Xu=36066,Hu=36067,qu=36068,Yu=36069,Ku=36070,Ju=36071,Zu=36072,$u=36073,ef=36074,tf=36075,nf=36076,rf=36077,of=36078,af=36079,sf=34853,cf=34854,lf=34855,uf=34856,ff=34857,_f=34858,hf=34859,df=34860,mf=34861,vf=34862,pf=34863,yf=34864,Af=34865,bf=34866,gf=34867,xf=34868,If=36063,Ef=34852,wf=34229,Sf=34916,Tf=34917,Cf=34918,Pf=34919,Rf=35007,Df=36392,Mf=36795},3884:(e,t,n)=>{n.d(t,{C:()=>o,j:()=>r});var r="gltf_node_index";function o(e,t){return e.magFilter===t.magFilter&&e.minFilter===t.minFilter&&e.wrapS===t.wrapS&&e.wrapT===t.wrapT}},2142:(e,t,n)=>{n.d(t,{_$8:()=>i._$8,lkt:()=>i.lkt,Td9:()=>i.Td9,wEd:()=>i.wEd,ogk:()=>i.ogk,AY1:()=>i.AY1,fNk:()=>i.fNk,Y0n:()=>i.Y0n,WPj:()=>i.WPj,gOo:()=>i.gOo,$LR:()=>i.$LR,faJ:()=>i.faJ,TdU:()=>i.TdU,UAv:()=>i.UAv,Q$l:()=>i.Q$l,wIF:()=>i.wIF,ZXb:()=>i.ZXb,hzX:()=>i.hzX,r9F:()=>i.r9F,Kzo:()=>i.Kzo,ttq:()=>i.ttq,XG_:()=>i.XG_,HPC:()=>i.HPC,QH$:()=>i.QH$,_1o:()=>i._1o,EZ0:()=>i.EZ0,N9T:()=>i.N9T,vgW:()=>i.vgW,tqi:()=>i.tqi,iU2:()=>i.iU2,BWL:()=>i.BWL,F_m:()=>i.F_m,$et:()=>i.$et,gx8:()=>i.gx8,Y8m:()=>i.Y8m,Wlc:()=>i.Wlc,krQ:()=>i.krQ,YCV:()=>i.YCV,p7w:()=>i.p7w,Axb:()=>i.Axb,eqO:()=>i.eqO,gwn:()=>i.gwn,BM1:()=>i.BM1,w4x:()=>i.w4x,CCZ:()=>i.CCZ,FQh:()=>i.FQh,AOk:()=>i.AOk,rjz:()=>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=>i.lQo,Ith:()=>i.Ith,GIj:()=>i.GIj,_sJ:()=>i._sJ,j3U:()=>a.j,bup:()=>o,CLY:()=>a.C});var r=n(3932);function o(e){switch(e.className){case"Scalar":return r.d.Scalar;case"Vector2":return r.d.Vec2;case"Vector3":return r.d.Vec3;case"Vector4":return r.d.Vec4;case"Matrix22":return r.d.Mat2;case"Matrix33":return r.d.Mat3;case"Matrix44":return r.d.Mat4;default:return console.error("CompositionType.Unknown"),r.d.Unknown}}var i=n(92),a=n(3884)},2129:(e,t,n)=>{n.d(t,{d:()=>p});var r=n(1067),o=n(6264);function i(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function a(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,i(e,t,"get"))}function s(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function c(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,i(e,t,"set"),n),n}function l(e,t){for(var n=0;n{n.d(t,{c:()=>N});var r=n(3100);function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}function i(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}var s=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};var c=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(s,e);var t,n,r=(t=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=o(t);if(n){var a=o(this).constructor;e=Reflect.construct(r,arguments,a)}else e=r.apply(this,arguments);return i(this,e)});function s(e){var t=e.index,n=e.str;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),r.call(this,{index:t,str:n})}return s}(r.Jx),l=new c({index:1,str:"OES_vertex_array_object"}),u=new c({index:2,str:"OES_texture_float"}),f=new c({index:3,str:"OES_texture_half_float"}),_=new c({index:4,str:"OES_texture_float_linear"}),h=new c({index:5,str:"OES_texture_half_float_linear"}),d=new c({index:6,str:"ANGLE_instanced_arrays"}),m=new c({index:7,str:"EXT_texture_filter_anisotropic"}),v=new c({index:8,str:"OES_element_index_uint"}),p=new c({index:9,str:"EXT_shader_texture_lod"}),y=new c({index:10,str:"OES_standard_derivatives"}),A=new c({index:11,str:"WEBGL_draw_buffers"}),b=new c({index:12,str:"EXT_blend_minmax"}),g=new c({index:13,str:"WEBGL_color_buffer_float"}),x=new c({index:14,str:"WEBGL_compressed_texture_astc"}),I=new c({index:15,str:"WEBGL_compressed_texture_s3tc"}),E=new c({index:16,str:"WEBGL_compressed_texture_pvrtc"}),w=new c({index:17,str:"WEBGL_compressed_texture_atc"}),S=new c({index:18,str:"WEBGL_compressed_texture_etc"}),T=new c({index:19,str:"WEBGL_compressed_texture_etc1"}),C=new c({index:20,str:"EXT_texture_compression_bptc"}),P=new c({index:21,str:"GMAN_webgl_memory"}),R=new c({index:22,str:"EXT_color_buffer_float"}),D=new c({index:23,str:"EXT_color_buffer_half_float"}),M=new c({index:24,str:"OCULUS_multiview"}),B=new c({index:25,str:"OVR_multiview2"}),N=Object.freeze({VertexArrayObject:l,TextureFloat:u,TextureHalfFloat:f,TextureFloatLinear:_,TextureHalfFloatLinear:h,InstancedArrays:d,TextureFilterAnisotropic:m,ElementIndexUint:v,ShaderTextureLod:p,ShaderDerivatives:y,DrawBuffers:A,BlendMinmax:b,ColorBufferFloatWebGL1:g,CompressedTextureAstc:x,CompressedTextureS3tc:I,CompressedTexturePvrtc:E,CompressedTextureAtc:w,CompressedTextureEtc:S,CompressedTextureEtc1:T,CompressedTextureBptc:C,ColorBufferFloatWebGL2:R,ColorBufferHalfFloatWebGL2:D,OculusMultiview:M,OvrMultiview2:B,GMAN_WEBGL_MEMORY:P})},2166:(e,t,n)=>{n.d(t,{x:()=>L});var r=n(4021),o=n(6221),i=n(7102),a=n(4543),s=n(3932),c=n(2535),l=n(2129),u=n(4969),f=n(7416),_=n(4356),h=n(9978),d=n(6558),m=n(6264),v=n(7952),p=n(1274),y=n(5479),A=n(2503),b=n(1067),g=n(9197),x=n(425),I=n(6014),E=n(9977),w=n(92);function S(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function T(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){S(i,r,o,a,s,"next",e)}function s(e){S(i,r,o,a,s,"throw",e)}a(void 0)}))}}function C(e,t){for(var n=0;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},L=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&M(e,t)}(B,e);var t,n,S=(t=B,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=P(t);if(n){var o=P(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return D(this,e)});function B(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,B),(e=S.call(this)).__webglContexts=new Map,e.__resourceCounter=r.F.InvalidCGAPIResourceUid,e.__webglResources=new Map,e}var L,F,G=B.prototype;return G.addWebGLContext=function(e,t,n,r){var o=new l.d(e,t,r);this.__webglContexts.set("default",o),n&&(this.__glw=o)},G.generateWebGLContext=function(e,t,n,r,o){var i=e.getContext("webgl2",o);return this.addWebGLContext(i,e,n,r),p.Kf.isSafari()&&(E.D.isUboEnabled=!1),i},G.getResourceNumber=function(){return++this.__resourceCounter},G.__registerResource=function(e){var t=this.getResourceNumber();return e._resourceUid=t,this.__webglResources.set(t,e),t},G.getWebGLResource=function(e){var t=this.__webglResources.get(e);return null!=t?t:null},G.createIndexBuffer=function(e){var t=this.__glw.getRawContext();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");this.__glw.bindVertexArray(null);var n=t.createBuffer(),r=this.__registerResource(n);return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.getTypedArray(),t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),r},G.updateIndexBuffer=function(e,t){var n=this.__glw,r=null==n?void 0:n.getRawContext();if(g.Is.not.exist(r))throw new Error("No WebGLRenderingContext set as Default.");var o=this.__webglResources.get(t);if(g.Is.not.exist(o))throw new Error("Not found VBO.");n.bindVertexArray(null),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,o),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,e.getTypedArray()),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,null)},G.createVertexBuffer=function(e){var t=this.__glw.getRawContext();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");this.__glw.bindVertexArray(null);var n=t.createBuffer(),r=this.__registerResource(n);return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,e.bufferView.getUint8Array(),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),r},G.createVertexBufferFromTypedArray=function(e){var t=this.__glw.getRawContext();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");this.__glw.bindVertexArray(null);var n=t.createBuffer(),r=this.__registerResource(n);return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),r},G.updateVertexBuffer=function(e,t){var n=this.__glw,r=null==n?void 0:n.getRawContext();if(!g.Is.exist(r))throw new Error("No WebGLRenderingContext set as Default.");var o=this.__webglResources.get(t);if(!g.Is.exist(o))throw new Error("Not found VBO.");n.bindVertexArray(null),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferSubData(r.ARRAY_BUFFER,0,e.bufferView.getUint8Array()),r.bindBuffer(r.ARRAY_BUFFER,null)},G.createVertexArray=function(){if(null==this.__glw)throw new Error("No WebGLRenderingContext set as Default.");var e=this.__glw.createVertexArray();if(!g.Is.not.exist(e))return this.__registerResource(e)},G.bindTexture2D=function(e,t){var n=this.getWebGLResource(t);this.__glw.bindTexture2D(e,n)},G.bindTextureCube=function(e,t){var n=this.getWebGLResource(t);this.__glw.bindTextureCube(e,n)},G.createVertexBufferAndIndexBuffer=function(e){var t,n=this;e.hasIndices()&&(t=this.createIndexBuffer(e.indicesAccessor));for(var r=[],i=0;i2&&void 0!==arguments[2]?arguments[2]:r.F.InvalidCGAPIResourceUid,u=this,f=this.__glw.getRawContext(),_=this.getWebGLResource(n);if(this.__glw.bindVertexArray(_),null!=i){var h=this.getWebGLResource(i);if(null==h)throw new Error("Nothing Element Array Buffer!");f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,h)}if(a.forEach((function(e,n){var r=u.getWebGLResource(e);if(null==r)throw new Error("Nothing Element Array Buffer at index "+n);f.bindBuffer(f.ARRAY_BUFFER,r),f.enableVertexAttribArray(o.T.toAttributeSlotFromJoinedString(t.attributeSemantics[n])),f.vertexAttribPointer(o.T.toAttributeSlotFromJoinedString(t.attributeSemantics[n]),t.attributeCompositionTypes[n].getNumberOfComponents(),t.attributeComponentTypes[n].index,t.attributeAccessors[n].normalized,t.attributeAccessors[n].byteStride,t.attributeAccessors[n].byteOffsetInBufferView)})),l!==r.F.InvalidCGAPIResourceUid){var d=this.getWebGLResource(l);if(null==d)throw new Error("Nothing Element Array Buffer at index");f.bindBuffer(f.ARRAY_BUFFER,d),f.enableVertexAttribArray(o.T.Instance.getAttributeSlot()),f.vertexAttribPointer(o.T.Instance.getAttributeSlot(),s.d.Vec4.getNumberOfComponents(),c.r.Float.index,!1,0,0),this.__glw.vertexAttribDivisor(o.T.Instance.getAttributeSlot(),1)}f.bindBuffer(f.ARRAY_BUFFER,null),this.__glw.bindVertexArray(null),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,null)},G.createTexStorage2D=function(e){var t=e.levels,n=e.internalFormat,r=e.width,o=e.height,i=this.__glw.getRawContextAsWebGL2(),a=i.createTexture();this.__glw.bindTexture2D(0,a),i.texStorage2D(w.CbE,t,n.index,r,o);var s=this.__registerResource(a);return this.__glw.unbindTexture2D(0),s},G.createTexStorage2DWithSamplerParameters=function(e){var t=e.levels,n=e.internalFormat,r=e.width,o=e.height,i=e.magFilter,a=e.minFilter,s=e.wrapS,c=e.wrapT,l=e.anisotropy,f=(e.isPremultipliedAlpha,this.__glw.getRawContextAsWebGL2()),_=f.createTexture();this.__glw.bindTexture2D(0,_),f.texStorage2D(w.CbE,t,n.index,r,o);var h=this.__registerResource(_);return f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,s.index),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,c.index),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,i.index),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,a.index),u.k.isPowerOfTwoTexture(r,o)&&l&&this.__glw.webgl2ExtTFA&&f.texParameteri(f.TEXTURE_2D,this.__glw.webgl2ExtTFA.TEXTURE_MAX_ANISOTROPY_EXT,4),this.__glw.unbindTexture2D(0),h},G.createTextureSampler=function(e){var t=e.magFilter,n=e.minFilter,r=e.wrapS,o=e.wrapT,i=e.anisotropy,a=(e.isPremultipliedAlpha,this.__glw.getRawContextAsWebGL2()),s=a.createSampler(),c=this.__registerResource(s);return a.samplerParameteri(s,a.TEXTURE_MIN_FILTER,n.index),a.samplerParameteri(s,a.TEXTURE_MAG_FILTER,t.index),a.samplerParameteri(s,a.TEXTURE_WRAP_S,r.index),a.samplerParameteri(s,a.TEXTURE_WRAP_T,o.index),i&&this.__glw.webgl2ExtTFA&&a.samplerParameteri(s,this.__glw.webgl2ExtTFA.TEXTURE_MAX_ANISOTROPY_EXT,4),c},G.createTextureFromImageBitmapData=function(e,t){t.level;var n=t.internalFormat,r=t.width,o=t.height,i=(t.border,t.format),a=t.type,s=t.magFilter,c=t.minFilter,l=t.wrapS,u=t.wrapT,f=t.generateMipmap,_=t.anisotropy,h=t.isPremultipliedAlpha,d=this.__glw.getRawContextAsWebGL2(),m=d.createTexture(),v=this.__registerResource(m);this.__glw.bindTexture2D(0,m);var p=f?Math.max(Math.log2(r),Math.log2(o)):1;return d.texStorage2D(w.CbE,p,n.index,r,o),d.texSubImage2D(d.TEXTURE_2D,0,0,0,i.index,a.index,e),this.__createTextureInner(d,l,u,s,c,h,r,o,_,f),{textureHandle:v,samplerHandle:-1}},G.__createTextureInner=function(e,t,n,r,o,i,a,s,c,l){e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,t.index),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,n.index),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r.index),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,o.index),u.k.isPowerOfTwoTexture(a,s)&&(c&&this.__glw.webgl2ExtTFA&&e.texParameteri(e.TEXTURE_2D,this.__glw.webgl2ExtTFA.TEXTURE_MAX_ANISOTROPY_EXT,4),l&&1!==s&&1!==a&&e.generateMipmap(e.TEXTURE_2D)),this.__glw.unbindTexture2D(0)},G.createTextureFromHTMLImageElement=function(e,t){t.level;var n=t.internalFormat,r=t.width,o=t.height,i=(t.border,t.format),a=t.type,s=t.magFilter,c=t.minFilter,l=t.wrapS,u=t.wrapT,f=t.generateMipmap,_=t.anisotropy,h=t.isPremultipliedAlpha,d=this.__glw.getRawContextAsWebGL2(),m=d.createTexture(),v=this.__registerResource(m);this.__glw.bindTexture2D(0,m);var p=f?Math.max(Math.log2(r),Math.log2(o)):1;return d.texStorage2D(w.CbE,p,n.index,r,o),d.texSubImage2D(d.TEXTURE_2D,0,0,0,i.index,a.index,e),this.__createTextureInner(d,l,u,s,c,h,r,o,_,f),v},G.createTextureFromTypedArray=function(e,t){t.level;var n=t.internalFormat,r=t.width,o=t.height,i=(t.border,t.format),a=t.type,s=t.magFilter,c=t.minFilter,l=t.wrapS,u=t.wrapT,f=t.generateMipmap,_=t.anisotropy,h=t.isPremultipliedAlpha,d=this.__glw.getRawContextAsWebGL2(),m=d.createTexture(),v=this.__registerResource(m);this.__glw.bindTexture2D(0,m);var p=f?Math.max(Math.log2(r),Math.log2(o)):1;return d.texStorage2D(w.CbE,p,n.index,r,o),d.texSubImage2D(d.TEXTURE_2D,0,0,0,r,o,i.index,a.index,e),this.__createTextureInner(d,l,u,s,c,h,r,o,_,f),v},G.createCompressedTexture=function(e,t,n){var r=n.magFilter,o=n.minFilter,a=n.wrapS,s=n.wrapT,c=n.anisotropy,l=this.__glw.getRawContext(),f=l.createTexture(),_=this.__registerResource(f);this.__glw.bindTexture2D(0,f);var h=t.index,d=!0,m=!1,v=void 0;try{for(var p,y=e[Symbol.iterator]();!(d=(p=y.next()).done);d=!0){var A=p.value;l.compressedTexImage2D(l.TEXTURE_2D,A.level,h,A.width,A.height,0,A.buffer)}}catch(e){m=!0,v=e}finally{try{d||null==y.return||y.return()}finally{if(m)throw v}}l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,r.index),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,a.index),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,s.index),o===i.d.LinearMipmapLinear&&(o=i.d.Linear),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,o.index);var b=e[0].width,g=e[0].height;return u.k.isPowerOfTwoTexture(b,g)&&c&&this.__glw.webgl2ExtTFA&&l.texParameteri(l.TEXTURE_2D,this.__glw.webgl2ExtTFA.TEXTURE_MAX_ANISOTROPY_EXT,4),this.__glw.unbindTexture2D(0),_},G.createCompressedTextureFromBasis=function(e,t){var n,r,o=t.border,a=(t.format,t.type,t.magFilter),s=t.minFilter,c=t.wrapS,l=t.wrapT,u=t.anisotropy,f=(t.isPremultipliedAlpha,this.__glw.getRawContext()),_=f.createTexture(),h=this.__registerResource(_);f.bindTexture(f.TEXTURE_2D,_);var d=f.getExtension("WEBGL_compressed_texture_s3tc");d&&(n=A.l.BC3,r=d.COMPRESSED_RGBA_S3TC_DXT5_EXT);var m=f.getExtension("WEBGL_compressed_texture_etc1");m&&(n=A.l.ETC1,r=m.COMPRESSED_RGB_ETC1_WEBGL);var v=f.getExtension("WEBGL_compressed_texture_atc");v&&(n=A.l.ATC_RGBA,r=v.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL);var p=f.getExtension("WEBGL_compressed_texture_etc");p&&(n=A.l.ETC2,r=p.COMPRESSED_RGBA8_ETC2_EAC);var y=f.getExtension("WEBGL_compressed_texture_pvrtc")||f.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");y&&(n=A.l.PVRTC1_RGBA,r=y.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG);var b=f.getExtension("WEBGL_compressed_texture_astc");b&&(n=A.l.ASTC,r=b.COMPRESSED_RGBA_ASTC_4x4_KHR);for(var g=e.getNumLevels(0),x=0;x=2?i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,i.NEAREST_MIPMAP_NEAREST):i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.NEAREST)):(e>=2?i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,i.LINEAR_MIPMAP_LINEAR):i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_CUBE_MAP,i.TEXTURE_MAG_FILTER,i.LINEAR));for(var c=function(e,t,a){if(e.hdriFormat===d.c.HDR_LINEAR){var s=o.__glw.getRawContextAsWebGL2();s.texImage2D(t,a,s.RGB32F,e.width,e.height,0,s.RGB,s.FLOAT,e.dataFloat)}else R(e,HTMLImageElement)||R(e,HTMLCanvasElement)?i.texImage2D(t,a,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,e):i.texImage2D(t,a,i.RGBA,n/Math.pow(2,a),r/Math.pow(2,a),0,i.RGBA,i.UNSIGNED_BYTE,e)},l=0;l=2)m.texParameteri(m.TEXTURE_CUBE_MAP,m.TEXTURE_MIN_FILTER,c.index),m.texParameteri(m.TEXTURE_CUBE_MAP,m.TEXTURE_MAG_FILTER,a.index);else{var T=c;c===i.d.LinearMipmapLinear&&(T=i.d.Linear),m.texParameteri(m.TEXTURE_CUBE_MAP,m.TEXTURE_MIN_FILTER,T.index),m.texParameteri(m.TEXTURE_CUBE_MAP,m.TEXTURE_MAG_FILTER,a.index)}for(var C=0;C0&&void 0!==arguments[0]?arguments[0]:"rgba(0,0,0,1)",t=document.createElement("canvas");t.width=1,t.height=1;var n=t.getContext("2d");return n.fillStyle=e,n.fillRect(0,0,1,1),this.createCubeTexture(1,[{posX:t,negX:t,posY:t,negY:t,posZ:t,negZ:t}],1,1)},G.setWebGLTextureDirectly=function(e){var t=e;return this.__registerResource(t)},G.createTextureFromDataUri=function(e,t){var n=t.level,r=t.internalFormat,o=t.border,i=t.format,a=t.type,s=t.magFilter,c=t.minFilter,l=t.wrapS,u=t.wrapT,f=t.generateMipmap,_=t.anisotropy,h=t.isPremultipliedAlpha,d=this;return T((function(){return N(this,(function(t){return[2,new Promise((function(t){var m=new Image;e.match(/^data:/)||(m.crossOrigin="Anonymous"),m.onload=function(){var e=m.width,v=m.height,p=d.createTextureFromHTMLImageElement(m,{level:n,internalFormat:r,width:e,height:v,border:o,format:i,type:a,magFilter:s,minFilter:c,wrapS:l,wrapT:u,generateMipmap:f,anisotropy:_,isPremultipliedAlpha:h});t(p)},m.src=e}))]}))}))()},G.updateLevel0TextureAndGenerateMipmap=function(e,t,n){var r=n.width,o=n.height,i=n.format,a=n.type,s=this.getWebGLResource(e);this.__glw.bindTexture2D(0,s);var c=this.__glw.getRawContextAsWebGL2();c.texSubImage2D(c.TEXTURE_2D,0,0,0,r,o,i.index,a.index,t),c.generateMipmap(c.TEXTURE_2D),this.__glw.unbindTexture2D(0)},G.updateTexture=function(e,t,n){var r=n.level,o=(n.xoffset,n.yoffset,n.width),i=n.height,a=n.format,s=n.type,c=this.getWebGLResource(e);this.__glw.bindTexture2D(0,c);var l=this.__glw.getRawContextAsWebGL2();l.texSubImage2D(l.TEXTURE_2D,r,0,0,o,i,a.index,s.index,t),this.__glw.unbindTexture2D(0)},G.deleteFrameBufferObject=function(e){var t=this.getWebGLResource(e),n=this.__glw.getRawContext();null!=t&&(n.deleteFramebuffer(t),this.__webglResources.delete(e))},G.deleteRenderBuffer=function(e){var t=this.__glw.getRawContext(),n=this.getWebGLResource(e);t.deleteRenderbuffer(n),this.__webglResources.delete(e)},G.deleteTexture=function(e){var t=this.getWebGLResource(e),n=this.__glw.getRawContext();null!=t&&(n.deleteTexture(t),this.__webglResources.delete(e))},G.createDummyTexture=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"rgba(255,255,255,1)",t=document.createElement("canvas");t.width=1,t.height=1;var n=t.getContext("2d");return n.fillStyle=e,n.fillRect(0,0,1,1),this.createTextureFromImageBitmapData(t,{level:0,internalFormat:i.d.RGBA8,width:1,height:1,border:0,format:a.V.RGBA,type:c.r.UnsignedByte,magFilter:i.d.Nearest,minFilter:i.d.Nearest,wrapS:i.d.ClampToEdge,wrapT:i.d.ClampToEdge,generateMipmap:!1,anisotropy:!1,isPremultipliedAlpha:!1})},G.createDummyBlackTexture=function(){return this.__createDummyTextureInner("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg==")},G.createDummyWhiteTexture=function(){return this.__createDummyTextureInner("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5/hPwAIAgL/4d1j8wAAAABJRU5ErkJggg==")},G.createDummyNormalTexture=function(){return this.__createDummyTextureInner("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOsr///HwAGgAL+v1RumAAAAABJRU5ErkJggg==")},G.__createDummyTextureInner=function(e){var t=y.j.base64ToArrayBuffer(e);return this.createTextureFromTypedArray(new Uint8Array(t),{level:0,internalFormat:i.d.RGBA8,width:1,height:1,border:0,format:a.V.RGBA,type:c.r.UnsignedByte,magFilter:i.d.Nearest,minFilter:i.d.Nearest,wrapS:i.d.ClampToEdge,wrapT:i.d.ClampToEdge,generateMipmap:!1,anisotropy:!1,isPremultipliedAlpha:!1})},G.createUniformBuffer=function(e){var t=this.__glw.getRawContextAsWebGL2();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");var n=t.createBuffer(),r=this.__registerResource(n);return t.bindBuffer(t.UNIFORM_BUFFER,n),t.bufferData(t.UNIFORM_BUFFER,e,t.DYNAMIC_DRAW),t.bindBuffer(t.UNIFORM_BUFFER,null),r},G.updateUniformBuffer=function(e,t,n,r){var o=this.__glw.getRawContextAsWebGL2(),i=this.getWebGLResource(e);o.bindBuffer(o.UNIFORM_BUFFER,i),o.bufferSubData(o.UNIFORM_BUFFER,0,t,n,r),o.bindBuffer(o.UNIFORM_BUFFER,null)},G.bindUniformBlock=function(e,t,n){var r=this.__glw.getRawContextAsWebGL2();if(null==r)throw new Error("No WebGLRenderingContext set as Default.");var o=this.getWebGLResource(e),i=r.getUniformBlockIndex(o,t);r.uniformBlockBinding(o,i,n)},G.bindUniformBufferBase=function(e,t){var n=this.__glw.getRawContextAsWebGL2();if(null==n)throw new Error("No WebGLRenderingContext set as Default.");var r=this.getWebGLResource(t);n.bindBufferBase(n.UNIFORM_BUFFER,e,r)},G.deleteUniformBuffer=function(e){var t=this.__glw.getRawContext();null==t&&new Error("No WebGLRenderingContext set as Default.");var n=this.getWebGLResource(e);this.__webglResources.delete(e),t.deleteBuffer(n)},G.setupUniformBufferDataArea=function(e){var t=this.__glw.getRawContextAsWebGL2();null==t&&new Error("No WebGLRenderingContext set as Default.");var n=t.createBuffer(),r=this.__registerResource(n),o=this.__glw.getMaxConventionUniformBlocks(),i=this.__glw.getAlignedMaxUniformBlockSize(),a=new Float32Array(i*o/4);g.Is.exist(e)&&a.set(e.subarray(0,a.length)),t.bindBuffer(t.UNIFORM_BUFFER,n),t.bufferData(t.UNIFORM_BUFFER,a,t.DYNAMIC_DRAW,0,0);for(var s=0;s{n.d(t,{M:()=>P,Z:()=>R});var r,o,i,a,s,c,l,u,f,_,h=n(3650),d=n(6807),m=n(9856),v=n(4021),p=n(9197),y=n(178),A=n(2166),b=n(7416),g=n(3932),x=n(2535),I=n(5685),E=n(1811),w=n(678),S=n(6860);function T(e,t,n){(o!==e||i!==t)&&(n.blendEquationSeparate(e,t),o=e,i=t)}function C(e,t,n,r,o){(a!==e||s!==t||c!==n||l!==r)&&(o.blendFuncSeparate(e,t,n,r),a=e,s=t,c=n,l=r)}function P(e,t){if(null!=t.mesh)for(var n=t.mesh.getPrimitiveNumber(),r=0;r{n.d(t,{X:()=>C});var r=n(2166),o=n(4395),i=n(4543),a=n(2535),s=n(7102),c=n(5171),l=n(9856),u=n(8118),f=n(4021),_=n(7416),h=n(3932),d=n(1410),m=n(429),v=n(6807),p=n(6383),y=n(9977),A=n(3279),b=n(9481),g=n(6174),x=n(1274),I=n(9807),E=n(178),w=n(9197),S=n(4654),T=n(2603),C=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__webglResourceRepository=r.x.getInstance(),this.__dataTextureUid=f.F.InvalidCGAPIResourceUid,this.__dataUBOUid=f.F.InvalidCGAPIResourceUid,this.__lastShader=f.F.InvalidCGAPIResourceUid,this.__lastRenderPassTickCount=-1,this._totalSizeOfGPUShaderDataStorageExceptMorphData=0,this.__latestPrimitivePositionAccessorVersions=[]}var t=e.prototype;return t.setupShaderForMaterial=function(t){var n=r.x.getInstance().currentWebGLContextWrapper,o=t._createProgram(e.getVertexShaderMethodDefinitions_dataTexture(),e.__getShaderProperty,n.isWebGL2);return t._setupBasicUniformsLocations(),t._setUniformLocationsOfMaterialNodes(!1),t._setupAdditionalUniformLocations(I.Z.getPointSpriteShaderSemanticsInfoArray(),!1),e.__globalDataRepository._setUniformLocationsForDataTextureModeOnly(t._shaderProgramUid),o},t._reSetupShaderForMaterialBySpector=function(t,n,r){var o=t._createProgramByUpdatedSources(n,r);return t._setupBasicUniformsLocations(),t._setUniformLocationsOfMaterialNodes(!1),t._setupAdditionalUniformLocations(I.Z.getPointSpriteShaderSemanticsInfoArray(),!1),e.__globalDataRepository._setUniformLocationsForDataTextureModeOnly(t._shaderProgramUid),o},t.$load=function(t){var n=t.mesh;if(w.Is.not.exist(n))l.$.alertNoMeshSet(t);else if(e.__currentComponentSIDs=e.__globalDataRepository.getValue(_.f5.CurrentComponentSIDs,0),I.Z.isMaterialsSetup(t)||(0,I.M)(this,t),!this.isMeshSetup(n)){this.deleteDataTexture(),I.Z.updateVBOAndVAO(n);for(var r=n.getPrimitiveNumber(),o=0;ou&&console.warn("The buffer size exceeds the size of the data texture.");var m=new Float32Array(n.getArrayBuffer(),l,d/4);this.__webglResourceRepository.updateTexture(this.__dataTextureUid,m,{level:0,xoffset:0,yoffset:0,width:o.B.bufferWidthLength,height:h,format:i.V.RGBA,type:a.r.Float}),e.__isDebugOperationToDataTextureBufferDone||(x.Kf.downloadTypedArray("Rhodonite_dataTextureBuffer.bin",m),e.__isDebugOperationToDataTextureBufferDone=!0)}else{var v,p=t.getBuffer(c.$.GPUVertexData);new ArrayBuffer(0),w.Is.exist(p)&&(p.takenSizeInByte,p.getArrayBuffer());var A=t.getBuffer(c.$.GPUVertexData),b=0;w.Is.exist(A)&&(b=A.takenSizeInByte);var g=new ArrayBuffer(0);w.Is.exist(A)&&(g=A.getArrayBuffer());var I=n.takenSizeInByte-l,E=4*(o.B.bufferWidthLength-I/4/4%o.B.bufferWidthLength)*4,S=x.Kf.concatArrayBuffers2({finalSize:u,srcs:[n.getArrayBuffer(),g],srcsCopySize:[I+E,b],srcsOffset:[l,0]});I+E+b>u&&console.warn("The buffer size exceeds the size of the data texture."),v=new Float32Array(S),y.D.totalSizeOfGPUShaderDataStorageExceptMorphData=n.takenSizeInByte+E,this.__dataTextureUid=this.__webglResourceRepository.createTextureFromTypedArray(v,{level:0,internalFormat:s.d.RGBA32F,width:o.B.bufferWidthLength,height:o.B.bufferHeightLength,border:0,format:i.V.RGBA,type:a.r.Float,magFilter:s.d.Nearest,minFilter:s.d.Nearest,wrapS:s.d.Repeat,wrapT:s.d.Repeat,generateMipmap:!1,anisotropy:!1,isPremultipliedAlpha:!0})}}},t.deleteDataTexture=function(){null!=this.__dataTextureUid&&(this.__webglResourceRepository.deleteTexture(this.__dataTextureUid),this.__dataTextureUid=f.F.InvalidCGAPIResourceUid)},t.common_$prerender=function(){this.__createAndUpdateDataTexture(),this.__createAndUpdateUBO(),this.__lightComponents=p.C.getComponentsWithType(S.r)},t.__isUboUse=function(){return this.__webglResourceRepository.currentWebGLContextWrapper.isWebGL2&&y.D.isUboEnabled},t.__createAndUpdateUBO=function(){if(this.__isUboUse()){var e=this.__webglResourceRepository.currentWebGLContextWrapper,t=e.getAlignedMaxUniformBlockSize(),n=e.getMaxConventionUniformBlocks(),r=o.B.getInstance().getBuffer(c.$.GPUInstanceData);if(this.__dataUBOUid===f.F.InvalidCGAPIResourceUid)this.__dataUBOUid=this.__webglResourceRepository.setupUniformBufferDataArea(new Float32Array(r.getArrayBuffer()));else{var i=new Float32Array(r.getArrayBuffer());this.__webglResourceRepository.updateUniformBuffer(this.__dataUBOUid,i,0,t*n/4)}}},t.attachGPUData=function(e){},t.attachGPUDataInner=function(e,t){},t.attachShaderProgram=function(e){var t=e._shaderProgramUid;if(t!==this.__lastShader){var n=this.__webglResourceRepository.currentWebGLContextWrapper.getRawContext(),r=this.__webglResourceRepository.getWebGLResource(t);n.useProgram(r),this.__lastShader=t}},t.attachVertexData=function(e,t,n,r){},t.attachVertexDataInner=function(e,t,n,r,o){var i=t.vertexHandles,a=r.getRawContext(),s=this.__webglResourceRepository.getWebGLResource(e.getVaoUids(n));if(null!=s)r.bindVertexArray(s);else{this.__webglResourceRepository.setVertexDataToPipeline(i,t,e._variationVBOUid);var c=this.__webglResourceRepository.getWebGLResource(i.iboHandle);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,c)}},t.__setCurrentComponentSIDsForEachRenderPass=function(t,n,r){if(r){var o=E.x.getInstance().getModule("xr").WebXRSystem.getInstance(),i=-1;o.isWebXRMode&&(i=o.isMultiView()?o._getCameraComponentSIDAt(0):o._getCameraComponentSIDAt(n)),e.__currentComponentSIDs._v[g.z.CameraComponentTID]=i}else{var a=t.cameraComponent;null==a&&(a=p.C.getComponent(A.M,A.M.current)),e.__currentComponentSIDs._v[g.z.CameraComponentTID]=a?a.componentSID:-1}},t.__setCurrentComponentSIDsForEachEntity=function(t,n,r){var o=r.tryToGetSkeletal();if(o){var i=0;o.componentSID 0.5) ? true : false;\n }\n\n bool get_isBillboard(float instanceId) {\n int index = ").concat(d.w.getLocationOffsetOfMemberOfComponent(m.a,"isBillboard")," * 4 + int(instanceId);\n float isBillboard = fetchScalarNo16BytesAligned(index);\n return (isBillboard > 0.5) ? true : false;\n }\n\n#ifdef RN_IS_VERTEX_SHADER\n #ifdef RN_IS_MORPHING\n vec3 get_position(float vertexId, vec3 basePosition) {\n vec3 position = basePosition;\n int scalar_idx = 3 * int(vertexId);\n for (int i=0; i<").concat(y.D.maxVertexMorphNumberInShader,"; i++) {\n\n int basePosIn4bytes = u_dataTextureMorphOffsetPosition[i] * 4 + scalar_idx;\n vec3 addPos = fetchVec3No16BytesAligned(basePosIn4bytes);\n\n position += addPos * u_morphWeights[i];\n if (i == u_morphTargetNumber-1) {\n break;\n }\n }\n\n return position;\n }\n #endif\n#endif\n")},e.__getShaderProperty=function(t,n,r,o,i){var s,c=n.compositionType.getGlslStr(n.componentType),l=h.d.isTexture(n.compositionType),u=n.semantic.str.replace(".","_"),f="",_=n.compositionType.getGlslStr(n.componentType),d="";n.arrayLength&&(d="[".concat(n.arrayLength,"]")),(n.needUniformInDataTextureMode||l)&&(f=" uniform ".concat(_," u_").concat(u).concat(d,";\n"));var m,v=n.compositionType.getVec4SizeOfProperty(),p=n.compositionType.getNumberOfComponents(),y=e.getOffsetOfPropertyInShader(o,r,t);-1===y&&console.error("Could not get the location offset of the property.");var A=v*(null!==(m=n.arrayLength)&&void 0!==m?m:1);if(s="int vec4_idx = ".concat(y," + ").concat(A," * instanceId;\n"),h.d.isArray(n.compositionType)){var b,g=p*(null!==(b=n.arrayLength)&&void 0!==b?b:1);s="int vec4_idx = ".concat(y," + ").concat(A," * instanceId + ").concat(v," * idxOfArray;\n"),s+="int scalar_idx = ".concat(4*y," + ").concat(g," * instanceId + ").concat(p," * idxOfArray;\n")}var x="";n.componentType===a.r.Int&&n.compositionType!==h.d.Scalar&&(x="i");var I="";if(l||n.needUniformInDataTextureMode){if(!l&&n.needUniformInDataTextureMode){if(!i&&n.arrayLength)return"\n".concat(f,"\n");var E="";return n.arrayLength&&(E="[idxOfArray]"),"".concat(f,"\n").concat(c," get_").concat(u,"(highp float _instanceId, const int idxOfArray) {\n return u_").concat(u).concat(E,";\n}\n")}return f}I+="\n".concat(c," get_").concat(u,"(highp float _instanceId, const int idxOfArray) {\n int instanceId = int(_instanceId);\n ").concat(s,"\n ");var w="".concat(f,"\n").concat(I);switch(n.compositionType){case h.d.Vec4:case h.d.Vec4Array:w+=" highp vec4 val = fetchElement(vec4_idx);\n";break;case h.d.Vec3:w+=" vec4 col0 = fetchElement(vec4_idx);\n",w+=" highp ".concat(x,"vec3 val = ").concat(x,"vec3(col0.xyz);");break;case h.d.Vec3Array:w+=" vec3 val = fetchVec3No16BytesAligned(scalar_idx);\n";break;case h.d.Vec2:w+=" highp vec4 col0 = fetchElement(vec4_idx);\n",w+=" highp ".concat(x,"vec2 val = ").concat(x,"vec2(col0.xy);");break;case h.d.Vec2Array:w+=" highp vec2 val = fetchVec2No16BytesAligned(scalar_idx);\n";break;case h.d.Scalar:w+=" vec4 col0 = fetchElement(vec4_idx);\n",n.componentType===a.r.Int?w+=" int val = int(col0.x);":n.componentType===a.r.Bool?w+=" bool val = bool(col0.x);":w+=" float val = col0.x;";break;case h.d.ScalarArray:w+=" float col0 = fetchScalarNo16BytesAligned(scalar_idx);\n",n.componentType===a.r.Int?w+=" int val = int(col0);":n.componentType===a.r.Bool?w+=" bool val = bool(col0);":w+=" float val = col0;";break;case h.d.Mat4:case h.d.Mat4Array:w+=" mat4 val = fetchMat4(vec4_idx);\n";break;case h.d.Mat3:w+=" mat3 val = fetchMat3(vec4_idx);\n";break;case h.d.Mat3Array:w+=" mat3 val = fetchMat3No16BytesAligned(scalar_idx);\n";break;case h.d.Mat2:w+=" mat2 val = fetchMat2(vec4_idx);\n";break;case h.d.Mat2Array:w+=" mat2 val = fetchMat2No16BytesAligned(scalar_idx);\n";break;default:w+=""}return w+"\n return val;\n}\n"},e.getOffsetOfPropertyInShader=function(e,t,n){return e?b.$.getInstance().getLocationOffsetOfProperty(t):T.r.getLocationOffsetOfMemberOfMaterial(n,t)},e.getInstance=function(){return this.__instance||(this.__instance=new e),this.__instance},e}();C.__globalDataRepository=b.$.getInstance(),C.__isDebugOperationToDataTextureBufferDone=!0},733:(e,t,n)=>{n.d(t,{I:()=>I});var r=n(2166),o=n(8118),i=n(4021),a=n(7416),s=n(6383),c=n(4654),l=n(9977),u=n(4543),f=n(2535),_=n(7102),h=n(6807),d=n(3932),m=n(678),v=n(4395),p=n(5685),y=n(5171),A=n(9481),b=n(1274),g=n(9807),x=n(9197),I=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__webglResourceRepository=r.x.getInstance(),this.__dataTextureUid=i.F.InvalidCGAPIResourceUid,this.__lastShader=-1,this.__lastRenderPassTickCount=-1,this.__latestPrimitivePositionAccessorVersions=[]}var t=e.prototype;return t.setupShaderForMaterial=function(t){var n=r.x.getInstance().currentWebGLContextWrapper,o=t._createProgram(e.__vertexShaderMethodDefinitions_uniform,a.f5.getShaderProperty,n.isWebGL2);t._setupBasicUniformsLocations(),t._setUniformLocationsOfMaterialNodes(!0);var i=e.componentMatrices,s=g.Z.getPointSpriteShaderSemanticsInfoArray();return t._setupAdditionalUniformLocations(i.concat(s),!0),e.__globalDataRepository._setUniformLocationsForUniformModeOnly(t._shaderProgramUid),o},t._reSetupShaderForMaterialBySpector=function(t,n,r){var o=t._createProgramByUpdatedSources(n,r);t._setupBasicUniformsLocations(),t._setUniformLocationsOfMaterialNodes(!0);var i=e.componentMatrices,a=g.Z.getPointSpriteShaderSemanticsInfoArray();return t._setupAdditionalUniformLocations(i.concat(a),!0),e.__globalDataRepository._setUniformLocationsForUniformModeOnly(t._shaderProgramUid),o},t.$load=function(e){var t=e.mesh;if(x.Is.exist(t)&&(g.Z.isMaterialsSetup(e)||(0,g.M)(this,e),!this.isMeshSetup(t))){g.Z.updateVBOAndVAO(t);for(var n=t.getPrimitiveNumber(),r=0;rv.B.bufferHeightLength&&console.warn("The buffer size exceeds the size of the data texture.");var t=v.B.bufferWidthLength*v.B.bufferHeightLength*4*4,n=b.Kf.concatArrayBuffers2({finalSize:t,srcs:[e.getArrayBuffer()],srcsCopySize:[e.takenSizeInByte],srcsOffset:[0]}),r=new Float32Array(n);this.__dataTextureUid=this.__webglResourceRepository.createTextureFromTypedArray(r,{level:0,internalFormat:_.d.RGBA32F,width:v.B.bufferWidthLength,height:v.B.bufferHeightLength,border:0,format:u.V.RGBA,type:f.r.Float,magFilter:_.d.Nearest,minFilter:_.d.Nearest,wrapS:_.d.Repeat,wrapT:_.d.Repeat,generateMipmap:!1,anisotropy:!1,isPremultipliedAlpha:!0})}},t.attachGPUData=function(e){},t.attachShaderProgram=function(e){},t.attachVertexData=function(e,t,n,r){},t.attachVertexDataInner=function(e,t,n,r,o){var i=t.vertexHandles,a=this.__webglResourceRepository.getWebGLResource(e.getVaoUidsByPrimitiveUid(n)),s=r.getRawContext();if(null!=a)r.bindVertexArray(a);else{this.__webglResourceRepository.setVertexDataToPipeline(i,t,o);var c=this.__webglResourceRepository.getWebGLResource(i.iboHandle);s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,c)}},t.dettachVertexData=function(e){var t=e.getRawContext();e.bindVertexArray&&e.bindVertexArray(null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),t.bindBuffer(t.ARRAY_BUFFER,null)},t.common_$render=function(e,t,n){"undefined"!=typeof spector&&spector.setMarker("| | Uniform:$render#");for(var r=this.__webglResourceRepository.currentWebGLContextWrapper,o=r.getRawContext(),i=g.Z.isVrMainPass(t),a=g.Z.getDisplayNumber(i),s=0;s{n.d(t,{Z:()=>a});var r=n(7042),o=n(733),i=n(1623);const a=function(e){return r.V.isDataTextureApproach(e)?i.X.getInstance():(r.V.isUniformApproach(e),o.I.getInstance())}},3237:(e,t,n)=>{n.r(t),n.d(t,{default:()=>u});var r=n(6014),o=n(8808),i=n(2129),a=n(2166),s=n(733),c=n(1623),l=Object.freeze({getRenderingStrategy:r.Z,GLSLShader:o.m,WebGLContextWrapper:i.d,WebGLResourceRepository:a.x,WebGLStrategyUniform:s.I,WebGLStrategyDataTexture:c.X});const u=l;(0,eval)("this").RnWebGL=l},8808:(e,t,n)=>{n.d(t,{m:()=>l});var r=n(7042),o=n(7416),i=n(6221),a=n(2166),s=n(2612);function c(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"";return e},e.getStringFromShaderAnyDataType=function(e){return t=e,(null!=(n=o.wy)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](t):t instanceof n)?"u_"+e.str:i.T.isInstanceOfVertexAttributeClass(e)?e.shaderStr:e;var t,n},t=e,l=[{key:"glslMainBegin",get:function(){return"\nvoid main() {\n"}},{key:"glslMainEnd",get:function(){return"\n}\n "}}],(n=[{key:"glsl_fragColor",get:function(){var e=this.__webglResourceRepository;return null!=e.currentWebGLContextWrapper&&e.currentWebGLContextWrapper.isWebGL2?"":"gl_FragColor = rt0;\n"}},{key:"glsl_textureCube",get:function(){return this.__webglResourceRepository.currentWebGLContextWrapper.isWebGL2?"texture":"textureCube"}},{key:"prerequisites",get:function(){return"uniform float u_materialSID;\n"}},{key:"mainPrerequisites",get:function(){var e=s.Z.currentProcessApproach;return r.V.isDataTextureApproach(e)?"\n":"\n "}}])&&c(t.prototype,n),l&&c(t,l),e}()},4387:(e,t,n)=>{n.d(t,{I:()=>l});var r=n(8808);function o(e,t){for(var n=0;n{n.d(t,{$:()=>l});var r=n(8808);function o(e,t){for(var n=0;n{n.d(t,{i:()=>u});var r=n(8808),o=n(2535);function i(e,t){for(var n=0;n{n.d(t,{x:()=>u});var r=n(8808),o=n(3740);function i(e,t){for(var n=0;n{n.d(t,{p:()=>l});var r=n(8808);function o(e,t){for(var n=0;n{n.d(t,{S:()=>l});var r=n(8808);function o(e,t){for(var n=0;n{n.d(t,{$:()=>l});var r=n(8808);function o(e,t){for(var n=0;n{n.d(t,{e:()=>l});var r=n(8808);function o(e,t){for(var n=0;n{n.d(t,{N:()=>w}),new Uint8Array([0]);const r=[171,75,84,88,32,50,48,187,13,10,26,10];var o,i,a,s,c,l,u,f,_;(_=o||(o={}))[_.NONE=0]="NONE",_[_.BASISLZ=1]="BASISLZ",_[_.ZSTD=2]="ZSTD",_[_.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(i||(i={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(a||(a={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(s||(s={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(c||(c={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(l||(l={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(u||(u={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(f||(f={}));class h{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=o.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:i.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:a.UNSPECIFIED,colorPrimaries:s.SRGB,transferFunction:s.SRGB,flags:l.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}}class d{constructor(e,t,n,r){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=r,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let r=0;for(;this._dataView.getUint8(this._offset)!==t&&re.arrayBuffer())).then((e=>WebAssembly.instantiate(e,g))).then(this._init):WebAssembly.instantiate(Buffer.from(I,"base64"),g).then(this._init),y)}_init(e){A=e.instance,g.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!A)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,r=A.exports.malloc(n);b.set(e,r),t=t||Number(A.exports.ZSTD_findDecompressedSize(r,n));const o=A.exports.malloc(t),i=A.exports.ZSTD_decompress(o,t,r,n),a=b.slice(o,o+i);return A.exports.free(r),A.exports.free(o),a}}const I="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYw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ACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0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AMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwC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DAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQI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sDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpA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H8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEE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AAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ";var E="ETC1_RGB",w=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"undefined"==typeof MSC_TRANSCODER&&console.error("Failed to call MSC_TRANSCODER() function. Please check to import msc_basis_transcoder.js."),this.__mscTranscoderPromise=this.__loadMSCTranscoder()}var t=e.prototype;return t.transcode=function(t){var n=this,r=this.__parse(t);if(r.pixelDepth>0)throw new Error("Only 2D textures are currently supported");if(r.layerCount>1)throw new Error("Array textures are not currently supported");if(r.faceCount>1)throw new Error("Cube textures are not currently supported");return r.supercompressionScheme===o.ZSTD?(null==e.__zstdDecoder&&(e.__zstdDecoder=new x),e.__zstdDecoder.init().then((function(){return n.__mscTranscoderPromise.then((function(){return n.__transcodeData(r)}))}))):this.__mscTranscoderPromise.then((function(){return n.__transcodeData(r)}))},t.__loadMSCTranscoder=function(){return new Promise((function(t){e.__mscTranscoderModule&&t(),MSC_TRANSCODER().then((function(n){n.initTranscoders(),e.__mscTranscoderModule=n,t()}))}))},t.__getDeviceDependentParameters=function(e){var t,n,r=v.F.getWebGLResourceRepository().currentWebGLContextWrapper,o=r.webgl2ExtCTAstc||r.webgl1ExtCTAstc,i=r.webgl2ExtCTBptc||r.webgl1ExtCTBptc,a=r.webgl2ExtCTS3tc||r.webgl1ExtCTS3tc,s=r.webgl2ExtCTPvrtc||r.webgl1ExtCTPvrtc,c=r.webgl2ExtCTEtc||r.webgl1ExtCTEtc,l=r.webgl2ExtCTEtc1||r.webgl1ExtCTEtc1;return o?(t="ASTC_4x4_RGBA",n=p.b.ASTC_RGBA_4x4):i?(t="BC7_RGBA",n=p.b.BPTC_RGBA):a?e?(t="BC3_RGBA",n=p.b.S3TC_RGBA_DXT5):(t="BC1_RGB",n=p.b.S3TC_RGB_DXT1):s?e?(t="PVRTC1_4_RGBA",n=p.b.PVRTC_RGBA_4BPPV1):(t="PVRTC1_4_RGB",n=p.b.PVRTC_RGB_4BPPV1):c?e?(t="ETC2_RGBA",n=p.b.ETC2_RGBA8_EAC):(t=E,n=p.b.ETC2_RGB8):l?(t=E,n=p.b.ETC1_RGB):(t="RGBA32",n=p.b.RGBA8_EXT),{transcodeTargetStr:t,compressionTextureType:n}},t.__parse=function(e){return function(e){const t=new Uint8Array(e.buffer,e.byteOffset,r.length);if(t[0]!==r[0]||t[1]!==r[1]||t[2]!==r[2]||t[3]!==r[3]||t[4]!==r[4]||t[5]!==r[5]||t[6]!==r[6]||t[7]!==r[7]||t[8]!==r[8]||t[9]!==r[9]||t[10]!==r[10]||t[11]!==r[11])throw new Error("Missing KTX 2.0 identifier.");const n=new h,o=17*Uint32Array.BYTES_PER_ELEMENT,i=new d(e,r.length,o,!0);n.vkFormat=i._nextUint32(),n.typeSize=i._nextUint32(),n.pixelWidth=i._nextUint32(),n.pixelHeight=i._nextUint32(),n.pixelDepth=i._nextUint32(),n.layerCount=i._nextUint32(),n.faceCount=i._nextUint32();const a=i._nextUint32();n.supercompressionScheme=i._nextUint32();const s=i._nextUint32(),c=i._nextUint32(),l=i._nextUint32(),u=i._nextUint32(),f=i._nextUint64(),_=i._nextUint64(),v=new d(e,r.length+o,3*a*8,!0);for(let t=0;t>x),E=Math.max(1,i>>x),w=new h.ImageInfo(m,I,E,x),S=t.levels[x].levelData,T=t.levels[x].uncompressedByteLength,C=w.numBlocksX*w.numBlocksY*u.bytesPlane[0];t.supercompressionScheme===o.ZSTD&&(S=e.__zstdDecoder.decode(S,T));for(var P=0,R=x*Math.max(t.layerCount,1)*s*Math.max(t.pixelDepth,1),D=0;D0?M.rgbSliceByteLength:0,w.alphaByteLength=M.alphaSliceByteLength,N=L.transcodeImage(A,B,w,0,!1)}if(null!=(null==N?void 0:N.transcodedImage)){var F=N.transcodedImage.get_typed_memory_view().slice();N.transcodedImage.delete();var G={level:x,width:I,height:E,buffer:F};b.push(G)}}}return g},t.__hasAlpha=function(e,t){return 1===t?e.samples[0].channelID===f.RGBA:2===e.samples.length&&(e.samples[0].channelID===u.AAA||e.samples[1].channelID===u.AAA)},e.getInstance=function(){return this.__instance||(this.__instance=new e),this.__instance},e}()},6968:(e,t,n)=>{n.d(t,{RQ:()=>E,sz:()=>B,KA:()=>C,_0:()=>M});const r={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})},o={xAxis:0,yAxis:0,button:0,state:r.ComponentState.DEFAULT};class i{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===r.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(o)}updateFromComponent({xAxis:e,yAxis:t,button:n,state:o}){const{normalizedXAxis:i,normalizedYAxis:a}=function(e=0,t=0){let n=e,r=t;if(Math.sqrt(e*e+t*t)>1){const o=Math.atan2(t,e);n=Math.cos(o),r=Math.sin(o)}return{normalizedXAxis:.5*n+.5,normalizedYAxis:.5*r+.5}}(e,t);switch(this.componentProperty){case r.ComponentProperty.X_AXIS:this.value=this.states.includes(o)?i:.5;break;case r.ComponentProperty.Y_AXIS:this.value=this.states.includes(o)?a:.5;break;case r.ComponentProperty.BUTTON:this.value=this.states.includes(o)?n:0;break;case r.ComponentProperty.STATE:this.valueNodeProperty===r.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(o):this.value=this.states.includes(o)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class a{constructor(e,t){if(!(e&&t&&t.visualResponses&&t.gamepadIndices&&0!==Object.keys(t.gamepadIndices).length))throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach((e=>{const n=new i(t.visualResponses[e]);this.visualResponses[e]=n})),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:r.ComponentState.DEFAULT,button:void 0!==this.gamepadIndices.button?0:void 0,xAxis:void 0!==this.gamepadIndices.xAxis?0:void 0,yAxis:void 0!==this.gamepadIndices.yAxis?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=r.ComponentState.DEFAULT,void 0!==this.gamepadIndices.button&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||1===this.values.button?this.values.state=r.ComponentState.PRESSED:(t.touched||this.values.button>r.ButtonTouchThreshold)&&(this.values.state=r.ComponentState.TOUCHED)}void 0!==this.gamepadIndices.xAxis&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===r.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>r.AxisTouchThreshold&&(this.values.state=r.ComponentState.TOUCHED)),void 0!==this.gamepadIndices.yAxis&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===r.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>r.AxisTouchThreshold&&(this.values.state=r.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach((e=>{e.updateFromComponent(this.values)}))}}class s{constructor(e,t,n){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=n,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach((e=>{const t=this.layoutDescription.components[e];this.components[e]=new a(e,t)})),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach((t=>{e.push(t.data)})),e}updateFromGamepad(){Object.values(this.components).forEach((e=>{e.updateFromGamepad(this.xrInputSource.gamepad)}))}}async function c(e){const t=await fetch(e);if(t.ok)return t.json();throw new Error(t.statusText)}async function l(e,t,n=null,r=!0){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const o=await async function(e){if(!e)throw new Error("No basePath supplied");return await c(`${e}/profilesList.json`)}(t);let i;if(e.profiles.some((e=>{const n=o[e];return n&&(i={profileId:e,profilePath:`${t}/${n.path}`,deprecated:!!n.deprecated}),!!i})),!i){if(!n)throw new Error("No matching profile name found");const e=o[n];if(!e)throw new Error(`No matching profile name found and default profile "${n}" missing.`);i={profileId:n,profilePath:`${t}/${e.path}`,deprecated:!!e.deprecated}}const a=await c(i.profilePath);let s;if(r){let t;if(t="any"===e.handedness?a.layouts[Object.keys(a.layouts)[0]]:a.layouts[e.handedness],!t)throw new Error(`No matching handedness, ${e.handedness}, in profile ${i.profileId}`);t.assetPath&&(s=i.profilePath.replace("profile.json",t.assetPath))}return{profile:a,assetPath:s}}var u=n(5936),f=n(9645),_=n(9197),h=n(5233),d=n(6860),m=n(1274),v=n(988),p=n(2863);function y(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function A(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){y(i,r,o,a,s,"next",e)}function s(e){y(i,r,o,a,s,"throw",e)}a(void 0)}))}}var b=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{n.d(t,{X:()=>g});var r=n(4021),o=n(6860),i=n(8289),a=n(6264),s=n(425),c=n(178),l=n(6968),u=n(9197),f=n(988),_=n(8776),h=n(3764),d=n(524),m=n(1442);function v(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function p(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){v(i,r,o,a,s,"next",e)}function s(e){v(i,r,o,a,s,"throw",e)}a(void 0)}))}}function y(e,t){for(var n=0;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0},v.__setWebXRMode=function(e){this.__isWebXRMode=e,this.__glw._isWebXRMode=e},v._getViewMatrixAt=function(e){return 0===e?this.leftViewMatrix:this.rightViewMatrix},v._getProjectMatrixAt=function(e){return 0===e?this.leftProjectionMatrix:this.rightProjectionMatrix},v._getViewportAt=function(e){return 0===e?this._getLeftViewport():this._getRightViewport()},v._getLeftViewport=function(){return a.Lt.fromCopyArray([0,0,this.__canvasWidthForVR/2,this.__canvasHeightForVR])},v._getRightViewport=function(){return this.__multiviewFramebufferHandle>0?a.Lt.fromCopyArray([0,0,this.__canvasWidthForVR/2,this.__canvasHeightForVR]):a.Lt.fromCopyArray([this.__canvasWidthForVR/2,0,this.__canvasWidthForVR/2,this.__canvasHeightForVR])},v._setValuesToGlobalDataRepository=function(){this.__leftCameraEntity.getCamera().projectionMatrix=this.leftProjectionMatrix,this.__rightCameraEntity.getCamera().projectionMatrix=this.rightProjectionMatrix,this.__leftCameraEntity.getCamera().setValuesToGlobalDataRepository(),this.__rightCameraEntity.getCamera().setValuesToGlobalDataRepository()},v._getCameraWorldPositionAt=function(e){var t,n=null===(t=this.__xrViewerPose)||void 0===t?void 0:t.views[e];if(u.Is.exist(n)){var r=n.transform.position,i=this.__defaultPositionInLocalSpaceMode,a=this.__viewerTranslate,s=o.P.add(o.P.fromCopyArray([r.x,r.y,r.z]),i);return o.P.fromCopyArray([(s.x+a.x)*this.__viewerScale.x,(s.y+a.y)*this.__viewerScale.y,(s.z+a.z)*this.__viewerScale.z])}return this.__defaultPositionInLocalSpaceMode},v._getCameraComponentSIDAt=function(e){return 0===e?this.__leftCameraEntity.getCamera().componentSID:this.__rightCameraEntity.getCamera().componentSID},v._preRender=function(e,t){this.isWebXRMode&&this.__requestedToEnterWebXR&&null!=t&&(this.__updateView(t),this.__updateInputSources(t),(0,l.KA)(e,t,{viewerTranslate:this.__viewerTranslate,viewerScale:this.__viewerScale,viewerOrientation:this.__viewerOrientation,viewerAzimuthAngle:this.__viewerAzimuthAngle}))},v._postRender=function(){if(this.__isWebXRMode){var e=this.__glw.getRawContextAsWebGL2();if(this.__multiviewFramebufferHandle>0){var t=r.F.getWebGLResourceRepository();e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[e.DEPTH_STENCIL_ATTACHMENT]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.__xrSession.renderState.baseLayer.framebuffer);var n=t.getWebGLResource(this.__multiviewColorTextureHandle);this.__webglStereoUtil.blit(n,0,0,1,1,this.__canvasWidthForVR,this.__canvasHeightForVR)}}this.requestedToEnterWebVR},v.__onInputSourcesChange=function(e,t,n){var r=this;return p((function(){var o,i,a,s,c,f,_,h;return A(this,(function(d){switch(d.label){case 0:r.__xrInputSources.length=0,o=!0,i=!1,a=void 0,d.label=1;case 1:d.trys.push([1,6,7,8]),s=e.added[Symbol.iterator](),d.label=2;case 2:return(o=(c=s.next()).done)?[3,5]:(f=c.value,r.__xrInputSources.push(f),[4,(0,l.RQ)(f,r.__basePath,n)]);case 3:_=d.sent(),u.Is.exist(_)&&(r.__controllerEntities.push(_),r.__viewerEntity.getSceneGraph().addChild(_.getSceneGraph())),d.label=4;case 4:return o=!0,[3,2];case 5:return[3,8];case 6:return h=d.sent(),i=!0,a=h,[3,8];case 7:try{o||null==s.return||s.return()}finally{if(i)throw a}return[7];case 8:return t(r.__controllerEntities),[2]}}))}))()},v.__setCameraInfoFromXRViews=function(e){if(u.Is.not.exist(e))console.warn("xrViewerPose not exist");else{var t=e.views[0],n=e.views[1];if(!u.Is.not.exist(t)&&!u.Is.not.exist(n)){var r=e.transform.orientation;this.__viewerOrientation.x=r.x,this.__viewerOrientation.y=r.y,this.__viewerOrientation.z=r.z,this.__viewerOrientation.w=r.w;var a=i.e.fromCopyFloat32ArrayColumnMajor(null==t?void 0:t.transform.matrix),s=i.e.fromCopyFloat32ArrayColumnMajor(null==n?void 0:n.transform.matrix),c=this.__viewerScale.x,l=t.transform.position,_=f.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate),h=f.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate),d=o.P.fromCopyArray([l.x,l.y,l.z]),m=o.P.fromCopyArray([l.x,l.y,l.z]),v=f.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate).add(d),p=f.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate).add(m),y=(_.x+h.x)/2,A=(_.z+h.z)/2,b=(v.x+p.x)/2,g=(v.z+p.z)/2,x=this.__viewerEntity.getTransform();x.localPosition=o.P.fromCopyArray([y,0,A]),x.localScale=o.P.fromCopyArray([c,c,c]),x.localEulerAngles=o.P.fromCopyArray([0,this.__viewerAzimuthAngle.x,0]),a.translateY=v.y,a.translateX=v.x-b,a.translateZ=v.z-g,a.translateY+=d.y,a.translateX+=d.x,a.translateZ+=d.z,s.translateY=p.y,s.translateX=p.x-b,s.translateZ=p.z-g,s.translateY+=m.y,s.translateX+=m.x,s.translateZ+=m.z,this.__leftCameraEntity.getTransform().localMatrix=a,this.__rightCameraEntity.getTransform().localMatrix=s}}},v.__setupWebGLLayer=function(e,t){var n=this;return p((function(){var o,i,a,s;return A(this,(function(c){switch(c.label){case 0:return null==(i=null===(o=n.__glw)||void 0===o?void 0:o.getRawContextAsWebGL2())?[3,2]:[4,i.makeXRCompatible()];case 1:return c.sent(),n.__webglLayer=new window.XRWebGLLayer(e,i),a=n.__webglLayer,e.updateRenderState({baseLayer:a,depthNear:.01,depthFar:1e3}),s=r.F.getWebGLResourceRepository(),n.__canvasWidthForVR=a.framebufferWidth,n.__canvasHeightForVR=a.framebufferHeight,console.log(n.__canvasWidthForVR),console.log(n.__canvasHeightForVR),n.__multiviewFramebufferHandle,m.rFg._makeShaderInvalidateToAllMaterials(),s.resizeCanvas(n.__canvasWidthForVR,n.__canvasHeightForVR),n.__setWebXRMode(!0),t(),[3,3];case 2:console.error("WebGL context is not ready for WebXR."),c.label=3;case 3:return[2]}}))}))()},v.__updateView=function(e){this.__xrViewerPose=e.getViewerPose(this.__xrReferenceSpace),this.__setCameraInfoFromXRViews(this.__xrViewerPose)},v.__updateInputSources=function(e){var t=this;this.__xrInputSources.forEach((function(n,r){if(u.Is.exist(n.gripSpace)){var o=e.getPose(n.gripSpace,t.__xrReferenceSpace);if(u.Is.exist(o)){var a=t.__controllerEntities[r];if(u.Is.exist(a)){var s=i.e.fromCopyFloat32ArrayColumnMajor(o.transform.matrix),c=i.e.fromCopyMatrix44(s);c.translateY+=t.__defaultPositionInLocalSpaceMode.y,c.translateY+=t.__viewerTranslate.y,a.getTransform().localMatrix=c;var f=(0,l.sz)(n);u.Is.exist(f)?(0,l._0)(a,f):console.warn("motionController not found")}}}}))},e.getInstance=function(){return this.__instance||(this.__instance=new e),this.__instance},t=e,(n=[{key:"leftViewMatrix",get:function(){return this.__leftCameraEntity.getCamera().viewMatrix}},{key:"rightViewMatrix",get:function(){return this.__rightCameraEntity.getCamera().viewMatrix}},{key:"leftProjectionMatrix",get:function(){var e,t=null===(e=this.__xrViewerPose)||void 0===e?void 0:e.views[0];return i.e.fromCopyFloat32ArrayColumnMajor(u.Is.exist(t)?t.projectionMatrix:i.e.identity()._v)}},{key:"rightProjectionMatrix",get:function(){var e,t=null===(e=this.__xrViewerPose)||void 0===e?void 0:e.views[1];return i.e.fromCopyFloat32ArrayColumnMajor(u.Is.exist(t)?t.projectionMatrix:i.e.identity()._v)}},{key:"framebuffer",get:function(){var e,t;return this.__multiviewFramebufferHandle>0?r.F.getWebGLResourceRepository().getWebGLResource(this.__multiviewFramebufferHandle):null===(e=null===(t=this.__xrSession)||void 0===t?void 0:t.renderState.baseLayer)||void 0===e?void 0:e.framebuffer}},{key:"requestedToEnterWebXR",get:function(){return this.__requestedToEnterWebXR}},{key:"xrSession",get:function(){return this.__xrSession}},{key:"requestedToEnterWebVR",get:function(){return this.__requestedToEnterWebXR}},{key:"isWebXRMode",get:function(){return this.__isWebXRMode}},{key:"isReadyForWebXR",get:function(){return this.__isReadyForWebXR}}])&&y(t.prototype,n),e}()},6265:(e,t,n)=>{n.r(t),n.d(t,{default:()=>x});var r=n(875),o=n(524),i=n(8289),a=n(8776),s=n(3764),c=n(988),l=n(6860),u=n(9197),f=n(2879),_=n(4021),h=n(178),d=n(425);function m(e,t,n,r,o,i,a){try{var s=e[i](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,o)}function v(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){m(i,r,o,a,s,"next",e)}function s(e){m(i,r,o,a,s,"throw",e)}a(void 0)}))}}function p(e,t){for(var n=0;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]{n.d(t,{Z:()=>r});const r={version:"v0.11.3-0-g711e95b-dirty",branch:""}},6893:function(){(function(){function l(e){throw e}var r=void 0,t,aa=this;function v(e,t){var n,o=e.split("."),i=aa;!(o[0]in i)&&i.execScript&&i.execScript("var "+o[0]);for(;o.length&&(n=o.shift());)o.length||t===r?i=i[n]?i[n]:i[n]={}:i[n]=t}var y="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView,z;for(new(y?Uint8Array:Array)(256),z=0;256>z;++z)for(var B=z,ba=7,B=B>>>1;B;B>>>=1)--ba;var ca=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],C=y?new Uint32Array(ca):ca,a;if(aa.Uint8Array!==r)try{eval("String.fromCharCode.apply(null, new Uint8Array([0]));")}catch(e){String.fromCharCode.apply=(a=String.fromCharCode.apply,function(e,t){return a.call(String.fromCharCode,e,Array.prototype.slice.call(t))})}function D(e){var t,n,r,o,i,a,s,c,l,u,f=e.length,_=0,h=Number.POSITIVE_INFINITY;for(c=0;c_&&(_=e[c]),e[c]>=1;for(u=r<<16|c,l=a;lG;G++)switch(!0){case 143>=G:F.push([G+48,8]);break;case 255>=G:F.push([G-144+400,9]);break;case 279>=G:F.push([G-256+0,7]);break;case 287>=G:F.push([G-280+192,8]);break;default:l("invalid literal: "+G)}var fa=function(){function e(e){switch(!0){case 3===e:return[257,e-3,0];case 4===e:return[258,e-4,0];case 5===e:return[259,e-5,0];case 6===e:return[260,e-6,0];case 7===e:return[261,e-7,0];case 8===e:return[262,e-8,0];case 9===e:return[263,e-9,0];case 10===e:return[264,e-10,0];case 12>=e:return[265,e-11,1];case 14>=e:return[266,e-13,1];case 16>=e:return[267,e-15,1];case 18>=e:return[268,e-17,1];case 22>=e:return[269,e-19,2];case 26>=e:return[270,e-23,2];case 30>=e:return[271,e-27,2];case 34>=e:return[272,e-31,2];case 42>=e:return[273,e-35,3];case 50>=e:return[274,e-43,3];case 58>=e:return[275,e-51,3];case 66>=e:return[276,e-59,3];case 82>=e:return[277,e-67,4];case 98>=e:return[278,e-83,4];case 114>=e:return[279,e-99,4];case 130>=e:return[280,e-115,4];case 162>=e:return[281,e-131,5];case 194>=e:return[282,e-163,5];case 226>=e:return[283,e-195,5];case 257>=e:return[284,e-227,5];case 258===e:return[285,e-258,0];default:l("invalid length: "+e)}}var t,n,r=[];for(t=3;258>=t;t++)n=e(t),r[t]=n[2]<<24|n[1]<<16|n[0];return r}();function I(e,t){switch(this.l=[],this.m=32768,this.d=this.f=this.c=this.t=0,this.input=y?new Uint8Array(e):e,this.u=!1,this.n=J,this.K=!1,!t&&(t={})||(t.index&&(this.c=t.index),t.bufferSize&&(this.m=t.bufferSize),t.bufferType&&(this.n=t.bufferType),t.resize&&(this.K=t.resize)),this.n){case ga:this.a=32768,this.b=new(y?Uint8Array:Array)(32768+this.m+258);break;case J:this.a=0,this.b=new(y?Uint8Array:Array)(this.m),this.e=this.W,this.B=this.R,this.q=this.V;break;default:l(Error("invalid inflate mode"))}}y&&new Uint32Array(fa);var ga=0,J=1;I.prototype.r=function(){for(;!this.u;){var e=K(this,3);switch(1&e&&(this.u=!0),e>>>=1){case 0:var t=this.input,n=this.c,o=this.b,i=this.a,a=t.length,s=r,c=o.length,u=r;switch(this.d=this.f=0,n+1>=a&&l(Error("invalid uncompressed block header: LEN")),s=t[n++]|t[n++]<<8,n+1>=a&&l(Error("invalid uncompressed block header: NLEN")),s===~(t[n++]|t[n++]<<8)&&l(Error("invalid uncompressed block header: length verify")),n+s>t.length&&l(Error("input buffer is broken")),this.n){case ga:for(;i+s>o.length;){if(s-=u=c-i,y)o.set(t.subarray(n,n+u),i),i+=u,n+=u;else for(;u--;)o[i++]=t[n++];this.a=i,o=this.e(),i=this.a}break;case J:for(;i+s>o.length;)o=this.e({H:2});break;default:l(Error("invalid inflate mode"))}if(y)o.set(t.subarray(n,n+s),i),i+=s,n+=s;else for(;s--;)o[i++]=t[n++];this.c=n,this.a=i,this.b=o;break;case 1:this.q(ha,ia);break;case 2:var f,_,h,d,m=K(this,5)+257,v=K(this,5)+1,p=K(this,4)+4,A=new(y?Uint8Array:Array)(L.length),b=r,g=r,x=r,I=r,E=r;for(E=0;E=R?8:255>=R?9:279>=R?7:8;var ha=D(Q),S=new(y?Uint8Array:Array)(30),T,ra;for(T=0,ra=S.length;T=s&&l(Error("input buffer is broken")),r|=i[a++]<>>t,e.d=o-t,e.c=a,n}function M(e,t){for(var n,r,o=e.f,i=e.d,a=e.input,s=e.c,c=a.length,u=t[0],f=t[1];i=c);)o|=a[s++]<>>16)>i&&l(Error("invalid code length: "+r)),e.f=o>>r,e.d=i-r,e.c=s,65535&n}function U(e){e=e||{},this.files=[],this.v=e.comment}function V(e,t){t=t||{},this.input=y&&e instanceof Array?new Uint8Array(e):e,this.c=0,this.ba=t.verify||!1,this.j=t.password}t=I.prototype,t.q=function(e,t){var n=this.b,r=this.a;this.C=e;for(var o,i,a,s,c=n.length-258;256!==(o=M(this,e));)if(256>o)r>=c&&(this.a=r,n=this.e(),r=this.a),n[r++]=o;else for(s=la[i=o-257],0=c&&(this.a=r,n=this.e(),r=this.a);s--;)n[r]=n[r++-a];for(;8<=this.d;)this.d-=8,this.c--;this.a=r},t.V=function(e,t){var n=this.b,r=this.a;this.C=e;for(var o,i,a,s,c=n.length;256!==(o=M(this,e));)if(256>o)r>=c&&(c=(n=this.e()).length),n[r++]=o;else for(s=la[i=o-257],0c&&(c=(n=this.e()).length);s--;)n[r]=n[r++-a];for(;8<=this.d;)this.d-=8,this.c--;this.a=r},t.e=function(){var e,t,n=new(y?Uint8Array:Array)(this.a-32768),r=this.a-32768,o=this.b;if(y)n.set(o.subarray(32768,n.length));else for(e=0,t=n.length;ee;++e)o[e]=o[r+e];return this.a=32768,o},t.W=function(e){var t,n,r,o=this.input.length/this.c+1|0,i=this.input,a=this.b;return e&&("number"==typeof e.H&&(o=e.H),"number"==typeof e.P&&(o+=e.P)),n=2>o?(r=(i.length-this.c)/this.C[2]/2*258|0)t&&(this.b.length=t),e=this.b),this.buffer=e},U.prototype.L=function(e){this.j=e},U.prototype.s=function(e){var t=65535&e[2]|2;return t*(1^t)>>8&255},U.prototype.k=function(e,t){e[0]=(C[255&(e[0]^t)]^e[0]>>>8)>>>0,e[1]=1+(6681*(20173*(e[1]+(255&e[0]))>>>0)>>>0)>>>0,e[2]=(C[255&(e[2]^e[1]>>>24)]^e[2]>>>8)>>>0},U.prototype.T=function(e){var t,n,r=[305419896,591751049,878082192];for(y&&(r=new Uint32Array(r)),t=0,n=e.length;t>>0,this.z=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.J=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.h=e[t++]|e[t++]<<8,this.g=e[t++]|e[t++]<<8,this.F=e[t++]|e[t++]<<8,this.ea=e[t++]|e[t++]<<8,this.ga=e[t++]|e[t++]<<8,this.fa=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,this.$=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.filename=String.fromCharCode.apply(null,y?e.subarray(t,t+=this.h):e.slice(t,t+=this.h)),this.X=y?e.subarray(t,t+=this.g):e.slice(t,t+=this.g),this.v=y?e.subarray(t,t+this.F):e.slice(t,t+this.F),this.length=t-this.offset};var va={N:1,ca:8,da:2048};function $(e){var t,n,o,i,a=[],s={};if(!e.i){if(e.o===r){var c,u=e.input;if(!e.D)e:{var f,_=e.input;for(f=_.length-12;0>>0,e.o=(u[c++]|u[c++]<<8|u[c++]<<16|u[c++]<<24)>>>0,e.w=u[c++]|u[c++]<<8,e.v=y?u.subarray(c,c+e.w):u.slice(c,c+e.w)}for(t=e.o,o=0,i=e.aa;o>>0,this.z=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.J=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.h=e[t++]|e[t++]<<8,this.g=e[t++]|e[t++]<<8,this.filename=String.fromCharCode.apply(null,y?e.subarray(t,t+=this.h):e.slice(t,t+=this.h)),this.X=y?e.subarray(t,t+=this.g):e.slice(t,t+=this.g),this.length=t-this.offset},t=V.prototype,t.Y=function(){var e,t,n,r=[];for(this.i||$(this),e=0,t=(n=this.i).length;e>>8^C[255&(v^c[p])];for(A=b>>3;A--;p+=8)v=(v=(v=(v=(v=(v=(v=(v=v>>>8^C[255&(v^c[p])])>>>8^C[255&(v^c[p+1])])>>>8^C[255&(v^c[p+2])])>>>8^C[255&(v^c[p+3])])>>>8^C[255&(v^c[p+4])])>>>8^C[255&(v^c[p+5])])>>>8^C[255&(v^c[p+6])])>>>8^C[255&(v^c[p+7])];u=(4294967295^v)>>>0,i.p!==u&&l(Error("wrong crc: file=0x"+i.p.toString(16)+", data=0x"+u.toString(16)))}return c},t.L=function(e){this.j=e},t.k=U.prototype.k,t.S=U.prototype.T,t.s=U.prototype.s,v("Zlib.Unzip",V),v("Zlib.Unzip.prototype.decompress",V.prototype.r),v("Zlib.Unzip.prototype.getFilenames",V.prototype.Y),v("Zlib.Unzip.prototype.setPassword",V.prototype.L)}).call(this)}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(7302),__webpack_exports__default=__webpack_exports__.Z;export{__webpack_exports__default as default}; \ No newline at end of file +var __webpack_modules__={4878:(e,t,n)=>{n.d(t,{Z:()=>i});const i={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord_0;\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec3 v_position_inWorld;\n\nuniform int u_envHdriFormat; // initialValue=0\nuniform float u_envRotation; // initialValue=0\nuniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)\nuniform samplerCube u_colorEnvTexture; // initialValue=(0,black)\nuniform bool u_makeOutputSrgb; // initialValue=true\nuniform bool u_inverseEnvironment; // initialValue=true\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\nvoid main() {\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // diffuseColor\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture\n\n // adapt OpenGL (RenderMan) CubeMap convention\n float envRotation = get_envRotation(materialSID, 0);\n float rot = envRotation + 3.1415;\n mat3 rotEnvMatrix = mat3(cos(rot), 0.0, -sin(rot), 0.0, 1.0, 0.0, sin(rot), 0.0, cos(rot));\n vec3 envNormal = normalize(rotEnvMatrix * v_position_inWorld);\n\n if (get_inverseEnvironment(materialSID, 0)) {\n envNormal.x *= -1.0;\n }\n\n vec4 diffuseTexel = texture(u_colorEnvTexture, envNormal);\n vec3 textureColor;\n int EnvHdriFormat = get_envHdriFormat(materialSID, 0);\n if (EnvHdriFormat == 0) { // LDR_SRGB\n textureColor = srgbToLinear(diffuseTexel.rgb);\n } else if (EnvHdriFormat == 3) { // RGBE\n textureColor = diffuseTexel.rgb * pow(2.0, diffuseTexel.a*255.0-128.0);\n } else {\n textureColor = diffuseTexel.rgb;\n }\n diffuseColor *= textureColor;\n\n rt0 = vec4(diffuseColor, alpha);\n\nfloat makeOutputSrgb = float(get_makeOutputSrgb(materialSID, 0));\nrt0.rgb = mix(rt0.rgb, linearToSrgb(rt0.rgb), makeOutputSrgb);\n\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0}},5757:(e,t,n)=>{n.d(t,{Z:()=>i});const i={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\n\nout vec2 v_texcoord_0;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec3 v_position_inWorld;\n\nuniform bool u_enableViewMatrix; // initialValue=true\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n\n if (get_enableViewMatrix(materialSID, 0)) {\n mat4 rotateMatrix = viewMatrix;\n rotateMatrix[3][0] = 0.0;\n rotateMatrix[3][1] = 0.0;\n rotateMatrix[3][2] = 0.0;\n gl_Position = projectionMatrix * rotateMatrix * worldMatrix * vec4(a_position, 1.0);\n } else {\n gl_Position = projectionMatrix * worldMatrix * vec4(a_position, 1.0);\n }\n\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n v_normal_inWorld = normalMatrix * a_normal;\n\n v_color = a_color;\n v_position_inWorld = (worldMatrix * vec4(a_position, 1.0)).xyz;\n v_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1}},3034:e=>{e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./../../dist/",n(n.s="./src/index.ts")}({"./src/index.ts":function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("./src/main/Shaderity.ts"));t.default=o.default},"./src/main/PreProcessor.ts":function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static process(e){const t=/#define[\t ]+(\w+)/,n=/#ifdef[\t ]+(\w+)/,i=/#elif[\t ]+defined\((\w+)\)/,o=/#else/,a=/#endif/,r=[];let s=!0;const l=[],c=[],_=[];for(const h of e){let e=!1;{const n=h.match(t);null!=n&&(l.push(n[1]),e=!0)}if(-1===r.indexOf(!1)){const t=h.match(n);if(null!=t){r.push(s);const n=t[1];c.push([n]),-1===l.indexOf(n)&&(s=!1),e=!0}}if(-1===r.indexOf(!1)){const t=h.match(i);if(null!=t){const n=t[1],i=c[c.length-1];let o=!0;for(const e of i)-1!==l.indexOf(e)&&(o=!1);s=!(!o||-1===l.indexOf(n)),i.push(n),e=!0}}if(-1===r.indexOf(!1)&&null!=h.match(o)){const t=c[c.length-1];let n=!0;for(const e of t)-1!==l.indexOf(e)&&(n=!1);s=n,e=!0}null!=h.match(a)&&(-1===r.indexOf(!1)&&(s=!0),e=!0,c.pop(),r.pop()),s&&!e&&_.push(h)}return _}}},"./src/main/Reflection.ts":function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});class i{constructor(e,t){this.__attributeSemanticsMap=new Map,this.__uniformSemanticsMap=new Map,this.__attributes=[],this.__varyings=[],this.__uniforms=[],this.__splittedShaderCode=e,this.__shaderStage=t,this.__setDefaultAttributeAndUniformSemanticsMap()}get attributes(){return this.__attributes}get varyings(){return this.__varyings}get uniforms(){return this.__uniforms}get attributesNames(){return this.__attributes.map((e=>e.name))}get attributesSemantics(){return this.__attributes.map((e=>e.semantic))}get attributesTypes(){return this.__attributes.map((e=>e.type))}addAttributeSemanticsMap(e){this.__attributeSemanticsMap=new Map([...this.__attributeSemanticsMap,...e])}addUniformSemanticsMap(e){this.__uniformSemanticsMap=new Map([...this.__uniformSemanticsMap,...e])}addAttributeSemantics(e,t){this.__attributeSemanticsMap.set(e,t)}addUniformSemantics(e,t){this.__uniformSemanticsMap.set(e,t)}resetAttributeSemantics(){this.__attributeSemanticsMap=new Map}resetUniformSemantics(){this.__uniformSemanticsMap=new Map}reflect(){const e=this.__splittedShaderCode,t=this.__shaderStage;for(const n of e)this.__matchAttribute(n,t)?this.__addAttribute(n):this.__matchVarying(n,t)?this.__addVarying(n,t):n.match(/^(?![\/])[\t ]*uniform[\t ]+/)&&this.__addUniform(n)}__setDefaultAttributeAndUniformSemanticsMap(){this.__attributeSemanticsMap.set("position","POSITION"),this.__attributeSemanticsMap.set("color$","COLOR_0"),this.__attributeSemanticsMap.set("color_?0","COLOR_0"),this.__attributeSemanticsMap.set("texcoord$","TEXCOORD_0"),this.__attributeSemanticsMap.set("texcoord_?0","TEXCOORD_0"),this.__attributeSemanticsMap.set("texcoord_?1","TEXCOORD_1"),this.__attributeSemanticsMap.set("texcoord_?2","TEXCOORD_2"),this.__attributeSemanticsMap.set("normal","NORMAL"),this.__attributeSemanticsMap.set("tangent","TANGENT"),this.__attributeSemanticsMap.set("joint$","JOINTS_0"),this.__attributeSemanticsMap.set("bone$","JOINTS_0"),this.__attributeSemanticsMap.set("joint_?0","JOINTS_0"),this.__attributeSemanticsMap.set("bone_?0","JOINTS_0"),this.__attributeSemanticsMap.set("weight$","WEIGHTS_0"),this.__attributeSemanticsMap.set("weight_?0","WEIGHTS_0"),this.__uniformSemanticsMap.set("worldmatrix","WorldMatrix"),this.__uniformSemanticsMap.set("normalmatrix","NormalMatrix"),this.__uniformSemanticsMap.set("viewmatrix","ViewMatrix"),this.__uniformSemanticsMap.set("projectionmatrix","ProjectionMatrix"),this.__uniformSemanticsMap.set("modelviewmatrix","ModelViewMatrix")}__matchAttribute(e,t){return"vertex"===t&&e.match(/^(?![\/])[\t ]*(attribute|in)[\t ]+.+;/)}__addAttribute(e){const t={name:"",type:"float",semantic:"UNKNOWN"},n=e.match(i.attributeAndVaryingTypeRegExp);if(n){const o=n[1];t.type=o;const a=n[2];t.name=a;const r=e.match(i.semanticRegExp);if(r)t.semantic=r[1];else for(let[e,n]of this.__attributeSemanticsMap)a.match(new RegExp(e,"i"))&&(t.semantic=n)}this.__attributes.push(t)}__matchVarying(e,t){return"vertex"===t?e.match(/^(?![\/])[\t ]*(varying|out)[\t ]+.+;/):e.match(/^(?![\/])[\t ]*(varying|in)[\t ]+.+;/)}__addVarying(e,t){const n={name:"",type:"float",inout:"in"},o=e.match(i.attributeAndVaryingTypeRegExp);if(o){const e=o[1];n.type=e;const i=o[2];n.name=i,n.inout="vertex"===t?"out":"in"}this.__varyings.push(n)}__addUniform(e){const t={name:"",type:"float",semantic:"UNKNOWN"},n=e.match(i.uniformTypeRegExp);if(n){const o=n[1];t.type=o;const a=n[2];t.name=a;const r=e.match(i.semanticRegExp);if(r)t.semantic=r[1];else for(let[e,n]of this.__uniformSemanticsMap)a.match(new RegExp(e,"i"))&&(t.semantic=n)}this.__uniforms.push(t)}}t.default=i,i.attributeAndVaryingTypeRegExp=/[\t ]+(float|int|vec2|vec3|vec4|mat2|mat3|mat4|ivec2|ivec3|ivec4)[\t ]+(\w+);/,i.uniformTypeRegExp=/[\t ]+(float|int|vec2|vec3|vec4|mat2|mat3|mat4|ivec2|ivec3|ivec4|sampler2D|samplerCube|sampler3D)[\t ]+(\w+);/,i.semanticRegExp=/<.*semantic[\t ]*=[\t ]*(\w+).*>/},"./src/main/ShaderEditor.ts":function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static _insertDefinition(e,t){const n=t.replace(/#define[\t ]+/,"");e.unshift(`#define ${n}`)}static _fillTemplate(e,t){const n=e.replace(/\/\*[\t ]*shaderity:[\t ]*(@{[\t ]*)(\S+)([\t ]*})[\t ]*\*\//g,"${this.$2}");return new Function("return `"+n+"`;").call(t)}}},"./src/main/ShaderTransformer.ts":function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static _transformToGLSLES1(e,t,n){return this.__convertOrInsertVersionGLSLES1(e),this.__removeES3Qualifier(e,n),this.__convertIn(e,t),this.__convertOut(e,t,n),this.__removePrecisionForES3(e),this.__convertTextureFunctionToES1(e,t,n),e}static _transformToGLSLES3(e,t){return this.__convertOrInsertVersionGLSLES3(e),this.__convertAttribute(e,t),this.__convertVarying(e,t),this.__convertTextureCube(e),this.__convertTexture2D(e),this.__convertTexture2DProd(e),this.__convertTexture3D(e),this.__convertTexture3DProd(e),e}static _transformTo(e,t,n,i){return e.match(/webgl2|es3/i)?this._transformToGLSLES3(t,n):e.match(/webgl1|es1/i)?this._transformToGLSLES1(t,n,i):(console.error("Invalid Version"),t)}static __convertOrInsertVersionGLSLES1(e){this.__removeFirstMatchingLine(e,/^(?![\/])[\t ]*#[\t ]*version[\t ]+.*/),e.unshift("#version 100")}static __convertOrInsertVersionGLSLES3(e){this.__removeFirstMatchingLine(e,/^(?![\/])[\t ]*#[\t ]*version[\t ]+.*/),e.unshift("#define GLSL_ES3"),e.unshift("#version 300 es")}static __convertIn(e,t){let n;n=t?function(e,t){return"varying "+t}:function(e,t){return"attribute "+t},this.__replaceLine(e,/^(?![\/])[\t ]*in[\t ]+((highp|mediump|lowp|)[\t ]*\w+[\t ]*\w+[\t ]*;)/,n)}static __convertOut(e,t,n){if(t){const t=this.__removeOutQualifier(e,n);if(null==t)return;this.__addGLFragColor(t,e,n)}else{const t=/^(?![\/])[\t ]*out[\t ]+((highp|mediump|lowp|)[\t ]*\w+[\t ]*\w+[\t ]*;)/,n=function(e,t){return"varying "+t};this.__replaceLine(e,t,n)}}static __removeOutQualifier(e,t){const n=/^(?![\/])[\t ]*out[\t ]+((highp|mediump|lowp|)[\t ]*\w+[\t ]*(\w+)[\t ]*;)/;let i;for(let t=0;t=0;e--){const n=t[e];if(!s&&n.match(i)&&(t[e]=n.replace(i,`$1\n${r}\n}\n`),s=!0),n.match(o)&&t.splice(e,0,r),n.match(a))break}if(!s){const e="__removeOutQualifier: Not found the closing brackets for the main function";this.__outError(t,t.length,e,n)}}static __removeES3Qualifier(e,t){this.__removeVaryingQualifier(e,t),this.__removeLayout(e)}static __removeVaryingQualifier(e,t){const n=/^(?![\/])[\t ]*(flat|smooth)[\t ]*((in|out)[\t ]+.*)/;for(let i=0;i"flat"===o?(this.__outError(e,i+1,"__removeVaryingQualifier: glsl es1 does not support flat qualifier",t),n):a))}static __removeLayout(e){this.__replaceLine(e,/^(?![\/])[\t ]*layout[\t ]*\([\t ]*location[\t ]*\=[\t ]*\d[\t ]*\)[\t ]+/g,"")}static __removePrecisionForES3(e){const t=/^(?![\/])[\t ]*precision[\t ]+(highp|mediump|lowp)[\t ]+(\w+)[\t ]*;/;for(let n=0;n=0;r--){if(!e[r].match(/\{/))continue;const t=null===(i=this.__getBracketSection(e,r).match(/.*\((.*)\)/))||void 0===i?void 0:i[1];if(null==t)return;const s=t.split(","),l=/[\n\t ]*(highp|mediump|lowp|)[\n\t ]*(sampler\w+)[\n\t ]*(\w+)[\n\t ]*/;if(null!==(o=s[0].match(l))&&void 0!==o?o:s[0].match(/^[\n\t ]*$/)){for(const t of s){const i=t.match(l);if(null==i)continue;const o=i[2],s=i[3];if(a.get(s)){const t="__createArgumentSamplerMap: duplicate variable name";this.__outError(e,r,t,n)}a.set(s,o)}break}}return a}static __getBracketSection(e,t){let n=0;for(let i=t;i>=0;i--)if(e[i].match(/\(/)){n=i;break}let i="";for(let o=n;o<=t;o++)i+=e[o];return i}static __convertAttribute(e,t){t||this.__replaceLine(e,/^(?![\/])[\t ]*attribute[\t ]+/g,"in ")}static __convertVarying(e,t){const n=t?"in ":"out ";this.__replaceLine(e,/^(?![\/])[\t ]*varying[\t ]+/g,n)}static __convertTextureCube(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(textureCube)(${t}+)`,"g");this.__replaceLine(e,n,"$1texture$3")}static __convertTexture2D(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture2D)(${t}+)`,"g");this.__replaceLine(e,n,"$1texture$3")}static __convertTexture2DProd(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture2DProj)(${t}+)`,"g");this.__replaceLine(e,n,"$1textureProj$3")}static __convertTexture3D(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture3D)(${t}+)`,"g");this.__replaceLine(e,n,"$1texture$3")}static __convertTexture3DProd(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture3DProj)(${t}+)`,"g");this.__replaceLine(e,n,"$1textureProj$3")}static __regSymbols(){return"[!\"#$%&'()*+-.,/:;<=>?@[\\]^`{|}~\t\n ]"}static __replaceLine(e,t,n){for(let i=0;i=0&&!e[t].match(o);t--)if(e[t]===i)return;console.error(n),e.push(i)}}}},"./src/main/Shaderity.ts":function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("./src/main/Reflection.ts")),a=i(n("./src/main/ShaderTransformer.ts")),r=i(n("./src/main/ShaderEditor.ts")),s=i(n("./src/main/Utility.ts")),l=i(n("./src/main/ShaderityObjectCreator.ts")),c=i(n("./src/main/PreProcessor.ts"));t.default=class{static transformToGLSLES1(e,t=!1){const n=s.default._splitByLineFeedCode(e.code),i=a.default._transformToGLSLES1(n,e.isFragmentShader,t);return{code:s.default._joinSplittedLine(i),shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}static transformToGLSLES3(e){const t=s.default._splitByLineFeedCode(e.code),n=a.default._transformToGLSLES3(t,e.isFragmentShader);return{code:s.default._joinSplittedLine(n),shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}static transformTo(e,t,n=!1){const i=s.default._splitByLineFeedCode(t.code),o=a.default._transformTo(e,i,t.isFragmentShader,n);return{code:s.default._joinSplittedLine(o),shaderStage:t.shaderStage,isFragmentShader:t.isFragmentShader}}static processPragma(e){const t=s.default._splitByLineFeedCode(e.code),n=c.default.process(t);return{code:s.default._joinSplittedLine(n),shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}static createShaderityObjectCreator(e){return new l.default(e)}static fillTemplate(e,t){const n=this.__copyShaderityObject(e);return n.code=r.default._fillTemplate(n.code,t),n}static insertDefinition(e,t){const n=this.__copyShaderityObject(e),i=s.default._splitByLineFeedCode(e.code);return r.default._insertDefinition(i,t),n.code=s.default._joinSplittedLine(i),n}static createReflectionObject(e){const t=s.default._splitByLineFeedCode(e.code);return new o.default(t,e.shaderStage)}static __copyShaderityObject(e){return{code:e.code,shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}}},"./src/main/ShaderityObjectCreator.ts":function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("./src/main/Utility.ts"));class a{constructor(e){this.__functionIdCount=0,this.__defineDirectiveNames=[],this.__extensions=[],this.__globalPrecision={int:"highp",float:"highp",sampler2D:"highp",samplerCube:"highp",sampler3D:"highp",sampler2DArray:"highp",isampler2D:"highp",isamplerCube:"highp",isampler3D:"highp",isampler2DArray:"highp",usampler2D:"highp",usamplerCube:"highp",usampler3D:"highp",usampler2DArray:"highp",sampler2DShadow:"highp",samplerCubeShadow:"highp",sampler2DArrayShadow:"highp"},this.__structDefinitions=[],this.__globalConstantValues=[],this.__globalConstantStructValues=[],this.__attributes=[],this.__varyings=[],this.__uniforms=[],this.__uniformStructs=[],this.__uniformBufferObjects=[],this.__functions=[],this.__mainFunctionCode="void main() {}",this.__outputColorVariableName="renderTarget0",this.__shaderStage=e}addDefineDirective(e){this.__defineDirectiveNames.some((t=>t===e))?console.warn("addDefineDirective: this define directive is already set"):this.__defineDirectiveNames.push(e)}addExtension(e,t="enable"){this.__extensions.some((t=>t.extensionName===e))?console.warn("addExtension: this extension is already set"):this.__extensions.push({extensionName:e,behavior:t})}addStructDefinition(e,t){this.__structDefinitions.some((t=>t.structName===e))?console.error(`addStructDefinition: duplicate struct type name ${e}`):this.__structDefinitions.push({structName:e,memberObjects:t})}addGlobalConstantValue(e,t,n){this.__globalConstantValues.some((t=>t.variableName===e))?console.error(`addGlobalConstantValue: duplicate variable name ${e}`):o.default._isValidComponentCount(t,n)?(o.default._isIntType(t)&&a.__existNonIntegerValue(n)&&console.warn(`addGlobalConstantValue: non-integer value is set to ${e}`),this.__globalConstantValues.push({variableName:e,type:t,values:n})):console.error(`addGlobalConstantValue: the component count of ${e} is invalid`)}addGlobalConstantStructValue(e,t,n){this.__globalConstantStructValues.some((e=>e.variableName===t))?console.error(`addGlobalConstantStructValue: duplicate variable name ${t}`):this.__globalConstantStructValues.push({variableName:t,structName:e,values:n})}addAttributeDeclaration(e,t,n){"vertex"===this.__shaderStage?this.__attributes.some((t=>t.variableName===e))?console.error(`addAttribute: duplicate variable name ${e}`):this.__attributes.push({variableName:e,type:t,precision:null==n?void 0:n.precision,location:null==n?void 0:n.location}):console.error("addAttribute: this method is for vertex shader only")}addVaryingDeclaration(e,t,n){if(this.__varyings.some((t=>t.variableName===e)))return void console.error(`addVarying: duplicate variable name ${e}`);const i=o.default._isIntType(t);let a=null==n?void 0:n.interpolationType;if(i&&"flat"!==a){if(null!=a)return void console.error("addVarying: the interpolationType must be flat for integer types");console.warn("addVarying: set the interpolationType of integer types to flat to avoid compilation error"),a="flat"}this.__varyings.push({variableName:e,type:t,precision:null==n?void 0:n.precision,interpolationType:a})}addUniformDeclaration(e,t,n){this.__uniforms.some((t=>t.variableName===e))?console.error(`addUniform: duplicate variable name ${e}`):("bool"===t&&null!=(null==n?void 0:n.precision)&&(console.warn("addUniform: remove the specification of precision for bool type to avoid compilation error"),n.precision=void 0),this.__uniforms.push({variableName:e,type:t,precision:null==n?void 0:n.precision}))}addUniformStructDeclaration(e,t){this.__uniformStructs.some((e=>e.variableName===t))?console.error(`addUniformStructDeclaration: duplicate variable name ${t}`):this.__uniformStructs.push({variableName:t,structName:e})}addUniformBufferObjectDeclaration(e,t,n){if(this.__uniformBufferObjects.some((t=>t.blockName===e)))console.error(`addUniformBufferObjectDeclaration: duplicate block name ${e}`);else{for(const e of this.__uniformBufferObjects)for(const n of e.variableObjects)for(const e of t)if(n.variableName===e.variableName)return void console.error(`addUniformBufferObjectDeclaration: duplicate variable name ${e.variableName}`);this.__uniformBufferObjects.push({blockName:e,variableObjects:t,instanceName:null==n?void 0:n.instanceName})}}addFunctionDefinition(e,t){var n,i;const o=this.__functionIdCount++,a=null!==(n=null==t?void 0:t.dependencyLevel)&&void 0!==n?n:0;return this.__functions[a]=null!==(i=this.__functions[a])&&void 0!==i?i:[],this.__functions[a].push({functionCode:e,functionId:o}),o}updateGlobalPrecision(e){Object.assign(this.__globalPrecision,e)}updateStructDefinition(e,t){const n=this.__structDefinitions.findIndex((t=>t.structName===e));-1!==n?this.__structDefinitions[n].memberObjects=t:console.error(`updateStructDefinition: the struct type name ${e} is not exist`)}updateGlobalConstantValue(e,t){const n=this.__globalConstantValues.findIndex((t=>t.variableName===e));if(-1===n)return void console.warn(`updateGlobalConstantValue: the variable name ${e} is not exist`);const i=this.__globalConstantValues[n].type;o.default._isValidComponentCount(i,t)?(o.default._isIntType(i)&&a.__existNonIntegerValue(t)&&console.warn(`updateGlobalConstantValue: the ${e} has a non-integer value.`),this.__globalConstantValues[n].values=t):console.error("updateGlobalConstantValue: the component count is invalid")}updateGlobalConstantStructValue(e,t){const n=this.__globalConstantStructValues.findIndex((t=>t.variableName===e));-1!==n?this.__globalConstantStructValues[n].values=t:console.error(`updateGlobalConstantStructValue: the variable name ${e} is not exist`)}updateMainFunction(e){this.__mainFunctionCode=e}updateOutputColorVariableName(e){"fragment"===this.__shaderStage?0!==e.length?this.__outputColorVariableName=e:console.error("updateOutputColorVariableName: invalid outColorVariableName"):console.error("updateOutputColorVariableName: this method is for fragment shader only")}removeDefineDirective(e){const t=this.__defineDirectiveNames.indexOf(e);-1!==t?this.__defineDirectiveNames.splice(t,1):console.warn("removedDefineDirective: this define directive is not exist")}removeExtension(e){const t=this.__extensions.findIndex((t=>t.extensionName===e));-1!==t?this.__extensions.splice(t,1):console.warn("removeExtension: this extension is not exist")}removeStructDefinition(e){const t=this.__structDefinitions.findIndex((t=>t.structName===e));-1!==t?this.__structDefinitions.splice(t,1):console.error(`removeStructDefinition: the struct type name ${e} is not exist`)}removeGlobalConstantValue(e){const t=this.__globalConstantValues.findIndex((t=>t.variableName===e));-1!==t?this.__globalConstantValues.splice(t,1):console.warn(`removeGlobalConstantValue: the variable name ${e} is not exist`)}removeGlobalConstantStructValue(e){const t=this.__globalConstantStructValues.findIndex((t=>t.variableName===e));-1!==t?this.__globalConstantStructValues.splice(t,1):console.error(`updateGlobalConstantStructValue: the variable name ${e} is not exist`)}removeAttributeDeclaration(e){const t=this.__attributes.findIndex((t=>t.variableName===e));-1!==t?this.__attributes.splice(t,1):console.warn(`removeAttribute: the variable name ${e} is not exist`)}removeVaryingDeclaration(e){const t=this.__varyings.findIndex((t=>t.variableName===e));-1!==t?this.__varyings.splice(t,1):console.warn(`removeVarying: the variable name ${e} is not exist`)}removeUniformDeclaration(e){const t=this.__uniforms.findIndex((t=>t.variableName===e));-1!==t?this.__uniforms.splice(t,1):console.warn(`removeUniform: the variable name ${e} is not exist`)}removeUniformStructDeclaration(e){const t=this.__uniformStructs.findIndex((t=>t.variableName===e));-1!==t?this.__uniformStructs.splice(t,1):console.warn(`removeUniformStructDeclaration: the variable name ${e} is not exist`)}removeUniformBufferObjectDeclaration(e){const t=this.__uniformBufferObjects.findIndex((t=>t.blockName===e));-1!==t?this.__uniformBufferObjects.splice(t,1):console.warn(`removeUniformStructDeclaration: the variable name ${e} is not exist`)}removeFunctionDefinition(e){this.__fillEmptyFunctions(),(e<0||e>=this.__functionIdCount)&&console.warn("removeFunctionDefinition: invalid function id");for(const t of this.__functions){const n=t.findIndex((t=>t.functionId===e));if(-1!==n)return void t.splice(n,1)}console.warn(`removeFunctionDefinition: not found the function of functionId ${e}`)}createShaderityObject(){return{code:this.__createShaderCode(),shaderStage:this.__shaderStage,isFragmentShader:"fragment"===this.__shaderStage}}static __existNonIntegerValue(e){for(const t of e)if(!Number.isInteger(t))return!0;return!1}__createShaderCode(){return this.__fillEmptyFunctions(),"#version 300 es\n\n"+this.__createDefineDirectiveShaderCode()+this.__createExtensionShaderCode()+this.__createGlobalPrecisionShaderCode()+this.__createStructDefinitionShaderCode()+this.__createGlobalConstantValueShaderCode()+this.__createGlobalConstantStructValueShaderCode()+this.__createAttributeDeclarationShaderCode()+this.__createVaryingDeclarationShaderCode()+this.__createOutputColorDeclarationShaderCode()+this.__createUniformDeclarationShaderCode()+this.__createUniformStructDeclarationShaderCode()+this.__createUniformBufferObjectShaderCode()+this.__createFunctionDefinitionShaderCode()+this.__createMainFunctionDefinitionShaderCode()}__fillEmptyFunctions(){var e;for(let t=0;te.structName===t.structName));if(-1===n){console.error(`__createGlobalConstantStructValueShaderCode: the struct type ${t.structName} is not defined`);continue}e+=`const ${t.structName} ${t.variableName} = ${t.structName} (\n`;const i=this.__structDefinitions[n];if(i.memberObjects.length===Object.keys(t.values).length)if(i.memberObjects.some((e=>o.default._isSamplerType(e.type))))console.error(`__createGlobalConstantStructValueShaderCode: ConstantStructValue (${t.variableName}) cannot have sampler type parameter`);else{for(let n=0;ne.structName===n))?e+=`uniform ${n} ${t.variableName};\n`:console.error(`__createUniformStructDeclarationShaderCode: the struct type ${n} is not defined`)}return o.default._addLineFeedCodeIfNotNullString(e)}__createUniformBufferObjectShaderCode(){let e="";for(const t of this.__uniformBufferObjects){e+=`layout (std140) uniform ${t.blockName} {\n`;for(let n=0;n{n.d(t,{D:()=>f});var i=n(9721),o=n(1350),a=n(8491),r=n(4507),s=n(6692),l=n(224),c=n(2404),_=n(4710),h=n(7987),u=n(3258),d=n(3496),m=n(4690);class f extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.type="efk",this.playJustAfterLoaded=!1,this.isLoop=!1,this.isPause=!1,this.randomSeed=-1,this.isImageLoadWithCredential=!1,this.__speed=1,this.__isInitialized=!1,this.isLoadEffect=!1,u.D.noWebGLTex2DStateCache=!0}static get componentTID(){return _.z.EffekseerComponentTID}cancelLoop(){clearInterval(this.__timer)}isPlay(){return!!m.Is.exist(this.__handle)&&!!this.__handle.exists&&!this.isPause}play(){return m.Is.not.exist(this.__context)?(console.warn("No Effekseer context yet"),!1):m.Is.not.exist(this.__effect)?(console.warn("No Effekseer effect yet"),!1):(this.stop(),this.isPause=!1,this.__handle=this.__context.play(this.__effect,0,0,0),m.Is.exist(this.__handle)&&m.Is.exist(this.__handle.setRandomSeed)&&this.randomSeed>0&&this.__handle.setRandomSeed(this.randomSeed),!0)}continue(){this.isPause=!1}pause(){m.Is.exist(this.__handle)&&(this.isPause=!0,clearInterval(this.__timer))}stop(){m.Is.exist(this.__handle)&&(this.__handle.stop(),this.isPause=!0,clearInterval(this.__timer))}set playSpeed(e){this.__handle&&this.__handle.setSpeed(e),this.__speed=e}get playSpeed(){return this.__speed}setTime(e){if(!this.play())return!1;if(m.Is.not.exist(this.__context))return!1;let t=0;const n=.0166;for(t=n;t<=e;)if(this.__context.update(t/n),t+=n,e{this.playJustAfterLoaded&&(this.play(),this.moveStageTo(r.I.Logic))},o=(e,t)=>{console.error(e,t)};if("efkpkg"===this.type){if(m.Is.not.exist(f.Unzip))return console.error("Please Set an Unzip object to EffekseerComponent.Unzip"),!1;this.__effect=this.__context.loadEffectPackage(n,f.Unzip,1,i.bind(this),o.bind(this))}else this.__effect=this.__context.loadEffect(n,1,i.bind(this),o.bind(this));return!0}$load(){!this.__isInitialized&&m.Is.not.exist(this.__context)&&m.Is.not.exist(this.__effect)&&(m.Is.exist(f.wasmModuleUri)?effekseer.initRuntime(f.wasmModuleUri,(()=>{this.__createEffekseerContext()&&this.moveStageTo(r.I.Logic)}),(()=>{console.error("Failed to initialize Effekseer")})):this.__createEffekseerContext()&&this.moveStageTo(r.I.Logic))}$logic(){if(this.isPause||m.Is.exist(this.__context)&&m.Is.false(this.isPause)&&this.__context.update(),null!=this.__handle){const e=f.__tmp_identityMatrix_0.copyComponents(this.__sceneGraphComponent.matrixInner);this.__handle.setMatrix(e._v),this.__handle.setSpeed(this.__speed)}this.isPause||this.isLoop&&(this.isPlay()||this.play()),this.moveStageTo(r.I.Render)}_destroy(){m.Is.exist(this.__context)&&(this.__context.releaseEffect(!this.__effect),effekseer.releaseContext(this.__context),this.__context=void 0),m.Is.exist(this.__handle)&&(this.__handle=void 0),this.__effect=void 0}$render(){if(m.Is.not.exist(this.__effect))return void this.moveStageTo(r.I.Load);const e=c.C.getComponent(l.M,l.M.current),t=f.__tmp_identityMatrix_0,n=f.__tmp_identityMatrix_1;e?(t.copyComponents(e.viewMatrix),n.copyComponents(e.projectionMatrix)):(t.identity(),n.identity()),m.Is.exist(this.__context)&&(this.__context.setProjectionMatrix(n._v),this.__context.setCameraMatrix(t._v),this.__context.draw()),this.moveStageTo(r.I.Logic)}static sort_$render(e){return m.Is.false(e.toRenderEffekseerEffects)?[]:c.C.getComponentsWithType(f).map((e=>e.componentSID))}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getEffekseer(){return this.getComponentByComponentTID(f.componentTID)}}return(0,o.e)(e,n),e}}f.ANIMATION_EVENT_PLAY=0,f.ANIMATION_EVENT_PAUSE=1,f.ANIMATION_EVENT_END=2,f.wasmModuleUri=void 0,f.__tmp_identityMatrix_0=d.e.identity(),f.__tmp_identityMatrix_1=d.e.identity(),c.C.registerComponentClass(f)},8107:(e,t,n)=>{n.d(t,{A:()=>i.Effekseer,D:()=>o.D});var i=n(3995),o=n(7015)},3995:(e,t,n)=>{n.r(t),n.d(t,{Effekseer:()=>s});var i=n(7015),o=n(1350),a=n(6692),r=n(8491);const s=Object.freeze({EffekseerComponent:i.D,createEffekseerEntity:function(){const e=o.g.createEntity(),t=o.g.addComponentToEntity(a.U,e),n=o.g.addComponentToEntity(r.a,t);return o.g.addComponentToEntity(i.D,n)}})},3658:(e,t,n)=>{n.d(t,{m:()=>a});var i=n(2471),o=n(4690);class a{constructor(){this.zNearMax=.1,this.zFarScalingFactor=1e5,this.autoCalculateZNearAndZFar=!0}_calcZNearInner(e,t,n){if(this.autoCalculateZNearAndZFar&&o.Is.exist(this.__targetEntity)){const o=this.__targetEntity.getSceneGraph().worldAABB,a=i.P.lengthBtw(t,o.centerPoint),r=o.centerPoint.x-t.x,s=o.centerPoint.y-t.y,l=o.centerPoint.z-t.z,c=(r*n.x+s*n.y+l*n.z)/(Math.hypot(r,s,l)*n.length());e.zNearInner=Math.max(Math.min(a*c-o.lengthCenterToCorner,this.zNearMax),.01)}else e.zNearInner=e.zNear}_calcZFarInner(e){this.autoCalculateZNearAndZFar?e.zFarInner=e.zNearInner*this.zFarScalingFactor:e.zNearInner=e.zFar}}},6547:(e,t,n)=>{n.d(t,{j:()=>d});var i=n(2471),o=n(9190),a=n(3032),r=n(2566),s=n(5467),l=n(3496),c=n(3658),_=n(4690),h=n(4742),u=n(3258);class d extends c.m{constructor(){super(),this.dollyScale=2,this.scaleOfLengthCenterToCamera=1,this.moveSpeed=1,this.followTargetAABB=!1,this.autoUpdate=!0,this.__updated=!1,this.__fixedDolly=!1,this.__fixedLengthOfCenterToEye=1,this.__isMouseDown=!1,this.__lastMouseDownTimeStamp=0,this.__lastMouseUpTimeStamp=0,this.__originalY=-1,this.__originalX=-1,this.__buttonNumber=0,this.__mouse_translate_y=0,this.__mouse_translate_x=0,this.__efficiency=1,this.__lengthOfCenterToEye=1,this.__fovyBias=1,this.__scaleOfTranslation=2.8,this.__mouseTranslateVec=o.d6.zero(),this.__newEyeVec=o.d6.zero(),this.__newCenterVec=o.d6.zero(),this.__newUpVec=o.d6.zero(),this.__newTangentVec=o.d6.zero(),this.__isSymmetryMode=!0,this.__rot_bgn_x=0,this.__rot_bgn_y=0,this.__rot_x=0,this.__rot_y=0,this.__dolly=.5,this.__eyeVec=o.d6.zero(),this.__centerVec=o.d6.zero(),this.__upVec=o.d6.zero(),this.__scaleOfZNearAndZFar=5e3,this.__doPreventDefault=!1,this.__isPressingShift=!1,this.__isPressingCtrl=!1,this.__pinchInOutControl=!1,this.__pinchInOutOriginalDistance=null,this.__resetDollyTouchTime=0,this.__mouseDownFunc=this.__mouseDown.bind(this),this.__mouseUpFunc=this.__mouseUp.bind(this),this.__mouseMoveFunc=this.__mouseMove.bind(this),this.__touchDownFunc=this.__touchDown.bind(this),this.__touchUpFunc=this.__touchUp.bind(this),this.__touchMoveFunc=this.__touchMove.bind(this),this.__pinchInOutFunc=this.__pinchInOut.bind(this),this.__pinchInOutEndFunc=this.__pinchInOutEnd.bind(this),this.__mouseWheelFunc=this.__mouseWheel.bind(this),this.__mouseDblClickFunc=this.__mouseDblClick.bind(this),this.__contextMenuFunc=this.__contextMenu.bind(this),this.__pressShiftFunc=this.__pressShift.bind(this),this.__releaseShiftFunc=this.__releaseShift.bind(this),this.__pressCtrlFunc=this.__pressCtrl.bind(this),this.__releaseCtrlFunc=this.__releaseCtrl.bind(this),this.__resetDollyAndPositionFunc=this.__resetDollyAndPosition.bind(this),this.registerEventListeners()}resetDollyAndTranslation(){this.__dolly=.5,this.__mouse_translate_x=0,this.__mouse_translate_y=0,this.__mouseTranslateVec=o.d6.zero()}setTarget(e){this.__targetEntity=e,this.__originalTargetAABB=void 0,this.__updated=!1}getTarget(){return this.__targetEntity}set doPreventDefault(e){this.__doPreventDefault=e}get doPreventDefault(){return this.__doPreventDefault}__mouseDown(e){this.__tryToPreventDefault(e),this.__isPressingCtrl||(this.__originalX=e.clientX,this.__originalY=e.clientY,this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y,this.__isMouseDown=!0,this.__lastMouseDownTimeStamp=e.timeStamp,console.log("original",this.__originalX,this.__originalY),this.__updated=!1)}__mouseMove(e){if(this.__tryToPreventDefault(e),_.Is.false(this.isMouseDown))return;if(this.__isPressingCtrl)return;0===this.__buttonNumber&&(this.__buttonNumber=e.buttons);const t=e.clientX,n=e.clientY;switch(this.__buttonNumber){case 1:this.__isPressingShift?this.__parallelTranslateControl(this.__originalX,this.__originalY,t,n):(this.__rotateControl(this.__originalX,this.__originalY,t,n),this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y);break;case 2:this.__zoomControl(this.__originalX,t);break;case 4:this.__parallelTranslateControl(this.__originalX,this.__originalY,t,n);break;default:return}this.__originalX=t,this.__originalY=n,this.__updated=!1}__mouseUp(e){this.__buttonNumber=0,this.__originalX=-1,this.__originalY=-1,this.__isMouseDown=!1,this.__lastMouseUpTimeStamp=e.timeStamp,this.__updated=!1}__touchDown(e){this.__tryToPreventDefault(e),1===e.touches.length?(this.__originalX=e.touches[0].clientX,this.__originalY=e.touches[0].clientY,this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y):(this.__originalX=.5*(e.touches[0].clientX+e.touches[1].clientX),this.__originalY=.5*(e.touches[0].clientY+e.touches[1].clientY)),this.__isMouseDown=!0,this.__lastMouseDownTimeStamp=e.timeStamp}__touchMove(e){if(this.__tryToPreventDefault(e),_.Is.false(this.isMouseDown))return;let t=e.touches[0].clientX,n=e.touches[0].clientY;1===e.touches.length?(t=e.touches[0].clientX,n=e.touches[0].clientY,this.__rotateControl(this.__originalX,this.__originalY,t,n),this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y):(t=.5*(e.touches[0].clientX+e.touches[1].clientX),n=.5*(e.touches[0].clientY+e.touches[1].clientY),this.__parallelTranslateControl(this.__originalX,this.__originalY,t,n)),this.__originalX=t,this.__originalY=n}__touchUp(e){const t=e.touches.length;0===t?(this.__originalX=-1,this.__originalY=-1):1===t?(this.__originalX=e.touches[0].clientX,this.__originalY=e.touches[0].clientY,this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y):(this.__originalX=.5*(e.touches[0].clientX+e.touches[1].clientX),this.__originalY=.5*(e.touches[0].clientY+e.touches[1].clientY)),this.__isMouseDown=!1,this.__lastMouseUpTimeStamp=e.timeStamp}set rotX(e){this.__rot_x=e}get rotX(){return this.__rot_x}set rotY(e){this.__rot_y=e}get rotY(){return this.__rot_y}set maximumY(e){this.__maximum_y=e}set minimumY(e){this.__minimum_y=e}__rotateControl(e,t,n,i){const o=(n-e)*this.__efficiency*.3,a=(i-t)*this.__efficiency*.3;this.__rot_x=this.__rot_bgn_x-o,this.__rot_y=this.__rot_bgn_y-a,null!=this.__maximum_y&&this.__rot_y>this.__maximum_y&&(this.__rot_y=this.__maximum_y),null!=this.__minimum_y&&this.__rot_y35&&(this.__pinchInOutOriginalDistance=t,this.__pinchInOutControl=!0));const i=n/t;this.dolly*=Math.pow(i*this.__efficiency,2.2/15),this.__pinchInOutOriginalDistance=t}__pinchInOutEnd(e){e.touches.length<2&&(this.__pinchInOutControl=!1,this.__pinchInOutOriginalDistance=null)}__tryToPreventDefault(e){this.__doPreventDefault&&e.preventDefault()}__mouseWheel(e){this.__tryToPreventDefault(e),this.dolly+=Math.sign(e.deltaY)/200}__contextMenu(e){this.__tryToPreventDefault(e)}set dolly(e){e=Math.min(e,1),e=Math.max(e,1e-4);let t=Math.pow(e,5);t=Math.max(t,1e-4),this.__dolly=t}get dolly(){return Math.pow(this.__dolly,.2)}__mouseDblClick(e){e.shiftKey?this.__mouseTranslateVec.zero():e.ctrlKey&&(this.__rot_y=0,this.__rot_x=0,this.__rot_bgn_y=0,this.__rot_bgn_x=0)}__resetDollyAndPosition(e){if(e.touches.length>1)return;const t=(new Date).getTime();t-this.__resetDollyTouchTime<300?(this.dolly=Math.pow(.5,1/2.2),this.__mouseTranslateVec.zero(),this.__rot_x=0,this.__rot_y=0):this.__resetDollyTouchTime=t}__pressShift(e){!0===e.shiftKey&&(this.__isPressingShift=!0)}__releaseShift(e){!1===e.shiftKey&&(this.__isPressingShift=!1)}__pressCtrl(e){!0===e.ctrlKey&&(this.__isPressingCtrl=!0)}__releaseCtrl(e){!1===e.ctrlKey&&(this.__isPressingCtrl=!1)}registerEventListeners(){let e=window;_.Is.exist(u.D.eventTargetDom)&&(e=u.D.eventTargetDom),"ontouchend"in document?h.$t.register(h.jO,[{eventName:"touchstart",handler:this.__touchDownFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchmove",handler:this.__touchMoveFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchend",handler:this.__touchUpFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchmove",handler:this.__pinchInOutFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchend",handler:this.__pinchInOutEndFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchstart",handler:this.__resetDollyAndPositionFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"contextmenu",handler:this.__contextMenuFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"dblclick",handler:this.__mouseDblClickFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}]):h.$t.register(h.jO,[{eventName:"mousedown",handler:this.__mouseDownFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseup",handler:this.__mouseUpFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseleave",handler:this.__mouseUpFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mousemove",handler:this.__mouseMoveFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keydown",handler:this.__pressShiftFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keyup",handler:this.__releaseShiftFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keydown",handler:this.__pressCtrlFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keyup",handler:this.__releaseCtrlFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"contextmenu",handler:this.__contextMenuFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"wheel",handler:this.__mouseWheelFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"dblclick",handler:this.__mouseDblClickFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}])}unregisterEventListeners(){h.$t.unregister(h.jO)}__getFovyFromCamera(e){return e.fovy?e.fovy:a.k.radianToDegree(2*Math.atan(Math.abs(e.top-e.bottom)/(2*e.zNear)))}logic(e){this.__updated&&!this.autoUpdate||(this.__updateTargeting(e),this.__calculateInfluenceOfController(),this.__updateCameraComponent(e),this.__updated=!0)}__updateTargeting(e){const t=e.eye,n=e._direction,i=e._up,r=this.__eyeVec,l=this.__centerVec,c=this.__upVec.copyComponents(i);if(null==this.__targetEntity)r.copyComponents(t),l.copyComponents(n);else{if(null==this.__originalTargetAABB){const e=this.__targetEntity.tryToGetSceneGraph().worldAABB;this.__originalTargetAABB=e.clone()}if(this.followTargetAABB){const e=this.__targetEntity.tryToGetSceneGraph().worldAABB;l.copyComponents(e.centerPoint)}else l.copyComponents(this.__originalTargetAABB.centerPoint);const i=o.d6.subtractTo(t,n,r).normalize();let _=this.__fixedDolly?this.__fixedLengthOfCenterToEye:this.__originalTargetAABB.lengthCenterToCorner*(1+1/Math.tan(a.k.degreeToRadian(e.fovy/2)))*this.scaleOfLengthCenterToCamera;Math.abs(_)<1e-5&&(_=1),i.multiply(_).add(l);const h=e.entity.tryToGetSceneGraph();if(null!=h){const e=s.J.invertTo(h.matrixInner,d.__tmpMat44_0);e.multiplyVector3To(l,l),e.multiplyVector3To(r,r),e.multiplyVector3To(c,c)}}}__calculateInfluenceOfController(){const e=o.d6.subtractTo(this.__eyeVec,this.__centerVec,d.__tmpVec3_0);this.__fixedDolly?this.__lengthOfCenterToEye=this.__fixedLengthOfCenterToEye:(e.multiply(this.__dolly*this.dollyScale),this.__lengthOfCenterToEye=e.length());const t=this.__newUpVec,n=this.__newEyeVec,s=this.__newCenterVec,l=this.__newTangentVec;if(this.__isSymmetryMode){const c=d.__tmpVec3_1;c.setComponents(e.x,0,e.z);let _=i.P.angleOfVectors(c,d.__tmp_up);_*=Math.sign(c.cross(d.__tmp_up).y);const h=d.__tmp_rotateM_X,u=d.__tmp_rotateM_Y,m=d.__tmp_rotateM_Reset,f=d.__tmp_rotateM_Revert;h.rotateX(a.k.degreeToRadian(this.__rot_y)),u.rotateY(a.k.degreeToRadian(this.__rot_x)),m.rotateY(a.k.degreeToRadian(_)),f.rotateY(a.k.degreeToRadian(-_));const p=d.__tmp_rotateM;r.x.multiplyTo(h,m,p),p.multiplyByLeft(u),p.multiplyByLeft(f),p.multiplyVectorTo(this.__upVec,t),p.multiplyVectorTo(e,n).add(this.__centerVec),s.copyComponents(this.__centerVec);const v=d.__tmpVec3_2;o.d6.subtractTo(s,n,v),o.d6.crossTo(t,v,l),n.add(this.__mouseTranslateVec),s.add(this.__mouseTranslateVec)}else{const i=d.__tmp_rotateM_X,c=d.__tmp_rotateM_Y;i.rotateX(a.k.degreeToRadian(this.__rot_y)),c.rotateY(a.k.degreeToRadian(this.__rot_x));const _=r.x.multiplyTo(c,i,d.__tmp_rotateM);_.multiplyVectorTo(this.__upVec,t),_.multiplyVectorTo(e,n).add(this.__centerVec),s.copyComponents(this.__centerVec);const h=d.__tmpVec3_1;o.d6.subtractTo(s,n,h),o.d6.crossTo(t,h,l),n.add(this.__mouseTranslateVec),s.add(this.__mouseTranslateVec)}}__updateCameraComponent(e){const t=d.__tmpVec3_0.copyComponents(this.__newCenterVec);t.subtract(this.__newEyeVec).normalize(),this._calcZNearInner(e,this.__newEyeVec,t),this._calcZFarInner(e);const n=e.zFar/e.zNear/this.__scaleOfZNearAndZFar,i=e.left+n,o=e.right+n,r=e.top+n,s=e.bottom+n,l=this.__getFovyFromCamera(e);this.__fovyBias=Math.tan(a.k.degreeToRadian(l/2)),e.eyeInner=this.__newEyeVec,e.directionInner=this.__newCenterVec,e.upInner=this.__newUpVec,e.leftInner=i,e.rightInner=o,e.topInner=r,e.bottomInner=s,e.fovyInner=l}set scaleOfZNearAndZFar(e){this.__scaleOfZNearAndZFar=e}get scaleOfZNearAndZFar(){return this.__scaleOfZNearAndZFar}get isMouseDown(){return this.__isMouseDown}get lastMouseDownTimeStamp(){return this.__lastMouseDownTimeStamp}get lastMouseUpTimeStamp(){return this.__lastMouseUpTimeStamp}setFixedDollyTrue(e){this.__fixedLengthOfCenterToEye=e,this.__fixedDolly=!0}unsetFixedDolly(){this.__fixedDolly=!1}}d.__tmp_up=i.P.fromCopyArray([0,0,1]),d.__tmpVec3_0=o.d6.zero(),d.__tmpVec3_1=o.d6.zero(),d.__tmpVec3_2=o.d6.zero(),d.__tmp_rotateM_X=r.x.identity(),d.__tmp_rotateM_Y=r.x.identity(),d.__tmp_rotateM=r.x.identity(),d.__tmp_rotateM_Reset=r.x.identity(),d.__tmp_rotateM_Revert=r.x.identity(),d.__tmpMat44_0=l.e.identity()},4478:(e,t,n)=>{n.d(t,{I:()=>u});var i=n(5467),o=n(8547),a=n(9190),r=n(2566),s=n(3496),l=n(3658),c=n(3032),_=n(4690),h=n(4742);class u extends l.m{constructor(e={eventTargetDom:document,verticalSpeed:1,horizontalSpeed:1,turnSpeed:.25,mouseWheelSpeedScale:1,inverseVerticalRotating:!1,inverseHorizontalRotating:!1}){super(),this._isKeyDown=!1,this._isMouseDrag=!1,this._lastKeyCode=-1,this._currentDir=a.d6.fromCopyArray([0,0,-1]),this._currentPos=a.d6.fromCopyArray([0,0,0]),this._currentCenter=a.d6.fromCopyArray([0,0,-1]),this._currentHorizontalDir=a.d6.fromCopyArray([0,0,-1]),this._newDir=a.d6.fromCopyArray([0,0,-1]),this._isMouseDown=!1,this._clickedMouseXOnCanvas=-1,this._clickedMouseYOnCanvas=-1,this._draggedMouseXOnCanvas=-1,this._draggedMouseYOnCanvas=-1,this._deltaMouseXOnCanvas=-1,this._deltaMouseYOnCanvas=-1,this._mouseXAdjustScale=1,this._mouseYAdjustScale=1,this._deltaY=-1,this._deltaX=-1,this._mouseUpBind=this._mouseUp.bind(this),this._mouseDownBind=this._mouseDown.bind(this),this._mouseMoveBind=this._mouseMove.bind(this),this._mouseWheelBind=this._mouseWheel.bind(this),this.__doPreventDefault=!1,this._needInitialize=!0,this._horizontalSpeed=e.horizontalSpeed,this._verticalSpeed=e.verticalSpeed,this._turnSpeed=e.turnSpeed,this._mouseXAdjustScale=this._turnSpeed,this._mouseYAdjustScale=this._turnSpeed,this._mouseWheelSpeedScale=e.mouseWheelSpeedScale,this._inverseVerticalRotating=e.inverseVerticalRotating,this._inverseHorizontalRotating=e.inverseHorizontalRotating,this.reset(),this._onKeydown=e=>{this._isKeyDown=!0,this._lastKeyCode=e.keyCode},this._onKeyup=e=>{this._isKeyDown=!1,this._lastKeyCode=-1};const t=e.eventTargetDom;this.registerEventListeners(t)}registerEventListeners(e=document){this._eventTargetDom=e;const t=[{eventName:"keydown",handler:this._onKeydown,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keyup",handler:this._onKeyup,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}];"ontouchend"in document&&t.push({eventName:"touchstart",handler:this._mouseDownBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchend",handler:this._mouseUpBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchmove",handler:this._mouseMoveBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}),"onmouseup"in document&&t.push({eventName:"mousedown",handler:this._mouseDownBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseup",handler:this._mouseUpBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseleave",handler:this._mouseUpBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mousemove",handler:this._mouseMoveBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}),"onwheel"in document&&t.push({eventName:"wheel",handler:this._mouseWheelBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}),h.$t.register(h.jO,t)}unregisterEventListeners(){h.$t.unregister(h.jO)}__tryToPreventDefault(e){this.__doPreventDefault&&e.preventDefault()}_mouseWheel(e){if(null===this._currentDir)return;const t=-1*Math.sign(e.deltaY)*this._mouseWheelSpeedScale*this._horizontalSpeed,n=u.__tmp_Vec3_0;n.setComponents(this._currentDir.x,0,this._currentDir.z).normalize();const i=a.d6.multiplyTo(n,t,u.__tmp_Vec3_1);this._currentPos.add(i),this._currentCenter.add(i)}_mouseDown(e){this.__tryToPreventDefault(e),this._isMouseDown=!0;const t=e.target.getBoundingClientRect();return this._clickedMouseXOnCanvas=e.clientX-t.left,this._clickedMouseYOnCanvas=e.clientY-t.top,!1}_mouseMove(e){if(this.__tryToPreventDefault(e),!this._isMouseDown)return;const t=e.target.getBoundingClientRect();this._draggedMouseXOnCanvas=e.clientX-t.left,this._draggedMouseYOnCanvas=e.clientY-t.top,this._deltaMouseXOnCanvas=this._draggedMouseXOnCanvas-this._clickedMouseXOnCanvas,this._deltaMouseYOnCanvas=this._draggedMouseYOnCanvas-this._clickedMouseYOnCanvas,this._isMouseDrag=!0}_mouseUp(e){this._isMouseDown=!1,this._isMouseDrag=!1;const t=e.target;if(null==(null==t?void 0:t.getBoundingClientRect))return;const n=t.getBoundingClientRect();this._clickedMouseXOnCanvas=e.clientX-n.left,this._clickedMouseYOnCanvas=e.clientY-n.top}tryReset(){}reset(){this._isKeyDown=!1,this._lastKeyCode=-1,this._currentPos.zero(),this._currentCenter.setComponents(0,0,-1),this._currentDir.setComponents(0,0,-1),this._currentHorizontalDir.setComponents(0,0,-1),this._isMouseDown=!1,this._isMouseDrag=!1,this._draggedMouseXOnCanvas=-1,this._draggedMouseYOnCanvas=-1,this._deltaMouseXOnCanvas=-1,this._deltaMouseYOnCanvas=-1,this._mouseXAdjustScale=this._turnSpeed,this._mouseYAdjustScale=this._turnSpeed,this._deltaY=0,this._deltaX=0,this._newDir.setComponents(0,0,-1)}logic(e){this.__updateCameraComponent(e)}__updateCameraComponent(e){const t=this.__targetEntity.getSceneGraph().worldAABB;if(this._needInitialize&&null!=t){const n=t.lengthCenterToCorner*(1+1/Math.tan(c.k.degreeToRadian(e.fovy/2)));this._currentPos.copyComponents(t.centerPoint),this._currentPos.z+=n,this._currentCenter.copyComponents(t.centerPoint),this._currentDir.setComponents(0,0,-1);const o=e.entity.tryToGetSceneGraph();if(_.Is.exist(o)){const e=i.J.invertTo(o.matrixInner,u.__tmpInvMat);e.multiplyVector3To(this._currentPos,this._currentPos),e.multiplyVector3To(this._currentCenter,this._currentCenter)}this._needInitialize=!1}const n=this._deltaY/90;this._newDir.x=this._currentDir.x*(1-n),this._newDir.y=n,this._newDir.z=this._currentDir.z*(1-n),this._newDir.normalize(),this._currentHorizontalDir.x=this._currentDir.x,this._currentHorizontalDir.y=0,this._currentHorizontalDir.z=this._currentDir.z,this._currentHorizontalDir.normalize();const o=u.__tmp_Vec3_0.zero();switch(this._lastKeyCode){case 87:case 38:o.x=this._currentHorizontalDir.x*this._horizontalSpeed,o.z=this._currentHorizontalDir.z*this._horizontalSpeed;break;case 65:case 37:o.x=this._currentHorizontalDir.z*this._horizontalSpeed,o.z=-this._currentHorizontalDir.x*this._horizontalSpeed;break;case 83:case 40:o.x=-this._currentHorizontalDir.x*this._horizontalSpeed,o.z=-this._currentHorizontalDir.z*this._horizontalSpeed;break;case 68:case 39:o.x=-this._currentHorizontalDir.z*this._horizontalSpeed,o.z=this._currentHorizontalDir.x*this._horizontalSpeed;break;case 81:o.x=-this._newDir.x*this._horizontalSpeed,o.y=-this._newDir.y*this._horizontalSpeed,o.z=-this._newDir.z*this._horizontalSpeed;break;case 69:o.x=this._newDir.x*this._horizontalSpeed,o.y=this._newDir.y*this._horizontalSpeed,o.z=this._newDir.z*this._horizontalSpeed;break;case 82:o.y=this._verticalSpeed;break;case 70:o.y=-this._verticalSpeed}if(this._currentPos.add(o),this._currentCenter.add(o),this._isMouseDrag){this._inverseHorizontalRotating?this._deltaX=this._deltaMouseXOnCanvas*this._mouseXAdjustScale:this._deltaX=-this._deltaMouseXOnCanvas*this._mouseXAdjustScale,this._inverseVerticalRotating?this._deltaY+=this._deltaMouseYOnCanvas*this._mouseYAdjustScale:this._deltaY+=-this._deltaMouseYOnCanvas*this._mouseYAdjustScale,this._deltaY=Math.max(-120,Math.min(50,this._deltaY));const e=u.__tmpRotateMat.rotateY(c.k.degreeToRadian(this._deltaX));e.multiplyVectorTo(this._currentDir,this._currentDir);const t=a.d6.subtractTo(this._currentCenter,this._currentPos,u.__tmp_Vec3_1);e.multiplyVectorTo(t,t),t.x=t.x*(1-n),t.y=n,t.z=t.z*(1-n),t.normalize(),this._currentCenter.copyComponents(this._currentPos),this._currentCenter.add(t),this._clickedMouseXOnCanvas=this._draggedMouseXOnCanvas,this._clickedMouseYOnCanvas=this._draggedMouseYOnCanvas,this._deltaMouseXOnCanvas=0,this._deltaMouseYOnCanvas=0}e.eyeInner=this._currentPos,e.directionInner=this._currentCenter,e.upInner=e._up,e.leftInner=e.left,e.rightInner=e.right,e.topInner=e.top,e.bottomInner=e.bottom,e.fovyInner=e.fovy,this._calcZNearInner(e,this._currentPos,this._newDir),this._calcZFarInner(e)}getDirection(){return null!==this._currentCenter?this._newDir.clone():null}set horizontalSpeed(e){this._horizontalSpeed=e}get horizontalSpeed(){return this._horizontalSpeed}set verticalSpeed(e){this._verticalSpeed=e}get verticalSpeed(){return this._verticalSpeed}set mouseWheelSpeed(e){this._mouseWheelSpeedScale=e}get mouseWheelSpeed(){return this._mouseWheelSpeedScale}setTarget(e){const t=e.tryToGetSceneGraph().worldAABB.lengthCenterToCorner/10;this.verticalSpeed=t,this.horizontalSpeed=t,this.__targetEntity=e,this._needInitialize=!0}getTarget(){return this.__targetEntity}get allInfo(){const e={};return e.verticalSpeed=this.verticalSpeed,e.horizontalSpeed=this.horizontalSpeed,e._turnSpeed=this._turnSpeed,this._currentPos&&(e._currentPos=this._currentPos.clone()),this._currentCenter&&(e._currentCenter=this._currentCenter.clone()),this._currentDir&&(e._currentDir=this._currentDir.clone()),e._deltaY=this._deltaY,e._newDir=this._newDir.clone(),e}set allInfo(e){let t=e;"string"==typeof e&&(t=JSON.parse(e));for(const e in t)t.hasOwnProperty(e)&&e in this&&(this[e]="quaternion"===e?o.D.cloneOfMathObjects(o.D.arrayToQuaternion(t[e])):o.D.cloneOfMathObjects(o.D.arrayToVectorOrMatrix(t[e])))}}u.__tmpInvMat=s.e.identity(),u.__tmpRotateMat=r.x.identity(),u.__tmp_Vec3_0=a.d6.zero(),u.__tmp_Vec3_1=a.d6.zero()},1564:(e,t,n)=>{n.d(t,{c:()=>S});var i=n(9721),o=n(2404),a=n(1350),r=n(4710),s=n(3498),l=n(6692),c=n(4507),_=n(6098),h=n(8827),u=n(9207),d=n(2471),m=n(4690),f=n(8107),p=n(6456),v=n(7305),A=n(3991);function y(e,t,n){const i=n;return t.sampler.interpolationMethod===v.k.CubicSpline?4===t.sampler.outputComponentN?i[A.hx](3*t.sampler.outputComponentN*e+t.sampler.outputComponentN):3===t.sampler.outputComponentN?i[A.Up](3*t.sampler.outputComponentN*e+t.sampler.outputComponentN):1===t.sampler.outputComponentN?i[A.w0](3*t.sampler.outputComponentN*e+t.sampler.outputComponentN):i[A.fK](3*t.sampler.outputComponentN*e+t.sampler.outputComponentN,t.sampler.outputComponentN):4===t.sampler.outputComponentN?i[A.JI](e):3===t.sampler.outputComponentN?i[A.Dq](e):1===t.sampler.outputComponentN?i[A.GW](e):i[A.lx](e,t.sampler.outputComponentN)}function x(e,t){let n=0,i=0,o=e.length-1,a=0;for(;i<=o&&t>=e[i]&&t<=e[o];)if(n=Math.floor(i+(t-e[i])*(o-i)/(e[o]-e[i])),e[n].5?0===this.__isEffekseerState&&(null===(e=this.__effekseerComponent)||void 0===e||e.play()):1===this.__isEffekseerState&&(null===(t=this.__effekseerComponent)||void 0===t||t.pause()),this.__isEffekseerState=r[0])}}if(m.Is.exist(this.__secondActiveAnimationTrackName)&&this.__interpolationRatioBtwFirstAndSecond>0){const e=this.__animationTracks.get(this.__secondActiveAnimationTrackName);if(void 0!==e)for(const[t,i]of e){const e=s.s.fromString(t).index,o=g(i,n,e);if(e===s.s.Quaternion.index){const e=u._.fromCopyArray4(o);this.__transformComponent.localRotation=u._.qlerp(this.__transformComponent.localRotationInner,e,this.__interpolationRatioBtwFirstAndSecond)}else if(e===s.s.Translate.index){const e=d.P.fromCopyArray3(o);this.__transformComponent.localPosition=d.P.lerp(this.__transformComponent.localPositionInner,e,this.__interpolationRatioBtwFirstAndSecond)}else if(e===s.s.Scale.index){const e=d.P.fromCopyArray3(o);this.__transformComponent.localScale=d.P.lerp(this.__transformComponent.localScaleInner,e,this.__interpolationRatioBtwFirstAndSecond)}else if(e===s.s.Weights.index){const e=o;for(let t=0;t{const t=new Map;return this.__animationTracks.set(e,t),t}}),l={sampler:{input:n,output:i,outputComponentN:o,interpolationMethod:a},target:{pathName:t,entity:this.entity},belongTrackName:e};s.set(t,l);const c=n[0],h=n[n.length-1],u={name:e,minStartInputTime:c,maxEndInputTime:h};S.__animationGlobalInfo.set(e,u),S.__pubsub.publishAsync(S.Event.ChangeAnimationInfo,{infoMap:new Map(S.__animationGlobalInfo)}),this.entity.getTransform()._backupTransformAsRest()}getStartInputValueOfAnimation(e){const t=null!=e?e:this.__firstActiveAnimationTrackName;if(void 0===t){const e=Array.from(S.__animationGlobalInfo.values());return 0===e.length?0:e[0].maxEndInputTime}return(0,_.kS)({value:S.__animationGlobalInfo.get(t),defaultValue:b}).minStartInputTime}getEndInputValueOfAnimation(e){const t=null!=e?e:this.__firstActiveAnimationTrackName;if(void 0===t){const e=Array.from(S.__animationGlobalInfo.values());return 0===e.length?0:e[0].maxEndInputTime}return(0,_.kS)({value:S.__animationGlobalInfo.get(t),defaultValue:b}).maxEndInputTime}static getAnimationList(){return Array.from(this.__animationGlobalInfo.keys())}static getAnimationInfo(){return new Map(this.__animationGlobalInfo)}getAnimationTrackNames(){return Array.from(this.__animationTracks.keys())}getAnimationChannelsOfTrack(e){return this.__animationTracks.get(e)}get isAnimating(){return this.__isAnimating}static get startInputValue(){if(0===o.C.getComponentsWithType(S).length)return 0;{const e=Array.from(this.__animationGlobalInfo.values());return e[e.length-1].minStartInputTime}}static get endInputValue(){if(0===o.C.getComponentsWithType(S).length)return 0;{const e=Array.from(this.__animationGlobalInfo.values());return e[e.length-1].maxEndInputTime}}static get componentTID(){return r.z.AnimationComponentTID}get componentTID(){return r.z.AnimationComponentTID}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getAnimation(){return this.getComponentByComponentTID(r.z.AnimationComponentTID)}}return(0,a.e)(e,n),e}addKeyFrame(e,t,n,i){const o=n/i,a=o,r=(n+1)/i,l=this.__animationTracks.get(e);if(m.Is.not.exist(l))return!1;const c=l.get(t);if(m.Is.not.exist(c))return!1;ArrayBuffer.isView(c.sampler.input)&&(c.sampler.input=Array.from(c.sampler.input)),ArrayBuffer.isView(c.sampler.output)&&(c.sampler.output=Array.from(c.sampler.output));const _=s.s.fromString(t).index,h=g(c,S.globalTime,_);if(0===c.sampler.input.length)c.sampler.input.push(a),c.sampler.output.push(...h);else if(1===c.sampler.input.length){const e=c.sampler.input[0];r{n.d(t,{x:()=>l});var i=n(9721),o=n(2404),a=n(1350),r=n(4710),s=n(4507);class l extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__weights=[],this.__targetNames=[],this.moveStageTo(s.I.Logic)}static get componentTID(){return r.z.BlendShapeComponentTID}get componentTID(){return r.z.BlendShapeComponentTID}set weights(e){this.__weights=e}get weights(){return this.__weights}set targetNames(e){this.__targetNames=e}get targetNames(){return this.__targetNames}setWeightByIndex(e,t){this.__weights[e]=t}$logic(){}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getBlendShape(){return this.getComponentByComponentTID(r.z.BlendShapeComponentTID)}}return(0,a.e)(e,n),e}}o.C.registerComponentClass(l)},224:(e,t,n)=>{n.d(t,{M:()=>w});var i=n(2404),o=n(9721),a=n(1350),r=n(4710),s=n(2471),l=n(7192),c=n(9646),_=n(5467),h=n(8491),u=n(752),d=n(3999),m=n(3496),f=n(4507),p=n(4536),v=n(9190),A=n(6477),y=n(3258),x=n(7348),g=n(4587),I=n(3032),b=n(2251),E=n(4690),T=n(5634),S=n(8430),C=n(7683);class w extends o.w{constructor(e,t,n,i){if(super(e,t,n,i),this._eyeInner=v.d6.dummy(),this._direction=v.d6.dummy(),this._directionInner=v.d6.dummy(),this._up=v.d6.dummy(),this._upInner=v.d6.dummy(),this._filmWidth=36,this._filmHeight=24,this._focalLength=20,this.primitiveMode=!1,this._corner=p.xQ.dummy(),this._cornerInner=p.xQ.dummy(),this._parameters=p.xQ.dummy(),this._parametersInner=p.xQ.dummy(),this.__type=c.i.Perspective,this._projectionMatrix=m.e.dummy(),this.__isProjectionMatrixUpToDate=!1,this._viewMatrix=m.e.dummy(),this.__isViewMatrixUpToDate=!1,this._xrLeft=!1,this._xrRight=!1,this.isSyncToLight=!1,this.__frustum=new A.i,this._setMaxNumberOfComponent(Math.max(10,Math.floor(y.D.maxEntityNumber/100))),this.setFovyAndChangeFocalLength(90),-1===w.current&&(w.current=t),this.registerMember(u.$.CPUGeneric,"eyeInner",v.d6,d.r.Float,[0,0,0]),this.registerMember(u.$.CPUGeneric,"direction",v.d6,d.r.Float,[0,0,-1]),this.registerMember(u.$.CPUGeneric,"up",v.d6,d.r.Float,[0,1,0]),this.registerMember(u.$.CPUGeneric,"directionInner",v.d6,d.r.Float,[0,0,-1]),this.registerMember(u.$.CPUGeneric,"upInner",v.d6,d.r.Float,[0,1,0]),this.registerMember(u.$.CPUGeneric,"corner",p.xQ,d.r.Float,[-1,1,1,-1]),this.registerMember(u.$.CPUGeneric,"cornerInner",p.xQ,d.r.Float,[-1,1,1,-1]),this.registerMember(u.$.CPUGeneric,"parameters",p.xQ,d.r.Float,[.1,1e4,90,1]),this.registerMember(u.$.CPUGeneric,"parametersInner",p.xQ,d.r.Float,[.1,1e4,90,1]),this.registerMember(u.$.CPUGeneric,"projectionMatrix",m.e,d.r.Float,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.registerMember(u.$.CPUGeneric,"viewMatrix",m.e,d.r.Float,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.submitToAllocation(y.D.maxCameraNumber,i),i)return;const o=x.$.getInstance();o.takeOne(g.f5.ViewMatrix),o.takeOne(g.f5.ProjectionMatrix),o.takeOne(g.f5.ViewPosition)}static set current(e){this.__current=e}static get current(){return this.__current}set type(e){this.__type=e,e===c.i.Orthographic?(this._parameters.z=1,this._parameters.w=1,this._parametersInner.z=1,this._parametersInner.w=1):(this.setFovyAndChangeFocalLength(90),this._parameters.w=1,this._parametersInner.z=90,this._parametersInner.w=1)}get type(){return this.__type}get eye(){return w._eye}set eye(e){throw Error("In Rhodonite, eye is always (0,0,0). Use TransformComponent for Camera positioning.")}get eyeInner(){return this._eyeInner}set eyeInner(e){this._eyeInner.copyComponents(e)}set upInner(e){this._upInner.copyComponents(e)}set up(e){this._up.copyComponents(e)}get up(){return this._up.clone()}get upInner(){return this._upInner}set direction(e){const t=this._direction,n=e,i=this._up;let o;if(0===v.d6.crossTo(n,i,w.__tmpVector3_0).length()){const e=v.d6.crossTo(t,i,w.__tmpVector3_1);o=v.d6.crossTo(e,n,w.__tmpVector3_2)}else{const e=v.d6.multiplyTo(n,n.dot(i),w.__tmpVector3_1);o=v.d6.subtractTo(i,e,w.__tmpVector3_2)}this._up.copyComponents(o).normalize(),this._direction.copyComponents(n)}set directionInner(e){this._directionInner.copyComponents(e)}get direction(){return this._direction.clone()}get directionInner(){return this._directionInner}set corner(e){this._corner.copyComponents(e)}get corner(){return this._corner.clone()}set left(e){this._corner.x=e}set leftInner(e){this._cornerInner.x=e}get left(){return this._corner.x}set right(e){this._corner.y=e}set rightInner(e){this._cornerInner.y=e}get right(){return this._corner.y}set top(e){this._corner.z=e}set topInner(e){this._cornerInner.z=e}get top(){return this._corner.z}set bottom(e){this._corner.w=e}set bottomInner(e){this._cornerInner.w=e}get bottom(){return this._corner.w}set cornerInner(e){this._cornerInner.copyComponents(e)}get cornerInner(){return this._cornerInner}set parametersInner(e){this._parametersInner.copyComponents(e)}get parametersInner(){return this._parametersInner}get parameters(){return this._parameters.clone()}set zNear(e){this._parameters.x=e}set zNearInner(e){this._parametersInner.x=e}get zNearInner(){return this._parametersInner.x}get zNear(){return this._parameters.x}set focalLength(e){this._focalLength=e,this._parameters.z=2*I.k.radianToDegree(Math.atan(this._filmHeight/(2*e)))}get focalLength(){return this._focalLength}set zFar(e){this._parameters.y=e}set zFarInner(e){this._parametersInner.y=e}get zFarInner(){return this._parametersInner.y}get zFar(){return this._parameters.y}setFovyAndChangeFilmSize(e){this._parameters.z=e,this._filmHeight=2*this.focalLength*Math.tan(I.k.degreeToRadian(e)/2),this._filmWidth=this._filmHeight*this.aspect}setFovyAndChangeFocalLength(e){this._parameters.z=e,this._focalLength=this._filmHeight/2/Math.tan(I.k.degreeToRadian(e)/2)}get fovy(){return this._parameters.z}set fovyInner(e){this._parametersInner.z=e}set aspect(e){this._parameters.w=e,this._filmWidth=this._filmHeight*e}set aspectInner(e){this._parametersInner.w=e}get aspectInner(){return this._parametersInner.w}get aspect(){return this._parameters.w}set xMag(e){this._parameters.z=e}get xMag(){return this._parameters.z}set yMag(e){this._parameters.w=e}get yMag(){return this._parameters.w}static get componentTID(){return r.z.CameraComponentTID}get componentTID(){return r.z.CameraComponentTID}calcProjectionMatrix(){const e=this._parametersInner.x,t=this._parametersInner.y;if(S.l.currentProcessApproach===C.V.WebGPU)if(this.type===c.i.Perspective){const n=this._parametersInner.z,i=this._parametersInner.w,o=1/Math.tan(.5*n*Math.PI/180),a=o/i;if(this._projectionMatrix.m00=a,this._projectionMatrix.m01=0,this._projectionMatrix.m02=0,this._projectionMatrix.m03=0,this._projectionMatrix.m10=0,this._projectionMatrix.m11=o,this._projectionMatrix.m12=0,this._projectionMatrix.m13=0,this._projectionMatrix.m20=0,this._projectionMatrix.m21=0,t===1/0){const n=1/(e-t);this._projectionMatrix.m22=t*n,this._projectionMatrix.m23=t*e*n}else this._projectionMatrix.m22=-1,this._projectionMatrix.m23=-e;this._projectionMatrix.m30=0,this._projectionMatrix.m31=0,this._projectionMatrix.m32=-1,this._projectionMatrix.m33=0}else if(this.type===c.i.Orthographic){const n=this._parametersInner.z,i=this._parametersInner.w;this._projectionMatrix.setComponents(1/n,0,0,0,0,1/i,0,0,0,0,-1/(t-e),-e/(t-e),0,0,0,1)}else{const n=this._cornerInner.x,i=this._cornerInner.y,o=this._cornerInner.z,a=this._cornerInner.w,r=1/(e-t);this._projectionMatrix.setComponents(2*e/(i-n),0,(i+n)/(i-n),0,0,2*e/(o-a),(o+a)/(o-a),0,0,0,t*r,t*e*r,0,0,-1,0)}else if(this.type===c.i.Perspective){const n=this._parametersInner.z,i=this._parametersInner.w,o=1/Math.tan(.5*n*Math.PI/180),a=o/i;if(this._projectionMatrix.m00=a,this._projectionMatrix.m01=0,this._projectionMatrix.m02=0,this._projectionMatrix.m03=0,this._projectionMatrix.m10=0,this._projectionMatrix.m11=o,this._projectionMatrix.m12=0,this._projectionMatrix.m13=0,this._projectionMatrix.m20=0,this._projectionMatrix.m21=0,t===1/0){const n=1/(e-t);this._projectionMatrix.m22=(t+e)*n,this._projectionMatrix.m23=2*t*e*n}else this._projectionMatrix.m22=-1,this._projectionMatrix.m23=-2*e;this._projectionMatrix.m30=0,this._projectionMatrix.m31=0,this._projectionMatrix.m32=-1,this._projectionMatrix.m33=0}else if(this.type===c.i.Orthographic){const n=this._parametersInner.z,i=this._parametersInner.w;this._projectionMatrix.setComponents(1/n,0,0,0,0,1/i,0,0,0,0,-2/(t-e),-(t+e)/(t-e),0,0,0,1)}else{const n=this._cornerInner.x,i=this._cornerInner.y,o=this._cornerInner.z,a=this._cornerInner.w,r=1/(e-t);this._projectionMatrix.setComponents(2*e/(i-n),0,(i+n)/(i-n),0,0,2*e/(o-a),(o+a)/(o-a),0,0,0,(t+e)*r,2*t*e*r,0,0,-1,0)}return this._projectionMatrix}calcViewMatrix(){const e=this.eyeInner,t=v.d6.subtractTo(this._directionInner,e,w.__tmpVector3_0).normalize(),n=v.d6.crossTo(t,this._upInner,w.__tmpVector3_1).normalize(),i=v.d6.crossTo(n,t,w.__tmpVector3_2);if(this._viewMatrix.setComponents(n.x,n.y,n.z,-s.P.dot(n,e),i.x,i.y,i.z,-s.P.dot(i,e),-t.x,-t.y,-t.z,s.P.dot(t,e),0,0,0,1),!this.primitiveMode){const e=m.e.invertTo(this.__sceneGraphComponent.matrixInner,w.__tmpMatrix44_0);this._viewMatrix.multiply(e)}return this._viewMatrix}get viewMatrix(){return this._viewMatrix}set viewMatrix(e){this._viewMatrix.copyComponents(e)}get projectionMatrix(){if(this._xrLeft||this._xrRight){const e=b.x.getInstance().getModule("xr");if(null==e?void 0:e.WebXRSystem.getInstance().isWebXRMode){const t=e.WebXRSystem.getInstance();if(this._xrLeft)return t.leftProjectionMatrix;if(this._xrRight)return t.rightProjectionMatrix}}return this._projectionMatrix}set projectionMatrix(e){this._projectionMatrix.copyComponents(e)}get viewProjectionMatrix(){return m.e.multiplyTo(this._projectionMatrix,this._viewMatrix,w.__tmpMatrix44_0)}get biasViewProjectionMatrix(){return m.e.multiplyTo(this._projectionMatrix,this._viewMatrix,w.__tmpMatrix44_0),m.e.multiplyTo(w.__biasMatrix,w.__tmpMatrix44_0,w.__tmpMatrix44_1)}setValuesToGlobalDataRepositoryOnlyMatrices(){w.__globalDataRepository.setValue(g.f5.ViewMatrix,this.componentSID,this.viewMatrix),w.__globalDataRepository.setValue(g.f5.ProjectionMatrix,this.componentSID,this.projectionMatrix)}setValuesToGlobalDataRepository(){w.__globalDataRepository.setValue(g.f5.ViewMatrix,this.componentSID,this.viewMatrix),w.__globalDataRepository.setValue(g.f5.ProjectionMatrix,this.componentSID,this.projectionMatrix),w.__globalDataRepository.setValue(g.f5.ViewPosition,this.componentSID,this.worldPosition)}get worldPosition(){var e;return null===(e=this.__sceneGraphComponent)||void 0===e||e.matrixInner.multiplyVector3To(this.eyeInner,w.returnVector3),w.returnVector3}updateFrustum(){this.__frustum.update(this.viewMatrix,this.projectionMatrix)}get frustum(){return this.__frustum}$create(){this.__sceneGraphComponent=a.g.getComponentOfEntity(this.__entityUid,h.a),this.moveStageTo(f.I.Logic)}$logic({renderPass:e}){const t=this.entity.tryToGetLight();if(this.isSyncToLight&&E.Is.exist(t)){if(this._eyeInner.copyComponents(w._eye),this._directionInner.copyComponents(this._direction),this._upInner.copyComponents(this._up),t.type===T.v.Spot)this.type=c.i.Perspective,this.setFovyAndChangeFilmSize(I.k.radianToDegree(t.outerConeAngle)),this._cornerInner.copyComponents(this._corner),this.aspect=1,this.zNear=.1,this.zFar=-1!==t.range?t.range:1e4,this._parametersInner.copyComponents(this._parameters);else if(t.type===T.v.Directional){this.type=c.i.Orthographic;const e=t.shadowAreaSizeForDirectionalLight;this._cornerInner.copyComponents(l.Lt.fromCopy4(-e,e,e,-e)),this.aspect=1,this.zNear=.1,this.zFar=-1!==t.range?t.range:100,this._parametersInner.copyComponents(this._parameters)}}else{const e=this.entity.tryToGetCameraController();E.Is.exist(e)?this._parametersInner.w=this._parameters.w:this.primitiveMode||(this._eyeInner.copyComponents(w._eye),this._directionInner.copyComponents(this._direction),this._upInner.copyComponents(this._up),this._cornerInner.copyComponents(this._corner),this._parametersInner.copyComponents(this._parameters))}this.calcViewMatrix(),this._xrLeft||this._xrRight||this.calcProjectionMatrix(),this.setValuesToGlobalDataRepository()}static getCurrentCameraEntity(){return i.C.getComponent(this,this.current).entity}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getCamera(){return this.getComponentByComponentTID(r.z.CameraComponentTID)}}return(0,a.e)(e,n),e}}w._eye=s.P.zero(),w.__current=-1,w.returnVector3=v.d6.zero(),w.__globalDataRepository=x.$.getInstance(),w.__tmpVector3_0=v.d6.zero(),w.__tmpVector3_1=v.d6.zero(),w.__tmpVector3_2=v.d6.zero(),w.__tmpMatrix44_0=m.e.zero(),w.__tmpMatrix44_1=m.e.zero(),w.__biasMatrix=_.J.fromCopy16ColumnMajor(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1),i.C.registerComponentClass(w)},5496:(e,t,n)=>{n.d(t,{S:()=>u});var i=n(9721),o=n(1350),a=n(224),r=n(4507),s=n(2404),l=n(4710),c=n(6547),_=n(4478),h=n(8914);class u extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__cameraController=new c.j}set type(e){this.__cameraController.unregisterEventListeners(),e===h.M.Orbit?this.__cameraController=new c.j:e===h.M.WalkThrough?this.__cameraController=new _.I:console.warn("Not support type!")}get type(){return this.__cameraController instanceof c.j?h.M.Orbit:h.M.WalkThrough}get controller(){return this.__cameraController}static get componentTID(){return l.z.CameraControllerComponentTID}get componentTID(){return l.z.CameraControllerComponentTID}$create(){this.__cameraComponent=o.g.getComponentOfEntity(this.__entityUid,a.M),this.moveStageTo(r.I.Logic)}$logic(){this.__cameraController&&this.__cameraController.logic(this.__cameraComponent)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getCameraController(){return this.getComponentByComponentTID(l.z.CameraControllerComponentTID)}}return(0,o.e)(e,n),e}}s.C.registerComponentClass(u)},6683:(e,t,n)=>{n.d(t,{r:()=>A});var i=n(2404),o=n(9721),a=n(1350),r=n(4710),s=n(5634),l=n(2471),c=n(8491),_=n(4507),h=n(3258),u=n(7348),d=n(4587),m=n(4536),f=n(4255),p=n(6128),v=n(4690);class A extends o.w{constructor(e,t,n,i){super(e,t,n,i),this.type=s.v.Point,this.__intensity=l.P.fromCopyArray([1,1,1]),this.__initialDirection=l.P.fromCopyArray([0,0,-1]),this.__direction=l.P.fromCopyArray([0,0,-1]),this.innerConeAngle=0,this.outerConeAngle=Math.PI/4,this.range=-1,this.enable=!0,this.shadowAreaSizeForDirectionalLight=10,this._setMaxNumberOfComponent(Math.max(10,Math.floor(h.D.maxEntityNumber/100)))}static get componentTID(){return r.z.LightComponentTID}get componentTID(){return r.z.LightComponentTID}get direction(){return this.__direction}set intensity(e){this.__intensity=e}get intensity(){return this.__intensity}get _up(){return l.P.fromCopy3(0,1,0)}set isLightGizmoVisible(e){e?(v.Is.not.defined(this.__lightGizmo)&&(this.__lightGizmo=new p.SU(this.entity),this.__lightGizmo._setup()),this.__lightGizmo.isVisible=!0):v.Is.defined(this.__lightGizmo)&&(this.__lightGizmo.isVisible=!1)}get isLightGizmoVisible(){return!!v.Is.defined(this.__lightGizmo)&&this.__lightGizmo.isVisible}$create(){this.__sceneGraphComponent=a.g.getComponentOfEntity(this.__entityUid,c.a),this.moveStageTo(_.I.Load)}$load(){const e=i.C.getComponentsWithType(A);A.__globalDataRepository.getValue(d.f5.CurrentComponentSIDs,0)._v[r.z.LightComponentTID]=e.length,A.__lightPositions=A.__globalDataRepository.getValue(d.f5.LightPosition,0),A.__lightDirections=A.__globalDataRepository.getValue(d.f5.LightDirection,0),A.__lightIntensities=A.__globalDataRepository.getValue(d.f5.LightIntensity,0),A.__lightProperties=A.__globalDataRepository.getValue(d.f5.LightProperty,0),this.moveStageTo(_.I.Logic)}__updateGizmo(){v.Is.defined(this.__lightGizmo)&&this.__lightGizmo.isSetup&&this.isLightGizmoVisible&&this.__lightGizmo._update()}$logic(){this.__direction=this.__sceneGraphComponent.normalMatrixInner.multiplyVector(this.__initialDirection);const e=1/Math.max(.001,Math.cos(this.innerConeAngle)-Math.cos(this.outerConeAngle)),t=-Math.cos(this.outerConeAngle)*e;A.__lightDirections._v[3*this.componentSID+0]=this.__direction.x,A.__lightDirections._v[3*this.componentSID+1]=this.__direction.y,A.__lightDirections._v[3*this.componentSID+2]=this.__direction.z;const n=this.__sceneGraphComponent.worldPosition;A.__lightPositions._v[3*this.componentSID+0]=n.x,A.__lightPositions._v[3*this.componentSID+1]=n.y,A.__lightPositions._v[3*this.componentSID+2]=n.z,A.__lightIntensities._v[3*this.componentSID+0]=this.__intensity.x,A.__lightIntensities._v[3*this.componentSID+1]=this.__intensity.y,A.__lightIntensities._v[3*this.componentSID+2]=this.__intensity.z,A.__lightProperties._v[4*this.componentSID+0]=this.enable?this.type.index:-1,A.__lightProperties._v[4*this.componentSID+1]=this.range,A.__lightProperties._v[4*this.componentSID+2]=e,A.__lightProperties._v[4*this.componentSID+3]=t,this.__updateGizmo()}_destroy(){super._destroy(),A.__lightIntensities._v[3*this.componentSID+0]=0,A.__lightIntensities._v[3*this.componentSID+1]=0,A.__lightIntensities._v[3*this.componentSID+2]=0}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getLight(){return this.getComponentByComponentTID(r.z.LightComponentTID)}}return(0,a.e)(e,n),e}}A.__globalDataRepository=u.$.getInstance(),A.__tmp_vec4=m.xQ.zero(),A.__lightPositions=new f.j(new Float32Array(0)),A.__lightDirections=new f.j(new Float32Array(0)),A.__lightIntensities=new f.j(new Float32Array(0)),A.__lightProperties=new f.j(new Float32Array(0)),i.C.registerComponentClass(A)},4097:(e,t,n)=>{n.d(t,{$:()=>A});var i=n(2404),o=n(9721),a=n(1350),r=n(4710),s=n(4507),l=n(2471),c=n(7192),_=n(8491),h=n(5467),u=n(3496),d=n(8547),m=n(9190),f=n(4690),p=n(6456),v=n(6098);class A extends o.w{constructor(e,t,n,i){super(e,t,n,i),this.__viewDepth=-Number.MAX_VALUE,this.isPickable=!0,this.moveStageTo(s.I.Create)}static get componentTID(){return r.z.MeshComponentTID}get componentTID(){return r.z.MeshComponentTID}setMesh(e){this.__mesh=e,e._belongToMeshComponent(this)}unsetMesh(){return null!=this.__mesh&&(this.__mesh=void 0,!0)}get mesh(){return this.__mesh}calcViewDepth(e){if(f.Is.not.exist(this.__mesh))return Number.MAX_VALUE;const t=this.__mesh.AABB.centerPoint,n=this.entity.tryToGetSkeletal();f.Is.exist(n)&&f.Is.exist(n._bindShapeMatrix)&&n._bindShapeMatrix.multiplyVector3To(this.__mesh.AABB.centerPoint,t);const i=this.entity.getSceneGraph().matrixInner.multiplyVector3To(t,A.__tmpVector3_0),o=e.viewMatrix.multiplyVector3To(i,A.__tmpVector3_1);return this.__viewDepth=o.z,this.__viewDepth}get viewDepth(){return this.__viewDepth}static alertNoMeshSet(e){console.debug("No mesh is set on this MeshComponent:"+e.componentSID)}castRay(e,t,n=0){if(this.__mesh){let i=e,o=t;if(this.__sceneGraphComponent){const a=h.J.invert(this.__sceneGraphComponent.matrixInner);i=l.P.fromCopyVector4(a.multiplyVector(c.Lt.fromCopyVector3(e)));const r=l.P.add(e,t),s=l.P.fromCopyVector4(a.multiplyVector(c.Lt.fromCopyVector3(r)));o=l.P.normalize(l.P.subtract(s,i));const _=this.__mesh.castRay(i,o,n);let u=null;if(f.Is.defined(_.data)&&_.data.t>=0)return u=l.P.fromCopyVector4(this.__sceneGraphComponent.matrixInner.multiplyVector(c.Lt.fromCopyVector3(_.data.position))),{result:!0,data:{t:_.data.t,u:_.data.u,v:_.data.v,position:u}}}}return{result:!1}}castRayFromScreenInLocal(e,t,n,i,o=0){if(this.__mesh&&this.__sceneGraphComponent){const a=u.e.multiplyTo(n.projectionMatrix,n.viewMatrix,A.__tmpMatrix44_0).multiply(this.__sceneGraphComponent.matrixInner).invert(),r=d.D.unProjectTo(e,t,0,a,i,A.__tmpVector3_0),s=d.D.unProjectTo(e,t,1,a,i,A.__tmpVector3_1),l=m.d6.subtractTo(s,r,A.__tmpVector3_2).normalize(),c=this.__mesh.castRay(r,l,o);if(f.Is.defined(c.data)&&c.data.t>=0)return{result:!0,data:{t:c.data.t,u:c.data.u,v:c.data.v,position:c.data.position}}}return{result:!1}}castRayFromScreenInWorld(e,t,n,i,o=0){const a=this.castRayFromScreenInLocal(e,t,n,i,o);if(this.__mesh&&this.__sceneGraphComponent&&a.result){(0,v.dK)(a.data);const e=this.__sceneGraphComponent.matrixInner.multiplyVector3To(a.data.position,A.__returnVector3);return{result:!0,data:{t:a.data.t,u:a.data.u,v:a.data.v,position:e}}}return a}$create(){this.__blendShapeComponent=a.g.getComponentOfEntity(this.__entityUid,p.x),this.__sceneGraphComponent=a.g.getComponentOfEntity(this.__entityUid,_.a),this.moveStageTo(s.I.Load)}static common_$load({processApproach:e}){const t=i.C.getComponentsWithType(A);for(const e of t){const t=e.mesh;if(!f.Is.exist(t))continue;const n=t.getPrimitiveNumber();for(let i=0;i0&&this.__mesh._calcBaryCentricCoord(),this.moveStageTo(s.I.Logic))}$logic(){}_shallowCopyFrom(e){const t=e;this.__viewDepth=t.__viewDepth,f.Is.exist(t.__mesh)&&this.setMesh(t.__mesh),this.isPickable=t.isPickable}_destroy(){this.__mesh&&(this.__mesh=void 0)}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getMesh(){return this.getComponentByComponentTID(r.z.MeshComponentTID)}}return(0,a.e)(e,n),e}}A.__tmpVector3_0=m.d6.zero(),A.__tmpVector3_1=m.d6.zero(),A.__tmpVector3_2=m.d6.zero(),A.__returnVector3=m.d6.zero(),A.__tmpMatrix44_0=u.e.zero(),A.__latestPrimitivePositionAccessorVersion=0,i.C.registerComponentClass(A)},9974:(e,t,n)=>{n.d(t,{Y:()=>m});var i=n(2404),o=n(9721),a=n(4097),r=n(7683),s=n(4507),l=n(1350),c=n(4710),_=n(224),h=n(2251),u=n(4339),d=n(4327);class m extends o.w{constructor(e,t,n,i){super(e,t,n,i),this.diffuseCubeMapContribution=1,this.specularCubeMapContribution=1,this.rotationOfCubeMap=0,this._readyForRendering=!1}static get componentTID(){return c.z.MeshRendererComponentTID}get componentTID(){return c.z.MeshRendererComponentTID}$create(){this.__meshComponent=l.g.getComponentOfEntity(this.__entityUid,a.$),this.moveStageTo(s.I.Load)}static common_$load({processApproach:e}){const t=h.x.getInstance();if(e===r.V.WebGPU){const e="webgpu",n=t.getModule(e);m.__webglRenderingStrategy=n.WebGpuStrategyBasic.getInstance()}else{const n="webgl",i=t.getModule(n);m.__webglRenderingStrategy=i.getRenderingStrategy(e)}}$load(){m.__webglRenderingStrategy.$load(this.__meshComponent),this.diffuseCubeMap&&!this.diffuseCubeMap.startedToLoad&&this.diffuseCubeMap.loadTextureImagesAsync(),this.specularCubeMap&&!this.specularCubeMap.startedToLoad&&this.specularCubeMap.loadTextureImagesAsync()}static common_$prerender(){m.__webglRenderingStrategy.common_$prerender()}static sort_$render(e){return m.sort_$render_inner(e)}static sort_$render_inner(e){let t=e.cameraComponent;null==t&&(t=i.C.getComponent(_.M,_.M.current));let n=[];const o=e.meshComponents;n=m.__cullingWithViewFrustum(t,o,e),n=Array.from(new Set(n)),n.sort(((e,t)=>{const n=e._sortkey-t._sortkey;return 0===n?e._viewDepth-t._viewDepth:n}));const a=n.map((e=>e.primitiveUid));a.push(-1),m._lastOpaqueIndex=n.length-1,m._lastTransparentIndex=-1,m._firstTransparentSortKey=-1,m._lastTransparentSortKey=-1;for(let e=0;e>i&1){m._lastOpaqueIndex=e-1,m._firstTransparentSortKey=t._sortkey;break}}return n.length>0&&(m._lastTransparentIndex=n.length-1,m._lastTransparentSortKey=n[n.length-1]._sortkey),a}static __cullingWithViewFrustum(e,t,n){let i=[];if(e&&m.isViewFrustumCullingEnabled){e.updateFrustum();const n=e.frustum,o=(e,t)=>{if("background-assets"===e.entity.getTagValue("type")||n.culling(e)){t.push(e),e.entity.getSceneGraph()._isCulled=!1;const n=e.entity.tryToGetSkeletal();void 0!==n&&(n._isCulled=!1)}else{e.entity.getSceneGraph()._isCulled=!0;const t=e.entity.tryToGetSkeletal();void 0!==t&&(t._isCulled=!0)}};for(const e of t)o(e,i)}else i=n.meshComponents;const o=[];for(let t=0;t{n.d(t,{Z:()=>c});var i=n(9721),o=n(2404),a=n(1350),r=n(4710),s=n(4507),l=n(7431);class c extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.moveStageTo(s.I.Logic)}static get componentTID(){return r.z.PhysicsComponentTID}get componentTID(){return r.z.PhysicsComponentTID}setStrategy(e){this.__strategy=e}get strategy(){return this.__strategy}static common_$logic(){l.q.update()}$logic(){var e;null===(e=this.__strategy)||void 0===e||e.update()}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getPhysics(){return this.getComponentByComponentTID(r.z.PhysicsComponentTID)}}return(0,a.e)(e,n),e}}o.C.registerComponentClass(c)},8491:(e,t,n)=>{n.d(t,{a:()=>b});var i=n(2404),o=n(9721),a=n(5467),r=n(1350),s=n(3999),l=n(4710),c=n(752),_=n(4507),h=n(3496),u=n(2566),d=n(2471),m=n(2477),f=n(9190),p=n(817),v=n(7326),A=n(4690),y=n(9244),x=n(7859),g=n(4020),I=n(7431);class b extends o.w{constructor(e,t,n,i){super(e,t,n,i),this.__children=[],this.__gizmoChildren=[],this._worldMatrix=h.e.dummy(),this._worldMatrixRest=h.e.dummy(),this._normalMatrix=u.x.dummy(),this.__isWorldMatrixUpToDate=!1,this.__isWorldMatrixRestUpToDate=!1,this.__isNormalMatrixUpToDate=!1,this.__tmpMatrix=h.e.identity(),this.__worldAABB=new m.m,this.__isWorldAABBDirty=!0,this._isVisible=g.DU.dummy(),this._isBillboard=g.DU.dummy(),this.__transformGizmoSpace="world",this.__latestPrimitivePositionAccessorVersion=0,this.toMakeWorldMatrixTheSameAsLocalMatrix=!1,this.isRootJoint=!1,this.jointIndex=-1,this._isCulled=!1,b.__sceneGraphs.push(this),this.registerMember(c.$.GPUInstanceData,"worldMatrix",h.e,s.r.Float,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.registerMember(c.$.GPUInstanceData,"normalMatrix",u.x,s.r.Float,[1,0,0,0,1,0,0,0,1]),this.registerMember(c.$.GPUInstanceData,"isVisible",g.DU,s.r.Float,[1]),this.registerMember(c.$.GPUInstanceData,"isBillboard",g.DU,s.r.Float,[0]),this.submitToAllocation(this.maxNumberOfComponent,i)}set isVisible(e){this._isVisible.setValue(e?1:0)}get isVisible(){return 1===this._isVisible.getValue()}setVisibilityRecursively(e){this.isVisible=e;for(const t of this.__children)t.setVisibilityRecursively(e)}set isBillboard(e){this._isBillboard.setValue(e?1:0)}get isBillboard(){return 1===this._isBillboard.getValue()}setIsBillboardRecursively(e){this._isBillboard.setValue(e?1:0);for(const t of this.__children)t.isBillboard=e}set isAABBGizmoVisible(e){e?(A.Is.not.defined(this.__aabbGizmo)&&(this.__aabbGizmo=new p.q(this.entity),this.__aabbGizmo._setup()),this.__aabbGizmo.isVisible=!0):A.Is.exist(this.__aabbGizmo)&&(this.__aabbGizmo.isVisible=!1)}get isAABBGizmoVisible(){return!!A.Is.exist(this.__aabbGizmo)&&this.__aabbGizmo.isVisible}set isLocatorGizmoVisible(e){e?(A.Is.not.defined(this.__locatorGizmo)&&(this.__locatorGizmo=new v.k(this.entity),this.__locatorGizmo._setup()),this.__locatorGizmo.isVisible=!0):A.Is.exist(this.__locatorGizmo)&&(this.__locatorGizmo.isVisible=!1)}get isLocatorGizmoVisible(){return!!A.Is.exist(this.__locatorGizmo)&&this.__locatorGizmo.isVisible}set isTranslationGizmoVisible(e){e?(A.Is.not.defined(this.__translationGizmo)&&(this.__translationGizmo=new y.u(this.entity),this.__translationGizmo._setup()),this.__translationGizmo.isVisible=!0):A.Is.exist(this.__translationGizmo)&&(this.__translationGizmo.isVisible=!1)}get isTranslationGizmoVisible(){return!!A.Is.exist(this.__translationGizmo)&&this.__translationGizmo.isVisible}set isScaleGizmoVisible(e){e?(A.Is.not.defined(this.__scaleGizmo)&&(this.__scaleGizmo=new x.q(this.entity),this.__scaleGizmo._setup()),this.__scaleGizmo.isVisible=!0):A.Is.exist(this.__scaleGizmo)&&(this.__scaleGizmo.isVisible=!1)}get isScaleGizmoVisible(){return!!A.Is.exist(this.__scaleGizmo)&&this.__scaleGizmo.isVisible}static getTopLevelComponents(){return b.__sceneGraphs.filter((e=>e.isTopLevel))}isJoint(){return this.jointIndex>=0}static get componentTID(){return l.z.SceneGraphComponentTID}get componentTID(){return l.z.SceneGraphComponentTID}setWorldMatrixRestDirty(){this.matrixRestInner,this.setWorldMatrixRestDirtyRecursively()}setWorldMatrixRestDirtyRecursively(){this.__isWorldMatrixRestUpToDate=!1,this.children.forEach((e=>{e.setWorldMatrixRestDirtyRecursively()}))}setWorldMatrixDirty(){var e;this.setWorldMatrixDirtyRecursively(),null===(e=this.parent)||void 0===e||e.setWorldAABBDirtyParentRecursively()}setWorldMatrixDirtyRecursively(){this.__isWorldMatrixUpToDate=!1,this.__isNormalMatrixUpToDate=!1,this.__isWorldAABBDirty=!0,this.children.forEach((e=>{e.setWorldMatrixDirtyRecursively()}))}setWorldAABBDirtyParentRecursively(){var e;this.__isWorldAABBDirty=!0,null===(e=this.parent)||void 0===e||e.setWorldAABBDirtyParentRecursively()}addChild(e){A.Is.exist(e.__parent)&&e.__parent.removeChild(e),e.__parent=this,this.__children.push(e)}removeChild(e){const t=this.__children.indexOf(e);t>=0&&this.__children.splice(t,1),e.__parent=void 0}_addGizmoChild(e){e.__parent=this,this.__gizmoChildren.push(e)}get isTopLevel(){return null==this.__parent}get children(){return this.__children}get parent(){return this.__parent}get matrixInner(){return this.__isWorldMatrixUpToDate||(this._worldMatrix.copyComponents(this.__calcWorldMatrixRecursively()),this.__isWorldMatrixUpToDate=!0),this._worldMatrix}get matrix(){return this.matrixInner.clone()}get matrixRestInner(){return this.__isWorldMatrixRestUpToDate||(this._worldMatrixRest.copyComponents(this.__calcWorldMatrixRestRecursively()),this.__isWorldMatrixRestUpToDate=!0),this._worldMatrix}get matrixRest(){return this.matrixRestInner.clone()}get normalMatrixInner(){return this.__isNormalMatrixUpToDate||(a.J.invertTo(this.matrixInner,b.invertedMatrix44),this._normalMatrix.copyComponents(b.invertedMatrix44.transpose()),this.__isNormalMatrixUpToDate=!0),this._normalMatrix}get entityWorldMatrix(){return this.entityWorldMatrixInner.clone()}get entityWorldMatrixInner(){const e=this.entity.tryToGetSkeletal();return A.Is.exist(e)&&e.isWorldMatrixUpdated?e.worldMatrixInner:this.entity.getSceneGraph().matrixInner}get normalMatrix(){return this.normalMatrixInner.clone()}isWorldMatrixUpToDateRecursively(){return!!this.__isWorldMatrixUpToDate&&(!this.__parent||this.__parent.isWorldMatrixUpToDateRecursively())}__calcWorldMatrixRecursively(){if(this.__isWorldMatrixUpToDate)return this._worldMatrix;const e=r.g.getEntity(this.__entityUid).getTransform();if(null==this.__parent||this.toMakeWorldMatrixTheSameAsLocalMatrix)return e.localMatrixInner;const t=this.__parent.__calcWorldMatrixRecursively();return h.e.multiplyTo(t,e.localMatrixInner,this.__tmpMatrix)}__calcWorldMatrixRestRecursively(){if(this.__isWorldMatrixRestUpToDate)return this._worldMatrixRest;const e=r.g.getEntity(this.__entityUid).getTransform();if(null==this.__parent||this.toMakeWorldMatrixTheSameAsLocalMatrix)return e.localMatrixRestInner;const t=this.__parent.__calcWorldMatrixRestRecursively();return h.e.multiplyTo(t,e.localMatrixRestInner,this.__tmpMatrix)}getQuaternionRecursively(){if(A.Is.not.exist(this.parent))return this.entity.getTransform().localRotation;const e=this.parent.getQuaternionRecursively();return g._f.multiply(e,this.entity.getTransform().localRotation)}static flattenHierarchy(e,t){const n=[];t&&!e.isJoint()||n.push(e);const i=e.children;for(let e=0;e{var t;return null===(t=e.parent)||void 0===t?void 0:t.removeChild(e)}))}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getSceneGraph(){return void 0===this.__sceneGraphComponent&&(this.__sceneGraphComponent=this.getComponentByComponentTID(l.z.SceneGraphComponentTID)),this.__sceneGraphComponent}get parent(){return this.getSceneGraph().parent}get matrix(){return this.getSceneGraph().matrix}get matrixInner(){return this.getSceneGraph().matrixInner}get position(){return this.getSceneGraph().position}set position(e){this.getSceneGraph().position=e}get positionRest(){return this.getSceneGraph().positionRest}get scale(){return this.getSceneGraph().scale}set scale(e){this.getSceneGraph().scale=e}get eulerAngles(){return this.getSceneGraph().eulerAngles}set eulerAngles(e){this.getSceneGraph().eulerAngles=e}get rotation(){return this.getSceneGraph().rotation}set rotation(e){this.getSceneGraph().rotation=e}get rotationRest(){return this.getSceneGraph().rotationRest}addChild(e){this.getSceneGraph().addChild(e)}get children(){return this.getSceneGraph().children}removeChild(e){this.getSceneGraph().removeChild(e)}}return(0,r.e)(e,n),e}}b.__originVector3=d.P.zero(),b.returnVector3=f.d6.zero(),b.__sceneGraphs=[],b.isJointAABBShouldBeCalculated=!1,b.invertedMatrix44=h.e.fromCopyArray16ColumnMajor([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),b.__tmpAABB=new m.m,i.C.registerComponentClass(b)},5684:(e,t,n)=>{n.d(t,{G:()=>a});var i=n(4020),o=n(4690);class a{constructor(e){this.__srcEntity=e}getSrcPGRestQ(e){let t;const n=e.getSceneGraph().parent;return t=o.Is.exist(n)?n.getRotationRest((e=>{const t=e.parent;if(o.Is.exist(t)){const e=t.entity.tryToGetVrm();return o.Is.exist(e)}return!0})):i._f.identity(),t}getDstPGRestQ(e){let t;const n=e.getSceneGraph().parent;return t=o.Is.exist(n)?n.getRotationRest((e=>{const t=e.parent;if(o.Is.exist(t)){const e=t.entity.tryToGetVrm();return o.Is.exist(e)}return!0})):i._f.identity(),t}retargetQuaternion(e){const t=this.__srcEntity,n=t.getTransform().localRotationInner,o=t.getTransform().localRotationRestInner,r=this.getSrcPGRestQ(t),s=i._f.multiply(r,i._f.multiply(n,i._f.multiply(i._f.invert(o),i._f.invert(r)))),l=e.getTransform().localRotationRestInner,c=this.getDstPGRestQ(e),_=i._f.multiply(i._f.invert(c),i._f.multiply(s,i._f.multiply(c,l)));return i._f.multiply(i._f.multiply(a.__rev,_),i._f.invert(a.__rev))}retargetTranslate(e){const t=this.__srcEntity,n=t.getTransform().localPositionInner,o=t.getTransform().localPositionRestInner,r=this.getSrcPGRestQ(t),s=i.P.subtract(n,o),l=r.transformVector3(s),c=e.getTransform().localPositionRestInner,_=this.getDstPGRestQ(e),h=i.P.add(_.transformVector3Inverse(l),c);if(t.uniqueName.indexOf("hips")>=0){const e=i.P.multiply(h,t.parent.scale.x);return a.__rev.transformVector3(e)}return h}retargetScale(e){return this.__srcEntity.getTransform().localScaleInner}}a.__rev=i._f.fromAxisAngle(i.P.fromCopy3(0,1,0),Math.PI)},1656:(e,t,n)=>{n.d(t,{Y:()=>y});var i=n(2404),o=n(9721),a=n(1350),r=n(4710),s=n(5467),l=n(4507),c=n(9190),_=n(963),h=n(3032),u=n(4536),d=n(3496),m=n(4587),f=n(7348),p=n(3258),v=n(1226),A=n(2253);class y extends o.w{constructor(e,t,n,i){super(e,t,n,i),this._jointIndices=[],this.__joints=[],this.isSkinning=!0,this.__qArray=new Float32Array(0),this.__tsArray=new Float32Array(0),this.__tqArray=new Float32Array(0),this.__sqArray=new Float32Array(0),this.__qtsArray=new Float32Array(0),this.__qtsInfo=u.xQ.dummy(),this.__matArray=new Float32Array(0),this.__worldMatrix=d.e.identity(),this.__isWorldMatrixVanilla=!0,this._isCulled=!1,this.moveStageTo(l.I.Logic),i||(y.__tookGlobalDataNumMath.abs(t.y)?Math.abs(t.x)>Math.abs(t.z)?t.x:t.z:Math.abs(t.y)>Math.abs(t.z)?t.y:t.z,this.__tsArray[4*e+3]=n}if(p.D.boneDataType===v.N.Vec4x2){const o=h.k.packNormalizedVec4ToVec2(i.x,i.y,i.z,i.w,Math.pow(2,12));this.__tqArray[4*e+0]=n.m03,this.__tqArray[4*e+1]=n.m13,this.__tqArray[4*e+2]=n.m23,this.__sqArray[4*e+0]=t.x,this.__sqArray[4*e+1]=t.y,this.__sqArray[4*e+2]=t.z,this.__tqArray[4*e+3]=o[0],this.__sqArray[4*e+3]=o[1]}else p.D.boneDataType===v.N.Vec4x2Old&&(this.__tsArray[4*e+0]=n.m03,this.__tsArray[4*e+1]=n.m13,this.__tsArray[4*e+2]=n.m23,this.__qArray[4*e+0]=i.x,this.__qArray[4*e+1]=i.y,this.__qArray[4*e+2]=i.z,this.__qArray[4*e+3]=i.w);if(p.D.boneDataType===v.N.Vec4x1){this.__tsArray[4*e+0]=n.m03,this.__tsArray[4*e+1]=n.m13,this.__tsArray[4*e+2]=n.m23;const t=h.k.packNormalizedVec4ToVec2(i.x,i.y,i.z,i.w,Math.pow(2,12));this.__qtsArray[4*e+0]=t[0],this.__qtsArray[4*e+1]=t[1]}}}if(p.D.boneDataType===v.N.Vec4x1){let e=1,t=1,n=1;for(let i=0;ie&&(e=o);const a=Math.abs(this.__tsArray[4*i+1]);a>t&&(t=a);const r=Math.abs(this.__tsArray[4*i+2]);r>n&&(n=r)}this.__qtsInfo.x=e,this.__qtsInfo.y=t,this.__qtsInfo.z=n,this.__qtsInfo.w=1;for(let i=0;i{n.d(t,{U:()=>h});var i=n(9721),o=n(2404),a=n(1350),r=n(4710),s=n(4507),l=n(9190),c=n(4020),_=n(2253);class h extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__pose=new c.WQ,this.__updateCountAtLastLogic=0,this.moveStageTo(s.I.Create)}$create(){this.__sceneGraphComponent=this.entity.tryToGetSceneGraph(),this.moveStageTo(s.I.Logic)}static get renderedPropertyCount(){return null}static get componentTID(){return r.z.TransformComponentTID}get componentTID(){return r.z.TransformComponentTID}get restOrPose(){return void 0!==this.__rest?this.__rest:this.__pose}_backupTransformAsRest(){void 0===this.__rest&&(this.__rest=this.__pose.clone(),this.entity.tryToGetSceneGraph().setWorldMatrixRestDirty())}_restoreTransformFromRest(){void 0!==this.__rest&&this.__pose.setTransform(this.__rest.positionInner,l.d6.fromCopyVector3(this.__rest.eulerAnglesInner),this.__rest.scaleInner,c.yG.fromCopyQuaternion(this.__rest.rotationInner),this.__rest.matrixInner)}get localTransform(){return this.__pose}set localTransform(e){this.__pose.setTransform(e.positionInner,l.d6.fromCopyVector3(e.eulerAnglesInner),e.scaleInner,c.yG.fromCopyQuaternion(e.rotationInner),e.matrixInner)}get localTransformRest(){return this.restOrPose}set localTransformRest(e){_.Is.undefined(this.__rest)&&(this.__rest=new c.WQ),this.__rest.setTransform(e.positionInner,l.d6.fromCopyVector3(e.eulerAnglesInner),e.scaleInner,c.yG.fromCopyQuaternion(e.rotationInner),e.matrixInner)}set localPosition(e){this.__pose.position=e}get localPosition(){return this.__pose.position}get localPositionInner(){return this.__pose.positionInner}set localPositionRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.position=e}get localPositionRest(){return this.restOrPose.position}get localPositionRestInner(){return this.restOrPose.positionInner}set localEulerAngles(e){this.__pose.eulerAngles=e}get localEulerAngles(){return this.__pose.eulerAngles}get localEulerAnglesInner(){return this.__pose.eulerAnglesInner}set localEulerAnglesRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.eulerAngles=e}get localEulerAnglesRest(){return this.restOrPose.eulerAngles}get localEulerAnglesRestInner(){return this.restOrPose.eulerAnglesInner}set localScale(e){this.__pose.scale=e}get localScale(){return this.__pose.scale}get localScaleInner(){return this.__pose.scaleInner}set localScaleRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.scale=e}get localScaleRest(){return this.restOrPose.scale}get localScaleRestInner(){return this.restOrPose.scaleInner}set localRotation(e){this.__pose.rotation=e}get localRotation(){return this.__pose.rotation}get localRotationInner(){return this.__pose.rotationInner}set localRotationRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.rotation=e}get localRotationRest(){return this.restOrPose.rotation}get localRotationRestInner(){return this.restOrPose.rotationInner}set localMatrix(e){this.__pose.matrix=e}get localMatrix(){return this.__pose.matrix}get localMatrixInner(){return this.__pose.matrixInner}set localMatrixRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.matrix=e}get localMatrixRest(){return this.restOrPose.matrix}get localMatrixRestInner(){return this.restOrPose.matrixInner}$logic(){this.__updateCountAtLastLogic!==this.__pose.updateCount&&(this.__sceneGraphComponent.setWorldMatrixDirty(),this.__updateCountAtLastLogic=this.__pose.updateCount)}_shallowCopyFrom(e){const t=e;this.__pose=t.__pose.clone(),null!=t.__rest&&(this.__rest=t.__rest.clone()),this.__updateCountAtLastLogic=t.__updateCountAtLastLogic}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getTransform(){return void 0===this.__transformComponent&&(this.__transformComponent=this.getComponentByComponentTID(r.z.TransformComponentTID)),this.__transformComponent}set localPosition(e){this.getTransform().localPosition=e}get localPosition(){return this.localPositionInner.clone()}get localPositionInner(){return this.getTransform().localPositionInner}set localPositionRest(e){this.getTransform().localPositionRest=e}get localPositionRest(){return this.getTransform().localPositionRest}get localPositionRestInner(){return this.getTransform().localPositionRestInner}set localScale(e){this.getTransform().localScale=e}get localScale(){return this.localScaleInner.clone()}get localScaleInner(){return this.getTransform().localScaleInner}set localScaleRest(e){this.getTransform().localScaleRest=e}get localScaleRest(){return this.getTransform().localScaleRest}get localScaleRestInner(){return this.getTransform().localScaleRestInner}set localEulerAngles(e){this.getTransform().localEulerAngles=e}get localEulerAngles(){return this.localEulerAnglesInner.clone()}get localEulerAnglesInner(){return this.getTransform().localEulerAnglesInner}set localEulerAnglesRest(e){this.getTransform().localEulerAnglesRest=e}get localEulerAnglesRest(){return this.localEulerAnglesRestInner.clone()}get localEulerAnglesRestInner(){return this.getTransform().localEulerAnglesRestInner}set localRotation(e){this.getTransform().localRotation=e}get localRotation(){return this.localRotationInner.clone()}get localRotationInner(){return this.getTransform().localRotationInner}set localRotationRest(e){this.getTransform().localRotationRest=e}get localRotationRest(){return this.localQuaternionRestInner.clone()}get localRotationRestInner(){return this.getTransform().localRotationRestInner}set localMatrix(e){this.getTransform().localMatrix=e}get localMatrix(){return this.localMatrixInner.clone()}get localMatrixInner(){return this.getTransform().localMatrixInner}set localMatrixRest(e){this.getTransform().localMatrixRest=e}get localMatrixRest(){return this.localMatrixRestInner.clone()}get localMatrixRestInner(){return this.getTransform().localMatrixRestInner}}return(0,a.e)(e,n),e}}o.C.registerComponentClass(h)},605:(e,t,n)=>{n.d(t,{Z:()=>c});var i=n(9721),o=n(2404),a=n(1350),r=n(4507),s=n(2253),l=n(4710);class c extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__expressions=new Map,this.__weights=new Map,this._version="",this.moveStageTo(r.I.Logic)}static get componentTID(){return l.z.VrmComponentTID}get componentTID(){return l.z.VrmComponentTID}setVrmExpressions(e){for(const t of e)this.__expressions.set(t.name,t),this.__weights.set(t.name,0)}setExpressionWeight(e,t){const n=this.__expressions.get(e);if(!s.Is.not.exist(n)){this.__weights.set(e,t);for(const e of n.binds){const n=a.g.getEntity(e.entityIdx).tryToGetBlendShape();s.Is.exist(n)&&n.setWeightByIndex(e.blendShapeIdx,t)}}}getExpressionWeight(e){return this.__weights.get(e)}getExpressionNames(){return Array.from(this.__expressions.keys())}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getVrm(){return void 0===this.__vrmComponent&&(this.__vrmComponent=this.getComponentByComponentTID(l.z.VrmComponentTID)),this.__vrmComponent}}return(0,a.e)(e,n),e}}o.C.registerComponentClass(c)},4710:(e,t,n)=>{n.d(t,{z:()=>i});const i=Object.freeze({AnimationComponentTID:1,TransformComponentTID:2,SceneGraphComponentTID:3,MeshComponentTID:4,MeshRendererComponentTID:5,LightComponentTID:6,CameraControllerComponentTID:7,CameraComponentTID:8,SkeletalComponentTID:9,BlendShapeComponentTID:10,PhysicsComponentTID:11,EffekseerComponentTID:12,VrmComponentTID:13,ConstraintComponentTID:14,maxWellKnownTidNumber:14})},1409:(e,t,n)=>{n.d(t,{l:()=>v,cw:()=>i.c,xT:()=>a.x,My:()=>r.M,SP:()=>s.S,B5:()=>f,GZ:()=>p.G,r0:()=>l.r,$t:()=>c.$,YZ:()=>_.Y,Ze:()=>h.Z,aj:()=>u.a,Yb:()=>A.Y,Uv:()=>y.U,ZA:()=>x.Z,zz:()=>g.z,vA:()=>o});var i=n(1564);const o="Default";var a=n(6456),r=n(224),s=n(5496),l=n(6683),c=n(4097),_=n(9974),h=n(3826),u=n(8491),d=n(4020),m=n(4690);class f{constructor(e){this.__srcEntity=e}getSrcPGRestQ(e){let t;const n=e.getSceneGraph().parent;return t=m.Is.exist(n)?n.getRotationRest((e=>{const t=e.parent;if(m.Is.exist(t)){const e=t.entity.tryToGetVrm();return m.Is.exist(e)}return!0})):d._f.identity(),t}getDstPGRestQ(e){let t;const n=e.getSceneGraph().parent;return t=m.Is.exist(n)?n.getRotationRest((e=>{const t=e.parent;if(m.Is.exist(t)){const e=t.entity.tryToGetVrm();return m.Is.exist(e)}return!0})):d._f.identity(),t}retargetQuaternion(e){const t=this.__srcEntity,n=t.getTransform().localRotationInner,i=t.getTransform().localRotationRestInner,o=this.getSrcPGRestQ(t),a=d._f.multiply(o,d._f.multiply(n,d._f.multiply(d._f.invert(i),d._f.invert(o)))),r=e.getTransform().localRotationRestInner,s=this.getDstPGRestQ(e);return d._f.multiply(d._f.invert(s),d._f.multiply(a,d._f.multiply(s,r)))}retargetTranslate(e){const t=this.__srcEntity,n=t.getTransform().localPositionInner,i=t.getTransform().localPositionRestInner,o=this.getSrcPGRestQ(t),a=d.P.subtract(n,i),r=o.transformVector3(a),s=e.getTransform().localPositionRestInner,l=this.getDstPGRestQ(e),c=d.P.add(l.transformVector3Inverse(r),s);return t.uniqueName.indexOf("hips")>=0?d.P.multiply(c,t.parent.scale.x):c}retargetScale(e){return this.__srcEntity.getTransform().localScaleInner}}var p=n(5684);class v{constructor(e){this.__srcEntity=e}retargetQuaternion(e){return this.__srcEntity.getTransform().localRotationInner}retargetTranslate(e){return this.__srcEntity.getTransform().localPositionInner}retargetScale(e){return this.__srcEntity.getTransform().localScaleInner}}var A=n(1656),y=n(6692),x=n(605),g=n(4710)},9721:(e,t,n)=>{n.d(t,{w:()=>c});var i=n(9286),o=n(1350),a=n(4507),r=n(2404),s=n(3258),l=n(9002);class c extends l.S{constructor(e,t,n,o){super(),this._isAlive=!0,this.__currentProcessStage=a.I.Create,this.__byteOffsetOfThisComponent=-1,this.__maxComponentNumber=s.D.maxEntityNumber,this.__entityUid=e,this._component_sid=t,c._processStages.forEach((e=>{this.isExistProcessStageMethod(e)&&null==c.__componentsOfProcessStages.get(e)&&(c.__componentsOfProcessStages.set(e,new Int32Array(s.D.maxEntityNumber)),c.__lengthOfArrayOfProcessStages.set(e,0))})),this.__memoryManager=i.B.getInstance(),this.__entityRepository=n}moveStageTo(e){this.__currentProcessStage=e}_setMaxNumberOfComponent(e){this.__maxComponentNumber=e}get maxNumberOfComponent(){return this.__maxComponentNumber}static get componentTID(){return 0}get componentTID(){return 0}get componentSID(){return this._component_sid}get entityUID(){return this.__entityUid}get currentProcessStage(){return this.__currentProcessStage}static doesTheProcessStageMethodExist(e,t){return null!=e.prototype[t.methodName]}isExistProcessStageMethod(e){return null!=this[e.methodName]}static process({componentType:e,processStage:t,processApproach:n,strategy:i,renderPass:o,renderPassTickCount:a}){if(!c.doesTheProcessStageMethodExist(e,t))return;const s=t.methodName,l=this.__componentsOfProcessStages.get(t),_=r.C._getComponentsIncludingDead(e);for(let e=0;e{o.set(e.bufferUse,[])})),i.forEach((e=>{o.get(e.bufferUse).push(e)}));for(const e of o.keys()){const t=o.get(e);c.__byteLengthSumOfMembers.has(n)||c.__byteLengthSumOfMembers.set(n,new Map);const i=c.__byteLengthSumOfMembers.get(n);i.has(e)||i.set(e,0),t.forEach((t=>{i.set(e,i.get(e)+t.compositionType.getNumberOfComponents()*t.componentType.getSizeInBytes())})),t.length}for(const i of o.keys())o.get(i).forEach((i=>{const o=c.takeAccessor(i.bufferUse,i.memberName,n,i.compositionType,i.componentType,e);t["_byteOffsetOfAccessorInBuffer_"+i.memberName]=o.byteOffsetInBuffer,t["_byteOffsetOfAccessorInComponent_"+i.memberName]=o.byteOffsetInBufferView}))}(this);const o=c.__members.get(n);for(const e of o.keys())o.get(e).forEach((e=>{this.takeOne(e.memberName,e.dataClassType,e.initValues,t,this._component_sid)}))}get entity(){return o.g.getEntity(this.__entityUid)}static getDataByteInfoInner(e,t){const n=e["_"+t]._v,i=n.byteOffset,o=n.byteLength,a=n.length,r=i/4/4;return{byteLength:o,byteOffsetInBuffer:i,byteOffsetInThisComponent:this["_byteOffsetOfAccessorInComponent_"+t]+e.componentSID*a*4,locationOffsetInBuffer:r,locationOffsetInThisComponent:this["_byteOffsetOfAccessorInComponent_"+t]+e.componentSID*a,thisComponentByteOffsetInBuffer:e.__byteOffsetOfThisComponent,thisComponentLocationOffsetInBuffer:e.__byteOffsetOfThisComponent/4/4,componentNumber:a}}getDataByteInfo(e){return c.getDataByteInfoInner(this,e)}static getDataByteInfoByComponentSID(e,t,n){const i=r.C.getComponent(e,t);if(i)return c.getDataByteInfoInner(i,n)}static getDataByteInfoByEntityUID(e,t,n){const i=o.g.getComponentOfEntity(t,e);if(i)return c.getDataByteInfoInner(i,n)}static getLocationOffsetOfMemberOfComponent(e,t){return r.C.getComponent(e,0)["_byteOffsetOfAccessorInBuffer_"+t]/4/4}addThisComponentToEntity(e,t){throw"Invalid Calling"}static getCompositionTypeOfMember(e,t){const n=this.__memberInfo.get(t).find((t=>t.memberName===e));return null!=n?n.compositionType:void 0}static getComponentTypeOfMember(e,t){const n=this.__memberInfo.get(t).find((t=>t.memberName===e));return null!=n?n.componentType:void 0}_destroy(){this._isAlive=!1}_shallowCopyFrom(e){}}c.invalidComponentSID=-1,c.__componentsOfProcessStages=new Map,c.__lengthOfArrayOfProcessStages=new Map,c.__bufferViews=new Map,c.__accessors=new Map,c.__byteLengthSumOfMembers=new Map,c.__memberInfo=new Map,c.__members=new Map,c._processStages=[a.I.Create,a.I.Load,a.I.Logic,a.I.PreRender,a.I.Render]},2404:(e,t,n)=>{n.d(t,{C:()=>s});var i=n(9721),o=n(4690),a=n(3258),r=n(4710);class s{constructor(){}static registerComponentClass(e){s.__componentClasses.set(e.componentTID,e)}static deregisterComponentClass(e){s.__componentClasses.delete(e)}static getComponentClass(e){return this.__componentClasses.get(e)}static createComponent(e,t,n){const a=s.__componentClasses.get(e);if(o.Is.exist(a)){let r=this.__component_sid_count_map.get(e);o.Is.not.exist(r)&&(this.__component_sid_count_map.set(e,0),r=i.w.invalidComponentSID);const s=this.__components.get(e);let l=-1;if(o.Is.exist(s))for(let e=0;ee._isAlive))}static _getComponentsIncludingDead(e){return this.__components.get(e.componentTID)}static getMemoryBeginIndex(e){let t=0;for(let n=0;ne._isAlive))}static getComponentTIDs(){const e=Array.from(this.__components.keys());return e.sort(((e,t)=>e-t)),e}static getRenderingComponentTIDs(){const e=[];return this.__components.has(r.z.MeshRendererComponentTID)&&e.push(r.z.MeshRendererComponentTID),this.__components.has(r.z.EffekseerComponentTID)&&e.push(r.z.EffekseerComponentTID),e}}s.__component_sid_count_map=new Map,s.__components=new Map,s.__componentClasses=new Map},3258:(e,t,n)=>{n.d(t,{D:()=>_});var i=n(1226),o=n(2253);let a=41,r=33,s=Math.pow(2,12),l=Math.pow(2,12),c=i.N.Mat43x1;"undefined"!=typeof navigator&&(o.Kf.isMobile()||o.Kf.isMobileVr())&&(a=4,r=32,s=512,l=512);const _={maxEntityNumber:5e3,maxLightNumberInShader:4,maxVertexMorphNumberInShader:a,maxMaterialInstanceForEachType:10,boneDataType:c,maxSkeletonNumber:r,maxCameraNumber:20,maxSizeLimitOfNonCompressedTexture:512,maxSkeletalBoneNumber:300,maxSkeletalBoneNumberForUniformMode:50,dataTextureWidth:s,dataTextureHeight:l,noWebGLTex2DStateCache:!1,maxMorphTargetNumber:4,totalSizeOfGPUShaderDataStorageExceptMorphData:0,isUboEnabled:!1,eventTargetDom:void 0}},1328:(e,t,n)=>{n.d(t,{J:()=>r});var i=n(9002),o=n(4690),a=n(4710);class r extends i.S{constructor(e,t,n){super(),this._myLatestCopyEntityUID=r.invalidEntityUID,this.___entity_uid=e,this._isAlive=t,this.__components=o.Is.exist(n)?n:new Map}get entityUID(){return this.___entity_uid}_setComponent(e,t){this.__components.set(e.componentTID,t)}hasComponent(e){return this.__components.has(e.componentTID)}getComponent(e){return this.__components.get(e.componentTID)}getComponentByComponentTID(e){return this.__components.get(e)}_removeComponent(e){this.__components.delete(e)}tryToGetAnimation(){return this.getComponentByComponentTID(a.z.AnimationComponentTID)}tryToGetBlendShape(){return this.getComponentByComponentTID(a.z.BlendShapeComponentTID)}tryToGetCamera(){return this.getComponentByComponentTID(a.z.CameraComponentTID)}tryToGetCameraController(){return this.getComponentByComponentTID(a.z.CameraControllerComponentTID)}tryToGetLight(){return this.getComponentByComponentTID(a.z.LightComponentTID)}tryToGetMesh(){return this.getComponentByComponentTID(a.z.MeshComponentTID)}tryToGetMeshRenderer(){return this.getComponentByComponentTID(a.z.MeshRendererComponentTID)}tryToGetPhysics(){return this.getComponentByComponentTID(a.z.PhysicsComponentTID)}tryToGetSceneGraph(){return this.getComponentByComponentTID(a.z.SceneGraphComponentTID)}tryToGetSkeletal(){return this.getComponentByComponentTID(a.z.SkeletalComponentTID)}tryToGetTransform(){return this.getComponentByComponentTID(a.z.TransformComponentTID)}tryToGetVrm(){return this.getComponentByComponentTID(a.z.VrmComponentTID)}tryToGetConstraint(){return this.getComponentByComponentTID(a.z.ConstraintComponentTID)}_destroy(){this.__components.forEach((e=>{e._destroy()})),this._isAlive=!1}}r.invalidEntityUID=-1},1350:(e,t,n)=>{n.d(t,{e:()=>c,g:()=>l});var i=n(1328),o=n(2404),a=n(6098),r=n(4690),s=n(4710);class l{constructor(){}static createEntity(){let e=-1;for(let t=0;tl.getEntity(e.entity._myLatestCopyEntityUID).tryToGetSceneGraph()));t.setJoints(e)}const i=e.tryToGetSceneGraph();r.Is.exist(i)&&i.children.forEach((e=>{l.__setJoints(e.entity)}))}static _shallowCopyEntityInner(e){const t=this.createEntity();t._tags=Object.assign({},e._tags),e._myLatestCopyEntityUID=t.entityUID;for(let n=1;n<=s.z.maxWellKnownTidNumber;n++){const i=e.getComponentByComponentTID(n);if(r.Is.exist(i)){this.tryToAddComponentToEntityByTID(n,t);const e=t.getComponentByComponentTID(n);r.Is.exist(e)&&e._shallowCopyFrom(i)}}return t}static __handleTagData(e){const t=e._tags;if(r.Is.exist(t)){const n=Object.keys(t);for(const t of n){if("rnEntities"===t){const t=e.getTagValue("rnEntities").map((e=>l.getEntity(e._myLatestCopyEntityUID)));e.tryToSetTag({tag:"rnEntities",value:t})}if("rnEntitiesByNames"===t){const t=e.getTagValue("rnEntitiesByNames");for(const e of Object.keys(t)){const n=t.get(e);t.set(e,l.getEntity(n._myLatestCopyEntityUID))}e.tryToSetTag({tag:"rnEntitiesByNames",value:t})}}}const n=e.tryToGetSceneGraph();r.Is.exist(n)&&n.children.forEach((e=>{l.__handleTagData(e.entity)}))}static tryToAddComponentToEntityByTID(e,t){const n=o.C.getComponentClass(e);return r.Is.not.exist(n)?t:this.addComponentToEntity(n,t)}static addComponentToEntity(e,t){if(t.hasComponent(e))return console.log("This entity already has the Component."),t;const n=o.C.createComponent(e.componentTID,t.entityUID,this);return(0,a.wv)({value:this._components[t.entityUID],compensation:()=>{const e=new Map;return this._components[t.entityUID]=e,e}}).set(e.componentTID,n),n.addThisComponentToEntity(t,e),t._setComponent(e,n),t}static removeComponentFromEntity(e,t){let n=this._components[t.entityUID];null==n&&(n=new Map,this._components[t.entityUID]=n);const i=n.get(e.componentTID);return r.Is.exist(i)&&(i._destroy(),n.delete(e.componentTID),t._removeComponent(e.componentTID)),t}static getEntity(e){return this.__entities[e]}static getComponentOfEntity(e,t){const n=this._components[e];let i=null;return null!=n?(i=n.get(t.componentTID),null!=i?i:null):i}static searchByTags(e){const t=[];for(const n of this.__entities)n.matchTags(e)&&t.push(n);return t}static getEntityByUniqueName(e){for(const t of this.__entities)if(t.uniqueName===e)return t}static _getEntities(){return this.__entities.filter((e=>e._isAlive))}static getEntitiesNumber(){return this.__entities.filter((e=>e._isAlive)).length}}function c(e,t){Object.getOwnPropertyNames(t.prototype).forEach((n=>{Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t.prototype,n)||Object.create(null))}))}l.__entity_uid_count=i.J.invalidEntityUID,l.__entities=[],l._components=[]},7348:(e,t,n)=>{n.d(t,{$:()=>b});var i=n(4587),o=n(752),a=n(9286),r=n(810),s=n(3999),l=n(8547),c=n(7987),_=n(5324),h=n(4255),u=n(1813),d=n(3258),m=n(3616),f=n(7192),p=n(2471),v=n(3496),A=n(4710),y=n(1226),x=n(7683),g=n(1181),I=n(4020);class b{constructor(){this.__fields=new Map}initialize(e){const t={semantic:i.f5.CurrentComponentSIDs,compositionType:r.d.ScalarArray,componentType:s.r.Float,arrayLength:A.z.maxWellKnownTidNumber,stage:_.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,needUniformInDataTextureMode:!0,initialValue:new h.j(new Float32Array(A.z.maxWellKnownTidNumber))};this.__registerProperty(t,1),this.takeOne(i.f5.CurrentComponentSIDs);const n={semantic:i.f5.ViewMatrix,compositionType:r.d.Mat4,componentType:s.r.Float,stage:_.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,initialValue:v.e.identity()},o={semantic:i.f5.ProjectionMatrix,compositionType:r.d.Mat4,componentType:s.r.Float,stage:_.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,initialValue:v.e.identity()},a={semantic:i.f5.ViewPosition,compositionType:r.d.Vec3,componentType:s.r.Float,stage:_.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:p.P.fromCopyArray([0,0,1])};this.__registerProperty(n,d.D.maxCameraNumber),this.__registerProperty(o,d.D.maxCameraNumber),this.__registerProperty(a,d.D.maxCameraNumber);const l=x.V.isUniformApproach(e)?d.D.maxSkeletalBoneNumberForUniformMode:d.D.maxSkeletalBoneNumber,c={semantic:i.f5.BoneMatrix,compositionType:r.d.Mat4x3Array,arrayLength:l,componentType:s.r.Float,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,soloDatum:!0,initialValue:new h.j(new Float32Array(0))},g={semantic:i.f5.BoneQuaternion,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,soloDatum:!0,initialValue:new h.j(new Float32Array(0))},b={semantic:i.f5.BoneTranslateScale,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,soloDatum:!0,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:new h.j(new Float32Array(0))},E={semantic:i.f5.BoneTranslatePackedQuat,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,soloDatum:!0,initialValue:new h.j(new Float32Array(0))},T={semantic:i.f5.BoneScalePackedQuat,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,soloDatum:!0,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:new h.j(new Float32Array(0))},S={semantic:i.f5.BoneCompressedChunk,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,soloDatum:!0,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:new h.j(new Float32Array(0))},C={semantic:i.f5.BoneCompressedInfo,compositionType:r.d.Vec4,componentType:s.r.Float,soloDatum:!0,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:f.Lt.zero()},w={semantic:i.f5.SkinningMode,compositionType:r.d.Scalar,componentType:s.r.Int,stage:_.H.VertexAndPixelShader,min:0,max:1,isCustomSetting:!0,updateInterval:u.a.EveryTime,initialValue:m.Ru.fromCopyNumber(-1)};d.D.boneDataType===y.N.Mat43x1?this.__registerProperty(c,d.D.maxSkeletonNumber):d.D.boneDataType===y.N.Vec4x2?(this.__registerProperty(E,d.D.maxSkeletonNumber),this.__registerProperty(T,d.D.maxSkeletonNumber)):d.D.boneDataType===y.N.Vec4x2Old?(this.__registerProperty(g,d.D.maxSkeletonNumber),this.__registerProperty(b,d.D.maxSkeletonNumber)):d.D.boneDataType===y.N.Vec4x1&&(this.__registerProperty(b,d.D.maxSkeletonNumber),this.__registerProperty(S,d.D.maxSkeletonNumber),this.__registerProperty(C,1),this.takeOne(i.f5.BoneCompressedInfo)),this.__registerProperty(w,1),this.takeOne(i.f5.SkinningMode);const R={semantic:i.f5.LightPosition,compositionType:r.d.Vec3Array,componentType:s.r.Float,stage:_.H.PixelShader,arrayLength:d.D.maxLightNumberInShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.EveryTime,initialValue:new h.j(new Float32Array(d.D.maxLightNumberInShader))},P={semantic:i.f5.LightDirection,compositionType:r.d.Vec3Array,componentType:s.r.Float,stage:_.H.PixelShader,arrayLength:d.D.maxLightNumberInShader,min:-1,max:1,isCustomSetting:!0,initialValue:new h.j(new Float32Array(d.D.maxLightNumberInShader)),updateInterval:u.a.EveryTime},M={semantic:i.f5.LightIntensity,compositionType:r.d.Vec3Array,componentType:s.r.Float,stage:_.H.PixelShader,arrayLength:d.D.maxLightNumberInShader,min:0,max:10,isCustomSetting:!0,initialValue:new h.j(new Float32Array(d.D.maxLightNumberInShader)),updateInterval:u.a.EveryTime},D={semantic:i.f5.LightProperty,compositionType:r.d.Vec4Array,componentType:s.r.Float,stage:_.H.PixelShader,arrayLength:d.D.maxLightNumberInShader,min:0,max:10,isCustomSetting:!0,initialValue:new h.j(new Float32Array(d.D.maxLightNumberInShader)),updateInterval:u.a.EveryTime};this.__registerProperty(R,1),this.__registerProperty(P,1),this.__registerProperty(M,1),this.__registerProperty(D,1),this.takeOne(i.f5.LightDirection),this.takeOne(i.f5.LightIntensity),this.takeOne(i.f5.LightPosition),this.takeOne(i.f5.LightProperty);const N={semantic:i.f5.LightNumber,compositionType:r.d.Scalar,componentType:s.r.Int,stage:_.H.VertexAndPixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:m.Ru.fromCopyNumber(0)};this.__registerProperty(N,1),this.takeOne(i.f5.LightNumber);const B={semantic:i.f5.BackBufferTextureSize,compositionType:r.d.Vec2,componentType:s.r.Float,stage:_.H.PixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isCustomSetting:!0,needUniformInDataTextureMode:!0,updateInterval:u.a.EveryTime,initialValue:I.FM.fromCopy2(0,0)};this.__registerProperty(B,1),this.takeOne(i.f5.BackBufferTextureSize);const L={semantic:i.f5.VrState,compositionType:r.d.Vec2,componentType:s.r.Int,stage:_.H.PixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isCustomSetting:!0,needUniformInDataTextureMode:!0,updateInterval:u.a.EveryTime,initialValue:I.FM.fromCopy2(0,0)};this.__registerProperty(L,1),this.takeOne(i.f5.VrState)}static getInstance(){return this.__instance||(this.__instance=new b),this.__instance}__registerProperty(e,t){const n=(0,g.V)(e),i=a.B.getInstance().createOrGetBuffer(o.$.GPUInstanceData),l=(0,g.K)(e),c=i.takeBufferView({byteLengthToNeed:l*t,byteStride:0}).unwrapForce();let _=e.arrayLength;r.d.isArray(e.compositionType)&&null==_&&(_=100);const h={shaderSemanticsInfo:e,values:[],maxCount:t,accessor:c.takeAccessor({compositionType:e.compositionType,componentType:s.r.Float,count:t,byteStride:l,arrayLength:_}).unwrapForce()};this.__fields.set(n,h)}takeOne(e){const t=(0,i.UL)(e),n=this.__fields.get(t);if(n){const e=n.shaderSemanticsInfo,t=n.accessor.takeOne(),i=n.values.length,o=l.D.initWithFloat32Array(e.initialValue,e.initialValue,t,e.compositionType);return n.values[i]=o,o}}setValue(e,t,n){const o=(0,i.UL)(e),a=this.__fields.get(o);if(a){const e=a.values[t];l.D._setForce(e,n)}}getValue(e,t){const n=(0,i.UL)(e),o=this.__fields.get(n);if(o)return o.values[t]}getGlobalPropertyStruct(e){return this.__fields.get(e)}getGlobalProperties(){return Array.from(this.__fields.values())}_setUniformLocationsForUniformModeOnly(e){const t=c.F.getWebGLResourceRepository(),n=[];this.__fields.forEach(((e,t)=>{const i=e.shaderSemanticsInfo;n.push(i)})),t.setupUniformLocations(e,n,!0)}_setUniformLocationsForDataTextureModeOnly(e){const t=c.F.getWebGLResourceRepository(),n=[];this.__fields.forEach(((e,t)=>{const i=e.shaderSemanticsInfo;i.needUniformInDataTextureMode&&n.push(i)})),t.setupUniformLocations(e,n,!0)}setUniformValues(e){const t=c.F.getWebGLResourceRepository();this.__fields.forEach(((n,i)=>{const o=n.shaderSemanticsInfo,a=n.values;for(let n=0;n{const r=o.shaderSemanticsInfo;r.stage!==_.H.VertexShader&&r.stage!==_.H.VertexAndPixelShader||(e+=n("",r,a,!0,i)),r.stage!==_.H.PixelShader&&r.stage!==_.H.VertexAndPixelShader||(t+=n("",r,a,!0,i))})),[e,t]}}},9286:(e,t,n)=>{n.d(t,{B:()=>s});var i=n(4235),o=n(752),a=n(3258),r=n(6098);class s{constructor(e,t,n){this.__buffers={},this.__buffersOnDemand=new Map,this.__memorySizeRatios={},this.__memorySizeRatios[o.$.CPUGeneric.str]=e,this.__memorySizeRatios[o.$.GPUInstanceData.str]=t,this.__memorySizeRatios[o.$.GPUVertexData.str]=n}static createInstanceIfNotCreated({cpuGeneric:e,gpuInstanceData:t,gpuVertexData:n}){return this.__instance||(this.__instance=new s(e,t,n)),this.__instance}__makeMultipleOf4byteSize(e){return e+(e%4==0?0:4-e%4)}static getInstance(){return this.__instance}__createBuffer(e){const t=s.bufferWidthLength*s.bufferHeightLength*4*4*this.__memorySizeRatios[e.str],n=new ArrayBuffer(this.__makeMultipleOf4byteSize(t));let a=4;e!==o.$.GPUInstanceData&&e!==o.$.GPUVertexData||(a=16);const r=new i.l({byteLength:n.byteLength,buffer:n,name:e.str,byteAlign:a});return this.__buffers[r.name]=r,r}getBuffer(e){return this.__buffers[e.toString()]}createOrGetBuffer(e){let t=this.__buffers[e.toString()];return null==t&&(t=this.__createBuffer(e)),t}createBufferOnDemand(e,t,n){const a=new ArrayBuffer(e),r=new i.l({byteLength:a.byteLength,buffer:a,name:o.$.UBOGeneric.toString(),byteAlign:n});return this.__buffersOnDemand.set(t.objectUID,r),r}getBufferOnDemand(e){return this.__buffersOnDemand.get(e.objectUID)}static get bufferWidthLength(){return a.D.dataTextureWidth}static get bufferHeightLength(){return a.D.dataTextureHeight}printMemoryUsage(){const e=this.__buffers[o.$.CPUGeneric.toString()],t=this.__buffers[o.$.GPUInstanceData.toString()],n=this.__buffers[o.$.GPUVertexData.toString()];console.log("Memory Usage in Memory Manager:"),console.log(`CPUGeneric: ${e.takenSizeInByte} byte of ${e.byteLength} bytes. (${e.takenSizeInByte/e.byteLength*100} %) `),console.log(`GPUInstanceData: ${t.takenSizeInByte} byte of ${t.byteLength} bytes. (${t.takenSizeInByte/t.byteLength*100} %) `),null!=n&&console.log(`GPUVertexData: ${n.takenSizeInByte} byte of ${n.byteLength} bytes. (${n.takenSizeInByte/n.byteLength*100} %) `)}dumpBuffer(e){const t=this.__buffers[e.toString()];return r.Kf.downloadArrayBuffer(e.toString(),t.getArrayBuffer()),t}}},9002:(e,t,n)=>{n.d(t,{S:()=>o});var i=n(6098);class o{constructor(){this.__objectUid=o.currentMaxObjectCount++,this._tags={},this.__combinedTagString="",this.__uniqueName=`${this.constructor.name}__uid_${this.__objectUid}`,this.__updateInfo(this.__uniqueName)}__updateInfo(e){o.__objects[this.__objectUid]=this,o.__uniqueNames[this.__objectUid]=e,o.__objectsByNameMap.set(this.__uniqueName,this)}static searchByTag(e,t){for(const n of o.__objects)if(n.getTagValue(e)===t)return n}get objectUID(){return this.__objectUid}static getRnObject(e){return o.__objects[e]}static getRnObjectByName(e){return o.__objectsByNameMap.get(e)}tryToSetUniqueName(e,t){if(-1!==o.__uniqueNames.indexOf(e)){if(t){const t=e+"_("+this.__objectUid+")";if(-1===o.__uniqueNames.indexOf(t))return this.__uniqueName=t,o.__uniqueNames[this.__objectUid]=this.__uniqueName,o.__objectsByNameMap.set(this.__uniqueName,this),!0}return!1}return this.__uniqueName=e,o.__uniqueNames[this.__objectUid]=this.__uniqueName,o.__objectsByNameMap.set(this.__uniqueName,this),!0}validateTagString(e){return!new RegExp(/[!"#$%&'()\*\+\-\s\.,\/:;<=>?@\[\\\]^`{|}~]/g).test(e)}tryToSetTag(e){return!!this.validateTagString(e.tag)&&(this.hasTag(e.tag)&&this.removeTag(e.tag),this._tags[e.tag]=e.value,this.__combinedTagString+=`${e.tag}:${e.value} `,!0)}getTagValue(e){return this._tags[e]}getTag(e){return{tag:e,value:this._tags[e]}}hasTag(e){return null!=this._tags[e]}removeTag(e){this._tags[e],this.__combinedTagString.replace(this.__combinedTagString,""),delete this._tags[e]}matchTag(e,t){return this._tags[e]===t}matchTagsAsFreeStrings(e){let t="^";for(let n=0;n{n.d(t,{F:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}toGltfString(){return"TRANSLUCENT"===this.str?"BLEND":this.str}}const a=new o({index:0,str:"OPAQUE"}),r=new o({index:1,str:"MASK"}),s=new o({index:2,str:"TRANSLUCENT"}),l=new o({index:3,str:"ADDITIVE"}),c=[a,r,s,l],_=Object.freeze({Opaque:a,Mask:r,Translucent:s,Additive:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})},fromGlTFString:function(e){return"BLEND"===e?s:(0,i.cu)({typeList:c,str:e})}})},3498:(e,t,n)=>{n.d(t,{s:()=>h});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Quaternion"}),r=new o({index:1,str:"Translate"}),s=new o({index:2,str:"Scale"}),l=new o({index:3,str:"Weights"}),c=new o({index:4,str:"Effekseer"}),_=[a,r,s,l,c],h=Object.freeze({Quaternion:a,Translate:r,Scale:s,Weights:l,Effekseer:c,from:function(e){return(0,i.li)({typeList:_,index:e})},fromString:function(e){return(0,i.cu)({typeList:_,str:e})}})},7305:(e,t,n)=>{n.d(t,{k:()=>c});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}get GltfString(){return this.str.toUpperCase()}}const a=new o({index:0,str:"Linear"}),r=new o({index:1,str:"Step"}),s=new o({index:2,str:"CubicSpline"}),l=[a,r,s],c=Object.freeze({Linear:a,Step:r,CubicSpline:s,from:function(e){return(0,i.li)({typeList:l,index:e})},fromString:function(e){return(0,i.cu)({typeList:l,str:e})}})},290:(e,t,n)=>{n.d(t,{l:()=>b});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"ETC1"}),r=new o({index:1,str:"ETC2"}),s=new o({index:2,str:"BC1"}),l=new o({index:3,str:"BC3"}),c=new o({index:4,str:"BC4"}),_=new o({index:5,str:"BC5"}),h=new o({index:6,str:"BC7_M6_OPAQUE"}),u=new o({index:7,str:"BC7_M5"}),d=new o({index:8,str:"PVRTC1_RGB"}),m=new o({index:9,str:"PVRTC1_RGBA"}),f=new o({index:10,str:"ASTC"}),p=new o({index:11,str:"ATC_RGB"}),v=new o({index:12,str:"ATC_RGBA"}),A=new o({index:13,str:"RGBA32"}),y=new o({index:14,str:"RGB565"}),x=new o({index:15,str:"BGR565"}),g=new o({index:16,str:"RGBA4444"}),I=[a,r,s,l,c,_,u,h,d,m,f,p,v,A,y,x,g],b=Object.freeze({ETC1:a,ETC2:r,BC1:s,BC3:l,BC4:c,BC5:_,BC7_M5:u,BC7_M6_OPAQUE:h,PVRTC1_RGB:d,PVRTC1_RGBA:m,ASTC:f,ATC_RGB:p,ATC_RGBA:v,RGBA32:A,RGB565:y,BGR565:x,RGBA4444:g,from:function(e){return(0,i.li)({typeList:I,index:e})},fromString:function(e){return(0,i.cu)({typeList:I,str:e})}})},7009:(e,t,n)=>{n.d(t,{C:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:32774,str:"Equation_FUNC_ADD"}),r=new o({index:1,str:"ONE"}),s=new o({index:770,str:"ONE_ALPHA"}),l=new o({index:771,str:"ONE_MINUS_SRC_ALPHA"}),c=[a,r,s,l],_=Object.freeze({EquationFuncAdd:a,One:r,SrcAlpha:s,OneMinusSrcAlpha:l,from:function(e){return(0,i.li)({typeList:c,index:e})}})},1226:(e,t,n)=>{n.d(t,{N:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Mat43x1"}),r=new o({index:1,str:"Vec4x2"}),s=new o({index:2,str:"Vec4x2Old"}),l=new o({index:3,str:"Vec4x1"}),c=[a,r,l],_=Object.freeze({Mat43x1:a,Vec4x2:r,Vec4x2Old:s,Vec4x1:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})}})},752:(e,t,n)=>{n.d(t,{$:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"GPUInstanceData"}),r=new o({index:1,str:"GPUVertexData"}),s=new o({index:2,str:"UBOGeneric"}),l=new o({index:3,str:"CPUGeneric"}),c=[a,r,s,l],_=Object.freeze({GPUInstanceData:a,GPUVertexData:r,UBOGeneric:s,CPUGeneric:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})}})},8914:(e,t,n)=>{n.d(t,{M:()=>l});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Orbit"}),r=new o({index:1,str:"WalkThrough"}),s=[a,r],l=Object.freeze({Orbit:a,WalkThrough:r,from:function(e){return(0,i.li)({typeList:s,index:e})},fromString:function(e){return(0,i.cu)({typeList:s,str:e})}})},9646:(e,t,n)=>{n.d(t,{i:()=>c});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Perspective"}),r=new o({index:1,str:"Orthographic"}),s=new o({index:2,str:"Frustum"}),l=[a,r,s],c=Object.freeze({Perspective:a,Orthographic:r,Frustum:s,from:function(e){return(0,i.li)({typeList:l,index:e})},fromString:function(e){return(0,i.cu)({typeList:l,str:e})}})},3999:(e,t,n)=>{n.d(t,{r:()=>v});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t,sizeInBytes:n,wgsl:i,webgpu:o}){super({index:e,str:t}),this.__sizeInBytes=n,this.__webgpu=o,this.__wgsl=i}get wgsl(){return this.__wgsl}get webgpu(){return this.__webgpu}getSizeInBytes(){return this.__sizeInBytes}isFloatingPoint(){return 5126===this.index||5127===this.index||36193===this.index}isInteger(){return 5120===this.index||5121===this.index||5122===this.index||5123===this.index||5124===this.index||5125===this.index}}const a=new o({index:5119,str:"UNKNOWN",sizeInBytes:0,wgsl:"unknown",webgpu:"unknown"}),r=new o({index:5120,str:"BYTE",sizeInBytes:1,wgsl:"i32",webgpu:"sint8"}),s=new o({index:5121,str:"UNSIGNED_BYTE",sizeInBytes:1,wgsl:"u32",webgpu:"uint8"}),l=new o({index:5122,str:"SHORT",sizeInBytes:2,wgsl:"i32",webgpu:"sint16"}),c=new o({index:5123,str:"UNSIGNED_SHORT",sizeInBytes:2,wgsl:"u32",webgpu:"uint16"}),_=new o({index:5124,str:"INT",sizeInBytes:4,wgsl:"i32",webgpu:"sint32"}),h=new o({index:5125,str:"UNSIGNED_INT",sizeInBytes:4,wgsl:"u32",webgpu:"uint32"}),u=new o({index:5126,str:"FLOAT",sizeInBytes:4,wgsl:"f32",webgpu:"float32"}),d=new o({index:5127,str:"DOUBLE",sizeInBytes:8,wgsl:"f32",webgpu:"float64"}),m=new o({index:35670,str:"BOOL",sizeInBytes:1,wgsl:"bool",webgpu:"bool"}),f=new o({index:5131,str:"HALF_FLOAT",sizeInBytes:2,wgsl:"f16",webgpu:"float16"}),p=[a,r,s,l,c,_,h,u,d,f,m],v=Object.freeze({Unknown:a,Byte:r,UnsignedByte:s,Short:l,UnsignedShort:c,Int:_,UnsignedInt:h,Float:u,Double:d,Bool:m,HalfFloat:f,from:function(e){return(0,i.li)({typeList:p,index:e})},fromTypedArray:function(e){return e instanceof Int8Array?r:e instanceof Uint8Array||e instanceof Uint8ClampedArray?s:e instanceof Int16Array?l:e instanceof Uint16Array?c:e instanceof Int32Array?_:e instanceof Uint32Array?h:e instanceof Float32Array?u:e instanceof Float64Array?d:a},toTypedArray:function(e){return e===r?Int8Array:e===s?Uint8Array:e===l?Int16Array:e===c?Uint16Array:e===_?Int32Array:e===h?Uint32Array:e===u?Float32Array:e===d?Float64Array:void 0},toGltf2AccessorComponentType:function(e){return e.index},fromString:function(e){return(0,i.cu)({typeList:p,str:e})},fromGlslString:function(e){let t=e;switch(e){case"bool":t="BOOL";break;case"int":case"ivec2":case"ivec3":case"ivec4":case"sampler2D":case"sampler2DShadow":case"sampler2DRect":case"sampler3D":case"samplerCube":t="INT";break;case"float":case"vec2":case"vec3":case"vec4":case"mat2":case"mat3":case"mat4":t="FLOAT"}return(0,i.cu)({typeList:p,str:t})},fromWgslString:function(e){let t=e;switch(e){case"bool":t="BOOL";break;case"i32":case"vec2":case"vec3":case"vec4":case"sampler_2d":case"sampler_2d_shadow":case"sampler_3d":case"sampler_cube":t="INT";break;case"u32":t="UNSIGNED_INT";break;case"f32":case"vec2":case"vec3":case"vec4":case"mat2x2":case"mat3x3":case"mat4x4":t="FLOAT"}return(0,i.cu)({typeList:p,str:t})}})},810:(e,t,n)=>{n.d(t,{d:()=>S});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t,glslStr:n,hlslStr:i,wgsl:o,webgpu:a,numberOfComponents:r,vec4SizeOfProperty:s,isArray:l=!1}){super({index:e,str:t}),this.__numberOfComponents=r,this.__glslStr=n,this.__hlslStr=i,this.__vec4SizeOfProperty=s,this.__isArray=l,this.__webgpuStr=a,this.__wgslStr=o}get webgpu(){return this.__webgpuStr}get wgsl(){return this.__wgslStr}getNumberOfComponents(){return this.__numberOfComponents}getGlslStr(e){return 5126===e.index||5127===e.index||this===S.Texture2D||this===S.Texture2DShadow||this===S.Texture2DRect||this===S.TextureCube?this.__glslStr:5120===e.index||5122===e.index||5124===e.index?this===S.Scalar||this===S.ScalarArray?"int":"i"+this.__glslStr:35670===e.index?"bool":"unknown"}getGlslInitialValue(e){if(5126===e.index||5127===e.index){if(this===S.Scalar)return"0.0";if(2===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0)";if(3===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0)";if(4===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0, 0.0)";if(9===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)";if(16===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)"}else if(5120===e.index||5122===e.index||5124===e.index){if(this===S.Scalar)return"0";if(2===this.__numberOfComponents)return this.__glslStr+"(0, 0)";if(3===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0)";if(4===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0, 0)";if(9===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0, 0, 0, 0, 0, 0, 0)";if(16===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"}else if(35670===e.index){if(this===S.Scalar)return"false";if(2===this.__numberOfComponents)return this.__glslStr+"(false, false)";if(3===this.__numberOfComponents)return this.__glslStr+"(false, false, false)";if(4===this.__numberOfComponents)return this.__glslStr+"(false, false, false, false)"}return"unknown"}toWGSLType(e){return this.__wgslStr.replace("#",e.wgsl)}getVec4SizeOfProperty(){return this.__vec4SizeOfProperty}}const a=new o({index:-1,str:"UNKNOWN",glslStr:"unknown",hlslStr:"unknown",wgsl:"unknown",webgpu:"unknown",numberOfComponents:0,vec4SizeOfProperty:0}),r=new o({index:0,str:"SCALAR",glslStr:"float",hlslStr:"float",wgsl:"#",webgpu:"",numberOfComponents:1,vec4SizeOfProperty:1}),s=new o({index:1,str:"VEC2",glslStr:"vec2",hlslStr:"float2",wgsl:"vec2<#>",webgpu:"x2",numberOfComponents:2,vec4SizeOfProperty:1}),l=new o({index:2,str:"VEC3",glslStr:"vec3",hlslStr:"float3",wgsl:"vec3<#>",webgpu:"x3",numberOfComponents:3,vec4SizeOfProperty:1}),c=new o({index:3,str:"VEC4",glslStr:"vec4",hlslStr:"float4",wgsl:"vec4<#>",webgpu:"x4",numberOfComponents:4,vec4SizeOfProperty:1}),_=new o({index:4,str:"MAT2",glslStr:"mat2",hlslStr:"float2x2",wgsl:"mat2x2<#>",webgpu:"unknown",numberOfComponents:4,vec4SizeOfProperty:2}),h=new o({index:5,str:"MAT3",glslStr:"mat3",hlslStr:"float3x3",wgsl:"mat3x3<#>",webgpu:"unknown",numberOfComponents:9,vec4SizeOfProperty:3}),u=new o({index:6,str:"MAT4",glslStr:"mat4",hlslStr:"float4x4",wgsl:"mat4x4<#>",webgpu:"unknown",numberOfComponents:16,vec4SizeOfProperty:4}),d=new o({index:7,str:"TEXTURE_2D",glslStr:"sampler2D",hlslStr:"Texture2D",wgsl:"texture_2d",webgpu:"texture_2d",numberOfComponents:1,vec4SizeOfProperty:1}),m=new o({index:8,str:"TEXTURE_CUBE_MAP",glslStr:"samplerCube",hlslStr:"TextureCube",wgsl:"texture_cube",webgpu:"texture_cube",numberOfComponents:1,vec4SizeOfProperty:1}),f=new o({index:9,str:"SCALAR_ARRAY",glslStr:"float",hlslStr:"float",wgsl:"#",webgpu:"unknown",numberOfComponents:1,vec4SizeOfProperty:1,isArray:!0}),p=new o({index:10,str:"VEC2_ARRAY",glslStr:"vec2",hlslStr:"float2",wgsl:"vec2<#>",webgpu:"unknown",numberOfComponents:2,vec4SizeOfProperty:1,isArray:!0}),v=new o({index:11,str:"VEC3_ARRAY",glslStr:"vec3",hlslStr:"float3",wgsl:"vec3<#>",webgpu:"unknown",numberOfComponents:3,vec4SizeOfProperty:1,isArray:!0}),A=new o({index:12,str:"VEC4_ARRAY",glslStr:"vec4",hlslStr:"float4",wgsl:"vec4<#>",webgpu:"unknown",numberOfComponents:4,vec4SizeOfProperty:1,isArray:!0}),y=new o({index:13,str:"MAT4_ARRAY",glslStr:"mat4",hlslStr:"float4x4",wgsl:"mat4x4<#>",webgpu:"unknown",numberOfComponents:16,vec4SizeOfProperty:4,isArray:!0}),x=new o({index:14,str:"MAT3_ARRAY",glslStr:"mat3",hlslStr:"float3x3",wgsl:"mat3x3<#>",webgpu:"unknown",numberOfComponents:9,vec4SizeOfProperty:3,isArray:!0}),g=new o({index:15,str:"MAT2_ARRAY",glslStr:"mat2",hlslStr:"float2x2",wgsl:"mat2x2<#>",webgpu:"unknown",numberOfComponents:4,vec4SizeOfProperty:2,isArray:!0}),I=new o({index:16,str:"TEXTURE_2D_SHADOW",glslStr:"highp sampler2DShadow",hlslStr:"Texture2D",wgsl:"texture_2d",webgpu:"texture_2d",numberOfComponents:1,vec4SizeOfProperty:1}),b=new o({index:17,str:"TEXTURE_2D_RECT",glslStr:"sampler2DRect",hlslStr:"Texture2D",wgsl:"texture_2d",webgpu:"texture_2d",numberOfComponents:1,vec4SizeOfProperty:1}),E=new o({index:18,str:"MAT4x3_ARRAY",glslStr:"mat4x3",hlslStr:"float4x3",wgsl:"mat4x3<#>",webgpu:"unknown",numberOfComponents:12,vec4SizeOfProperty:3,isArray:!0}),T=[a,r,s,l,c,_,h,u,p,v,A,f,g,x,y,d,I,b,m,E],S=Object.freeze({Unknown:a,Scalar:r,Vec2:s,Vec3:l,Vec4:c,Mat2:_,Mat3:h,Mat4:u,ScalarArray:f,Vec2Array:p,Vec3Array:v,Vec4Array:A,Mat2Array:g,Mat3Array:x,Mat4Array:y,Texture2D:d,Texture2DShadow:I,TextureCube:m,Texture2DRect:b,Mat4x3Array:E,from:function(e){return(0,i.li)({typeList:T,index:e})},fromString:function(e){return(0,i.cu)({typeList:T,str:e})},vectorFrom:function(e){let t="";switch(e){case 1:t="scalar";break;case 2:t="vec2";break;case 3:t="vec3";break;case 4:t="vec4";break;default:console.error("not found appropriate Vectors")}return(0,i.cu)({typeList:T,str:t})},fromGlslString:function(e){let t=e;switch(e){case"bool":case"int":case"float":t="scalar";break;case"ivec2":t="vec2";break;case"ivec3":t="vec3";break;case"ivec4":t="vec4";break;case"sampler2D":t="TEXTURE_2D";break;case"sampler2DShadow":t="TEXTURE_2D_SHADOW";break;case"sampler2DRect":t="TEXTURE_2D_RECT";break;case"samplerCube":t="TEXTURE_CUBE_MAP"}return(0,i.cu)({typeList:T,str:t})},fromWgslString:function(e){let t=e;switch(e){case"bool":case"i32":case"u32":case"f32":t="scalar";break;case"vec2":case"vec2":t="vec2";break;case"vec3":case"vec3":t="vec3";break;case"vec4":case"vec4":t="vec4";break;case"sampler_2d":t="TEXTURE_2D";break;case"sampler_2d_shadow":t="TEXTURE_2D_SHADOW";break;case"sampler_cube":t="TEXTURE_CUBE_MAP"}return(0,i.cu)({typeList:T,str:t})},isArray:function(e){return e===f||e===p||e===v||e===A||e===E||e===y||e===x||e===g},isTexture:function(e){return e===d||e===m||e===I||e===b},toGltf2AnimationAccessorCompositionType:function(e){switch(e){case 1:return r;case 2:return s;case 3:return l;case 4:return c;default:throw new Error("Invalid componentN")}},toGltf2AccessorCompositionTypeString:function(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";case 9:return"MAT3";case 16:return"MAT4";default:throw new Error("Invalid componentN")}},toGltf2AnimationAccessorCompositionTypeString:function(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";default:throw new Error("Invalid componentN")}},toGltf2SquareMatrixAccessorCompositionTypeString:function(e){switch(e){case 4:return"VEC4";case 9:return"MAT3";case 16:return"MAT4";default:throw new Error("Invalid componentN")}}})},1715:(e,t,n)=>{n.d(t,{b:()=>X});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:37808,str:"COMPRESSED_RGBA_ASTC_4x4_KHR"}),r=new o({index:37809,str:"COMPRESSED_RGBA_ASTC_5x4_KHR"}),s=new o({index:37810,str:"COMPRESSED_RGBA_ASTC_5x5_KHR"}),l=new o({index:37811,str:"COMPRESSED_RGBA_ASTC_6x5_KHR"}),c=new o({index:37812,str:"COMPRESSED_RGBA_ASTC_6x6_KHR"}),_=new o({index:37813,str:"COMPRESSED_RGBA_ASTC_8x5_KHR"}),h=new o({index:37814,str:"COMPRESSED_RGBA_ASTC_8x6_KHR"}),u=new o({index:37815,str:"COMPRESSED_RGBA_ASTC_8x8_KHR"}),d=new o({index:37816,str:"COMPRESSED_RGBA_ASTC_10x5_KHR"}),m=new o({index:37817,str:"COMPRESSED_RGBA_ASTC_10x6_KHR"}),f=new o({index:37818,str:"COMPRESSED_RGBA_ASTC_10x8_KHR"}),p=new o({index:37819,str:"COMPRESSED_RGBA_ASTC_10x10_KHR"}),v=new o({index:37820,str:"COMPRESSED_RGBA_ASTC_12x10_KHR"}),A=new o({index:37821,str:"COMPRESSED_RGBA_ASTC_12x12_KHR"}),y=new o({index:37840,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR"}),x=new o({index:37841,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR"}),g=new o({index:37842,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR"}),I=new o({index:37843,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR"}),b=new o({index:37844,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR"}),E=new o({index:37845,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR"}),T=new o({index:37846,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR"}),S=new o({index:37847,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR"}),C=new o({index:37848,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR"}),w=new o({index:37849,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR"}),R=new o({index:37850,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR"}),P=new o({index:37851,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR"}),M=new o({index:37852,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR"}),D=new o({index:37853,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR"}),N=new o({index:33776,str:"COMPRESSED_RGB_S3TC_DXT1_EXT"}),B=new o({index:33777,str:"COMPRESSED_RGBA_S3TC_DXT1_EXT"}),L=new o({index:33778,str:"COMPRESSED_RGBA_S3TC_DXT3_EXT"}),F=new o({index:33779,str:"COMPRESSED_RGBA_S3TC_DXT5_EXT"}),G=new o({index:36492,str:"COMPRESSED_RGBA_BPTC_UNORM_EXT"}),z=new o({index:35842,str:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"}),V=new o({index:35840,str:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG"}),O=new o({index:37496,str:"COMPRESSED_RGBA8_ETC2_EAC"}),U=new o({index:37492,str:"COMPRESSED_RGB8_ETC2"}),k=new o({index:36196,str:"COMPRESSED_RGB_ETC1_WEBGL"}),Q=new o({index:32856,str:"RGBA8_EXT"}),W=[a,r,s,l,c,_,h,u,d,m,f,p,v,A,y,x,g,I,b,E,T,S,C,w,R,P,M,D,N,B,L,F,G,z,V,O,U,k,Q],X=Object.freeze({ASTC_RGBA_4x4:a,ASTC_RGBA_5x4:r,ASTC_RGBA_5x5:s,ASTC_RGBA_6x5:l,ASTC_RGBA_6x6:c,ASTC_RGBA_8x5:_,ASTC_RGBA_8x6:h,ASTC_RGBA_8x8:u,ASTC_RGBA_10x5:d,ASTC_RGBA_10x6:m,ASTC_RGBA_10x8:f,ASTC_RGBA_10x10:p,ASTC_RGBA_12x10:v,ASTC_RGBA_12x12:A,ASTC_SRGB_4x4:y,ASTC_SRGB_5x4:x,ASTC_SRGB_5x5:g,ASTC_SRGB_6x5:I,ASTC_SRGB_6x6:b,ASTC_SRGB_8x5:E,ASTC_SRGB_8x6:T,ASTC_SRGB_8x8:S,ASTC_SRGB_10x5:C,ASTC_SRGB_10x6:w,ASTC_SRGB_10x8:R,ASTC_SRGB_10x10:P,ASTC_SRGB_12x10:M,ASTC_SRGB_12x12:D,S3TC_RGB_DXT1:N,S3TC_RGBA_DXT1:B,S3TC_RGBA_DXT3:L,S3TC_RGBA_DXT5:F,BPTC_RGBA:G,PVRTC_RGBA_4BPPV1:z,PVRTC_RGB_4BPPV1:V,ETC2_RGBA8_EAC:O,ETC2_RGB8:U,ETC1_RGB:k,RGBA8_EXT:Q,from:function(e){return(0,i.li)({typeList:W,index:e})},fromString:function(e){return(0,i.cu)({typeList:W,str:e})}})},7338:(e,t,n)=>{n.d(t,{T:()=>u});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t,ext:n,brand:i}){super({index:e,str:t}),this.extension=n,this.brand=i}}const a=new o({index:-1,str:"unknown",ext:"unknown",brand:"UnKnown"}),r=new o({index:0,str:"gltf",ext:"gltf",brand:"glTF"}),s=new o({index:1,str:"glb",ext:"glb",brand:"glTF"}),l=new o({index:2,str:"vrm",ext:"vrm",brand:"VRM"}),c=new o({index:3,str:"drc",ext:"drc",brand:"Draco"}),_=new o({index:4,str:"efk",ext:"efk",brand:"EffekseerEffect"}),h=[a,r,s,l,c,_],u=Object.freeze({Unknown:a,Gltf:r,GltfBinary:s,VRM:l,Draco:c,EffekseerEffect:_,from:function(e){return(0,i.li)({typeList:h,index:e})},fromString:function(e){const t=(0,i.cu)({typeList:h,str:e});return null!=t?t:a},isGltfOrGlb:function(e){return e===r||e===s}})},1986:(e,t,n)=>{n.d(t,{c:()=>u});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:".ldr_srgb"}),r=new o({index:1,str:".ldr_linear"}),s=new o({index:2,str:".hdr"}),l=new o({index:3,str:".rgbe.png"}),c=new o({index:4,str:".rgb9_e5.png"}),_=new o({index:5,str:".exr"}),h=[a,r,s,l,c,_],u=Object.freeze({LDR_SRGB:a,LDR_LINEAR:r,HDR_LINEAR:s,RGBE_PNG:l,RGB9_E5_PNG:c,OpenEXR:_,from:function(e){return(0,i.li)({typeList:h,index:e})},fromString:function(e){return(0,i.cu)({typeList:h,str:e})}})},5634:(e,t,n)=>{n.d(t,{v:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Directional"}),r=new o({index:1,str:"Point"}),s=new o({index:2,str:"Spot"}),l=new o({index:3,str:"Ambient"}),c=[r,a,s,l],_=Object.freeze({Point:r,Directional:a,Spot:s,Ambient:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})}})},9216:(e,t,n)=>{n.d(t,{V:()=>d});var i=n(10),o=n(2343);class a extends o.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const r=new a({index:6402,str:"DEPTH_COMPONENT"}),s=new a({index:6406,str:"ALPHA"}),l=new a({index:i.SJU,str:"RG"}),c=new a({index:6407,str:"RGB"}),_=new a({index:6408,str:"RGBA"}),h=new a({index:6409,str:"LUMINANCE"}),u=new a({index:6410,str:"LUMINANCE_ALPHA"}),d=Object.freeze({DepthComponent:r,Alpha:s,RG:l,RGB:c,RGBA:_,Luminance:h,LuminanceAlpha:u})},8696:(e,t,n)=>{n.d(t,{T:()=>m});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}getWebGPUTypeStr(){switch(this.index){case 0:return"point-list";case 1:return"line-list";case 2:case 6:default:throw new Error("Not Supported in WebGPU");case 3:return"line-strip";case 4:return"triangle-list";case 5:return"triangle-strip"}}}const a=new o({index:-1,str:"UNKNOWN"}),r=new o({index:0,str:"POINTS"}),s=new o({index:1,str:"LINES"}),l=new o({index:2,str:"LINE_LOOP"}),c=new o({index:3,str:"LINE_STRIP"}),_=new o({index:4,str:"TRIANGLES"}),h=new o({index:5,str:"TRIANGLE_STRIP"}),u=new o({index:6,str:"TRIANGLE_FAN"}),d=[a,r,s,l,c,_,h,u],m=Object.freeze({Unknown:a,Points:r,Lines:s,LineLoop:l,LineStrip:c,Triangles:_,TriangleStrip:h,TriangleFan:u,from:function(e){return(0,i.li)({typeList:d,index:e})}})},7683:(e,t,n)=>{n.d(t,{V:()=>c,y:()=>o});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}get webGLVersion(){switch(this){case r:case s:return 2;default:return 0}}}const a=new o({index:0,str:"NONE"}),r=new o({index:1,str:"UNIFORM"}),s=new o({index:2,str:"DataTexture"}),l=new o({index:3,str:"WebGPU"}),c=Object.freeze({isDataTextureApproach:e=>e===s,isUniformApproach:e=>e===r,isWebGpuApproach:e=>e===l,None:a,Uniform:r,DataTexture:s,WebGPU:l,isWebGL2Approach:e=>{switch(e){case r:case s:return!0;default:return!1}}})},4507:(e,t,n)=>{n.d(t,{I:()=>f});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t,methodName:n}){super({index:e,str:t}),this.methodName=n}}const a=new o({index:-1,str:"UNKNOWN",methodName:"$unknown"}),r=new o({index:0,str:"CREATE",methodName:"$create"}),s=new o({index:1,str:"LOAD",methodName:"$load"}),l=new o({index:2,str:"MOUNT",methodName:"$mount"}),c=new o({index:3,str:"LOGIC",methodName:"$logic"}),_=new o({index:4,str:"PRE_RENDER",methodName:"$prerender"}),h=new o({index:5,str:"RENDER",methodName:"$render"}),u=new o({index:6,str:"UNMOUNT",methodName:"$unmount"}),d=new o({index:7,str:"DISCARD",methodName:"$discard"}),m=[a,r,s,l,c,_,h,u,d],f=Object.freeze({Unknown:a,Create:r,Load:s,Mount:l,Logic:c,PreRender:_,Render:h,Unmount:u,Discard:d,from:function(e){return(0,i.li)({typeList:m,index:e})}})},8422:(e,t,n)=>{n.d(t,{G:()=>E});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}webGLConstantValue(){return-2===this.index?0:-1===this.index?1029:36064+this.index}}const a=new o({index:-2,str:"NONE"}),r=new o({index:-1,str:"BACK"}),s=new o({index:0,str:"COLOR_ATTACHMENT0"}),l=new o({index:1,str:"COLOR_ATTACHMENT1"}),c=new o({index:2,str:"COLOR_ATTACHMENT2"}),_=new o({index:3,str:"COLOR_ATTACHMENT3"}),h=new o({index:4,str:"COLOR_ATTACHMENT4"}),u=new o({index:5,str:"COLOR_ATTACHMENT5"}),d=new o({index:6,str:"COLOR_ATTACHMENT6"}),m=new o({index:7,str:"COLOR_ATTACHMENT7"}),f=new o({index:8,str:"COLOR_ATTACHMENT8"}),p=new o({index:9,str:"COLOR_ATTACHMENT9"}),v=new o({index:10,str:"COLOR_ATTACHMENT10"}),A=new o({index:11,str:"COLOR_ATTACHMENT11"}),y=new o({index:12,str:"COLOR_ATTACHMENT12"}),x=new o({index:13,str:"COLOR_ATTACHMENT13"}),g=new o({index:14,str:"COLOR_ATTACHMENT14"}),I=new o({index:15,str:"COLOR_ATTACHMENT15"}),b=[a,r,s,l,c,_,h,u,d,m,f,p,v,A,y,x,g,I],E=Object.freeze({None:a,Back:r,ColorAttachment0:s,ColorAttachment1:l,ColorAttachment2:c,ColorAttachment3:_,ColorAttachment4:h,ColorAttachment5:u,ColorAttachment6:d,ColorAttachment7:m,ColorAttachment8:f,ColorAttachment9:p,ColorAttachment10:v,ColorAttachment11:A,ColorAttachment12:y,ColorAttachment13:x,ColorAttachment14:g,ColorAttachment15:I,from:function(e){return(0,i.li)({typeList:b,index:e})}})},3591:(e,t,n)=>{n.d(t,{Z:()=>l});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"ClassicShading"}),r=new o({index:1,str:"PBRShading"}),s=(new o({index:2,str:"Lerp"}),new o({index:3,str:"Add"}),[a,r]),l=Object.freeze({ClassicShading:a,PBRShading:r,from:function(e){return(0,i.li)({typeList:s,index:e})},fromString:function(e){return(0,i.cu)({typeList:s,str:e})}})},4587:(e,t,n)=>{n.d(t,{UL:()=>St,f5:()=>Ct,wy:()=>a});var i=n(2343),o=n(810);class a extends i.Jx{constructor({str:e}){super({index:++a.__indexCount*a._scale,str:e,noCheckStrUnique:!0}),a.__classes[this.index]=this}static getShaderSemanticByIndex(e){return this.__classes[Math.abs(e)-Math.abs(e)%this._scale]}static isNonArrayShaderSemanticIndex(e){return e>=this._scale}static isArrayAndZeroIndexShaderSemanticIndex(e){return e<0&&Math.abs(e)%a._scale==0}static isArrayAndNonZeroIndexShaderSemanticIndex(e){return e<0&&Math.abs(e)%a._scale!=0}static getIndexCount(){return a.__indexCount}}a.__indexCount=-1,a._scale=1e4,a.__classes=[];const r=new a({str:"worldMatrix"}),s=new a({str:"viewMatrix"}),l=new a({str:"isBillboard"}),c=new a({str:"enableViewMatrix"}),_=new a({str:"projectionMatrix"}),h=new a({str:"normalMatrix"}),u=new a({str:"boneMatrix"}),d=new a({str:"baseColorFactor"}),m=new a({str:"baseColorTexture"}),f=new a({str:"normalTexture"}),p=new a({str:"metallicRoughnessTexture"}),v=new a({str:"occlusionTexture"}),A=new a({str:"emissiveFactor"}),y=new a({str:"emissiveTexture"}),x=new a({str:"lightNumber"}),g=new a({str:"lightPosition"}),I=new a({str:"lightDirection"}),b=new a({str:"lightIntensity"}),E=new a({str:"lightProperty"}),T=new a({str:"metallicRoughnessFactor"}),S=new a({str:"brdfLutTexture"}),C=new a({str:"diffuseEnvTexture"}),w=new a({str:"specularEnvTexture"}),R=new a({str:"inverseEnvironment"}),P=new a({str:"iblParameter"}),M=new a({str:"viewPosition"}),D=new a({str:"wireframe"}),N=new a({str:"diffuseColorFactor"}),B=new a({str:"diffuseColorTexture"}),L=new a({str:"shininess"}),F=new a({str:"shadingModel"}),G=new a({str:"skinningMode"}),z=new a({str:"generalTexture"}),V=new a({str:"vertexAttributesExistenceArray"}),O=new a({str:"boneQuaternion"}),U=new a({str:"boneTranslateScale"}),k=new a({str:"boneTranslatePackedQuat"}),Q=new a({str:"boneScalePackedQuat"}),W=new a({str:"boneCompressedChunk"}),X=new a({str:"boneCompressedInfo"}),q=new a({str:"pointSize"}),H=new a({str:"colorEnvTexture"}),j=new a({str:"pointDistanceAttenuation"}),Y=new a({str:"hdriFormat"}),K=new a({str:"screenInfo"}),J=new a({str:"depthTexture"}),Z=new a({str:"lightViewProjectionMatrix"}),$=new a({str:"anisotropy"}),ee=new a({str:"clearcoatParameter"}),te=new a({str:"sheenColorFactor"}),ne=new a({str:"sheenColorTexture"}),ie=new a({str:"sheenRoughnessFactor"}),oe=new a({str:"sheenRoughnessTexture"}),ae=new a({str:"sheenLutTexture"}),re=new a({str:"specularGlossinessFactor"}),se=new a({str:"specularGlossinessTexture"}),le=new a({str:"entityUID"}),ce=new a({str:"morphTargetNumber"}),_e=new a({str:"dataTextureMorphOffsetPosition"}),he=new a({str:"morphWeights"}),ue=new a({str:"currentComponentSIDs"}),de=new a({str:"alphaCutoff"}),me=new a({str:"alphaTexture"}),fe=new a({str:"makeOutputSrgb"}),pe=new a({str:"framebufferWidth"}),ve=new a({str:"clearCoatFactor"}),Ae=new a({str:"clearCoatTexture"}),ye=new a({str:"clearCoatRoughnessFactor"}),xe=new a({str:"clearCoatRoughnessTexture"}),ge=new a({str:"clearCoatNormalTexture"}),Ie=new a({str:"transmissionFactor"}),be=new a({str:"transmissionTexture"}),Ee=new a({str:"backBufferTexture"}),Te=new a({str:"backBufferTextureSize"}),Se=new a({str:"thicknessFactor"}),Ce=new a({str:"thicknessTexture"}),we=new a({str:"attenuationDistance"}),Re=new a({str:"attenuationColor"}),Pe=new a({str:"isOutputHDR"}),Me=new a({str:"baseColorTextureTransform"}),De=new a({str:"baseColorTextureRotation"}),Ne=new a({str:"normalTextureTransform"}),Be=new a({str:"normalTextureRotation"}),Le=new a({str:"metallicRoughnessTextureTransform"}),Fe=new a({str:"metallicRoughnessTextureRotation"}),Ge=new a({str:"normalTexcoordIndex"}),ze=new a({str:"baseColorTexcoordIndex"}),Ve=new a({str:"metallicRoughnessTexcoordIndex"}),Oe=new a({str:"occlusionTexcoordIndex"}),Ue=new a({str:"occlusionTextureTransform"}),ke=new a({str:"occlusionTextureRotation"}),Qe=new a({str:"emissiveTexcoordIndex"}),We=new a({str:"emissiveTextureTransform"}),Xe=new a({str:"emissiveTextureRotation"}),qe=new a({str:"normalScale"}),He=new a({str:"occlusionStrength"}),je=new a({str:"envRotation"}),Ye=new a({str:"envHdriFormat"}),Ke=new a({str:"vrState"}),Je=new a({str:"enableLinearToSrgb"}),Ze=new a({str:"specularFactor"}),$e=new a({str:"specularTexture"}),et=new a({str:"specularColorFactor"}),tt=new a({str:"specularColorTexture"}),nt=new a({str:"ior"}),it=new a({str:"depthBiasPV"}),ot=new a({str:"clearCoatTextureTransform"}),at=new a({str:"clearCoatTextureRotation"}),rt=new a({str:"clearCoatRoughnessTextureTransform"}),st=new a({str:"clearCoatRoughnessTextureRotation"}),lt=new a({str:"clearCoatNormalTextureTransform"}),ct=new a({str:"clearCoatNormalTextureRotation"}),_t=new a({str:"clearCoatTexcoordIndex"}),ht=new a({str:"clearCoatRoughnessTexcoordIndex"}),ut=new a({str:"clearCoatNormalTexcoordIndex"}),dt=new a({str:"iridescenceFactor"}),mt=new a({str:"iridescenceTexture"}),ft=new a({str:"iridescenceIor"}),pt=new a({str:"iridescenceThicknessMinimum"}),vt=new a({str:"iridescenceThicknessMaximum"}),At=new a({str:"iridescenceThicknessTexture"}),yt=new a({str:"gaussianKernelSize"}),xt=new a({str:"anisotropyStrength"}),gt=new a({str:"anisotropyRotation"}),It=new a({str:"anisotropyTexture"}),bt=new a({str:"gaussianRatio"}),Et=new a({str:"isHorizontal"}),Tt=[r,s,l,c,_,h,u,d,m,f,p,v,A,y,x,g,I,b,E,T,S,C,w,R,P,M,D,N,B,L,F,G,z,V,O,U,k,Q,W,X,q,H,j,Y,K,J,Z,$,ee,te,ne,ie,oe,ae,re,se,le,ce,_e,he,ue,de,me,fe,pe,ve,Ae,ye,xe,ge,Ie,be,Ee,Te,Se,Ce,we,Re,Pe,Me,De,Ne,Be,Le,Fe,Ge,ze,Ve,Oe,Ue,ke,Qe,We,Xe,qe,He,je,Ye,Ke,Je,Ze,$e,et,tt,nt,it,ot,at,rt,st,lt,ct,_t,ht,ut,dt,mt,ft,pt,vt,At,yt,bt,Et,xt,gt,It];function St(e){return e.index}const Ct=Object.freeze({from:function(e){return(0,i.li)({typeList:Tt,index:e})},fromString:function(e){return(0,i.cu)({typeList:Tt,str:e})},fromStringCaseSensitively:function(e){return(0,i.bm)({typeList:Tt,str:e})},WorldMatrix:r,ViewMatrix:s,IsBillboard:l,EnableViewMatrix:c,ProjectionMatrix:_,NormalMatrix:h,BoneMatrix:u,BaseColorFactor:d,BaseColorTexture:m,NormalTexture:f,MetallicRoughnessTexture:p,OcclusionTexture:v,EmissiveFactor:A,EmissiveTexture:y,LightNumber:x,LightPosition:g,LightDirection:I,LightIntensity:b,LightProperty:E,MetallicRoughnessFactor:T,BrdfLutTexture:S,DiffuseEnvTexture:C,SpecularEnvTexture:w,InverseEnvironment:R,IBLParameter:P,ViewPosition:M,Wireframe:D,DiffuseColorFactor:N,DiffuseColorTexture:B,Shininess:L,ShadingModel:F,SkinningMode:G,GeneralTexture:z,VertexAttributesExistenceArray:V,BoneQuaternion:O,BoneTranslateScale:U,BoneTranslatePackedQuat:k,BoneScalePackedQuat:Q,BoneCompressedChunk:W,BoneCompressedInfo:X,PointSize:q,ColorEnvTexture:H,PointDistanceAttenuation:j,HDRIFormat:Y,ScreenInfo:K,DepthTexture:J,LightViewProjectionMatrix:Z,Anisotropy:$,ClearCoatParameter:ee,SheenColorFactor:te,SheenColorTexture:ne,SheenRoughnessFactor:ie,SheenRoughnessTexture:oe,SheenLutTexture:ae,SpecularGlossinessFactor:re,SpecularGlossinessTexture:se,ClearCoatFactor:ve,ClearCoatTexture:Ae,ClearCoatRoughnessFactor:ye,ClearCoatRoughnessTexture:xe,ClearCoatNormalTexture:ge,TransmissionFactor:Ie,TransmissionTexture:be,BackBufferTexture:Ee,BackBufferTextureSize:Te,ThicknessFactor:Se,ThicknessTexture:Ce,AttenuationDistance:we,AttenuationColor:Re,fullSemanticStr:function(e){let t="";return null!=e.prefix&&(t=e.prefix),t+e.semantic.str},getShaderProperty:(e,t,n,i,r)=>{if(t.isComponentData)return"";const s=t.compositionType.getGlslStr(t.componentType);let l=Ct.fullSemanticStr(t);const c=t.compositionType.getGlslStr(t.componentType);let _="";t.arrayLength&&(_=`[${t.arrayLength}]`);const h=` uniform ${c} u_${l}${_};\n`;let u="";if(n<0||o.d.isArray(t.compositionType)){if(Math.abs(n)%a._scale!=0&&!o.d.isArray(t.compositionType))return"";l.match(/\[.+?\]/)?l=l.replace(/\[.+?\]/g,"[i]"):l+="[i]",u+=r?`\n ${s} val;\n int i = index;\n return u_${l};\n `:`\n ${s} val;\n for (int i=0; i<${t.arrayLength}; i++) {\n if (i == index) {\n val = u_${l};\n break;\n }\n }\n return val;\n `}else u+=`return u_${l};`;let d="";return o.d.isTexture(t.compositionType)||(d=`\n ${s} get_${t.semantic.str}(float instanceId, int index) {\n ${u}\n }\n`),`${h}${d}`},EntityUID:le,MorphTargetNumber:ce,DataTextureMorphOffsetPosition:_e,MorphWeights:he,CurrentComponentSIDs:ue,AlphaCutoff:de,AlphaTexture:me,MakeOutputSrgb:fe,FramebufferWidth:pe,IsOutputHDR:Pe,BaseColorTextureTransform:Me,BaseColorTextureRotation:De,NormalTextureTransform:Ne,NormalTextureRotation:Be,MetallicRoughnessTextureTransform:Le,MetallicRoughnessTextureRotation:Fe,NormalTexcoordIndex:Ge,BaseColorTexcoordIndex:ze,MetallicRoughnessTexcoordIndex:Ve,OcclusionTexcoordIndex:Oe,OcclusionTextureTransform:Ue,OcclusionTextureRotation:ke,EmissiveTexcoordIndex:Qe,EmissiveTextureTransform:We,EmissiveTextureRotation:Xe,NormalScale:qe,OcclusionStrength:He,envRotation:je,EnvHdriFormat:Ye,VrState:Ke,EnableLinearToSrgb:Je,SpecularFactor:Ze,SpecularTexture:$e,SpecularColorFactor:et,SpecularColorTexture:tt,Ior:nt,DepthBiasPV:it,ClearCoatTextureTransform:ot,ClearCoatTextureRotation:at,ClearCoatRoughnessTextureTransform:rt,ClearCoatRoughnessTextureRotation:st,ClearCoatNormalTextureTransform:lt,ClearCoatNormalTextureRotation:ct,ClearCoatTexcoordIndex:_t,ClearCoatRoughnessTexcoordIndex:ht,ClearCoatNormalTexcoordIndex:ut,IridescenceFactor:dt,IridescenceTexture:mt,IridescenceIor:ft,IridescenceThicknessMinimum:pt,IridescenceThicknessMaximum:vt,IridescenceThicknessTexture:At,GaussianKernelSize:yt,GaussianRatio:bt,IsHorizontal:Et,AnisotropyStrength:xt,AnisotropyRotation:gt,AnisotropyTexture:It})},1181:(e,t,n)=>{n.d(t,{K:()=>o,V:()=>a});var i=n(810);function o(e){const t=e.compositionType.getNumberOfComponents()*e.componentType.getSizeInBytes();let n=t;if(n%16!=0&&(n=t+16-t%16),i.d.isArray(e.compositionType)){const t=e.arrayLength;null!=t?n*=t:(console.error("semanticInfo has invalid maxIndex!"),n*=100)}return n}function a(e){return e.semantic.index}},5324:(e,t,n)=>{n.d(t,{H:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:1,str:"VertexShader"}),r=new o({index:2,str:"PixelShader"}),s=new o({index:3,str:"VertexAndPixelShader"}),l=new o({index:4,str:"ComputeShader"}),c=[a,r,s,l],_=Object.freeze({VertexShader:a,PixelShader:r,VertexAndPixelShader:s,ComputeShader:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})}})},1813:(e,t,n)=>{n.d(t,{a:()=>c});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"FirstTimeOnly"}),r=new o({index:1,str:"EveryTime"}),s=new o({index:2,str:"RenderPass"}),l=[a,r,s],c=Object.freeze({FirstTimeOnly:a,EveryTime:r,RenderPass:s,from:function(e){return(0,i.li)({typeList:l,index:e})},fromString:function(e){return(0,i.cu)({typeList:l,str:e})}})},9840:(e,t,n)=>{n.d(t,{D:()=>h});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:-1,str:"UNKNOWN"}),r=new o({index:0,str:"CONSTANT"}),s=new o({index:1,str:"LAMBERT"}),l=new o({index:2,str:"BLINN"}),c=new o({index:3,str:"PHONG"}),_=[a,r,s,l,c],h=Object.freeze({Unknown:a,Constant:r,Lambert:s,BlinnPhong:l,Phong:c,from:function(e){return(0,i.li)({typeList:_,index:e})}})},5981:(e,t,n)=>{n.d(t,{d:()=>O});var i=n(10),o=n(2343),a=n(9216);class r extends o.Jx{constructor({index:e,str:t,webgpu:n}){super({index:e,str:t}),this.__webgpu=n}get webgpu(){if(void 0===this.__webgpu)throw new Error(`does not support ${this.str}`);return this.__webgpu}}const s=new r({index:9728,str:"NEAREST",webgpu:"nearest"}),l=new r({index:9729,str:"LINEAR",webgpu:"linear"}),c=new r({index:9984,str:"NEAREST_MIPMAP_NEAREST",webgpu:"nearest"}),_=new r({index:9985,str:"LINEAR_MIPMAP_NEAREST",webgpu:"linear"}),h=new r({index:9986,str:"NEAREST_MIPMAP_LINEAR",webgpu:"nearest"}),u=new r({index:9987,str:"LINEAR_MIPMAP_LINEAR",webgpu:"linear"}),d=new r({index:10240,str:"TEXTURE_MAG_FILTER"}),m=new r({index:10241,str:"TEXTURE_MIN_FILTER"}),f=new r({index:10242,str:"TEXTURE_WRAP_S"}),p=new r({index:10243,str:"TEXTURE_WRAP_T"}),v=new r({index:3553,str:"TEXTURE_2D"}),A=new r({index:5890,str:"TEXTURE"}),y=new r({index:33984,str:"TEXTURE0"}),x=new r({index:33985,str:"TEXTURE1"}),g=new r({index:34016,str:"ACTIVE_TEXTURE"}),I=new r({index:10497,str:"REPEAT",webgpu:"repeat"}),b=new r({index:33071,str:"CLAMP_TO_EDGE",webgpu:"clamp-to-edge"}),E=new r({index:33648,str:"MIRRORED_REPEAT",webgpu:"mirror-repeat"}),T=new r({index:32849,str:"RGB8"}),S=new r({index:32856,str:"RGBA8",webgpu:"rgba8unorm"}),C=new r({index:32857,str:"RGB10_A2"}),w=new r({index:i.uLG,str:"RG16F"}),R=new r({index:i.uM4,str:"RG32F"}),P=new r({index:34843,str:"RGB16F"}),M=new r({index:34837,str:"RGB32F"}),D=new r({index:34842,str:"RGBA16F"}),N=new r({index:34836,str:"RGBA32F"}),B=new r({index:33189,str:"DEPTH_COMPONENT16"}),L=new r({index:33190,str:"DEPTH_COMPONENT24"}),F=new r({index:36012,str:"DEPTH_COMPONENT32F"}),G=new r({index:35056,str:"DEPTH24_STENCIL8"}),z=new r({index:36013,str:"DEPTH32F_STENCIL8"}),V=[s,l,c,_,h,u,d,m,f,p,v,A,y,x,g,I,b,E,T,S,C,w,R,P,M,D,N,B,L,F,G,z],O=Object.freeze({Nearest:s,Linear:l,NearestMipmapNearest:c,LinearMipmapNearest:_,NearestMipmapLinear:h,LinearMipmapLinear:u,TextureMagFilter:d,TextureMinFilter:m,TextureWrapS:f,TextureWrapT:p,Texture2D:v,Texture:A,Texture0:y,Texture1:x,ActiveTexture:g,Repeat:I,ClampToEdge:b,MirroredRepeat:E,RGB8:T,RGBA8:S,RGB10_A2:C,RG16F:w,RG32F:R,RGB16F:P,RGB32F:M,RGBA16F:D,RGBA32F:N,Depth16:B,Depth24:L,Depth32F:F,Depth24Stencil8:G,Depth32FStencil8:z,from:function(e){return(0,o.li)({typeList:V,index:e})},migrateToWebGL1InternalFormat:function(e){if(e.index===S.index)return a.V.RGBA;if(e.index===T.index)return a.V.RGB;throw new Error("Unsupported texture parameter")}})},128:(e,t,n)=>{n.d(t,{T:()=>g,x:()=>a});var i=n(2343),o=n(3738);class a extends i.Jx{constructor({str:e,shaderStr:t,attributeSlot:n,gltfComponentN:i}){super({index:a.__indexCount++,str:e}),this.__attributeSlot=n,this.__shaderStr=t,this.__gltfComponentN=i}getAttributeSlot(){return this.__attributeSlot}get shaderStr(){return this.__shaderStr}get attributeTypeName(){return this.str}_setShaderStr(e){this.__shaderStr=this.__shaderStr+e}get X(){return`${this.attributeTypeName}.X`}get Y(){return`${this.attributeTypeName}.Y`}get Z(){return`${this.attributeTypeName}.Z`}get W(){return`${this.attributeTypeName}.W`}get XY(){return`${this.attributeTypeName}.X,${this.attributeTypeName}.Y`}get XYZ(){return`${this.attributeTypeName}.X,${this.attributeTypeName}.Y,${this.attributeTypeName}.Z`}get XYZW(){return`${this.attributeTypeName}.X,${this.attributeTypeName}.Y,${this.attributeTypeName}.Z,${this.attributeTypeName}.W`}getVertexAttributeComponentsAsGltf(){if(1===this.__gltfComponentN)return this.X;if(2===this.__gltfComponentN)return this.XY;if(3===this.__gltfComponentN)return this.XYZ;if(4===this.__gltfComponentN)return this.XYZW;throw new o.Mr({message:"Invalid gltf component number",error:this.__gltfComponentN})}static __createVertexAttributeClass(e){return new a(e)}}a.__indexCount=-1;const r=a.__createVertexAttributeClass({str:"UNKNOWN",shaderStr:"a_unknown",attributeSlot:-1,gltfComponentN:0}),s=a.__createVertexAttributeClass({str:"POSITION",shaderStr:"a_position",attributeSlot:0,gltfComponentN:3}),l=a.__createVertexAttributeClass({str:"NORMAL",shaderStr:"a_normal",attributeSlot:1,gltfComponentN:3}),c=a.__createVertexAttributeClass({str:"TANGENT",shaderStr:"a_tangent",attributeSlot:2,gltfComponentN:3}),_=a.__createVertexAttributeClass({str:"TEXCOORD_0",shaderStr:"a_texcoord_0",attributeSlot:3,gltfComponentN:2}),h=a.__createVertexAttributeClass({str:"TEXCOORD_1",shaderStr:"a_texcoord_1",attributeSlot:4,gltfComponentN:2}),u=a.__createVertexAttributeClass({str:"COLOR_0",shaderStr:"a_color_0",attributeSlot:5,gltfComponentN:4}),d=a.__createVertexAttributeClass({str:"JOINTS_0",shaderStr:"a_joints_0",attributeSlot:6,gltfComponentN:4}),m=a.__createVertexAttributeClass({str:"WEIGHTS_0",shaderStr:"a_weights_0",attributeSlot:7,gltfComponentN:4}),f=a.__createVertexAttributeClass({str:"INSTANCE",shaderStr:"a_instanceInfo",attributeSlot:8,gltfComponentN:4}),p=a.__createVertexAttributeClass({str:"FACE_NORMAL",shaderStr:"a_faceNormal",attributeSlot:9,gltfComponentN:3}),v=a.__createVertexAttributeClass({str:"BARY_CENTRIC_COORD",shaderStr:"a_baryCentricCoord",attributeSlot:10,gltfComponentN:3}),A=a.__createVertexAttributeClass({str:"TEXCOORD_2",shaderStr:"a_texcoord_2",attributeSlot:11,gltfComponentN:2}),y=[r,s,l,c,_,h,u,d,m,f,p,v,A],x=y.length-1,g=Object.freeze({Unknown:r,Position:s,Normal:l,Tangent:c,Texcoord0:_,Texcoord1:h,Color0:u,Joints0:d,Weights0:m,Instance:f,FaceNormal:p,BaryCentricCoord:v,AttributeTypeNumber:x,isInstanceOfVertexAttributeClass:function(e){return e instanceof a},toVertexAttributeSemanticJoinedStringAsGltfStyle:function(e){switch(e){case s:case u:case l:case c:return e.XYZ;case _:case h:case A:return e.XY;case d:case m:case f:case p:case v:return e.XYZW;default:throw new Error("Invalied glTF VertexAttributeEnum")}},toAttributeSlotFromJoinedString:function(e){switch(e){case s.XYZ:return s.getAttributeSlot();case u.XYZ:return u.getAttributeSlot();case l.XYZ:return l.getAttributeSlot();case c.XYZ:return c.getAttributeSlot();case _.XY:return _.getAttributeSlot();case h.XY:return h.getAttributeSlot();case A.XY:return A.getAttributeSlot();case d.XYZW:return d.getAttributeSlot();case m.XYZW:return m.getAttributeSlot();case f.XYZW:return f.getAttributeSlot();case p.XYZ:return p.getAttributeSlot();case v.XYZ:return v.getAttributeSlot();default:throw new Error("Invalied glTF VertexAttributeEnum")}},toVectorComponentN:function(e){return e.split(",").length},from:function(e){return(0,i.li)({typeList:y,index:e})},fromString:function(e){let t=e;return"COLOR"===e?t="COLOR_0":"TEXCOORD"===e?t="TEXCOORD_0":"JOINTS"===e?t="JOINTS_0":"WEIGHTS"===e&&(t="WEIGHTS_0"),(0,i.cu)({typeList:y,str:t})}})},1296:(e,t,n)=>{n.d(t,{Fv:()=>i.F,sd:()=>o.s,kO:()=>a.k,l6:()=>r.l,Nh:()=>s.N,$H:()=>l.$,My:()=>c.M,iM:()=>_.i,re:()=>h.r,dh:()=>u.d,bf:()=>d.b,Tv:()=>m.T,cz:()=>f.c,vB:()=>p.v,VI:()=>v.V,Tc:()=>A.T,V7:()=>y.V,yv:()=>y.y,Iq:()=>x.I,G2:()=>g.G,Zp:()=>I.Z,f5:()=>b.f5,wy:()=>b.wy,Ho:()=>T.H,Lv:()=>M,ax:()=>D.a,DA:()=>N.D,J1:()=>z,dI:()=>V.d,T:()=>O.T,x$:()=>O.x,EE:()=>q,Vl:()=>E.V,UL:()=>b.UL,Ky:()=>E.K});var i=n(5704),o=n(3498),a=n(7305),r=n(290),s=n(1226),l=n(752),c=n(8914),_=n(9646),h=n(3999),u=n(810),d=n(1715),m=n(7338),f=n(1986),p=n(5634),v=n(9216),A=n(8696),y=n(7683),x=n(4507),g=n(8422),I=n(3591),b=n(4587),E=n(1181),T=n(5324),S=n(2343);class C extends S.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const w=new C({index:1,str:"Varying"}),R=new C({index:2,str:"ReadOnlyData"}),P=[w,R],M=Object.freeze({Varying:w,ReadOnlyData:R,from:function(e){return(0,S.li)({typeList:P,index:e})},fromString:function(e){return(0,S.cu)({typeList:P,str:e})}});var D=n(1813),N=n(9840);class B extends S.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const L=new B({index:0,str:"Standard"}),F=new B({index:1,str:"Variance"}),G=[L,F],z=Object.freeze({Standard:L,Variance:F,from:function(e){return(0,S.li)({typeList:G,index:e})},fromString:function(e){return(0,S.cu)({typeList:G,str:e})}});var V=n(5981),O=n(128);class U extends S.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const k=new U({index:0,str:"Neutral"}),Q=new U({index:1,str:"Visible"}),W=new U({index:-1,str:"Invisible"}),X=[Q,W,k],q=Object.freeze({Visible:Q,Invisible:W,Neutral:k,from:function(e){return(0,S.li)({typeList:X,index:e})},fromString:function(e){return(0,S.cu)({typeList:X,str:e})}})},6477:(e,t,n)=>{n.d(t,{i:()=>s});var i=n(7192),o=n(5467),a=n(3496),r=n(4536);class s{constructor(){this.top=r.xQ.zero(),this.bottom=r.xQ.zero(),this.right=r.xQ.zero(),this.left=r.xQ.zero(),this.zNear=r.xQ.zero(),this.zFar=r.xQ.zero(),this.__updated=!1,this.__vp=a.e.zero(),this.__invProjMat=a.e.zero(),this.__invViewMat=a.e.zero(),this.corners=[]}update(e,t){o.J.multiplyTo(t,e,this.__vp),this.zNear.x=this.__vp.m20+this.__vp.m30,this.zNear.y=this.__vp.m21+this.__vp.m31,this.zNear.z=this.__vp.m22+this.__vp.m32,this.zNear.w=this.__vp.m23+this.__vp.m33,this.zFar.x=-this.__vp.m20+this.__vp.m30,this.zFar.y=-this.__vp.m21+this.__vp.m31,this.zFar.z=-this.__vp.m22+this.__vp.m32,this.zFar.w=-this.__vp.m23+this.__vp.m33,this.bottom.x=this.__vp.m10+this.__vp.m30,this.bottom.y=this.__vp.m11+this.__vp.m31,this.bottom.z=this.__vp.m12+this.__vp.m32,this.bottom.w=this.__vp.m13+this.__vp.m33,this.top.x=-this.__vp.m10+this.__vp.m30,this.top.y=-this.__vp.m11+this.__vp.m31,this.top.z=-this.__vp.m12+this.__vp.m32,this.top.w=-this.__vp.m13+this.__vp.m33,this.left.x=this.__vp.m00+this.__vp.m30,this.left.y=this.__vp.m01+this.__vp.m31,this.left.z=this.__vp.m02+this.__vp.m32,this.left.w=this.__vp.m03+this.__vp.m33,this.right.x=-this.__vp.m00+this.__vp.m30,this.right.y=-this.__vp.m01+this.__vp.m31,this.right.z=-this.__vp.m02+this.__vp.m32,this.right.w=-this.__vp.m03+this.__vp.m33;const n=[i.Lt.fromCopy4(-1,1,1,1),i.Lt.fromCopy4(1,1,1,1),i.Lt.fromCopy4(1,-1,1,1),i.Lt.fromCopy4(-1,-1,1,1),i.Lt.fromCopy4(-1,1,-1,1),i.Lt.fromCopy4(1,1,-1,1),i.Lt.fromCopy4(1,-1,-1,1),i.Lt.fromCopy4(-1,-1,-1,1)];o.J.invertTo(t,this.__invProjMat),o.J.invertTo(e,this.__invViewMat);for(let e=0;e<8;e++)n[e]=this.__invProjMat.multiplyVector(n[e]),n[e]=i.Lt.fromCopy4(n[e].x/n[e].w,n[e].y/n[e].w,n[e].z/n[e].w,1),this.corners[e]=this.__invViewMat.multiplyVector(n[e])}culling(e){const t=e.entity.getSceneGraph().worldAABB;for(let e=0;e<6;e++){let n=0;const i=this.getPlane(e);if(n+=i.x*t.minPoint.x+i.y*t.minPoint.y+i.z*t.minPoint.z+i.w<0?1:0,n+=i.x*t.maxPoint.x+i.y*t.minPoint.y+i.z*t.minPoint.z+i.w<0?1:0,n+=i.x*t.minPoint.x+i.y*t.maxPoint.y+i.z*t.minPoint.z+i.w<0?1:0,n+=i.x*t.maxPoint.x+i.y*t.maxPoint.y+i.z*t.minPoint.z+i.w<0?1:0,n+=i.x*t.minPoint.x+i.y*t.minPoint.y+i.z*t.maxPoint.z+i.w<0?1:0,n+=i.x*t.maxPoint.x+i.y*t.minPoint.y+i.z*t.maxPoint.z+i.w<0?1:0,n+=i.x*t.minPoint.x+i.y*t.maxPoint.y+i.z*t.maxPoint.z+i.w<0?1:0,n+=i.x*t.maxPoint.x+i.y*t.maxPoint.y+i.z*t.maxPoint.z+i.w<0?1:0,8===n)return!1}let n=0;n=0;for(let e=0;e<8;e++)n+=this.corners[e].x>t.maxPoint.x?1:0;if(8===n)return!1;n=0;for(let e=0;e<8;e++)n+=this.corners[e].xt.maxPoint.y?1:0;if(8===n)return!1;n=0;for(let e=0;e<8;e++)n+=this.corners[e].yt.maxPoint.z?1:0;if(8===n)return!1;n=0;for(let e=0;e<8;e++)n+=this.corners[e].z{n.d(t,{K:()=>m});var i=n(128),o=n(8696),a=n(9286),r=n(752),s=n(3999),l=n(810),c=n(2471),_=n(2477),h=n(7987),u=n(9190),d=n(4690);class m{constructor(){this.__primitives=[],this.__opaquePrimitives=[],this.__transparentPrimitives=[],this.__morphPrimitives=[],this.__localAABB=new _.m,this.__vaoUids=[],this.__variationVBOUid=h.F.InvalidCGAPIResourceUid,this.__latestPrimitivePositionAccessorVersion=0,this.__belongToEntities=[],this.tangentCalculationMode=1,this.__hasFaceNormal=!1,this.__meshUID=++m.__mesh_uid_count}getVaoUids(e){return this.__vaoUids[e]}getVaoUidsByPrimitiveUid(e){const t=this.__primitives.findIndex((t=>t.primitiveUid===e));return this.__vaoUids[t]}get meshEntitiesInner(){return this.__belongToEntities}_belongToMeshComponent(e){this.__belongToEntities.push(e.entity)}addPrimitive(e){e._belongToMesh(this),null!=e.material&&e.material.isBlend()?this.__transparentPrimitives.push(e):this.__opaquePrimitives.push(e),this.__setPrimitives(this.__opaquePrimitives.concat(this.__transparentPrimitives))}__setPrimitives(e){this.__primitives=e}isAllBlend(){return this.__transparentPrimitives.length>0&&0===this.__opaquePrimitives.length}isBlendPartially(){return this.__transparentPrimitives.length>0&&this.__opaquePrimitives.length>0}isOpaque(){return 0===this.__transparentPrimitives.length&&this.__opaquePrimitives.length>0}getPrimitiveAt(e){return this.__primitives[e]}getPrimitiveNumber(){return this.__primitives.length}updateVariationVBO(){const e=h.F.getCgApiResourceRepository();this.__variationVBOUid!==h.F.InvalidCGAPIResourceUid&&e.deleteVertexBuffer(this.__variationVBOUid);const t=this.__belongToEntities.length,n=new Float32Array(4*t);for(let e=0;e{const o=t.getAttribute(i),a=o.elementCount;for(let e=0;e{n.d(t,{W:()=>y});var i=n(8696),o=n(128),a=n(9002),r=n(3999),s=n(9286),l=n(810),c=n(2477),_=n(3913),h=n(7987),u=n(2471),d=n(9190),m=n(4690),f=n(4339),p=n(2852),v=n(6312),A=n(3449);class y extends a.S{constructor(){super(),this.__mode=i.T.Unknown,this.__material=_.G.createEmptyMaterial(),this.__materialVariants=new Map,this.__currentVariantName=void 0,this._prevMaterial=_.G.createEmptyMaterial(),this.__attributes=new Map,this.__oIndices=new v.Hq,this.__primitiveUid=-1,this.__aabb=new c.m,this.__targets=[],this.__latestPositionAccessorVersion=0,this.__woMesh=new p.Lq,this._sortkey=0,this._viewDepth=0}getIndexBitSize(){const e=this.__oIndices.unwrapOrUndefined();if(null==e)throw new Error("indexAccessor is null");if(e.componentType===r.r.UnsignedShort)return"uint16";if(e.componentType===r.r.UnsignedInt)return"uint32";throw new Error("unknown indexAccessor.componentType")}get _vertexHandles(){return this.__vertexHandles}setMaterialVariant(e,t){this.__materialVariants.set(e,t)}applyMaterialVariant(e){const t=this.__materialVariants.get(e);t&&(this.material=t,this.__currentVariantName=e)}getVariantNames(){return Array.from(this.__materialVariants.keys())}getVariantMaterial(e){return this.__materialVariants.get(e)}set material(e){this.__material=e,this.setSortKey(f.Yx,e.alphaMode.index),e._addBelongPrimitive(this)}get material(){return this.__material}setSortKey(e,t){const n=t<{c+=e.byteLength}));let _=c;null!=i&&(_+=A.j.addPaddingBytes(i.byteLength,4));const h=s.B.getInstance().createBufferOnDemand(_,this,4);let u,d,m;if(null!=i){u=r.r.fromTypedArray(i),d=h.takeBufferView({byteLengthToNeed:i.byteLength,byteStride:0}).unwrapForce(),m=d.takeAccessor({compositionType:l.d.Scalar,componentType:u,count:i.byteLength/u.getSizeInBytes()}).unwrapForce();for(let e=0;e{const a=l.d.vectorFrom(o.T.toVectorComponentN(t[i]));v[i]=r.r.fromTypedArray(e[i]);const s=f.takeAccessor({compositionType:a,componentType:r.r.fromTypedArray(e[i]),count:n.byteLength/a.getNumberOfComponents()/v[i].getSizeInBytes()}).unwrapForce();s.copyFromTypedArray(n),p.push(s)}));const y=new Map;for(let e=0;e{e.push(t)})),e}getAttribute(e){return this.__attributes.get(e)}get attributeSemantics(){const e=[];return this.__attributes.forEach(((t,n)=>{e.push(n)})),e}get attributeEntries(){return this.__attributes.entries()}get attributeCompositionTypes(){const e=[];return this.__attributes.forEach(((t,n)=>{e.push(t.compositionType)})),e}get attributeComponentTypes(){const e=[];return this.__attributes.forEach(((t,n)=>{e.push(t.componentType)})),e}get primitiveMode(){return this.__mode}get primitiveUid(){return this.__primitiveUid}get positionAccessorVersion(){if(null!=this.__cachePositionAccessor)return this.__cachePositionAccessor.version;{const e=this.__attributes.get(o.T.Position.XYZ);return null!=e?(this.__cachePositionAccessor=e,e.version):void 0}}get AABB(){if(this.__aabb.isVanilla()||this.positionAccessorVersion!==this.__latestPositionAccessorVersion){const e=this.__attributes.get(o.T.Position.XYZ),t=e.min;this.__aabb.minPoint=y.__tmpVec3_0.setComponents(t[0],t[1],t[2]);const n=e.max;this.__aabb.maxPoint=y.__tmpVec3_0.setComponents(n[0],n[1],n[2]),this.__latestPositionAccessorVersion=e.version}return this.__aabb}setVertexAttribute(e,t){this.__attributes.set(t,e)}removeIndices(){this.__oIndices=new v.Hq}setIndices(e){this.__oIndices=new v.bD(e)}setBlendShapeTargets(e){this.__targets=e}getBlendShapeTargets(){return this.__targets.concat()}get targets(){return this.__targets}isBlend(){return!(null==this.material||!this.material.isBlend())}isOpaque(){return!this.isBlend()}create3DAPIVertexData(){if(null!=this.__vertexHandles)return!1;const e=h.F.getCgApiResourceRepository();return this.__vertexHandles=e.createVertexBufferAndIndexBuffer(this),!0}update3DAPIVertexData(){const e=this.__vertexHandles;return!m.Is.not.exist(this.__vertexHandles)&&(h.F.getCgApiResourceRepository().updateVertexBufferAndIndexBuffer(this,e),!0)}delete3DAPIVertexData(){return null!=this.__vertexHandles&&(h.F.getWebGLResourceRepository().deleteVertexDataResources(this.__vertexHandles),this.__vertexHandles=void 0,!0)}get vertexHandles(){return this.__vertexHandles}castRay(e,t,n,o,a,r){let s=Number.MAX_VALUE,l=3;if(this.__mode===i.T.TriangleStrip)l=1;else if(this.__mode===i.T.Points)return{result:!1};let c=0,_=0,h=0,d=0;if(this.hasIndices()){const i=this.__oIndices.unwrapForce();for(let u=0;ui.elementCount-1)break;const p=i.getScalar(f,{}),v=i.getScalar(f+1,{}),A=i.getScalar(f+2,{}),y=this.__castRayInnerTomasMoller(e,t,u,p,v,A,n,o,a,r);m.Is.false(y)||m.Is.not.exist(y.data)||y.data.t-c&&!l)return{result:!1}}}const h=this.__attributes.get(o.T.Position.XYZ),m=h.getVec3(i,{}),f=h.getVec3(a,{}),p=h.getVec3(r,{}),v=d.d6.zero(),A=d.d6.zero(),y=d.d6.zero(),x=d.d6.zero(),g=d.d6.zero();let I=0,b=0;d.d6.subtractTo(f,m,v),d.d6.subtractTo(p,m,A),d.d6.crossTo(t,A,y);const E=u.P.dot(v,y);if(E>1e-4){if(d.d6.subtractTo(e,m,x),I=u.P.dot(x,y),I<0||I>E)return{result:!1};if(d.d6.crossTo(x,v,g),b=u.P.dot(t,g),b<0||I+b>E)return{result:!1}}else{if(!(E<-1e-4))return{result:!1};if(d.d6.subtractTo(e,m,x),I=u.P.dot(x,y),I>0||I0||I+b{n.d(t,{X:()=>l});var i=n(8696),o=n(128),a=n(2471),r=n(4690),s=n(3713);class l extends s.A{generate(e){var t;const n={widthVector:null!==(t=e.widthVector)&&void 0!==t?t:a.P.fromCopy3(1,1,1),color:e.color,material:e.material},s=[-n.widthVector.x/2,n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,-n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,-n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,-n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,-n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,-n.widthVector.y/2,n.widthVector.z/2,n.widthVector.x/2,-n.widthVector.y/2,n.widthVector.z/2,n.widthVector.x/2,n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,-n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,-n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,n.widthVector.y/2,-n.widthVector.z/2,-n.widthVector.x/2,n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,-n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,-n.widthVector.y/2,n.widthVector.z/2,n.widthVector.x/2,n.widthVector.y/2,n.widthVector.z/2,n.widthVector.x/2,n.widthVector.y/2,-n.widthVector.z/2,-n.widthVector.x/2,-n.widthVector.y/2,-n.widthVector.z/2,-n.widthVector.x/2,-n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,n.widthVector.y/2,-n.widthVector.z/2],l=r.Is.not.exist(n.color)?[]:[n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a],c=[o.T.Position.XYZ,o.T.Normal.XYZ,o.T.Texcoord0.XY],_=[new Float32Array(s),new Float32Array([0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),new Float32Array([0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1])];r.Is.exist(n.color)&&(c.push(o.T.Color0.XYZ),_.push(new Float32Array(l)));const h=i.T.Triangles;this.copyVertexData({attributes:_,attributeSemantics:c,primitiveMode:h,indices:new Uint16Array([3,1,0,2,1,3,4,5,7,7,5,6,8,9,11,11,9,10,15,13,12,14,13,15,19,17,16,18,17,19,20,21,23,23,21,22]),material:n.material})}}},3713:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(1845);class o extends i.W{}},9561:(e,t,n)=>{n.d(t,{J:()=>r});var i=n(128),o=n(8696),a=n(3713);class r extends a.A{generate(e){var t,n,a,r,s,l;const c={width:null!==(t=e.width)&&void 0!==t?t:1,height:null!==(n=e.height)&&void 0!==n?n:1,uSpan:null!==(a=e.uSpan)&&void 0!==a?a:1,vSpan:null!==(r=e.vSpan)&&void 0!==r?r:1,isUVRepeat:null!==(s=e.isUVRepeat)&&void 0!==s&&s,flipTextureCoordinateY:null!==(l=e.flipTextureCoordinateY)&&void 0!==l&&l,material:e.material},_=[];for(let e=0;e<=c.vSpan;e++)for(let t=0;t<=c.uSpan;t++)_.push((t/c.uSpan-.5)*c.width),_.push(0),_.push((e/c.vSpan-.5)*c.height);const h=[];for(let e=0;e{n.d(t,{BH:()=>c,IM:()=>a,Qo:()=>_,V_:()=>s,Y1:()=>r,Yx:()=>l,aK:()=>i,xz:()=>o});const i=3,o=10,a=2,r=0,s=i,l=i+o,c=i+o+a,_=32},817:(e,t,n)=>{n.d(t,{q:()=>h});var i=n(8082),o=n(8696),a=n(128),r=n(1845),s=n(2471),l=n(6214),c=n(7973),_=n(4690);class h extends i.t{constructor(e){super(e)}get isSetup(){return null!=this.__topEntity}_setup(){if(this.__toSkipSetup())return;this.__topEntity=c._.createMeshEntity(),this.__topEntity.tryToSetUniqueName(`AABBGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph());const e=this.__topEntity.tryToGetMesh();h.__mesh=new l.K,h.__mesh.addPrimitive(h.generatePrimitive()),e.setMesh(h.__mesh),this.setGizmoTag()}static generatePrimitive(){const e=new Uint32Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,3,3,7,7,4,4,0,1,2,2,6,6,5,5,1,0,1,1,5,5,4,4,0,3,2,2,6,6,7,7,3]),t=new Float32Array([-1,-1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,1,1]);return r.W.createPrimitive({indices:e,attributeSemantics:[a.T.Position.XYZ],attributes:[t],primitiveMode:o.T.Lines})}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph().worldAABB;this.__topEntity.getTransform().localPosition=e.centerPoint,this.__topEntity.getTransform().localScale=s.P.fromCopyArray([e.sizeX/2,e.sizeY/2,e.sizeZ/2])}_destroy(){_.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}}},8082:(e,t,n)=>{n.d(t,{t:()=>a});var i=n(9002),o=n(8491);class a extends i.S{constructor(e){super(),this.__isVisible=!1,this.__target=e,this.setGizmoTag()}set isVisible(e){this.__setVisible(e)}get isVisible(){return this.__isVisible}__setVisible(e){this.__isVisible=e,this.__topEntity&&this.__topEntity.getSceneGraph().setVisibilityRecursively(e)}__toSkipSetup(){return!!this.isSetup||!!this.__target.matchTag("Being","gizmo")}setGizmoTag(){if(this.__topEntity){this.__topEntity.tryToSetTag({tag:"Being",value:"gizmo"}),this.__topEntity.tryToSetTag({tag:"Gizmo",value:"top"});const e=o.a.flattenHierarchy(this.__topEntity.getSceneGraph(),!1);for(const t of e)t.entity.tryToSetTag({tag:"Being",value:"gizmo"});this.__topEntity.tryToSetTag({tag:"type",value:"background-assets"})}}}},7326:(e,t,n)=>{n.d(t,{k:()=>h});var i=n(8696),o=n(128),a=n(6214),r=n(1845),s=n(7973),l=n(2471),c=n(4690),_=n(8082);class h extends _.t{constructor(e){super(e)}get isSetup(){return null!=this.__topEntity}set length(e){h.__length=e}get length(){return h.__length}_setup(){if(this.__toSkipSetup())return;this.__topEntity=s._.createMeshEntity(),this.__topEntity.tryToSetUniqueName(`LocatorGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph());const e=this.__topEntity.tryToGetMesh();h.__mesh=new a.K,h.__mesh.addPrimitive(h.__generatePrimitive()),e.setMesh(h.__mesh),this.setGizmoTag()}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph(),t=e.worldAABB;t.isVanilla()?this.__topEntity.getTransform().localPosition=e.position:this.__topEntity.getTransform().localPosition=t.centerPoint,this.__topEntity.getTransform().localScale=l.P.fromCopyArray([Math.max(1,t.isVanilla()?1:t.sizeX/2),Math.max(1,t.isVanilla()?1:t.sizeY/2),Math.max(1,t.isVanilla()?1:t.sizeZ/2)])}static __generatePrimitive(){const e=new Float32Array([0,0,0,this.__length,0,0,0,0,0,0,this.__length,0,0,0,0,0,0,this.__length]),t=new Float32Array([1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1]);return r.W.createPrimitive({attributeSemantics:[o.T.Position.XYZ,o.T.Color0.XYZ],attributes:[e,t],primitiveMode:i.T.Lines})}_destroy(){c.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}}h.__length=1},7859:(e,t,n)=>{n.d(t,{q:()=>C});var i=n(224),o=n(2404),a=n(3258),r=n(5704),s=n(8696),l=n(4587),c=n(128),_=n(6214),h=n(1845),u=n(7597),d=n(9561),m=n(7973),f=n(3913),p=n(3032),v=n(1937),A=n(5467),y=n(2566),x=n(9207),g=n(2471),I=n(7192),b=n(4690),E=n(6098),T=n(4742),S=n(8082);class C extends S.t{constructor(e){super(e),this.__pickStatedPoint=g.P.zero(),this.__deltaPoint=g.P.one(),this.__targetScaleBackup=g.P.one(),this.__isPointerDown=!1,this.__onPointerDownFunc=this.__onPointerDown.bind(this),this.__onPointerMoveFunc=this.__onPointerMove.bind(this),this.__onPointerUpFunc=this.__onPointerUp.bind(this)}get isSetup(){return null!=this.__topEntity}set length(e){C.__length=e}get length(){return C.__length}set isVisible(e){if(!1===this.__isVisible&&!0===e){let e=window;if(b.Is.exist(a.D.eventTargetDom)&&(e=a.D.eventTargetDom),T.$t.register(T.K2,[{eventName:(0,T.EY)("start"),handler:this.__onPointerDownFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:(0,T.EY)("move"),handler:this.__onPointerMoveFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:(0,T.EY)("end"),handler:this.__onPointerUpFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:"pointerleave",handler:this.__onPointerUpFunc,options:{},classInstance:this,eventTargetDom:e}]),this.__topEntity.getSceneGraph().addChild(C.__groupEntity.getSceneGraph()),C.__latestTargetEntity=this.__target,"local"===C.__space){const e=this.__target.getSceneGraph();let t=x._.identity();b.Is.exist(e)&&(t=e.getQuaternionRecursively()),C.__groupEntity.getTransform().localRotation=t}else"world"===C.__space&&(C.__groupEntity.getTransform().localRotation=x._.fromCopy4(0,0,0,1))}!0===this.__isVisible&&!1===e&&(T.$t.unregister(T.K2),this.__deltaPoint=this.__target.getTransform().localScale,this.__pickStatedPoint=g.P.zero(),this.__isPointerDown=!1,this.__targetScaleBackup=this.__target.getTransform().localScale,C.__activeAxis="none"),T.$t.setActive(T.K2,e),this.__setVisible(e),C.__xyPlaneEntity.getSceneGraph().isVisible=!1,C.__yzPlaneEntity.getSceneGraph().isVisible=!1,C.__zxPlaneEntity.getSceneGraph().isVisible=!1}setSpace(e){C.__space=e,this.__isVisible&&(this.isVisible=!1,this.isVisible=!0)}get isVisible(){return this.__isVisible}_setup(){this.__toSkipSetup()||(this.__topEntity=m._.createGroupEntity(),this.__topEntity.tryToSetUniqueName(`ScaleGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph()),b.Is.not.exist(C.__xCubeEntity)&&(this.xMesh(),this.xEdgeMesh()),b.Is.not.exist(C.__yCubeEntity)&&(this.yMesh(),this.yEdgeMesh()),b.Is.not.exist(C.__zCubeEntity)&&(this.zMesh(),this.zEdgeMesh()),b.Is.not.exist(C.__xyPlaneEntity)&&this.xyPlane(),b.Is.not.exist(C.__yzPlaneEntity)&&this.yzPlane(),b.Is.not.exist(C.__zxPlaneEntity)&&this.zxPlane(),b.Is.not.exist(C.__groupEntity)&&(C.__groupEntity=m._.createGroupEntity()),this.__topEntity.getSceneGraph().addChild(C.__groupEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__xCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__yCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__zCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__xyPlaneEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__yzPlaneEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__zxPlaneEntity.getSceneGraph()),C.__latestTargetEntity=this.__target,this.setGizmoTag())}zxPlane(){C.__zxPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_zxPlane",!0),C.__zxPlaneEntity.getSceneGraph().isVisible=!1,C.__zxPlaneMaterial=f.G.createClassicUberMaterial(),C.__zxPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,.5,0,0])),C.__zxPlaneMaterial.alphaMode=r.F.Translucent,C.__zxPlaneMesh=new _.K,C.__zxPlanePrimitive=new d.J,C.__zxPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__zxPlaneMaterial}),C.__zxPlaneMesh.addPrimitive(C.__zxPlanePrimitive),C.__zxPlaneEntity.getMesh().setMesh(C.__zxPlaneMesh)}yzPlane(){C.__yzPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_yzPlane",!0),C.__yzPlaneEntity.getSceneGraph().isVisible=!1,C.__yzPlaneEntity.getTransform().localEulerAngles=g.P.fromCopy3(0,0,p.k.degreeToRadian(90)),C.__yzPlaneMaterial=f.G.createClassicUberMaterial(),C.__yzPlaneMaterial.alphaMode=r.F.Translucent,C.__yzPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([.5,0,0,0])),C.__yzPlaneMesh=new _.K,C.__yzPlanePrimitive=new d.J,C.__yzPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__yzPlaneMaterial}),C.__yzPlaneMesh.addPrimitive(C.__yzPlanePrimitive),C.__yzPlaneEntity.getMesh().setMesh(C.__yzPlaneMesh)}xyPlane(){C.__xyPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_xyPlane",!0),C.__xyPlaneEntity.getSceneGraph().isVisible=!1,C.__xyPlaneEntity.getTransform().localEulerAngles=g.P.fromCopy3(p.k.degreeToRadian(90),0,0),C.__xyPlaneMaterial=f.G.createClassicUberMaterial(),C.__xyPlaneMaterial.alphaMode=r.F.Translucent,C.__xyPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,0,.5,0])),C.__xyPlaneMesh=new _.K,C.__xyPlanePrimitive=new d.J,C.__xyPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__xyPlaneMaterial}),C.__xyPlaneMesh.addPrimitive(C.__xyPlanePrimitive),C.__xyPlaneEntity.getMesh().setMesh(C.__xyPlaneMesh)}zMesh(){C.__zCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_zCube",!0),C.__zCubeEntity.getTransform().localPosition=g.P.fromCopy3(0,0,1),C.__zCubeMesh=new _.K,C.__zCubeMaterial=f.G.createClassicUberMaterial(),C.__zCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,0,1,1])),C.__zCubePrimitive=new u.X,C.__zCubePrimitive.generate({widthVector:g.P.fromCopy3(.05,.05,1),material:C.__zCubeMaterial}),C.__zCubeMesh.addPrimitive(C.__zCubePrimitive),C.__zCubeEntity.getMesh().setMesh(C.__zCubeMesh)}yMesh(){C.__yCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_yCube",!0),C.__yCubeEntity.getTransform().localPosition=g.P.fromCopy3(0,1,0),C.__yCubeMesh=new _.K,C.__yCubeMaterial=f.G.createClassicUberMaterial(),C.__yCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,1,0,1])),C.__yCubePrimitive=new u.X,C.__yCubePrimitive.generate({widthVector:g.P.fromCopy3(.05,1,.05),material:C.__yCubeMaterial}),C.__yCubeMesh.addPrimitive(C.__yCubePrimitive),C.__yCubeEntity.getMesh().setMesh(C.__yCubeMesh)}xMesh(){C.__xCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_xCube",!0),C.__xCubeEntity.getTransform().localPosition=g.P.fromCopy3(1,0,0),C.__xCubeMesh=new _.K,C.__xCubeMaterial=f.G.createClassicUberMaterial(),C.__xCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([1,0,0,1])),C.__xCubePrimitive=new u.X,C.__xCubePrimitive.generate({widthVector:g.P.fromCopy3(1,.05,.05),material:C.__xCubeMaterial}),C.__xCubeMesh.addPrimitive(C.__xCubePrimitive),C.__xCubeEntity.getMesh().setMesh(C.__xCubeMesh)}xEdgeMesh(){C.__xEdgeCubeEntity=m._.createMeshEntity(),C.__xEdgeCubeEntity.tryToSetUniqueName("ScaleGizmo_xEdgeCube",!0),C.__xEdgeCubeEntity.getTransform().localPosition=g.P.fromCopy3(1,0,0),C.__xEdgeCubeMesh=new _.K,C.__xEdgeCubePrimitive=new u.X,C.__xEdgeCubePrimitive.generate({widthVector:g.P.fromCopy3(.1,.1,.1),material:C.__xCubeMaterial}),C.__xEdgeCubeMesh.addPrimitive(C.__xEdgeCubePrimitive),C.__xEdgeCubeEntity.getMesh().setMesh(C.__xEdgeCubeMesh),C.__xCubeEntity.addChild(C.__xEdgeCubeEntity.getSceneGraph())}yEdgeMesh(){C.__yEdgeCubeEntity=m._.createMeshEntity(),C.__yEdgeCubeEntity.tryToSetUniqueName("ScaleGizmo_yEdgeCube",!0),C.__yEdgeCubeEntity.getTransform().localPosition=g.P.fromCopy3(0,1,0),C.__yEdgeCubeMesh=new _.K,C.__yEdgeCubePrimitive=new u.X,C.__yEdgeCubePrimitive.generate({widthVector:g.P.fromCopy3(.1,.1,.1),material:C.__yCubeMaterial}),C.__yEdgeCubeMesh.addPrimitive(C.__yEdgeCubePrimitive),C.__yEdgeCubeEntity.getMesh().setMesh(C.__yEdgeCubeMesh),C.__yCubeEntity.addChild(C.__yEdgeCubeEntity.getSceneGraph())}zEdgeMesh(){C.__zEdgeCubeEntity=m._.createMeshEntity(),C.__zEdgeCubeEntity.tryToSetUniqueName("ScaleGizmo_zEdgeCube",!0),C.__zEdgeCubeEntity.getTransform().localPosition=g.P.fromCopy3(0,0,1),C.__zEdgeCubeMesh=new _.K,C.__zEdgeCubePrimitive=new u.X,C.__zEdgeCubePrimitive.generate({widthVector:g.P.fromCopy3(.1,.1,.1),material:C.__zCubeMaterial}),C.__zEdgeCubeMesh.addPrimitive(C.__zEdgeCubePrimitive),C.__zEdgeCubeEntity.getMesh().setMesh(C.__zEdgeCubeMesh),C.__zCubeEntity.addChild(C.__zEdgeCubeEntity.getSceneGraph())}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph(),t=e.worldAABB;t.isVanilla()?this.__topEntity.getTransform().localPosition=e.position:this.__topEntity.getTransform().localPosition=t.centerPoint;const n=Math.max(t.sizeX,t.sizeY,t.sizeZ);this.__topEntity.getTransform().localScale=g.P.fromCopyArray([Math.min(1,t.isVanilla()?1:n/2),Math.min(1,t.isVanilla()?1:n/2),Math.min(1,t.isVanilla()?1:n/2)]),this.__isPointerDown&&C.__latestTargetEntity===this.__target&&(this.__target.getTransform().localScale=this.__deltaPoint.clone())}static __generatePrimitive(){const e=new Float32Array([0,0,0,this.__length,0,0,0,0,0,0,this.__length,0,0,0,0,0,0,this.__length]),t=new Float32Array([1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1]);return h.W.createPrimitive({attributeSemantics:[c.T.Position.XYZ,c.T.Color0.XYZ],attributes:[e,t],primitiveMode:s.T.Lines})}__onPointerDown(e){e.preventDefault(),this.__isPointerDown=!0,C.__originalX=e.clientX,C.__originalY=e.clientY;const t=this.__target.getSceneGraph().matrix.getRotate(),n=g.P.one();let i=v.h.fromCopy9RowMajor(n.x*t.m00,n.x*t.m01,n.x*t.m02,n.y*t.m10,n.y*t.m11,n.y*t.m12,n.z*t.m20,n.z*t.m21,n.z*t.m22);"local"===C.__space?i=v.h.transpose(i):"world"===C.__space&&(i=y.x.identity());const{xResult:o,yResult:a,zResult:r}=C.castRay(e);o.result&&((0,E.dK)(o.data),this.__pickStatedPoint=i.multiplyVector(o.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="x"),a.result&&((0,E.dK)(a.data),this.__pickStatedPoint=i.multiplyVector(a.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="y"),r.result&&((0,E.dK)(r.data),this.__pickStatedPoint=i.multiplyVector(r.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="z"),C.__latestTargetEntity===this.__target&&(this.__targetScaleBackup=this.__target.getTransform().localScale)}__onPointerMove(e){if(e.preventDefault(),b.Is.false(this.__isPointerDown))return;const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current),_=this.__target.getSceneGraph().matrix.getRotate(),h=g.P.one();let u=v.h.fromCopy9RowMajor(h.x*_.m00,h.x*_.m01,h.x*_.m02,h.y*_.m10,h.y*_.m11,h.y*_.m12,h.z*_.m20,h.z*_.m21,h.z*_.m22);"local"===C.__space?u=v.h.transpose(u):"world"===C.__space&&(u=y.x.identity());let d=this.__pickStatedPoint.clone();if("x"===C.__activeAxis){const e=C.__xyPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=u.multiplyVector(e.data.position);d=g.P.fromCopy3(t.x,d.y,d.z),console.log("Move:"+e.data.position.toStringApproximately())}T.$t.disableCameraController()}if("y"===C.__activeAxis){const e=C.__xyPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=u.multiplyVector(e.data.position);d=g.P.fromCopy3(d.x,t.y,d.z),console.log("Move:"+e.data.position.toStringApproximately())}T.$t.disableCameraController()}if("z"===C.__activeAxis){const e=C.__yzPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=u.multiplyVector(e.data.position);d=g.P.fromCopy3(d.x,d.y,t.z),console.log("Move:"+e.data.position.toStringApproximately())}T.$t.disableCameraController()}const m=this.__target.getSceneGraph().worldAABB,f=g.P.multiply(g.P.subtract(d,this.__pickStatedPoint),1/m.lengthCenterToCorner);if(console.log(`${this.__target.uniqueName}: `+f.toStringApproximately()),"local"===C.__space)this.__deltaPoint=g.P.add(this.__targetScaleBackup,f),this.__deltaPoint=g.P.fromCopy3(Math.max(this.__deltaPoint.x,.01),Math.max(this.__deltaPoint.y,.01),Math.max(this.__deltaPoint.z,.01));else if("world"===C.__space){const e=A.J.fromCopyQuaternion(this.__target.getSceneGraph().getQuaternionRecursively()),t=A.J.multiply(e,A.J.scale(this.__targetScaleBackup)).getScale();let n=I.Lt.add(f,t);n=I.Lt.fromCopy4(Math.max(n.x,.01),Math.max(n.y,.01),Math.max(n.z,.01),Math.max(n.w,.01)),this.__deltaPoint=A.J.multiply(A.J.invert(e),A.J.scale(n)).getScale(),this.__deltaPoint=g.P.fromCopy3(Math.max(this.__deltaPoint.x,.01),Math.max(this.__deltaPoint.y,.01),Math.max(this.__deltaPoint.z,.01))}}__onPointerUp(e){e.preventDefault(),this.__isPointerDown=!1,C.__activeAxis="none",T.$t.enableCameraController(),C.__latestTargetEntity===this.__target&&(this.__targetScaleBackup=this.__target.getTransform().localScale)}static castRay2(e){const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current);return C.__groupEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0,[])}static castRay(e){const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current);return{xResult:C.__xCubeEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0),yResult:C.__yCubeEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0),zResult:C.__zCubeEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0)}}_destroy(){b.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}}C.__originalX=0,C.__originalY=0,C.__activeAxis="none",C.__space="world",C.__length=1},9244:(e,t,n)=>{n.d(t,{u:()=>C});var i=n(224),o=n(2404),a=n(3258),r=n(5704),s=n(8696),l=n(4587),c=n(128),_=n(6214),h=n(1845),u=n(7597),d=n(9561),m=n(7973),f=n(3913),p=n(5467),v=n(3032),A=n(1937),y=n(2566),x=n(9207),g=n(2471),I=n(7192),b=n(4690),E=n(6098),T=n(4742),S=n(8082);class C extends S.t{constructor(e){super(e),this.__pickStatedPoint=g.P.zero(),this.__deltaPoint=g.P.zero(),this.__targetPointBackup=g.P.zero(),this.__isPointerDown=!1,this.__onPointerDownFunc=this.__onPointerDown.bind(this),this.__onPointerMoveFunc=this.__onPointerMove.bind(this),this.__onPointerUpFunc=this.__onPointerUp.bind(this)}get isSetup(){return null!=this.__topEntity}set length(e){C.__length=e}get length(){return C.__length}set isVisible(e){if(!1===this.__isVisible&&!0===e){let e=window;if(b.Is.exist(a.D.eventTargetDom)&&(e=a.D.eventTargetDom),T.$t.register(T.KQ,[{eventName:(0,T.EY)("start"),handler:this.__onPointerDownFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:(0,T.EY)("move"),handler:this.__onPointerMoveFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:(0,T.EY)("end"),handler:this.__onPointerUpFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:"pointerleave",handler:this.__onPointerUpFunc,options:{},classInstance:this,eventTargetDom:e}]),this.__topEntity.getSceneGraph().addChild(C.__groupEntity.getSceneGraph()),this.__latestTargetEntity=this.__target,"local"===C.__space){const e=this.__target.getSceneGraph().parent;let t=x._.identity();b.Is.exist(e)&&(t=e.getQuaternionRecursively()),C.__groupEntity.getTransform().localRotation=t}else"world"===C.__space&&(C.__groupEntity.getTransform().localRotation=x._.fromCopy4(0,0,0,1))}!0===this.__isVisible&&!1===e&&(T.$t.unregister(T.KQ),this.__deltaPoint=this.__target.getTransform().localPosition,this.__pickStatedPoint=g.P.zero(),this.__isPointerDown=!1,this.__targetPointBackup=this.__target.getTransform().localPosition,C.__activeAxis="none"),T.$t.setActive(T.KQ,e),this.__setVisible(e),C.__xyPlaneEntity.getSceneGraph().isVisible=!1,C.__yzPlaneEntity.getSceneGraph().isVisible=!1,C.__zxPlaneEntity.getSceneGraph().isVisible=!1}setSpace(e){C.__space=e,this.__isVisible&&(this.isVisible=!1,this.isVisible=!0)}get isVisible(){return this.__isVisible}_setup(){this.__toSkipSetup()||(this.__topEntity=m._.createGroupEntity(),this.__topEntity.tryToSetUniqueName(`TranslationGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph()),b.Is.not.exist(C.__xCubeEntity)&&(C.__xCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_xCube",!0),C.__xCubeEntity.getTransform().localPosition=g.P.fromCopy3(1,0,0),C.__xCubeMesh=new _.K,C.__xCubeMaterial=f.G.createClassicUberMaterial(),C.__xCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([1,0,0,1])),C.__xCubePrimitive=new u.X,C.__xCubePrimitive.generate({widthVector:g.P.fromCopy3(1,.05,.05),material:C.__xCubeMaterial}),C.__xCubeMesh.addPrimitive(C.__xCubePrimitive),C.__xCubeEntity.getMesh().setMesh(C.__xCubeMesh)),b.Is.not.exist(C.__yCubeEntity)&&(C.__yCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_yCube",!0),C.__yCubeEntity.getTransform().localPosition=g.P.fromCopy3(0,1,0),C.__yCubeMesh=new _.K,C.__yCubeMaterial=f.G.createClassicUberMaterial(),C.__yCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,1,0,1])),C.__yCubePrimitive=new u.X,C.__yCubePrimitive.generate({widthVector:g.P.fromCopy3(.05,1,.05),material:C.__yCubeMaterial}),C.__yCubeMesh.addPrimitive(C.__yCubePrimitive),C.__yCubeEntity.getMesh().setMesh(C.__yCubeMesh)),b.Is.not.exist(C.__zCubeEntity)&&(C.__zCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_zCube",!0),C.__zCubeEntity.getTransform().localPosition=g.P.fromCopy3(0,0,1),C.__zCubeMesh=new _.K,C.__zCubeMaterial=f.G.createClassicUberMaterial(),C.__zCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,0,1,1])),C.__zCubePrimitive=new u.X,C.__zCubePrimitive.generate({widthVector:g.P.fromCopy3(.05,.05,1),material:C.__zCubeMaterial}),C.__zCubeMesh.addPrimitive(C.__zCubePrimitive),C.__zCubeEntity.getMesh().setMesh(C.__zCubeMesh)),b.Is.not.exist(C.__xyPlaneEntity)&&(C.__xyPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_xyPlane",!0),C.__xyPlaneEntity.getSceneGraph().isVisible=!1,C.__xyPlaneEntity.getTransform().localEulerAngles=g.P.fromCopy3(v.k.degreeToRadian(90),0,0),C.__xyPlaneMaterial=f.G.createClassicUberMaterial(),C.__xyPlaneMaterial.alphaMode=r.F.Translucent,C.__xyPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,0,.5,0])),C.__xyPlaneMesh=new _.K,C.__xyPlanePrimitive=new d.J,C.__xyPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__xyPlaneMaterial}),C.__xyPlaneMesh.addPrimitive(C.__xyPlanePrimitive),C.__xyPlaneEntity.getMesh().setMesh(C.__xyPlaneMesh)),b.Is.not.exist(C.__yzPlaneEntity)&&(C.__yzPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_yzPlane",!0),C.__yzPlaneEntity.getSceneGraph().isVisible=!1,C.__yzPlaneEntity.getTransform().localEulerAngles=g.P.fromCopy3(0,0,v.k.degreeToRadian(90)),C.__yzPlaneMaterial=f.G.createClassicUberMaterial(),C.__yzPlaneMaterial.alphaMode=r.F.Translucent,C.__yzPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([.5,0,0,0])),C.__yzPlaneMesh=new _.K,C.__yzPlanePrimitive=new d.J,C.__yzPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__yzPlaneMaterial}),C.__yzPlaneMesh.addPrimitive(C.__yzPlanePrimitive),C.__yzPlaneEntity.getMesh().setMesh(C.__yzPlaneMesh)),b.Is.not.exist(C.__zxPlaneEntity)&&(C.__zxPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_zxPlane",!0),C.__zxPlaneEntity.getSceneGraph().isVisible=!1,C.__zxPlaneMaterial=f.G.createClassicUberMaterial(),C.__zxPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,.5,0,0])),C.__zxPlaneMaterial.alphaMode=r.F.Translucent,C.__zxPlaneMesh=new _.K,C.__zxPlanePrimitive=new d.J,C.__zxPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__zxPlaneMaterial}),C.__zxPlaneMesh.addPrimitive(C.__zxPlanePrimitive),C.__zxPlaneEntity.getMesh().setMesh(C.__zxPlaneMesh)),b.Is.not.exist(C.__groupEntity)&&(C.__groupEntity=m._.createGroupEntity()),this.__topEntity.getSceneGraph().addChild(C.__groupEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__xCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__yCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__zCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__xyPlaneEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__yzPlaneEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__zxPlaneEntity.getSceneGraph()),this.__latestTargetEntity=this.__target,this.setGizmoTag())}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph(),t=e.worldAABB;t.isVanilla()?this.__topEntity.getTransform().localPosition=e.position:this.__topEntity.getTransform().localPosition=t.centerPoint;const n=Math.max(t.sizeX,t.sizeY,t.sizeZ);this.__topEntity.getTransform().localScale=g.P.fromCopyArray([Math.min(1,t.isVanilla()?1:n/2),Math.min(1,t.isVanilla()?1:n/2),Math.min(1,t.isVanilla()?1:n/2)]),this.__isPointerDown&&this.__latestTargetEntity===this.__target&&(this.__target.getTransform().localPosition=this.__deltaPoint.clone())}static __generatePrimitive(){const e=new Float32Array([0,0,0,this.__length,0,0,0,0,0,0,this.__length,0,0,0,0,0,0,this.__length]),t=new Float32Array([1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1]);return h.W.createPrimitive({attributeSemantics:[c.T.Position.XYZ,c.T.Color0.XYZ],attributes:[e,t],primitiveMode:s.T.Lines})}__onPointerDown(e){e.preventDefault(),this.__isPointerDown=!0,C.__originalX=e.clientX,C.__originalY=e.clientY;const t=this.__target.getSceneGraph().parent;let n=p.J.identity();b.Is.exist(t)&&(n=t.matrixInner.getRotate());const i=g.P.one();let o=A.h.fromCopy9RowMajor(i.x*n.m00,i.x*n.m01,i.x*n.m02,i.y*n.m10,i.y*n.m11,i.y*n.m12,i.z*n.m20,i.z*n.m21,i.z*n.m22);"local"===C.__space?o=A.h.transpose(o):"world"===C.__space&&(o=y.x.identity());const{xResult:a,yResult:r,zResult:s}=C.castRay(e);a.result&&((0,E.dK)(a.data),this.__pickStatedPoint=o.multiplyVector(a.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="x"),r.result&&((0,E.dK)(r.data),this.__pickStatedPoint=o.multiplyVector(r.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="y"),s.result&&((0,E.dK)(s.data),this.__pickStatedPoint=o.multiplyVector(s.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="z"),this.__latestTargetEntity===this.__target&&(this.__targetPointBackup=this.__target.getTransform().localPosition)}__onPointerMove(e){if(e.preventDefault(),b.Is.false(this.__isPointerDown))return;const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current),_=this.__target.getSceneGraph().parent;let h=p.J.identity();b.Is.exist(_)&&(h=_.matrixInner.getRotate());const u=g.P.one();let d=A.h.fromCopy9RowMajor(u.x*h.m00,u.x*h.m01,u.x*h.m02,u.y*h.m10,u.y*h.m11,u.y*h.m12,u.z*h.m20,u.z*h.m21,u.z*h.m22);"local"===C.__space?d=A.h.transpose(d):"world"===C.__space&&(d=y.x.identity());let m=this.__pickStatedPoint.clone();if("x"===C.__activeAxis){const e=C.__xyPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=d.multiplyVector(e.data.position);m=g.P.fromCopy3(t.x,m.y,m.z)}T.$t.disableCameraController()}if("y"===C.__activeAxis){const e=C.__xyPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=d.multiplyVector(e.data.position);m=g.P.fromCopy3(m.x,t.y,m.z)}T.$t.disableCameraController()}if("z"===C.__activeAxis){const e=C.__yzPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=d.multiplyVector(e.data.position);m=g.P.fromCopy3(m.x,m.y,t.z)}T.$t.disableCameraController()}const f=g.P.subtract(m,this.__pickStatedPoint);if(0!==f.length())if(console.log(`${this.__target.uniqueName}: `+f.toStringApproximately()),"local"===C.__space)this.__deltaPoint=g.P.add(f,this.__targetPointBackup);else if("world"===C.__space){const e=this.__target.getSceneGraph().parent;let t=p.J.identity();b.Is.exist(e)&&(t=e.matrix.getRotate());const n=g.P.one();let i=A.h.fromCopy9RowMajor(n.x*t.m00,n.x*t.m01,n.x*t.m02,n.y*t.m10,n.y*t.m11,n.y*t.m12,n.z*t.m20,n.z*t.m21,n.z*t.m22);i=A.h.transpose(i);const o=g.P.add(this.__targetPointBackup,i.multiplyVector(f));this.__deltaPoint=o}}__onPointerUp(e){e.preventDefault(),this.__isPointerDown=!1,C.__activeAxis="none",T.$t.enableCameraController(),this.__latestTargetEntity===this.__target&&(this.__targetPointBackup=this.__target.getTransform().localPosition)}static castRay2(e){const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current);return C.__groupEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0,[])}static castRay(e){const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current);return{xResult:C.__xCubeEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0),yResult:C.__yCubeEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0),zResult:C.__zCubeEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0)}}_destroy(){b.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}}C.__originalX=0,C.__originalY=0,C.__activeAxis="none",C.__space="world",C.__length=1},6128:(e,t,n)=>{n.d(t,{qf:()=>i.q,tb:()=>o.t,SU:()=>d,kl:()=>a.k,qu:()=>m.q,ug:()=>f.u});var i=n(817),o=n(8082),a=n(7326),r=n(8696),s=n(128),l=n(6214),c=n(1845),_=n(7973),h=n(2471),u=n(4690);class d extends o.t{constructor(e){super(e)}get isSetup(){return null!=this.__topEntity}_setup(){if(this.__toSkipSetup())return;this.__topEntity=_._.createMeshEntity(),this.__topEntity.tryToSetUniqueName(`LightGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph());const e=this.__topEntity.tryToGetMesh();d.__mesh=new l.K,d.__mesh.addPrimitive(d.__generatePrimitive()),e.setMesh(d.__mesh),this.setGizmoTag()}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph(),t=e.worldAABB;t.isVanilla()?this.__topEntity.getTransform().localPosition=e.position:this.__topEntity.getTransform().localPosition=t.centerPoint,this.__topEntity.getTransform().localRotation=e.rotation,this.__topEntity.getTransform().localScale=h.P.fromCopyArray([Math.max(1,t.isVanilla()?1:t.sizeX/2),Math.max(1,t.isVanilla()?1:t.sizeY/2),Math.max(1,t.isVanilla()?1:t.sizeZ/2)])}_destroy(){u.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}static __generatePrimitive(){const e=new Float32Array([0,0,0,0,0,-this.__length,0,0,-this.__length,-.1,0,.2-this.__length,-.1,0,.2-this.__length,0,0,.2-this.__length]);return c.W.createPrimitive({attributeSemantics:[s.T.Position.XYZ],attributes:[e],primitiveMode:r.T.Lines})}}d.__length=1;var m=n(7859),f=n(9244)},7973:(e,t,n)=>{n.d(t,{_:()=>p});var i=n(1350),o=n(6692),a=n(8491),r=n(4097),s=n(9974),l=n(5496),c=n(1656),_=n(3826),h=n(224),u=n(6683);function d(){const e=i.g.createEntity();return i.g.addComponentToEntity(o.U,e)}function m(){const e=d();return i.g.addComponentToEntity(a.a,e)}function f(){const e=m();return i.g.addComponentToEntity(h.M,e)}const p=Object.freeze({createEntity:function(){return i.g.createEntity()},createTransformEntity:d,createGroupEntity:m,createMeshEntity:function(){const e=m(),t=i.g.addComponentToEntity(r.$,e);return i.g.addComponentToEntity(s.Y,t)},createCameraEntity:f,createCameraControllerEntity:function(){const e=f();return i.g.addComponentToEntity(l.S,e)},createSkeletalEntity:function(){const e=m();return i.g.addComponentToEntity(c.Y,e)},createLightEntity:function(){const e=m();return i.g.addComponentToEntity(u.r,e)},createLightWithCameraEntity:function(){const e=m(),t=i.g.addComponentToEntity(u.r,e),n=i.g.addComponentToEntity(h.M,t);return n.getCamera().isSyncToLight=!0,n},createPhysicsEntity:function(){const e=m();return i.g.addComponentToEntity(_.Z,e)}})},3913:(e,t,n)=>{n.d(t,{G:()=>Z});var i=n(3258),o=n(621),a=n(9764),r=n(8774),s=n(1554),l=n(1995),c=n(4507),_=n(8287),h=n(9604),u=n(7369),d=n(6863),m=n(9330),f=n(968),p=n(8283),v=n(4587),A=n(3999),y=n(810),x=n(5324),g=n(4255);const I={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec3 v_baryCentricCoord;\nout vec4 v_shadowCoord;\n\nuniform float u_pointSize; // initialValue=30\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0,0.1,0.01)\n\n// BiasMatrix * LightProjectionMatrix * LightViewMatrix, See: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/#basic-shader\nuniform mat4 u_depthBiasPV; // initialValue=(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n\n v_color = a_color;\n v_normal_inWorld = normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n v_shadowCoord = get_depthBiasPV(materialSID, 0) * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},b={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec3 v_baryCentricCoord;\nin vec4 v_shadowCoord;\n\nuniform int u_shadingModel; // initialValue=0\nuniform float u_alphaCutoff; // initialValue=0.01\nuniform float u_shininess; // initialValue=5\nuniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)\nuniform sampler2D u_diffuseColorTexture; // initialValue=(0,white)\nuniform sampler2D u_normalTexture; // initialValue=(1,blue)\nuniform vec4 u_diffuseColorTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_diffuseColorTextureRotation; // initialValue=0\nuniform sampler2DShadow u_depthTexture; // initialValue=(2,white)\n\n/* shaderity: @{renderTargetBegin} */\n\n// #pragma shaderity: require(../common/deliot2019SeamlessTexture.glsl)\n// uniform sampler2D u_tInvTexture; // initialValue=(1,white)\n// uniform vec3 u_colorSpaceOrigin;\n// uniform vec3 u_colorSpaceVector1;\n// uniform vec3 u_colorSpaceVector2;\n// uniform vec3 u_colorSpaceVector3;\n// uniform vec4 u_scaleTranslate;\n\n\nvec2 uvTransform(vec2 scale, vec2 offset, float rotation, vec2 uv) {\n mat3 translationMat = mat3(1,0,0, 0,1,0, offset.x, offset.y, 1);\n mat3 rotationMat = mat3(\n cos(rotation), -sin(rotation), 0,\n sin(rotation), cos(rotation), 0,\n 0, 0, 1\n );\n mat3 scaleMat = mat3(scale.x,0,0, 0,scale.y,0, 0,0,1);\n\n mat3 matrix = translationMat * rotationMat * scaleMat;\n vec2 uvTransformed = ( matrix * vec3(uv.xy, 1) ).xy;\n\n return uvTransformed;\n}\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n\n\n // diffuseColor (Considered to be premultiplied alpha)\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture (Considered to be premultiplied alpha)\n vec4 diffuseColorTextureTransform = get_diffuseColorTextureTransform(materialSID, 0);\n float diffuseColorTextureRotation = get_diffuseColorTextureRotation(materialSID, 0);\n vec2 diffuseColorTexUv = uvTransform(diffuseColorTextureTransform.xy, diffuseColorTextureTransform.zw, diffuseColorTextureRotation, v_texcoord_0);\n vec4 textureColor = texture(u_diffuseColorTexture, diffuseColorTexUv);\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n\n#ifdef RN_IS_ALPHAMODE_MASK\n float alphaCutoff = get_alphaCutoff(materialSID, 0);\n if (alpha < alphaCutoff) {\n discard;\n }\n#endif\n\n\n // Lighting\n vec3 shadingColor = vec3(0.0, 0.0, 0.0);\n#ifdef RN_IS_LIGHTING\n int shadingModel = get_shadingModel(materialSID, 0);\n if (shadingModel > 0) {\n\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */ ; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n // Diffuse\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, light.direction)) * light.attenuatedIntensity;\n\n float shininess = get_shininess(materialSID, 0);\n int shadingModel = get_shadingModel(materialSID, 0);\n\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n\n // Specular\n if (shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 halfVector = normalize(light.direction + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), shininess);\n } else if (shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 R = reflect(light.direction, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), shininess);\n }\n\n }\n\n shadingColor = diffuse + specular;\n } else {\n shadingColor = diffuseColor;\n }\n#else\n shadingColor = diffuseColor;\n#endif\n\n // Shadow\n#ifdef RN_USE_SHADOW_MAPPING\n float visibility = 1.0;\n float bias = 0.001;\n\n // Non PCF\n // if ( textureProj( u_depthTexture, v_shadowCoord ).r < (v_shadowCoord.z - bias) / v_shadowCoord.w ) {\n // visibility = 0.5;\n // }\n // shadingColor *= visibility;\n\n // Hardware PCF\n vec4 shadowCoord = v_shadowCoord;\n shadowCoord.z -= bias;\n shadingColor *= textureProj( u_depthTexture, shadowCoord ) * 0.5 + 0.5;\n\n // shadingColor.rgb = texture( u_depthTexture, v_shadowCoord.xy ).rrr;\n // shadingColor.rgb = vec3(v_shadowCoord.xy, 0.0);\n // shadingColor.rgb = vec3(diffuseColorTexUv, 0.0);\n // shadingColor.rgb = vec3(texture( u_depthTexture, diffuseColorTexUv).rrr);\n // shadingColor.rgb = texture( u_depthTexture, diffuseColorTexUv).rgb;\n // shadingColor.rgb = vec3(textureProj( u_depthTexture, v_shadowCoord ).z, 0.0, 0.0);\n alpha = 1.0;\n#endif\n\n rt0 = vec4(shadingColor * alpha, alpha);\n // rt0 = vec4(u_lightNumber, 0.0, 0.0, 1.0);\n // rt0 = vec4(1.0, 0.0, 0.0, 1.0);\n // rt0 = vec4(normal_inWorld*0.5+0.5, 1.0);\n\n#ifdef RN_IS_ALPHAMODE_OPAQUE\n rt0.a = 1.0;\n#elif defined(RN_IS_ALPHAMODE_MASK)\n rt0.a = 1.0;\n#endif\n\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},E={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec2 a_texcoord_1;\nin vec2 a_texcoord_2;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec2 v_texcoord_1;\nout vec2 v_texcoord_2;\nout vec3 v_baryCentricCoord;\nout float v_instanceInfo;\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n in vec4 a_tangent;\n out vec3 v_tangent_inWorld;\n out vec3 v_binormal_inWorld;\n#endif\n#ifdef RN_USE_SHADOW_MAPPING\n out vec4 v_shadowCoord;\n#endif\n\nuniform float u_pointSize; // initialValue=30, soloDatum=true\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0.0, 0.1, 0.01), soloDatum=true\n\n#ifdef RN_IS_MORPHING\nuniform int u_morphTargetNumber; // initialValue=0, isCustomSetting=true, soloDatum=true, needUniformInDataTextureMode=true\n// uniform int u_dataTextureMorphOffsetPosition[];\n// uniform int u_morphWeights[]; //\n#endif\n\n// BiasMatrix * LightProjectionMatrix * LightViewMatrix, See: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/#basic-shader\nuniform mat4 u_depthBiasPV; // initialValue=(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n v_color = a_color;\n\n bool isSkinning = false;\n\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n v_texcoord_0 = a_texcoord_0;\n v_texcoord_1 = a_texcoord_1;\n v_texcoord_2 = a_texcoord_2;\n\n #ifdef RN_USE_TANGENT_ATTRIBUTE\n v_tangent_inWorld = normalMatrix * a_tangent.xyz;\n v_binormal_inWorld = cross(v_tangent_inWorld, v_normal_inWorld) * a_tangent.w;\n #endif\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n\n v_instanceInfo = a_instanceInfo.x;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n#ifdef RN_USE_SHADOW_MAPPING\n v_shadowCoord = get_depthBiasPV(materialSID, 0) * v_position_inWorld;\n#endif\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},T={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec2 v_texcoord_1;\nin vec2 v_texcoord_2;\nin vec3 v_baryCentricCoord;\nin float v_instanceInfo;\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n in vec3 v_tangent_inWorld;\n in vec3 v_binormal_inWorld;\n#endif\n\n#ifdef RN_USE_SHADOW_MAPPING\nin vec4 v_shadowCoord;\n#endif\n\nuniform vec4 u_baseColorFactor; // initialValue=(1,1,1,1)\nuniform sampler2D u_baseColorTexture; // initialValue=(0,white)\nuniform vec2 u_metallicRoughnessFactor; // initialValue=(1,1)\nuniform sampler2D u_metallicRoughnessTexture; // initialValue=(1,white)\nuniform sampler2D u_occlusionTexture; // initialValue=(3,white)\nuniform vec3 u_emissiveFactor; // initialValue=(0,0,0)\nuniform sampler2D u_emissiveTexture; // initialValue=(4,white)\nuniform vec3 u_wireframe; // initialValue=(0,0,1)\nuniform bool u_isOutputHDR; // initialValue=0\nuniform bool u_makeOutputSrgb; // initialValue=1\nuniform vec4 u_iblParameter; // initialValue=(1,1,1,1), isCustomSetting=true\nuniform ivec2 u_hdriFormat; // initialValue=(0,0), isCustomSetting=true\nuniform samplerCube u_diffuseEnvTexture; // initialValue=(5,white), isCustomSetting=true\nuniform samplerCube u_specularEnvTexture; // initialValue=(6,white), isCustomSetting=true\nuniform vec4 u_baseColorTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_baseColorTextureRotation; // initialValue=0\nuniform vec4 u_metallicRoughnessTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_metallicRoughnessTextureRotation; // initialValue=0\nuniform int u_baseColorTexcoordIndex; // initialValue=0\nuniform int u_metallicRoughnessTexcoordIndex; // initialValue=0\nuniform int u_occlusionTexcoordIndex; // initialValue=0\nuniform vec4 u_occlusionTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_occlusionTextureRotation; // initialValue=0\nuniform int u_emissiveTexcoordIndex; // initialValue=0\nuniform vec4 u_emissiveTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_emissiveTextureRotation; // initialValue=0\nuniform float u_occlusionStrength; // initialValue=1\nuniform bool u_inverseEnvironment; // initialValue=true\nuniform float u_ior; // initialValue=1.5\n\n#ifdef RN_USE_NORMAL_TEXTURE\n uniform sampler2D u_normalTexture; // initialValue=(2,black)\n uniform vec4 u_normalTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_normalTextureRotation; // initialValue=(0)\n uniform int u_normalTexcoordIndex; // initialValue=(0)\n uniform float u_normalScale; // initialValue=(1)\n#endif\n\n#ifdef RN_USE_CLEARCOAT\n uniform float u_clearCoatFactor; // initialValue=0\n uniform float u_clearCoatRoughnessFactor; // initialValue=0\n uniform vec4 u_clearCoatTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_clearCoatTextureRotation; // initialValue=0\n uniform vec4 u_clearCoatRoughnessTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_clearCoatRoughnessTextureRotation; // initialValue=0\n uniform vec4 u_clearCoatNormalTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_clearCoatNormalTextureRotation; // initialValue=0\n uniform int u_clearCoatTexcoordIndex; // initialValue=(0)\n uniform int u_clearCoatRoughnessTexcoordIndex; // initialValue=(0)\n uniform int u_clearCoatNormalTexcoordIndex; // initialValue=(0)\n#endif\n\n#ifdef RN_USE_TRANSMISSION\n uniform float u_transmissionFactor; // initialValue=(0)\n#endif\n\n#ifdef RN_USE_VOLUME\n uniform float u_thicknessFactor; // initialValue=(0)\n uniform float u_attenuationDistance; // initialValue=(0.000001)\n uniform vec3 u_attenuationColor; // initialValue=(1,1,1)\n#endif\n\n#ifdef RN_USE_SHEEN\n uniform vec3 u_sheenColorFactor; // initialValue=(0,0,0)\n uniform float u_sheenRoughnessFactor; // initialValue=(0)\n#endif\n\n#ifdef RN_USE_SPECULAR\n uniform float u_specularFactor; // initialValue=1.0\n uniform vec3 u_specularColorFactor; // initialValue=(1,1,1)\n#endif\n\n#ifdef RN_USE_IRIDESCENCE\n uniform float u_iridescenceFactor; // initialValue=0\n uniform float u_iridescenceIor; // initialValue=1.3\n uniform float u_iridescenceThicknessMinimum; // initialValue=100\n uniform float u_iridescenceThicknessMaximum; // initialValue=400\n#endif\n\n#ifdef RN_USE_ANISOTROPY\n uniform float u_anisotropyStrength; // initialValue=0\n uniform vec2 u_anisotropyRotation; // initialValue=(1,0)\n#endif\n\nuniform float u_alphaCutoff; // initialValue=(0.01)\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\nconst float M_PI = 3.141592653589793;\nconst float RECIPROCAL_PI = 0.3183098861837907;\nconst float c_MinRoughness = 0.04;\n\nfloat angular_n_h(float NH) {\n return acos(NH);\n}\n\nfloat d_phong(float NH, float c1) {\n return pow(\n cos(acos(NH))\n , c1\n );\n}\n\n// this is from https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 envBRDFApprox( float Roughness, float NoV ) {\n const vec4 c0 = vec4(-1, -0.0275, -0.572, 0.022 );\n const vec4 c1 = vec4(1, 0.0425, 1.04, -0.04 );\n vec4 r = Roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( -9.28 * NoV ) ) * r.x + r.y;\n vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n return AB;\n}\n\n// GGX NDF\nfloat d_ggx(float NH, float alphaRoughness) {\n float roughnessSqr = alphaRoughness * alphaRoughness;\n float f = (roughnessSqr - 1.0) * NH * NH + 1.0;\n return roughnessSqr / (M_PI * f * f);\n}\n\nfloat d_torrance_reiz(float NH, float c3) {\n float CosSquared = NH*NH;\n float TanSquared = (1.0 - CosSquared)/CosSquared;\n //return (1.0/M_PI) * sq(c3/(CosSquared * (c3*c3 + TanSquared))); // gamma = 2, aka GGX\n return (1.0/sqrt(M_PI)) * (sq(c3)/(CosSquared * (c3*c3 + TanSquared))); // gamma = 1, D_Berry\n}\n\nfloat d_beckmann(float NH, float m) {\n float co = 1.0 / (4.0 * m * m * NH * NH * NH * NH);\n float expx = exp((NH * NH - 1.0) / (m * m * NH * NH));\n return co * expx;\n}\n\n// the same as glTF WebGL sample\n// https://github.com/KhronosGroup/glTF-WebGL-PBR/blob/88eda8c5358efe03128b72b6c5f5f6e5b6d023e1/shaders/pbr-frag.glsl#L188\n// That is, Unreal Engine based approach, but modified to use alphaRoughness (squared artist's roughness parameter),\n// and based on 'Separable Masking and Shadowing' approximation (propesed by Christophe Schlick)\n// https://www.cs.virginia.edu/~jdl/bib/appearance/analytic%20models/schlick94b.pdf\nfloat g_shielding(float NL, float NV, float alphaRoughness) {\n float r = alphaRoughness;\n\n // Local Shadowing using \"Schlick-Smith\" Masking Function\n float localShadowing = 2.0 * NL / (NL + sqrt(r * r + (1.0 - r * r) * (NL * NL)));\n\n // Local Masking using \"Schlick-Smith\" Masking Function\n float localMasking = 2.0 * NV / (NV + sqrt(r * r + (1.0 - r * r) * (NV * NV)));\n\n return localShadowing * localMasking;\n}\n\n// The code from https://google.github.io/filament/Filament.html#listing_approximatedspecularv\n// The idea is from [Heitz14] Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs.\nfloat v_SmithGGXCorrelated(float NL, float NV, float alphaRoughness) {\n float a2 = alphaRoughness * alphaRoughness;\n float GGXV = NL * sqrt(NV * NV * (1.0 - a2) + a2);\n float GGXL = NV * sqrt(NL * NL * (1.0 - a2) + a2);\n return 0.5 / (GGXV + GGXL);\n}\n\nfloat v_SmithGGXCorrelatedFast(float NL, float NV, float alphaRoughness) {\n float a = alphaRoughness;\n float GGXV = NL * (NV * (1.0 - a) + a);\n float GGXL = NV * (NL * (1.0 - a) + a);\n return 0.5 / (GGXV + GGXL);\n}\n\n// The Schlick Approximation to Fresnel\nfloat fresnel(float f0, float f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = x * x2 * x2;\n return f0 + (f90 - f0) * x5;\n}\n\nvec3 fresnel(vec3 f0, vec3 f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = x * x2 * x2;\n return f0 + (f90 - f0) * x5;\n}\n\nvec3 fresnel(vec3 f0, float f90, float VdotH)\n{\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = x * x2 * x2;\n return f0 + (f90 - f0) * x5;\n}\n\nfloat fresnel(float f0, float VdotH)\n{\n float f90 = 1.0; //clamp(50.0 * f0, 0.0, 1.0);\n return fresnel(f0, f90, VdotH);\n}\nvec3 fresnel(vec3 f0, float VdotH)\n{\n float f90 = 1.0; //clamp(50.0 * f0, 0.0, 1.0);\n return fresnel(f0, f90, VdotH);\n}\n\nvec3 cook_torrance_specular_brdf(float NH, float NL, float NV, vec3 F, float alphaRoughness) {\n float D = d_ggx(NH, alphaRoughness);\n float V = v_SmithGGXCorrelated(NL, NV, alphaRoughness);\n return vec3(D)*vec3(V)*F;\n// float G = g_shielding(NL, NV, alphaRoughness);\n// return vec3(D)*vec3(G)*F/vec3(4.0*NL*NV);\n\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#diffuse-brdf\nvec3 diffuse_brdf(vec3 albedo)\n{\n // (1/pi) * diffuseAlbedo\n return RECIPROCAL_PI * albedo;\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#specular-brdf\nfloat specular_brdf(float alphaRoughness, float NdotL, float NdotV, float NdotH) {\n float V = v_SmithGGXCorrelated(NdotL, NdotV, alphaRoughness);\n float D = d_ggx(NdotH, alphaRoughness);\n return V * D;\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_transmission#implementation-notes\nfloat specular_btdf(float alphaRoughness, float NdotL, float NdotV, float NdotHt) {\n float V = v_SmithGGXCorrelated(NdotL, NdotV, alphaRoughness);\n float D = d_ggx(NdotHt, alphaRoughness);\n return V * D;\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#fresnel\nvec3 conductor_fresnel(vec3 f0, float brdf, float alphaRoughness, float VdotH) {\n return vec3(brdf) * (f0.rgb + (vec3(1.0) - f0.rgb) * vec3(pow(1.0 - abs(VdotH), 5.0)));\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#fresnel\nvec3 fresnel_mix(float ior, vec3 base, vec3 layer, float VdotH) {\n float f0 = pow((1.0 - ior)/(1.0 + ior), 2.0);\n float fr = f0 + (1.0 - f0) * pow(1.0 - abs(VdotH), 5.0);\n return mix(base, layer, fr);\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#metal-brdf-and-dielectric-brdf\nvec3 metal_brdf(float perceptualRoughness, vec3 baseColor, float NdotL, float NdotV, float NdotH, float VdotH) {\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n return conductor_fresnel(\n baseColor,\n specular_brdf(alphaRoughness, NdotL, NdotV, NdotH),\n alphaRoughness,\n VdotH\n );\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#metal-brdf-and-dielectric-brdf\nvec3 dielectric_brdf(float ior, vec3 baseColor, float perceptualRoughness, float NdotL, float NdotV, float NdotH, float VdotH) {\n vec3 base = diffuse_brdf(baseColor);\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n vec3 layer = vec3(specular_brdf(alphaRoughness, NdotL, NdotV, NdotH));\n return fresnel_mix(ior, base, layer, VdotH);\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat#layering\nvec3 coated_material_s(vec3 base, float perceptualRoughness, float clearcoatRoughness, float clearcoat, float VdotNc, float LdotNc, float NdotHc) {\n float clearcoatFresnel = 0.04 + (1.0 - 0.04) * pow(1.0 - abs(VdotNc), 5.0);\n float clearcoatAlpha = clearcoatRoughness * clearcoatRoughness;\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n float D = d_ggx(NdotHc, clearcoatAlpha);\n float V = v_SmithGGXCorrelated(LdotNc, VdotNc, clearcoatAlpha);\n float f_clearcoat = clearcoatFresnel * D * V;\n\n // base = (f_diffuse + f_specular) in https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat#layering\n return base * vec3(1.0 - clearcoat * clearcoatFresnel) + vec3(f_clearcoat * clearcoat);\n}\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\nfloat srgbToLinear(float value) {\n return pow(value, 2.2);\n}\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nfloat linearToSrgb(float value) {\n return pow(value, 1.0/2.2);\n}\n\n// Roughness Dependent Fresnel\n// https://www.jcgt.org/published/0008/01/03/paper.pdf\nvec3 fresnelSchlickRoughness(vec3 F0, float cosTheta, float roughness)\n{\n vec3 Fr = max(vec3(1.0 - roughness), F0) - F0;\n vec3 k_S = F0 + Fr * pow(1.0 - cosTheta, 5.0);\n return k_S;\n}\n\nvec3 fresnelSchlickRoughnessWithIridescence(\n vec3 F0, float cosTheta, float roughness,\n vec3 iridescenceFresnel, float iridescence\n )\n{\n vec3 Fr = max(vec3(1.0 - roughness), F0) - F0;\n vec3 k_S = mix(F0 + Fr * pow(1.0 - cosTheta, 5.0), iridescenceFresnel, iridescence);\n return k_S;\n}\n\n// From: https://github.com/KhronosGroup/glTF-Sample-Viewer/blob/e2c7b8c8bd12916c1a387cd41f9ef061edc718df/source/Renderer/shaders/brdf.glsl#L44-L66\nvec3 Schlick_to_F0(vec3 f, vec3 f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = clamp(x * x2 * x2, 0.0, 0.9999);\n\n return (f - f90 * x5) / (1.0 - x5);\n}\n\nfloat Schlick_to_F0(float f, float f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = clamp(x * x2 * x2, 0.0, 0.9999);\n\n return (f - f90 * x5) / (1.0 - x5);\n}\n\nvec3 Schlick_to_F0(vec3 f, float VdotH) {\n return Schlick_to_F0(f, vec3(1.0), VdotH);\n}\n\nfloat Schlick_to_F0(float f, float VdotH) {\n return Schlick_to_F0(f, 1.0, VdotH);\n}\n\nvec3 normalBlendingUDN(sampler2D baseMap, sampler2D detailMap, vec2 baseUv, vec2 detailUv) {\n vec3 t = texture(baseMap, baseUv).xyz * 2.0 - 1.0;\n vec3 u = texture(detailMap, detailUv).xyz * 2.0 - 1.0;\n vec3 r = normalize(vec3(t.xy + u.xy, t.z));\n return r;\n}\n\nvec2 uvTransform(vec2 scale, vec2 offset, float rotation, vec2 uv) {\n mat3 translationMat = mat3(1,0,0, 0,1,0, offset.x, offset.y, 1);\n mat3 rotationMat = mat3(\n cos(rotation), -sin(rotation), 0,\n sin(rotation), cos(rotation), 0,\n 0, 0, 1\n );\n mat3 scaleMat = mat3(scale.x,0,0, 0,scale.y,0, 0,0,1);\n\n mat3 matrix = translationMat * rotationMat * scaleMat;\n vec2 uvTransformed = ( matrix * vec3(uv.xy, 1) ).xy;\n\n return uvTransformed;\n}\n\nfloat IsotropicNDFFiltering(vec3 normal, float roughness2) {\n float SIGMA2 = 0.15915494;\n float KAPPA = 0.18;\n vec3 dndu = dFdx(normal);\n vec3 dndv = dFdy(normal);\n float kernelRoughness2 = SIGMA2 * (dot(dndu, dndu) + dot(dndv, dndv));\n float clampedKernelRoughness2 = min(kernelRoughness2, KAPPA);\n float filteredRoughness2 = saturate(roughness2 + clampedKernelRoughness2);\n return filteredRoughness2;\n}\n\n\n////////////////////////////////////////\n// glTF KHR_materials_volume\n////////////////////////////////////////\n\n#ifdef RN_USE_VOLUME\n// https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_volume/README.md#attenuation\nvec3 volumeAttenuation(vec3 attenuationColor, float attenuationDistance, vec3 intensity, float transmissionDistance)\n{\n if (attenuationDistance == 0.0) { // means Infinite distance\n return intensity; // No attenuation\n } else {\n vec3 attenuationCo = -log(attenuationColor) / attenuationDistance;\n vec3 attenuatedTransmittance = exp(-attenuationCo * transmissionDistance);\n return intensity * attenuatedTransmittance;\n }\n}\n#endif\n\n\n\n\n\n\n////////////////////////////////////////\n// glTF KHR_materials_anisotropy\n////////////////////////////////////////\n#ifdef RN_USE_ANISOTROPY\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_anisotropy\nfloat D_GGX_anisotropic(float NdotH, float TdotH, float BdotH, float at, float ab)\n{\n float a2 = at * ab;\n vec3 f = vec3(ab * TdotH, at * BdotH, a2 * NdotH);\n float w2 = a2 / dot(f, f);\n return a2 * w2 * w2 / M_PI;\n}\n\nfloat V_GGX_anisotropic(float NdotL, float NdotV, float BdotV, float TdotV, float TdotL, float BdotL,\n float at, float ab)\n{\n float GGXV = NdotL * length(vec3(at * TdotV, ab * BdotV, NdotV));\n float GGXL = NdotV * length(vec3(at * TdotL, ab * BdotL, NdotL));\n float v = 0.5 / (GGXV + GGXL);\n return clamp(v, 0.0, 1.0);\n}\n\nvec3 BRDF_specularAnisotropicGGX(vec3 F, float alphaRoughness,\n float VdotH, float NdotL, float NdotV, float NdotH, float BdotV, float TdotV,\n float TdotL, float BdotL, float TdotH, float BdotH, float anisotropy)\n{\n float at = mix(alphaRoughness, 1.0, anisotropy * anisotropy);\n float ab = alphaRoughness;\n\n float V = V_GGX_anisotropic(NdotL, NdotV, BdotV, TdotV, TdotL, BdotL, at, ab);\n float D = D_GGX_anisotropic(NdotH, TdotH, BdotH, at, ab);\n\n return F * V * D;\n}\n#endif\n\n\n\n////////////////////////////////////////\n// glTF KHR_materials_sheen\n////////////////////////////////////////\n\n#ifdef RN_USE_SHEEN\nfloat d_Charlie(float sheenPerceptualRoughness, float NoH) {\n // Estevez and Kulla 2017, \"Production Friendly Microfacet Sheen BRDF\"\n float alphaG = sheenPerceptualRoughness * sheenPerceptualRoughness;\n float invAlpha = 1.0 / alphaG;\n float cos2h = NoH * NoH;\n float sin2h = 1.0 - cos2h;\n return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen#sheen-visibility\nfloat sheenSimpleVisibility(float NdotL, float NdotV) {\n return 1.0 / (4.0 * (NdotL + NdotV - NdotL * NdotV));\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen#sheen-visibility\nfloat charlieL(float x, float alphaG) {\n float oneMinusAlphaSq = (1.0 - alphaG) * (1.0 - alphaG);\n float a = mix(21.5473, 25.3245, oneMinusAlphaSq);\n float b = mix(3.82987, 3.32435, oneMinusAlphaSq);\n float c = mix(0.19823, 0.16801, oneMinusAlphaSq);\n float d = mix(-1.97760, -1.27393, oneMinusAlphaSq);\n float e = mix(-4.32054, -4.85967, oneMinusAlphaSq);\n return a / (1.0 + b * pow(x, c)) + d * x + e;\n}\n\nfloat lambdaSheen(float cosTheta, float alphaG)\n{\n return abs(cosTheta) < 0.5 ? exp(charlieL(cosTheta, alphaG)) : exp(2.0 * charlieL(0.5, alphaG) - charlieL(1.0 - cosTheta, alphaG));\n}\n\nfloat sheenCharlieVisibility(float NdotL, float NdotV, float sheenPerceptualRoughness) {\n float alphaG = sheenPerceptualRoughness * sheenPerceptualRoughness;\n float sheenVisibility = 1.0 / ((1.0 + lambdaSheen(NdotV, alphaG) + lambdaSheen(NdotL, alphaG)) * (4.0 * NdotV * NdotL));\n return sheenVisibility;\n}\n\nvec3 sheen_brdf(vec3 sheenColor, float sheenPerceptualRoughness, float NdotL, float NdotV, float NdotH) {\n float sheenDistribution = d_Charlie(sheenPerceptualRoughness, NdotH);\n float sheenVisibility = sheenCharlieVisibility(NdotL, NdotV, sheenPerceptualRoughness);\n return sheenColor * sheenDistribution * sheenVisibility;\n}\n#endif\n\n\n\n\n\n\n\n\n\n////////////////////////////////////////\n// glTF KHR_materials_irirdescence\n////////////////////////////////////////\n\n#ifdef RN_USE_IRIDESCENCE\n// XYZ to REC709(sRGB) conversion matrix\nconst mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n);\n\n// Assume air interface for top\nvec3 Fresnel0ToIor(vec3 F0) {\n vec3 sqrtF0 = sqrt(F0);\n return (vec3(1.0) + sqrtF0) / (vec3(1.0) - sqrtF0);\n}\n\n// Conversion from IOR to F0\n// ior is a value between 1.0 and 3.0. 1.0 is air interface\nvec3 IorToFresnel0(vec3 transmittedIor, float incidentIor) {\n return sq((transmittedIor - vec3(incidentIor)) / (transmittedIor + vec3(incidentIor)));\n}\nfloat IorToFresnel0(float transmittedIor, float incidentIor) {\n return sq((transmittedIor - incidentIor) / (transmittedIor + incidentIor));\n}\n\n/**\n * From: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_iridescence#analytic-spectral-integration\n */\nvec3 evalSensitivity(float OPD, vec3 shift) {\n float phase = 2.0 * M_PI * OPD * 1.0e-9;\n vec3 val = vec3(5.4856e-13, 4.4201e-13, 5.2481e-13);\n vec3 pos = vec3(1.6810e+06, 1.7953e+06, 2.2084e+06);\n vec3 var = vec3(4.3278e+09, 9.3046e+09, 6.6121e+09);\n\n vec3 xyz = val * sqrt(2.0 * M_PI * var) * cos(pos * phase + shift) * exp(-(phase * phase) * var);\n xyz.x += 9.7470e-14 * sqrt(2.0 * M_PI * 4.5282e+09) * cos(2.2399e+06 * phase + shift[0]) * exp(-4.5282e+09 * (phase * phase));\n xyz /= 1.0685e-7;\n\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n}\n\n/**\n * From: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_iridescence#iridescence-fresnel\n */\nvec3 calcIridescence(float outsideIor, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0) {\n\n\n // iridescenceIor is the index of refraction of the thin-film layer\n // Force iridescenceIor -> outsideIOR when thinFilmThickness -> 0.0\n float iridescenceIor = mix(outsideIor, eta2, smoothstep(0.0, 0.03, thinFilmThickness));\n\n // To calculate the reflectances R12 and R23 at the viewing angles (angle hitting the thin-film layer)\n // and (angle after refraction in the thin-film) Schlick Fresnel is again used.\n // This approximation allows to eliminate the split into S and P polarization for the exact Fresnel equations.\n // can be calculated using Snell's law (with being outsideIor and being iridescenceIor):\n float sinTheta2Sq = sq(outsideIor / iridescenceIor) * (1.0 - sq(cosTheta1));\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n\n // Handle total internal reflection\n if (cosTheta2Sq < 0.0) {\n return vec3(1.0);\n }\n\n float cosTheta2 = sqrt(cosTheta2Sq);\n\n /// Material Interfaces\n // The iridescence model defined by Belcour/Barla models two material interfaces\n // - one from the outside to the thin-film layer\n // and another one from the thin-film to the base material. These two interfaces are defined as follows:\n\n // First interface (from the outside to the thin-film layer)\n float R0 = IorToFresnel0(iridescenceIor, outsideIor);\n float R12 = fresnel(R0, cosTheta1);\n float R21 = R12;\n float T121 = 1.0 - R12;\n\n // Second interface (from the thin-film to the base material)\n vec3 baseIor = Fresnel0ToIor(baseF0 + 0.0001); // guard against 1.0\n vec3 R1 = IorToFresnel0(baseIor, iridescenceIor);\n vec3 R23 = fresnel(R1, cosTheta2);\n\n // phi12 and phi23 define the base phases per interface and are approximated with 0.0\n // if the IOR of the hit material (iridescenceIor or baseIor) is higher\n // than the IOR of the previous material (outsideIor or iridescenceIor) and π otherwise.\n // Also here, polarization is ignored. float phi12 = 0.0;\n\n // First interface (from the outside to the thin-film layer)\n float phi12 = 0.0;\n if (iridescenceIor < outsideIor) phi12 = M_PI;\n float phi21 = M_PI - phi12;\n\n // Second interface (from the thin-film to the base material)\n vec3 phi23 = vec3(0.0);\n if (baseIor[0] < iridescenceIor) phi23[0] = M_PI;\n if (baseIor[1] < iridescenceIor) phi23[1] = M_PI;\n if (baseIor[2] < iridescenceIor) phi23[2] = M_PI;\n\n // OPD (optical path difference)\n float OPD = 2.0 * iridescenceIor * thinFilmThickness * cosTheta2;\n // Phase shift\n vec3 phi = vec3(phi21) + phi23;\n\n // Compound terms\n vec3 R123 = clamp(R12 * R23, 1e-5, 0.9999);\n vec3 r123 = sqrt(R123);\n vec3 Rs = (T121 * T121) * R23 / (vec3(1.0) - R123);\n\n // Reflectance term for m = 0 (DC term amplitude)\n vec3 C0 = R12 + Rs;\n vec3 I = C0;\n\n // Reflectance term for m > 0 (pairs of diracs)\n vec3 Cm = Rs - T121;\n for (int m = 1; m <= 2; ++m)\n {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity(float(m) * OPD, float(m) * phi);\n I += Cm * Sm;\n }\n\n vec3 F_iridescence = max(I, vec3(0.0));\n\n return F_iridescence;\n}\n#endif\n\n\n\n\n\n////////////////////////////////////////\n// glTF BRDF for punctual lights\n////////////////////////////////////////\nvec3 gltfBRDF(\n Light light,\n vec3 normal_inWorld,\n vec3 viewDirection,\n float NdotV,\n vec3 albedo,\n float perceptualRoughness,\n float metallic,\n vec3 F0,\n vec3 F90,\n float ior,\n float transmission,\n float clearcoat,\n float clearcoatRoughness,\n vec3 clearcoatNormal_inWorld,\n float VdotNc,\n vec3 attenuationColor,\n float attenuationDistance,\n float anisotropy,\n vec3 anisotropicT,\n vec3 anisotropicB,\n float BdotV,\n float TdotV,\n vec3 sheenColor,\n float sheenRoughness,\n float albedoSheenScalingNdotV\n )\n{\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n // Fresnel\n vec3 halfVector = normalize(light.direction + viewDirection);\n float VdotH = dot(viewDirection, halfVector);\n vec3 F = fresnel(F0, F90, VdotH);\n\n float NdotL = saturateEpsilonToOne(dot(normal_inWorld, light.direction));\n\n // Diffuse\n vec3 diffuseBrdf = diffuse_brdf(albedo);\n vec3 pureDiffuse = (vec3(1.0) - F) * diffuseBrdf * vec3(NdotL) * light.attenuatedIntensity;\n\n#ifdef RN_USE_TRANSMISSION\n vec3 refractionVector = refract(-viewDirection, normal_inWorld, 1.0 / ior);\n Light transmittedLightFromUnderSurface = light;\n transmittedLightFromUnderSurface.pointToLight -= refractionVector;\n vec3 transmittedLightDirectionFromUnderSurface = normalize(transmittedLightFromUnderSurface.pointToLight);\n transmittedLightFromUnderSurface.direction = transmittedLightDirectionFromUnderSurface;\n\n vec3 Ht = normalize(viewDirection + transmittedLightFromUnderSurface.direction);\n float NdotHt = saturateEpsilonToOne(dot(normal_inWorld, Ht));\n float NdotLt = saturateEpsilonToOne(dot(normal_inWorld, transmittedLightFromUnderSurface.direction));\n\n vec3 transmittedContrib = (vec3(1.0) - F) * specular_btdf(alphaRoughness, NdotLt, NdotV, NdotHt) * albedo * transmittedLightFromUnderSurface.attenuatedIntensity;\n\n#ifdef RN_USE_VOLUME\n transmittedContrib = volumeAttenuation(attenuationColor, attenuationDistance, transmittedContrib, length(transmittedLightFromUnderSurface.pointToLight));\n#endif // RN_USE_VOLUME\n\n vec3 diffuseContrib = mix(pureDiffuse, vec3(transmittedContrib), transmission);\n#else\n vec3 diffuseContrib = pureDiffuse;\n#endif // RN_USE_TRANSMISSION\n\n // Specular\n float NdotH = saturateEpsilonToOne(dot(normal_inWorld, halfVector));\n#ifdef RN_USE_ANISOTROPY\n float TdotL = dot(anisotropicT, light.direction);\n float BdotL = dot(anisotropicB, light.direction);\n float TdotH = dot(anisotropicT, halfVector);\n float BdotH = dot(anisotropicB, halfVector);\n vec3 specularContrib = BRDF_specularAnisotropicGGX(F, alphaRoughness, VdotH, NdotL, NdotV, NdotH, BdotV, TdotV, TdotL, BdotL, TdotH, BdotH, anisotropy) * vec3(NdotL) * light.attenuatedIntensity;\n#else\n vec3 specularContrib = cook_torrance_specular_brdf(NdotH, NdotL, NdotV, F, alphaRoughness) * vec3(NdotL) * light.attenuatedIntensity;\n#endif // RN_USE_ANISOTROPY\n // Base Layer\n vec3 baseLayer = diffuseContrib + specularContrib;\n\n#ifdef RN_USE_SHEEN\n // Sheen\n vec3 sheenContrib = sheen_brdf(sheenColor, sheenRoughness, NdotL, NdotV, NdotH) * NdotL * light.attenuatedIntensity;\n float albedoSheenScaling = min(\n albedoSheenScalingNdotV,\n 1.0 - max3(sheenColor) * texture(u_sheenLutTexture, vec2(NdotL, sheenRoughness)).r);\n vec3 color = sheenContrib + baseLayer * albedoSheenScaling;\n#else\n vec3 color = baseLayer;\n float albedoSheenScaling = 1.0;\n#endif // RN_USE_SHEEN\n\n#ifdef RN_USE_CLEARCOAT\n // Clear Coat Layer\n float NdotHc = saturateEpsilonToOne(dot(clearcoatNormal_inWorld, halfVector));\n float LdotNc = saturateEpsilonToOne(dot(light.direction, clearcoatNormal_inWorld));\n vec3 coated = coated_material_s(color, perceptualRoughness,\n clearcoatRoughness, clearcoat, VdotNc, LdotNc, NdotHc);\n vec3 finalColor = coated;\n#else\n vec3 finalColor = color;\n#endif // RN_USE_CLEARCOAT\n\n return finalColor;\n}\n\n\n/* shaderity: @{matricesGetters} */\n\n#ifdef RN_USE_SHADOW_MAPPING\n\nconst float g_minVariance = 0.00001;\n\nfloat chebyshevUpperBound(vec2 moments, float t) {\n float p = (t <= moments.x) ? 1.0 : 0.0;\n\n float variance = moments.y - sq(moments.x);\n variance = max(variance, g_minVariance);\n\n float d = t - moments.x;\n float p_max = variance / (variance + sq(d));\n\n return max(p, p_max);\n}\n\nfloat varianceShadowContribution(vec2 lightTexCoord, float distanceToLight) {\n vec2 moments = texture(u_depthTexture, lightTexCoord).xy;\n\n return chebyshevUpperBound(moments, distanceToLight);\n}\n\n#endif\n\n\nvec3 get_irradiance(vec3 normal_forEnv, float materialSID, ivec2 hdriFormat) {\n vec4 diffuseTexel = texture(u_diffuseEnvTexture, normal_forEnv);\n\n vec3 irradiance;\n if (hdriFormat.x == 0) {\n // LDR_SRGB\n irradiance = srgbToLinear(diffuseTexel.rgb);\n }\n else if (hdriFormat.x == 3) {\n // RGBE\n irradiance = diffuseTexel.rgb * pow(2.0, diffuseTexel.a*255.0-128.0);\n }\n else {\n irradiance = diffuseTexel.rgb;\n }\n\n return irradiance;\n}\n\nfloat scaleForLod(float perceptualRoughness, float ior)\n{\n // Scale roughness to the range [0, 1],\n // ior=1.0 will be scale 0,\n // ior=1.5 will be scale 1.0,\n // ior=2 will be scale 1.0 (clamped)\n //\n\n float scale = clamp(ior * 2.0 - 2.0, 0.0, 1.0);\n return perceptualRoughness * scale;\n}\n\n#ifdef RN_USE_TRANSMISSION\nvec3 get_sample_from_backbuffer(float materialSID, vec2 sampleCoord, float perceptualRoughness, float ior) {\n ivec2 vrState = get_vrState(0.0, 0);\n vec2 backBufferTextureSize = get_backBufferTextureSize(materialSID, 0);\n float backBufferTextureLength = max(backBufferTextureSize.x, backBufferTextureSize.y);\n if (vrState.x == 1) { // For VR\n backBufferTextureLength = max(backBufferTextureSize.x / 2.0, backBufferTextureSize.y);\n sampleCoord.x = sampleCoord.x * 0.5;\n if (vrState.y == 1) { // For right eye\n sampleCoord.x += 0.5;\n }\n }\n float framebufferLod = log2(backBufferTextureLength) * scaleForLod(perceptualRoughness, ior);\n\n #ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n vec3 transmittedLight = texture2DLodEXT(u_backBufferTexture, sampleCoord, framebufferLod).rgb;\n #elif defined(GLSL_ES3)\n vec3 transmittedLight = textureLod(u_backBufferTexture, sampleCoord, framebufferLod).rgb;\n #else\n vec3 transmittedLight = texture(u_backBufferTexture, sampleCoord).rgb;\n #endif\n\n return transmittedLight;\n}\n#endif\n\nvec3 get_radiance(vec3 reflection, float lod, ivec2 hdriFormat) {\n #ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n vec4 specularTexel = textureCubeLodEXT(u_specularEnvTexture, reflection, lod);\n #elif defined(GLSL_ES3)\n vec4 specularTexel = textureLod(u_specularEnvTexture, reflection, lod);\n #else\n vec4 specularTexel = texture(u_specularEnvTexture, reflection);\n #endif\n\n// #pragma shaderity: require(./../common/fetchCubeTexture.glsl)\n\n vec3 radiance;\n if (hdriFormat.y == 0) {\n // LDR_SRGB\n radiance = srgbToLinear(specularTexel.rgb);\n }\n else if (hdriFormat.y == 3) {\n // RGBE\n radiance = specularTexel.rgb * pow(2.0, specularTexel.a*255.0-128.0);\n }\n else {\n radiance = specularTexel.rgb;\n }\n\n return radiance;\n}\n\n// from glTF Sample Viewer: https://github.com/KhronosGroup/glTF-Sample-Viewer\nvec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior)\n{\n vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior);\n mat4 worldMatrix = get_worldMatrix(v_instanceInfo);\n\n vec3 modelScale;\n modelScale.x = length(vec3(worldMatrix[0].xyz));\n modelScale.y = length(vec3(worldMatrix[1].xyz));\n modelScale.z = length(vec3(worldMatrix[2].xyz));\n\n return normalize(refractionVector) * thickness * modelScale;\n}\n\nstruct IblResult\n{\n vec3 specular;\n vec3 diffuse;\n vec3 FssEss;\n};\n\nIblResult getIBLRadianceGGX(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection)\n{\n // get radiance\n float mipCount = iblParameter.x;\n float lod = (perceptualRoughness * (mipCount - 1.0));\n vec3 radiance = get_radiance(reflection, lod, hdriFormat);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughness(F0, NdotV, perceptualRoughness);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Specular IBL\n vec3 specular = FssEss * radiance;\n\n // scale with user parameters\n float IBLSpecularContribution = iblParameter.z;\n specular *= IBLSpecularContribution;\n\n result.specular = specular;\n\n return result;\n}\n\nIblResult getIBLRadianceGGXWithIridescence(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection, vec3 iridescenceFresnel, float iridescence)\n{\n // get radiance\n float mipCount = iblParameter.x;\n float lod = (perceptualRoughness * (mipCount - 1.0));\n vec3 radiance = get_radiance(reflection, lod, hdriFormat);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughnessWithIridescence(F0, NdotV, perceptualRoughness, iridescenceFresnel, iridescence);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Specular IBL\n vec3 specular = FssEss * radiance;\n\n // scale with user parameters\n float IBLSpecularContribution = iblParameter.z;\n specular *= IBLSpecularContribution;\n\n result.specular = specular;\n\n return result;\n}\n\nIblResult getIBLRadianceLambertian(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection)\n{\n // get irradiance\n vec3 irradiance = get_irradiance(normal_forEnv, materialSID, hdriFormat);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughness(F0, NdotV, perceptualRoughness);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Multiple scattering, Fdez-Aguera's approach\n float Ems = (1.0 - (f_ab.x + f_ab.y));\n vec3 F_avg = F0 + (1.0 - F0) / 21.0;\n vec3 FmsEms = Ems * FssEss * F_avg / (1.0 - F_avg * Ems);\n vec3 k_D = albedo * (1.0 - FssEss - FmsEms);\n\n // Diffuse IBL\n vec3 diffuse = (FmsEms + k_D) * irradiance;\n\n // scale with user parameters\n float IBLDiffuseContribution = iblParameter.y;\n diffuse *= IBLDiffuseContribution;\n\n result.diffuse = diffuse;\n\n return result;\n}\n\nIblResult getIBLRadianceLambertianWithIridescence(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection, vec3 iridescenceF0, float iridescence)\n{\n // get irradiance\n vec3 irradiance = get_irradiance(normal_forEnv, materialSID, hdriFormat);\n\n // Use the maximum component of the iridescence Fresnel color\n // Maximum is used instead of the RGB value to not get inverse colors for the diffuse BRDF\n vec3 iridescenceF0Max = vec3(max(max(iridescenceF0.r, iridescenceF0.g), iridescenceF0.b));\n\n // Blend between base F0 and iridescence F0\n vec3 mixedF0 = mix(F0, iridescenceF0Max, iridescence);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughness(mixedF0, NdotV, perceptualRoughness);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Multiple scattering, Fdez-Aguera's approach\n float Ems = (1.0 - (f_ab.x + f_ab.y));\n vec3 F_avg = mixedF0 + (1.0 - mixedF0) / 21.0;\n vec3 FmsEms = Ems * FssEss * F_avg / (1.0 - F_avg * Ems);\n vec3 k_D = albedo * (1.0 - FssEss - FmsEms);\n\n // Diffuse IBL\n vec3 diffuse = (FmsEms + k_D) * irradiance;\n\n // scale with user parameters\n float IBLDiffuseContribution = iblParameter.y;\n diffuse *= IBLDiffuseContribution;\n\n result.diffuse = diffuse;\n\n return result;\n}\n\n#ifdef RN_USE_SHEEN\nvec3 sheenIBL(float NdotV, float sheenPerceptualRoughness, vec3 sheenColor, vec4 iblParameter, vec3 reflection, ivec2 hdriFormat)\n{\n float mipCount = iblParameter.x;\n float lod = (sheenPerceptualRoughness * (mipCount - 1.0));\n\n vec2 sheenLutUV = vec2(NdotV, sheenPerceptualRoughness);\n float brdf = texture(u_sheenLutTexture, sheenLutUV).b;\n vec3 sheenLight = get_radiance(reflection, lod, hdriFormat);\n float IBLSpecularContribution = iblParameter.z;\n sheenLight *= IBLSpecularContribution;\n\n return sheenLight * sheenColor * brdf;\n}\n#endif\n\nvec3 getNormalForEnv(mat3 rotEnvMatrix, vec3 normal_inWorld, float materialSID) {\n vec3 normal_forEnv = rotEnvMatrix * normal_inWorld;\n if (get_inverseEnvironment(materialSID, 0)) {\n normal_forEnv.x *= -1.0;\n }\n return normal_forEnv;\n}\n\nvec3 getReflection(mat3 rotEnvMatrix, vec3 viewDirection, vec3 normal_inWorld, float materialSID, float perceptualRoughness, float anisotropy, vec3 anisotropyDirection) {\n#ifdef RN_USE_ANISOTROPY\n\n float tangentRoughness = mix(perceptualRoughness, 1.0, anisotropy * anisotropy);\n vec3 anisotropicTangent = cross(anisotropyDirection, viewDirection);\n vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);\n float bendFactor = 1.0 - anisotropy * (1.0 - perceptualRoughness);\n float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor;\n vec3 bentNormal = normalize(mix(anisotropicNormal, normal_inWorld, bendFactorPow4));\n vec3 reflection = rotEnvMatrix * reflect(-viewDirection, bentNormal);\n#else\n vec3 reflection = rotEnvMatrix * reflect(-viewDirection, normal_inWorld);\n#endif\n if (get_inverseEnvironment(materialSID, 0)) {\n reflection.x *= -1.0;\n }\n return reflection;\n}\n\nvec3 IBLContribution(float materialSID, vec3 normal_inWorld, float NdotV, vec3 viewDirection,\n vec3 albedo, vec3 F0, float perceptualRoughness, float clearcoatRoughness, vec3 clearcoatNormal_inWorld,\n float clearcoat, float VdotNc, vec3 geomNormal_inWorld, float cameraSID, float transmission, vec3 v_position_inWorld,\n float thickness, vec3 sheenColor, float sheenRoughness, float albedoSheenScalingNdotV, float ior,\n vec3 iridescenceFresnel, vec3 iridescenceF0, float iridescence, float anisotropy, vec3 anisotropyDirection)\n{\n vec4 iblParameter = get_iblParameter(materialSID, 0);\n float rot = iblParameter.w + 3.1415;\n mat3 rotEnvMatrix = mat3(cos(rot), 0.0, -sin(rot), 0.0, 1.0, 0.0, sin(rot), 0.0, cos(rot));\n ivec2 hdriFormat = get_hdriFormat(materialSID, 0);\n\n vec3 normal_forEnv = getNormalForEnv(rotEnvMatrix, normal_inWorld, materialSID);\n vec3 reflection = getReflection(rotEnvMatrix, viewDirection, normal_inWorld, materialSID, perceptualRoughness, anisotropy, anisotropyDirection);\n\n // IBL\n #ifdef RN_USE_IRIDESCENCE\n IblResult baseRadianceResult = getIBLRadianceGGXWithIridescence(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection, iridescenceFresnel, iridescence);\n IblResult baseLambertianResult = getIBLRadianceLambertianWithIridescence(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection, iridescenceF0, iridescence);\n #else\n IblResult baseRadianceResult = getIBLRadianceGGX(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection);\n IblResult baseLambertianResult = getIBLRadianceLambertian(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection);\n #endif\n\n#ifdef RN_USE_TRANSMISSION\n vec3 refractedRay = getVolumeTransmissionRay(geomNormal_inWorld, viewDirection, thickness, ior);\n vec3 refractedRayFromVPosition = v_position_inWorld + refractedRay;\n vec4 ndcPoint = get_projectionMatrix(cameraSID, 0) * get_viewMatrix(cameraSID, 0) * vec4(refractedRayFromVPosition, 1.0);\n vec2 refractionCoords = ndcPoint.xy / ndcPoint.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec3 transmittedLight = get_sample_from_backbuffer(materialSID, refractionCoords, perceptualRoughness, ior);\n\n#ifdef RN_USE_VOLUME\n vec3 attenuationColor = get_attenuationColor(materialSID, 0);\n float attenuationDistance = get_attenuationDistance(materialSID, 0);\n transmittedLight = volumeAttenuation(attenuationColor, attenuationDistance, transmittedLight, length(refractedRay));\n#endif\n\n vec3 transmissionComp = (vec3(1.0) - baseRadianceResult.FssEss) * transmittedLight * albedo;\n vec3 diffuse = mix(baseLambertianResult.diffuse, transmissionComp, transmission);\n vec3 base = diffuse + baseRadianceResult.specular;\n#else\n vec3 base = baseLambertianResult.diffuse + baseRadianceResult.specular;\n#endif\n\n#ifdef RN_USE_SHEEN\n vec3 sheen = sheenIBL(NdotV, sheenRoughness, sheenColor, iblParameter, reflection, hdriFormat);\n vec3 color = sheen + base * albedoSheenScalingNdotV;\n#else\n vec3 color = base;\n#endif\n\n#ifdef RN_USE_CLEARCOAT\n float VdotNg = dot(geomNormal_inWorld, viewDirection);\n vec3 clearcoatNormal_forEnv = getNormalForEnv(rotEnvMatrix, normal_inWorld, materialSID);\n IblResult coatResult = getIBLRadianceGGX(materialSID, VdotNc, viewDirection, vec3(0.0), F0,\n clearcoatRoughness, iblParameter, hdriFormat, rotEnvMatrix, clearcoatNormal_forEnv, reflection);\n vec3 coatLayer = coatResult.specular;\n\n float clearcoatFresnel = 0.04 + (1.0 - 0.04) * pow(1.0 - abs(VdotNc), 5.0);\n vec3 coated = color * vec3(1.0 - clearcoat * clearcoatFresnel) + vec3(coatLayer * clearcoat);\n return coated;\n#else\n return color;\n#endif\n\n}\n\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvec2 getTexcoord(int texcoordIndex) {\n vec2 texcoord;\n if(texcoordIndex == 2){\n texcoord = v_texcoord_2;\n } else if(texcoordIndex == 1){\n texcoord = v_texcoord_1;\n }else{\n texcoord = v_texcoord_0;\n }\n return texcoord;\n}\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n mat3 getTBN(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord) {\n vec3 tangent_inWorld = normalize(v_tangent_inWorld);\n vec3 binormal_inWorld = normalize(v_binormal_inWorld);\n mat3 tbnMat_tangent_to_world = mat3(tangent_inWorld, binormal_inWorld, normal_inWorld);\n\n return tbnMat_tangent_to_world;\n }\n#else\n // This is based on http://www.thetenthplanet.de/archives/1180\n mat3 cotangent_frame(vec3 normal_inWorld, vec3 position, vec2 uv) {\n uv = gl_FrontFacing ? uv : -uv;\n\n // get edge vectors of the pixel triangle\n vec3 dp1 = dFdx(position);\n vec3 dp2 = dFdy(position);\n vec2 duv1 = dFdx(uv);\n vec2 duv2 = dFdy(uv);\n\n // solve the linear system\n vec3 dp2perp = cross(dp2, normal_inWorld);\n vec3 dp1perp = cross(normal_inWorld, dp1);\n vec3 tangent = dp2perp * duv1.x + dp1perp * duv2.x;\n vec3 bitangent = dp2perp * duv1.y + dp1perp * duv2.y;\n bitangent *= -1.0;\n\n // construct a scale-invariant frame\n float invMat = inversesqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));\n return mat3(tangent * invMat, bitangent * invMat, normal_inWorld);\n }\n\n mat3 getTBN(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord) {\n mat3 tbnMat_tangent_to_world = cotangent_frame(normal_inWorld, -viewVector, texcoord);\n\n return tbnMat_tangent_to_world;\n }\n#endif\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // View direction\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n vec3 viewVector = viewPosition - v_position_inWorld.xyz;\n vec3 viewDirection = normalize(viewVector);\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n vec3 geomNormal_inWorld = normal_inWorld;\n vec4 normalTextureTransform = get_normalTextureTransform(materialSID, 0);\n float normalTextureRotation = get_normalTextureRotation(materialSID, 0);\n int normalTexcoordIndex = get_normalTexcoordIndex(materialSID, 0);\n vec2 normalTexcoord = getTexcoord(normalTexcoordIndex);\n vec2 normalTexUv = uvTransform(normalTextureTransform.xy, normalTextureTransform.zw, normalTextureRotation, normalTexcoord);\n mat3 TBN = getTBN(normal_inWorld, viewVector, normalTexUv);\n #ifdef RN_USE_NORMAL_TEXTURE\n vec3 normalTexValue = texture(u_normalTexture, normalTexUv).xyz;\n if(normalTexValue.b >= 128.0 / 255.0) {\n // normal texture is existence\n vec3 normalTex = normalTexValue * 2.0 - 1.0;\n float normalScale = get_normalScale(materialSID, 0);\n vec3 scaledNormal = normalize(normalTex * vec3(normalScale, normalScale, 1.0));\n normal_inWorld = normalize(TBN * scaledNormal);\n }\n #endif\n\n // BaseColorFactor\n vec3 baseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n vec4 baseColorFactor = get_baseColorFactor(materialSID, 0);\n if (v_color != baseColor && baseColorFactor.rgb != baseColor) {\n baseColor = v_color * baseColorFactor.rgb;\n alpha = baseColorFactor.a;\n } else if (v_color == baseColor) {\n baseColor = baseColorFactor.rgb;\n alpha = baseColorFactor.a;\n } else if (baseColorFactor.rgb == baseColor) {\n baseColor = v_color;\n } else {\n baseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // BaseColor (take account for BaseColorTexture)\n vec4 baseColorTextureTransform = get_baseColorTextureTransform(materialSID, 0);\n float baseColorTextureRotation = get_baseColorTextureRotation(materialSID, 0);\n int baseColorTexcoordIndex = get_baseColorTexcoordIndex(materialSID, 0);\n vec2 baseColorTexcoord = getTexcoord(baseColorTexcoordIndex);\n vec2 baseColorTexUv = uvTransform(baseColorTextureTransform.xy, baseColorTextureTransform.zw, baseColorTextureRotation, baseColorTexcoord);\n vec4 textureColor = texture(u_baseColorTexture, baseColorTexUv);\n baseColor *= srgbToLinear(textureColor.rgb);\n alpha *= textureColor.a;\n\n#ifdef RN_IS_ALPHAMODE_MASK\n float alphaCutoff = get_alphaCutoff(materialSID, 0);\n if (alpha < alphaCutoff) {\n discard;\n }\n#endif\n\n\n\n#ifdef RN_IS_LIGHTING\n // Metallic & Roughness\n vec2 metallicRoughnessFactor = get_metallicRoughnessFactor(materialSID, 0);\n float metallic = metallicRoughnessFactor.x;\n vec4 metallicRoughnessTextureTransform = get_metallicRoughnessTextureTransform(materialSID, 0);\n float metallicRoughnessTextureRotation = get_metallicRoughnessTextureRotation(materialSID, 0);\n int metallicRoughnessTexcoordIndex = get_metallicRoughnessTexcoordIndex(materialSID, 0);\n vec2 metallicRoughnessTexcoord = getTexcoord(metallicRoughnessTexcoordIndex);\n vec2 metallicRoughnessTexUv = uvTransform(metallicRoughnessTextureTransform.xy, metallicRoughnessTextureTransform.zw, metallicRoughnessTextureRotation, metallicRoughnessTexcoord);\n vec4 ormTexel = texture(u_metallicRoughnessTexture, metallicRoughnessTexUv);\n float perceptualRoughness = ormTexel.g * metallicRoughnessFactor.y;\n metallic = ormTexel.b * metallic;\n metallic = clamp(metallic, 0.0, 1.0);\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n // filter NDF for specular AA --- https://jcgt.org/published/0010/02/02/\n float alphaRoughness2 = alphaRoughness * alphaRoughness;\n float filteredRoughness2 = IsotropicNDFFiltering(normal_inWorld, alphaRoughness2);\n perceptualRoughness = sqrt(sqrt(filteredRoughness2));\n\n // Albedo\n vec3 black = vec3(0.0);\n vec3 albedo = mix(baseColor.rgb, black, metallic);\n\n // NdotV\n float NdotV = saturateEpsilonToOne(dot(normal_inWorld, viewDirection));\n\n #ifdef RN_USE_ANISOTROPY\n float anisotropy = get_anisotropyStrength(materialSID, 0);\n vec2 anisotropyRotation = get_anisotropyRotation(materialSID, 0);\n vec2 direction = anisotropyRotation;\n vec3 anisotropyTex = texture(u_anisotropyTexture, baseColorTexUv).rgb;\n direction = anisotropyTex.rg * 2.0 - vec2(1.0);\n direction = mat2(anisotropyRotation.x, anisotropyRotation.y, -anisotropyRotation.y, anisotropyRotation.x) * normalize(direction);\n anisotropy *= anisotropyTex.b;\n vec3 anisotropicT = normalize(TBN * vec3(direction, 0.0));\n vec3 anisotropicB = normalize(cross(geomNormal_inWorld, anisotropicT));\n float BdotV = dot(anisotropicB, viewDirection);\n float TdotV = dot(anisotropicT, viewDirection);\n #else\n float anisotropy = 0.0;\n vec3 anisotropicT = vec3(0.0, 0.0, 0.0);\n vec3 anisotropicB = vec3(0.0, 0.0, 0.0);\n float BdotV = 0.0;\n float TdotV = 0.0;\n #endif\n\n // Clearcoat\n #ifdef RN_USE_CLEARCOAT\n float clearcoatFactor = get_clearCoatFactor(materialSID, 0);\n vec4 clearcoatTextureTransform = get_clearCoatTextureTransform(materialSID, 0);\n float clearcoatTextureRotation = get_clearCoatTextureRotation(materialSID, 0);\n int clearCoatTexcoordIndex = get_clearCoatTexcoordIndex(materialSID, 0);\n vec2 clearCoatTexcoord = getTexcoord(clearCoatTexcoordIndex);\n vec2 clearcoatTexUv = uvTransform(clearcoatTextureTransform.xy, clearcoatTextureTransform.zw, clearcoatTextureRotation, clearCoatTexcoord);\n float clearcoatTexture = texture(u_clearCoatTexture, clearcoatTexUv).r;\n float clearcoat = clearcoatFactor * clearcoatTexture;\n #else\n float clearcoat = 0.0;\n #endif // RN_USE_CLEARCOAT\n\n // Transmission\n #ifdef RN_USE_TRANSMISSION\n float transmissionFactor = get_transmissionFactor(materialSID, 0);\n float transmissionTexture = texture(u_transmissionTexture, baseColorTexUv).r;\n float transmission = transmissionFactor * transmissionTexture;\n // alpha *= transmission;\n #else\n float transmission = 0.0;\n #endif // RN_USE_TRANSMISSION\n\n #ifdef RN_USE_SPECULAR\n float specularTexture = texture(u_specularTexture, baseColorTexUv).a;\n float specular = get_specularFactor(materialSID, 0) * specularTexture;\n vec3 specularColorTexture = srgbToLinear(texture(u_specularTexture, baseColorTexUv).rgb);\n vec3 specularColor = get_specularColorFactor(materialSID, 0) * specularColorTexture;\n #else\n float specular = 1.0;\n vec3 specularColor = vec3(1.0, 1.0, 1.0);\n #endif // RN_USE_SPECULAR\n\n // F0, F90\n float ior = get_ior(materialSID, 0);\n float outsideIor = 1.0;\n vec3 dielectricSpecularF0 = min(\n ((ior - outsideIor) / (ior + outsideIor)) * ((ior - outsideIor) / (ior + outsideIor)) * specularColor,\n vec3(1.0)\n ) * specular;\n vec3 dielectricSpecularF90 = vec3(specular);\n vec3 F0 = mix(dielectricSpecularF0, baseColor.rgb, metallic);\n vec3 F90 = mix(dielectricSpecularF90, vec3(1.0), metallic);\n\n // Iridescence\n #ifdef RN_USE_IRIDESCENCE\n float iridescenceFactor = get_iridescenceFactor(materialSID, 0);\n float iridescenceTexture = texture(u_iridescenceTexture, baseColorTexUv).r;\n float iridescence = iridescenceFactor * iridescenceTexture;\n float iridescenceIor = get_iridescenceIor(materialSID, 0);\n float thicknessRatio = texture(u_iridescenceThicknessTexture, baseColorTexUv).r;\n float iridescenceThicknessMinimum = get_iridescenceThicknessMinimum(materialSID, 0);\n float iridescenceThicknessMaximum = get_iridescenceThicknessMaximum(materialSID, 0);\n float iridescenceThickness = mix(iridescenceThicknessMinimum, iridescenceThicknessMaximum, thicknessRatio);\n\n vec3 iridescenceFresnel = calcIridescence(1.0, iridescenceIor, NdotV, iridescenceThickness, F0);\n vec3 iridescenceF0 = Schlick_to_F0(iridescenceFresnel, NdotV);\n\n #else\n float iridescence = 0.0;\n vec3 iridescenceFresnel = vec3(0.0);\n vec3 iridescenceF0 = F0;\n #endif // RN_USE_IRIDESCENCE\n\n #ifdef RN_USE_CLEARCOAT\n // Clearcoat\n float clearcoatRoughnessFactor = get_clearCoatRoughnessFactor(materialSID, 0);\n int clearCoatRoughnessTexcoordIndex = get_clearCoatRoughnessTexcoordIndex(materialSID, 0);\n vec2 clearCoatRoughnessTexcoord = getTexcoord(clearCoatRoughnessTexcoordIndex);\n vec4 clearcoatRoughnessTextureTransform = get_clearCoatRoughnessTextureTransform(materialSID, 0);\n float clearcoatRoughnessTextureRotation = get_clearCoatRoughnessTextureRotation(materialSID, 0);\n vec2 clearcoatRoughnessTexUv = uvTransform(clearcoatRoughnessTextureTransform.xy, clearcoatRoughnessTextureTransform.zw, clearcoatRoughnessTextureRotation, clearCoatRoughnessTexcoord);\n float textureRoughnessTexture = texture(u_clearCoatRoughnessTexture, clearcoatRoughnessTexUv).g;\n float clearcoatRoughness = clearcoatRoughnessFactor * textureRoughnessTexture;\n\n int clearCoatNormalTexcoordIndex = get_clearCoatNormalTexcoordIndex(materialSID, 0);\n vec2 clearCoatNormalTexcoord = getTexcoord(clearCoatNormalTexcoordIndex);\n vec4 clearcoatNormalTextureTransform = get_clearCoatNormalTextureTransform(materialSID, 0);\n float clearcoatNormalTextureRotation = get_clearCoatNormalTextureRotation(materialSID, 0);\n vec2 clearcoatNormalTexUv = uvTransform(clearcoatNormalTextureTransform.xy, clearcoatNormalTextureTransform.zw, clearcoatNormalTextureRotation, clearCoatNormalTexcoord);\n vec3 textureNormal_tangent = texture(u_clearCoatNormalTexture, clearcoatNormalTexUv).xyz * vec3(2.0) - vec3(1.0);\n vec3 clearcoatNormal_inWorld = normalize(TBN * textureNormal_tangent);\n float VdotNc = saturateEpsilonToOne(dot(viewDirection, clearcoatNormal_inWorld));\n #else\n float clearcoatRoughness = 0.0;\n vec3 clearcoatNormal_inWorld = vec3(0.0);\n float VdotNc = 0.0;\n #endif // RN_USE_CLEARCOAT\n\n #ifdef RN_USE_VOLUME\n // Volume\n float thicknessFactor = get_thicknessFactor(materialSID, 0);\n float thicknessTexture = texture(u_thicknessTexture, baseColorTexUv).g;\n float attenuationDistance = get_attenuationDistance(materialSID, 0);\n vec3 attenuationColor = get_attenuationColor(materialSID, 0);\n float thickness = thicknessFactor * thicknessTexture;\n #else\n float thickness = 0.0;\n vec3 attenuationColor = vec3(0.0);\n float attenuationDistance = 0.000001;\n #endif // RN_USE_VOLUME\n\n #ifdef RN_USE_SHEEN\n // Sheen\n vec3 sheenColorFactor = get_sheenColorFactor(materialSID, 0);\n vec3 sheenColorTexture = texture(u_sheenColorTexture, baseColorTexUv).rgb;\n float sheenRoughnessFactor = get_sheenRoughnessFactor(materialSID, 0);\n float sheenRoughnessTexture = texture(u_sheenRoughnessTexture, baseColorTexUv).a;\n vec3 sheenColor = sheenColorFactor * sheenColorTexture;\n float sheenRoughness = clamp(sheenRoughnessFactor * sheenRoughnessTexture, 0.000001, 1.0);\n float albedoSheenScalingNdotV = 1.0 - max3(sheenColor) * texture(u_sheenLutTexture, vec2(NdotV, sheenRoughness)).r;\n #else\n vec3 sheenColor = vec3(0.0);\n float sheenRoughness = 0.000001;\n float albedoSheenScalingNdotV = 1.0;\n #endif // RN_USE_SHEEN\n\n rt0 = vec4(0.0, 0.0, 0.0, alpha);\n\n // Lighting\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n rt0.xyz += gltfBRDF(light, normal_inWorld, viewDirection, NdotV, albedo,\n perceptualRoughness, metallic, F0, F90, ior, transmission,\n clearcoat, clearcoatRoughness, clearcoatNormal_inWorld, VdotNc,\n attenuationColor, attenuationDistance,\n anisotropy, anisotropicT, anisotropicB, BdotV, TdotV,\n sheenColor, sheenRoughness, albedoSheenScalingNdotV);\n }\n\n #ifdef RN_USE_SHADOW_MAPPING\n float bias = 0.001;\n vec2 shadowCoord = v_shadowCoord.xy / v_shadowCoord.w;\n float shadowContribusion = 1.0;\n if (shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0) {\n shadowContribusion = varianceShadowContribution(shadowCoord, (v_shadowCoord.z - bias)/v_shadowCoord.w);\n }\n // rt0.rgb = rt0.rgb * (0.5 + shadowContribusion * 0.5);\n rt0.rgb = rt0.rgb * shadowContribusion;\n #endif\n\n vec3 ibl = IBLContribution(materialSID, normal_inWorld, NdotV, viewDirection,\n albedo, F0, perceptualRoughness, clearcoatRoughness, clearcoatNormal_inWorld,\n clearcoat, VdotNc, geomNormal_inWorld, cameraSID, transmission, v_position_inWorld.xyz, thickness,\n sheenColor, sheenRoughness, albedoSheenScalingNdotV, ior, iridescenceFresnel, iridescenceF0, iridescence, anisotropy, anisotropicB);\n\n int occlusionTexcoordIndex = get_occlusionTexcoordIndex(materialSID, 0);\n vec2 occlusionTexcoord = getTexcoord(occlusionTexcoordIndex);\n vec4 occlusionTextureTransform = get_occlusionTextureTransform(materialSID, 0);\n float occlusionTextureRotation = get_occlusionTextureRotation(materialSID, 0);\n vec2 occlusionTexUv = uvTransform(occlusionTextureTransform.xy, occlusionTextureTransform.zw, occlusionTextureRotation, occlusionTexcoord);\n float occlusion = texture(u_occlusionTexture, occlusionTexUv).r;\n float occlusionStrength = get_occlusionStrength(materialSID, 0);\n\n // Occlution to Indirect Lights\n rt0.xyz += mix(ibl, ibl * occlusion, occlusionStrength);\n#else\n rt0 = vec4(baseColor, alpha);\n#endif // RN_IS_LIGHTING\n\n // Emissive\n vec3 emissiveFactor = get_emissiveFactor(materialSID, 0);\n int emissiveTexcoordIndex = get_emissiveTexcoordIndex(materialSID, 0);\n vec2 emissiveTexcoord = getTexcoord(emissiveTexcoordIndex);\n vec4 emissiveTextureTransform = get_emissiveTextureTransform(materialSID, 0);\n float emissiveTextureRotation = get_emissiveTextureRotation(materialSID, 0);\n vec2 emissiveTexUv = uvTransform(emissiveTextureTransform.xy, emissiveTextureTransform.zw, emissiveTextureRotation, emissiveTexcoord);\n vec3 emissive = emissiveFactor * srgbToLinear(texture(u_emissiveTexture, emissiveTexUv).xyz);\n\n#ifdef RN_USE_CLEARCOAT\n vec3 coated_emissive = emissive * mix(vec3(1.0), vec3(0.04 + (1.0 - 0.04) * pow(1.0 - NdotV, 5.0)), clearcoat);\n rt0.xyz += coated_emissive;\n#else\n rt0.xyz += emissive;\n#endif // RN_USE_CLEARCOAT\n\n bool isOutputHDR = get_isOutputHDR(materialSID, 0);\n if(isOutputHDR){\n/* shaderity: @{renderTargetEnd} */\n\n return;\n }\n\n#ifdef RN_IS_ALPHAMODE_OPAQUE\n rt0.a = 1.0;\n#elif defined(RN_IS_ALPHAMODE_MASK)\n rt0.a = 1.0;\n#endif\n\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\n // rt0.rgb = vec3(texture(u_depthTexture, v_shadowCoord.xy/v_shadowCoord.w).r);\n\n // premultiplied alpha\n // rt0.rgb /= alpha;\n\nfloat makeOutputSrgb = float(get_makeOutputSrgb(materialSID, 0));\nrt0.rgb = mix(rt0.rgb, linearToSrgb(rt0.rgb), makeOutputSrgb);\n\nrt1 = rt0;\nrt2 = rt0;\nrt3 = rt0;\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},S={code:"/* shaderity: @{definitions} */\nstruct VertexOutput {\n @builtin(position) position : vec4,\n @location(0) normal : vec3,\n @location(1) texcoord_0 : vec2,\n @location(2) color_0 : vec2,\n}\n\nstruct StorageData {\n data: array>,\n}\n@binding(0) @group(0) var storageData : StorageData;\n\noverride _materialSID: u32;\n\nfn fetchElement(vec4_idx: u32) -> vec4\n{\n return storageData.data[vec4_idx];\n}\n\nfn fetchVec3No16BytesAligned(scalar_idx: u32) -> vec3 {\n let posIn4bytes = scalar_idx % 4u;\n\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n if (posIn4bytes == 0u) {\n let val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1u) {\n let val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2u) {\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.w, val1.xy);\n }\n}\n\nfn fetchVec4(vec4_idx: u32) -> vec4 {\n return fetchElement(vec4_idx);\n}\n\nfn fetchScalarNo16BytesAligned(scalar_idx: u32) -> f32 {\n let posIn4bytes = scalar_idx % 4u;\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n let val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0u) {\n return val.x;\n } else if (posIn4bytes == 1u) {\n return val.y;\n } else if (posIn4bytes == 2u) {\n return val.z;\n } else { // posIn4bytes == 3u\n return val.w;\n }\n}\n\n\n\n\nfn fetchMat4(vec4_idx: u32) -> mat4x4\n{\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n let col3 = fetchElement(vec4_idx + 3u);\n\n let val = mat4x4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\n\nfn fetchMat4x3(vec4_idx: u32) -> mat4x3 {\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n\n let val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n\n return val;\n}\n\n\n/* shaderity: @{getters} */\n/* shaderity: @{matricesGetters} */\n\n\n#ifdef RN_IS_SKINNING\n\nfn createMatrixFromQuaternionTranslationScale( quaternion: vec4, translation: vec3, scale: vec3 ) -> mat4x3 {\n let q = quaternion;\n let t = translation;\n\n let sx = q.x * q.x;\n let sy = q.y * q.y;\n let sz = q.z * q.z;\n let cx = q.y * q.z;\n let cy = q.x * q.z;\n let cz = q.x * q.y;\n let wx = q.w * q.x;\n let wy = q.w * q.y;\n let wz = q.w * q.z;\n\n let mat = mat4x4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n let uniformScaleMat = mat4x4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n let mat44 = mat*uniformScaleMat;\n return mat4x3(\n vec3(mat44[0].x, mat44[0].y, mat44[0].z),\n vec3(mat44[1].x, mat44[1].y, mat44[1].z),\n vec3(mat44[2].x, mat44[2].y, mat44[2].z),\n vec3(mat44[3].x, mat44[3].y, mat44[3].z)\n );\n\n}\n\nfn unpackedVec2ToNormalizedVec4(vec_xy: vec2, criteria: f32) -> vec4 {\n\n var r: f32;\n var g: f32;\n var b: f32;\n var a: f32;\n\n let ix = floor(vec_xy.x * criteria);\n let v1x = ix / criteria;\n let v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n let iy = floor( vec_xy.y * criteria);\n let v2x = iy / criteria;\n let v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nfn getSkinMatrix(skeletalComponentSID: u32, joint: vec4, weight: vec4) -> mat4x3 {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n var skinMat: mat4x3 = weight.x * get_boneMatrix(skeletalComponentSID, joint.x);\n skinMat += weight.y * get_boneMatrix(skeletalComponentSID, joint.y);\n skinMat += weight.z * get_boneMatrix(skeletalComponentSID, joint.z);\n skinMat += weight.w * get_boneMatrix(skeletalComponentSID, joint.w);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n let criteria = vec2(4096.0, 4096.0);\n\n let tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, joint.x);\n let sq_x = get_boneScalePackedQuat(skeletalComponentSID, joint.x);\n var quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n var skinMat: mat4x3 = weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n let tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, joint.y);\n let sq_y = get_boneScalePackedQuat(skeletalComponentSID, joint.y);\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n let tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, joint.z);\n let sq_z = get_boneScalePackedQuat(skeletalComponentSID, joint.z);\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n let tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, joint.w);\n let sq_w = get_boneScalePackedQuat(skeletalComponentSID, joint.w);\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n let ts_x = get_boneTranslateScale(skeletalComponentSID, joint.x);\n var skinMat: mat4x3 = weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, joint.x), ts_x.xyz, vec3(ts_x.w));\n let ts_y = get_boneTranslateScale(skeletalComponentSID, joint.y);\n skinMat += weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, joint.y), ts_y.xyz, vec3(ts_y.w));\n let ts_z = get_boneTranslateScale(skeletalComponentSID, joint.z);\n skinMat += weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, joint.z), ts_z.xyz, vec3(ts_z.w));\n let ts_w = get_boneTranslateScale(skeletalComponentSID, joint.w);\n skinMat += weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, joint.w), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n let boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, joint.x);\n let boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, joint.y);\n let boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, joint.z);\n let boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, joint.w);\n\n let criteria = vec2(4096.0, 4096.0);\n let boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n let ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n var skinMat: mat4x3 = weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n let ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n let ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n let ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n@vertex\nfn main(\n#ifdef RN_USE_INSTANCE\n @location(8) instance_ids: vec4,\n#endif\n#ifdef RN_USE_POSITION\n @location(0) position: vec3,\n#endif\n#ifdef RN_USE_NORMAL\n @location(1) normal: vec3,\n#endif\n#ifdef RN_USE_TANGENT\n @location(2) tangent: vec3,\n#endif\n#ifdef RN_USE_TEXCOORD_0\n @location(3) texcoord_0: vec2,\n#endif\n#ifdef RN_USE_COLOR_0\n @location(3) color_0: vec2,\n#endif\n) -> VertexOutput {\nlet materialSID = _materialSID;\n\n\n var output : VertexOutput;\n\n let cameraSID = u32(get_currentComponentSIDs(0, /* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */));\n let worldMatrix = get_worldMatrix(u32(instance_ids.x));\n let viewMatrix = get_viewMatrix(cameraSID, 0);\n let projectionMatrix = get_projectionMatrix(cameraSID, 0);\n\n output.position = projectionMatrix * viewMatrix * worldMatrix * vec4(position, 1.0);\n#ifdef RN_USE_NORMAL\n output.normal = normalize((worldMatrix * vec4(normal, 0.0)).xyz);\n#endif\n\n#ifdef RN_USE_TEXCOORD_0\n output.texcoord_0 = texcoord_0;\n#endif\n\n#ifdef RN_USE_COLOR_0\n output.color_0 = color_0;\n#endif\n\n // output.Position = vec4(position, 1.0);\n\n return output;\n}\n",shaderStage:"vertex",isFragmentShader:!1},C={code:"/* shaderity: @{definitions} */\nstruct VertexOutput {\n @builtin(position) position : vec4,\n @location(0) normal : vec3,\n @location(1) texcoord_0 : vec2,\n @location(2) color_0 : vec2,\n}\n\nstruct StorageData {\n data: array>,\n}\n@binding(0) @group(0) var storageData : StorageData;\n\noverride _materialSID: u32;\n\nfn fetchElement(vec4_idx: u32) -> vec4\n{\n return storageData.data[vec4_idx];\n}\n\nfn fetchVec3No16BytesAligned(scalar_idx: u32) -> vec3 {\n let posIn4bytes = scalar_idx % 4u;\n\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n if (posIn4bytes == 0u) {\n let val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1u) {\n let val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2u) {\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.w, val1.xy);\n }\n}\n\nfn fetchVec4(vec4_idx: u32) -> vec4 {\n return fetchElement(vec4_idx);\n}\n\nfn fetchScalarNo16BytesAligned(scalar_idx: u32) -> f32 {\n let posIn4bytes = scalar_idx % 4u;\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n let val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0u) {\n return val.x;\n } else if (posIn4bytes == 1u) {\n return val.y;\n } else if (posIn4bytes == 2u) {\n return val.z;\n } else { // posIn4bytes == 3u\n return val.w;\n }\n}\n\n\n\n\nfn fetchMat4(vec4_idx: u32) -> mat4x4\n{\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n let col3 = fetchElement(vec4_idx + 3u);\n\n let val = mat4x4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\n\nfn fetchMat4x3(vec4_idx: u32) -> mat4x3 {\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n\n let val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n\n return val;\n}\n\n\n/* shaderity: @{getters} */\n\n// #param baseColorFactor: vec4; // initialValue=(1,1,1,1)\n\n@group(1) @binding(0) var baseColorTexture: texture_2d; // initialValue=white\n@group(2) @binding(0) var baseColorSampler: sampler;\n\n@fragment\nfn main(\n input: VertexOutput\n) -> @location(0) vec4 {\nlet materialSID = _materialSID;\n\n\n var Normal = input.normal * 0.5 + 0.5;\n\n var baseColor = vec4(1, 1, 1, 1);\n var baseColorFactor = get_baseColorFactor(materialSID, 0u);\n\n#ifdef RN_USE_COLOR_0\n baseColor = input.color_0;\n#endif\n\n baseColor *= baseColorFactor;\n\n#ifdef RN_USE_TEXCOORD_0\n baseColor *= textureSample(baseColorTexture, baseColorSampler, input.texcoord_0);\n#endif\n return baseColor;\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var w=n(5757),R=n(4878);const P={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nout vec2 v_texcoord_0;\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n v_texcoord_0 = a_texcoord_0;\n}\n",shaderStage:"vertex",isFragmentShader:!1},M={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/**\n * This file contains source code provided by NVIDIA Corporation.\n * FXAA antialiasing is developed by NVIDIA.\n * The codes of this file is modified from original code to work on WebGL1.\n * The modification for GLSL 100 is referred from Three.js, https://github.com/mrdoob/three.js/blob/5ba4c25bcb74577e1b1e14906f345135610a94f3/examples/js/shaders/FXAAShader.js\n * The original FXAA code is https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/80e8ba8f5e8935821513207033490735dd3279d8/samples/es3-kepler/FXAA/FXAA3_11.h\n */\n\n//----------------------------------------------------------------------------------\n// File: es3-kepler\\FXAA/FXAA3_11.h\n// SDK Version: v3.00\n// Email: gameworks@nvidia.com\n// Site: http://developer.nvidia.com/\n//\n// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// * Neither the name of NVIDIA CORPORATION nor the names of its\n// contributors may be used to endorse or promote products derived\n// from this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 'AS IS' AND ANY\n// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//----------------------------------------------------------------------------------\n/*============================================================================\n NVIDIA FXAA 3.11 by TIMOTHY LOTTES\n============================================================================*/\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord_0;\n\nuniform sampler2D u_baseColorTexture; // initialValue=(0,white)\nuniform vec2 u_screenInfo; // initialValue=(0,0)\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\n\n\n #define FXAA_PC 1\n #define FXAA_QUALITYPRESET 39\n #define FXAA_GREEN_AS_LUMA 0\n #define FXAA_GLSL_100 1\n\n /*============================================================================\n INTEGRATION KNOBS\n ============================================================================*/\n //\n // FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE).\n // FXAA_360_OPT is a prototype for the new optimized 360 version.\n //\n // 1 = Use API.\n // 0 = Don't use API.\n //\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_PS3\n #define FXAA_PS3 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_360\n #define FXAA_360 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_360_OPT\n #define FXAA_360_OPT 0\n #endif\n /*==========================================================================*/\n #ifndef FXAA_PC\n //\n // FXAA Quality\n // The high quality PC algorithm.\n //\n #define FXAA_PC 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_PC_CONSOLE\n //\n // The console algorithm for PC is included\n // for developers targeting really low spec machines.\n // Likely better to just run FXAA_PC, and use a really low preset.\n //\n #define FXAA_PC_CONSOLE 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GLSL_120\n #define FXAA_GLSL_120 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GLSL_130\n #define FXAA_GLSL_130 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_3\n #define FXAA_HLSL_3 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_4\n #define FXAA_HLSL_4 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_5\n #define FXAA_HLSL_5 0\n #endif\n /*==========================================================================*/\n #ifndef FXAA_GREEN_AS_LUMA\n //\n // For those using non-linear color,\n // and either not able to get luma in alpha, or not wanting to,\n // this enables FXAA to run using green as a proxy for luma.\n // So with this enabled, no need to pack luma in alpha.\n //\n // This will turn off AA on anything which lacks some amount of green.\n // Pure red and blue or combination of only R and B, will get no AA.\n //\n // Might want to lower the settings for both,\n // fxaaConsoleEdgeThresholdMin\n // fxaaQualityEdgeThresholdMin\n // In order to insure AA does not get turned off on colors\n // which contain a minor amount of green.\n //\n // 1 = On.\n // 0 = Off.\n //\n #define FXAA_GREEN_AS_LUMA 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_EARLY_EXIT\n //\n // Controls algorithm's early exit path.\n // On PS3 turning this ON adds 2 cycles to the shader.\n // On 360 turning this OFF adds 10ths of a millisecond to the shader.\n // Turning this off on console will result in a more blurry image.\n // So this defaults to on.\n //\n // 1 = On.\n // 0 = Off.\n //\n #define FXAA_EARLY_EXIT 1\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_DISCARD\n //\n // Only valid for PC OpenGL currently.\n // Probably will not work when FXAA_GREEN_AS_LUMA = 1.\n //\n // 1 = Use discard on pixels which don't need AA.\n // For APIs which enable concurrent TEX+ROP from same surface.\n // 0 = Return unchanged color on pixels which don't need AA.\n //\n #define FXAA_DISCARD 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_FAST_PIXEL_OFFSET\n //\n // Used for GLSL 120 only.\n //\n // 1 = GL API supports fast pixel offsets\n // 0 = do not use fast pixel offsets\n //\n #ifdef GLEXT_gpu_shader4\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifdef GLNV_gpu_shader5\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifdef GLARB_gpu_shader5\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifndef FXAA_FAST_PIXEL_OFFSET\n #define FXAA_FAST_PIXEL_OFFSET 0\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GATHER4_ALPHA\n //\n // 1 = API supports gather4 on alpha channel.\n // 0 = API does not support gather4 on alpha channel.\n //\n #if (FXAA_HLSL_5 == 1)\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifdef GLARB_gpu_shader5\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifdef GLNV_gpu_shader5\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifndef FXAA_GATHER4_ALPHA\n #define FXAA_GATHER4_ALPHA 0\n #endif\n #endif\n\n /*============================================================================\n FXAA CONSOLE PS3 - TUNING KNOBS\n ============================================================================*/\n #ifndef FXAA_CONSOLEPS3_EDGE_SHARPNESS\n //\n // Consoles the sharpness of edges on PS3 only.\n // Non-PS3 tuning is done with shader input.\n //\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 4 and 8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n //\n // 8.0 is sharper\n // 4.0 is softer\n // 2.0 is really soft (good for vector graphics inputs)\n //\n #if 1\n #define FXAA_CONSOLEPS3_EDGE_SHARPNESS 8.0\n #endif\n #if 0\n #define FXAA_CONSOLEPS3_EDGE_SHARPNESS 4.0\n #endif\n #if 0\n #define FXAA_CONSOLEPS3_EDGE_SHARPNESS 2.0\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_CONSOLEPS3_EDGE_THRESHOLD\n //\n // Only effects PS3.\n // Non-PS3 tuning is done with shader input.\n //\n // The minimum amount of local contrast required to apply algorithm.\n // The console setting has a different mapping than the quality setting.\n //\n // This only applies when FXAA_EARLY_EXIT is 1.\n //\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 0.25 and 0.125.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n //\n // 0.125 leaves less aliasing, but is softer\n // 0.25 leaves more aliasing, and is sharper\n //\n #if 1\n #define FXAA_CONSOLEPS3_EDGE_THRESHOLD 0.125\n #else\n #define FXAA_CONSOLEPS3_EDGE_THRESHOLD 0.25\n #endif\n #endif\n\n /*============================================================================\n FXAA QUALITY - TUNING KNOBS\n ------------------------------------------------------------------------------\n NOTE the other tuning knobs are now in the shader function inputs!\n ============================================================================*/\n #ifndef FXAA_QUALITYPRESET\n //\n // Choose the quality preset.\n // This needs to be compiled into the shader as it effects code.\n // Best option to include multiple presets is to\n // in each shader define the preset, then include this file.\n //\n // OPTIONS\n // -----------------------------------------------------------------------\n // 10 to 15 - default medium dither (10=fastest, 15=highest quality)\n // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)\n // 39 - no dither, very expensive\n //\n // NOTES\n // -----------------------------------------------------------------------\n // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)\n // 13 = about same speed as FXAA 3.9 and better than 12\n // 23 = closest to FXAA 3.9 visually and performance wise\n // _ = the lowest digit is directly related to performance\n // _ = the highest digit is directly related to style\n //\n #define FXAA_QUALITYPRESET 12\n #endif\n\n\n /*============================================================================\n FXAA QUALITY - PRESETS\n ============================================================================*/\n\n /*============================================================================\n FXAA QUALITY - MEDIUM DITHER PRESETS\n ============================================================================*/\n #if(FXAA_QUALITYPRESET == 10)\n#define FXAA_QUALITYPS 3\n#define FXAA_QUALITYP0 1.5\n#define FXAA_QUALITYP1 3.0\n#define FXAA_QUALITYP2 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 11)\n#define FXAA_QUALITYPS 4\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 3.0\n#define FXAA_QUALITYP3 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 12)\n#define FXAA_QUALITYPS 5\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 4.0\n#define FXAA_QUALITYP4 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 13)\n#define FXAA_QUALITYPS 6\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 4.0\n#define FXAA_QUALITYP5 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 14)\n#define FXAA_QUALITYPS 7\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 4.0\n#define FXAA_QUALITYP6 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 15)\n#define FXAA_QUALITYPS 8\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 4.0\n#define FXAA_QUALITYP7 12.0\n#endif\n\n/*============================================================================\n FXAA QUALITY - LOW DITHER PRESETS\n============================================================================*/\n#if (FXAA_QUALITYPRESET == 20)\n#define FXAA_QUALITYPS 3\n#define FXAA_QUALITYP0 1.5\n#define FXAA_QUALITYP1 2.0\n#define FXAA_QUALITYP2 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 21)\n#define FXAA_QUALITYPS 4\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 22)\n#define FXAA_QUALITYPS 5\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 23)\n#define FXAA_QUALITYPS 6\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 24)\n#define FXAA_QUALITYPS 7\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 3.0\n#define FXAA_QUALITYP6 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 25)\n#define FXAA_QUALITYPS 8\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 4.0\n#define FXAA_QUALITYP7 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 26)\n#define FXAA_QUALITYPS 9\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 4.0\n#define FXAA_QUALITYP8 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 27)\n#define FXAA_QUALITYPS 10\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 4.0\n#define FXAA_QUALITYP9 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 28)\n#define FXAA_QUALITYPS 11\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 2.0\n#define FXAA_QUALITYP9 4.0\n#define FXAA_QUALITYP10 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 29)\n#define FXAA_QUALITYPS 12\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 2.0\n#define FXAA_QUALITYP9 2.0\n#define FXAA_QUALITYP10 4.0\n#define FXAA_QUALITYP11 8.0\n#endif\n\n/*============================================================================\n FXAA QUALITY - EXTREME QUALITY\n============================================================================*/\n#if (FXAA_QUALITYPRESET == 39)\n#define FXAA_QUALITYPS 12\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.0\n#define FXAA_QUALITYP2 1.0\n#define FXAA_QUALITYP3 1.0\n#define FXAA_QUALITYP4 1.0\n#define FXAA_QUALITYP5 1.5\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 2.0\n#define FXAA_QUALITYP9 2.0\n#define FXAA_QUALITYP10 4.0\n#define FXAA_QUALITYP11 8.0\n#endif\n\n\n\n/*============================================================================\n API PORTING\n============================================================================*/\n#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)\n#define FxaaBool bool\n#define FxaaDiscard discard\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 ivec2\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTex sampler2D\n#else\n#define FxaaBool bool\n#define FxaaDiscard clip(-1)\n#define FxaaFloat float\n#define FxaaFloat2 float2\n#define FxaaFloat3 float3\n#define FxaaFloat4 float4\n#define FxaaHalf half\n#define FxaaHalf2 half2\n#define FxaaHalf3 half3\n#define FxaaHalf4 half4\n#define FxaaSat(x) saturate(x)\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_GLSL_100 == 1)\n#define FxaaTexTop(t, p) texture(t, p, 0.0)\n#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r), 0.0)\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_GLSL_120 == 1)\n// Requires,\n// #version 120\n// And at least,\n// #extension GLEXT_gpu_shader4 : enable\n// (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)\n#define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)\n#if (FXAA_FAST_PIXEL_OFFSET == 1)\n#define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)\n#else\n#define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)\n#endif\n#if (FXAA_GATHER4_ALPHA == 1)\n// use #extension GLARB_gpu_shader5 : enable\n#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n#define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n#endif\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_GLSL_130 == 1)\n// Requires \"#version 130\" or better\n#define FxaaTexTop(t, p) textureLod(t, p, 0.0)\n#define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)\n#if (FXAA_GATHER4_ALPHA == 1)\n// use #extension GLARB_gpu_shader5 : enable\n#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n#define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n#endif\n#endif\n\n\n/*============================================================================\n GREEN AS LUMA OPTION SUPPORT FUNCTION\n============================================================================*/\n#if (FXAA_GREEN_AS_LUMA == 0)\n FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return dot(rgba.rgb, vec3(0.298912, 0.586611, 0.114478)); }\n // FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }\n#else\n FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\n#endif\n\n\n\n\n\n\n\n\n\n/*============================================================================\n FXAA3 QUALITY - PC\n============================================================================*/\n#if (FXAA_PC == 1)\n /*--------------------------------------------------------------------------*/\n FxaaFloat4 FxaaPixelShader(\n //\n // Use noperspective interpolation here (turn off perspective interpolation).\n // {xy} = center of pixel\n FxaaFloat2 pos,\n //\n // Used only for FXAA Console, and not used on the 360 version.\n // Use noperspective interpolation here (turn off perspective interpolation).\n // {xy} = upper left of pixel\n // {zw} = lower right of pixel\n FxaaFloat4 fxaaConsolePosPos,\n //\n // Input color texture.\n // {rgb_} = color in linear or perceptual color space\n // if (FXAA_GREEN_AS_LUMA == 0)\n // {_a} = luma in perceptual color space (not linear)\n FxaaTex tex,\n //\n // Only used on the optimized 360 version of FXAA Console.\n // For everything but 360, just use the same input here as for \"tex\".\n // For 360, same texture, just alias with a 2nd sampler.\n // This sampler needs to have an exponent bias of -1.\n FxaaTex fxaaConsole360TexExpBiasNegOne,\n //\n // Only used on the optimized 360 version of FXAA Console.\n // For everything but 360, just use the same input here as for \"tex\".\n // For 360, same texture, just alias with a 3nd sampler.\n // This sampler needs to have an exponent bias of -2.\n FxaaTex fxaaConsole360TexExpBiasNegTwo,\n //\n // Only used on FXAA Quality.\n // This must be from a constant/uniform.\n // {x_} = 1.0/screenWidthInPixels\n // {_y} = 1.0/screenHeightInPixels\n FxaaFloat2 fxaaQualityRcpFrame,\n //\n // Only used on FXAA Console.\n // This must be from a constant/uniform.\n // This effects sub-pixel AA quality and inversely sharpness.\n // Where N ranges between,\n // N = 0.50 (default)\n // N = 0.33 (sharper)\n // {x_} = -N/screenWidthInPixels\n // {_y} = -N/screenHeightInPixels\n // {z_} = N/screenWidthInPixels\n // {_w} = N/screenHeightInPixels\n FxaaFloat4 fxaaConsoleRcpFrameOpt,\n //\n // Only used on FXAA Console.\n // Not used on 360, but used on PS3 and PC.\n // This must be from a constant/uniform.\n // {x_} = -2.0/screenWidthInPixels\n // {_y} = -2.0/screenHeightInPixels\n // {z_} = 2.0/screenWidthInPixels\n // {_w} = 2.0/screenHeightInPixels\n FxaaFloat4 fxaaConsoleRcpFrameOpt2,\n //\n // Only used on FXAA Console.\n // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.\n // This must be from a constant/uniform.\n // {x_} = 8.0/screenWidthInPixels\n // {_y} = 8.0/screenHeightInPixels\n // {z_} = -4.0/screenWidthInPixels\n // {_w} = -4.0/screenHeightInPixels\n FxaaFloat4 fxaaConsole360RcpFrameOpt2,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITYSUBPIX define.\n // It is here now to allow easier tuning.\n // Choose the amount of sub-pixel aliasing removal.\n // This can effect sharpness.\n // 1.00 - upper limit (softer)\n // 0.75 - default amount of filtering\n // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)\n // 0.25 - almost off\n // 0.00 - completely off\n FxaaFloat fxaaQualitySubpix,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITYEDGE_THRESHOLD define.\n // It is here now to allow easier tuning.\n // The minimum amount of local contrast required to apply algorithm.\n // 0.333 - too little (faster)\n // 0.250 - low quality\n // 0.166 - default\n // 0.125 - high quality\n // 0.063 - overkill (slower)\n FxaaFloat fxaaQualityEdgeThreshold,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITYEDGE_THRESHOLD_MIN define.\n // It is here now to allow easier tuning.\n // Trims the algorithm from processing darks.\n // 0.0833 - upper limit (default, the start of visible unfiltered edges)\n // 0.0625 - high quality (faster)\n // 0.0312 - visible limit (slower)\n // Special notes when using FXAA_GREEN_AS_LUMA,\n // Likely want to set this to zero.\n // As colors that are mostly not-green\n // will appear very dark in the green channel!\n // Tune by looking at mostly non-green content,\n // then start at zero and increase until aliasing is a problem.\n FxaaFloat fxaaQualityEdgeThresholdMin,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLEEDGE_SHARPNESS define.\n // It is here now to allow easier tuning.\n // This does not effect PS3, as this needs to be compiled in.\n // Use FXAA_CONSOLEPS3_EDGE_SHARPNESS for PS3.\n // Due to the PS3 being ALU bound,\n // there are only three safe values here: 2 and 4 and 8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n // For all other platforms can be a non-power of two.\n // 8.0 is sharper (default!!!)\n // 4.0 is softer\n // 2.0 is really soft (good only for vector graphics inputs)\n FxaaFloat fxaaConsoleEdgeSharpness,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLEEDGE_THRESHOLD define.\n // It is here now to allow easier tuning.\n // This does not effect PS3, as this needs to be compiled in.\n // Use FXAA_CONSOLEPS3_EDGE_THRESHOLD for PS3.\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 1/4 and 1/8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n // The console setting has a different mapping than the quality setting.\n // Other platforms can use other values.\n // 0.125 leaves less aliasing, but is softer (default!!!)\n // 0.25 leaves more aliasing, and is sharper\n FxaaFloat fxaaConsoleEdgeThreshold,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLEEDGE_THRESHOLD_MIN define.\n // It is here now to allow easier tuning.\n // Trims the algorithm from processing darks.\n // The console setting has a different mapping than the quality setting.\n // This only applies when FXAA_EARLY_EXIT is 1.\n // This does not apply to PS3,\n // PS3 was simplified to avoid more shader instructions.\n // 0.06 - faster but more aliasing in darks\n // 0.05 - default\n // 0.04 - slower and less aliasing in darks\n // Special notes when using FXAA_GREEN_AS_LUMA,\n // Likely want to set this to zero.\n // As colors that are mostly not-green\n // will appear very dark in the green channel!\n // Tune by looking at mostly non-green content,\n // then start at zero and increase until aliasing is a problem.\n FxaaFloat fxaaConsoleEdgeThresholdMin,\n //\n // Extra constants for 360 FXAA Console only.\n // Use zeros or anything else for other platforms.\n // These must be in physical constant registers and NOT immedates.\n // Immedates will result in compiler un-optimizing.\n // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)\n FxaaFloat4 fxaaConsole360ConstDir\n ) {\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posM;\n posM.x = pos.x;\n posM.y = pos.y;\n #if (FXAA_GATHER4_ALPHA == 1)\n #if (FXAA_DISCARD == 0)\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #if (FXAA_GREEN_AS_LUMA == 0)\n #define lumaM rgbyM.w\n #else\n #define lumaM rgbyM.y\n #endif\n #endif\n #if (FXAA_GREEN_AS_LUMA == 0)\n FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);\n FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));\n #else\n FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);\n FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));\n #endif\n #if (FXAA_DISCARD == 1)\n #define lumaM luma4A.w\n #endif\n #define lumaE luma4A.z\n #define lumaS luma4A.x\n #define lumaSE luma4A.y\n #define lumaNW luma4B.w\n #define lumaN luma4B.z\n #define lumaW luma4B.x\n #else\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #if (FXAA_GREEN_AS_LUMA == 0)\n #define lumaM rgbyM.w\n #else\n #define lumaM rgbyM.y\n #endif\n #if (FXAA_GLSL_100 == 1)\n FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(0.0, 1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(1.0, 0.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(0.0, -1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));\n #else\n FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(0, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, 0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(0, -1), fxaaQualityRcpFrame.xy));\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n FxaaFloat maxSM = max(lumaS, lumaM);\n FxaaFloat minSM = min(lumaS, lumaM);\n FxaaFloat maxESM = max(lumaE, maxSM);\n FxaaFloat minESM = min(lumaE, minSM);\n FxaaFloat maxWN = max(lumaN, lumaW);\n FxaaFloat minWN = min(lumaN, lumaW);\n FxaaFloat rangeMax = max(maxWN, maxESM);\n FxaaFloat rangeMin = min(minWN, minESM);\n FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\n FxaaFloat range = rangeMax - rangeMin;\n FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\n FxaaBool earlyExit = range < rangeMaxClamped;\n /*--------------------------------------------------------------------------*/\n if (earlyExit)\n #if (FXAA_DISCARD == 1)\n FxaaDiscard;\n #else\n return rgbyM;\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_GATHER4_ALPHA == 0)\n #if (FXAA_GLSL_100 == 1)\n FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, -1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(1.0, 1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(1.0, -1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));\n #else\n FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n #endif\n #else\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n #endif\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNS = lumaN + lumaS;\n FxaaFloat lumaWE = lumaW + lumaE;\n FxaaFloat subpixRcpRange = 1.0 / range;\n FxaaFloat subpixNSWE = lumaNS + lumaWE;\n FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\n FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNESE = lumaNE + lumaSE;\n FxaaFloat lumaNWNE = lumaNW + lumaNE;\n FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\n FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNWSW = lumaNW + lumaSW;\n FxaaFloat lumaSWSE = lumaSW + lumaSE;\n FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\n FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\n FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\n FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\n FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\n FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\n /*--------------------------------------------------------------------------*/\n FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\n FxaaFloat lengthSign = fxaaQualityRcpFrame.x;\n FxaaBool horzSpan = edgeHorz >= edgeVert;\n FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\n /*--------------------------------------------------------------------------*/\n if (!horzSpan) lumaN = lumaW;\n if (!horzSpan) lumaS = lumaE;\n if (horzSpan) lengthSign = fxaaQualityRcpFrame.y;\n FxaaFloat subpixB = (subpixA * (1.0 / 12.0)) - lumaM;\n /*--------------------------------------------------------------------------*/\n FxaaFloat gradientN = lumaN - lumaM;\n FxaaFloat gradientS = lumaS - lumaM;\n FxaaFloat lumaNN = lumaN + lumaM;\n FxaaFloat lumaSS = lumaS + lumaM;\n FxaaBool pairN = abs(gradientN) >= abs(gradientS);\n FxaaFloat gradient = max(abs(gradientN), abs(gradientS));\n if (pairN) lengthSign = -lengthSign;\n FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posB;\n posB.x = posM.x;\n posB.y = posM.y;\n FxaaFloat2 offNP;\n offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n offNP.y = (horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n if (!horzSpan) posB.x += lengthSign * 0.5;\n if (horzSpan) posB.y += lengthSign * 0.5;\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posN;\n posN.x = posB.x - offNP.x * FXAA_QUALITYP0;\n posN.y = posB.y - offNP.y * FXAA_QUALITYP0;\n FxaaFloat2 posP;\n posP.x = posB.x + offNP.x * FXAA_QUALITYP0;\n posP.y = posB.y + offNP.y * FXAA_QUALITYP0;\n FxaaFloat subpixD = ((-2.0) * subpixC) + 3.0;\n FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\n FxaaFloat subpixE = subpixC * subpixC;\n FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\n /*--------------------------------------------------------------------------*/\n if (!pairN) lumaNN = lumaSS;\n FxaaFloat gradientScaled = gradient * 1.0 / 4.0;\n FxaaFloat lumaMM = lumaM - lumaNN * 0.5;\n FxaaFloat subpixF = subpixD * subpixE;\n FxaaBool lumaMLTZero = lumaMM < 0.0;\n /*--------------------------------------------------------------------------*/\n lumaEndN -= lumaNN * 0.5;\n lumaEndP -= lumaNN * 0.5;\n FxaaBool doneN = abs(lumaEndN) >= gradientScaled;\n FxaaBool doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP1;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP1;\n FxaaBool doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP1;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP1;\n /*--------------------------------------------------------------------------*/\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP2;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP2;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP2;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP2;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 3)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP3;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP3;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP3;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP3;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 4)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP4;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP4;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP4;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP4;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 5)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP5;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP5;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP5;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP5;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 6)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP6;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP6;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP6;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP6;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 7)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP7;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP7;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP7;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP7;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 8)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP8;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP8;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP8;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP8;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 9)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP9;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP9;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP9;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP9;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 10)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP10;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP10;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP10;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP10;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 11)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP11;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP11;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP11;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP11;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 12)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP12;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP12;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP12;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP12;\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n /*--------------------------------------------------------------------------*/\n FxaaFloat dstN = posM.x - posN.x;\n FxaaFloat dstP = posP.x - posM.x;\n if (!horzSpan) dstN = posM.y - posN.y;\n if (!horzSpan) dstP = posP.y - posM.y;\n /*--------------------------------------------------------------------------*/\n FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\n FxaaFloat spanLength = (dstP + dstN);\n FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\n FxaaFloat spanLengthRcp = 1.0 / spanLength;\n /*--------------------------------------------------------------------------*/\n FxaaBool directionN = dstN < dstP;\n FxaaFloat dst = min(dstN, dstP);\n FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\n FxaaFloat subpixG = subpixF * subpixF;\n FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\n FxaaFloat subpixH = subpixG * fxaaQualitySubpix;\n /*--------------------------------------------------------------------------*/\n FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\n FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\n if (!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\n if (horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\n #if (FXAA_DISCARD == 1)\n return FxaaTexTop(tex, posM);\n #else\n return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n #endif\n}\n/*==========================================================================*/\n#endif\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec2 screenInfo = get_screenInfo(materialSID, 0);\n rt0 = FxaaPixelShader(\n v_texcoord_0,\n vec4(0.0),\n u_baseColorTexture,\n u_baseColorTexture,\n u_baseColorTexture,\n 1.0 / screenInfo,\n vec4(0.0),\n vec4(0.0),\n vec4(0.0),\n 0.75,\n 0.166,\n 0.0833,\n 0.0,\n 0.0,\n 0.0,\n vec4(0.0)\n );\n rt0.a = 1.0;\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},D={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nout vec2 v_texcoord_0;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\nv_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},N={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord_0;\n\nuniform sampler2D u_baseColorTexture; // initialValue=(0,white)\nuniform bool u_enableLinearToSrgb; // initialValue=true\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nvec4 baseColor = texture(u_baseColorTexture, v_texcoord_0);\n\nif (get_enableLinearToSrgb(materialSID, 0)) {\n baseColor.rgb = linearToSrgb(baseColor.rgb);\n}\n\nrt0 = baseColor;\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},B={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nout vec2 v_texcoord_0;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\nv_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},L={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord_0;\n\nuniform sampler2DRect u_baseColorTexture; // initialValue=(0,white)\nuniform float u_count; // initialValue=0.0\nuniform float u_direction; // initialValue=0.0\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nfloat i = get_count(materialSID, 0);\nfloat dir = get_direction(materialSID, 0);\n\nrt0 = texture(u_baseColorTexture, gl_FragCoord.xy);\n\nif (dir > 0.0) {\n // horizontal\n rt0 += texture(u_baseColorTexture, vec2(gl_FragCoord.x + pow(2.0, i), gl_FragCoord.y));\n} else {\n // virtical\n rt0 += texture(u_baseColorTexture, vec2(gl_FragCoord.x, gl_FragCoord.y + pow(2.0, i)));\n}\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},F={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec3 v_baryCentricCoord;\n\nuniform float u_pointSize; // initialValue=30\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0,0.1,0.01)\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n\n v_color = a_color;\n v_normal_inWorld = normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},G={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec3 v_baryCentricCoord;\n\nuniform int u_shadingModel; // initialValue=0\nuniform float u_alphaCutoff; // initialValue=0.01\nuniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)\nuniform sampler2D u_diffuseColorTexture; // initialValue=(0,white)\nuniform sampler2D u_normalTexture; // initialValue=(1,blue)\nuniform vec4 u_diffuseColorTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_diffuseColorTextureRotation; // initialValue=0\n\n/* shaderity: @{renderTargetBegin} */\n\n\n\nvec2 uvTransform(vec2 scale, vec2 offset, float rotation, vec2 uv) {\n mat3 translationMat = mat3(1,0,0, 0,1,0, offset.x, offset.y, 1);\n mat3 rotationMat = mat3(\n cos(rotation), -sin(rotation), 0,\n sin(rotation), cos(rotation), 0,\n 0, 0, 1\n );\n mat3 scaleMat = mat3(scale.x,0,0, 0,scale.y,0, 0,0,1);\n\n mat3 matrix = translationMat * rotationMat * scaleMat;\n vec2 uvTransformed = ( matrix * vec3(uv.xy, 1) ).xy;\n\n return uvTransformed;\n}\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n\n\n // diffuseColor (Considered to be premultiplied alpha)\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture (Considered to be premultiplied alpha)\n vec4 diffuseColorTextureTransform = get_diffuseColorTextureTransform(materialSID, 0);\n float diffuseColorTextureRotation = get_diffuseColorTextureRotation(materialSID, 0);\n vec2 diffuseColorTexUv = uvTransform(diffuseColorTextureTransform.xy, diffuseColorTextureTransform.zw, diffuseColorTextureRotation, v_texcoord_0);\n vec4 textureColor = texture(u_diffuseColorTexture, diffuseColorTexUv);\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n\n// #pragma shaderity: require(../common/alphaMask.glsl)\n\n rt0 = vec4(diffuseColor * alpha, alpha);\n // rt0 = vec4(1.0, 0.0, 0.0, 1.0);\n\n// #pragma shaderity: require(../common/setAlphaIfNotInAlphaBlendMode.glsl)\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n\n",shaderStage:"fragment",isFragmentShader:!0},z={code:"/* shaderity: @{definitions} */\nstruct VertexOutput {\n @builtin(position) position : vec4,\n @location(0) normal : vec3,\n @location(1) texcoord_0 : vec2,\n}\n\nstruct StorageData {\n data: array>,\n}\n@binding(0) @group(0) var storageData : StorageData;\n\noverride _materialSID: u32;\n\nfn fetchElement(vec4_idx: u32) -> vec4\n{\n return storageData.data[vec4_idx];\n}\n\nfn fetchVec3No16BytesAligned(scalar_idx: u32) -> vec3 {\n let posIn4bytes = scalar_idx % 4u;\n\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n if (posIn4bytes == 0u) {\n let val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1u) {\n let val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2u) {\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.w, val1.xy);\n }\n}\n\nfn fetchVec4(vec4_idx: u32) -> vec4 {\n return fetchElement(vec4_idx);\n}\n\nfn fetchScalarNo16BytesAligned(scalar_idx: u32) -> f32 {\n let posIn4bytes = scalar_idx % 4u;\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n let val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0u) {\n return val.x;\n } else if (posIn4bytes == 1u) {\n return val.y;\n } else if (posIn4bytes == 2u) {\n return val.z;\n } else { // posIn4bytes == 3u\n return val.w;\n }\n}\n\n\n\n\nfn fetchMat4(vec4_idx: u32) -> mat4x4\n{\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n let col3 = fetchElement(vec4_idx + 3u);\n\n let val = mat4x4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\n\nfn fetchMat4x3(vec4_idx: u32) -> mat4x3 {\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n\n let val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n\n return val;\n}\n\n\n/* shaderity: @{getters} */\n/* shaderity: @{matricesGetters} */\n\n@vertex\nfn main(\n#ifdef RN_USE_INSTANCE\n @location(8) instance_ids: vec4,\n#endif\n#ifdef RN_USE_POSITION\n @location(0) position: vec3,\n#endif\n#ifdef RN_USE_NORMAL\n @location(1) normal: vec3,\n#endif\n#ifdef RN_USE_TANGENT\n @location(2) tangent: vec3,\n#endif\n#ifdef RN_USE_TEXCOORD_0\n @location(3) texcoord_0: vec2,\n#endif\n) -> VertexOutput {\nlet materialSID = _materialSID;\n\n\n var output : VertexOutput;\n\n let cameraSID = u32(get_currentComponentSIDs(0u, /* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */u));\n let worldMatrix = get_worldMatrix(u32(instance_ids.x));\n let viewMatrix = get_viewMatrix(cameraSID, 0u);\n let projectionMatrix = get_projectionMatrix(cameraSID, 0u);\n\n output.position = projectionMatrix * viewMatrix * worldMatrix * vec4(position, 1.0);\n\n#ifdef RN_USE_NORMAL\n output.normal = normalize((worldMatrix * vec4(normal, 0.0)).xyz);\n#endif\n\n#ifdef RN_USE_TEXCOORD_0\n output.texcoord_0 = texcoord_0;\n#endif\n\n // output.Position = vec4(position, 1.0);\n\n return output;\n}\n",shaderStage:"vertex",isFragmentShader:!1},V={code:"/* shaderity: @{definitions} */\nstruct VertexOutput {\n @builtin(position) position : vec4,\n @location(0) normal : vec3,\n @location(1) texcoord_0 : vec2,\n}\n\nstruct StorageData {\n data: array>,\n}\n@binding(0) @group(0) var storageData : StorageData;\n\noverride _materialSID: u32;\n\nfn fetchElement(vec4_idx: u32) -> vec4\n{\n return storageData.data[vec4_idx];\n}\n\nfn fetchVec3No16BytesAligned(scalar_idx: u32) -> vec3 {\n let posIn4bytes = scalar_idx % 4u;\n\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n if (posIn4bytes == 0u) {\n let val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1u) {\n let val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2u) {\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.w, val1.xy);\n }\n}\n\nfn fetchVec4(vec4_idx: u32) -> vec4 {\n return fetchElement(vec4_idx);\n}\n\nfn fetchScalarNo16BytesAligned(scalar_idx: u32) -> f32 {\n let posIn4bytes = scalar_idx % 4u;\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n let val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0u) {\n return val.x;\n } else if (posIn4bytes == 1u) {\n return val.y;\n } else if (posIn4bytes == 2u) {\n return val.z;\n } else { // posIn4bytes == 3u\n return val.w;\n }\n}\n\n\n\n\nfn fetchMat4(vec4_idx: u32) -> mat4x4\n{\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n let col3 = fetchElement(vec4_idx + 3u);\n\n let val = mat4x4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\n\nfn fetchMat4x3(vec4_idx: u32) -> mat4x3 {\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n\n let val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n\n return val;\n}\n\n\n/* shaderity: @{getters} */\n\n// #param diffuseColorFactor: vec4; // initialValue=(1,1,1,1)\n\n@group(1) @binding(0) var baseColorTexture: texture_2d; // initialValue=blue\n@group(2) @binding(0) var baseColorSampler: sampler;\n\n@fragment\nfn main(\n input: VertexOutput\n) -> @location(0) vec4 {\nlet materialSID = _materialSID;\n\n\n var Normal = input.normal * 0.5 + 0.5;\n // return vec4(Normal.x, Normal.y, Normal.z, 1);\n\n#ifdef RN_USE_TEXCOORD_0\n var baseColor = textureSample(baseColorTexture, baseColorSampler, input.texcoord_0);\n return baseColor;\n#else\n return vec4(1, 0, 0, 1);\n#endif\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},O={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec2 a_texcoord_1;\nin vec2 a_texcoord_2;\nin vec4 a_joint;\nin vec4 a_weight;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\nuniform float u_pointSize; // initialValue=30, soloDatum=true\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0.0, 0.1, 0.01), soloDatum=true\n\n#ifdef RN_IS_MORPHING\nuniform int u_morphTargetNumber; // initialValue=0, isCustomSetting=true, soloDatum=true, needUniformInDataTextureMode=true\n#endif\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n v_color = a_color;\n\n bool isSkinning = false;\n\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n\n",shaderStage:"vertex",isFragmentShader:!1},U={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\n\nvoid main (){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float depth = gl_FragCoord.z;\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n\n rt0.x = depth; // M1\n rt0.y = sq(depth) + 0.25 * (sq(dx) + sq(dy)); // M2\n rt0.z = 0.0;\n rt0.w = 1.0;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n\n",shaderStage:"fragment",isFragmentShader:!0};var k=n(1813),Q=n(903),W=n(2192);const X={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec3 a_position;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},q={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n// uniform bool isHorizontal; // initialValue=1\n// uniform int gaussianKernelSize; // initialValue=1\n// uniform float framebufferWidth; // initialValue=1\n// uniform sampler2D baseColorTexture; // initialValue=(0,white)\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n\tfloat tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n\n vec2 blurDirection;\n bool isHorizontal = get_isHorizontal(materialSID, 0);\n if(isHorizontal){\n blurDirection = vec2(1.0,0.0);\n }else{\n blurDirection = vec2(0.0,1.0);\n }\n\n vec4 color = vec4(0.0);\n int gaussianKernelSize = get_gaussianKernelSize(materialSID, 0);\n float minStrideLength = -float(gaussianKernelSize - 1) / 2.0;\n\n for(int i=0; i < 30; i++) {\n if(gaussianKernelSize == i) {\n break;\n }\n\n float strideLength = minStrideLength + float(i);\n vec2 stride = strideLength * blurDirection;\n\n float gaussianRatio = u_gaussianRatio[i];\n color += texture(u_baseColorTexture, (offset + stride) * tFrag) * gaussianRatio;\n }\n\n rt0 = color;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},H={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec3 a_position;\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},j={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nfloat decodeRGBAToDepth(vec4 RGBA){\n const float rMask = 1.0;\n const float gMask = 1.0 / 255.0;\n const float bMask = 1.0 / (255.0 * 255.0);\n const float aMask = 1.0 / (255.0 * 255.0 * 255.0);\n float depth = dot(RGBA, vec4(rMask, gMask, bMask, aMask));\n return depth;\n}\n\nvec4 encodeDepthToRGBA(float depth){\n float r = depth;\n float g = fract(r * 255.0);\n float b = fract(g * 255.0);\n float a = fract(b * 255.0);\n float coef = 1.0 / 255.0;\n r -= g * coef;\n g -= b * coef;\n b -= a * coef;\n return vec4(r, g, b, a);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n\tfloat tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n\n vec2 blurDirection;\n bool isHorizontal = get_isHorizontal(materialSID, 0);\n if(isHorizontal){\n blurDirection = vec2(1.0,0.0);\n }else{\n blurDirection = vec2(0.0,1.0);\n }\n\n float depth = 0.0;\n int gaussianKernelSize = get_gaussianKernelSize(materialSID, 0);\n float minStrideLength = -float(gaussianKernelSize - 1) / 2.0;\n\n for(int i=0; i < 30; i++) {\n if(gaussianKernelSize == i) {\n break;\n }\n\n float strideLength = minStrideLength + float(i);\n vec2 stride = strideLength * blurDirection;\n float depthData = decodeRGBAToDepth(texture(u_baseColorTexture, (offset + stride) * tFrag));\n if(depthData > 1.0) depthData = 1.0;\n\n float gaussianRatio = u_gaussianRatio[i];\n depth += depthData * gaussianRatio;\n }\n\n rt0 = encodeDepthToRGBA(depth);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var Y=n(3616);function K(e,t,n){let i=0,o=!1;do{const a=e+`__${i}`;if(o=Q.r.isFullOrOverOfThisMaterialType(a),!o)return Q.r.registerMaterial(a,t,n),Q.r.createMaterial(a,t);i++}while(o);return Q.r.isRegisteredMaterialType(e)||Q.r.registerMaterial(e,t,n),Q.r.createMaterial(e,t)}function J(e,t,n){return Q.r.forceRegisterMaterial(e,t,n),Q.r.createMaterial(e,t)}const Z=Object.freeze({createMaterial:K,recreateMaterial:J,recreateCustomMaterial:function(e,t,{additionalName:n="",isSkinning:o=!0,isLighting:a=!1,isMorphing:r=!1,maxInstancesNumber:s=i.D.maxMaterialInstanceForEachType}={}){const c=`Custom_${n}_`+(r?"+morphing":"")+(o?"+skinning":"")+(a?"":"-lighting"),_=new l.f({name:c,isSkinning:o,isLighting:a,isMorphing:r,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:{code:e,shaderStage:"vertex",isFragmentShader:!1},pixelShader:{code:t,shaderStage:"fragment",isFragmentShader:!0},noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});return _.isSingleOperation=!0,J(c,_,s)},recreateShaderityMaterial:function(e,t,{additionalName:n="",maxInstancesNumber:o=i.D.maxMaterialInstanceForEachType}={}){const a=`Shaderity_${n}`,r=new p.u({name:a,vertexShaderityObj:e,pixelShaderityObj:t});return r.isSingleOperation=!0,J(a,r,o)},createEmptyMaterial:function(){const e=K("Empty",void 0,i.D.maxMaterialInstanceForEachType);return e.tryToSetUniqueName("EmptyMaterial",!0),e},createClassicUberMaterial:function({additionalName:e="",isSkinning:t=!0,isLighting:n=!1,isMorphing:o=!1,isShadow:a=!1,maxInstancesNumber:r=i.D.maxMaterialInstanceForEachType}={}){const s=`ClassicUber_${e}_`+(t?"+skinning":"")+(n?"":"-lighting"),c=new l.f({name:"ClassicUber",isSkinning:t,isLighting:n,isMorphing:o,isShadow:a,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:I,pixelShader:b,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});return c.isSingleOperation=!0,K(s,c,r)},createDepthMomentEncodeMaterial:function({additionalName:e="",isSkinning:t=!0,isMorphing:n=!1,maxInstancesNumber:o=i.D.maxMaterialInstanceForEachType}={}){const a=`DepthMomentEncode_${e}_`,r=new l.f({name:"DepthMomentEncode",isSkinning:t,isLighting:!1,isMorphing:n,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:O,pixelShader:U,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});return r.isSingleOperation=!0,K(a,r,o)},createFlatMaterial:function({additionalName:e="",isSkinning:t=!0,isMorphing:n=!1,maxInstancesNumber:o=i.D.maxMaterialInstanceForEachType}={}){const a=`Flat_${e}_`+(t?"+skinning":""),r=new l.f({name:"Flat",isSkinning:t,isLighting:!1,isMorphing:n,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:F,pixelShader:G,noUseCameraTransform:!1,additionalShaderSemanticInfo:[],vertexShaderWebGpu:z,pixelShaderWebGpu:V});return r.isSingleOperation=!0,K(a,r,o)},createPbrUberMaterial:function({additionalName:e="",isMorphing:t=!0,isSkinning:n=!0,isLighting:o=!0,isClearCoat:a=!1,isTransmission:r=!1,isVolume:s=!1,isSheen:c=!1,isSpecular:_=!1,isIridescence:h=!1,isAnisotropy:u=!1,isShadow:d=!1,useTangentAttribute:m=!1,useNormalTexture:f=!0,maxInstancesNumber:p=i.D.maxMaterialInstanceForEachType}={}){const I=`PbrUber_${e}_`+(t?"+morphing":"")+(n?"+skinning":"")+(o?"":"-lighting")+(a?"+clearcoat":"")+(r?"+transmission":"")+(s?"+volume":"")+(c?"+sheen":"")+(_?"+specular":"")+(h?"+iridescence":"")+(u?"+anisotropy":"")+(m?"+tangentAttribute":"")+(f?"":"-normalTexture");let b=[];t&&(b=[{semantic:v.f5.DataTextureMorphOffsetPosition,componentType:A.r.Int,compositionType:y.d.ScalarArray,arrayLength:i.D.maxVertexMorphNumberInShader,stage:x.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new g.j(new Int32Array(i.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:v.f5.MorphWeights,componentType:A.r.Float,compositionType:y.d.ScalarArray,arrayLength:i.D.maxVertexMorphNumberInShader,stage:x.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new g.j(new Float32Array(i.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0}]);let w=8;a&&(b.push({semantic:v.f5.ClearCoatTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.ClearCoatRoughnessTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.ClearCoatNormalTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.$R],min:0,max:Number.MAX_VALUE})),r&&(b.push({semantic:v.f5.TransmissionTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.BackBufferTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.mg],min:0,max:Number.MAX_VALUE})),s&&b.push({semantic:v.f5.ThicknessTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),c&&(b.push({semantic:v.f5.SheenColorTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.SheenRoughnessTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.SheenLutTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.NB],min:0,max:Number.MAX_VALUE})),_&&(b.push({semantic:v.f5.SpecularTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.SpecularColorTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE})),h&&(b.push({semantic:v.f5.IridescenceTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.IridescenceThicknessTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE})),u&&b.push({semantic:v.f5.AnisotropyTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!0,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Lx],min:0,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0}),d&&b.push({semantic:v.f5.DepthTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE});const R=new l.f({name:"PbrUber",isSkinning:n,isLighting:o,isMorphing:t,isClearCoat:a,isTransmission:r,isVolume:s,isSheen:c,isSpecular:_,isIridescence:h,isAnisotropy:u,isShadow:d,useTangentAttribute:m,useNormalTexture:f,vertexShader:E,pixelShader:T,vertexShaderWebGpu:S,pixelShaderWebGpu:C,noUseCameraTransform:!1,additionalShaderSemanticInfo:b});return R.isSingleOperation=!0,K(I,R,p)},createEnvConstantMaterial:function({additionalName:e="",maxInstancesNumber:t=5,makeOutputSrgb:n=!0}={}){const i=`EnvConstant_${e}`,o=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!1,vertexShader:w.Z,pixelShader:R.Z,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});o.isSingleOperation=!0;const a=K(i,o,t);return a.setParameter(v.f5.MakeOutputSrgb,n?1:0),a},createFXAA3QualityMaterial:function({additionalName:e="",maxInstancesNumber:t=1,noUseCameraTransform:n=!1}={}){const i=`FXAA3Quality_${e}`,o=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:P,pixelShader:M,noUseCameraTransform:n,additionalShaderSemanticInfo:[]});return o.isSingleOperation=!0,K(i,o,t)},createDepthEncodeMaterial:function({additionalName:e="",isSkinning:t=!1,depthPow:n=1,maxInstancesNumber:i=10}={}){const a=`DepthEncode_${e}_`+(t?"+skinning":""),r=new o.Q(n,{isSkinning:t});return r.isSingleOperation=!0,K(a,r,i)},createShadowMapDecodeClassicSingleMaterial:function({additionalName:e="",isMorphing:t=!1,isSkinning:n=!1,isLighting:i=!0,isDebugging:o=!1,colorAttachmentsNumber:r=0,maxInstancesNumber:s=20}={},l){const c=`ShadowMapDecodeClassic_${e}_`+(n?"+skinning":"")+(i?"":"-lighting"),_=new a.R({isMorphing:t,isSkinning:n,isLighting:i,isDebugging:o,colorAttachmentsNumber:r},l);return _.isSingleOperation=!0,K(c,_,s)},createGammaCorrectionMaterial:function({additionalName:e="",maxInstancesNumber:t=1,noUseCameraTransform:n=!1}={}){const i=`GammaCorrection_${e}`,o=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:D,pixelShader:N,noUseCameraTransform:n,additionalShaderSemanticInfo:[]});return o.isSingleOperation=!0,K(i,o,t)},createSummedAreaTableMaterial:function({additionalName:e="",maxInstancesNumber:t=1,noUseCameraTransform:n=!1}={}){const i=`SummedAreaTable_${e}`,o=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:B,pixelShader:L,noUseCameraTransform:n,additionalShaderSemanticInfo:[]});return o.isSingleOperation=!0,K(i,o,t)},createVarianceShadowMapDecodeClassicSingleMaterial:function({additionalName:e="",isMorphing:t=!1,isSkinning:n=!1,isDebugging:i=!1,isLighting:o=!0,colorAttachmentsNumberDepth:a=0,colorAttachmentsNumberSquareDepth:r=0,depthCameraComponent:s,maxInstancesNumber:l=10},c){const _=`VarianceShadowMapDecodeShading_${e}_`+(t?"+morphing":"")+(n?"+skinning":"")+(o?"":"-lighting")+(i?"":"+debugging"),h=new f.Q({isMorphing:t,isSkinning:n,isLighting:o,isDebugging:i,colorAttachmentsNumberDepth:a,colorAttachmentsNumberSquareDepth:r,depthCameraComponent:s},c);return h.isSingleOperation=!0,K(_,h,l)},createEntityUIDOutputMaterial:function({additionalName:e="",maxInstancesNumber:t=10}={}){const n=`EntityUIDOutput_${e}`,i=new r.z;return i.isSingleOperation=!0,K(n,i,t)},createMToonMaterial:function({additionalName:e="",isMorphing:t=!1,isSkinning:n=!1,isLighting:o=!0,useTangentAttribute:a=!1,isOutline:r=!1,materialProperties:l,textures:c,samplers:_,debugMode:h,maxInstancesNumber:u=i.D.maxMaterialInstanceForEachType,makeOutputSrgb:d=!0}){const m=`MToon_${e}_`+(t?"+morphing":"")+(n?"+skinning":"")+(o?"":"-lighting")+(a?"+tangentAttribute":"")+(r?"-outline":""),f=new s.f(r,l,c,_,t,n,o,a,h,d);f.isSingleOperation=!0;const p=K(m,f,u);return f.setMaterialParameters(p,r),p},createFurnaceTestMaterial:function({additionalName:e="",maxInstancesNumber:t=1}={}){const n=`FurnaceTest_${e}`,i=new _.b;return i.isSingleOperation=!0,K(n,i,t)},createGaussianBlurForEncodedDepthMaterial:function({additionalName:e="",maxInstancesNumber:t=10,noUseCameraTransform:n=!1}={}){const i=`GaussianBlurForEncodedDepth_${e}`,o=[],a=new Float32Array(30);o.push({semantic:v.f5.IsHorizontal,componentType:A.r.Bool,compositionType:y.d.Scalar,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:Y.Ru.fromCopyNumber(1),min:0,max:1},{semantic:v.f5.GaussianRatio,componentType:A.r.Float,compositionType:y.d.ScalarArray,arrayLength:30,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:new g.j(a),min:0,max:1,needUniformInDataTextureMode:!0},{semantic:v.f5.GaussianKernelSize,componentType:A.r.Int,compositionType:y.d.Scalar,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:Y.Ru.fromCopyNumber(1),min:1,max:30},{semantic:v.f5.FramebufferWidth,componentType:A.r.Float,compositionType:y.d.Scalar,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:Y.Ru.fromCopyNumber(1),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:v.f5.BaseColorTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[0,W.mg],min:0,max:Number.MAX_SAFE_INTEGER});const r=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,isClearCoat:!1,isTransmission:!1,isVolume:!1,isSheen:!1,isSpecular:!1,isIridescence:!1,isShadow:!1,useTangentAttribute:!1,useNormalTexture:!1,vertexShader:H,pixelShader:j,noUseCameraTransform:n,additionalShaderSemanticInfo:o});return r.isSingleOperation=!0,K(i,r,t)},createDetectHighLuminanceMaterial:function({additionalName:e="",colorAttachmentsNumber:t=0,maxInstancesNumber:n=5}={},i){const o=`DetectHighLuminance_${e}_`,a=new h.t(i,t);return a.isSingleOperation=!0,K(o,a,n)},createGaussianBlurMaterial:function({additionalName:e="",maxInstancesNumber:t=10,noUseCameraTransform:n=!1}={}){const i=`GaussianBlur_${e}`,o=[],a=new Float32Array(30);o.push({semantic:v.f5.IsHorizontal,componentType:A.r.Bool,compositionType:y.d.Scalar,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:Y.Ru.fromCopyNumber(1),min:0,max:1},{semantic:v.f5.GaussianRatio,componentType:A.r.Float,compositionType:y.d.ScalarArray,arrayLength:30,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:new g.j(a),min:0,max:1,needUniformInDataTextureMode:!0},{semantic:v.f5.GaussianKernelSize,componentType:A.r.Int,compositionType:y.d.Scalar,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:Y.Ru.fromCopyNumber(1),min:1,max:30},{semantic:v.f5.FramebufferWidth,componentType:A.r.Float,compositionType:y.d.Scalar,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:Y.Ru.fromCopyNumber(1),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:v.f5.BaseColorTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[0,W.mg],min:0,max:Number.MAX_SAFE_INTEGER});const r=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,isClearCoat:!1,isTransmission:!1,isVolume:!1,isSheen:!1,isSpecular:!1,isIridescence:!1,isShadow:!1,useTangentAttribute:!1,useNormalTexture:!1,vertexShader:X,pixelShader:q,noUseCameraTransform:n,additionalShaderSemanticInfo:o});return r.isSingleOperation=!0,K(i,r,t)},createSynthesizeHDRMaterial:function({additionalName:e="",targetRegionTexture:t,maxInstancesNumber:n=1},i){const o=`SynthesizeHDR_${e}`,a=new u.d(i,t);return a.isSingleOperation=!0,K(o,a,n)},createColorGradingUsingLUTsMaterial:function({additionalName:e="",colorAttachmentsNumber:t=0,uri:n,texture:i,maxInstancesNumber:o=1},a){const r=`ColorGradingUsingLUTs_${e}`,s=new d.h(a,t,n,i);return s.isSingleOperation=!0,K(r,s,o)},createMatCapMaterial:function({additionalName:e="",isSkinning:t=!1,uri:n,texture:i,sampler:o,maxInstancesNumber:a=10}){const r=`MatCap_${e}`+(t?"+skinning":""),s=new m.S(t,n,i,o);return s.isSingleOperation=!0,K(r,s,a)},changeMaterial:function(e,t,n){const i=e.getMeshRenderer();t.material=n,i.moveStageTo(c.I.Load)}})},2749:(e,t,n)=>{n.d(t,{Z:()=>l});var i=n(3449),o=n(4252),a=n(4690),r=n(6098),s=n(3738);class l{constructor(){}static async importFromUri(e,t){var n;const o=await i.j.fetchArrayBuffer(e);return o.isErr()?new s.UG({message:"fetchArrayBuffer error",error:void 0}):await this._importGltfOrGlbFromArrayBuffers(o.unwrapForce(),null!==(n=null==t?void 0:t.files)&&void 0!==n?n:{},t,e)}static async importFromArrayBuffers(e,t){for(const n in e){const o=i.j.getExtension(n);if("gltf"===o||"glb"===o)return await this._importGltfOrGlbFromArrayBuffers(e[n],e,t)}return new s.UG({message:"no gltf or glb file found",error:void 0})}static async _importGltfOrGlbFromArrayBuffers(e,t,n,o){if(1179937895!==new DataView(e,0,20).getUint32(0,!0)){const a=i.j.arrayBufferToString(e),r=JSON.parse(a);try{const e=await this._importGltf(r,t,n,o);return new s.Ok(e)}catch(e){return new s.UG({message:"this.__importGltf error",error:void 0})}}else try{const i=await this._importGlb(e,t,n);return new s.Ok(i)}catch(e){return new s.UG({message:"this.importGlb error",error:void 0})}}static _getOptions(e,t,n){var i,o;if(null!=(null===(o=null===(i=t.asset)||void 0===i?void 0:i.extras)||void 0===o?void 0:o.rnLoaderOptions))for(const n in t.asset.extras.rnLoaderOptions)e[n]=t.asset.extras.rnLoaderOptions[n];for(const t in n)e[t]=n[t];return n&&n.loaderExtensionName&&"string"==typeof n.loaderExtensionName&&(null!=Rn[n.loaderExtensionName]?e.loaderExtension=Rn[n.loaderExtensionName].getInstance():(console.error(`${n.loaderExtensionName} not found!`),e.loaderExtension=void 0)),e}static async _importGlb(e,t,n){const o=new DataView(e,0,20);if(2!==o.getUint32(4,!0))throw new Error("invalid version field in this binary glTF file.");const a=o.getUint32(12,!0);if(1313821514!==o.getUint32(16,!0))throw new Error("invalid chunkType of chunk0 in this binary glTF file.");const r=new Uint8Array(e,20,a),s=i.j.uint8ArrayToString(r),l=JSON.parse(s),c=i.j.createDefaultGltfOptions();n=this._getOptions(c,l,n);const _=new Uint8Array(e,20+a+8);void 0===l.asset.extras&&(l.asset.extras={fileType:"glTF",version:"2"}),this._mergeExtendedJson(l,n.extendedJson),l.asset.extras.rnLoaderOptions=n;try{await this._loadInner(l,t,n,_)}catch(e){console.log("this._loadInner error in _loadAsBinaryJson",e)}return l}static async _importGltf(e,t,n,o,a){const r=(null==o?void 0:o.substring(0,null==o?void 0:o.lastIndexOf("/")))+"/";void 0===e.asset.extras&&(e.asset.extras={fileType:"glTF",version:"2"});const s=i.j.createDefaultGltfOptions();n=this._getOptions(s,e,n),this._mergeExtendedJson(e,n.extendedJson),e.asset.extras.rnLoaderOptions=n;try{await this._loadInner(e,t,n,void 0,r,a)}catch(e){console.error("this._loadInner error in _loadAsTextJson",e)}return e}static _loadInner(e,t,n,i,a,r){const s=[];return s.push(this._loadResources(i,e,t,n,a,r)),s.push(new o.n((t=>{this._loadJsonContent(e),t()}))),o.n.all(s)}static _loadJsonContent(e){this._loadDependenciesOfScenes(e),this._loadDependenciesOfNodes(e),this._loadDependenciesOfMeshes(e),this._loadDependenciesOfMaterials(e),this._loadDependenciesOfTextures(e),this._loadDependenciesOfJoints(e),this._loadDependenciesOfAnimations(e),this._loadDependenciesOfAccessors(e),this._loadDependenciesOfBufferViews(e),void 0===e.asset.extras&&(e.asset.extras={})}static _loadDependenciesOfScenes(e){for(const t of e.scenes){a.Is.undefined(t.nodesObjects)&&(t.nodesObjects=[]);for(const n of t.nodes)t.nodesObjects[n]=e.nodes[t.nodes[n]]}}static _loadDependenciesOfNodes(e){var t,n;for(const i of e.nodes){if(i.childrenObjects=null!==(t=i.childrenObjects)&&void 0!==t?t:[],i.children)for(const t of i.children)i.childrenObjects[t]=e.nodes[t];void 0!==i.mesh&&void 0!==e.meshes&&(i.meshObject=e.meshes[i.mesh]),void 0!==i.skin&&void 0!==e.skins&&(i.skinObject=e.skins[i.skin],a.Is.exist(i.skinObject)&&(a.Is.not.exist(null===(n=i.meshObject)||void 0===n?void 0:n.extras)&&(i.meshObject.extras={}),i.meshObject.extras._skin=i.skin)),void 0!==i.camera&&void 0!==e.cameras&&(i.cameraObject=e.cameras[i.camera]),void 0!==i.extensions&&void 0!==e.extensions&&void 0!==e.extensions.KHR_lights_punctual&&(i.extensions.KHR_lights_punctual.lightIndex=i.extensions.KHR_lights_punctual.light,i.extensions.KHR_lights_punctual.light=e.extensions.KHR_lights_punctual.lights[i.extensions.KHR_lights_punctual.lightIndex])}}static _loadDependenciesOfMeshes(e){var t;if(!a.Is.not.exist(e.meshes))for(const n of e.meshes)for(const i of n.primitives){if(void 0!==i.material&&(i.materialObject=e.materials[i.material]),null!=(null===(t=i.extensions)||void 0===t?void 0:t.KHR_materials_variants)){i.materialVariants=[];const t=i.extensions.KHR_materials_variants.mappings,n=e.extensions.KHR_materials_variants.variants;for(const o of t){const t=o.variants.map((e=>n[e].name)),a={materialObject:e.materials[o.material],variants:t};i.materialVariants.push(a)}}i.attributesObjects={};for(const t in i.attributes){const n=i.attributes[t],o=e.accessors[n];o.extras={toGetAsTypedArray:!0,attributeName:t},i.attributesObjects[t]=o}if(null!=i.indices&&(i.indicesObject=e.accessors[i.indices]),null!=i.targets){i.targetsObjects=[];for(const t of i.targets){const n={};for(const i in t){const o=t[i];if(o>=0){const t=e.accessors[o];t.extras={toGetAsTypedArray:!0,attributeName:i},n[i]=t}}i.targetsObjects.push(n)}}}}static _checkRnGltfLoaderOptionsExist(e){return!(!e.asset.extras||!e.asset.extras.rnLoaderOptions)}static _loadDependenciesOfMaterials(e){if(e.textures||(e.textures=[]),e.materials)for(const t of e.materials){if(t.pbrMetallicRoughness){const n=t.pbrMetallicRoughness.baseColorTexture;void 0!==n&&(n.texture=e.textures[n.index]);const i=t.pbrMetallicRoughness.metallicRoughnessTexture;void 0!==i&&(i.texture=e.textures[i.index])}const n=t.normalTexture;void 0!==n&&(n.texture=e.textures[n.index]);const i=t.occlusionTexture;void 0!==i&&(i.texture=e.textures[i.index]);const o=t.emissiveTexture;if(void 0!==o&&(o.texture=e.textures[o.index]),this._checkRnGltfLoaderOptionsExist(e)&&e.asset.extras.rnLoaderOptions.loaderExtension&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures(e,t),a.Is.exist(t.extensions)){const n=t.extensions;if(a.Is.exist(n.KHR_materials_clearcoat)){const t=n.KHR_materials_clearcoat.clearcoatTexture;void 0!==t&&(t.texture=e.textures[t.index]);const i=n.KHR_materials_clearcoat.clearcoatRoughnessTexture;void 0!==i&&(i.texture=e.textures[i.index]);const o=n.KHR_materials_clearcoat.clearcoatNormalTexture;void 0!==o&&(o.texture=e.textures[o.index])}if(a.Is.exist(n.KHR_materials_transmission)){const t=n.KHR_materials_transmission.transmissionTexture;void 0!==t&&(t.texture=e.textures[t.index])}if(a.Is.exist(n.KHR_materials_volume)){const t=n.KHR_materials_volume.thicknessTexture;void 0!==t&&(t.texture=e.textures[t.index])}if(a.Is.exist(n.KHR_materials_sheen)){const t=n.KHR_materials_sheen.sheenColorTexture;void 0!==t&&(t.texture=e.textures[t.index]);const i=n.KHR_materials_sheen.sheenRoughnessTexture;void 0!==i&&(i.texture=e.textures[i.index])}if(a.Is.exist(n.KHR_materials_specular)){const t=n.KHR_materials_specular.specularTexture;void 0!==t&&(t.texture=e.textures[t.index]);const i=n.KHR_materials_specular.specularColorTexture;void 0!==i&&(i.texture=e.textures[i.index])}if(a.Is.exist(n.KHR_materials_iridescence)){const t=n.KHR_materials_iridescence.iridescenceTexture;void 0!==t&&(t.texture=e.textures[t.index]);const i=n.KHR_materials_iridescence.iridescenceThicknessTexture;void 0!==i&&(i.texture=e.textures[i.index])}if(a.Is.exist(n.KHR_materials_anisotropy)){const t=n.KHR_materials_anisotropy.anisotropyTexture;void 0!==t&&(t.texture=e.textures[t.index])}}}}static _loadDependenciesOfTextures(e){var t,n;if(e.textures)for(const i of e.textures)(0,r.Jx)((t=>i.samplerObject=e.samplers[t]),i.sampler),null!=(null===(n=null===(t=i.extensions)||void 0===t?void 0:t.KHR_texture_basisu)||void 0===n?void 0:n.source)?(i.extensions.KHR_texture_basisu.fallbackSourceIndex=i.source,i.source=i.extensions.KHR_texture_basisu.source,i.image=e.images[i.source]):void 0!==i.source&&(i.image=e.images[i.source])}static _loadDependenciesOfJoints(e){if(e.skins)for(const t of e.skins){t.skeletonObject=e.nodes[t.skeleton],t.inverseBindMatricesObject=e.accessors[t.inverseBindMatrices],a.Is.not.exist(t.skeleton)&&(t.skeleton=t.joints[0],t.skeletonObject=e.nodes[t.skeleton]),t.jointsObjects=[];for(const n of t.joints)t.jointsObjects.push(e.nodes[n])}}static _loadDependenciesOfAnimations(e){if(e.animations)for(const t of e.animations)for(const n of t.channels)if(a.Is.exist(n.sampler)){if(n.samplerObject=t.samplers[n.sampler],n.target.nodeObject=e.nodes[n.target.node],n.samplerObject.inputObject=e.accessors[n.samplerObject.input],n.samplerObject.outputObject=e.accessors[n.samplerObject.output],a.Is.undefined(n.samplerObject.outputObject.extras)&&(n.samplerObject.outputObject.extras={}),"weights"===n.target.path){let e=n.samplerObject.outputObject.count/n.samplerObject.inputObject.count;"CUBICSPLINE"===n.samplerObject.interpolation&&(e=n.samplerObject.outputObject.count/n.samplerObject.inputObject.count/3),n.samplerObject.outputObject.extras.weightsArrayLength=e}"rotation"===n.target.path&&(n.samplerObject.outputObject.extras.quaternionIfVec4=!0)}}static _loadDependenciesOfAccessors(e){for(const t of e.accessors)if(null==t.bufferView&&(t.bufferView=0),t.bufferViewObject=e.bufferViews[t.bufferView],a.Is.exist(t.sparse)){const n=t.sparse;a.Is.exist(n)&&a.Is.exist(n.indices)&&a.Is.exist(n.values)&&(n.indices.bufferViewObject=e.bufferViews[n.indices.bufferView],n.values.bufferViewObject=e.bufferViews[n.values.bufferView])}}static _loadDependenciesOfBufferViews(e){for(const t of e.bufferViews)void 0!==t.buffer&&(t.bufferObject=e.buffers[t.buffer])}static _mergeExtendedJson(e,t){let n=null;if(t instanceof ArrayBuffer){const e=i.j.arrayBufferToString(t);n=JSON.parse(e)}else"string"==typeof t?n=JSON.parse(t):"object"==typeof t&&(n=t);Object.assign(e,n)}static _loadResources(e,t,n,r,s,l){var c;const _=[];let h;for(const a of t.buffers){let t="";if(a.uri){const e=a.uri.split("/");t=e[e.length-1]}h=void 0===a.uri?new o.n((t=>{a.buffer=e,t(e)})):a.uri.match(/^data:application\/(.*);base64,/)?new o.n((e=>{const t=i.j.dataUriToArrayBuffer(a.uri);a.buffer=new Uint8Array(t),e(t)})):n&&this.__containsFileName(n,t)?new o.n((e=>{const i=this.__getFullPathOfFileName(n,t),o=n[i];a.buffer=new Uint8Array(o),e(o)})):new o.n(i.j.loadResourceAsync(s+a.uri,!0,((e,t)=>{a.buffer=new Uint8Array(t),e(t)}),((e,t)=>{e("HTTP Error Status:"+t)}))),a.bufferPromise=h,_.push(h)}for(const r of null!==(c=t.images)&&void 0!==c?c:[])if(null==r.uri)if(a.Is.exist(e)){const o=i.j.createUint8ArrayFromBufferViewInfo(t,r.bufferView,e),a=i.j.createBlobImageUriFromUint8Array(o,r.mimeType);_.push(this.__loadImageUri(a,r,n))}else{const e=t.bufferViews[r.bufferView].bufferObject;if(a.Is.not.exist(e)){console.error("gltf2BufferView.bufferObject not found");continue}const s=e.bufferPromise,l=new o.n((e=>{s.then((o=>{const a=i.j.createUint8ArrayFromBufferViewInfo(t,r.bufferView,o),s=i.j.createBlobImageUriFromUint8Array(a,r.mimeType);this.__loadImageUri(s,r,n).then((()=>{e(o)}))}))})),c=_.indexOf(s);_[c]=l,e.bufferPromise=l}else{const e=r.uri,t=e.split("/"),o=t[t.length-1];let a;if(n&&this.__containsFileName(n,o)){const e=this.__getFullPathOfFileName(n,o),t=n[e];a=i.j.createBlobImageUriFromUint8Array(new Uint8Array(t),r.mimeType)}else a=e.match(/^data:/)?e:s+e;_.push(this.__loadImageUri(a,r,n))}if(r.defaultTextures){const e=r.defaultTextures.basePath,t=r.defaultTextures.textureInfos;for(const n of t){const t=n.fileName,o=e+t,a=i.j.getExtension(t),r=i.j.getMimeTypeFromExtension(a),s=i.j.createImageFromUri(o,r).then((e=>(e.crossOrigin="Anonymous",n.image={image:e},n.image)));_.push(s)}}return o.n.all(_,l).catch((e=>{console.log("Promise.all error",e)}))}static __containsFileName(e,t){for(const n in e){const e=n.split("/");if(e[e.length-1]===t)return!0}return!1}static __getFullPathOfFileName(e,t){for(const n in e){const e=n.split("/");if(e[e.length-1]===t)return n}}static __loadImageUri(e,t,n){var a,r;let s;return s=e.match(/basis$/)?new o.n((n=>{fetch(e,{mode:"cors"}).then((e=>{e.arrayBuffer().then((e=>{const i=new Uint8Array(e);t.basis=i,n(t)}))}))})):(null===(a=t.uri)||void 0===a?void 0:a.match(/basis$/))?new o.n((e=>{t.basis=new Uint8Array(n[t.uri]),e(t)})):e.match(/\.ktx2$/)||e.match(/^data:image\/ktx2/)||null!=t.bufferView&&"image/ktx2"===t.mimeType?new o.n((n=>{fetch(e,{mode:"cors"}).then((e=>{e.arrayBuffer().then((e=>{const i=new Uint8Array(e);t.ktx2=i,n(t)}))}))})):(null===(r=t.uri)||void 0===r?void 0:r.match(/ktx2$/))?new o.n((e=>{t.ktx2=new Uint8Array(n[t.uri]),e(t)})):i.j.createImageFromUri(e,t.mimeType).then((e=>(e.crossOrigin="Anonymous",t.image=e,t))),s}}},6694:(e,t,n)=>{n.d(t,{e:()=>W});var i=n(1350),o=n(4097),a=n(2471),r=n(9207),s=n(5467),l=n(1845),c=n(4235),_=n(8696),h=n(810),u=n(3999),d=n(128),m=n(9646),f=n(2575),p=n(7192),v=n(1564),A=n(7305),y=n(3032),x=n(1656),g=n(5704),I=n(3913),b=n(4587),E=n(2390),T=n(9840),S=n(6214),C=n(4536),w=n(5634),R=n(3258),P=n(752),M=n(9286),D=n(3616),N=n(5981),B=n(7987),L=n(4690),F=n(3449),G=n(4350),z=n(7973),V=n(6456),O=n(6683),U=n(1220),k=n(3496),Q=n(580);class W{constructor(){}static __generateGroupEntity(e){const t=z._.createGroupEntity();return this.addTags(t,e),t}static addTags(e,t){e.tryToSetTag({tag:"SourceType",value:t.asset.extras.fileType}),e.tryToSetTag({tag:"SourceTypeVersion",value:t.asset.extras.version})}static __generateMeshEntity(e){const t=z._.createMeshEntity();return this.addTags(t,e),t}static __generateCameraEntity(e){const t=z._.createCameraEntity();return this.addTags(t,e),t}static __generateLightEntity(e){const t=z._.createLightEntity();return this.addTags(t,e),t}static convertToRhodoniteObject(e){var t;e.asset.extras.rnMeshesAtGltMeshIdx=[];const n=this.createRnBuffer(e);e.asset.extras.rnMaterials={};const{rnEntities:i,rnEntitiesByNames:o}=this.__setupObjects(e,n);e.asset.extras.rnEntities=i,this._setupTransform(e,i),this._setupAnimation(e,i,n),this._setupSkeleton(e,i,n),this._setupHierarchy(e,i),this._setupAnimation(e,i,n);const a=this.__generateGroupEntity(e);if(a.tryToSetUniqueName("FileRoot",!0),a.tryToSetTag({tag:"ObjectType",value:"top"}),e.scenes[0].nodes)for(const t of e.scenes[0].nodes){const e=i[t].getSceneGraph();a.getSceneGraph().addChild(e)}if(e.asset.extras&&e.asset.extras.rnLoaderOptions){const n=e.asset.extras.rnLoaderOptions;n&&n.loaderExtension&&(null===(t=null==n?void 0:n.loaderExtension)||void 0===t?void 0:t.loadExtensionInfoAndSetToRootGroup)&&n.loaderExtension.loadExtensionInfoAndSetToRootGroup(a,e),n&&n.expression&&n.expression.tryToSetTag({tag:"gltfModel",value:e})}return a.tryToSetTag({tag:"rnEntities",value:i}),a.tryToSetTag({tag:"rnEntitiesByNames",value:o}),a.tryToSetTag({tag:"gltfModel",value:e}),L.Is.not.exist(e.extras)&&(e.extras={}),e.extras.rnEntities=i,e.extras.rnEntitiesByNames=o,U.z.importEffect(e,a),U.z.importBillboard(e,i),L.Is.exist(e.extensionsUsed)&&e.extensionsUsed.indexOf("VRMC_vrm"),a}static createRnBuffer(e){const t=[];for(const n of e.buffers){const e=new c.l({byteLength:n.byteLength,buffer:n.buffer,name:`gltf2Buffer_0_(${n.uri})`,byteAlign:4});t.push(e)}return t}static _setupTransform(e,t){for(const n in e.nodes){const i=t[n],o=e.nodes[n],l=i.getTransform();o.translation&&(l.localPosition=a.P.fromCopyArray([o.translation[0],o.translation[1],o.translation[2]])),o.scale&&(l.localScale=a.P.fromCopyArray([o.scale[0],o.scale[1],o.scale[2]])),o.rotation&&(l.localRotation=r._.fromCopy4(o.rotation[0],o.rotation[1],o.rotation[2],o.rotation[3])),o.matrix&&(l.localMatrix=s.J.fromCopyArrayColumnMajor(o.matrix))}}static _setupHierarchy(e,t){const n=t.map((e=>e.getSceneGraph()));for(const t in e.nodes){const i=parseInt(t),o=e.nodes[i];if(L.Is.exist(o.children)){const e=n[i];for(const t of o.children){const i=n[t];e.addChild(i)}}}}static _setupAnimation(e,t,n){var o;if(e.animations)for(const t of e.animations)for(const e of t.samplers)this._readBinaryFromAccessorAndSetItToAccessorExtras(e.inputObject,n),this._readBinaryFromAccessorAndSetItToAccessorExtras(e.outputObject,n);if(L.Is.exist(e.animations)&&e.animations.length>0)for(const n of e.animations)for(const e of n.channels)if(L.Is.exist(e.samplerObject)){const a=e.samplerObject.inputObject.extras.typedDataArray,r=e.samplerObject.outputObject.extras.typedDataArray,s=null!==(o=e.samplerObject.interpolation)&&void 0!==o?o:"LINEAR";let l="undefined";l="translation"===e.target.path?"translate":"rotation"===e.target.path?"quaternion":e.target.path;const c=t[e.target.node];if(L.Is.exist(c)){let t=c.tryToGetAnimation();if(L.Is.not.exist(t)&&(t=i.g.addComponentToEntity(v.c,c).getAnimation()),L.Is.exist(t)){const i=e.samplerObject.outputObject.extras.componentN;t.setAnimation(L.Is.exist(n.name)?n.name:"Untitled_Animation",l,a,r,i,A.k.fromString(s))}}}}static _setupSkeleton(e,t,n){if(null!=e.skins)for(const o in e.nodes){const a=e.nodes[o],r=t[o].getSceneGraph();let l;if(L.Is.exist(a.skinObject)){const e=t[o];if(l=i.g.addComponentToEntity(x.Y,e).getSkeletal(),L.Is.exist(a.skinObject.bindShapeMatrix)&&(l._bindShapeMatrix=s.J.fromCopyArrayColumnMajor(a.skinObject.bindShapeMatrix)),L.Is.exist(a.skinObject.skeleton)&&(r.isRootJoint=!0,L.Is.exist(a.mesh))){const e=[];for(const n of a.skinObject.joints)e.push(t[n].getSceneGraph());l.setJoints(e),L.Is.exist(a.skinObject.skeleton)?l.topOfJointsHierarchy=t[a.skinObject.skeleton].getSceneGraph():l.topOfJointsHierarchy=e[0]}for(const e of a.skinObject.joints)t[e].getSceneGraph().jointIndex=e;const c=a.skinObject.inverseBindMatricesObject;if(L.Is.exist(c)){const e=this.__getRnBufferViewAndRnAccessor(c,n[c.bufferViewObject.buffer]);l.setInverseBindMatricesAccessor(e)}}}}static __setupObjects(e,t){var n,a,r,s,l;const c=[],_=new Map;for(const h in e.nodes){const u=e.nodes[parseInt(h)];let d;if(null!=u.mesh){const i=u.mesh,a=this.__setupMesh(u,u.meshObject,i,t,e);u.name&&a.tryToSetUniqueName(u.name,!0),(null===(n=u.meshObject)||void 0===n?void 0:n.name)&&a.getComponent(o.$).tryToSetUniqueName(u.meshObject.name,!0),d=a}else if(null!=u.cameraObject){const t=this.__setupCamera(u.cameraObject,e);u.name&&t.tryToSetUniqueName(u.name,!0),d=t}else if(null===(a=u.extensions)||void 0===a?void 0:a.KHR_lights_punctual)d=this.__setupLight(u.extensions.KHR_lights_punctual.light,e);else{const t=this.__generateGroupEntity(e);u.name&&t.tryToSetUniqueName(u.name,!0),d=t}if(this.__isMorphing(u,e)){let e=[];if(u.weights)e=u.weights;else if(null===(r=u.meshObject)||void 0===r?void 0:r.weights)e=u.meshObject.weights;else{let t=0;for(const e of u.meshObject.primitives)L.Is.exist(e.targets)&&e.targets.length>t&&(t=e.targets.length);e=new Array(t).fill(0)}d=i.g.addComponentToEntity(V.x,d);const t=d.getBlendShape();t.weights=e,(null===(l=null===(s=u.meshObject)||void 0===s?void 0:s.primitives[0].extras)||void 0===l?void 0:l.targetNames)&&(t.targetNames=u.meshObject.primitives[0].extras.targetNames)}d.tryToSetTag({tag:G.j,value:h}),c.push(d),_.set(u.name,d)}return{rnEntities:c,rnEntitiesByNames:_}}static __isMorphing(e,t){var n,i,o;const a=null===(i=null===(n=t.asset.extras)||void 0===n?void 0:n.rnLoaderOptions)||void 0===i?void 0:i.defaultMaterialHelperArgumentArray[0];return!1!==(null==a?void 0:a.isMorphing)&&null!=(null===(o=e.meshObject)||void 0===o?void 0:o.primitives[0].targets)}static __setupLight(e,t){var n,i;const o=this.__generateLightEntity(t),r=o.getComponent(O.r);if(null!=e.name){r.tryToSetUniqueName(e.name,!0),r.type=w.v.fromString(e.type);let t=a.P.fromCopyArray3([1,1,1]),o=1;null!=e.color&&(t=a.P.fromCopyArray3(e.color)),null!=e.intensity&&(o=e.intensity),r.intensity=a.P.multiply(t,o),null!=e.range&&(r.range=e.range),"spot"===e.type&&(null!=(null===(n=e.spot)||void 0===n?void 0:n.innerConeAngle)&&(r.innerConeAngle=e.spot.innerConeAngle),null!=(null===(i=e.spot)||void 0===i?void 0:i.outerConeAngle)&&(r.outerConeAngle=e.spot.outerConeAngle))}return o}static __setupCamera(e,t){const n=this.__generateCameraEntity(t),i=n.getCamera();return i.direction=a.P.fromCopyArray([0,0,-1]),t.asset&&t.asset.LastSaved_ApplicationVendor&&(i.direction=a.P.fromCopyArray([1,0,0]),i.directionInner=a.P.fromCopyArray([1,0,0])),i.up=a.P.fromCopyArray([0,1,0]),i.type=m.i.fromString(e.type),i.type===m.i.Perspective?(i.aspect=e.perspective.aspectRatio?e.perspective.aspectRatio:1,i.setFovyAndChangeFocalLength(y.k.radianToDegree(e.perspective.yfov)),i.zNear=e.perspective.znear,i.zFar=e.perspective.zfar?e.perspective.zfar:1e5,i.tryToSetTag({tag:"OriginalFovY",value:i.fovy})):i.type===m.i.Orthographic&&(i.xMag=e.orthographic.xmag,i.yMag=e.orthographic.ymag,i.zNear=e.orthographic.znear,i.zFar=e.orthographic.zfar,i.tryToSetTag({tag:"OriginalXMag",value:i.xMag}),i.tryToSetTag({tag:"OriginalYMag",value:i.yMag})),i.tryToSetTag({tag:"OriginalAspect",value:i.aspect}),n}static __setupMesh(e,t,n,i,o){var a;const r=this.__generateMeshEntity(o),s=o.asset.extras.rnMeshesAtGltMeshIdx[n];let c=_.T.Triangles;const h=r.getMesh();if(null!=s)h.setMesh(s);else{const r=new S.K,s=o.asset.extras.rnLoaderOptions;null!=(null==s?void 0:s.tangentCalculationMode)&&(r.tangentCalculationMode=s.tangentCalculationMode);const u=(t,n)=>{const i=this.__setupMaterial(t,e,o,n,n.materialObject);return!1===i.isEmptyMaterial()&&W.setDefaultTextures(i,o),i},m=(t,n)=>{const i=n.materialVariants;if(!L.Is.not.exist(i))for(const a of i){const i=this.__setupMaterial(t,e,o,n,a.materialObject);!1===i.isEmptyMaterial()&&W.setDefaultTextures(i,o);for(const e of a.variants)t.setMaterialVariant(e,i)}};for(const e in t.primitives){const n=t.primitives[e];null!=n.mode&&(c=_.T.from(n.mode));const h=new l.W,f=u(h,n);let p;m(h,n);const v=new Map;if(null===(a=n.extensions)||void 0===a?void 0:a.KHR_draco_mesh_compression){if(p=this.__decodeDraco(n,i,o,v),L.Is.not.exist(p))break}else{L.Is.exist(n.indices)&&(p=this.__getRnBufferViewAndRnAccessor(n.indicesObject,i[n.indicesObject.bufferViewObject.buffer]));const e=new Map;for(const t in n.attributesObjects){const o=n.attributesObjects[t],a=i[o.bufferViewObject.buffer];let r;L.Is.exist(o.bufferView)?(r=e.get(o.bufferView),L.Is.not.exist(r)&&(r=this.__getRnBufferView(o.bufferViewObject,a),e.set(o.bufferView,r))):r=a.takeBufferView({byteLengthToNeed:0,byteStride:0}).unwrapForce();const s=this.__getRnAccessor(o,r),l=d.T.toVertexAttributeSemanticJoinedStringAsGltfStyle(d.T.fromString(o.extras.attributeName));v.set(l,s)}}if(h.setData(v,c,f,p),null!=n.targets){let e=R.D.maxMorphTargetNumber;null!=(null==s?void 0:s.maxMorphTargetNumber)&&(e=s.maxMorphTargetNumber);const t=[];for(let o=0;o=e);o++){const e=n.targetsObjects[o],a=new Map;for(const t in e){const n=e[t],o=this.__getRnBufferViewAndRnAccessor(n,i[n.bufferViewObject.buffer]),r=this.__copyRnAccessorAndBufferView(o),s=d.T.fromString(t),l=d.T.toVertexAttributeSemanticJoinedStringAsGltfStyle(s);a.set(l,r)}t.push(a)}h.setBlendShapeTargets(t)}r.addPrimitive(h)}h.setMesh(r),o.asset.extras.rnMeshesAtGltMeshIdx[n]=r}return r}static setSparseAccessor(e,t){var n,i,o,a;const r=e.bufferViewObject.bufferObject.buffer,s=e.sparse.count,l=e.sparse.indices,c=(null!==(n=l.bufferViewObject.byteOffset)&&void 0!==n?n:0)+(null!==(i=l.byteOffset)&&void 0!==i?i:0),_=this._checkBytesPerComponent(l),h=_*s,u=new DataView(r.buffer,c+r.byteOffset,h),d=this._checkDataViewMethod(l),m=e.sparse.values,f=(null!==(o=m.bufferViewObject.byteOffset)&&void 0!==o?o:0)+(null!==(a=m.byteOffset)&&void 0!==a?a:0),p=this._checkBytesPerComponent(e),v=this._checkComponentNumber(e),A=p*v*s,y=new DataView(r.buffer,f+r.byteOffset,A),x=this._checkDataViewMethod(e),g=t.getTypedArray();for(let e=0;e=2){const e=null!==(f=null===(m=n.asset.extras)||void 0===m?void 0:m.rnLoaderOptions)&&void 0!==f?f:{},t=this.__useTangentAttribute(n,i),a=this.__useNormalTexture(n),r=I.G.createPbrUberMaterial({isMorphing:S,isSkinning:C,isLighting:w,isClearCoat:L.Is.exist(null===(p=null==o?void 0:o.extensions)||void 0===p?void 0:p.KHR_materials_clearcoat),isTransmission:L.Is.exist(null===(v=null==o?void 0:o.extensions)||void 0===v?void 0:v.KHR_materials_transmission),isVolume:L.Is.exist(null===(A=null==o?void 0:o.extensions)||void 0===A?void 0:A.KHR_materials_volume),isSheen:L.Is.exist(null===(y=null==o?void 0:o.extensions)||void 0===y?void 0:y.KHR_materials_sheen),isSpecular:L.Is.exist(null===(x=null==o?void 0:o.extensions)||void 0===x?void 0:x.KHR_materials_specular),isIridescence:L.Is.exist(null===(E=null==o?void 0:o.extensions)||void 0===E?void 0:E.KHR_materials_iridescence),isAnisotropy:L.Is.exist(null===(T=null==o?void 0:o.extensions)||void 0===T?void 0:T.KHR_materials_anisotropy),isShadow:!!e.shadow,useTangentAttribute:t,useNormalTexture:a,additionalName:M,maxInstancesNumber:D}),s=this.__makeOutputSrgb(n);return L.Is.exist(s)&&r.setParameter(b.f5.MakeOutputSrgb,s),r}return I.G.createClassicUberMaterial({isSkinning:C,isLighting:w,additionalName:M,maxInstancesNumber:D})}static __isLighting(e,t){var n,i,o,a;const r=null===(o=null===(i=null===(n=null==e?void 0:e.asset)||void 0===n?void 0:n.extras)||void 0===i?void 0:i.rnLoaderOptions)||void 0===o?void 0:o.defaultMaterialHelperArgumentArray[0];return null!=(null==r?void 0:r.isLighting)?r.isLighting:null==(null===(a=null==t?void 0:t.extensions)||void 0===a?void 0:a.KHR_materials_unlit)}static __isSkinning(e,t){var n,i,o;const a=null===(o=null===(i=null===(n=null==t?void 0:t.asset)||void 0===n?void 0:n.extras)||void 0===i?void 0:i.rnLoaderOptions)||void 0===o?void 0:o.defaultMaterialHelperArgumentArray[0];return!1!==(null==a?void 0:a.isSkinning)&&null!=e.skin}static __useTangentAttribute(e,t){var n,i,o;switch(null===(o=null===(i=null===(n=null==e?void 0:e.asset)||void 0===n?void 0:n.extras)||void 0===i?void 0:i.rnLoaderOptions)||void 0===o?void 0:o.tangentCalculationMode){case 0:case 3:return!1;case 1:break;case 2:case 4:return!0}for(const e in t.attributes)if("TANGENT"===e)return!0;return!1}static __useNormalTexture(e){var t,n,i,o,a,r;const s=null===(i=null===(n=null===(t=null==e?void 0:e.asset)||void 0===t?void 0:t.extras)||void 0===n?void 0:n.rnLoaderOptions)||void 0===i?void 0:i.defaultMaterialHelperArgumentArray[0];return!1!==(null==s?void 0:s.useNormalTexture)&&0!==(null===(r=null===(a=null===(o=null==e?void 0:e.asset)||void 0===o?void 0:o.extras)||void 0===a?void 0:a.rnLoaderOptions)||void 0===r?void 0:r.tangentCalculationMode)}static __makeOutputSrgb(e){var t,n,i;const o=null===(i=null===(n=null===(t=null==e?void 0:e.asset)||void 0===t?void 0:t.extras)||void 0===n?void 0:n.rnLoaderOptions)||void 0===i?void 0:i.defaultMaterialHelperArgumentArray[0];return null==o?void 0:o.makeOutputSrgb}static __getMaterialHash(e,t,n,i){return n.material+"_isSkinning_"+this.__isSkinning(e,t)+"_isMorphing_"+this.__isMorphing(e,t)+"_isLighting_"+this.__isLighting(t,i)+"_useTangentAttribute_"+this.__useTangentAttribute(t,n)}static __setupMaterial(e,t,n,i,o){var r,s,l,c,_,h,u,d,m,f,v,A;const y=null!=(null===(r=null==o?void 0:o.extensions)||void 0===r?void 0:r.KHR_materials_unlit),x=this.__generateAppropriateMaterial(e,t,n,i,o);if(!this.__needParameterInitialization(o,x.materialTypeName))return x;const I=n.asset.extras.rnLoaderOptions,S=null==o?void 0:o.pbrMetallicRoughness;if(null!=S)!function(e,t,n,i,o){var r;const s=null!=(null===(r=o.extensions)||void 0===r?void 0:r.KHR_materials_unlit),l=e.baseColorFactor;null!=l&&t.setParameter(b.f5.BaseColorFactor,p.Lt.fromCopyArray4(l));const c=e.baseColorTexture;if(null!=c){const e=W._createTexture(c.texture,n,{autoDetectTransparency:null==i?void 0:i.autoDetectTextureTransparency}),o=W._createSampler(c.texture);t.setTextureParameter(b.f5.BaseColorTexture,e,o),null!=c.texCoord&&t.setParameter(b.f5.BaseColorTexcoordIndex,c.texCoord)}const _=o.occlusionTexture;if(null!=_&&L.Is.falsy(s)){const e=W._createTexture(_.texture,n),i=W._createSampler(_.texture);t.setTextureParameter(b.f5.OcclusionTexture,e,i),null!=_.texCoord&&t.setParameter(b.f5.OcclusionTexcoordIndex,_.texCoord),null!=_.strength&&t.setParameter(b.f5.OcclusionStrength,_.strength),W._setupTextureTransform(_,t,b.f5.OcclusionTextureTransform,b.f5.OcclusionTextureRotation)}let h=e.metallicFactor;h=s?0:null!=h?h:1;let u=e.roughnessFactor;u=s?1:null!=u?u:1,t.setParameter(b.f5.MetallicRoughnessFactor,E.FM.fromCopyArray2([h,u]));const d=e.metallicRoughnessTexture;if(null!=d&&L.Is.falsy(s)){const e=W._createTexture(d.texture,n),i=W._createSampler(d.texture);t.setTextureParameter(b.f5.MetallicRoughnessTexture,e,i),null!=d.texCoord&&t.setParameter(b.f5.MetallicRoughnessTexcoordIndex,d.texCoord)}!function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_clearcoat;if(L.Is.exist(o)){const e=L.Is.exist(o.clearcoatFactor)?o.clearcoatFactor:0;t.setParameter(b.f5.ClearCoatFactor,e);const i=o.clearcoatTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.ClearCoatTexture,e,o),null!=i.texCoord&&t.setParameter(b.f5.ClearCoatTexcoordIndex,i.texCoord),W._setupTextureTransform(i,t,b.f5.ClearCoatTextureTransform,b.f5.ClearCoatTextureRotation)}const a=L.Is.exist(o.clearcoatRoughnessFactor)?o.clearcoatRoughnessFactor:0;t.setParameter(b.f5.ClearCoatRoughnessFactor,a);const r=o.clearcoatRoughnessTexture;if(null!=r){const e=W._createTexture(r.texture,n),i=W._createSampler(r.texture);t.setTextureParameter(b.f5.ClearCoatRoughnessTexture,e,i),null!=r.texCoord&&t.setParameter(b.f5.ClearCoatRoughnessTexcoordIndex,r.texCoord),W._setupTextureTransform(r,t,b.f5.ClearCoatRoughnessTextureTransform,b.f5.ClearCoatRoughnessTextureRotation)}const s=o.clearcoatNormalTexture;if(null!=s){const e=W._createTexture(s.texture,n),i=W._createSampler(s.texture);t.setTextureParameter(b.f5.ClearCoatNormalTexture,e,i),null!=s.texCoord&&t.setParameter(b.f5.ClearCoatNormalTexcoordIndex,s.texCoord),W._setupTextureTransform(s,t,b.f5.ClearCoatNormalTextureTransform,b.f5.ClearCoatNormalTextureRotation)}}}(o,t,n);const m=function(e,t,n){var i;const o=null===(i=e.extensions)||void 0===i?void 0:i.KHR_materials_transmission;if(L.Is.exist(o)){const e=L.Is.exist(o.transmissionFactor)?o.transmissionFactor:0;t.setParameter(b.f5.TransmissionFactor,e);const i=o.transmissionTexture;if(L.Is.exist(i)){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.TransmissionTexture,e,o)}return!0}return!1}(o,t,n);i.transmission||(i.transmission=m),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_volume;if(L.Is.exist(o)){const e=o.thicknessFactor?o.thicknessFactor:0;null!=e&&t.setParameter(b.f5.ThicknessFactor,e);const i=o.thicknessTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.ThicknessTexture,e,o)}const r=o.attenuationDistance?o.attenuationDistance:0;null!=r&&t.setParameter(b.f5.AttenuationDistance,r);const s=o.attenuationColor?a.P.fromCopyArray3(o.attenuationColor):a.P.fromCopy3(1,1,1);null!=s&&t.setParameter(b.f5.AttenuationColor,s)}}(o,t,n),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_sheen;if(L.Is.exist(o)){const e=L.Is.exist(o.sheenColorFactor)?o.sheenColorFactor:[0,0,0];t.setParameter(b.f5.SheenColorFactor,a.P.fromCopyArray3(e));const i=o.sheenColorTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.SheenColorTexture,e,o)}const r=L.Is.exist(o.sheenRoughnessFactor)?o.sheenRoughnessFactor:0;t.setParameter(b.f5.SheenRoughnessFactor,r);const s=o.sheenRoughnessTexture;if(null!=s){const e=W._createTexture(s.texture,n),i=W._createSampler(s.texture);t.setTextureParameter(b.f5.SheenRoughnessTexture,e,i)}}}(o,t,n),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_specular;if(L.Is.exist(o)){const e=L.Is.exist(o.specularFactor)?o.specularFactor:1;t.setParameter(b.f5.SpecularFactor,e);const i=o.specularTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.SpecularTexture,e,o)}const r=L.Is.exist(o.SpecularColorFactor)?o.SpecularColorFactor:[1,1,1];t.setParameter(b.f5.SpecularColorFactor,a.P.fromCopyArray3(r));const s=o.SpecularColorTexture;if(null!=s){const e=W._createTexture(s.texture,n),i=W._createSampler(s.texture);t.setTextureParameter(b.f5.SpecularColorTexture,e,i)}}}(o,t,n),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_ior;if(L.Is.exist(o)){const e=L.Is.exist(o.ior)?o.ior:1.5;t.setParameter(b.f5.Ior,e)}}(o,t),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_iridescence;if(L.Is.exist(o)){const e=L.Is.exist(o.iridescenceFactor)?o.iridescenceFactor:0;t.setParameter(b.f5.IridescenceFactor,e);const i=o.iridescenceTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.IridescenceTexture,e,o)}const a=L.Is.exist(o.iridescenceIor)?o.iridescenceIor:1.3;t.setParameter(b.f5.IridescenceIor,a);const r=L.Is.exist(o.iridescenceThicknessMinimum)?o.iridescenceThicknessMinimum:100;t.setParameter(b.f5.IridescenceThicknessMinimum,r);const s=L.Is.exist(o.iridescenceThicknessMaximum)?o.iridescenceThicknessMaximum:400;t.setParameter(b.f5.IridescenceThicknessMaximum,s);const l=o.iridescenceThicknessTexture;if(null!=l){const e=W._createTexture(l.texture,n),i=W._createSampler(l.texture);t.setTextureParameter(b.f5.IridescenceThicknessTexture,e,i)}}}(o,t,n),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_anisotropy;if(L.Is.exist(o)){const e=L.Is.exist(o.anisotropyStrength)?o.anisotropyStrength:0;t.setParameter(b.f5.AnisotropyStrength,e);const i=L.Is.exist(o.anisotropyRotation)?o.anisotropyRotation:0;t.setParameter(b.f5.AnisotropyRotation,E.FM.fromCopy2(Math.cos(i),Math.sin(i)));const a=o.anisotropyTexture;if(null!=a){const e=W._createTexture(a.texture,n),i=W._createSampler(a.texture);t.setTextureParameter(b.f5.AnisotropyTexture,e,i)}}}(o,t,n),function(e,t,n){W._setupTextureTransform(e,t,b.f5.BaseColorTextureTransform,b.f5.BaseColorTextureRotation),W._setupTextureTransform(n,t,b.f5.MetallicRoughnessTextureTransform,b.f5.MetallicRoughnessTextureRotation)}(c,t,d)}(S,x,n,I,o);else{let e=T.D.Phong.index;if(null===(s=null==o?void 0:o.extras)||void 0===s?void 0:s.technique){switch(o.extras.technique){case T.D.Constant.str:e=T.D.Constant.index;break;case T.D.Lambert.str:e=T.D.Lambert.index;break;case T.D.BlinnPhong.str:e=T.D.BlinnPhong.index;break;case T.D.Phong.str:e=T.D.Phong.index}x.setParameter(b.f5.ShadingModel,D.Ru.fromCopyNumber(e))}}const C=y?[0,0,0]:null==o?void 0:o.emissiveFactor;null!=C&&x.setParameter(b.f5.EmissiveFactor,a.P.fromCopyArray3(C));const w=null==o?void 0:o.emissiveTexture;if(null!=w&&L.Is.falsy(y)){const e=W._createTexture(w.texture,n),t=W._createSampler(w.texture);x.setTextureParameter(b.f5.EmissiveTexture,e,t),parseFloat(null===(l=n.asset)||void 0===l?void 0:l.version)>=2&&null!=w.texCoord&&x.setParameter(b.f5.EmissiveTexcoordIndex,w.texCoord),W._setupTextureTransform(w,x,b.f5.EmissiveTextureTransform,b.f5.EmissiveTextureRotation)}let R=null==o?void 0:o.alphaMode;(null==I?void 0:I.alphaMode)&&(R=I.alphaMode),null!=R&&(x.alphaMode=g.F.fromGlTFString(R),x.alphaMode!==g.F.Mask||(null===(_=null===(c=n.asset.extras)||void 0===c?void 0:c.rnLoaderOptions)||void 0===_?void 0:_.__isImportVRM0x)||x.setParameter(b.f5.AlphaCutoff,D.Ru.fromCopyNumber(null!==(h=null==o?void 0:o.alphaCutoff)&&void 0!==h?h:.5))),L.Is.exist(null===(u=null==o?void 0:o.extensions)||void 0===u?void 0:u.KHR_materials_transmission)&&(x.alphaMode=g.F.Translucent);const P=null==o?void 0:o.doubleSided;if(null!=P&&(x.cullFace=!P),L.Is.exist(o.diffuseColorTexture)){const e=o.diffuseColorTexture,t=W._createTexture(e,n,{autoDetectTransparency:null==I?void 0:I.autoDetectTextureTransparency}),i=W._createSampler(e);if(x.setTextureParameter(b.f5.DiffuseColorTexture,t,i),this._checkRnGltfLoaderOptionsExist(n)&&(null===(m=null===(d=n.asset.extras)||void 0===d?void 0:d.rnLoaderOptions)||void 0===m?void 0:m.loaderExtension)){const t=n.asset.extras.rnLoaderOptions.loaderExtension;t.setUVTransformToTexture&&t.setUVTransformToTexture(x,e.samplerObject)}}if(L.Is.exist(null==o?void 0:o.diffuseColorFactor)){const e=null==o?void 0:o.diffuseColorFactor;x.setParameter(b.f5.DiffuseColorFactor,p.Lt.fromCopyArray4(e))}const M=null==o?void 0:o.normalTexture;if(null!=M&&L.Is.falsy(y)){const e=W._createTexture(M.texture,n),t=W._createSampler(M.texture);x.setTextureParameter(b.f5.NormalTexture,e,t),parseFloat(null===(f=n.asset)||void 0===f?void 0:f.version)>=2&&(null!=M.texCoord&&x.setParameter(b.f5.NormalTexcoordIndex,M.texCoord),null!=M.scale&&x.setParameter(b.f5.NormalScale,M.scale))}if(W._setupTextureTransform(M,x,b.f5.NormalTextureTransform,b.f5.NormalTextureRotation),this._checkRnGltfLoaderOptionsExist(n)){const e=null===(A=null===(v=n.asset.extras)||void 0===v?void 0:v.rnLoaderOptions)||void 0===A?void 0:A.loaderExtension;null!=(null==e?void 0:e.setupMaterial)&&e.setupMaterial(n,o,x)}return x}static _createSampler(e){var t,n,i,o;const a=new Q.Z({magFilter:L.Is.exist(null===(t=e.samplerObject)||void 0===t?void 0:t.magFilter)?N.d.from(e.samplerObject.magFilter):N.d.Linear,minFilter:L.Is.exist(null===(n=e.samplerObject)||void 0===n?void 0:n.minFilter)?N.d.from(e.samplerObject.minFilter):N.d.Linear,wrapS:L.Is.exist(null===(i=e.samplerObject)||void 0===i?void 0:i.wrapS)?N.d.from(e.samplerObject.wrapS):N.d.Repeat,wrapT:L.Is.exist(null===(o=e.samplerObject)||void 0===o?void 0:o.wrapT)?N.d.from(e.samplerObject.wrapT):N.d.Repeat});return a.create(),a}static _createTexture(e,t,{autoDetectTransparency:n=!1}={}){var i,o,a,r,s,l,c;const _=null===(i=t.asset.extras)||void 0===i?void 0:i.rnLoaderOptions,h=new f.x;h.autoDetectTransparency=n,h.autoResize=!0===(null==_?void 0:_.autoResizeTexture);const u={magFilter:L.Is.exist(null===(o=e.samplerObject)||void 0===o?void 0:o.magFilter)?N.d.from(e.samplerObject.magFilter):N.d.Linear,minFilter:L.Is.exist(null===(a=e.samplerObject)||void 0===a?void 0:a.minFilter)?N.d.from(e.samplerObject.minFilter):N.d.Linear,wrapS:L.Is.exist(null===(r=e.samplerObject)||void 0===r?void 0:r.wrapS)?N.d.from(e.samplerObject.wrapS):N.d.Repeat,wrapT:L.Is.exist(null===(s=e.samplerObject)||void 0===s?void 0:s.wrapT)?N.d.from(e.samplerObject.wrapT):N.d.Repeat},d=e.image;if(d.image){const e=d.image;!(null===(l=B.F.getWebGLResourceRepository().currentWebGLContextWrapper)||void 0===l?void 0:l.isWebGL2)&&!this.__sizeIsPowerOfTwo(e)&&this.__needResizeToPowerOfTwoOnWebGl1(u)&&(h.autoResize=!0),h.generateTextureFromImage(e),h.loadFromImgLazy()}else d.basis?h.generateTextureFromBasis(d.basis,{}):d.ktx2&&h.generateTextureFromKTX2(d.ktx2);if(d.uri)h.name=d.uri;else{const e=null===(c=d.mimeType)||void 0===c?void 0:c.split("/")[1];h.name=d.name+`.${e}`}return h}static __needResizeToPowerOfTwoOnWebGl1(e){return e.wrapS!==N.d.ClampToEdge||e.wrapT!==N.d.ClampToEdge||e.minFilter!==N.d.Linear&&e.minFilter!==N.d.Nearest}static __sizeIsPowerOfTwo(e){const t=e.width,n=e.height;return 0==(t&t-1)&&0==(n&n-1)}static __needParameterInitialization(e,t){return null!=e&&(null!=t.match(/PbrUber/)||null!=t.match(/ClassicUber/))}static _checkRnGltfLoaderOptionsExist(e){var t;return!!(null===(t=e.asset.extras)||void 0===t?void 0:t.rnLoaderOptions)}static __rewrapWithTypedArray(e,t,n,i){return new e(t.buffer,n+t.byteOffset,i)}static _checkBytesPerComponent(e){let t=0;switch(e.componentType){case 5120:case 5121:t=1;break;case 5122:case 5123:t=2;break;case 5124:case 5125:case 5126:t=4}return t}static _checkComponentNumber(e){let t=0;switch(e.type){case"SCALAR":t=1;break;case"VEC2":t=2;break;case"VEC3":t=3;break;case"VEC4":t=4;break;case"MAT4":t=16}return t}static _checkDataViewMethod(e){let t="";switch(e.componentType){case 5120:t="getInt8";break;case 5121:t="getUint8";break;case 5122:t="getInt16";break;case 5123:t="getUint16";break;case 5124:t="getInt32";break;case 5125:t="getUint32";break;case 5126:t="getFloat32"}return t}static _isSystemLittleEndian(){return!!new Uint8Array(new Uint16Array([255]).buffer)[0]}static _readBinaryFromAccessorAndSetItToAccessorExtras(e,t){var n,i,o;const a=e.bufferViewObject;let r=(null!==(n=a.byteOffset)&&void 0!==n?n:0)+(null!==(i=e.byteOffset)&&void 0!==i?i:0),s=a.bufferObject.buffer;const l=this._checkComponentNumber(e),c=this._checkBytesPerComponent(e),_=this._checkDataViewMethod(e);L.Is.not.exist(e.extras)&&(e.extras={attributeName:"",toGetAsTypedArray:!0,typedDataArray:new Float32Array,componentN:0,componentBytes:4,dataViewMethod:""}),e.extras.componentN=L.Is.exist(null===(o=e.extras)||void 0===o?void 0:o.weightsArrayLength)?e.extras.weightsArrayLength:l,e.extras.componentBytes=c,e.extras.dataViewMethod=_;const h=c*l*e.count;if(L.Is.exist(t)){const n=t[e.bufferViewObject.buffer],i=this.__getRnBufferView(a,n);s=this.__getRnAccessor(e,i).getUint8Array(),r=0}let u=new Float32Array;const d=[];if(W._isSystemLittleEndian()){let e=new Float32Array;"getFloat32"===_?e=this.__rewrapWithTypedArray(Float32Array,s,r,h/c):"getInt8"===_?e=new Int8Array(s,r,h/c):"getUint8"===_?e=new Uint8Array(s,r,h/c):"getInt16"===_?e=this.__rewrapWithTypedArray(Int16Array,s,r,h/c):"getUint16"===_?e=this.__rewrapWithTypedArray(Uint16Array,s,r,h/c):"getInt32"===_?e=this.__rewrapWithTypedArray(Int32Array,s,r,h/c):"getUint32"===_&&(e=this.__rewrapWithTypedArray(Uint32Array,s,r,h/c)),u=this.__normalizeTypedArrayToFloat32Array(_,e)}else{const t=new DataView(s.buffer,r+s.byteOffset,h),n=c*l,i=!0;for(let o=0;o{if(L.Is.exist(t.children))for(const a of t.children){const t=n[a];L.Is.exist(t)&&(o.getSceneGraph().addChild(t.getSceneGraph()),i(e.nodes[a],t))}};for(const i of e.nodes)if(L.Is.exist(i.skinObject)){const e=i.skinObject.joints;for(const i of e){const e=t[i],o=z._.createGroupEntity();o.getTransform().localMatrix=e.getTransform().localMatrix,n[i]=o}}for(const t of e.nodes)if(L.Is.exist(t.skinObject)){const e=n[t.skinObject.joints[0]];i(t.skinObject.jointsObjects[0],e)}for(let i=0;i{n.d(t,{z:()=>c});var i=n(7015),o=n(1409),a=n(1350),r=n(1296),s=n(3449),l=n(4690);class c{static importBillboard(e,t){if(!l.Is.not.exist(e.extensionsUsed)&&-1!==e.extensionsUsed.findIndex((e=>"RHODONITE_billboard"===e)))for(const n in e.nodes){const i=t[n],o=e.nodes[n],a=i.getSceneGraph();void 0!==o.extensions&&void 0!==o.extensions.RHODONITE_billboard&&!0===o.extensions.RHODONITE_billboard.isBillboard&&(a.isBillboard=!0)}}static importEffect(e,t){if(l.Is.not.exist(e.extensions)||l.Is.not.exist(e.extensions.RHODONITE_effekseer)||-1===e.extensionsUsed.findIndex((e=>"RHODONITE_effekseer"===e)))return;const o=t.getTagValue("rnEntities"),r=e.extensions.RHODONITE_effekseer.effects;for(const t of r){const r=o[t.node],c=a.g.addComponentToEntity(i.D,r),h=c.getEffekseer();h.playJustAfterLoaded=!0,h.isLoop=!0,l.Is.exist(t.bufferView)?e.buffers[0].bufferPromise.then((n=>{const i=s.j.createUint8ArrayFromBufferViewInfo(e,t.bufferView,n);h.arrayBuffer=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),h.type="efkpkg"})):l.Is.exist(t.uri)?(h.uri=t.uri,h.type="efk"):console.error("No real effect data."),_(c,t);const u=n(6893).Zlib.Unzip;i.D.Unzip=u}}}function _(e,t){const n=e.getComponentByComponentTID(o.zz.EffekseerComponentTID);if(l.Is.exist(n)&&(n.playJustAfterLoaded=!0,n.isLoop=!0,l.Is.exist(t.timelines))){const n=t.timelines;for(const t of n){const n=t.values,i=t.name,s=n.map((e=>({input:e.input,event:e.event})));let c,_=e.tryToGetAnimation();l.Is.not.exist(_)&&(c=a.g.addComponentToEntity(o.cw,e)),_=c.getAnimation(),_.setAnimation(l.Is.exist(i)?i:"Default","effekseer",new Float32Array(s.map((e=>e.input))),new Float32Array(s.map((e=>"play"===e.event?1:(e.event,0)))),1,r.kO.Step,!0)}}}},8583:(e,t,n)=>{n.d(t,{mNG:()=>M.mN,qfN:()=>xe.qf,lam:()=>r.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i:()=>M.Ff,Upt:()=>M.Up,Dq2:()=>M.Dq,VIV:()=>M.VI,hxV:()=>M.hx,JIQ:()=>M.JI,EYp:()=>jn.EY,fKE:()=>M.fK,lxk:()=>M.lx,tSN:()=>be.tS,JxS:()=>be.WF,t0P:()=>be.t0,fK9:()=>be.fK,OBD:()=>be.OB,bhs:()=>be.bh,ZsA:()=>be.Zs,fYc:()=>be.fY,eD0:()=>be.eD,Cb2:()=>Ft.Cb,iCj:()=>qn.iC,lsI:()=>qn.ls,QjB:()=>be.Qj,nsy:()=>M.ns,p8g:()=>M.eI,n5i:()=>M.n5,QUJ:()=>M.QU,XgD:()=>M.Xg,vVE:()=>be.vV,YUA:()=>be.YU,ozT:()=>be.oz,EY5:()=>be.EY,Rlh:()=>M.Rl,_7O:()=>M._7,NBV:()=>Ft.NB,PjQ:()=>qn.Pj,wv6:()=>be.wv,kSU:()=>be.kS});var i=n(3658),o=n(6547),a=n(4478),r=n(1409),s=n(9721),l=n(2404),c=n(3258),_=n(1328),h=n(1350),u=n(7348),d=n(9286),m=n(9002),f=n(1296);const p=Symbol();class v{constructor(e){this.__raw=e}}Object.defineProperty(v.prototype,"getComponentFromEntities",{enumerable:!1,writable:!1,configurable:!0,value:function(e){const t=this.__raw,n=[];return t.forEach((t=>{const i=t.getComponentByComponentTID(e.componentTID);null!=i&&n.push(i)})),n}});const A=()=>{Object.defineProperty(Array.prototype,"Rn",{enumerable:!1,configurable:!1,get(){return new v(this)}})};var y=n(4587),x=n(4690),g=n(4350),I=n(3999),b=n(3449),E=n(7461),T=n(810),S=n(8491),C=n(4710);function w(e,t){let n=!1;const i=e.extras.bufferViewByteLengthAccumulatedArray.length-1,o=[];for(let a=0;a.5?"play":"pause"};o.push(i)}const a={name:t,values:o};i.push(a)}}}t.timelines=i}}var P=n(7192),M=n(4020);const D=n(5337).Z,N="glTF",B="glTF-Binary",L="glTF-Draco",F="glTF-Embedded",G="No-Download";class z{constructor(){}static async export(e,t={entities:void 0,type:B}){const{collectedEntities:n,topLevelEntities:i}=this.__collectEntities(t),{json:o,fileName:a}=this.__createJsonBase(e);this.__createBufferViewsAndAccessors(o,n),this.__createNodes(o,n,i),await this.__createMaterials(o,n,t),w(o,n);const r=this.__createBinary(o);this.__deleteEmptyArrays(o);const s=function(e,t){delete e.buffers[0].uri;let n=JSON.stringify(e,null,2),i=b.j.stringToBuffer(n);const o=b.j.calcPaddingBytes(i.byteLength,4);if(o>0){for(let e=0;e{if(x.Is.exist(e)&&x.Is.exist(e.excludeTags)){for(const n of e.excludeTags)if(t.matchTag(n.tag,n.value))return!1;if(t.matchTag("Being","gizmo"))return!0}return!0},n=t=>{if(x.Is.exist(e)&&x.Is.exist(e.excludeTags))for(const n of e.excludeTags)if(t.matchTag(n.tag,n.value))return[];return[t]},i=(e,t)=>{const o=e.getSceneGraph();if(o.children.length>0){const a=t?[]:n(e);for(let e=0;e0){const n=e.entities.flatMap((e=>i(e,!0)));let o=[];e.entities.forEach((e=>{-1===n.indexOf(e)&&t(e)&&o.push(e)}));let a=e.entities.concat();return Array.prototype.push.apply(a,n),a=[...new Set(a)],0===o.length&&(o=a),{collectedEntities:a,topLevelEntities:o}}let o=h.g._getEntities();o=o.filter((e=>t(e)));let a=S.a.getTopLevelComponents().flatMap((e=>e.entity));return a=a.filter((e=>t(e))),o=o.flatMap((e=>i(e,!0))),Array.prototype.push.apply(o,a),o=[...new Set(o)],{collectedEntities:o,topLevelEntities:a}}static __createJsonBase(e){const t=e||"Rhodonite_"+(new Date).getTime();return{json:{asset:{version:"2.0",generator:`Rhodonite (${D.version})`},buffers:[{uri:t+".bin",byteLength:0}],bufferViews:[],accessors:[],animations:[],meshes:[],skins:[],materials:[{pbrMetallicRoughness:{baseColorFactor:[1,1,1,1]}}],textures:[],images:[],extensionsUsed:[],extensions:{},extras:{rnSkins:[],bufferViewByteLengthAccumulatedArray:[]},cameras:[],samplers:[]},fileName:t}}static __createBufferViewsAndAccessors(e,t){const n=[],i=[],o=[];!function(e,t,n,i,o){for(let a=0;a{e.entity===t&&l.push(n)}));const c=r.getInverseBindMatricesAccessor();x.Is.exist(c)&&(te(e,n,i,c.bufferView),ne(e,e.bufferViews.length-1,o,c));const _=r.topOfJointsHierarchy,h=r._bindShapeMatrix;let u=-1;if(x.Is.exist(_)){const e=_.entity;u=t.indexOf(e)}else u=l[0];const d={joints:l,inverseBindMatrices:e.accessors.length-1,skeleton:u>=0?u:void 0,bindShapeMatrix:null==h?void 0:h.flattenAsArray()};e.skins.push(d)}}(e,t,n,i,o)}static __createNodes(e,t,n){e.nodes=[],e.scenes=[{nodes:[]}];const i=e.scenes[0];for(let e=0;e0){a.children=[];for(let e=0;e0&&(a.weights=e)}const h=i.tryToGetSkeletal();if(x.Is.exist(h)){const t=e.extras.rnSkins.indexOf(h.entity);t>=0&&(a.skin=t)}const u=i.tryToGetCamera();if(x.Is.exist(u)){let t;if(u.type===f.iM.Perspective){const e=u.getTagValue("OriginalAspect"),n=u.getTagValue("OriginalFovY");t={name:u.entity.uniqueName,type:"perspective",perspective:{aspectRatio:x.Is.exist(e)?e:u.aspect,yfov:x.Is.exist(n)?M.kj.degreeToRadian(n):M.kj.degreeToRadian(u.fovy),znear:u.zNear,zfar:u.zFar}}}else if(u.type===f.iM.Orthographic){const e=u.getTagValue("OriginalXMag"),n=u.getTagValue("OriginalYMag");t={name:u.entity.uniqueName,type:"orthographic",orthographic:{xmag:x.Is.exist(e)?e:u.xMag,ymag:x.Is.exist(n)?n:u.yMag,znear:u.zNear,zfar:u.zFar}}}e.cameras.push(t),a.camera=e.cameras.length-1}}n.forEach(((e,n)=>{const o=t.indexOf(e);o>=0&&i.nodes.push(o)}))}static async __createMaterials(e,t,n){let i=0;const o=[];e.extras.bufferViewByteLengthAccumulatedArray.push(0);const a=e.extras.bufferViewByteLengthAccumulatedArray.length-1;for(let r=0;r{if(i&&i.width>1&&i.height>1){let s=e.images.length,l=!1;for(let t=0;t(0,g.C)(t,e))),-1===c&&(e.samplers.push(t),c=e.samplers.length-1)}if(!l){const r={uri:i.name};r.rnTextureUID=i.textureUID,-1!==t.indexOf(i.name)&&(r.uri+="_"+i.textureUID),t.push(r.uri),x.Is.not.exist(r.uri.match(/\.(png)/))&&(r.uri+=".png");const s=i.htmlCanvasElement;if(s){const t=new Promise(((t,i)=>{s.toBlob((o=>{if(!x.Is.exist(o))throw Error("canvas to blob error!");J(e,a,o,n,r,t,i)}))}));o.push(t)}e.images.push(r)}const _={sampler:c,source:s};return-1===e.textures.indexOf(_)&&e.textures.push(_),e.textures.indexOf(_)}};let r,s=c.getParameter(y.f5.BaseColorTexture);if(null!=s)r=i(s[1],s[2]),null!=r&&(_.pbrMetallicRoughness.baseColorTexture={index:r});else if(s=c.getParameter(y.f5.DiffuseColorTexture),null!=s){const e=i(s[1],s[2]);null!=e&&(_.pbrMetallicRoughness.diffuseColorTexture={index:e})}s=c.getParameter(y.f5.MetallicRoughnessTexture),s&&(r=i(s[1],s[2]),null!=r&&(_.pbrMetallicRoughness.metallicRoughnessTexture={index:r})),s=c.getParameter(y.f5.NormalTexture),s&&(r=i(s[1],s[2]),null!=r&&(_.normalTexture={index:r})),s=c.getParameter(y.f5.OcclusionTexture),s&&(r=i(s[1],s[2]),null!=r&&(_.occlusionTexture={index:r})),s=c.getParameter(y.f5.EmissiveTexture),s&&(r=i(s[1],s[2]),null!=r&&(_.emissiveTexture={index:r}))}-1===e.materials.indexOf(_)&&e.materials.push(_),l.material=e.materials.indexOf(_)}}}return Promise.all(o)}static __createBinary(e){if(x.Is.undefined(e.accessors)||x.Is.undefined(e.bufferViews))return new ArrayBuffer(0);const t=e.extras.bufferViewByteLengthAccumulatedArray.reduce(((e,t)=>e+t));t>0&&(e.buffers[0].byteLength=t+b.j.calcPaddingBytes(t,4));const n=new ArrayBuffer(e.buffers[0].byteLength);let i=0;for(let t=0;te.isSame(t)))}function k(e,t){0===e.length&&e.push(t);const n=e.findIndex((e=>e.isSame(t))),i=-1===n?e.length:n;return-1===n&&e.push(t),i}function Q(e,t,n){return x.Is.exist(e[t])?e[t]+b.j.addPaddingBytes(n.byteLength,4):b.j.addPaddingBytes(n.byteLength,4)}function W(e){switch(e){case"translate":return"translation";case"quaternion":return"rotation";case"scale":return"scale";case"weights":return"weights";default:throw new Error("Invalid Path Name")}}function X(e,t,n,i){const o={sampler:t++,target:{path:W(e.target.pathName),node:i}};return n.channels.push(o),t}function q(e,t,n,i){const o={input:e,output:t,interpolation:n.sampler.interpolationMethod.GltfString};i.samplers.push(o)}function H(e,t,n,i){const o=I.r.fromTypedArray(ArrayBuffer.isView(t.sampler.input)?t.sampler.input:new Float32Array(t.sampler.input)),a=t.sampler.input.length,r=$({bufferIdx:n,bufferViewByteOffset:i,accessorByteOffset:0,accessorCount:a,bufferViewByteStride:I.r.Float.getSizeInBytes(),componentType:o,compositionType:T.d.Scalar,uint8Array:new Uint8Array(ArrayBuffer.isView(t.sampler.input)?t.sampler.input.buffer:new Float32Array(t.sampler.input).buffer)});e.bufferViews.push(r);const s=ee({bufferViewIdx:e.bufferViews.indexOf(r),accessorByteOffset:0,componentType:o,count:a,compositionType:T.d.Scalar,min:[t.sampler.input[0]],max:[t.sampler.input[t.sampler.input.length-1]]});return e.accessors.push(s),i=Y(0,r),{inputAccessorIdx:e.accessors.indexOf(s),inputBufferViewByteLengthAccumulated:i}}function j(e,t,n,i){const o=I.r.fromTypedArray(ArrayBuffer.isView(t.sampler.output)?t.sampler.output:new Float32Array(t.sampler.output)),a=t.target.pathName;let r=T.d.toGltf2AnimationAccessorCompositionType(t.sampler.outputComponentN),s=t.sampler.output.length/t.sampler.outputComponentN;"weights"===a&&(r=T.d.Scalar,s=t.sampler.output.length);const l=$({bufferIdx:n,bufferViewByteOffset:i,accessorByteOffset:0,accessorCount:s,bufferViewByteStride:o.getSizeInBytes()*t.sampler.outputComponentN,componentType:o,compositionType:r,uint8Array:new Uint8Array(ArrayBuffer.isView(t.sampler.output)?t.sampler.output.buffer:new Float32Array(t.sampler.output).buffer)});e.bufferViews.push(l);const c=ee({bufferViewIdx:e.bufferViews.indexOf(l),accessorByteOffset:0,componentType:o,count:s,compositionType:r});return e.accessors.push(c),i=Y(0,l),{outputAccessorIdx:e.accessors.indexOf(c),outputBufferViewByteLengthAccumulated:i}}function Y(e,t){return t.byteLength+b.j.calcPaddingBytes(t.byteLength,4)}function K(e){return e%4==0?e:e+(4-e%4)}async function J(e,t,n,i,o,a,r){if(i.type===N)setTimeout((()=>{const e=document.createElement("a"),t=new MouseEvent("click");e.href=URL.createObjectURL(n),e.download=o.uri,e.dispatchEvent(t),URL.revokeObjectURL(e.href)}),5e3*Math.random()),a();else{const i=new FileReader;i.addEventListener("load",(()=>{const n=i.result,r=Z(e,t,new Uint8ClampedArray(n));o.bufferView=e.bufferViews.indexOf(r),o.mimeType="image/png",delete o.uri,a()})),i.addEventListener("error",(()=>{r(i.error)})),i.readAsArrayBuffer(n)}}function Z(e,t,n){const i=e.extras.bufferViewByteLengthAccumulatedArray[t],o={buffer:t,byteLength:n.byteLength,byteOffset:i,extras:{uint8Array:n}},a=b.j.addPaddingBytes(o.byteLength,4)+i;return e.bufferViews.push(o),e.extras.bufferViewByteLengthAccumulatedArray[t]=a,o}function $({bufferIdx:e,bufferViewByteOffset:t,accessorByteOffset:n,accessorCount:i,bufferViewByteStride:o,componentType:a,compositionType:r,uint8Array:s}){const l=K(n),{fixedBufferViewByteLength:c,fixedBufferViewByteOffset:_}=function({accessorByteOffset:e,accessorCount:t,bufferViewByteStride:n,bufferViewByteOffset:i,sizeOfComponent:o,numberOfComponents:a}){const r=0===n?o*a:n;if(n%o!=0)throw Error("glTF2: When byteStride is defined, it MUST be a multiple of the size of the accessor’s component type.");const s=(_=r)%4==0?_:_+(4-_%4),l=K(e),c=o*a;var _;return{fixedBufferViewByteLength:l+s*(t-1)+o*a,fixedBufferViewByteOffset:K(i+(c-(l+i)%c))}}({accessorByteOffset:l,accessorCount:i,bufferViewByteStride:o,bufferViewByteOffset:t,sizeOfComponent:a.getSizeInBytes(),numberOfComponents:r.getNumberOfComponents()});return{buffer:e,byteLength:c,byteOffset:_,extras:{uint8Array:s}}}function ee({bufferViewIdx:e,accessorByteOffset:t,componentType:n,count:i,compositionType:o,min:a,max:r}){return{bufferView:e,byteOffset:K(t),componentType:I.r.toGltf2AccessorComponentType(n),count:i,type:o.str,min:a,max:r,extras:{}}}function te(e,t,n,i,o){const a=U(n,i);if(-1===a){const a=k(t,i.buffer),r={buffer:a,byteLength:i.byteLength,byteOffset:i.byteOffsetInBuffer,extras:{uint8Array:i.getUint8Array()}};return x.Is.exist(o)&&(r.target=o),e.extras.bufferViewByteLengthAccumulatedArray[a]=Q(e.extras.bufferViewByteLengthAccumulatedArray,a,r),n.push(i),e.bufferViews.push(r),r}return e.bufferViews[a]}function ne(e,t,n,i){const o=function(e,t){return e.findIndex((e=>e.isSame(t)))}(n,i);if(-1===o){const o={bufferView:t,byteOffset:i.byteOffsetInBufferView,componentType:I.r.toGltf2AccessorComponentType(i.componentType),count:i.elementCount,type:T.d.toGltf2AccessorCompositionTypeString(i.compositionType.getNumberOfComponents()),extras:{uint8Array:void 0}};return i.compositionType.getNumberOfComponents()<=4&&(o.max=i.max,o.min=i.min),n.push(i),e.accessors.push(o),o}return e.accessors[o]}var ie=n(128),oe=n(8696),ae=n(3713);class re extends ae.A{generate(e){var t;const n={length:null!==(t=e.length)&&void 0!==t?t:1,material:e.material},i=[new Float32Array([0,0,0,n.length,0,0,0,0,0,0,n.length,0,0,0,0,0,0,n.length]),new Float32Array([1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1])],o=[ie.T.Position.XYZ,ie.T.Color0.XYZ];this.copyVertexData({attributes:i,attributeSemantics:o,primitiveMode:oe.T.Lines,material:n.material})}}var se=n(7597);class le extends ae.A{generate(e){var t,n,i,o,a;const r={length:null!==(t=e.length)&&void 0!==t?t:1,division:null!==(n=e.division)&&void 0!==n?n:10,isXY:null===(i=e.isXY)||void 0===i||i,isXZ:null===(o=e.isXZ)||void 0===o||o,isYZ:null===(a=e.isYZ)||void 0===a||a,material:e.material},s=[];for(let e=0;e<2*r.division+3;e++){const t=-r.length,n=r.length/(r.division+1);r.isXZ&&(s.push(-r.length,0,t+n*e),s.push(r.length,0,t+n*e),s.push(t+n*e,0,-r.length),s.push(t+n*e,0,r.length)),r.isXY&&(s.push(-r.length,t+n*e,0),s.push(r.length,t+n*e,0),s.push(t+n*e,-r.length,0),s.push(t+n*e,r.length,0)),r.isYZ&&(s.push(0,-r.length,t+n*e),s.push(0,r.length,t+n*e),s.push(0,t+n*e,-r.length),s.push(0,t+n*e,r.length))}const l=[new Float32Array(s)],c=[ie.T.Position.XYZ];this.copyVertexData({attributes:l,attributeSemantics:c,primitiveMode:oe.T.Lines,material:null==r?void 0:r.material})}}var ce=n(2471);class _e extends ae.A{constructor(){super(...arguments),this.__worldPositionOfThisJoint=ce.P.fromCopyArray3([0,0,1]),this.__worldPositionOfParentJoint=ce.P.fromCopyArray3([0,0,0]),this.__width=1}generate(e){const t=ce.P.lengthBtw(this.__worldPositionOfThisJoint,this.__worldPositionOfParentJoint),n=this.__width,i=t-t/7.5,o=ce.P.subtract(this.__worldPositionOfParentJoint,this.__worldPositionOfThisJoint);let a=ce.P.fromCopyArray3([0,1,0]);o.isEqual(ce.P.zero())||(a=ce.P.normalize(ce.P.subtract(this.__worldPositionOfParentJoint,this.__worldPositionOfThisJoint)));const r=ce.P.add(this.__worldPositionOfThisJoint,ce.P.multiply(a,i));let s=ce.P.fromCopyArray3([0,1,0]),l=ce.P.fromCopyArray3([0,-1,0]);Math.abs(ce.P.dot(a,s))>.4&&(s=ce.P.fromCopyArray3([1,0,0]),l=ce.P.fromCopyArray3([-1,0,0])),Math.abs(ce.P.dot(a,s))>.4&&(s=ce.P.fromCopyArray3([0,0,1]),l=ce.P.fromCopyArray3([0,0,-1]));const c=ce.P.multiply(ce.P.normalize(ce.P.cross(a,s)),n),_=ce.P.multiply(ce.P.normalize(ce.P.cross(a,c)),n),h=ce.P.multiply(ce.P.normalize(ce.P.cross(a,l)),n),u=ce.P.multiply(ce.P.normalize(ce.P.cross(a,h)),n),d=ce.P.add(r,c),m=ce.P.add(r,_),f=ce.P.add(r,h),p=ce.P.add(r,u),v=[];v.push(this.__worldPositionOfThisJoint),v.push(d),v.push(this.__worldPositionOfThisJoint),v.push(m),v.push(this.__worldPositionOfThisJoint),v.push(f),v.push(this.__worldPositionOfThisJoint),v.push(p),v.push(d),v.push(m),v.push(m),v.push(f),v.push(f),v.push(p),v.push(p),v.push(d),v.push(this.__worldPositionOfParentJoint),v.push(d),v.push(this.__worldPositionOfParentJoint),v.push(m),v.push(this.__worldPositionOfParentJoint),v.push(f),v.push(this.__worldPositionOfParentJoint),v.push(p);const A=[];v.map((e=>{Array.prototype.push.apply(A,e.flattenAsArray())}));const y=[new Float32Array(A)],x=[ie.T.Position.XYZ];this.copyVertexData({attributes:y,attributeSemantics:x,primitiveMode:oe.T.Lines,material:null==e?void 0:e.material})}}class he extends ae.A{generate(e){var t,n,i;const o={startPos:null!==(t=e.startPos)&&void 0!==t?t:ce.P.fromCopy3(0,0,0),endPos:null!==(n=e.endPos)&&void 0!==n?n:ce.P.fromCopy3(1,0,0),hasTerminalMark:null===(i=e.hasTerminalMark)||void 0===i||i,material:e.material},a=[];if(a.push(...o.startPos.flattenAsArray()),a.push(...o.endPos.flattenAsArray()),o.hasTerminalMark){const e=.1*o.startPos.lengthTo(o.endPos);a.push(o.startPos.x-e,o.startPos.y,o.startPos.z),a.push(o.startPos.x+e,o.startPos.y,o.startPos.z),a.push(o.startPos.x,o.startPos.y,o.startPos.z-e),a.push(o.startPos.x,o.startPos.y,o.startPos.z+e),a.push(o.endPos.x-e,o.endPos.y,o.endPos.z),a.push(o.endPos.x+e,o.endPos.y,o.endPos.z),a.push(o.endPos.x,o.endPos.y,o.endPos.z-e),a.push(o.endPos.x,o.endPos.y,o.endPos.z+e)}const r=[new Float32Array(a)],s=[ie.T.Position.XYZ];this.copyVertexData({attributes:r,attributeSemantics:s,primitiveMode:oe.T.Lines,material:o.material})}}var ue=n(9561);class de extends ae.A{constructor(){super()}generate(e){var t,n,i;const o={radius:null!==(t=e.radius)&&void 0!==t?t:1,widthSegments:null!==(n=e.widthSegments)&&void 0!==n?n:10,heightSegments:null!==(i=e.heightSegments)&&void 0!==i?i:10,material:e.material},a=[],r=[],s=[];Math.abs(o.radius){const t=new ue.J;t.generate(e);const n=De(t);return be.Is.not.exist(e.direction)&&(e.direction="xz"),"xy"===e.direction?n.localEulerAngles=ce.P.fromCopy3(Math.PI/2,0,0):"yz"===e.direction&&(n.localEulerAngles=ce.P.fromCopy3(0,0,Math.PI/2)),n},createLine:(e={})=>{const t=new he;return t.generate(e),De(t)},createGrid:(e={})=>{const t=new le;return t.generate(e),De(t)},createCube:(e={})=>{var t;const n=new se.X;n.generate(e);const i=De(n);if(be.Is.exist(e.physics)&&e.physics.use){const n=h.g.addComponentToEntity(Ee.Z,i),o=n.getPhysics(),a=new Te.q,r={type:Me.Box,size:null!==(t=e.widthVector)&&void 0!==t?t:ce.P.fromCopy3(1,1,1),position:ce.P.fromCopy3(0,0,0),rotation:ce.P.fromCopy3(0,0,0),move:e.physics.move,density:e.physics.density,friction:e.physics.friction,restitution:e.physics.restitution};a.setShape(r,n),o.setStrategy(a)}return i},createCubes:(e,t={})=>{var n;const i=new se.X;i.generate(t);const o=new ve.K;o.addPrimitive(i);const a=[];for(let i=0;i{const t=new de;t.generate(e);const n=De(t);if(be.Is.exist(e.physics)&&e.physics.use){const t=h.g.addComponentToEntity(Ee.Z,n),i=t.getPhysics(),o=new Te.q,a={type:Me.Sphere,size:be.Is.exist(e.radius)?ce.P.fromCopy3(e.radius,e.radius,e.radius):ce.P.fromCopy3(1,1,1),position:ce.P.fromCopy3(0,0,0),rotation:ce.P.fromCopy3(0,0,0),move:e.physics.move,density:e.physics.density,friction:e.physics.friction,restitution:e.physics.restitution};o.setShape(a,t),i.setStrategy(o)}return n},createSpheres:(e,t={})=>{const n=new de;n.generate(t);const i=new ve.K;i.addPrimitive(n);const o=[];for(let n=0;n{const t=new _e;return t.generate(e),De(t)},createAxis:(e={})=>{const t=new re;return t.generate(e),De(t)},createShape:De});var Be=n(7987),Le=n(8422),Fe=n(4392);class Ge extends m.S{constructor(){super(),this.__colorAttachments=[],this.cgApiResourceUid=Be.F.InvalidCGAPIResourceUid,this.width=0,this.height=0,this.__colorAttachmentMap=new Map}get colorAttachmentsRenderBufferTargets(){return Array.from(this.__colorAttachmentMap.keys())}get colorAttachments(){return this.__colorAttachments}get depthAttachment(){return this.__depthAttachment}get stencilAttachment(){return this.__stencilAttachment}get depthStencilAttachment(){return this.__depthStencilAttachment}getColorAttachedRenderTargetTexture(e){return null!=this.__colorAttachments[e]&&this.__colorAttachments[e]instanceof Fe._?this.__colorAttachments[e]:void 0}getDepthAttachedRenderTargetTexture(){return this.__depthAttachment instanceof Fe._?this.__depthAttachment:void 0}create(e,t){this.width=e,this.height=t;const n=Be.F.getWebGLResourceRepository();return this.cgApiResourceUid=n.createFrameBufferObject(),this.cgApiResourceUid}get framebufferUID(){return this.cgApiResourceUid}setColorAttachmentAt(e,t){return t.width===this.width&&t.height===this.height&&(this.__colorAttachments[e]=t,Be.F.getWebGLResourceRepository().attachColorBufferToFrameBufferObject(this,e,t),this.__colorAttachmentMap.set(Le.G.from(e),t),!0)}setDepthAttachment(e){return e.width===this.width&&e.height===this.height&&(this.__depthAttachment=e,Be.F.getWebGLResourceRepository().attachDepthBufferToFrameBufferObject(this,e),!0)}setStencilAttachment(e){return e.width===this.width&&e.height===this.height&&(this.__stencilAttachment=e,Be.F.getWebGLResourceRepository().attachStencilBufferToFrameBufferObject(this,e),!0)}setDepthStencilAttachment(e){return e.width===this.width&&e.height===this.height&&(this.__depthStencilAttachment=e,Be.F.getWebGLResourceRepository().attachDepthStencilBufferToFrameBufferObject(this,e),!0)}resize(e,t){Be.F.getWebGLResourceRepository().deleteFrameBufferObject(this.cgApiResourceUid),this.cgApiResourceUid=Be.F.InvalidCGAPIResourceUid,this.width=0,this.height=0,this.create(e,t),this.depthAttachment&&(this.depthAttachment.resize(e,t),this.setDepthAttachment(this.depthAttachment)),this.depthStencilAttachment&&(this.depthStencilAttachment.resize(e,t),this.setDepthStencilAttachment(this.depthStencilAttachment)),this.stencilAttachment&&(this.stencilAttachment.resize(e,t),this.setStencilAttachment(this.stencilAttachment));for(let n=0;n0)for(const n of t.animations)for(const i of n.channels){const n=this.__getCorrespondingEntityWithVrma(e,t,i.target.node);if(n){const o=h.g.addComponentToEntity(qe.c,n).getAnimation(),a=t.extras.rnEntities[i.target.node],s=t.extensions.VRMC_vrm_animation.humanoidBoneNameMap.get(i.target.node);if(a.tryToSetUniqueName(s,!0),"0.x"===e.tryToGetVrm()._version){const e=new je.G(a);o.setAnimationRetarget(e)}else if("1.0"===e.tryToGetVrm()._version){const e=new r.B5(a);o.setAnimationRetarget(e)}}}return e}static getInstance(){return this.__instance||(this.__instance=new Ye),this.__instance}__getCorrespondingEntity(e,t,n,i,o,a){if(a){const n=e.getTagValue("rnEntitiesByNames"),o=t.nodes[i];return n.get(o.name)}if(x.Is.exist(n.extensions.VRM)){const t=n.extensions.VRM.humanoid.humanBones;let a;const r=new Map,s=new Map;for(const e of t)r.set(e.node,e.bone),s.set(e.name,e.bone);null!=o&&(a=s.get(o),null==a&&(a=r.get(i)));const l=e.getTagValue("humanoid_map_name_nodeId").get(a);if(null!=l)return e.getTagValue("rnEntities")[l];console.log(`humanoidBoneName: ${a}, nodeIndex: ${i}, nodeName: ${o}`)}else if(x.Is.exist(n.extensions.VRMC_vrm)){const t=n.extensions.VRMC_vrm.humanoid.humanBones;let a;const r=new Map;for(const e in t){const n=t[e];r.set(n.node,e)}null!=o&&(a=r.get(i));const s=e.getTagValue("humanoid_map_name_nodeId").get(a);if(null!=s)return e.getTagValue("rnEntities")[s];console.log(`humanoidBoneName: ${a}, nodeIndex: ${i}, nodeName: ${o}`)}}__getCorrespondingEntityWithVrma(e,t,n){const i=t.extensions.VRMC_vrm_animation.humanoidBoneNameMap.get(n),o=e.getTagValue("humanoid_map_name_nodeId").get(i);if(null!=o)return e.getTagValue("rnEntities")[o];console.log(`humanoidBoneName: ${i}, nodeIndex: ${n}`)}__isHips(e,t,n){const i=new Map;if(x.Is.exist(t.extensions.VRM)){const e=t.extensions.VRM.humanoid.humanBones;for(const t of e)i.set(t.node,t.bone)}else if(x.Is.exist(t.extensions.VRMC_vrm)){const e=t.extensions.VRMC_vrm.humanoid.humanBones;for(const t in e){const n=e[t];i.set(n.node,t)}}return e.getTagValue("humanoid_map_name_nodeId"),"hips"===i.get(n)}__setupAnimationForSameSkeleton(e,t,n,i,o){var a,s,l,c;if(t.animations)for(const e of t.animations)for(const t of e.samplers)Xe.e._readBinaryFromAccessorAndSetItToAccessorExtras(t.inputObject),Xe.e._readBinaryFromAccessorAndSetItToAccessorExtras(t.outputObject);if(t.animations&&t.animations.length>0)for(const _ of t.animations)for(const u of _.channels){const d=null===(s=null===(a=u.samplerObject)||void 0===a?void 0:a.inputObject)||void 0===s?void 0:s.extras.typedDataArray,m=null===(c=null===(l=u.samplerObject)||void 0===l?void 0:l.outputObject)||void 0===c?void 0:c.extras.typedDataArray,f=null!=u.samplerObject.interpolation?u.samplerObject.interpolation:"LINEAR",p=t.nodes[u.target.node],v=this.__getCorrespondingEntity(e,t,n,u.target.node,p.name,i);if(v){const i=h.g.addComponentToEntity(qe.c,v).getAnimation();if("none"===o){let t="translate";t="translation"===u.target.path?"translate":"rotation"===u.target.path?"quaternion":u.target.path,"quaternion"===t?i.setAnimation(x.Is.exist(_.name)?_.name:"Untitled",t,d,m,4,He.k.fromString(f)):"translate"===t&&this.__isHips(e,n,u.target.node)&&i.setAnimation(x.Is.exist(_.name)?_.name:"Untitled",t,d,m,3,He.k.fromString(f))}else{const e=t.extras.rnEntities[u.target.node];let n;if("global"===o)n=new r.B5(e);else{if("absolute"!==o)throw new Error("unknown retarget mode");n=new r.l(e)}i.setAnimationRetarget(n)}}}}}var Ke=n(4252),Je=n(6098),Ze=n(3738);class $e{constructor(){}async importPointCloud(e,t){const n=e.substring(0,e.lastIndexOf("/"))+"/",i=b.j.createDefaultGltfOptions();if(t&&t.files)for(const e in t.files)if("drc"===b.j.getExtension(e)){const o=await this.__decodeDraco(t.files[e],i,n,t);return new Ze.Ok(o)}const o=await b.j.fetchArrayBuffer(e);if(o.isErr())return new Ze.UG({message:"fetchArrayBuffer failed",error:o});const a=await this.__decodeDraco(o.unwrapForce(),i,n,t);return new Ze.Ok(a)}importArrayBuffer(e,t,n){const i=e.substring(0,e.lastIndexOf("/"))+"/",o=b.j.createDefaultGltfOptions();return this.__decodeDraco(t,o,i,n).catch((e=>{console.log("__loadFromArrayBuffer error",e)}))}async __loadFromArrayBuffer(e,t,n,i){const o=new DataView(e,0,20);let a;if(1179937895!==o.getUint32(0,!0)){const o=b.j.arrayBufferToString(e),r=JSON.parse(o);a=await this._loadAsTextJson(r,i,t,n).catch((e=>{console.log("this.__loadAsTextJson error",e)}))}else a=await this._loadAsBinaryJson(o,!0,e,i,t,n).catch((e=>{console.log("this.__loadAsBinaryJson error",e)}));return a}_getOptions(e,t,n){if(t.asset&&t.asset.extras&&t.asset.extras.rnLoaderOptions)for(const n in t.asset.extras.rnLoaderOptions)e[n]=t.asset.extras.rnLoaderOptions[n];for(const t in n)e[t]=n[t];return n&&n.loaderExtensionName&&"string"==typeof n.loaderExtensionName&&(null!=Rn[n.loaderExtensionName]?e.loaderExtension=Rn[n.loaderExtensionName].getInstance():(console.error(`${n.loaderExtensionName} not found!`),e.loaderExtension=void 0)),e}async _loadAsBinaryJson(e,t,n,i,o,a){const r=e.getUint32(12,t);if(1313821514!==e.getUint32(16,t))throw new Error("invalid chunkType of chunk0 in this binary glTF file.");const s=new Uint8Array(n,20,r),l=b.j.uint8ArrayToString(s),c=JSON.parse(l);i=this._getOptions(o,c,i);const _=new Uint8Array(n,20+r+8);void 0===c.asset.extras&&(c.asset.extras={fileType:"glTF",version:"2"}),this._mergeExtendedJson(c,i.extendedJson),c.asset.extras.rnLoaderOptions=i;try{await this._loadInner(_,a,c,i)}catch(e){console.log("this._loadInner error in _loadAsBinaryJson",e)}return c}async _loadAsTextJson(e,t,n,i){void 0===e.asset.extras&&(e.asset.extras={fileType:"glTF",version:"2"}),t=this._getOptions(n,e,t),this._mergeExtendedJson(e,t.extendedJson),e.asset.extras.rnLoaderOptions=t;try{await this._loadInner(void 0,i,e,t)}catch(e){console.log("this._loadInner error in _loadAsTextJson",e)}return e}_loadInner(e,t,n,i){const o=[];return o.push(this._loadResources(e,t,n,i,{shaders:[],buffers:[],images:[]})),o.push(new Promise(((e,t)=>{this._loadJsonContent(n,i),e()}))),Promise.all(o)}_loadJsonContent(e,t){this._loadDependenciesOfScenes(e),this._loadDependenciesOfNodes(e),this._loadDependenciesOfMeshes(e),this._loadDependenciesOfMaterials(e),this._loadDependenciesOfTextures(e),this._loadDependenciesOfJoints(e),this._loadDependenciesOfAnimations(e),this._loadDependenciesOfAccessors(e),this._loadDependenciesOfBufferViews(e),void 0===e.asset.extras&&(e.asset.extras={})}_loadDependenciesOfScenes(e){for(const t of e.scenes)for(const n in t.nodes)t.nodesObjects[n]=e.nodes[t.nodes[n]]}_loadDependenciesOfNodes(e){for(const t of e.nodes){if(t.children){x.Is.not.exist(t.childrenObjects)&&(t.childrenObjects=[]);for(const n in t.children)t.childrenObjects[n]=e.nodes[t.children[n]]}void 0!==t.mesh&&void 0!==e.meshes&&(t.meshObject=e.meshes[t.mesh]),void 0!==t.skin&&void 0!==e.skins&&(t.skinObject=e.skins[t.skin],void 0===t.meshObject.extras&&(t.meshObject.extras={}),t.meshObject.extras._skin=t.skin),void 0!==t.camera&&void 0!==e.cameras&&(t.cameraObject=e.cameras[t.camera]),void 0!==t.extensions&&void 0!==e.extensions&&void 0!==e.extensions.KHR_lights_punctual&&(t.extensions.KHR_lights_punctual.lightIndex=t.extensions.KHR_lights_punctual.light,t.extensions.KHR_lights_punctual.light=e.extensions.KHR_lights_punctual.lights[t.extensions.KHR_lights_punctual.lightIndex])}}_loadDependenciesOfMeshes(e){for(const t of e.meshes)for(const n of t.primitives){void 0!==n.material&&(n.materialObject=e.materials[n.material]);for(const t in n.attributes){const i=n.attributes[t],o=e.accessors[i];o.extras={toGetAsTypedArray:!0,attributeName:t},n.attributesObjects[t]=o}if(null!=n.indices&&(n.indicesObject=e.accessors[n.indices]),null!=n.targets){n.targetsObjects=[];for(const t of n.targets){const i={};for(const n in t){const o=t[n];if(o>=0){const t=e.accessors[o];t.extras={toGetAsTypedArray:!0,attributeName:n},i[n]=t}}n.targetsObjects.push(i)}}}}_checkRnGltfLoaderOptionsExist(e){return!(!e.asset.extras||!e.asset.extras.rnLoaderOptions)}_loadDependenciesOfMaterials(e){if(e.textures||(e.textures=[]),e.materials)for(const t of e.materials){if(t.pbrMetallicRoughness){const n=t.pbrMetallicRoughness.baseColorTexture;void 0!==n&&(n.texture=e.textures[n.index]);const i=t.pbrMetallicRoughness.metallicRoughnessTexture;void 0!==i&&(i.texture=e.textures[i.index])}const n=t.normalTexture;void 0!==n&&(n.texture=e.textures[n.index]);const i=t.occlusionTexture;void 0!==i&&(i.texture=e.textures[i.index]);const o=t.emissiveTexture;void 0!==o&&(o.texture=e.textures[o.index]),this._checkRnGltfLoaderOptionsExist(e)&&e.asset.extras.rnLoaderOptions.loaderExtension&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures(e,t)}}_loadDependenciesOfTextures(e){if(e.textures)for(const t of e.textures)(0,Je.Jx)((n=>{t.samplerObject=e.samplers[n]}),t.sampler),void 0!==t.source&&(t.image=e.images[t.source])}_loadDependenciesOfJoints(e){if(e.skins)for(const t of e.skins)if(x.Is.exist(t.skeleton)){t.skeletonObject=e.nodes[t.skeleton],(0,Je.Jx)((n=>t.inverseBindMatricesObject=e.accessors[n]),t.inverseBindMatrices),(0,Je.fY)((()=>t.skeletonObject=e.nodes[t.joints[0]]),t.skeleton),t.jointsObjects=[];for(const n of t.joints)t.jointsObjects.push(e.nodes[n])}}_loadDependenciesOfAnimations(e){if(e.animations)for(const t of e.animations){for(const n of t.channels)n.samplerObject=t.samplers[n.sampler],n.target.nodeObject=e.nodes[n.target.node];for(const n of t.channels)if(x.Is.exist(n.samplerObject)&&(n.samplerObject.inputObject=e.accessors[n.samplerObject.input],n.samplerObject.outputObject=e.accessors[n.samplerObject.output],void 0===n.samplerObject.outputObject.extras&&(n.samplerObject.outputObject.extras={}),"rotation"===n.target.path&&(n.samplerObject.outputObject.extras.quaternionIfVec4=!0),"weights"===n.target.path)){const e=n.samplerObject.outputObject.count/n.samplerObject.inputObject.count;n.samplerObject.outputObject.extras.weightsArrayLength=e}}}_loadDependenciesOfAccessors(e){for(const t of e.accessors)if(null==t.bufferView&&(t.bufferView=0),t.bufferViewObject=e.bufferViews[t.bufferView],null!=t.sparse){const n=t.sparse;n.indices.bufferViewObject=e.bufferViews[n.indices.bufferView],n.values.bufferViewObject=e.bufferViews[n.values.bufferView]}}_loadDependenciesOfBufferViews(e){for(const t of e.bufferViews)void 0!==t.buffer&&(t.bufferObject=e.buffers[t.buffer])}_mergeExtendedJson(e,t){let n=null;if(t instanceof ArrayBuffer){const e=b.j.arrayBufferToString(t);n=JSON.parse(e)}else"string"==typeof t?n=JSON.parse(t):"object"==typeof t&&(n=t);Object.assign(e,n)}_loadResources(e,t,n,i,o){const a=[];let r;for(const s in n.buffers){const l=n.buffers[s];let c,_;l.uri&&(c=l.uri.split("/"),_=c[c.length-1]),r=void 0===l.uri?new Ke.n(((t,n)=>{o.buffers[s]=e,l.buffer=e,t(e)})):l.uri.match(/^data:application\/(.*);base64,/)?new Ke.n(((e,t)=>{const n=b.j.dataUriToArrayBuffer(l.uri);o.buffers[s]=new Uint8Array(n),l.buffer=new Uint8Array(n),e(n)})):i.files&&i.files[_]?new Ke.n(((e,t)=>{const n=i.files[_];o.buffers[s]=new Uint8Array(n),l.buffer=new Uint8Array(n),e(n)})):new Ke.n(b.j.loadResourceAsync(t+l.uri,!0,((e,t)=>{o.buffers[s]=new Uint8Array(t),l.buffer=new Uint8Array(t),e(t)}),((e,t)=>{}))),l.bufferPromise=r,a.push(r)}for(const r in n.images){const s=r,l=n.images[s];let c;if(void 0===l.uri){let t=e;null==e&&(t=n.bufferViews[l.bufferView].bufferObject.buffer);const i=b.j.createUint8ArrayFromBufferViewInfo(n,l.bufferView,e);c=b.j.createBlobImageUriFromUint8Array(i,l.mimeType)}else{const e=l.uri,n=e.split("/"),o=n[n.length-1];if(i.files&&i.files[o]){const e=i.files[o];c=b.j.createBlobImageUriFromUint8Array(new Uint8Array(e),l.mimeType)}else c=e.match(/^data:/)?e:t+e}const _=b.j.createImageFromUri(c,l.mimeType).then((e=>{e.crossOrigin="Anonymous",o.images[s]=e,l.image=e}));a.push(_)}if(i.defaultTextures){const e=i.defaultTextures.basePath,t=i.defaultTextures.textureInfos;for(const n of t){const t=n.fileName,i=e+t,o=b.j.getExtension(t),r=b.j.getMimeTypeFromExtension(o),s=b.j.createImageFromUri(i,r).then((e=>{e.crossOrigin="Anonymous",n.image={image:e}}));a.push(s)}}return Promise.all(a).catch((e=>{console.log("Promise.all error",e)}))}static getInstance(){return this.__instance||(this.__instance=new $e),this.__instance}__decodeDraco(e,t,n,i){return this.__decodeBuffer(e).then((e=>{const o=JSON.stringify(e),a=JSON.parse(o);return this._loadAsTextJson(a,i,t,n).catch((e=>{console.log("this.__loadAsTextJson error",e)}))}))}__decodeBuffer(e){const t=new DracoDecoderModule,n=new t.Decoder,i=this.__getGeometryFromDracoBuffer(t,n,e);if(null==i)throw new Error("invalid dracoGeometry.");if(i.geometryType!==t.POINT_CLOUD)throw new Error("invalid geometryType of drc file.");if(-1===n.GetAttributeId(i,t.POSITION))throw t.destroy(n),t.destroy(i),new Error("Draco: No position attribute found.");const o=["POSITION","NORMAL","COLOR","TEX_COORD","GENERIC"],a=i.num_points(),r=[],s=[];let l=0;for(let e=0;e{e(o)}))}__setBuffersToJSON(e,t){return this.__convertBufferToURI(e.buffer).then((n=>{t.buffers=[{name:"input",byteLength:e.byteLength,uri:n}]})).catch((e=>{console.log("this.__convertBufferToURI error:",e)}))}__convertBufferToURI(e){return new Promise(((t,n)=>{const i=new Blob([e],{type:"application/octet-stream"}),o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=()=>{n(o.error)},o.readAsDataURL(i)}))}__setAccessorsAndBufferViewsToJSON(e,t,n,i){const o=[],a=[];let r=0;for(let i=0,s=0;i0){const e=i[0].entity.getTransform().localPosition;e.lengthSquared(){for(let n=0;nt[e]));const s=[];for(const t in i.bones){const n=i.bones[t],o=e.asset.extras.rnEntities[n];this.__addSpringBoneRecursively(r,o,i,s)}n.push(r)}for(const e of n)this.__addPhysicsComponent(e,e.rootBone)}static __addSpringBoneRecursively(e,t,n,i){const o=t.getSceneGraph().children;if(!i.includes(t)){const o=new ft(t);o.dragForce=n.dragForce,o.stiffnessForce=n.stiffiness,o.gravityPower=n.gravityPower,o.gravityDir=ce.P.fromCopyArray([n.gravityDir.x,n.gravityDir.y,n.gravityDir.z]),o.hitRadius=n.hitRadius,e.bones.push(o),i.push(t)}for(const t of o)this.__addSpringBoneRecursively(e,t.entity,n,i)}static __addPhysicsComponent(e,t){const n=t.entity,i=h.g.addComponentToEntity(Ee.Z,n).getPhysics(),o=new _t;o.setSpring(e),i.setStrategy(o)}static _createTextures(e){e.textures||(e.textures=[]);const t=e.textures,n=[];for(let i=0;i({entityIdx:e.extras.rnEntities[t.node].entityUID,blendShapeIdx:t.index,weight:t.weight}))));const r={name:t,isBinary:n.isBinary,binds:i};o.push(r)}const s=h.g.addComponentToEntity(r.ZA,t);s.getVrm().setVrmExpressions(o),s.getVrm()._version="1.0"}static _readVRMHumanoidInfo(e,t){const n=e.extensions.VRMC_vrm.humanoid.humanBones,i=new Map;for(const e in n){const t=n[e];i.set(e,t.node)}null!=t&&t.tryToSetTag({tag:"humanoid_map_name_nodeId",value:i})}static _readSpringBone(e){var t,n;const i=[];if(x.Is.exist(null===(t=e.extensions.VRMC_springBone)||void 0===t?void 0:t.colliderGroups))for(const t in e.extensions.VRMC_springBone.colliderGroups){const n=e.extensions.VRMC_springBone.colliderGroups[t],o=new ut;i.push(o);for(const t of n.colliders){const n=e.extensions.VRMC_springBone.colliders[t],i=e.asset.extras.rnEntities[n.node].getSceneGraph();if(x.Is.exist(n.shape.sphere)){const e=new ht;e.baseSceneGraph=i,e.position=ce.P.fromCopyArray([n.shape.sphere.offset[0],n.shape.sphere.offset[1],n.shape.sphere.offset[2]]),e.radius=n.shape.sphere.radius,o.sphereColliders.push(e)}else if(x.Is.exist(n.shape.capsule)){const e=new vt;e.baseSceneGraph=i,e.position=ce.P.fromCopyArray([n.shape.capsule.offset[0],n.shape.capsule.offset[1],n.shape.capsule.offset[2]]),e.radius=n.shape.capsule.radius,e.tail=ce.P.fromCopyArray([n.shape.capsule.tail[0],n.shape.capsule.tail[1],n.shape.capsule.tail[2]]),o.capsuleColliders.push(e)}}}const o=[];if(x.Is.exist(null===(n=e.extensions.VRMC_springBone)||void 0===n?void 0:n.springs))for(const t of e.extensions.VRMC_springBone.springs){const n=t.joints[0],a=e.asset.extras.rnEntities[n.node],r=new dt(a.getSceneGraph());r.tryToSetUniqueName(t.name,!0);const s=x.Is.exist(t.colliderGroups)?t.colliderGroups:[];r.colliderGroups=s.map((e=>i[e]));const l=[];for(const n in t.joints){const i=t.joints[n],o=e.asset.extras.rnEntities[i.node],a=new ft(o);a.dragForce=i.dragForce,a.stiffnessForce=i.stiffness,a.gravityPower=x.Is.exist(i.gravityPower)?i.gravityPower:1,a.gravityDir=x.Is.exist(i.gravityDir)?ce.P.fromCopyArray3([i.gravityDir[0],i.gravityDir[1],i.gravityDir[2]]):ce.P.fromCopyArray3([0,-1,0]),a.hitRadius=i.hitRadius,r.bones.push(a),l.push(o)}this.__addSpringBoneRecursively(r,a,l),o.push(r)}for(const e of o)this.__addPhysicsComponent(e,e.rootBone)}static __addSpringBoneRecursively(e,t,n){const i=t.getSceneGraph().children;if(!n.includes(t)){const i=new ft(t);e.bones.push(i),n.push(t)}for(const t of i)this.__addSpringBoneRecursively(e,t.entity,n)}static __addPhysicsComponent(e,t){const n=t.entity,i=h.g.addComponentToEntity(Ee.Z,n).getPhysics(),o=new _t;o.setSpring(e),i.setStrategy(o)}static _createTextures(e){e.textures||(e.textures=[]);const t=e.textures,n=[];for(let i=0;i=0?(n.__isImportVRM0x=!1,i.asset.extras.rnLoaderOptions.__isImportVRM0x=!1,n.__importedType="vrm1",await bt.__importVRM(i,t)):i.extensionsUsed.indexOf("VRM")>=0&&(n.__importedType="vrm0x",await pt.__importVRM0x(i,t)),new Ze.Ok}return(0,Ze.Z6)(e),new Ze.UG({message:e.getRnError().message,error:void 0})}default:return new Ze.UG({message:"detect invalid format",error:void 0})}}static __getFileTypeFromFilePromise(e,t,n){return null!=n?et.T.fromString(n):tt({[e]:t.files[e]})}}var Tt=n(1220);class St{static async importFromUri(e){const t=await it.Z.importFromUri(e,{});if(t.isErr())return new Ze.UG({message:"Failed to import VRM file.",error:t});(0,Ze.UD)(t);const n=t.get();return this.readHumanoid(n),new Ze.Ok(n)}static async importFromArrayBuffer(e){const t=await it.Z.importFromArrayBuffers({"data.glb":e},{});if(t.isErr())return new Ze.UG({message:"Failed to import VRM file.",error:t});(0,Ze.UD)(t);const n=t.get();return this.readHumanoid(n),new Ze.Ok(n)}static readHumanoid(e){var t;const n=null===(t=e.extensions.VRMC_vrm_animation.humanoid)||void 0===t?void 0:t.humanBones;if(x.Is.not.exist(n))return;const i=new Map;e.extensions.VRMC_vrm_animation.humanoidBoneNameMap=i;for(const e in n){const t=n[e];i.set(t.node,e)}}}var Ct=n(5868);class wt extends m.S{constructor(e,t,n){super(),this.__inputs=[],this.__outputs=[],this.__inputConnections=[],this.__shaderFunctionName=e,this.__shaderCode=t,this.__shaderNodeUid=++wt.__invalidShaderNodeCount,wt._shaderNodes[wt.__invalidShaderNodeCount]=this,this.__shader=n}addInputConnection(e,t,n){this.__inputConnections.push({shaderNodeUid:e.shaderNodeUid,outputNameOfPrev:t,inputNameOfThis:n})}get shaderFunctionName(){return this.__shaderFunctionName}get shaderCode(){return this.__shaderCode}get shaderNodeUid(){return this.__shaderNodeUid}getInput(e){for(const t of this.__inputs)if(t.name===e)return t}getInputs(){return this.__inputs}getOutput(e){for(const t of this.__outputs)if(t.name===e)return t}getOutputs(){return this.__outputs}get inputConnections(){return this.__inputConnections}get shader(){return this.__shader}}wt._shaderNodes=[],wt.__invalidShaderNodeCount=-1;var Rt=n(7882),Pt=n(903),Mt=n(5324),Dt=n(836);const Nt="const float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n";class Bt{static createVertexShaderCode(e){var t;const n=e.concat(),i=this.__findBeginNode(n),o=this.__sortTopologically(i,n);let a="",r="attribute";(null===(t=Be.F.getWebGLResourceRepository().currentWebGLContextWrapper)||void 0===t?void 0:t.isWebGL2)&&(r="in"),a+=`\n#version 300 es\nprecision highp float;\nprecision highp int;\n${Nt}\n\n ${r} vec4 a_instanceInfo;\n`,a+=`\nuniform bool u_vertexAttributesExistenceArray[${ie.T.AttributeTypeNumber}];\n`,a+="/* shaderity: @{matricesGetters} */",a+="/* shaderity: @{getters} */";let s="";return s+=Bt.getFunctionDefinition(o,Mt.H.VertexShader),s+=Bt.__constructShaderWithNodes(o),{shader:a+s,shaderBody:s}}static createPixelShaderCode(e){const t=e.concat(),n=this.__findBeginNode(t),i=this.__sortTopologically(n,t);let o="";o+=`\n#version 300 es\nprecision highp float;\nprecision highp int;\n${Nt}\n`,o+="/* shaderity: @{getters} */",o+="layout(location = 0) out vec4 rt0;";let a="";return a+=Bt.getFunctionDefinition(i,Mt.H.PixelShader),a+=Bt.__constructShaderWithNodes(i),{shader:o+a,shaderBody:a}}static __findBeginNode(e){let t;for(let n=0;n{let i=0;for(const e of t.inputConnections)-1===n.indexOf(e.shaderNodeUid)&&i++;0===i&&(e=t)})),i.push(e),n.push(e.shaderNodeUid),t.splice(t.indexOf(e),1)}while(0!==t.length);return i}static getFunctionDefinition(e,t){let n="";const i=[];for(let o=0;o=0&&null==o[l-1]&&(o[l-1]=[]);const _=c.inputConnections;for(let e=0;e<_.length;e++){const o=_[e],r=wt._shaderNodes[o.shaderNodeUid];if(n(c.getInputs()[e]))continue;const h=r.getOutput(o.outputNameOfPrev),u=c.getInput(o.inputNameOfThis),d=`${h.name}_${o.shaderNodeUid}_to_${c.shaderNodeUid}`;-1===a.indexOf(r.shaderNodeUid)&&(t+=`${u.compositionType.getGlslStr(u.componentType)} ${d} = ${u.compositionType.getGlslInitialValue(u.componentType)};\n`);const m=s.get(r.shaderNodeUid);i[l].push(m||d),a.push(o.shaderNodeUid)}for(let t=l;t=0&&o[l-1].push(e),s.set(t.shaderNodeUid,e)}r.push(t.shaderNodeUid)}}}}}let a="";for(let n=0;n0){l+=`${s}(`;for(let t=0;t rhs;\n}\n\nvoid greater(in int lhs, in int rhs, out bool outValue) {\n outValue = lhs > rhs;\n}\n"),this.__inputs.push({compositionType:e,componentType:t,name:"lhs"}),this.__inputs.push({compositionType:e,componentType:I.r.Float,name:"rhs"}),this.__outputs.push({compositionType:T.d.Scalar,componentType:I.r.Bool,name:"outValue"})}}var jt=n(4109);class Yt extends wt{constructor(){super("ifStatement",void 0,new jt.p),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Bool,name:"condition"}),this.__outputs.push({compositionType:T.d.Unknown,componentType:I.r.Unknown,name:"ifStart"})}}class Kt extends wt{constructor(e,t,n,i){super("multiply","\nvoid multiply(in float lfs, in float rhs, out float outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in int lfs, in int rhs, out int outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat2 lfs, in mat2 rhs, out mat2 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat3 lfs, in mat3 rhs, out mat3 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat4 lfs, in mat4 rhs, out mat4 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat3 lfs, in vec3 rhs, out vec3 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat4 lfs, in vec4 rhs, out vec4 outValue) {\n outValue = lfs * rhs;\n}\n\n");let o=T.d.Unknown;e===T.d.Mat4&&n===T.d.Mat4?o=T.d.Mat4:e===T.d.Mat4&&n===T.d.Vec4?o=T.d.Vec4:e===T.d.Scalar&&n===T.d.Scalar&&(o=T.d.Scalar),this.__inputs.push({compositionType:e,componentType:t,name:"lhs"}),this.__inputs.push({compositionType:n,componentType:i,name:"rhs"}),this.__outputs.push({compositionType:o,componentType:t,name:"outValue"})}}class Jt extends wt{constructor(){super("normalMatrix","\nvoid normalMatrix(out mat3 outValue) {\n outValue = get_normalMatrix(a_instanceInfo.x);\n}\n"),this.__outputs.push({compositionType:T.d.Mat3,componentType:I.r.Float,name:"outValue"})}}class Zt extends wt{constructor(e,t){super("normalize","\nvoid normalize(in vec2 value, out vec2 outValue) {\n outValue = normalize(value);\n}\n\nvoid normalize(in vec3 value, out vec3 outValue) {\n outValue = normalize(value);\n}\n\nvoid normalize(in vec4 value, out vec4 outValue) {\n outValue = normalize(value);\n}\n"),this.__inputs.push({compositionType:e,componentType:t,name:"value"}),this.__outputs.push({compositionType:e,componentType:t,name:"outValue"})}}var $t=n(4212);class en extends wt{constructor(){super("outColor",void 0,$t.x.getInstance()),this.__inputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"value"})}}class tn extends wt{constructor(){super("outPosition",void 0,$t.x.getInstance()),this.__inputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"value"})}}class nn extends wt{constructor(){super("projectionMatrix","\nvoid projectionMatrix(out mat4 outValue) {\n float cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID}*/];\n outValue = get_projectionMatrix(cameraSID, 0);\n}\n"),this.__outputs.push({compositionType:T.d.Mat4,componentType:I.r.Float,name:"outValue"})}}class on extends wt{constructor(){super("scalarToVector4","\nvoid scalarToVector4(in float x, in float y, in float z, in float w, out vec4 outValue) {\n outValue.x = x;\n outValue.y = y;\n outValue.z = z;\n outValue.w = w;\n}\n"),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"x"}),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"y"}),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"z"}),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"w"}),this.__outputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"outValue"})}}var an=n(6796);class rn extends Ct.P{constructor(){super(new an.S,"textureFetch"),this.generalTextureMaterialNodeUID=new y.wy({str:`generalTexture_${this.materialNodeUid}`});const e=[{semantic:this.generalTextureMaterialNodeUID,componentType:I.r.Int,compositionType:T.d.Texture2D,stage:Mt.H.PixelShader,isCustomSetting:!1,soloDatum:!1,min:0,max:Number.MAX_SAFE_INTEGER}];this.setShaderSemanticsInfoArray(e),this.__vertexInputs.push({compositionType:T.d.Vec2,componentType:I.r.Float,name:"texcoord"}),this.__vertexOutputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"outColor"})}}var sn=n(204);class ln extends wt{constructor(e,t){super("uniformData"),this.__shaderFunctionName+="_"+this.__shaderNodeUid,this.__shader=new sn.$(this.__shaderFunctionName,e,t),this.__outputs.push({compositionType:e,componentType:t,name:"outValue"})}setDefaultInputValue(e,t){"value"===e&&this.__shader.setDefaultValue(t)}setUniformDataName(e){this.__shader.setVariableName(e)}}var cn=n(9071);class _n extends wt{constructor(e,t){super("varyingInVariable"),this.__shaderFunctionName+="_"+this.__shaderNodeUid,this.__shader=new cn.e(this.__shaderFunctionName,e,t),this.__outputs.push({compositionType:e,componentType:t,name:"outValue",isClosed:!0})}setVaryingVariableName(e){this.__shader.setVariableName(e)}}class hn extends wt{constructor(e,t){super("varyingOutVariable"),this.__shaderFunctionName+="_"+this.__shaderNodeUid,this.__shader=new cn.e(this.__shaderFunctionName,e,t),this.__inputs.push({compositionType:e,componentType:t,name:"value"})}setVaryingVariableName(e){this.__shader.setVariableName(e)}}class un extends wt{constructor(){super("vector3AndScalarToVector4","\nvoid vector3AndScalarToVector4(in vec3 xyz, in float w, out vec4 outValue) {\n outValue.x = xyz.x;\n outValue.y = xyz.y;\n outValue.z = xyz.z;\n outValue.w = w;\n}\n"),this.__inputs.push({compositionType:T.d.Vec3,componentType:I.r.Float,name:"xyz"}),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"w"}),this.__outputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"outValue"})}}class dn extends wt{constructor(){super("viewMatrix","\nvoid viewMatrix(out mat4 outValue) {\n float cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID}*/];\n outValue = get_viewMatrix(cameraSID, 0);\n}\n"),this.__outputs.push({compositionType:T.d.Mat4,componentType:I.r.Float,name:"outValue"})}}class mn extends wt{constructor(){super("wireframe","bool wireframe(\n in vec4 existingFragColor,\n in vec4 wireframeColor,\n out vec4 outColor\n) {\n vec3 wireframeInfo = get_wireframe(a_instanceInfo.x);\n\n // Wireframe\n float threshold = 0.001;\n float wireframeWidthInner = wireframeInfo.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframeInfo.x > 0.5 && wireframeInfo.y < 0.5) {\n outColor.a = 0.0;\n }\n vec4 wireframeResult = existingFragColor;\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + existingFragColor.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(existingFragColor.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframeInfo.x > 0.5) {\n outColor = wireframeResult;\n if (wireframeInfo.y < 0.5 && existingFragColor.a == 0.0) {\n discard;\n }\n }\n}\n"),this.__inputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"existingFragColor"}),this.__inputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"wireframeColor"}),this.__outputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"outColor"})}}class fn extends wt{constructor(){super("worldMatrix","\nvoid worldMatrix(out mat4 outValue) {\n outValue = get_worldMatrix(a_instanceInfo.x);\n}\n"),this.__outputs.push({compositionType:T.d.Mat4,componentType:I.r.Float,name:"outValue"})}}var pn=n(6863),vn=n(1995),An=n(621),yn=n(9604),xn=n(8774),gn=n(3616),In=n(224),bn=n(1813),En=n(5757),Tn=n(4878);class Sn extends Ct.P{constructor(){super(null,"envConstantShading",{},En.Z,Tn.Z);const e=[{semantic:Sn.EnvHdriFormat,componentType:I.r.Int,compositionType:T.d.Scalar,stage:Mt.H.PixelShader,isCustomSetting:!1,updateInterval:bn.a.EveryTime,soloDatum:!1,initialValue:gn.Ru.fromCopyNumber(0),min:0,max:5},{semantic:Sn.envRotation,componentType:I.r.Float,compositionType:T.d.Scalar,stage:Mt.H.PixelShader,isCustomSetting:!1,updateInterval:bn.a.EveryTime,soloDatum:!1,initialValue:gn.Ru.fromCopyNumber(0),min:-Math.PI,max:Math.PI},{semantic:y.f5.DiffuseColorFactor,componentType:I.r.Float,compositionType:T.d.Vec4,stage:Mt.H.PixelShader,isCustomSetting:!1,updateInterval:bn.a.EveryTime,soloDatum:!1,initialValue:P.Lt.fromCopyArray([1,1,1,1]),min:0,max:2},{semantic:y.f5.ColorEnvTexture,componentType:I.r.Int,compositionType:T.d.TextureCube,stage:Mt.H.PixelShader,isCustomSetting:!1,updateInterval:bn.a.EveryTime,initialValue:[0,Ft.pn],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:y.f5.MakeOutputSrgb,compositionType:T.d.Scalar,componentType:I.r.Bool,stage:Mt.H.PixelShader,min:0,max:1,isCustomSetting:!1,updateInterval:bn.a.FirstTimeOnly,initialValue:gn.Ru.fromCopyNumber(1)}];this.setShaderSemanticsInfoArray(e)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix));let o=i.renderPass.cameraComponent;null==o&&(o=l.C.getComponent(In.M,In.M.current)),o&&(this.setViewInfo(t,o,i.isVr,i.displayIdx),this.setProjection(t,o,i.isVr,i.displayIdx))}}Sn.envRotation=new y.wy({str:"envRotation"}),Sn.EnvHdriFormat=new y.wy({str:"envHdriFormat"});var Cn=n(8287),wn=n(1554),Pn=n(9330),Mn=n(8283),Dn=n(9764),Nn=n(7369),Bn=n(968),Ln=n(5519),Fn=n(4235),Gn=n(1050),zn=n(6312),Vn=n(2858),On=n(3981),Un=n(3648),kn=n(2251),Qn=n(580);class Wn extends m.S{constructor(){super(),this.__width=0,this.__height=0,this.__isShadow=!1,this.__shadowMapSize=1024,this.__oFrame=new zn.Hq,this.__oFrameDepthMoment=new zn.Hq,this.__oFrameBufferMsaa=new zn.Hq,this.__oFrameBufferResolve=new zn.Hq,this.__oFrameBufferResolveForReference=new zn.Hq,this.__oInitialExpression=new zn.Hq,this.__expressions=[],this.__depthMomentExpressions=[],this.__oMsaaResolveExpression=new zn.Hq,this.__oGammaExpression=new zn.Hq,this.__transparentOnlyExpressions=[],this.__oGammaBoardEntity=new zn.Hq,this.__oWebXRSystem=new zn.Hq,this.__oDrawFunc=new zn.Hq,this.__oDiffuseCubeTexture=new zn.Hq,this.__oSpecularCubeTexture=new zn.Hq,this.__oSamplerForBackBuffer=new zn.Hq}async setup(e,t,{isShadow:n=!1,shadowMapSize:i=1024}={}){if(this.__width=e,this.__height=t,this.__shadowMapSize=i,this.__oFrame.has())return new Ze.UG({message:"Already setup",error:void 0});const o=new zn.bD(new On.R);this.__oFrame=o,this.__oSamplerForBackBuffer=new zn.bD(new Qn.Z({wrapS:ze.d.Repeat,wrapT:ze.d.Repeat,minFilter:ze.d.LinearMipmapLinear,magFilter:ze.d.Linear})),this.__oSamplerForBackBuffer.unwrapForce().create();const{framebufferMsaa:a,framebufferResolve:r,framebufferResolveForReference:s}=this.__createRenderTargets(e,t);n&&(this.__isShadow=!0,this.__oFrameDepthMoment=this.__setupDepthMomentFramebuffer(i));const l=this.__setupInitialExpression(a,this.__oFrameDepthMoment);this.__oInitialExpression=new zn.bD(l);const c=this.__setupMsaaResolveExpression(o,a,r,s);this.__oMsaaResolveExpression=new zn.bD(c),this.__oFrameBufferMsaa=new zn.bD(a),this.__oFrameBufferResolve=new zn.bD(r),this.__oFrameBufferResolveForReference=new zn.bD(s);const _=this.__setupGammaExpression(o,r,e/t);this.__oGammaExpression=new zn.bD(_);const h=await kn.x.getInstance().getModule("xr");return x.Is.exist(h)&&(this.__oWebXRSystem=new zn.bD(h.WebXRSystem.getInstance())),new Ze.Ok}setExpressions(e,t={isTransmission:!0}){this.__setExpressionsInner(e,{isTransmission:t.isTransmission});const n=e.map((e=>e.clone()));t.isTransmission&&this.__setTransparentExpressionsForTransmission(n),this.__setDepthTextureToEntityMaterials()}__setDepthTextureToEntityMaterials(){if(x.Is.false(this.__isShadow))return;this.__depthMomentExpressions=[];for(const e of this.__expressions)this.__depthMomentExpressions.push(e.clone());const e=Ie.G.createDepthMomentEncodeMaterial();for(const t of this.__depthMomentExpressions)for(const n of t.renderPasses)n.setFramebuffer(this.__oFrameDepthMoment.unwrapForce()),n.toClearColorBuffer=!0,n.toClearDepthBuffer=!0,n.toRenderTransparentPrimitives=!1,n.setMaterial(e);for(const e of this.__expressions)for(const t of e.renderPasses){const e=t.entities;for(const t of e){const e=t.tryToGetMesh();if(x.Is.exist(e)){const t=e.mesh;if(x.Is.exist(t)){const e=t.primitives;for(const t of e)t.material.setTextureParameter(y.f5.DepthTexture,this.__oFrameDepthMoment.unwrapForce().getColorAttachedRenderTargetTexture(0))}}}}}startRenderLoop(e){return this.__oFrame.doesNotHave()?new Ze.UG({message:"not initialized.",error:void 0}):(this.__oDrawFunc=new zn.bD(e),Un.x.startRenderLoop((()=>{this.__setExpressions(),e(this.__oFrame.unwrapForce())})),new Ze.Ok)}draw(){this.__oDrawFunc.unwrapForce()(this.__oFrame.unwrapForce())}resize(e,t){if(this.__oFrame.doesNotHave())return new Ze.UG({message:"not initialized.",error:void 0});(0,zn.Zz)(this.__oFrame),(0,zn.Zz)(this.__oFrameBufferMsaa),(0,zn.Zz)(this.__oFrameBufferResolve),(0,zn.Zz)(this.__oFrameBufferResolveForReference),(0,zn.Zz)(this.__oGammaExpression),(0,zn.Zz)(this.__oGammaBoardEntity);const n=this.__oWebXRSystem.unwrapOrUndefined();return x.Is.exist(n)&&n.isWebXRMode&&(e=n.getCanvasWidthForVr(),t=n.getCanvasHeightForVr()),Un.x.resizeCanvas(e,t),this.__oFrame.get().setViewport(P.Lt.fromCopy4(0,0,e,t)),this.__oFrameDepthMoment.has()&&this.__oFrameDepthMoment.get().resize(Math.floor(this.__shadowMapSize*(this.__width/this.__height)),this.__shadowMapSize),this.__oFrameBufferMsaa.get().resize(e,t),this.__oFrameBufferResolve.get().resize(e,t),this.__oFrameBufferResolveForReference.get().resize(e,t),this.__oGammaExpression.get().renderPasses[0].setViewport(P.Lt.fromCopy4(0,0,e,t)),new Ze.Ok}setIBL(e){const t=new Vn.B;t.baseUriToLoad=e.diffuse.baseUri,t.hdriFormat=e.diffuse.hdriFormat,t.isNamePosNeg=e.diffuse.isNamePosNeg,t.mipmapLevelNumber=e.diffuse.mipmapLevelNumber,t.loadTextureImagesAsync(),this.__oDiffuseCubeTexture=new zn.bD(t);const n=new Vn.B;n.baseUriToLoad=e.specular.baseUri,n.isNamePosNeg=e.specular.isNamePosNeg,n.hdriFormat=e.specular.hdriFormat,n.mipmapLevelNumber=e.specular.mipmapLevelNumber,n.loadTextureImagesAsync(),this.__oSpecularCubeTexture=new zn.bD(n),this.__setIblInner(),this.__setIblInnerForTransparentOnly()}setIBLTextures(e,t){this.__oDiffuseCubeTexture=new zn.bD(e),this.__oSpecularCubeTexture=new zn.bD(t),this.__setIblInner(),this.__setIblInnerForTransparentOnly()}getInitialExpression(){return this.__oInitialExpression.unwrapOrUndefined()}getMsaaResolveExpression(){return this.__oMsaaResolveExpression.unwrapOrUndefined()}getGammaExpression(){return this.__oGammaExpression.unwrapOrUndefined()}setDiffuseIBLContribution(e){for(const t of this.__expressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();x.Is.exist(n)&&(n.diffuseCubeMapContribution=e)}for(const t of this.__transparentOnlyExpressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();x.Is.exist(n)&&(n.diffuseCubeMapContribution=e)}}setSpecularIBLContribution(e){for(const t of this.__expressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();x.Is.exist(n)&&(n.specularCubeMapContribution=e)}for(const t of this.__transparentOnlyExpressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();x.Is.exist(n)&&(n.specularCubeMapContribution=e)}}setIBLRotation(e){for(const t of this.__expressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();x.Is.exist(n)&&(n.rotationOfCubeMap=e)}}setCameraComponentOfLight(e){if(this.__isShadow){for(const t of this.__depthMomentExpressions)for(const n of t.renderPasses)n.cameraComponent=e;for(const t of this.__expressions)for(const n of t.renderPasses)n.setPostRenderFunction((function(){const t=n.entities;for(const n of t){const t=n.tryToGetMesh();if(x.Is.exist(t)){const n=t.mesh;if(x.Is.exist(n)){const t=n.primitives;for(const n of t)n.material.setParameter(y.f5.DepthBiasPV,e.biasViewProjectionMatrix)}}}}))}}__setExpressionsInner(e,t={isTransmission:!0}){for(const n of e)for(const e of n.renderPasses)e.toRenderOpaquePrimitives=!0,t.isTransmission?e.toRenderTransparentPrimitives=!1:e.toRenderTransparentPrimitives=!0,e.toClearDepthBuffer=!1,e.setFramebuffer(this.__oFrameBufferMsaa.unwrapForce());this.__expressions=e,this.__setIblInner()}__setTransparentExpressionsForTransmission(e){for(const t of e){t.tryToSetUniqueName("modelTransparentForTransmission",!0);for(const e of t.renderPasses){e.toRenderOpaquePrimitives=!1,e.toRenderTransparentPrimitives=!0,e.toClearDepthBuffer=!1,e.setFramebuffer(this.__oFrameBufferMsaa.unwrapForce());for(const t of e.entities){const e=t.tryToGetMesh();if(x.Is.exist(e)){const t=e.mesh;if(x.Is.exist(t))for(let e=0;eo?(r=Math.min(i,t),s=r*a):(s=Math.min(o,t),r=s/a),n.width=r,n.height=s;const l=n.getContext("2d");if(l.drawImage(e,0,0,e.width,e.height,0,0,r,s),this.autoDetectTransparency){this.__imageData=l.getImageData(0,0,r,s);for(let e=0;e{const _=()=>{this.__width=h.videoWidth,this.__height=h.videoHeight;const e=Be.F.getCgApiResourceRepository().createTextureFromImageBitmapData(h,{level:t,internalFormat:n,width:this.__width,height:this.__height,border:0,format:i,type:o,generateMipmap:a});this._textureResourceUid=e,this.__isTextureReady=!0,l()};null==s||s.addEventListener("click",(()=>{_(),h.play()}),!0);const h=document.createElement("video");h.crossOrigin="anonymous",h.setAttribute("playsinline","playsinline"),r&&(h.autoplay=!0,h.muted=!0),h.preload="auto",Zn(this,Xn,h,"f"),h.addEventListener("canplaythrough",(()=>{_(),h.play()}),!0),h.addEventListener("ended",(()=>{h.play()}),!0),h.src=e}))}updateTexture(){const e=Be.F.getWebGLResourceRepository();this.__isTextureReady&&$n(this,Xn,"f")&&e.updateTexture(this._textureResourceUid,$n(this,Xn,"f"),{level:0,xoffset:0,yoffset:0,width:this.__width,height:this.__height,format:Ve.V.RGBA,type:I.r.UnsignedByte})}getCurrentFramePixelData(){let e;const t=Be.F.getWebGLResourceRepository();return this.__isTextureReady&&$n(this,Xn,"f")&&(e=t.getPixelDataFromTexture(this._textureResourceUid,0,0,this.width,this.height)),[e,this.width,this.height]}set playbackRate(e){$n(this,Xn,"f")&&($n(this,Xn,"f").playbackRate=e)}get playbackRate(){var e;const t=null===(e=$n(this,Xn,"f"))||void 0===e?void 0:e.playbackRate;return null!=t?t:1}play(){var e;null===(e=$n(this,Xn,"f"))||void 0===e||e.play()}pause(){$n(this,Xn,"f").pause()}}Xn=new WeakMap,ei.__loadedBasisFunc=!1},6863:(e,t,n)=>{n.d(t,{h:()=>A});var i=n(7290),o=n(224),a=n(810),r=n(2404),s=n(3999),l=n(4587),c=n(5324),_=n(1813),h=n(2575),u=n(5981),d=n(5868);const m={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord;\nin vec3 a_position;\n\nout vec2 v_texcoord;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n v_texcoord = a_texcoord;\n}\n",shaderStage:"vertex",isFragmentShader:!1},f={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec2 v_texcoord;\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec4 textureColor = texture(u_baseColorTexture, v_texcoord);\n\n float r = textureColor.r;\n float g = textureColor.g;\n float b = textureColor.b;\n float r16 = r * 15.0;\n float g16 = g * 15.0;\n float b16 = b * 15.0;\n float rInt = floor(r16);\n float gInt = floor(g16);\n float bInt = floor(b16);\n\n float rRate, gRate, bRate;\n float rIntAdjust, gIntAdjust, bIntAdjust;\n\n vec3 newColor = vec3(0.0);\n for(int i=0; i<8; i++){\n rRate = 1.0 - fract(r16);\n gRate = 1.0 - fract(g16);\n bRate = 1.0 - fract(b16);\n rIntAdjust = rInt;\n gIntAdjust = gInt;\n bIntAdjust = bInt;\n\n if(fract(float(i) / 2.0) != 0.0){\n rIntAdjust += 1.0;\n rRate = 1.0 - rRate;\n }\n if(fract(float(i / 2) / 2.0) != 0.0){\n gIntAdjust += 1.0;\n gRate = 1.0 - gRate;\n }\n if(fract(float(i / 4) / 2.0) != 0.0){\n bIntAdjust += 1.0;\n bRate = 1.0 - bRate;\n }\n\n if( rRate * gRate * bRate != 0.0){\n newColor += texture(u_lookupTableTexture, vec2(rIntAdjust / 256.0 + bIntAdjust / 16.0 + 1.0 / 512.0, gIntAdjust / 16.0 + 1.0 / 32.0)).rgb * rRate * gRate * bRate;\n }\n }\n\n rt0 = vec4(newColor, 1.0);\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var p=n(580),v=n(2192);class A extends d.P{constructor(e,t,n,o){let r;super(null,"colorGradingUsingLUTsShading",{},m,f);const d=e.getFramebuffer();let y;null!=d&&null!=d.colorAttachments[t]?r=d.colorAttachments[t]:(r=v.mg,null!=d?console.warn("renderPass does not have framebuffer.colorAttachments["+t+"]"):console.warn("renderPass does not have framebuffer")),"string"==typeof n?(y=new h.x,async function(e){y.generateTextureFromUri(e,{type:s.r.UnsignedByte}),await y.loadFromUrlLazy()}(n)):o instanceof i.y?y=o:(console.warn("no LUT texture is specified"),y=v.mg);const x=new p.Z({minFilter:u.d.Nearest,magFilter:u.d.Nearest,wrapS:u.d.ClampToEdge,wrapT:u.d.ClampToEdge,anisotropy:!1});x.create();const g=[{semantic:l.f5.BaseColorTexture,componentType:s.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:_.a.EveryTime,initialValue:[0,r],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:A.lookupTableTexture,componentType:s.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:_.a.EveryTime,initialValue:[1,y,x],min:0,max:Number.MAX_SAFE_INTEGER}];this.setShaderSemanticsInfoArray(g)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&this.setWorldMatrix(t,i.worldMatrix);let a=i.renderPass.cameraComponent;null==a&&(a=r.C.getComponent(o.M,o.M.current)),a&&(this.setViewInfo(t,a,i.isVr,i.displayIdx),this.setProjection(t,a,i.isVr,i.displayIdx))}}A.lookupTableTexture=new l.wy({str:"lookupTableTexture"})},1995:(e,t,n)=>{n.d(t,{f:()=>M});var i=n(4587),o=n(5868),a=n(5324),r=n(2404),s=n(224),l=n(1986),c=n(430),_=n(7348),h=n(2192),u=n(8430),d=n(7683),m=n(3034),f=n.n(m),p=n(3999),v=n(810),A=n(4710),y=n(3258),x=n(1813),g=n(8182),I=n(9190),b=n(4536),E=n(2566),T=n(3496),S=n(4267),C=n(7035),w=n(1296),R=n(580);class P{static fillTemplate(e,t){const n=Object.assign(t,{WellKnownComponentTIDs:A.z,Config:y.D});return f().fillTemplate(e,n)}static getShaderDataReflection(e,t){const n=this.__copyShaderityObject(e),i=new Map,o=e.code.split(/\r\n|\n/),a=[],r=[];for(const n of o){const o=/^[\t ]*\/\/[\t ]*#param[\t ]+(\w+)[ \t]*:[\t ]*([\w><]+);[\t ]*(\/\/)*[\t ]*(.*)/,s=n.match(o),l=/^[\t ]*@group\(1\) @binding\((\d+)\)[ \t]*var[ \t]*(\w+)[ \t]*:[ \t]*([\w><]+);[\t ]*\/\/*[\t ]*(.*)/,c=n.match(l),_=/^[\t ]*@group\(2\) @binding\((\d+)\)[ \t]*var[ \t]*(\w+)[ \t]*:[ \t]*sampler;/,h=n.match(_);if(s){const n=s[2],i=s[1],o=s[4],a=this.__createShaderSemanticsInfo(n,i,o,e.isFragmentShader,t);r.push(a)}else if(c){const o=parseInt(c[1]),s=c[2],l=c[3],_=c[4],h=this.__createShaderSemanticInfoForTexture(l,s,o,_,e.isFragmentShader,t);i.set(o,h),r.push(h),a.push(n)}else if(h){const e=parseInt(h[1]);if(h[2],i.has(e)){const t=i.get(e);if(t){const e=new R.Z({magFilter:w.dI.Linear,minFilter:w.dI.Linear,wrapS:w.dI.Repeat,wrapT:w.dI.Repeat,wrapR:w.dI.Repeat,anisotropy:!1});t.initialValue[2]=e}}a.push(n)}else a.push(n)}return n.code=a.join("\n"),{shaderSemanticsInfoArray:r,shaderityObject:n}}static __createShaderSemanticInfoForTexture(e,t,n,o,r,s){const l=p.r.Int,c=v.d.Texture2D,_=r?a.H.PixelShader:a.H.VertexShader;let h=i.f5.fromStringCaseSensitively(t);if(null==h){const e=null==s?void 0:s.get(t);h=null!=e?e.semantic:new i.wy({str:t})}const u={semantic:h,compositionType:c,componentType:l,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!1,stage:_,none_u_prefix:!0},d=o.match(/initialValue[\t ]*=[\t ]*(.+)[,\t ]*/);if(d){const e=d[1];u.initialValue=this.__getInitialValueFromTextForTexture(u,n,e)}else u.initialValue=this.__getDefaultInitialValue(u);return u}static __createShaderSemanticsInfo(e,t,n,o,r){const s=p.r.fromWgslString(e),l=v.d.fromWgslString(e),c=o?a.H.PixelShader:a.H.VertexShader;let _=i.f5.fromStringCaseSensitively(t);if(null==_){const e=null==r?void 0:r.get(t);_=null!=e?e.semantic:new i.wy({str:t})}const h={semantic:_,compositionType:l,componentType:s,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!1,stage:c,none_u_prefix:!0};return this.__setRhodoniteOriginalParametersTo(h,n),h}static __setRhodoniteOriginalParametersTo(e,t){var n;const i=t.match(/soloDatum[\t ]*=[\t ]*(\w+)[,\t ]*/);let o=!1;"true"===(null==i?void 0:i[1])&&(o=!0),e.soloDatum=o;const a=t.match(/isCustomSetting[\t ]*=[\t ]*(\w+)[,\t ]*/);let r=!1;"true"===(null==a?void 0:a[1])&&(r=!0),e.isCustomSetting=r;const s=t.match(/updateInterval[\t ]*=[\t ]*(\w+)[,\t ]*/);let l=x.a.FirstTimeOnly;"everytime"===(null===(n=null==s?void 0:s[1])||void 0===n?void 0:n.toLowerCase())&&(l=x.a.EveryTime),e.updateInterval=l;const c=t.match(/initialValue[\t ]*=[\t ]*(.+)[,\t ]*/);if(c){const t=c[1];e.initialValue=this.__getInitialValueFromText(e,t)}else e.initialValue=this.__getDefaultInitialValue(e);const _=t.match(/needUniformInDataTextureMode[\t ]*=[\t ]*(.+)[,\t ]*/);if(_){let t=!1;"true"===(null==_?void 0:_[1])&&(t=!0),e.needUniformInDataTextureMode=t}}static __getInitialValueFromTextForTexture(e,t,n){let i;if(e.compositionType===v.d.Texture2D||e.compositionType===v.d.Texture2DShadow){const e=n.charAt(0).toUpperCase()+n.slice(1);i=[t,h.kT[`dummy${e}Texture`]]}else if(e.compositionType===v.d.TextureCube){const e=n.charAt(0).toUpperCase()+n.slice(1);i=[t,h.kT[`dummy${e}CubeTexture`]]}return i}static __getInitialValueFromText(e,t){const n=t.match(/\(([\d\w., ]+)\)/),i=t=>{e.compositionType!==t&&console.error("component number of initialValue is invalid:"+e.semantic.str)};let o;if(n){const e=n[1].split(",");switch(e.length){case 1:i(v.d.Scalar),o="true"===e[0]?new S.DU(new Float32Array([1])):"false"===e[0]?new S.DU(new Float32Array([0])):new S.DU(new Float32Array([parseFloat(e[0])]));break;case 2:i(v.d.Vec2),o=g.NR.fromCopyArray([parseFloat(e[0]),parseFloat(e[1])]);break;case 3:i(v.d.Vec3),o=I.d6.fromCopyArray([parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2])]);break;case 4:i(v.d.Vec4),o=b.xQ.fromCopyArray([parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])]);break;case 9:i(v.d.Mat3),o=E.x.fromCopy9RowMajor(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),parseFloat(e[7]),parseFloat(e[8]));break;case 16:i(v.d.Mat4),o=T.e.fromCopy16RowMajor(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),parseFloat(e[7]),parseFloat(e[8]),parseFloat(e[9]),parseFloat(e[10]),parseFloat(e[11]),parseFloat(e[12]),parseFloat(e[13]),parseFloat(e[14]),parseFloat(e[15]));break;default:console.error("Invalid format")}}else i(v.d.Scalar),o="true"===t?new S.DU(new Float32Array([1])):"false"===t?new S.DU(new Float32Array([0])):new S.DU(new Float32Array([parseFloat(t)]));return o}static __getDefaultInitialValue(e){return e.compositionType===v.d.Scalar?new S.DU(new Float32Array([0])):e.compositionType===v.d.Vec2?g.NR.zero():e.compositionType===v.d.Vec3?I.d6.zero():e.compositionType===v.d.Vec4?b.xQ.zero():e.compositionType===v.d.Mat2?C.f.identity():e.compositionType===v.d.Mat3?E.x.identity():e.compositionType===v.d.Mat4?T.e.identity():e.compositionType===v.d.Texture2D||e.compositionType===v.d.Texture2DShadow?[0,h.Dx]:e.compositionType===v.d.TextureCube?[0,h.mg]:void console.warn("initial value is not found")}static __copyShaderityObject(e){return{code:e.code,shaderStage:e.shaderStage,isFragmentShader:"fragment"===e.shaderStage}}}class M extends o.P{constructor({name:e,isMorphing:t,isSkinning:n,isLighting:i,isClearCoat:r,isTransmission:s,isVolume:l,isSheen:_,isSpecular:h,isIridescence:m,isAnisotropy:f,isShadow:p,useTangentAttribute:v,useNormalTexture:A,vertexShader:y,pixelShader:x,noUseCameraTransform:g,additionalShaderSemanticInfo:I,vertexShaderWebGpu:b,pixelShaderWebGpu:E}){let T,S;super(null,e+(t?"+morphing":"")+(n?"+skinning":"")+(i?"":"-lighting")+(r?"+clearcoat":"")+(s?"+transmission":"")+(l?"+volume":"")+(h?"+specular":"")+(_?"+sheen":"")+(m?"+iridescence":"")+(f?"+anisotropy":"")+(v?"+tangentAttribute":""),{isMorphing:t,isSkinning:n,isLighting:i}),u.l.currentProcessApproach===d.V.WebGPU?(T=P.getShaderDataReflection(b,o.P.__semanticsMap.get(this.shaderFunctionName)),S=P.getShaderDataReflection(E,o.P.__semanticsMap.get(this.shaderFunctionName)),this.__vertexShaderityObject=T.shaderityObject,this.__pixelShaderityObject=S.shaderityObject):(T=c.u.getShaderDataReflection(y,o.P.__semanticsMap.get(this.shaderFunctionName)),S=c.u.getShaderDataReflection(x,o.P.__semanticsMap.get(this.shaderFunctionName)),this.__vertexShaderityObject=T.shaderityObject,this.__pixelShaderityObject=S.shaderityObject);const C=[];for(const e of T.shaderSemanticsInfoArray)e.stage=a.H.VertexShader,C.push(e);for(const e of S.shaderSemanticsInfoArray){const t=C.find((t=>t.semantic.str===e.semantic.str));t?t.stage=a.H.VertexAndPixelShader:(e.stage=a.H.PixelShader,C.push(e))}i&&(this.__definitions+="#define RN_IS_LIGHTING\n"),n&&(this.__definitions+="#define RN_IS_SKINNING\n"),t&&(this.__definitions+="#define RN_IS_MORPHING\n"),r&&(this.__definitions+="#define RN_USE_CLEARCOAT\n"),s&&(this.__definitions+="#define RN_USE_TRANSMISSION\n"),l&&(this.__definitions+="#define RN_USE_VOLUME\n"),_&&(this.__definitions+="#define RN_USE_SHEEN\n"),h&&(this.__definitions+="#define RN_USE_SPECULAR\n"),m&&(this.__definitions+="#define RN_USE_IRIDESCENCE\n"),f&&(this.__definitions+="#define RN_USE_ANISOTROPY\n"),p&&(this.__definitions+="#define RN_USE_SHADOW_MAPPING\n"),v&&(this.__definitions+="#define RN_USE_TANGENT_ATTRIBUTE\n"),A&&(this.__definitions+="#define RN_USE_NORMAL_TEXTURE\n"),g&&(this.__definitions+="#define RN_NO_CAMERA_TRANSFORM\n"),this.setShaderSemanticsInfoArray(C.concat(I))}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:a}){if(a.setUniform){if(this.setWorldMatrix(t,a.worldMatrix),this.setNormalMatrix(t,a.normalMatrix),this.setIsBillboard(t,a.isBillboard),n||a.isVr){let e=a.renderPass.cameraComponent;null==e&&(e=r.C.getComponent(s.M,s.M.current)),this.setViewInfo(t,e,a.isVr,a.displayIdx),this.setProjection(t,e,a.isVr,a.displayIdx)}n&&this.setLightsInfo(t,a.lightComponents,e,a.setUniform);const i=a.entity.tryToGetSkeletal();this.setSkinning(t,a.setUniform,i)}if(a.diffuseCube&&a.diffuseCube.isTextureReady?this.__webglResourceRepository.setUniformValue(t,i.f5.DiffuseEnvTexture.str,n,[5,a.diffuseCube]):this.__webglResourceRepository.setUniformValue(t,i.f5.DiffuseEnvTexture.str,n,[5,h.pn]),a.specularCube&&a.specularCube.isTextureReady?this.__webglResourceRepository.setUniformValue(t,i.f5.SpecularEnvTexture.str,n,[6,a.specularCube]):this.__webglResourceRepository.setUniformValue(t,i.f5.SpecularEnvTexture.str,n,[6,h.pn]),a.setUniform){if(n){const{mipmapLevelNumber:e,meshRenderComponent:o,diffuseHdriType:r,specularHdriType:s}=M.__setupHdriParameters(a);this.__webglResourceRepository.setUniformValue(t,i.f5.IBLParameter.str,n,{x:e,y:o.diffuseCubeMapContribution,z:o.specularCubeMapContribution,w:o.rotationOfCubeMap}),this.__webglResourceRepository.setUniformValue(t,i.f5.HDRIFormat.str,n,{x:r,y:s})}}else{const{mipmapLevelNumber:t,meshRenderComponent:n,diffuseHdriType:r,specularHdriType:s}=M.__setupHdriParameters(a),l=o.P.__tmp_vector4;l.x=t,l.y=n.diffuseCubeMapContribution,l.z=n.specularCubeMapContribution,l.w=n.rotationOfCubeMap,e.setParameter(i.f5.IBLParameter,l);const c=o.P.__tmp_vector2;c.x=r,c.y=s,e.setParameter(i.f5.HDRIFormat,c)}const l=a.entity.tryToGetBlendShape();this.setMorphInfo(t,a.entity.getMesh(),a.primitive,l);const c=a.glw.canvas.width,_=a.glw.canvas.height,u=M.__globalDataRepository.getValue(i.f5.BackBufferTextureSize,0);u._v[0]=c,u._v[1]=_,t._gl.uniform2fv(t.backBufferTextureSize,u._v);const d=M.__globalDataRepository.getValue(i.f5.VrState,0);d._v[0]=a.isVr?1:0,d._v[1]=a.displayIdx,t._gl.uniform2iv(t.vrState,d._v)}static __setupHdriParameters(e){let t=1;e.specularCube&&(t=e.specularCube.mipmapLevelNumber);const n=e.entity.getMeshRenderer();let i=l.c.LDR_SRGB.index,o=l.c.LDR_SRGB.index;return n.diffuseCubeMap&&(i=n.diffuseCubeMap.hdriFormat.index),n.specularCubeMap&&(o=n.specularCubeMap.hdriFormat.index),{mipmapLevelNumber:t,meshRenderComponent:n,diffuseHdriType:i,specularHdriType:o}}}M.__globalDataRepository=_.$.getInstance()},621:(e,t,n)=>{n.d(t,{Q:()=>f});var i=n(5868),o=n(224),a=n(2404),r=n(3999),s=n(810),l=n(3616),c=n(4587),_=n(5324),h=n(1813),u=n(2471);const d={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec3 v_normal_inWorld;\nout vec4 v_position_inLocal;\nout vec4 v_position_inWorld;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n v_position_inLocal = gl_Position;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},m={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec4 v_position_inLocal;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvec4 encodeDepthToRGBA(float depth){\n float r = depth;\n float g = fract(r * 255.0);\n float b = fract(g * 255.0);\n float a = fract(b * 255.0);\n float coef = 1.0 / 255.0;\n r -= g * coef;\n g -= b * coef;\n b -= a * coef;\n return vec4(r, g, b, a);\n}\n\nvoid main (){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n float depth;\n bool isPointLight = get_isPointLight(materialSID, 0);\n if(isPointLight){\n float zNear = get_zNearInner(materialSID, 0);\n float zFar = get_zFarInner(materialSID, 0);\n float normalizationCoefficient = 1.0 / (zFar - zNear);\n depth = normalizationCoefficient * length(v_position_inLocal);\n }else{\n depth = gl_FragCoord.z;\n }\n\n float depthPow = get_depthPow(materialSID, 0);\n float depthData = pow(depth, depthPow);\n vec4 encodedDepth = encodeDepthToRGBA(depthData);\n\n rt0 = encodedDepth;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};class f extends i.P{constructor(e,{isSkinning:t}){super(null,"depthEncodeShading"+(t?"+skinning":""),{isMorphing:!1,isSkinning:t,isLighting:!1},d,m),this.__lastZNear=0,this.__lastZFar=0;const n=[{semantic:f.zNearInner,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:l.Ru.fromCopyNumber(.1),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:f.zFarInner,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:l.Ru.fromCopyNumber(1e4),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:f.isPointLight,componentType:r.r.Bool,compositionType:s.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:l.Ru.fromCopyNumber(1),min:0,max:1},{semantic:f.depthPow,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:l.Ru.fromCopyNumber(e),min:1,max:2},{semantic:c.f5.PointSize,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:l.Ru.fromCopyNumber(30),min:0,max:100},{semantic:c.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:s.d.Vec3,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:u.P.fromCopyArray([0,.1,.01]),min:0,max:1}];t&&(this.__definitions+="#define RN_IS_SKINNING"),this.setShaderSemanticsInfoArray(n)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){let r=i.renderPass.cameraComponent;null==r&&(r=a.C.getComponent(o.M,o.M.current)),i.setUniform?(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix),this.setViewInfo(t,r,i.isVr,i.displayIdx),this.setProjection(t,r,i.isVr,i.displayIdx),(n||this.__lastZNear!==r.zNearInner)&&(t._gl.uniform1f(t.zNearInner,r.zNearInner),this.__lastZNear=r.zNearInner),this.__lastZFar!==r.zFarInner&&(t._gl.uniform1f(t.zFarInner,r.zFarInner),this.__lastZFar=r.zFarInner)):(e.setParameter(f.zNearInner,r.zNearInner),e.setParameter(f.zFarInner,r.zFarInner));const s=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,s)}}f.zNearInner=new c.wy({str:"zNearInner"}),f.zFarInner=new c.wy({str:"zFarInner"}),f.isPointLight=new c.wy({str:"isPointLight"}),f.depthPow=new c.wy({str:"depthPow"})},9604:(e,t,n)=>{n.d(t,{t:()=>f});var i=n(4587),o=n(810),a=n(3999),r=n(5324),s=n(1813),l=n(2404),c=n(224),_=n(3616),h=n(5868);const u={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec3 a_position;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},d={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n\tfloat tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n vec4 baseColor = texture(u_baseColorTexture, offset * tFrag);\n\n float luminance = length(baseColor);\n\n float luminanceCriterion = get_luminanceCriterion(materialSID, 0);\n if(luminance < luminanceCriterion){\n baseColor = vec4(0.0);\n }else{\n float luminanceReduce = get_luminanceReduce(materialSID, 0);\n baseColor.rgb = pow(baseColor.rgb, vec3(luminanceReduce));\n }\n\n rt0 = baseColor;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var m=n(2192);class f extends h.P{constructor(e,t){super(null,"HighLuminanceDetectShading",{},u,d);const n=[{semantic:f.LuminanceCriterion,componentType:a.r.Float,compositionType:o.d.Scalar,stage:r.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.FirstTimeOnly,soloDatum:!1,initialValue:_.Ru.fromCopyNumber(2),min:0,max:Number.MAX_VALUE},{semantic:f.LuminanceReduce,componentType:a.r.Float,compositionType:o.d.Scalar,stage:r.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.FirstTimeOnly,soloDatum:!1,initialValue:_.Ru.fromCopyNumber(.25),min:0,max:1}];let l,c;const h=e.getFramebuffer();null!=h&&null!=h.colorAttachments[t]?(l=h.colorAttachments[t],c=h.width):(l=m.mg,c=1,null!=h?console.warn("renderPass does not have framebuffer.colorAttachments["+t+"]"):console.warn("renderPass does not have framebuffer")),n.push({semantic:i.f5.FramebufferWidth,componentType:a.r.Float,compositionType:o.d.Scalar,stage:r.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.EveryTime,soloDatum:!1,initialValue:_.Ru.fromCopyNumber(c),min:0,max:Number.MAX_VALUE},{semantic:i.f5.BaseColorTexture,componentType:a.r.Int,compositionType:o.d.Texture2D,stage:r.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.EveryTime,initialValue:[0,l],min:0,max:Number.MAX_SAFE_INTEGER}),this.setShaderSemanticsInfoArray(n)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&this.setWorldMatrix(t,i.worldMatrix);let o=i.renderPass.cameraComponent;null==o&&(o=l.C.getComponent(c.M,c.M.current)),o&&(this.setViewInfo(t,o,i.isVr,i.displayIdx),this.setProjection(t,o,i.isVr,i.displayIdx))}}f.LuminanceCriterion=new i.wy({str:"luminanceCriterion"}),f.LuminanceReduce=new i.wy({str:"luminanceReduce"}),f.FramebufferWidth=new i.wy({str:"framebufferWidth"})},8774:(e,t,n)=>{n.d(t,{z:()=>v});var i=n(4587),o=n(5868),a=n(810),r=n(3999),s=n(2471),l=n(5324),c=n(3616),_=n(1813),h=n(2404),u=n(224),d=n(3496),m=n(2566);const f={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout float v_instanceInfo;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\n\nvoid main()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n v_instanceInfo = a_instanceInfo.x;\n}\n",shaderStage:"vertex",isFragmentShader:!1},p={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin float v_instanceInfo;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nconst vec4 bitEnc = vec4(1.,255.,65025.,16581375.);\nconst vec4 bitDec = 1./bitEnc;\n\nvec4 encodeFloatRGBA(float v) {\n float val = v;\n float r = mod(val, 255.0);\n val -= r;\n float g = mod(val, 65025.0);\n val -= g;\n float b = mod(val, 16581375.0);\n return vec4(r/255.0, g/65025.0, b/16581375.0, 1.0);\n}\n\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n rt0 = encodeFloatRGBA(v_instanceInfo);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};class v extends o.P{constructor(){super(null,"entityUidOutputShading+skinning-lighting",{isMorphing:!1,isSkinning:!0,isLighting:!1},f,p);const e=[{semantic:i.f5.WorldMatrix,isComponentData:!0,compositionType:a.d.Mat4,componentType:r.r.Float,stage:l.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.EveryTime,initialValue:d.e.zero()},{semantic:i.f5.NormalMatrix,isComponentData:!0,compositionType:a.d.Mat3,componentType:r.r.Float,stage:l.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.EveryTime,initialValue:m.x.zero()},{semantic:i.f5.PointSize,componentType:r.r.Float,compositionType:a.d.Scalar,stage:l.H.VertexShader,isCustomSetting:!1,updateInterval:_.a.FirstTimeOnly,soloDatum:!0,initialValue:c.Ru.fromCopyNumber(30),min:0,max:100},{semantic:i.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:a.d.Vec3,stage:l.H.VertexShader,isCustomSetting:!1,updateInterval:_.a.FirstTimeOnly,soloDatum:!0,initialValue:s.P.fromCopyArray([0,.1,.01]),min:0,max:1}];this.__definitions+="#define RN_IS_SKINNING\n",this.setShaderSemanticsInfoArray(e)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix));let o=i.renderPass.cameraComponent;null==o&&(o=h.C.getComponent(u.M,u.M.current)),this.setViewInfo(t,o,i.isVr,i.displayIdx),this.setProjection(t,o,i.isVr,i.displayIdx);const a=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,a),this.setLightsInfo(t,i.lightComponents,e,i.setUniform)}}},8287:(e,t,n)=>{n.d(t,{b:()=>p});var i=n(3999),o=n(810),a=n(3616),r=n(4587),s=n(5324),l=n(1813),c=n(2390),_=n(5868),h=n(2404),u=n(224);const d={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord;\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec2 v_texcoord;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n v_normal_inWorld = normalMatrix * a_normal;\n v_position_inWorld = worldMatrix * vec4(a_position, 1.0);\n v_texcoord = a_texcoord;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},m={code:'\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n\n/* shaderity: @{getters} */\n\n#define MATH_PI 3.141592\n\n// These codes are referenced from https://github.com/knarkowicz/FurnaceTest\nfloat roughnessRemap(float userRoughness) {\n return userRoughness * userRoughness;\n}\n\n// GGX NDF\nfloat d_ggx(float userRoughness, float NH) {\n float alphaRoughness = userRoughness * userRoughness;\n float roughnessSqr = alphaRoughness * alphaRoughness;\n float f = (roughnessSqr - 1.0) * NH * NH + 1.0;\n return roughnessSqr / (MATH_PI * f * f);\n}\n\n// this is from https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 envBRDFApprox( float Roughness, float NoV ) {\n const vec4 c0 = vec4(-1, -0.0275, -0.572, 0.022 );\n const vec4 c1 = vec4(1, 0.0425, 1.04, -0.04 );\n vec4 r = Roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( -9.28 * NoV ) ) * r.x + r.y;\n vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n return AB;\n}\n\nfloat specularIBL(float userRoughness, float NV, float f0) {\n /// Use specular BRDF LUT\n // vec3 brdf = texture(u_brdfLutTexture, vec2(NV, 1.0 - userRoughness)).rgb;\n // float specular = 1.0 * (f0 * brdf.x + brdf.y);\n\n /// Use specular BRDF Approx\n vec2 f_ab = envBRDFApprox(userRoughness, NV);\n vec3 specular = vec3(f0) * f_ab.x + f_ab.y;\n return specular.x;\n}\n\n// The Schlick Approximation to Fresnel\nfloat fresnel(float f0, float VH) {\n return f0 + (1.0 - f0) * pow(1.0 - VH, 5.0);\n}\n\nfloat smithG1(float roughness, float NoV)\n{\n\tfloat a = roughnessRemap( roughness );\n\tfloat a2 = a * a;\n\tfloat NoV2 = NoV * NoV;\n\tfloat lambda = (-1.0 + sqrt(1.0 + a2 * (1.0 - NoV2) / NoV2)) * 0.5;\n\treturn 1.0 / (1.0 + lambda);\n}\n\nfloat smithG(float roughness, float NoV, float NoL)\n{\n\tfloat a = roughnessRemap( roughness );\n\tfloat a2 = a * a;\n\tfloat NoV2 = NoV * NoV;\n\tfloat NoL2 = NoL * NoL;\n\tfloat lambdaV = (-1.0 + sqrt(1.0 + a2 * (1.0 - NoV2) / NoV2)) * 0.5;\n\tfloat lambdaL = (-1.0 + sqrt(1.0 + a2 * (1.0 - NoL2) / NoL2)) * 0.5;\n\treturn 1.0 / (1.0 + lambdaV + lambdaL);\n}\n\nfloat g_shieldingForWeak(float alphaRoughness, float NV, float NL) {\n float r = alphaRoughness;\n\n // Local Masking using "Schlick-Smith" Masking Function\n float localMasking = 2.0 * NV / (NV + sqrt(r * r + (1.0 - r * r) * (NV * NV)));\n\n return localMasking;\n}\n\n\nfloat g_shielding(float roughness, float NV, float NL) {\n float a = roughnessRemap( roughness );\n float r = a;\n\n // Local Shadowing using "Schlick-Smith" Masking Function\n float localShadowing = 2.0 * NL / (NL + sqrt(r * r + (1.0 - r * r) * (NL * NL)));\n\n // Local Masking using "Schlick-Smith" Masking Function\n float localMasking = 2.0 * NV / (NV + sqrt(r * r + (1.0 - r * r) * (NV * NV)));\n\n return localShadowing * localMasking;\n}\n\nfloat v_SmithGGXCorrelatedForWeak(float roughness, float NV, float NL) {\n float a = roughnessRemap( roughness );\n float a2 = a * a;\n float GGXV = NL * sqrt(NV * NV * (1.0 - a2) + a2);\n return 0.5 / (GGXV);\n}\n\nfloat v_SmithGGXCorrelated(float roughness, float NV, float NL) {\n float a = roughnessRemap( roughness );\n float a2 = a * a;\n float GGXV = NL * sqrt(NV * NV * (1.0 - a2) + a2);\n float GGXL = NV * sqrt(NL * NL * (1.0 - a2) + a2);\n return 0.5 / (GGXV + GGXL);\n}\n\n// this is from https://learnopengl.com/PBR/IBL/Specular-IBL\nfloat vanDerCorpus(int n, int base)\n{\n float invBase = 1.0 / float(base);\n float denom = 1.0;\n float result = 0.0;\n\n for(int i = 0; i < 32; ++i)\n {\n if(n > 0)\n {\n denom = mod(float(n), 2.0);\n result += denom * invBase;\n invBase = invBase / 2.0;\n n = int(float(n) / 2.0);\n }\n }\n\n return result;\n}\n\nvec2 hammersleyNoBitOps(int i, int N)\n{\n return vec2(float(i)/float(N), vanDerCorpus(i, 2));\n}\n\nfloat radicalInverse_VdC(uint bits)\n{\n bits = (bits << 16u) | (bits >> 16u);\n bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\n bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\n bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\n bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\n return float(bits) * 2.3283064365386963e-10; // / 0x100000000\n}\n// ----------------------------------------------------------------------------\nvec2 hammersley(uint i, uint N)\n{\n return vec2(float(i)/float(N), radicalInverse_VdC(i));\n}\n\nvec3 sampleHemisphereGGX(vec2 Xi, float roughness) {\n float a = roughnessRemap(roughness);\n\tfloat a2 = a * a;\n\n float phi = 2.0 * MATH_PI * Xi.x;\n float cosPhi = cos(phi);\n float sinPhi = sin(phi);\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a2 - 1.0) * Xi.y)); // GGX\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\n\n return vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\n}\n\nfloat weakWhiteFurnaceTest(float roughness, float NoV, float f0, int g_type, int disable_fresnel)\n{\n\tfloat vx = sqrt(1.0 - NoV * NoV);\n\tfloat vy = 0.0;\n\tfloat vz = NoV;\n\n\tfloat integral = 0.0;\n\tconst uint sampleNum = 2048u;\n\tfor (uint i = 0u; i < sampleNum; ++i)\n\t{\n vec2 Xi = hammersley(i, sampleNum);\n\n vec3 hvec = sampleHemisphereGGX(Xi, roughness);\n\n\t\tfloat VoHUnsat = vx * hvec.x + vy * hvec.y + vz * hvec.z;\n\n float lz = 2.0 * VoHUnsat * hvec.z - vz;\n\n float NoL = max(lz, 0.0);\n\t\tfloat NoH = max(hvec.z, 0.0);\n\t\tfloat VoH = max(VoHUnsat, 0.0);\n\n float f = fresnel(f0, VoH);\n\n float g1 = 0.0;\n if (g_type == 0) {\n g1 = smithG1(roughness, NoV);\n } else if (g_type == 1) {\n g1 = g_shieldingForWeak(roughness, NoV, NoL);\n } else if (g_type == 2) {\n g1 = v_SmithGGXCorrelatedForWeak(roughness, NoV, NoL) * 4.0 * NoV * NoL;\n }\n\n float pdf = 4.0 * VoH / NoH;\n float integralValue = (g1 * pdf) / (4.0 * NoV);\n if (disable_fresnel == 0) {\n integralValue *= f;\n }\n // integralValue *= 0.5; // Set furnace color 0.5\n\n integral += integralValue;\n\n\t}\n\tintegral /= float(sampleNum);\n\treturn clamp(integral, 0.0, 1.0);\n}\n\nfloat whiteFurnaceTest(float roughness, float NoV, float f0, int g_type, int disable_fresnel)\n{\n\tfloat vx = sqrt(1.0 - NoV * NoV);\n\tfloat vy = 0.0;\n\tfloat vz = NoV;\n\n\tfloat integral = 0.0;\n\tconst uint sampleNum = 4096u;\n\tfor (uint i = 0u; i < sampleNum; ++i)\n\t{\n\n vec2 Xi = hammersley(i, sampleNum);\n\n vec3 hvec = sampleHemisphereGGX(Xi, roughness);\n\n\t\tfloat VoHUnsat = vx * hvec.x + vy * hvec.y + vz * hvec.z;\n\t\tfloat lx = 2.0 * VoHUnsat * hvec.x - vx;\n\t\tfloat ly = 2.0 * VoHUnsat * hvec.y - vy;\n\t\tfloat lz = 2.0 * VoHUnsat * hvec.z - vz;\n\n\t\tfloat NoL = max(lz, 0.0);\n\t\tfloat NoH = max(hvec.z, 0.0);\n float VoH = max(VoHUnsat, 0.0);\n\n float f = fresnel(f0, VoH);\n\n float g = 0.0;\n if (g_type == 0) {\n g = smithG(roughness, NoV, NoL);\n } else if (g_type == 1){\n g = g_shielding(roughness, NoV, NoL);\n } else if (g_type == 2){\n g = v_SmithGGXCorrelated(roughness, NoV, NoL) * (4.0 * NoV * NoL);\n } else if (g_type == 3) {\n g = 0.0;\n }\n\n float pdf = 4.0 * VoH / NoH;\n float integralValue = (g * pdf) / (4.0 * NoV);\n if (disable_fresnel == 0 && g_type != 3) {\n integralValue *= f;\n }\n // integralValue *= 0.5; // Set furnace color 0.5\n integral += integralValue;\n\t}\n integral /= float(sampleNum);\n if (g_type == 3) {\n integral = specularIBL(roughness, NoV, f0);\n }\n\treturn clamp(integral, 0.0, 1.0);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec2 quadSizeInPixel = get_screenInfo(materialSID, 0);\n float roughness = 0.0;\n float NoV = 0.0; // normal dot view vector\n\n // 2D mode\n int mode = get_mode(materialSID, 0);\n if (mode == 0) {\n roughness = (gl_FragCoord.y) / quadSizeInPixel.y;\n NoV = (gl_FragCoord.x) / quadSizeInPixel.x;\n } else {\n // object mode\n // Roughness\n const float c_MinRoughness = 0.04;\n vec2 metallicRoughnessFactor = get_metallicRoughnessFactor(materialSID, 0);\n float userRoughness = metallicRoughnessFactor.y;\n float metallic = metallicRoughnessFactor.x;\n\n vec4 ormTexel = texture(u_metallicRoughnessTexture, v_texcoord);\n userRoughness = ormTexel.g * userRoughness;\n userRoughness = clamp(userRoughness, c_MinRoughness, 1.0);\n roughness = userRoughness;\n\n // vec3 viewVector = normalize(vec3(0.0, 0.0, 10.0) - v_position_inWorld.xyz);\n // vec3 viewVector = normalize(u_viewPosition - v_position_inWorld.xyz);\n vec3 viewVector = vec3(0.0, 0.0, 1.0);\n NoV = dot(v_normal_inWorld, viewVector);\n }\n\n int debugView = get_debugView(materialSID, 0);\n float f0 = get_f0(materialSID, 0);\n int g_type = get_g_type(materialSID, 0);\n int disable_fresnel = get_disable_fresnel(materialSID, 0);\n\n if (debugView == 0) {\n float whiteFurnaceResult = whiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n rt0 = vec4(whiteFurnaceResult, whiteFurnaceResult, whiteFurnaceResult, 1.0);\n\n } else if (debugView == 1) {\n float weakWhiteFurnaceResult = weakWhiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n rt0 = vec4(weakWhiteFurnaceResult, weakWhiteFurnaceResult, weakWhiteFurnaceResult, 1.0);\n\n } else if (debugView == 2){\n float nn = NoV*0.5+0.5;\n rt0 = vec4(nn, nn, nn, 1.0);\n\n } else if (debugView == 3){\n rt0 = vec4(v_normal_inWorld.xyz, 1.0);\n\n } else if (debugView == 4){\n float whiteFurnaceResult = whiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n float weakWhiteFurnaceResult = weakWhiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n rt0 = vec4(whiteFurnaceResult, weakWhiteFurnaceResult, 0.0, 1.0);\n\n } else if (debugView == 5){\n rt0 = vec4(roughness, NoV, 0.0, 1.0);\n\n } else {\n rt0 = vec4(1.0, 1.0, 1.0, 1.0);\n }\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n',shaderStage:"fragment",isFragmentShader:!0};var f=n(2192);class p extends _.P{constructor(){super(null,"FurnaceTestShading",{},d,m);const e=[{semantic:p.debugView,componentType:i.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(0),min:0,max:1},{semantic:p.disable_fresnel,componentType:i.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(0),min:0,max:1},{semantic:p.f0,componentType:i.r.Float,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(1),min:0,max:1},{semantic:p.g_type,componentType:i.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(0),min:0,max:3},{semantic:p.mode,componentType:i.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(0),min:0,max:1},{semantic:r.f5.ScreenInfo,componentType:i.r.Float,compositionType:o.d.Vec2,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:c.FM.fromCopyArray2([0,0]),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:r.f5.MetallicRoughnessFactor,componentType:i.r.Float,compositionType:o.d.Vec2,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:c.FM.fromCopyArray2([1,1]),min:0,max:2},{semantic:r.f5.MetallicRoughnessTexture,componentType:i.r.Int,compositionType:o.d.Texture2D,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,initialValue:[1,f.Dx],min:0,max:Number.MAX_SAFE_INTEGER}];this.setShaderSemanticsInfoArray(e)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){if(i.setUniform&&(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix),n)){let n=i.renderPass.cameraComponent;null==n&&(n=h.C.getComponent(u.M,u.M.current)),this.setViewInfo(t,n,i.isVr,i.displayIdx),this.setProjection(t,n,i.isVr,i.displayIdx),this.setLightsInfo(t,i.lightComponents,e,i.setUniform)}}}p.mode=new r.wy({str:"mode"}),p.debugView=new r.wy({str:"debugView"}),p.g_type=new r.wy({str:"g_type"}),p.disable_fresnel=new r.wy({str:"disable_fresnel"}),p.f0=new r.wy({str:"f0"})},1554:(e,t,n)=>{n.d(t,{f:()=>I});var i=n(5868),o=n(5704),a=n(224),r=n(7987),s=n(2404),l=n(3999),c=n(810),_=n(3258),h=n(3616),u=n(4587),d=n(5324),m=n(1813),f=n(2471),p=n(7192),v=n(4255);const A={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\n// This shader is based on https://github.com/Santarh/MToon\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nin vec3 a_normal;\nin vec4 a_baryCentricCoord;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec2 v_texcoord_0;\nout vec3 v_baryCentricCoord;\nout vec3 v_normal_inView;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\nin vec4 a_tangent;\nout vec3 v_tangent_inWorld;\nout vec3 v_binormal_inWorld; // bitangent_inWorld\n#endif\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_NONE\n return;\n #endif\n #endif\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isSkinning = false;\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n\n v_normal_inView = vec3(viewMatrix * vec4(v_normal_inWorld, 0.0));\n\n #ifndef RN_MTOON_IS_OUTLINE\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n #else\n #if defined(RN_MTOON_HAS_OUTLINE_WIDTH_TEXTURE)\n float outlineTex = texture(u_outlineWidthTexture, a_texcoord_0).r;\n #else\n float outlineTex = 1.0;\n #endif\n\n #if defined(RN_MTOON_OUTLINE_WIDTH_WORLD)\n float outlineWidth = get_outlineWidth(materialSID, 0);\n vec3 outlineOffset = 0.01 * outlineWidth * outlineTex * a_normal;\n vec4 worldOutlineOffset = worldMatrix * vec4(outlineOffset, 0.0);\n gl_Position = projectionMatrix * viewMatrix * (v_position_inWorld + worldOutlineOffset);\n\n #elif defined(RN_MTOON_OUTLINE_WIDTH_SCREEN)\n vec4 vertex = projectionMatrix * viewMatrix * v_position_inWorld;\n\n vec3 clipNormal = (projectionMatrix * vec4(v_normal_inView, 1.0)).xyz;\n vec2 projectedNormal = normalize(clipNormal.xy);\n float outlineScaledMaxDistance = get_outlineScaledMaxDistance(materialSID, 0);\n projectedNormal *= min(vertex.w, outlineScaledMaxDistance);\n float aspect = abs(get_aspect(0.0, 0)); //solo datum\n projectedNormal.x *= aspect;\n\n float outlineWidth = get_outlineWidth(materialSID, 0);\n vertex.xy += 0.01 * outlineWidth * outlineTex * projectedNormal * clamp(1.0 - abs(v_normal_inView.z), 0.0, 1.0); // ignore offset when normal toward camera\n\n gl_Position = vertex;\n #else\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n #endif\n #endif\n\n #ifdef RN_USE_TANGENT_ATTRIBUTE\n v_tangent_inWorld = normalMatrix * a_tangent.xyz;\n v_binormal_inWorld = cross(v_normal_inWorld, v_tangent_inWorld) * a_tangent.w;\n #endif\n\n v_texcoord_0 = a_texcoord_0;\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n}\n",shaderStage:"vertex",isFragmentShader:!1},y={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nconst float EPS_COL = 0.00001;\n\nin vec2 v_texcoord_0;\nin vec3 v_baryCentricCoord;\nin vec3 v_normal_inView;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n in vec3 v_tangent_inWorld;\n in vec3 v_binormal_inWorld; // bitangent_inWorld\n#endif\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n mat3 getTBN(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord) {\n vec3 tangent_inWorld = normalize(v_tangent_inWorld);\n vec3 binormal_inWorld = normalize(v_binormal_inWorld);\n mat3 tbnMat_tangent_to_world = mat3(tangent_inWorld, binormal_inWorld, normal_inWorld);\n\n return tbnMat_tangent_to_world;\n }\n#else\n // This is based on http://www.thetenthplanet.de/archives/1180\n mat3 cotangent_frame(vec3 normal_inWorld, vec3 position, vec2 uv) {\n uv = gl_FrontFacing ? uv : -uv;\n\n // get edge vectors of the pixel triangle\n vec3 dp1 = dFdx(position);\n vec3 dp2 = dFdy(position);\n vec2 duv1 = dFdx(uv);\n vec2 duv2 = dFdy(uv);\n\n // solve the linear system\n vec3 dp2perp = cross(dp2, normal_inWorld);\n vec3 dp1perp = cross(normal_inWorld, dp1);\n vec3 tangent = dp2perp * duv1.x + dp1perp * duv2.x;\n vec3 bitangent = dp2perp * duv1.y + dp1perp * duv2.y;\n bitangent *= -1.0;\n\n // construct a scale-invariant frame\n float invMat = inversesqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));\n return mat3(tangent * invMat, bitangent * invMat, normal_inWorld);\n }\n\n mat3 getTBN(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord) {\n mat3 tbnMat_tangent_to_world = cotangent_frame(normal_inWorld, -viewVector, texcoord);\n\n return tbnMat_tangent_to_world;\n }\n#endif\n\n\nvoid main (){\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_NONE\n discard;\n #endif\n #endif\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n\n // TODO\n // uv transform\n\n // TODO\n // uv animation\n\n // main color\n vec4 litTextureColor = texture(u_litColorTexture, v_texcoord_0);\n vec4 litColorFactor = get_litColor(materialSID, 0);\n\n // alpha\n float alpha = 1.0;\n\n #ifdef RN_ALPHATEST_ON\n alpha = litTextureColor.a * litColorFactor.a;\n float cutoff = get_cutoff(materialSID, 0);\n if(alpha < cutoff) discard;\n #elif defined(RN_ALPHABLEND_ON)\n alpha = litTextureColor.a * litColorFactor.a;\n #endif\n\n if (alpha < 0.01) {\n discard;\n }else{\n rt0.w = alpha;\n }\n\n\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_COLOR_FIXED\n vec3 outlineColor = get_outlineColor(materialSID, 0);\n rt0.xyz = outlineColor;\n\n rt0.xyz = srgbToLinear(rt0.xyz);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n #endif\n #endif\n\n // view vector\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n vec3 viewVector = viewPosition - v_position_inWorld.xyz;\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n #ifdef RN_MTOON_HAS_BUMPMAP\n vec3 normal = texture(u_normalTexture, v_texcoord_0).xyz * 2.0 - 1.0;\n mat3 TBN = getTBN(normal_inWorld, viewVector, v_texcoord_0);\n normal_inWorld = normalize(TBN * normal);\n #endif\n\n #ifdef RN_MTOON_IS_OUTLINE\n normal_inWorld *= -1.0;\n #endif\n\n\n // Lighting, Direct Light\n\n float shadowAttenuation = 1.0;\n // TODO: shadowmap computation\n\n float receiveShadowRate = get_receiveShadowRate(materialSID, 0);\n float lightAttenuation = shadowAttenuation * mix(1.0, shadowAttenuation, receiveShadowRate * texture(u_receiveShadowTexture, v_texcoord_0).r);\n\n float shadingGradeRate = get_shadingGradeRate(materialSID, 0);\n float shadingGrade = 1.0 - shadingGradeRate * (1.0 - texture(u_shadingGradeTexture, v_texcoord_0).r);\n float lightColorAttenuation = get_lightColorAttenuation(materialSID, 0);\n\n vec3 shadeColorFactor = get_shadeColor(materialSID, 0);\n vec3 shadeColor = shadeColorFactor * texture(u_shadeColorTexture, v_texcoord_0).xyz;\n shadeColor.xyz = srgbToLinear(shadeColor.xyz);\n\n vec3 litColor = litColorFactor.xyz * litTextureColor.xyz;\n litColor.xyz = srgbToLinear(litColor.xyz);\n\n\n float shadeShift = get_shadeShift(materialSID, 0);\n float shadeToony = get_shadeToony(materialSID, 0);\n\n vec3 lightings[/* shaderity: @{Config.maxLightNumberInShader} */];\n #ifdef RN_MTOON_DEBUG_LITSHADERATE\n float lightIntensities[/* shaderity: @{Config.maxLightNumberInShader} */];\n #endif\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n // lightAttenuation *= distanceAttenuation * spotEffect;\n float dotNL = dot(light.direction, normal_inWorld);\n float lightIntensity = dotNL * 0.5 + 0.5; // from [-1, +1] to [0, 1]\n lightIntensity = lightIntensity * lightAttenuation; // TODO: receive shadow\n lightIntensity = lightIntensity * shadingGrade; // darker\n lightIntensity = lightIntensity * 2.0 - 1.0; // from [0, 1] to [-1, +1]\n\n // tooned. mapping from [minIntensityThreshold, maxIntensityThreshold] to [0, 1]\n float maxIntensityThreshold = mix(1.0, shadeShift, shadeToony);\n float minIntensityThreshold = shadeShift;\n lightIntensity = clamp((lightIntensity - minIntensityThreshold) / max(EPS_COL, (maxIntensityThreshold - minIntensityThreshold)), 0.0, 1.0);\n #ifdef RN_MTOON_DEBUG_LITSHADERATE\n lightIntensities[i] = lightIntensity;\n #endif\n\n // Albedo color\n vec3 col = mix(shadeColor, litColor, lightIntensity);\n\n // Direct Light\n vec3 lighting = light.attenuatedIntensity;\n lighting = mix(lighting, vec3(max(EPS_COL, max(lighting.x, max(lighting.y, lighting.z)))), lightColorAttenuation); // color atten\n\n\n if(i > 0){\n lighting *= 0.5; // darken if additional light.\n lighting *= min(0.0, dotNL) + 1.0; // darken dotNL < 0 area by using half lambert\n // lighting *= shadowAttenuation; // darken if receiving shadow\n #ifdef RN_ALPHABLEND_ON\n lighting *= step(0.0, dotNL); // darken if transparent. Because Unity's transparent material can't receive shadowAttenuation.\n #endif\n }\n\n col *= lighting;\n lightings[i] = lighting;\n\n rt0.xyz += col;\n\n lightAttenuation = 1.0;\n }\n\n\n // Indirect Light\n vec3 indirectLighting = get_ambientColor(materialSID, 0);\n indirectLighting = srgbToLinear(indirectLighting);\n indirectLighting = mix(indirectLighting, vec3(max(EPS_COL, max(indirectLighting.x, max(indirectLighting.y, indirectLighting.z)))), lightColorAttenuation); // color atten\n // TODO: use ShadeIrad in www.ppsloan.org/publications/StupidSH36.pdf\n\n rt0.xyz += indirectLighting * litColor;\n rt0.xyz = min(rt0.xyz, litColor); // comment out if you want to PBR absolutely.\n\n\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_COLOR_MIXED\n vec3 outlineColor = get_outlineColor(materialSID, 0);\n outlineColor = srgbToLinear(outlineColor);\n float outlineLightingMix = get_outlineLightingMix(materialSID, 0);\n rt0.xyz = outlineColor * mix(vec3(1.0), rt0.xyz, outlineLightingMix);\n #endif\n #else\n vec3 viewDirection = normalize(viewVector);\n\n float rimFresnelPower = get_rimFresnelPower(materialSID, 0);\n float rimLift = get_rimLift(materialSID, 0);\n vec3 rimColorFactor = get_rimColor(materialSID, 0);\n vec3 rimTextureColor = texture(u_rimTexture, v_texcoord_0).xyz;\n vec3 rimColor = srgbToLinear(rimColorFactor * rimTextureColor);\n vec3 rim = pow(clamp(1.0 - dot(normal_inWorld, viewDirection) + rimLift, 0.0, 1.0), rimFresnelPower) * rimColor;\n\n float staticRimLighting = 1.0;\n float rimLightingMix = get_rimLightingMix(materialSID, 0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) break;\n\n if(i > 0) staticRimLighting = 0.0;\n\n vec3 rimLighting = mix(vec3(staticRimLighting), lightings[i], vec3(rimLightingMix));\n rt0.xyz += rim * rimLighting;\n }\n\n // additive matcap\n vec3 cameraUp = get_cameraUp(0.0, 0); //solo datum\n vec3 worldViewUp = normalize(cameraUp - viewDirection * dot(viewDirection, cameraUp));\n vec3 worldViewRight = normalize(cross(viewDirection, worldViewUp));\n vec2 matcapUv = vec2(dot(worldViewRight, normal_inWorld), dot(worldViewUp, normal_inWorld)) * 0.5 + 0.5;\n vec3 matCapColor = srgbToLinear(texture(u_matCapTexture, matcapUv).xyz);\n rt0.xyz += matCapColor;\n\n\n // Emission\n vec3 emissionColor = get_emissionColor(materialSID, 0);\n vec3 emission = srgbToLinear(texture(u_emissionTexture, v_texcoord_0).xyz) * emissionColor;\n rt0.xyz += emission;\n #endif\n\n\n // debug\n #ifdef RN_MTOON_DEBUG_NORMAL\n rt0 = vec4(normal_inWorld * 0.5 + 0.5, alpha);\n\n rt0.xyz = srgbToLinear(rt0.xyz);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n #elif defined(RN_MTOON_DEBUG_LITSHADERATE)\n rt0 = vec4(0.0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) break;\n rt0 += vec4(lightIntensities[i] * lightings[i], alpha);\n }\n\n rt0.xyz = srgbToLinear(rt0.xyz);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n #endif\n\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\nfloat makeOutputSrgb = float(get_makeOutputSrgb(materialSID, 0));\nrt0.rgb = mix(rt0.rgb, linearToSrgb(rt0.rgb), makeOutputSrgb);\n\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var x=n(7009),g=n(2192);class I extends i.P{constructor(e,t,n,i,o,a,r,s,x,b){super(null,"MToonShading"+(o?"+morphing":"")+(a?"+skinning":"")+(r?"":"-lighting")+(s?"+tangentAttribute":""),{isMorphing:o,isSkinning:a,isLighting:r},A,y),this.__OutlineWidthModeIsScreen=!1,this.__floatProperties={},this.__vectorProperties={},this.__textureProperties={};const E=[];switch(null!=t?(this.__floatProperties=t.floatProperties,this.__vectorProperties=t.vectorProperties,this.__textureProperties=t.textureProperties):(this.__floatProperties._BlendMode=0,this.__floatProperties._BumpScale=1,this.__floatProperties._CullMode=2,this.__floatProperties._Cutoff=.5,this.__floatProperties._DebugMode=0,this.__floatProperties._DstBlend=0,this.__floatProperties._IndirectLightIntensity=.1,this.__floatProperties._LightColorAttenuation=0,this.__floatProperties._OutlineColorMode=0,this.__floatProperties._OutlineCullMode=1,this.__floatProperties._OutlineLightingMix=1,this.__floatProperties._OutlineScaledMaxDistance=1,this.__floatProperties._OutlineWidth=.5,this.__floatProperties._OutlineWidthMode=0,this.__floatProperties._ReceiveShadowRate=1,this.__floatProperties._RimFresnelPower=1,this.__floatProperties._RimLift=0,this.__floatProperties._RimLightingMix=0,this.__floatProperties._ShadeShift=0,this.__floatProperties._ShadeToony=.9,this.__floatProperties._ShadingGradeRate=1,this.__floatProperties._SrcBlend=1,this.__floatProperties._ZWrite=1,this.__vectorProperties._Color=[1,1,1,1],this.__vectorProperties._EmissionColor=[0,0,0],this.__vectorProperties._OutlineColor=[0,0,0,1],this.__vectorProperties._ShadeColor=[.97,.81,.86,1],this.__vectorProperties._RimColor=[0,0,0],this.__textureProperties._BumpMap=0,this.__textureProperties._EmissionMap=1,this.__textureProperties._MainTex=0,this.__textureProperties._OutlineWidthTexture=0,this.__textureProperties._ReceiveShadowTexture=0,this.__textureProperties._RimTexture=1,this.__textureProperties._ShadeTexture=0,this.__textureProperties._ShadingGradeTexture=0,this.__textureProperties._SphereAdd=1,n=[g.Dx,g.mg]),x&&(this.__floatProperties._DebugMode=x),E.push({semantic:I._Cutoff,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._Cutoff),min:0,max:1},{semantic:I._Color,componentType:l.r.Float,compositionType:c.d.Vec4,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:p.Lt.fromCopyArray(this.__vectorProperties._Color),min:0,max:1},{semantic:I._ShadeColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray(this.__vectorProperties._ShadeColor),min:0,max:1},{semantic:I._BumpScale,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._BumpScale),min:0,max:1},{semantic:I._ReceiveShadowRate,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._ReceiveShadowRate),min:0,max:1},{semantic:I._ShadingGradeRate,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._ShadingGradeRate),min:0,max:1},{semantic:I._ShadeShift,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._ShadeShift),min:0,max:1},{semantic:I._ShadeToony,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._ShadeToony),min:0,max:1},{semantic:I._LightColorAttenuation,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._LightColorAttenuation),min:0,max:1},{semantic:I._AmbientColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray([.5785,.5785,.5785]),min:0,max:1},{semantic:I._RimColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray(this.__vectorProperties._RimColor),min:0,max:1},{semantic:I._RimLightingMix,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._RimLightingMix),min:0,max:1},{semantic:I._RimFresnelPower,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._RimFresnelPower),min:0,max:1},{semantic:I._RimLift,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._RimLift),min:0,max:1},{semantic:I.CameraUp,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!0,soloDatum:!0,initialValue:f.P.fromCopyArray([0,1,0]),min:0,max:1},{semantic:I._EmissionColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray(this.__vectorProperties._EmissionColor),min:0,max:1},{semantic:u.f5.Wireframe,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray([0,0,1]),min:0,max:10},{semantic:u.f5.MakeOutputSrgb,compositionType:c.d.Scalar,componentType:l.r.Bool,stage:d.H.PixelShader,min:0,max:1,isCustomSetting:!1,updateInterval:m.a.FirstTimeOnly,initialValue:h.Ru.fromCopyNumber(b?1:0)}),this.__floatProperties._DebugMode){case 1:this.__definitions+="#define RN_MTOON_DEBUG_NORMAL\n";break;case 2:this.__definitions+="#define RN_MTOON_DEBUG_LITSHADERATE\n"}if(e){switch(this.__definitions+="#define RN_MTOON_IS_OUTLINE\n",this.__floatProperties._OutlineWidthMode){case 0:this.__definitions+="#define RN_MTOON_OUTLINE_NONE\n";break;case 1:this.__definitions+="#define RN_MTOON_OUTLINE_WIDTH_WORLD\n";break;case 2:this.__definitions+="#define RN_MTOON_OUTLINE_WIDTH_SCREEN\n",this.__OutlineWidthModeIsScreen=!0}switch(this.__floatProperties._OutlineColorMode){case 0:this.__definitions+="#define RN_MTOON_OUTLINE_COLOR_FIXED\n";break;case 1:this.__definitions+="#define RN_MTOON_OUTLINE_COLOR_MIXED\n"}E.push({semantic:I._OutlineWidth,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.VertexShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._OutlineWidth),min:0,max:1},{semantic:I._OutlineScaledMaxDistance,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.VertexShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._OutlineScaledMaxDistance),min:0,max:1},{semantic:I._OutlineColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray(this.__vectorProperties._OutlineColor),min:0,max:1},{semantic:I._OutlineLightingMix,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._OutlineLightingMix),min:0,max:1},{semantic:I.Aspect,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:h.Ru.fromCopyNumber(1),min:0,max:1})}r&&(this.__definitions+="#define RN_IS_LIGHTING\n"),a&&(this.__definitions+="#define RN_IS_SKINNING\n"),o&&(this.__definitions+="#define RN_IS_MORPHING\n",E.push({semantic:u.f5.MorphTargetNumber,componentType:l.r.Int,compositionType:c.d.Scalar,stage:d.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:h.Ru.fromCopyNumber(0),min:0,max:_.D.maxVertexMorphNumberInShader,needUniformInDataTextureMode:!0},{semantic:u.f5.DataTextureMorphOffsetPosition,componentType:l.r.Int,compositionType:c.d.ScalarArray,arrayLength:_.D.maxVertexMorphNumberInShader,stage:d.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new v.j(new Int32Array(_.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:u.f5.MorphWeights,componentType:l.r.Float,compositionType:c.d.ScalarArray,arrayLength:_.D.maxVertexMorphNumberInShader,stage:d.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new v.j(new Float32Array(_.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0})),s&&(this.__definitions+="#define RN_USE_TANGENT_ATTRIBUTE\n"),this.__setTextures(n,i,E,e),this.setShaderSemanticsInfoArray(E)}__setTextures(e,t,n,i){n.push({semantic:I._MainTex,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[0,e[this.__textureProperties._MainTex],t[this.__textureProperties._MainTex]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._ShadeTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[1,e[this.__textureProperties._ShadeTexture],t[this.__textureProperties._ShadeTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._ReceiveShadowTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[2,e[this.__textureProperties._ReceiveShadowTexture],t[this.__textureProperties._ReceiveShadowTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._ShadingGradeTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[3,e[this.__textureProperties._ShadingGradeTexture],t[this.__textureProperties._ShadingGradeTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._RimTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[4,e[this.__textureProperties._RimTexture],t[this.__textureProperties._RimTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._SphereAdd,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[5,e[this.__textureProperties._SphereAdd],t[this.__textureProperties._SphereAdd]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._EmissionMap,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[6,e[this.__textureProperties._EmissionMap],t[this.__textureProperties._EmissionMap]],min:0,max:Number.MAX_SAFE_INTEGER}),n.push({semantic:I._BumpMap,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[8,e[this.__textureProperties._BumpMap],t[this.__textureProperties._BumpMap]],min:0,max:Number.MAX_SAFE_INTEGER}),this.__textureProperties._BumpMap!==e.length-2&&(this.__definitions+="#define RN_MTOON_HAS_BUMPMAP\n"),i&&(n.push({semantic:I._OutlineWidthTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.VertexShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[9,e[this.__textureProperties._OutlineWidthTexture],t[this.__textureProperties._OutlineWidthTexture]],min:0,max:Number.MAX_SAFE_INTEGER}),this.__textureProperties._OutlineWidthTexture!==e.length-2&&(this.__definitions+="#define RN_MTOON_HAS_OUTLINE_WIDTH_TEXTURE\n"))}setMaterialParameters(e,t){if(null==I.usableBlendEquationModeAlpha&&I.__initializeUsableBlendEquationModeAlpha(),0!==this.__floatProperties._BlendMode){switch(this.__floatProperties._BlendMode){case 1:this.__definitions+="#define RN_ALPHATEST_ON\n",e.alphaMode=o.F.Mask;break;case 2:case 3:this.__definitions+="#define RN_ALPHABLEND_ON\n",e.alphaMode=o.F.Translucent}const t=32774,n=I.usableBlendEquationModeAlpha,i=I.unityBlendEnumCorrespondence(this.__floatProperties._SrcBlend),a=I.unityBlendEnumCorrespondence(this.__floatProperties._DstBlend);e.setBlendEquationMode(x.C.from(t),null!=n?x.C.from(n):void 0),e.setBlendFuncFactor(x.C.from(i),x.C.from(a))}if(t)switch(this.__floatProperties._OutlineCullMode){case 0:e.cullFace=!1;break;case 1:e.cullFace=!0,e.cullFrontFaceCCW=!1;break;case 2:e.cullFace=!0,e.cullFrontFaceCCW=!0}else switch(this.__floatProperties._CullMode){case 0:e.cullFace=!1;break;case 1:e.cullFace=!0,e.cullFrontFaceCCW=!1;break;case 2:e.cullFace=!0,e.cullFrontFaceCCW=!0}}static __initializeUsableBlendEquationModeAlpha(){const e=r.F.getWebGLResourceRepository().currentWebGLContextWrapper,t=e.getRawContextAsWebGL2();e.isWebGL2?I.usableBlendEquationModeAlpha=t.MAX:e.webgl1ExtBM?I.usableBlendEquationModeAlpha=e.webgl1ExtBM.MAX_EXT:I.usableBlendEquationModeAlpha=t.FUNC_ADD}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){let o=i.renderPass.cameraComponent;if(null==o&&(o=s.C.getComponent(a.M,a.M.current)),i.setUniform){this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix),this.setViewInfo(t,o,i.isVr,i.displayIdx),this.setProjection(t,o,i.isVr,i.displayIdx);const n=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,n),this.setLightsInfo(t,i.lightComponents,e,i.setUniform),t._gl.uniform3fv(t.cameraUp,o.upInner._v),this.__OutlineWidthModeIsScreen&&t._gl.uniform1f(t.aspect,o.aspect)}else e.setParameter(I.CameraUp,o.upInner),this.__OutlineWidthModeIsScreen&&e.setParameter(I.Aspect,o.aspect);const r=i.entity.tryToGetBlendShape();this.setMorphInfo(t,i.entity.getMesh(),i.primitive,r)}static unityBlendEnumCorrespondence(e){const t=r.F.getWebGLResourceRepository().currentWebGLContextWrapper.getRawContext();let n=t.ZERO;switch(e){case 0:n=t.ZERO;break;case 1:n=t.ONE;break;case 2:n=t.DST_COLOR;break;case 3:n=t.SRC_COLOR;break;case 4:n=t.ONE_MINUS_DST_COLOR;break;case 5:n=t.SRC_ALPHA;break;case 6:n=t.ONE_MINUS_SRC_COLOR;break;case 7:n=t.DST_ALPHA;break;case 8:n=t.ONE_MINUS_DST_ALPHA;break;case 9:n=t.SRC_ALPHA_SATURATE;break;case 10:n=t.ONE_MINUS_SRC_ALPHA}return n}}I._Cutoff=new u.wy({str:"cutoff"}),I._Color=new u.wy({str:"litColor"}),I._ShadeColor=new u.wy({str:"shadeColor"}),I._MainTex=new u.wy({str:"litColorTexture"}),I._ShadeTexture=new u.wy({str:"shadeColorTexture"}),I._BumpScale=new u.wy({str:"normalScale"}),I._BumpMap=new u.wy({str:"normalTexture"}),I._ReceiveShadowRate=new u.wy({str:"receiveShadowRate"}),I._ReceiveShadowTexture=new u.wy({str:"receiveShadowTexture"}),I._ShadingGradeRate=new u.wy({str:"shadingGradeRate"}),I._ShadingGradeTexture=new u.wy({str:"shadingGradeTexture"}),I._ShadeShift=new u.wy({str:"shadeShift"}),I._ShadeToony=new u.wy({str:"shadeToony"}),I._LightColorAttenuation=new u.wy({str:"lightColorAttenuation"}),I._AmbientColor=new u.wy({str:"ambientColor"}),I._RimTexture=new u.wy({str:"rimTexture"}),I._RimColor=new u.wy({str:"rimColor"}),I._RimLightingMix=new u.wy({str:"rimLightingMix"}),I._RimFresnelPower=new u.wy({str:"rimFresnelPower"}),I._RimLift=new u.wy({str:"rimLift"}),I._SphereAdd=new u.wy({str:"matCapTexture"}),I._EmissionColor=new u.wy({str:"emissionColor"}),I._EmissionMap=new u.wy({str:"emissionTexture"}),I._OutlineWidthTexture=new u.wy({str:"outlineWidthTexture"}),I._OutlineWidth=new u.wy({str:"outlineWidth"}),I._OutlineScaledMaxDistance=new u.wy({str:"outlineScaledMaxDistance"}),I._OutlineColor=new u.wy({str:"outlineColor"}),I._OutlineLightingMix=new u.wy({str:"outlineLightingMix"}),I.Aspect=new u.wy({str:"aspect"}),I.CameraUp=new u.wy({str:"cameraUp"})},9330:(e,t,n)=>{n.d(t,{S:()=>A});var i=n(7290),o=n(224),a=n(2404),r=n(3999),s=n(810),l=n(3616),c=n(4587),_=n(5324),h=n(1813),u=n(2575),d=n(2471),m=n(5868);const f={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec3 a_baryCentricCoord;\nin vec3 a_position;\nin vec3 a_normal;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec3 v_baryCentricCoord;\nout vec3 v_normal_inView;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n\n bool isSkinning = false;\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n v_normal_inView = vec3(viewMatrix * vec4(normalMatrix * a_normal, 0.0));\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n v_baryCentricCoord = a_baryCentricCoord;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},p={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec3 v_baryCentricCoord;\nin vec3 v_normal_inView;\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec3 normal_inView = normalize(v_normal_inView);\n normal_inView.y *= -1.0;\n vec2 normalUVCordinate = normal_inView.xy * 0.5 + 0.5;\n vec4 matCapColor = texture(u_matCapTexture, normalUVCordinate);\n rt0 = matCapColor;\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var v=n(2192);class A extends m.P{constructor(e,t,n,o){let a;super(null,"MatCapShading"+(e?"+skinning":""),{isSkinning:e},f,p),"string"==typeof t?(a=new u.x,async function(e){a.generateTextureFromUri(e,{type:r.r.UnsignedByte}),await a.loadFromUrlLazy()}(t)):n instanceof i.y?a=n:(console.warn("no matcap texture"),a=v.mg);const m=[];m.push({semantic:c.f5.Wireframe,componentType:r.r.Float,compositionType:s.d.Vec3,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:d.P.fromCopyArray([0,0,1]),min:0,max:10}),m.push({semantic:c.f5.PointSize,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:l.Ru.fromCopyNumber(30),min:0,max:100},{semantic:c.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:s.d.Vec3,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:d.P.fromCopyArray([0,.1,.01]),min:0,max:1}),e&&(this.__definitions+="#define RN_IS_SKINNING\n"),m.push({semantic:A.MatCapTexture,componentType:r.r.Int,compositionType:s.d.Texture2D,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[0,a,o],min:0,max:Number.MAX_SAFE_INTEGER}),this.setShaderSemanticsInfoArray(m)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix));let r=i.renderPass.cameraComponent;null==r&&(r=a.C.getComponent(o.M,o.M.current)),this.setViewInfo(t,r,i.isVr,i.displayIdx),this.setProjection(t,r,i.isVr,i.displayIdx);const s=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,s)}}A.MatCapTexture=new c.wy({str:"matCapTexture"})},8283:(e,t,n)=>{n.d(t,{u:()=>_});var i=n(4587),o=n(5868),a=n(430),r=n(5324),s=n(2404),l=n(224),c=n(7348);class _ extends o.P{constructor({name:e,vertexShaderityObj:t,pixelShaderityObj:n}){super(null,e,{});const i=a.u.getShaderDataReflection(t,o.P.__semanticsMap.get(this.shaderFunctionName)),s=a.u.getShaderDataReflection(n,o.P.__semanticsMap.get(this.shaderFunctionName));this.__vertexShaderityObject=t,this.__pixelShaderityObject=n;const l=i.shaderSemanticsInfoArray.concat();for(const e of s.shaderSemanticsInfoArray){const t=l.find((t=>t.semantic.str===e.semantic.str));t?t.stage=r.H.VertexAndPixelShader:l.push(e)}_.__removeUselessShaderSemantics(l),this.setShaderSemanticsInfoArray(l)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){if(i.setUniform){if(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix),n||i.isVr){let e=i.renderPass.cameraComponent;null==e&&(e=s.C.getComponent(l.M,l.M.current)),this.setViewInfo(t,e,i.isVr,i.displayIdx),this.setProjection(t,e,i.isVr,i.displayIdx)}n&&this.setLightsInfo(t,i.lightComponents,e,i.setUniform);const o=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,o)}const o=i.entity.tryToGetBlendShape();this.setMorphInfo(t,i.entity.getMesh(),i.primitive,o)}static __removeUselessShaderSemantics(e){const t=c.$.getInstance().getGlobalProperties();for(const n of t){const t=n.shaderSemanticsInfo,i=e.findIndex((e=>e.semantic.str===t.semantic.str));-1!==i&&e.splice(i,1)}const n=[i.f5.VertexAttributesExistenceArray,i.f5.WorldMatrix,i.f5.NormalMatrix,i.f5.PointSize,i.f5.PointDistanceAttenuation];for(const t of n){const n=e.findIndex((e=>e.semantic.str===t.str));-1!==n&&e.splice(n,1)}}}},9764:(e,t,n)=>{n.d(t,{R:()=>I});var i=n(4587),o=n(5868),a=n(810),r=n(3999),s=n(7192),l=n(2471),c=n(9840),_=n(5324),h=n(1813),u=n(2404),d=n(224),m=n(4255),f=n(3616),p=n(3258),v=n(7987),A=n(3496);const y={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec2 a_texcoord_1;\nin vec4 a_joint;\nin vec4 a_weight;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec4 v_texcoord_1;\nout vec4 v_projPosition_from_light;\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n // Shadow mapping\n mat4 lightViewProjectionMatrix = get_lightViewProjectionMatrix(materialSID, 0);\n v_projPosition_from_light = lightViewProjectionMatrix * v_position_inWorld;\n\n // Following tMatrix is based on https://wgld.org/d/webgl/w051.html\n mat4 tMatrix = mat4(\n 0.5, 0.0, 0.0, 0.0,\n 0.0, 0.5, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.5, 0.5, 0.0, 1.0\n );\n v_texcoord_1 = tMatrix * v_projPosition_from_light;\n\n v_color = a_color;\n v_normal_inWorld = normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},x={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec4 v_texcoord_1;\nin vec4 v_projPosition_from_light;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nfloat decodeRGBAToDepth(vec4 RGBA){\n const float rMask = 1.0;\n const float gMask = 1.0 / 255.0;\n const float bMask = 1.0 / (255.0 * 255.0);\n const float aMask = 1.0 / (255.0 * 255.0 * 255.0);\n float depth = dot(RGBA, vec4(rMask, gMask, bMask, aMask));\n return depth;\n}\n\nvoid main (){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n // diffuseColor\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture\n vec4 textureColor = texture(u_diffuseColorTexture, v_texcoord_0);\n if (textureColor.r > 0.05) {\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n }\n\n // shadow mapping\n if(v_projPosition_from_light.w > 0.0){\n float zNear = get_zNearInner(materialSID, 0);\n float zFar = get_zFarInner(materialSID, 0);\n float normalizationCoefficient = 1.0 / (zFar - zNear);\n\n vec2 shadowMapUV = v_texcoord_1.xy / v_texcoord_1.w;\n\n #ifdef RN_IS_DEBUGGING\n bool inShadowMap = (shadowMapUV.x >= 0.0 && shadowMapUV.x <= 1.0) && (shadowMapUV.y >= 0.0 && shadowMapUV.y <= 1.0);\n if(inShadowMap == false){\n rt0 = get_debugColorFactor(materialSID, 0);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n }\n #endif\n\n float measureDepth = normalizationCoefficient * length(v_projPosition_from_light);\n float textureDepth = decodeRGBAToDepth(texture(u_depthTexture, shadowMapUV));\n float allowableDepthError = get_allowableDepthError(materialSID, 0);\n\n if(measureDepth > textureDepth + allowableDepthError){\n // case of shadow\n vec4 shadowColorFactor = get_shadowColorFactor(materialSID, 0);\n diffuseColor = shadowColorFactor.rgb;\n alpha = shadowColorFactor.a;\n }\n }\n\n // Lighting\n vec3 shadingColor = vec3(0.0, 0.0, 0.0);\n int shadingModel = get_shadingModel(materialSID, 0);\n if (shadingModel > 0) {\n\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n int lightNumber = get_lightNumber(materialSID, 0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, light.direction)) * light.attenuatedIntensity;\n\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n float shininess = get_shininess(materialSID, 0);\n if (shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 halfVector = normalize(light.direction + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), shininess);\n } else if (shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 R = reflect(light.direction, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), shininess);\n }\n\n }\n\n shadingColor = diffuse + specular;\n } else {\n shadingColor = diffuseColor;\n }\n\n rt0 = vec4(shadingColor, alpha);\n //rt0 = vec4(u_lightNumber, 0.0, 0.0, 1.0);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var g=n(2192);class I extends o.P{constructor({isMorphing:e,isSkinning:t,isLighting:n,isDebugging:o,colorAttachmentsNumber:u},d){super(null,"ShadowMapDecodeClassicShading"+(t?"+skinning":"")+(n?"":"-lighting"),{isMorphing:e,isSkinning:t,isLighting:n},y,x),this.__encodedDepthRenderPass=d;const v=d.getFramebuffer();if(null==v)return void console.error("encodedDepthRenderPass does not have framebuffer");const b=v.colorAttachments[u],E=d.getViewport();E.setComponents(1,1,E.z-1,E.w-1),d.setViewport(E);const T=[{semantic:i.f5.LightViewProjectionMatrix,compositionType:a.d.Mat4,componentType:r.r.Float,stage:_.H.VertexShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:A.e.zero(),min:-Number.MAX_VALUE,max:Number.MAX_VALUE},{semantic:i.f5.ShadingModel,compositionType:a.d.Scalar,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(c.D.Constant.index),min:0,max:3},{semantic:i.f5.Shininess,compositionType:a.d.Scalar,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(5),min:0,max:Number.MAX_VALUE},{semantic:I.AllowableDepthError,compositionType:a.d.Scalar,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e-4),min:0,max:1},{semantic:I.ShadowColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([.5,.5,.5,1]),min:0,max:1},{semantic:i.f5.DiffuseColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,1,1,1]),min:0,max:2},{semantic:I.IsPointLight,componentType:r.r.Bool,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1),min:0,max:1},{semantic:i.f5.Wireframe,componentType:r.r.Float,compositionType:a.d.Vec3,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:l.P.fromCopyArray([0,0,1]),min:0,max:10},{semantic:i.f5.NormalTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[0,g.$R],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:i.f5.DepthTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[0,b],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:i.f5.DiffuseColorTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[1,g.Dx],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.zNearInner,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(.1),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:I.zFarInner,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e4),min:1e-4,max:Number.MAX_SAFE_INTEGER}];T.push({semantic:i.f5.PointSize,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(30),min:0,max:100},{semantic:i.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:a.d.Vec3,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:l.P.fromCopyArray([0,.1,.01]),min:0,max:1}),t&&(this.__definitions+="#define RN_IS_SKINNING\n"),n&&(this.__definitions+="#define RN_IS_LIGHTING\n"),e&&(this.__definitions+="#define RN_IS_MORPHING\n",T.push({semantic:i.f5.MorphTargetNumber,componentType:r.r.Int,compositionType:a.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(0),min:0,max:p.D.maxVertexMorphNumberInShader,needUniformInDataTextureMode:!0},{semantic:i.f5.DataTextureMorphOffsetPosition,componentType:r.r.Int,compositionType:a.d.ScalarArray,arrayLength:p.D.maxVertexMorphNumberInShader,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new m.j(new Int32Array(p.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:i.f5.MorphWeights,componentType:r.r.Float,compositionType:a.d.ScalarArray,arrayLength:p.D.maxVertexMorphNumberInShader,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new m.j(new Float32Array(p.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0})),o&&(this.__definitions+="#define RN_IS_DEBUGGING\n",T.push({semantic:I.DebugColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,0,0,1]),min:0,max:2})),this.setShaderSemanticsInfoArray(T)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:o}){let a=o.renderPass.cameraComponent;null==a&&(a=u.C.getComponent(d.M,d.M.current));const r=this.__encodedDepthRenderPass.cameraComponent;o.setUniform?(this.setWorldMatrix(t,o.worldMatrix),this.setNormalMatrix(t,o.normalMatrix),this.setViewInfo(t,a,o.isVr,o.displayIdx),this.setProjection(t,a,o.isVr,o.displayIdx),I.__lastZNear!==r.zNearInner&&(t._gl.uniform1f(t.zNearInner,r.zNearInner),I.__lastZNear=r.zNearInner),I.__lastZFar!==r.zFarInner&&(t._gl.uniform1f(t.zFarInner,r.zFarInner),I.__lastZFar=r.zFarInner),v.F.getWebGLResourceRepository().setUniformValue(t,i.f5.LightViewProjectionMatrix.str,!0,this.__encodedDepthRenderPass.cameraComponent.viewProjectionMatrix)):(e.setParameter(I.zNearInner,r.zNearInner),e.setParameter(I.zFarInner,r.zFarInner),e.setParameter(i.f5.LightViewProjectionMatrix,this.__encodedDepthRenderPass.cameraComponent.viewProjectionMatrix));const s=o.entity.tryToGetSkeletal();this.setSkinning(t,o.setUniform,s),this.setLightsInfo(t,o.lightComponents,e,o.setUniform);const l=o.entity.tryToGetBlendShape();this.setMorphInfo(t,o.entity.getMesh(),o.primitive,l)}}I.ShadowColorFactor=new i.wy({str:"shadowColorFactor"}),I.ShadowAlpha=new i.wy({str:"shadowAlpha"}),I.NonShadowAlpha=new i.wy({str:"nonShadowAlpha"}),I.AllowableDepthError=new i.wy({str:"allowableDepthError"}),I.zNearInner=new i.wy({str:"zNearInner"}),I.zFarInner=new i.wy({str:"zFarInner"}),I.DebugColorFactor=new i.wy({str:"debugColorFactor"}),I.DepthTexture=new i.wy({str:"depthTexture"}),I.IsPointLight=new i.wy({str:"isPointLight"}),I.__lastZNear=0,I.__lastZFar=0},7369:(e,t,n)=>{n.d(t,{d:()=>p});var i=n(224),o=n(2404),a=n(3999),r=n(810),s=n(4587),l=n(5324),c=n(1813),_=n(5868),h=n(4255),u=n(3616);const d={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec3 a_baryCentricCoord;\nin vec3 a_position;\n\nout vec3 v_baryCentricCoord;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n v_baryCentricCoord = a_baryCentricCoord;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},m={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec3 v_baryCentricCoord;\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3 + vec3(1.0 - wireframeWidthInner) * d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n float tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n\n float synthesizeCoefficient0 = u_synthesizeCoefficient[0];\n vec3 color = synthesizeCoefficient0 * texture(u_synthesizeTexture0, offset * tFrag).rgb;\n\n vec4 targetTextureColor = texture(u_targetRegionTexture, offset * tFrag);\n if (targetTextureColor != vec4(1.0, 1.0, 1.0, 1.0)) {\n float synthesizeCoefficient1 = u_synthesizeCoefficient[1];\n float synthesizeCoefficient2 = u_synthesizeCoefficient[2];\n float synthesizeCoefficient3 = u_synthesizeCoefficient[3];\n float synthesizeCoefficient4 = u_synthesizeCoefficient[4];\n float synthesizeCoefficient5 = u_synthesizeCoefficient[5];\n\n color += synthesizeCoefficient1 * texture(u_synthesizeTexture1, offset * tFrag).rgb;\n color += synthesizeCoefficient2 * texture(u_synthesizeTexture2, offset * tFrag).rgb;\n color += synthesizeCoefficient3 * texture(u_synthesizeTexture3, offset * tFrag).rgb;\n color += synthesizeCoefficient4 * texture(u_synthesizeTexture4, offset * tFrag).rgb;\n color += synthesizeCoefficient5 * texture(u_synthesizeTexture5, offset * tFrag).rgb;\n }\n\n rt0 = vec4(color, 1.0);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n\n",shaderStage:"fragment",isFragmentShader:!0};var f=n(2192);class p extends _.P{constructor(e,t=f.mg){var n,i,o,_,v,A;super(null,"synthesizeHDRTextureShading",{},d,m),this.existTargetRegion=null!=t,this.textureNumber=e.length;const y=[{semantic:s.f5.FramebufferWidth,componentType:a.r.Float,compositionType:r.d.Scalar,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,soloDatum:!1,initialValue:u.Ru.fromCopyNumber(e[0].width),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeCoefficient,componentType:a.r.Float,compositionType:r.d.ScalarArray,arrayLength:6,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,soloDatum:!1,initialValue:new h.j(new Float32Array(6)),min:0,max:1,needUniformInDataTextureMode:!0},{semantic:p.SynthesizeTexture0,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[0,null!==(n=e[0])&&void 0!==n?n:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture1,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[1,null!==(i=e[1])&&void 0!==i?i:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture2,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[2,null!==(o=e[2])&&void 0!==o?o:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture3,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[3,null!==(_=e[3])&&void 0!==_?_:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture4,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[4,null!==(v=e[4])&&void 0!==v?v:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture5,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[5,null!==(A=e[5])&&void 0!==A?A:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.TargetRegionTexture,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[6,t],min:0,max:Number.MAX_SAFE_INTEGER}];this.setShaderSemanticsInfoArray(y)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:a}){a.setUniform?this.setWorldMatrix(t,a.worldMatrix):t._gl.uniform1fv(t.synthesizeCoefficient,e.getParameter(p.SynthesizeCoefficient)._v);let r=a.renderPass.cameraComponent;null==r&&(r=o.C.getComponent(i.M,i.M.current)),r&&(this.setViewInfo(t,r,a.isVr,a.displayIdx),this.setProjection(t,r,a.isVr,a.displayIdx))}get existTargetRegionTexture(){return this.existTargetRegion}get synthesizeTextureNumber(){return this.textureNumber}}p.SynthesizeCoefficient=new s.wy({str:"synthesizeCoefficient"}),p.TargetRegionTexture=new s.wy({str:"targetRegionTexture"}),p.SynthesizeTexture0=new s.wy({str:"synthesizeTexture0"}),p.SynthesizeTexture1=new s.wy({str:"synthesizeTexture1"}),p.SynthesizeTexture2=new s.wy({str:"synthesizeTexture2"}),p.SynthesizeTexture3=new s.wy({str:"synthesizeTexture3"}),p.SynthesizeTexture4=new s.wy({str:"synthesizeTexture4"}),p.SynthesizeTexture5=new s.wy({str:"synthesizeTexture5"})},968:(e,t,n)=>{n.d(t,{Q:()=>I});var i=n(4587),o=n(5868),a=n(810),r=n(3999),s=n(7192),l=n(2471),c=n(9840),_=n(5324),h=n(1813),u=n(2404),d=n(224),m=n(4255),f=n(3616),p=n(3258),v=n(7987),A=n(3496);const y={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec4 v_texcoord_1;\nout vec4 v_projPosition_from_light;\nout vec3 v_baryCentricCoord;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n\n bool isSkinning = false;\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n v_color = a_color;\n v_texcoord_0 = a_texcoord_0;\n\n // Shadow mapping\n mat4 lightViewProjectionMatrix = get_lightViewProjectionMatrix(materialSID, 0);\n v_projPosition_from_light = lightViewProjectionMatrix * v_position_inWorld;\n\n // Following tMatrix is based on https://wgld.org/d/webgl/w051.html\n mat4 tMatrix = mat4(\n 0.5, 0.0, 0.0, 0.0,\n 0.0, 0.5, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.5, 0.5, 0.0, 1.0\n );\n v_texcoord_1 = tMatrix * v_projPosition_from_light;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},x={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec4 v_texcoord_1;\nin vec4 v_projPosition_from_light;\nin vec3 v_baryCentricCoord;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nfloat decodeRGBAToDepth(vec4 RGBA){\n const float rMask = 1.0;\n const float gMask = 1.0 / 255.0;\n const float bMask = 1.0 / (255.0 * 255.0);\n const float aMask = 1.0 / (255.0 * 255.0 * 255.0);\n float depth = dot(RGBA, vec4(rMask, gMask, bMask, aMask));\n return depth;\n}\n\nfloat linstep(float min,float max,float v){\n return clamp((v-min)/(max-min),0.0,1.0);\n}\n\nfloat reduceLightBleeding(float p_max, float parameter){\n return linstep(parameter,1.0,p_max);\n}\n\nfloat chebyshevUpperBound(float materialSID){\n float textureDepth = decodeRGBAToDepth(texture2DProj(u_depthTexture, v_texcoord_1));\n float textureSquareDepth = decodeRGBAToDepth(texture2DProj(u_squareDepthTexture, v_texcoord_1));\n if(textureDepth == 1.0 || textureSquareDepth == 1.0){\n return 1.0;\n }\n\n float nonShadowProb = 1.0;\n\n if(v_projPosition_from_light.w > 0.0){\n float measureDepth;\n bool isPointLight = get_isPointLight(materialSID, 0);\n if(isPointLight){\n float zNear = get_zNearInner(materialSID, 0);\n float zFar = get_zFarInner(materialSID, 0);\n float normalizationCoefficient = 1.0 / (zFar - zNear);\n measureDepth = normalizationCoefficient * length(v_projPosition_from_light);\n }else{\n measureDepth = (v_projPosition_from_light / v_projPosition_from_light.w).z;\n }\n\n float depthAdjustment = get_depthAdjustment(materialSID, 0);\n measureDepth += depthAdjustment;\n\n float textureDepthAdjustment = get_textureDepthAdjustment(materialSID, 0);\n textureDepth += textureDepthAdjustment;\n\n float d = measureDepth - textureDepth;\n if(d < 0.0) return 1.0;\n\n float variance = textureSquareDepth - textureDepth * textureDepth;\n float minimumVariance = get_minimumVariance(materialSID, 0);\n variance = max(variance, minimumVariance);\n\n nonShadowProb = variance / (variance + d * d);\n\n\n float lightBleedingParameter = get_lightBleedingParameter(materialSID, 0);\n nonShadowProb = reduceLightBleeding(nonShadowProb, lightBleedingParameter);\n }\n return nonShadowProb;\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n // diffuseColor\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture\n vec4 textureColor = texture(u_diffuseColorTexture, v_texcoord_0);\n if (textureColor.r > 0.05) {\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n }\n\n // shadow mapping\n vec4 shadowColor = get_shadowColor(materialSID, 0);\n\n float nonShadowProb = chebyshevUpperBound(materialSID);\n diffuseColor = nonShadowProb * diffuseColor + (1.0 - nonShadowProb) * shadowColor.rgb;\n alpha = nonShadowProb * alpha + (1.0 - nonShadowProb) * shadowColor.a;\n\n // Lighting\n vec3 shadingColor = vec3(0.0, 0.0, 0.0);\n\n int shadingModel = get_shadingModel(materialSID, 0);\n if (shadingModel > 0) {\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n int lightNumber = get_lightNumber(materialSID, 0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */ ; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, light.direction)) * light.attenuatedIntensity;\n\n vec3 viewPosition = get_viewPosition(materialSID, 0);\n float shininess = get_shininess(materialSID, 0);\n if (shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 halfVector = normalize(light.direction + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), shininess);\n } else if (shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 R = reflect(light.direction, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), shininess);\n }\n\n }\n\n shadingColor = diffuse + specular;\n } else {\n shadingColor = diffuseColor;\n }\n\n rt0 = vec4(shadingColor, alpha);\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var g=n(2192);class I extends o.P{constructor({isMorphing:e,isSkinning:t,isLighting:n,isDebugging:o,colorAttachmentsNumberDepth:u,colorAttachmentsNumberSquareDepth:d,depthCameraComponent:v},b){super(null,"varianceShadowMapDecodeShading"+(e?"+morphing":"")+(t?"+skinning":"")+(n?"":"-lighting")+(o?"":"+debugging"),{isMorphing:e,isSkinning:t,isLighting:n},y,x),2!==b.length&&console.error("invalid length of renderPasses"),null==v?console.warn("need to set depth camera component"):this.__depthCameraComponent=v;for(const e of b){const t=e.getViewport();t.setComponents(1,1,t.z-1,t.w-1),e.setViewport(t)}let E;const T=b[0].getFramebuffer();let S;T?E=T.colorAttachments[u]:(console.warn("renderPass of depth does not have framebuffer"),E=g.mg);const C=b[1].getFramebuffer();C?S=C.colorAttachments[d]:(console.warn("renderPass of square depth does not have framebuffer"),S=g.mg);const w=[{semantic:i.f5.LightViewProjectionMatrix,compositionType:a.d.Mat4,componentType:r.r.Float,stage:_.H.VertexShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:A.e.zero(),min:-Number.MAX_VALUE,max:Number.MAX_VALUE},{semantic:i.f5.ShadingModel,compositionType:a.d.Scalar,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(c.D.Constant.index),min:0,max:3},{semantic:i.f5.Shininess,compositionType:a.d.Scalar,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(5),min:0,max:Number.MAX_VALUE},{semantic:I.AllowableDepthError,compositionType:a.d.Scalar,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e-4),min:0,max:1},{semantic:I.ShadowColor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([.5,.5,.5,1]),min:0,max:1},{semantic:i.f5.DiffuseColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,1,1,1]),min:0,max:2},{semantic:I.zNearInner,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(.1),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:I.zFarInner,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e4),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:I.IsPointLight,componentType:r.r.Bool,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1),min:0,max:1},{semantic:i.f5.Wireframe,componentType:r.r.Float,compositionType:a.d.Vec3,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:l.P.fromCopyArray([0,0,1]),min:0,max:10},{semantic:I.DepthAdjustment,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(0),min:0,max:1},{semantic:I.LightBleedingParameter,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(0),min:0,max:1},{semantic:I.MinimumVariance,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e-7),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.TextureDepthAdjustment,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(0),min:0,max:1},{semantic:i.f5.NormalTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[0,g.$R],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:i.f5.DiffuseColorTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[1,g.Dx],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.DepthTexture,componentType:r.r.Int,compositionType:a.d.Texture2D,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[2,E],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.SquareDepthTexture,componentType:r.r.Int,compositionType:a.d.Texture2D,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[3,S],min:0,max:Number.MAX_SAFE_INTEGER}];w.push({semantic:i.f5.PointSize,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(30),min:0,max:100},{semantic:i.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:a.d.Vec3,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:l.P.fromCopyArray([0,.1,.01]),min:0,max:1}),t&&(this.__definitions+="#define RN_IS_SKINNING\n"),n&&(this.__definitions+="#define RN_IS_LIGHTING\n"),e&&(this.__definitions+="#define RN_IS_MORPHING\n",w.push({semantic:i.f5.MorphTargetNumber,componentType:r.r.Int,compositionType:a.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(0),min:0,max:p.D.maxVertexMorphNumberInShader,needUniformInDataTextureMode:!0},{semantic:i.f5.DataTextureMorphOffsetPosition,componentType:r.r.Int,compositionType:a.d.ScalarArray,arrayLength:p.D.maxVertexMorphNumberInShader,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new m.j(new Int32Array(p.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:i.f5.MorphWeights,componentType:r.r.Float,compositionType:a.d.ScalarArray,arrayLength:p.D.maxVertexMorphNumberInShader,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new m.j(new Float32Array(p.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0})),o&&(this.__definitions+="#define RN_IS_DEBUGGING\n",w.push({semantic:I.DebugColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,0,0,1]),min:0,max:2})),this.setShaderSemanticsInfoArray(w)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:o}){var a;let r=o.renderPass.cameraComponent;null==r&&(r=u.C.getComponent(d.M,d.M.current));const s=null!==(a=this.__depthCameraComponent)&&void 0!==a?a:o.renderPass.cameraComponent;o.setUniform?(this.setWorldMatrix(t,o.worldMatrix),this.setNormalMatrix(t,o.normalMatrix),this.setViewInfo(t,r,o.isVr,o.displayIdx),this.setProjection(t,r,o.isVr,o.displayIdx),I.__lastZNear!==s.zNearInner&&(t._gl.uniform1f(t.zNearInner,s.zNearInner),I.__lastZNear=s.zNearInner),I.__lastZFar!==s.zFarInner&&(t._gl.uniform1f(t.zFarInner,s.zFarInner),I.__lastZFar=s.zFarInner),v.F.getWebGLResourceRepository().setUniformValue(t,i.f5.LightViewProjectionMatrix.str,!0,s.viewProjectionMatrix)):(e.setParameter(I.zNearInner,s.zNearInner),e.setParameter(I.zFarInner,s.zFarInner),e.setParameter(i.f5.LightViewProjectionMatrix,s.viewProjectionMatrix));const l=o.entity.tryToGetSkeletal();this.setSkinning(t,o.setUniform,l),this.setLightsInfo(t,o.lightComponents,e,o.setUniform);const c=o.entity.tryToGetBlendShape();this.setMorphInfo(t,o.entity.getMesh(),o.primitive,c),v.F.getWebGLResourceRepository().setUniformValue(t,i.f5.LightViewProjectionMatrix.str,!0,s.viewProjectionMatrix)}set depthCameraComponent(e){this.__depthCameraComponent=e}}I.IsPointLight=new i.wy({str:"isPointLight"}),I.DepthTexture=new i.wy({str:"depthTexture"}),I.SquareDepthTexture=new i.wy({str:"squareDepthTexture"}),I.DepthAdjustment=new i.wy({str:"depthAdjustment"}),I.TextureDepthAdjustment=new i.wy({str:"textureDepthAdjustment"}),I.MinimumVariance=new i.wy({str:"minimumVariance"}),I.LightBleedingParameter=new i.wy({str:"lightBleedingParameter"}),I.ShadowColor=new i.wy({str:"shadowColor"}),I.AllowableDepthError=new i.wy({str:"allowableDepthError"}),I.zNearInner=new i.wy({str:"zNearInner"}),I.zFarInner=new i.wy({str:"zFarInner"}),I.DebugColorFactor=new i.wy({str:"debugColorFactor"}),I.__lastZNear=0,I.__lastZFar=0},5868:(e,t,n)=>{n.d(t,{P:()=>v});var i=n(9002),o=n(7987),a=n(3258),r=n(8182),s=n(4536),l=n(2471),c=n(3496),_=n(128),h=n(7683),u=n(1226),d=n(8430),m=n(5324),f=n(2251),p=n(2404);class v extends i.S{constructor(e,t,{isMorphing:n=!1,isSkinning:i=!1,isLighting:a=!1}={},r,s){super(),this.__semantics=[],this.__vertexInputs=[],this.__pixelInputs=[],this.__vertexOutputs=[],this.__pixelOutputs=[],this.__defaultInputValues=new Map,this.__vertexInputConnections=[],this.__pixelInputConnections=[],this.isSingleOperation=!1,this.__definitions="",this.shaderType=m.H.VertexAndPixelShader,this.__shaderFunctionName=t,this.__materialNodeUid=++v.__invalidMaterialNodeCount,v.materialNodes[v.__invalidMaterialNodeCount]=this,this.__isMorphing=n,this.__isSkinning=i,this.__isLighting=a,this.__vertexShaderityObject=r,this.__pixelShaderityObject=s,this.__webglResourceRepository=o.F.getWebGLResourceRepository(),this.__definitions+=`#define RN_MATERIAL_NODE_NAME ${t}\n`}get shaderFunctionName(){return this.__shaderFunctionName}get vertexShaderityObject(){return this.__vertexShaderityObject}get pixelShaderityObject(){return this.__pixelShaderityObject}getDefinitions(e){let t=this.__definitions.concat();return t+="#define RN_IS_ALPHAMODE_"+e.alphaMode.str+"\n",t}static getMaterialNode(e){return v.materialNodes[e]}get materialNodeUid(){return this.__materialNodeUid}get _semanticsInfoArray(){return this.__semantics}get isSkinning(){return this.__isSkinning}get isMorphing(){return this.__isMorphing}get isLighting(){return this.__isLighting}setShaderSemanticsInfoArray(e){const t=[];for(const n of e)t.push(n);this.__semantics=t,v.__semanticsMap.has(this.shaderFunctionName)||v.__semanticsMap.set(this.shaderFunctionName,new Map);const n=v.__semanticsMap.get(this.shaderFunctionName);for(const e of this.__semantics)n.set(e.semantic.str,e)}getShaderSemanticInfoFromName(e){return v.__semanticsMap.get(this.shaderFunctionName).get(e)}addVertexInputConnection(e,t,n){this.__vertexInputConnections.push({materialNodeUid:e.materialNodeUid,outputNameOfPrev:t,inputNameOfThis:n})}addPixelInputConnection(e,t,n){this.__pixelInputConnections.push({materialNodeUid:e.materialNodeUid,outputNameOfPrev:t,inputNameOfThis:n})}get vertexInputConnections(){return this.__vertexInputConnections}get pixelInputConnections(){return this.__pixelInputConnections}getVertexInput(e){for(const t of this.__vertexInputs)if(t.name===e)return t}getVertexInputs(){return this.__vertexInputs}getVertexOutput(e){for(const t of this.__vertexOutputs)if(t.name===e)return t}getVertexOutputs(){return this.__vertexOutputs}getPixelInput(e){for(const t of this.__pixelInputs)if(t.name===e)return t}getPixelInputs(){return this.__pixelInputs}getPixelOutput(e){for(const t of this.__pixelOutputs)if(t.name===e)return t}getPixelOutputs(){return this.__pixelOutputs}setupBasicInfo(e,t,n,i,o){if(e.setUniform){if(this.setWorldMatrix(t,e.worldMatrix),this.setNormalMatrix(t,e.normalMatrix),this.setIsBillboard(t,e.isBillboard),n||e.isVr){let n=e.renderPass.cameraComponent;null==n&&(n=p.C.getComponent(o,o.current)),this.setViewInfo(t,n,e.isVr,e.displayIdx),this.setProjection(t,n,e.isVr,e.displayIdx)}if(n){this.setLightsInfo(t,e.lightComponents,i,e.setUniform);const n=e.entity.tryToGetSkeletal();this.setSkinning(t,e.setUniform,n)}}const a=e.entity.tryToGetBlendShape();this.setMorphInfo(t,e.entity.getMesh(),e.primitive,a)}setWorldMatrix(e,t){e._gl.uniformMatrix4fv(e.worldMatrix,!1,t._v)}setNormalMatrix(e,t){e._gl.uniformMatrix3fv(e.normalMatrix,!1,t._v)}setIsBillboard(e,t){e._gl.uniform1i(e.isBillboard,t?1:0)}setViewInfo(e,t,n,i){let o,a;if(n){const e=f.x.getInstance().getModule("xr").WebXRSystem.getInstance();e.isWebXRMode&&(o=e._getViewMatrixAt(i),a=e._getCameraWorldPositionAt(i))}else t?(a=t.worldPosition,o=t.viewMatrix):(o=c.e.identity(),a=l.P.fromCopyArray([0,0,10]));e._gl.uniformMatrix4fv(e.viewMatrix,!1,o._v),e._gl.uniform3fv(e.viewPosition,a._v)}setProjection(e,t,n,i){let o;if(n){const e=f.x.getInstance().getModule("xr").WebXRSystem.getInstance();e.isWebXRMode&&(o=e._getProjectMatrixAt(i))}else o=t?t.projectionMatrix:c.e.identity();e._gl.uniformMatrix4fv(e.projectionMatrix,!1,o._v)}setSkinning(e,t,n){if(this.__isSkinning)if(n){if(t){if(a.D.boneDataType===u.N.Mat43x1){const t=n.jointMatricesArray;e._gl.uniformMatrix4x3fv(e.boneMatrix,!1,t)}else if(a.D.boneDataType===u.N.Vec4x2){const t=n.jointTranslatePackedQuat,i=n.jointScalePackedQuat;e._gl.uniform4fv(e.boneTranslatePackedQuat,t),e._gl.uniform4fv(e.boneScalePackedQuat,i)}else if(a.D.boneDataType===u.N.Vec4x2Old){const t=n.jointQuaternionArray,i=n.jointTranslateScaleArray;e._gl.uniform4fv(e.boneQuaternion,t),e._gl.uniform4fv(e.boneTranslateScale,i)}else if(a.D.boneDataType===u.N.Vec4x1){const t=n.jointCompressedChunk,i=n.jointCompressedInfo;e._gl.uniform4fv(e.boneCompressedChunk,t),e._gl.uniform4fv(e.boneCompressedInfo,i._v)}e._gl.uniform1i(e.skinningMode,n.componentSID)}}else t&&e._gl.uniform1i(e.skinningMode,-1)}setLightsInfo(e,t,n,i){if(this.__isLighting&&i){const n=t.filter((e=>e.enable));e._gl.uniform1i(e.lightNumber,n.length);const i=Math.min(n.length,a.D.maxLightNumberInShader);v.__lightPositions.length!==3*i&&(v.__lightPositions=new Float32Array(3*i),v.__lightDirections=new Float32Array(3*i),v.__lightIntensities=new Float32Array(3*i),v.__lightProperties=new Float32Array(4*i));for(let t=0;t=a.D.maxLightNumberInShader)&&null!=e.lightPosition;t++){const e=n[t],i=e.entity.getSceneGraph().worldPosition,o=e.direction,a=e.intensity;v.__lightPositions[3*t+0]=i.x,v.__lightPositions[3*t+1]=i.y,v.__lightPositions[3*t+2]=i.z;const r=1/Math.max(.001,Math.cos(e.innerConeAngle)-Math.cos(e.outerConeAngle)),s=-Math.cos(e.outerConeAngle)*r;v.__lightDirections[3*t+0]=o.x,v.__lightDirections[3*t+1]=o.y,v.__lightDirections[3*t+2]=o.z,v.__lightIntensities[3*t+0]=a.x,v.__lightIntensities[3*t+1]=a.y,v.__lightIntensities[3*t+2]=a.z,v.__lightProperties[4*t+0]=e.enable?e.type.index:-1,v.__lightProperties[4*t+1]=e.range,v.__lightProperties[4*t+2]=r,v.__lightProperties[4*t+3]=s}i>0&&(e._gl.uniform3fv(e.lightPosition,v.__lightPositions),e._gl.uniform3fv(e.lightDirection,v.__lightDirections),e._gl.uniform3fv(e.lightIntensity,v.__lightIntensities),e._gl.uniform4fv(e.lightProperty,v.__lightProperties))}}setMorphInfo(e,t,n,i){if(!this.__isMorphing)return;if(0===n.targets.length)return void e._gl.uniform1i(e.morphTargetNumber,0);e._gl.uniform1i(e.morphTargetNumber,n.targets.length);const o=n.targets.map((e=>{const t=e.get(_.T.Position.XYZ);let n=0;return h.V.isDataTextureApproach(d.l.currentProcessApproach)&&(n=a.D.totalSizeOfGPUShaderDataStorageExceptMorphData),(n+t.byteOffsetInBuffer)/4/4}));let r;e._gl.uniform1iv(e.dataTextureMorphOffsetPosition,o),r=i.weights.length>0?i.weights:new Float32Array(n.targets.length),e._gl.uniform1fv(e.morphWeights,r)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){}setDefaultInputValue(e,t){this.__defaultInputValues.set(e,t)}getDefinition(){return""}}v.__semanticsMap=new Map,v.__invalidMaterialNodeUid=-1,v.__invalidMaterialNodeCount=-1,v.materialNodes=[],v.__tmp_vector4=s.xQ.zero(),v.__tmp_vector2=r.NR.zero(),v.__lightPositions=new Float32Array(0),v.__lightDirections=new Float32Array(0),v.__lightIntensities=new Float32Array(0),v.__lightProperties=new Float32Array(0)},2192:(e,t,n)=>{n.d(t,{$R:()=>l,Cb:()=>m,Dx:()=>s,GV:()=>u,Lx:()=>d,NB:()=>h,kT:()=>f,mg:()=>c,pn:()=>_});var i=n(7683),o=n(8430),a=n(2858),r=n(2575);const s=new r.x,l=new r.x,c=new r.x,_=new a.B,h=new r.x,u=new r.x,d=new r.x;async function m(){s.isTextureReady||(s.tryToSetUniqueName("dummyWhiteTexture",!0),l.tryToSetUniqueName("dummyBlueTexture",!0),c.tryToSetUniqueName("dummyBlackTexture",!0),_.tryToSetUniqueName("dummyBlackCubeTexture",!0),h.tryToSetUniqueName("sheenLutTexture",!0),u.tryToSetUniqueName("dummySRGBGrayTexture",!0),d.tryToSetUniqueName("dummyAnisotropyTexture",!0),s.generate1x1TextureFrom(),l.generate1x1TextureFrom("rgba(127.5, 127.5, 255, 1)"),c.generate1x1TextureFrom("rgba(0, 0, 0, 1)"),_.load1x1Texture("rgba(0, 0, 0, 1)"),o.l.currentProcessApproach!==i.V.WebGPU&&await h.generateSheenLutTextureFromDataUri(),u.generate1x1TextureFrom("rgba(186, 186, 186, 1)"),d.generate1x1TextureFrom("rgba(255, 127.5, 255, 1)"))}const f={dummyWhiteTexture:s,dummyBlueTexture:l,dummyBlackTexture:c,dummyBlackCubeTexture:_,sheenLutTexture:h,dummySRGBGrayTexture:u,dummyAnisotropyTexture:d}},7882:(e,t,n)=>{n.d(t,{F:()=>T});var i=n(9002),o=n(5704),a=n(4587),r=n(810),s=n(8547),l=n(7987),c=n(5324),_=n(7348),h=n(1813),u=n(4690),d=n(7009),m=n(3034),f=n.n(m),p=n(3258),v=n(1226),A=n(7683),y=n(3449),x=n(8430),g=n(430);class I{static _createShaderProgramWithCache(e,t,n,i,o,a){const r=t+n;let s=this.__shaderStringMap.get(r);if(s)return s;const c=y.j.toCRC32(r);if(s=this.__shaderHashMap.get(c),s)return s;{const s=l.F.getCgApiResourceRepository().createShaderProgram({material:e,vertexShaderStr:t,fragmentShaderStr:n,attributeNames:i,attributeSemantics:o,onError:a});return this.__shaderStringMap.set(r,s),this.__shaderHashMap.set(c,s),s}}}function b(e){const t=g.u.getAttributeReflection(e.vertexShaderityObject);return{attributeNames:t.names,attributeSemantics:t.semantics}}function E(e){let t="";const n=l.F.getWebGLResourceRepository().currentWebGLContextWrapper;return n.isWebGL2&&(t+="#version 300 es\n#define GLSL_ES3\n",p.D.isUboEnabled&&(t+="#define RN_IS_UBO_ENABLED\n")),t+=`#define RN_MATERIAL_TYPE_NAME ${e}\n`,A.V.isDataTextureApproach(x.l.currentProcessApproach)?t+="#define RN_IS_DATATEXTURE_MODE\n":t+="#define RN_IS_UNIFORM_MODE\n",n.is_multiview&&(t+="#define WEBGL2_MULTI_VIEW\n"),(n.isWebGL2||n.webgl1ExtDRV)&&(t+="#define RN_IS_SUPPORTING_STANDARD_DERIVATIVES\n"),p.D.boneDataType===v.N.Mat43x1?t+="#define RN_BONE_DATA_TYPE_Mat43x1\n":p.D.boneDataType===v.N.Vec4x2?t+="#define RN_BONE_DATA_TYPE_VEC4X2\n":p.D.boneDataType===v.N.Vec4x2Old?t+="#define RN_BONE_DATA_TYPE_VEC4X2_OLD\n":p.D.boneDataType===v.N.Vec4x1&&(t+="#define RN_BONE_DATA_TYPE_VEC4X1\n"),t}I.__shaderHashMap=new Map,I.__shaderStringMap=new Map;class T extends i.S{constructor(e,t,n,i,a){super(),this._allFieldVariables=new Map,this._autoFieldVariablesOnly=new Map,this._allFieldsInfo=new Map,this.__belongPrimitives=new Map,this._shaderProgramUid=l.F.InvalidCGAPIResourceUid,this.__materialUid=-1,this.__materialSid=-1,this.__alphaMode=o.F.Opaque,this.cullFace=!0,this.cullFrontFaceCCW=!0,this.__alphaToCoverage=!1,this.__blendEquationMode=d.C.EquationFuncAdd,this.__blendEquationModeAlpha=d.C.EquationFuncAdd,this.__blendFuncSrcFactor=d.C.SrcAlpha,this.__blendFuncDstFactor=d.C.OneMinusSrcAlpha,this.__blendFuncAlphaSrcFactor=d.C.One,this.__blendFuncAlphaDstFactor=d.C.One,this.__stateVersion=0,this._materialContent=a,this.__materialTid=e,this.__materialUid=t,this.__materialSid=n,this.__materialTypeName=i}setParameter(e,t){const n=(0,a.UL)(e),i=this._allFieldsInfo.get(n);if(null!=i){let e;e=i.soloDatum?T._soloDatumFields.get(this.__materialTypeName).get(n):this._allFieldVariables.get(n),s.D._setForce(e.value,t)}this.__stateVersion++}setTextureParameter(e,t,n){if(this._allFieldsInfo.has(e.index)){const i=async()=>{void 0!==t.loadFromUrlLazy&&(await t.loadFromUrlLazy(),await t.loadFromImgLazy());const i=this._allFieldVariables.get(e.index),r={value:[i.value[0],t,n],info:i.info};this._allFieldVariables.set(e.index,r),i.info.isCustomSetting||this._autoFieldVariablesOnly.set(e.index,r),e!==a.f5.DiffuseColorTexture&&e!==a.f5.BaseColorTexture||t.isTransparent&&(this.alphaMode=o.F.Translucent),this.__stateVersion++};void 0!==t.hasDataToLoadLazy&&t.hasDataToLoadLazy?setTimeout(i,0):i()}}getTextureParameter(e){if(this._allFieldsInfo.has(e.index))return this._allFieldVariables.get(e.index).value[1]}setTextureParameterAsPromise(e,t){t.then((t=>{if(this._allFieldsInfo.has(e.index)){const n=this._allFieldVariables.get(e.index),i={value:[n.value[0],t],info:n.info};this._allFieldVariables.set(e.index,i),n.info.isCustomSetting||this._autoFieldVariablesOnly.set(e.index,i),e!==a.f5.DiffuseColorTexture&&e!==a.f5.BaseColorTexture||t.isTransparent&&(this.alphaMode=o.F.Translucent)}this.__stateVersion++}))}getParameter(e){var t,n;const i=this._allFieldsInfo.get(e.index);if(null!=i)return i.soloDatum?null===(t=T._soloDatumFields.get(this.__materialTypeName).get(e.index))||void 0===t?void 0:t.value:null===(n=this._allFieldVariables.get(e.index))||void 0===n?void 0:n.value}isShaderProgramReady(){return this._shaderProgramUid!==l.F.InvalidCGAPIResourceUid}_setUniformLocationsOfMaterialNodes(e){const t=l.F.getWebGLResourceRepository();let n=[];if(u.Is.exist(this._materialContent)){const e=this._materialContent._semanticsInfoArray;n=n.concat(e)}t.setupUniformLocations(this._shaderProgramUid,n,e)}_addBelongPrimitive(e){this.__belongPrimitives.set(e.primitiveUid,e)}_createProgramWebGL(e,t,n){const{vertexPropertiesStr:i,pixelPropertiesStr:o}=this._getProperties(t,n),a=function(e,t,n,i,o){const a=l.F.getWebGLResourceRepository(),r=e._materialContent,s=r.getDefinitions(e);let c=E(e.__materialTypeName);c+="#define RN_IS_VERTEX_SHADER\n";let _=E(e.__materialTypeName);_+="#define RN_IS_PIXEL_SHADER\n";const h=g.u.fillTemplate(r.vertexShaderityObject,{getters:t,definitions:s,dataUBODefinition:a.getGlslDataUBODefinitionString(),dataUBOVec4Size:a.getGlslDataUBOVec4SizeString(),matricesGetters:i}),u=g.u.transformWebGLVersion(h,o).code,d=g.u.fillTemplate(r.pixelShaderityObject,{renderTargetBegin:a.getGlslRenderTargetBeginString(4),getters:n,definitions:s,dataUBODefinition:a.getGlslDataUBODefinitionString(),dataUBOVec4Size:a.getGlslDataUBOVec4SizeString(),matricesGetters:i,renderTargetEnd:a.getGlslRenderTargetEndString(4)}),m=g.u.transformWebGLVersion(d,o).code;c+=u.replace(/#version\s+(100|300\s+es)/,""),_+=m.replace(/#version\s+(100|300\s+es)/,"");const{attributeNames:f,attributeSemantics:p}=b(r),v=function(e,t){let n="\n// Vertex Attributes Binding Info\n";for(let i=0;i{const r=this._allFieldsInfo.get(a);r.stage!==c.H.VertexShader&&r.stage!==c.H.VertexAndPixelShader||(n+=e(this.__materialTypeName,r,a,!1,t)),r.stage!==c.H.PixelShader&&r.stage!==c.H.VertexAndPixelShader||(i+=e(this.__materialTypeName,r,a,!1,t))}));const o=_.$.getInstance();return[n,i]=o._addPropertiesStr(n,i,e,t),{vertexPropertiesStr:n,pixelPropertiesStr:i}}__setAutoParametersToGpu(e,t,n){const i=l.F.getWebGLResourceRepository();e.setUniform?this._autoFieldVariablesOnly.forEach((e=>{const o=e.info;t||o.updateInterval!==h.a.FirstTimeOnly?i.setUniformValue(n,o.semantic.str,t,e.value):r.d.isTexture(o.compositionType)&&i.bindTexture(o,e.value)})):this._autoFieldVariablesOnly.forEach((e=>{const o=e.info;r.d.isTexture(o.compositionType)&&(t||o.updateInterval!==h.a.FirstTimeOnly?i.setUniformValue(n,o.semantic.str,t,e.value):i.bindTexture(o,e.value)),o.needUniformInDataTextureMode&&i.setUniformValue(n,o.semantic.str,t,e.value)}))}__setSoloDatumParametersToGpu({shaderProgram:e,firstTime:t,args:n}){const i=l.F.getWebGLResourceRepository(),o=this.__materialTypeName,a=T._soloDatumFields.get(o);null!=a&&a.forEach(((o,a)=>{const s=o.info;(n.setUniform||r.d.isTexture(s.compositionType))&&(s.isCustomSetting||(t||s.updateInterval!==h.a.FirstTimeOnly?i.setUniformValue(e,s.semantic.str,t,o.value):i.bindTexture(s,o.value)))}))}__getTargetShaderSemantics(e){const t=this.fieldsInfoArray.find((t=>(t.none_u_prefix?"":"u_")+t.semantic.str===e));if(null!=t)return t.semantic;console.error(`Material.__getTargetShaderSemantics: uniform ${e} is not found`)}setBlendEquationMode(e,t){this.__blendEquationMode=e,this.__blendEquationModeAlpha=null!=t?t:e,this.__stateVersion++}setBlendFuncSeparateFactor(e,t,n,i){this.__blendFuncSrcFactor=e,this.__blendFuncDstFactor=t,this.__blendFuncAlphaSrcFactor=n,this.__blendFuncAlphaDstFactor=i,this.__stateVersion++}setBlendFuncFactor(e,t){this.__blendFuncSrcFactor=e,this.__blendFuncDstFactor=t,this.__blendFuncAlphaSrcFactor=e,this.__blendFuncAlphaDstFactor=t,this.__stateVersion++}isEmptyMaterial(){return void 0===this._materialContent}isBlend(){return this.alphaMode===o.F.Translucent||this.alphaMode===o.F.Additive}set alphaToCoverage(e){e&&this.alphaMode===o.F.Translucent&&console.warn("If you set alphaToCoverage = true on a material whose AlphaMode is Translucent, you may get drawing problems."),this.__alphaToCoverage=e,this.__stateVersion++}get alphaToCoverage(){return this.__alphaToCoverage}get materialTID(){return this.__materialTid}get fieldsInfoArray(){return Array.from(this._allFieldsInfo.values())}get blendEquationMode(){return this.__blendEquationMode}get blendEquationModeAlpha(){return this.__blendEquationModeAlpha}get blendFuncSrcFactor(){return this.__blendFuncSrcFactor}get blendFuncDstFactor(){return this.__blendFuncDstFactor}get blendFuncAlphaSrcFactor(){return this.__blendFuncAlphaSrcFactor}get blendFuncAlphaDstFactor(){return this.__blendFuncAlphaDstFactor}get alphaMode(){return this.__alphaMode}set alphaMode(e){this.__alphaMode=e,this._shaderProgramUid=-1}get materialUID(){return this.__materialUid}get materialSID(){return this.__materialSid}get isSkinning(){return this._materialContent.isSkinning}get isMorphing(){return this._materialContent.isMorphing}get isLighting(){return this._materialContent.isLighting}get materialTypeName(){return this.__materialTypeName}get stateVersion(){return this.__stateVersion}}T._soloDatumFields=new Map},903:(e,t,n)=>{n.d(t,{r:()=>u});var i=n(3258),o=n(9286),a=n(752),r=n(3999),s=n(810),l=n(1181),c=n(8547),_=n(4690),h=n(7882);class u{static registerMaterial(e,t,n=i.D.maxMaterialInstanceForEachType){return u.__materialNodes.has(e)?(console.info(`${e} is already registered.`),!1):(u.__registerInner(e,t,n),!0)}static forceRegisterMaterial(e,t,n=i.D.maxMaterialInstanceForEachType){return this.__registerInner(e,t,n),!0}static isRegisteredMaterialType(e){return u.__materialNodes.has(e)}static getMaterialByMaterialUid(e){return this.__materialMap.get(e)}static getAllMaterials(){return Array.from(u.__materialMap.values())}static createMaterial(e,t){let n=t;n||(n=u.__materialNodes.get(e));let i=u.__materialInstanceCountOfType.get(e);const o=new h.F(u.__materialTids.get(e),++u.__materialUidCount,i++,e,n);return this.__initialize(o,i),o}static isFullOrOverOfThisMaterialType(e){const t=u.__materialInstanceCountOfType.get(e);if(_.Is.not.exist(t))return!1;const n=u.__maxInstances.get(e);return!_.Is.not.exist(n)&&t>=n}static __initialize(e,t){e.tryToSetUniqueName(e.__materialTypeName,!0);{u.__materialMap.set(e.materialUID,e);let n=u.__instances.get(e.__materialTypeName);_.Is.not.exist(n)&&(n=new Map,u.__instances.set(e.materialTypeName,n)),n.set(e.materialSID,e),u.__materialInstanceCountOfType.set(e.materialTypeName,t)}if(_.Is.exist(e._materialContent)){const t=e._materialContent._semanticsInfoArray,n=u.__accessors.get(e.materialTypeName);t.forEach((t=>{const i=u._getPropertyIndex(t);if(e._allFieldsInfo.set(i,t),!t.soloDatum){const o=n.get(i).takeOne(),a={info:t,value:c.D.initWithFloat32Array(t.initialValue,t.initialValue,o,t.compositionType)};e._allFieldVariables.set(i,a),t.isCustomSetting||e._autoFieldVariablesOnly.set(i,a)}}))}}static getLocationOffsetOfMemberOfMaterial(e,t){const n=u.__instances.get(e).get(0);return n._allFieldsInfo.get(t).soloDatum?h.F._soloDatumFields.get(n.materialTypeName).get(t).value._v.byteOffset/4/4:this.__accessors.get(e).get(t).byteOffsetInBuffer/4/4}static _getPropertyIndex(e){return e.semantic.index}static __registerInner(e,t,n){const i=++u.__materialTidCount;u.__materialNodes.set(e,t),u.__materialTids.set(e,i),u.__maxInstances.set(e,n),_.Is.exist(t)&&u.__allocateBufferView(e,t),u.__materialInstanceCountOfType.set(e,0)}static __allocateBufferView(e,t){let n=0;const i=[];for(const o of t._semanticsInfoArray){const t=(0,l.K)(o);let a=1;o.soloDatum||(a=u.__maxInstances.get(e)),n+=t*a,i.push({alignedByte:t,semanticInfo:o})}this.__accessors.has(e)||this.__accessors.set(e,new Map);const _=o.B.getInstance().createOrGetBuffer(a.$.GPUInstanceData);let d;this.__bufferViews.has(e)?d=this.__bufferViews.get(e):(d=_.takeBufferView({byteLengthToNeed:n,byteStride:0}).unwrapForce(),this.__bufferViews.set(e,d));for(let t=0;t{n.d(t,{u:()=>I});var i=n(3034),o=n.n(i),a=n(3999),r=n(810),s=n(128),l=n(9286),c=n(4710),_=n(3258),h=n(4587),u=n(1813),d=n(8182),m=n(9190),f=n(4536),p=n(2566),v=n(3496),A=n(4267),y=n(7035),x=n(5324),g=n(2192);class I{static fillTemplate(e,t){const n=Object.assign(t,{WellKnownComponentTIDs:c.z,widthOfDataTexture:`const int widthOfDataTexture = ${l.B.bufferWidthLength};`,heightOfDataTexture:`const int heightOfDataTexture = ${l.B.bufferHeightLength};`,Config:_.D});return o().fillTemplate(e,n)}static transformWebGLVersion(e,t){return t?o().transformToGLSLES3(e):o().transformToGLSLES1(e,!0)}static getAttributeReflection(e){const t=o().createReflectionObject(e);return this.__setDefaultAttributeSemanticMap(t),t.reflect(),{names:t.attributesNames,semantics:t.attributesSemantics.map((e=>s.T.fromString(e))),compositions:t.attributesTypes.map((e=>r.d.fromGlslString(e))),components:t.attributesTypes.map((e=>a.r.fromGlslString(e)))}}static __setDefaultAttributeSemanticMap(e){const t=new Map;t.set("instanceinfo","INSTANCE"),t.set("barycentriccoord","BARY_CENTRIC_COORD"),e.addAttributeSemanticsMap(t)}static getShaderDataReflection(e,t){const n=this.__copyShaderityObject(e),i=e.code.split(/\r\n|\n/),o=[],a=[];for(const n of i){const i=/^(?![/])[\t ]*uniform[\t ]+(\w+)[\t ]+(\w+);[\t ]*(\/\/)*[\t ]*(.*)/,r=n.match(i);if(r){const i=r[1],s=r[2],l=r[4];if(this.__ignoreThisUniformDeclaration(l)){o.push(n);continue}const c=this.__createShaderSemanticsInfo(i,s,l,e.isFragmentShader,t);a.push(c)}else o.push(n)}return n.code=o.join("\n"),{shaderSemanticsInfoArray:a,shaderityObject:n}}static __copyShaderityObject(e){return{code:e.code,shaderStage:e.shaderStage,isFragmentShader:"fragment"===e.shaderStage}}static __ignoreThisUniformDeclaration(e){const t=e.match(/skipProcess[\t ]*=[\t ]*(\w+)[,\t ]*/);return"true"===(null==t?void 0:t[1])}static __createShaderSemanticsInfo(e,t,n,i,o){const s=a.r.fromGlslString(e),l=r.d.fromGlslString(e),c=i?x.H.PixelShader:x.H.VertexShader;let _=!0;const u=t.match(/u_(\w+)/);u&&(t=u[1],_=!1);let d=h.f5.fromStringCaseSensitively(t);if(null==d){const e=null==o?void 0:o.get(t);d=null!=e?e.semantic:new h.wy({str:t})}const m={semantic:d,compositionType:l,componentType:s,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!1,stage:c,none_u_prefix:_};return this.__setRhodoniteOriginalParametersTo(m,n),m}static __setRhodoniteOriginalParametersTo(e,t){var n;const i=t.match(/soloDatum[\t ]*=[\t ]*(\w+)[,\t ]*/);let o=!1;"true"===(null==i?void 0:i[1])&&(o=!0),e.soloDatum=o;const a=t.match(/isCustomSetting[\t ]*=[\t ]*(\w+)[,\t ]*/);let r=!1;"true"===(null==a?void 0:a[1])&&(r=!0),e.isCustomSetting=r;const s=t.match(/updateInterval[\t ]*=[\t ]*(\w+)[,\t ]*/);let l=u.a.FirstTimeOnly;"everytime"===(null===(n=null==s?void 0:s[1])||void 0===n?void 0:n.toLowerCase())&&(l=u.a.EveryTime),e.updateInterval=l;const c=t.match(/initialValue[\t ]*=[\t ]*(.+)[,\t ]*/);if(c){const t=c[1];e.initialValue=this.__getInitialValueFromText(e,t)}else e.initialValue=this.__getDefaultInitialValue(e);const _=t.match(/needUniformInDataTextureMode[\t ]*=[\t ]*(.+)[,\t ]*/);if(_){let t=!1;"true"===(null==_?void 0:_[1])&&(t=!0),e.needUniformInDataTextureMode=t}}static __getInitialValueFromText(e,t){const n=t.match(/\(([\d\w., ]+)\)/),i=t=>{e.compositionType!==t&&console.error("component number of initialValue is invalid:"+e.semantic.str)};let o;if(n){const t=n[1].split(",");switch(t.length){case 1:i(r.d.Scalar),o="true"===t[0]?new A.DU(new Float32Array([1])):"false"===t[0]?new A.DU(new Float32Array([0])):new A.DU(new Float32Array([parseFloat(t[0])]));break;case 2:if(e.compositionType===r.d.Texture2D||e.compositionType===r.d.Texture2DShadow){const e=t[1].charAt(0).toUpperCase()+t[1].slice(1);o=[parseInt(t[0]),g.kT[`dummy${e}Texture`]]}else if(e.compositionType===r.d.TextureCube){const e=t[1].charAt(0).toUpperCase()+t[1].slice(1);o=[parseInt(t[0]),g.kT[`dummy${e}CubeTexture`]]}else i(r.d.Vec2),o=d.NR.fromCopyArray([parseFloat(t[0]),parseFloat(t[1])]);break;case 3:i(r.d.Vec3),o=m.d6.fromCopyArray([parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]);break;case 4:i(r.d.Vec4),o=f.xQ.fromCopyArray([parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])]);break;case 9:i(r.d.Mat3),o=p.x.fromCopy9RowMajor(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]),parseFloat(t[7]),parseFloat(t[8]));break;case 16:i(r.d.Mat4),o=v.e.fromCopy16RowMajor(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]),parseFloat(t[7]),parseFloat(t[8]),parseFloat(t[9]),parseFloat(t[10]),parseFloat(t[11]),parseFloat(t[12]),parseFloat(t[13]),parseFloat(t[14]),parseFloat(t[15]));break;default:console.error("Invalid format")}}else i(r.d.Scalar),o="true"===t?new A.DU(new Float32Array([1])):"false"===t?new A.DU(new Float32Array([0])):new A.DU(new Float32Array([parseFloat(t)]));return o}static __getDefaultInitialValue(e){return e.compositionType===r.d.Scalar?new A.DU(new Float32Array([0])):e.compositionType===r.d.Vec2?d.NR.zero():e.compositionType===r.d.Vec3?m.d6.zero():e.compositionType===r.d.Vec4?f.xQ.zero():e.compositionType===r.d.Mat2?y.f.identity():e.compositionType===r.d.Mat3?p.x.identity():e.compositionType===r.d.Mat4?v.e.identity():e.compositionType===r.d.Texture2D||e.compositionType===r.d.Texture2DShadow?[0,g.Dx]:e.compositionType===r.d.TextureCube?[0,g.mg]:void console.warn("initial value is not found")}}},2477:(e,t,n)=>{n.d(t,{m:()=>r});var i=n(2471),o=n(9190),a=n(3032);class r{constructor(){this.__min=o.d6.fromCopyArray([Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE]),this.__max=o.d6.fromCopyArray([-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]),this.__centerPoint=o.d6.zero(),this.__lengthCenterToCorner=0,this.__isCenterPointDirty=!1,this.__isLengthCenterToCornerDirty=!1,this.__isVanilla=!0}clone(){const e=new r;return e.__max=this.__max.clone(),e.__min=this.__min.clone(),e.__centerPoint=this.__centerPoint.clone(),e.__lengthCenterToCorner=this.__lengthCenterToCorner,e.__isCenterPointDirty=this.__isCenterPointDirty,e.__isLengthCenterToCornerDirty=this.__isLengthCenterToCornerDirty,e}copyComponents(e){return this.__max.copyComponents(e.__max),this.__min.copyComponents(e.__min),this.__centerPoint.copyComponents(e.__centerPoint),this.__lengthCenterToCorner=e.__lengthCenterToCorner,this.__isCenterPointDirty=e.__isCenterPointDirty,this.__isLengthCenterToCornerDirty=e.__isLengthCenterToCornerDirty,this.__isVanilla=!1,this}initialize(){this.__min.setComponents(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.__max.setComponents(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),this.__centerPoint.zero(),this.__lengthCenterToCorner=0,this.__isCenterPointDirty=!1,this.__isLengthCenterToCornerDirty=!1,this.__isVanilla=!0}set minPoint(e){this.__min.copyComponents(e),this.__isCenterPointDirty=!0,this.__isLengthCenterToCornerDirty=!0,this.__isVanilla=!1}get minPoint(){return this.__min}set maxPoint(e){this.__max.copyComponents(e),this.__isCenterPointDirty=!0,this.__isLengthCenterToCornerDirty=!0,this.__isVanilla=!1}get maxPoint(){return this.__max}isVanilla(){return this.__isVanilla}addPosition(e){return this.__min.x=e.x{n.d(t,{X:()=>i});class i{constructor(){this._v=new Float32Array}at(e,t){throw new Error("Method not implemented.")}toString(){throw new Error("Method not implemented.")}toStringApproximately(){throw new Error("Method not implemented.")}flattenAsArray(){throw new Error("Method not implemented.")}isDummy(){return 0===this._v.length}v(e){return this._v[e]}determinant(){throw new Error("Method not implemented.")}get className(){return this.constructor.name}get isIdentityMatrixClass(){return!1}isTheSourceSame(e){return this._v.buffer===e}}},3632:(e,t,n)=>{n.d(t,{l:()=>i});class i{constructor(){this._v=new Float32Array}get className(){return this.constructor.name}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return this._v[3]}at(e){return this._v[e]}length(){return Math.hypot(this._v[0],this._v[1],this._v[2],this._v[3])}lengthSquared(){return this._v[0]**2+this._v[1]**2+this._v[2]**2+this._v[3]**2}toString(){throw new Error("Method not implemented.")}toStringApproximately(){throw new Error("Method not implemented.")}flattenAsArray(){throw new Error("Method not implemented.")}isDummy(){throw new Error("Method not implemented.")}isEqual(e,t){throw new Error("Method not implemented.")}isStrictEqual(e){throw new Error("Method not implemented.")}toEulerAnglesTo(e){throw new Error("Method not implemented.")}toEulerAngles(){throw new Error("Method not implemented.")}transformVector3(e){throw new Error("Method not implemented.")}transformVector3Inverse(e){throw new Error("Method not implemented.")}dot(e){return this._v[0]*e._v[0]+this._v[1]*e._v[1]+this._v[2]*e._v[2]+this._v[3]*e._v[3]}clone(){throw new Error("Method not implemented.")}}},3343:(e,t,n)=>{n.d(t,{O:()=>i});class i{constructor(){this._v=new Float32Array}get glslStrAsFloat(){throw new Error("Method not implemented.")}get glslStrAsInt(){throw new Error("Method not implemented.")}isEqual(e,t){throw new Error("Method not implemented.")}isStrictEqual(e){throw new Error("Method not implemented.")}length(){throw new Error("Method not implemented.")}lengthSquared(){throw new Error("Method not implemented.")}lengthTo(e){throw new Error("Method not implemented.")}dot(e){throw new Error("Method not implemented.")}at(e){return this._v[e]}toString(){throw new Error("Method not implemented.")}toStringApproximately(){throw new Error("Method not implemented.")}flattenAsArray(){throw new Error("Method not implemented.")}isDummy(){return 0===this._v.length}v(e){return this._v[e]}isTheSourceSame(e){return this._v.buffer===e}get className(){return this.constructor.name}get bytesPerComponent(){throw new Error("Method not implemented.")}}},1162:(e,t,n)=>{n.d(t,{s:()=>o});var i=n(2471);class o extends i.P{constructor(e){super(e)}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return 1}get r(){return this._v[0]}get g(){return this._v[1]}get b(){return this._v[2]}get a(){return 1}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}static cross(e,t){return super._cross(e,t,Float32Array)}clone(){return super.clone()}}},346:(e,t,n)=>{n.d(t,{c:()=>r});var i=n(810),o=n(8775),a=n(2471);class r extends o.X{constructor(){super(),this._v=r.__v}toString(){return"1 0 0\n0 1 0\n0 0 1\n"}toStringApproximately(){return this.toString()}flattenAsArray(){return[1,0,0,0,1,0,0,0,1]}isDummy(){return!1}isEqual(e,t=Number.EPSILON){return Math.abs(e.m00-1){n.d(t,{a:()=>r});var i=n(810),o=n(8775),a=n(2471);class r extends o.X{constructor(){super(),this._v=r.__v}toString(){return"1 0 0 0\n0 1 0 0\n0 0 1 0\n0 0 0 1\n"}toStringApproximately(){return this.toString()}flattenAsArray(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}isDummy(){return!1}isEqual(e,t=Number.EPSILON){return Math.abs(e.m00-1){n.d(t,{D:()=>y});var i=n(2390),o=n(2471),a=n(7192),r=n(9207),s=n(1937),l=n(5467),c=n(810),_=n(3496),h=n(2566),u=n(4536),d=n(9190),m=n(8182),f=n(3616),p=n(963),v=n(4267),A=n(4255);class y{constructor(){}static arrayToVector(e){return Array.isArray(e)?void 0!==e[3]?a.Lt.fromCopyArray([e[0],e[1],e[2],e[3]]):void 0!==e[2]?o.P.fromCopyArray([e[0],e[1],e[2]]):i.FM.fromCopyArray2([e[0],e[1]]):e}static arrayToVectorOrMatrix(e){return Array.isArray(e)?void 0!==e[15]?l.J.fromCopyArrayRowMajor(e):void 0!==e[8]?s.h.fromCopyArrayRowMajor(e):void 0!==e[3]?a.Lt.fromCopyArray([e[0],e[1],e[2],e[3]]):void 0!==e[2]?o.P.fromCopyArray([e[0],e[1],e[2]]):i.FM.fromCopyArray2([e[0],e[1]]):e}static getImmutableValueClass(e){return e===c.d.Vec2?i.FM:e===c.d.Vec3?o.P:e===c.d.Vec4?a.Lt:e===c.d.Mat3?s.h:e===c.d.Mat4?l.J:void 0}static getMutableValueClass(e){return e===c.d.Vec2?m.NR:e===c.d.Vec3?d.d6:e===c.d.Vec4?u.xQ:e===c.d.Mat3?h.x:e===c.d.Mat4?_.e:void 0}static cloneOfMathObjects(e){return e instanceof l.J||e instanceof s.h||e instanceof a.Lt||e instanceof o.P||e instanceof i.FM?e.clone():e}static isAcceptableArrayForQuaternion(e){return!(!Array.isArray(e)||void 0===e[3])}static arrayToQuaternion(e){return r._.fromCopy4(e[0],e[1],e[2],e[3])}static makeSubArray(e,t){return 4===t?[e[0],e[1],e[2],e[3]]:3===t?[e[0],e[1],e[2]]:2===t?[e[0],e[1]]:e[0]}static vectorToArray(e){return e instanceof i.FM?[e.x,e.y]:e instanceof o.P?[e.x,e.y,e.z]:e instanceof a.Lt||e instanceof r._?[e.x,e.y,e.z,e.w]:e}static componentNumberOfVector(e){return e instanceof i.FM?2:e instanceof o.P?3:e instanceof a.Lt||e instanceof r._?4:Array.isArray(e)?e.length:0}static packNormalizedVec4ToVec2(e,t,n,i,o){let a=0,r=0;return e=(e+1)/2,t=(t+1)/2,n=(n+1)/2,i=(i+1)/2,a=(Math.floor(e*(o-1))*o+Math.floor(t*(o-1)))/o,r=(Math.floor(n*(o-1))*o+Math.floor(i*(o-1)))/o,[a,r]}static unProjectTo(e,t,n,i,o,a){const r=this.__tmpVector4_0.setComponents((e-o.x)/o.z*2-1,(t-o.y)/o.w*2-1,2*n-1,1),s=i.multiplyVectorTo(r,this.__tmpVector4_1);return 0===s.w&&console.error("0 division occurred!"),d.d6.multiplyTo(s,1/s.w,a)}static add(e,t){if(isFinite(e))return e+t;if(e instanceof i.FM)return i.FM.add(e,t);if(e instanceof o.P)return o.P.add(e,t);if(e instanceof a.Lt)return a.Lt.add(e,t);if(e instanceof r._)return r._.add(e,t);if(Array.isArray(e)){const n=[];for(let i=0;i{function i(e){return 0==(e&e-1)}n.d(t,{k:()=>o});const o=Object.freeze({radianToDegree:function(e){return 180*e/Math.PI},degreeToRadian:function(e){return e*Math.PI/180},toHalfFloat:()=>function(e){const t=new Float32Array(1),n=new Int32Array(t.buffer);t[0]=e;const i=n[0];let o=i>>16&32768,a=i>>12&2047;const r=i>>23&255;return r<103?o:r>142?(o|=31744,o|=(255==r?0:1)&&8388607&i,o):r<113?(a|=2048,o|=(a>>114-r)+(a>>113-r&1),o):(o|=r-112<<10|a>>1,o+=1&a,o)},isPowerOfTwo:i,isPowerOfTwoTexture:function(e,t){return i(e)&&i(t)},packNormalizedVec4ToVec2:function(e,t,n,i,o){return e=(e+1)/2,t=(t+1)/2,n=(n+1)/2,i=(i+1)/2,[(Math.floor(e*(o-1))*o+Math.floor(t*(o-1)))/o,(Math.floor(n*(o-1))*o+Math.floor(i*(o-1)))/o]},convertToStringAsGLSLFloat:function(e){return Number.isInteger(e)?`${e}.0`:""+e},nearZeroToZero:function(e){return Math.abs(e)<1e-5?e=0:.999994&&Math.abs(n.at(o))+l==Math.abs(n.at(o))&&Math.abs(n.at(d))+l==Math.abs(n.at(d)))e.setAt(o,d,0);else if(Math.abs(e.at(o,d))>u){c=n.at(d)-n.at(o),Math.abs(c)+l==Math.abs(c)?s=e.at(o,d)/c:(h=.5*c/e.at(o,d),s=h<0?-1/(Math.sqrt(1+h*h)-h):1/(Math.sqrt(1+h*h)+h)),r=1/Math.sqrt(1+s*s),a=s*r,_=s*e.at(o,d),e.setAt(o,d,0),n.setAt(o,n.at(o)-_),n.setAt(d,n.at(d)+_);for(let t=0;t=0?" "+t:t},lerp:function(e,t,n){return e*(1-n)+t*n}})},18:(e,t,n)=>{n.d(t,{a:()=>s});var i=n(810),o=n(2390),a=n(3032),r=n(8775);class s extends r.X{constructor(e){super(),this._v=e}get m00(){return this._v[0]}get m10(){return this._v[1]}get m01(){return this._v[2]}get m11(){return this._v[3]}get className(){return"Matrix22"}static get compositionType(){return i.d.Mat2}static zero(){return s.fromCopy4RowMajor(0,0,0,0)}static identity(){return s.fromCopy4RowMajor(1,0,0,1)}static dummy(){return new this(new Float32Array(0))}static transpose(e){return s.fromCopy4RowMajor(e._v[0],e._v[1],e._v[2],e._v[3])}static invert(e){const t=e.determinant();0===t&&console.error("the determinant is 0!");const n=e._v[3]/t,i=e._v[2]/t*-1,o=e._v[1]/t*-1,a=e._v[0]/t;return s.fromCopy4RowMajor(n,i,o,a)}static invertTo(e,t){const n=e.determinant();0===n&&console.error("the determinant is 0!");const i=e._v[3]/n,o=e._v[2]/n*-1,a=e._v[1]/n*-1,r=e._v[0]/n;return t.setComponents(i,o,a,r)}static rotate(e){const t=Math.cos(e),n=Math.sin(e);return s.fromCopy4RowMajor(t,-n,n,t)}static scale(e){return s.fromCopy4RowMajor(e._v[0],0,0,e._v[1])}static multiply(e,t){const n=e._v[0]*t._v[0]+e._v[2]*t._v[1],i=e._v[1]*t._v[0]+e._v[3]*t._v[1],o=e._v[0]*t._v[2]+e._v[2]*t._v[3],a=e._v[1]*t._v[2]+e._v[3]*t._v[3];return s.fromCopy4RowMajor(n,o,i,a)}static multiplyTo(e,t,n){const i=e._v[0]*t._v[0]+e._v[2]*t._v[1],o=e._v[1]*t._v[0]+e._v[3]*t._v[1],a=e._v[0]*t._v[2]+e._v[2]*t._v[3],r=e._v[1]*t._v[2]+e._v[3]*t._v[3];return n.setComponents(i,a,o,r)}toString(){return this._v[0]+" "+this._v[2]+"\n"+this._v[1]+" "+this._v[3]+" \n"}toStringApproximately(){return a.k.financial(this._v[0])+" "+a.k.financial(this._v[2])+"\n"+a.k.financial(this._v[1])+" "+a.k.financial(this._v[3])+" \n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){n.d(t,{h:()=>l});var i=n(2471),o=n(810),a=n(3032),r=n(8775),s=n(346);class l extends r.X{constructor(e){super(),this._v=e}get m00(){return this._v[0]}get m10(){return this._v[1]}get m20(){return this._v[2]}get m01(){return this._v[3]}get m11(){return this._v[4]}get m21(){return this._v[5]}get m02(){return this._v[6]}get m12(){return this._v[7]}get m22(){return this._v[8]}get className(){return"Matrix33"}static get compositionType(){return o.d.Mat3}static zero(){return l.fromCopy9RowMajor(0,0,0,0,0,0,0,0,0)}static identity(){return new s.c}static dummy(){return new this(new Float32Array(0))}static transpose(e){return e.isIdentityMatrixClass?e:l.fromCopy9RowMajor(e._v[0],e._v[1],e._v[2],e._v[3],e._v[4],e._v[5],e._v[6],e._v[7],e._v[8])}static invert(e){if(e.isIdentityMatrixClass)return e;const t=e.determinant();0===t&&console.error("the determinant is 0!");const n=(e._v[4]*e._v[8]-e._v[7]*e._v[5])/t,i=(e._v[6]*e._v[5]-e._v[3]*e._v[8])/t,o=(e._v[3]*e._v[7]-e._v[6]*e._v[4])/t,a=(e._v[7]*e._v[2]-e._v[1]*e._v[8])/t,r=(e._v[0]*e._v[8]-e._v[6]*e._v[2])/t,s=(e._v[6]*e._v[1]-e._v[0]*e._v[7])/t,c=(e._v[1]*e._v[5]-e._v[4]*e._v[2])/t,_=(e._v[3]*e._v[2]-e._v[0]*e._v[5])/t,h=(e._v[0]*e._v[4]-e._v[3]*e._v[1])/t;return l.fromCopy9RowMajor(n,i,o,a,r,s,c,_,h)}static invertTo(e,t){if(e.isIdentityMatrixClass)return t.copyComponents(e);const n=e.determinant();0===n&&console.error("the determinant is 0!");const i=(e._v[4]*e._v[8]-e._v[7]*e._v[5])/n,o=(e._v[6]*e._v[5]-e._v[3]*e._v[8])/n,a=(e._v[3]*e._v[7]-e._v[6]*e._v[4])/n,r=(e._v[7]*e._v[2]-e._v[1]*e._v[8])/n,s=(e._v[0]*e._v[8]-e._v[6]*e._v[2])/n,l=(e._v[6]*e._v[1]-e._v[0]*e._v[7])/n,c=(e._v[1]*e._v[5]-e._v[4]*e._v[2])/n,_=(e._v[3]*e._v[2]-e._v[0]*e._v[5])/n,h=(e._v[0]*e._v[4]-e._v[3]*e._v[1])/n;return t.setComponents(i,o,a,r,s,l,c,_,h)}static rotateX(e){const t=Math.cos(e),n=Math.sin(e);return l.fromCopy9RowMajor(1,0,0,0,t,-n,0,n,t)}static rotateY(e){const t=Math.cos(e),n=Math.sin(e);return l.fromCopy9RowMajor(t,0,n,0,1,0,-n,0,t)}static rotateZ(e){const t=Math.cos(e),n=Math.sin(e);return l.fromCopy9RowMajor(t,-n,0,n,t,0,0,0,1)}static rotateXYZ(e,t,n){const i=Math.cos(e),o=Math.sin(e),a=Math.cos(t),r=Math.sin(t),s=Math.cos(n),c=Math.sin(n),_=-o,h=-c,u=r*o,d=r*i,m=s*a,f=s*u+h*i,p=s*d+h*_,v=c*a,A=c*u+s*i,y=c*d+s*_,x=-r,g=a*o,I=a*i;return l.fromCopy9RowMajor(m,f,p,v,A,y,x,g,I)}static rotate(e){return this.rotateXYZ(e._v[0],e._v[1],e._v[2])}static scale(e){return l.fromCopy9RowMajor(e._v[0],0,0,0,e._v[1],0,0,0,e._v[2])}static multiply(e,t){if(e.isIdentityMatrixClass)return t;if(t.isIdentityMatrixClass)return e;const n=e._v[0]*t._v[0]+e._v[3]*t._v[1]+e._v[6]*t._v[2],i=e._v[1]*t._v[0]+e._v[4]*t._v[1]+e._v[7]*t._v[2],o=e._v[2]*t._v[0]+e._v[5]*t._v[1]+e._v[8]*t._v[2],a=e._v[0]*t._v[3]+e._v[3]*t._v[4]+e._v[6]*t._v[5],r=e._v[1]*t._v[3]+e._v[4]*t._v[4]+e._v[7]*t._v[5],s=e._v[2]*t._v[3]+e._v[5]*t._v[4]+e._v[8]*t._v[5],c=e._v[0]*t._v[6]+e._v[3]*t._v[7]+e._v[6]*t._v[8],_=e._v[1]*t._v[6]+e._v[4]*t._v[7]+e._v[7]*t._v[8],h=e._v[2]*t._v[6]+e._v[5]*t._v[7]+e._v[8]*t._v[8];return l.fromCopy9RowMajor(n,a,c,i,r,_,o,s,h)}static multiplyTo(e,t,n){if(e.isIdentityMatrixClass)return n.copyComponents(t);if(t.isIdentityMatrixClass)return n.copyComponents(e);const i=e._v[0]*t._v[0]+e._v[3]*t._v[1]+e._v[6]*t._v[2],o=e._v[1]*t._v[0]+e._v[4]*t._v[1]+e._v[7]*t._v[2],a=e._v[2]*t._v[0]+e._v[5]*t._v[1]+e._v[8]*t._v[2],r=e._v[0]*t._v[3]+e._v[3]*t._v[4]+e._v[6]*t._v[5],s=e._v[1]*t._v[3]+e._v[4]*t._v[4]+e._v[7]*t._v[5],l=e._v[2]*t._v[3]+e._v[5]*t._v[4]+e._v[8]*t._v[5],c=e._v[0]*t._v[6]+e._v[3]*t._v[7]+e._v[6]*t._v[8],_=e._v[1]*t._v[6]+e._v[4]*t._v[7]+e._v[7]*t._v[8],h=e._v[2]*t._v[6]+e._v[5]*t._v[7]+e._v[8]*t._v[8];return n.setComponents(i,r,c,o,s,_,a,l,h)}toString(){return this._v[0]+" "+this._v[3]+" "+this._v[6]+"\n"+this._v[1]+" "+this._v[4]+" "+this._v[7]+"\n"+this._v[2]+" "+this._v[5]+" "+this._v[8]+"\n"}toStringApproximately(){return a.k.financial(this._v[0])+" "+a.k.financial(this._v[3])+" "+a.k.financial(this._v[6])+"\n"+a.k.financial(this._v[1])+" "+a.k.financial(this._v[4])+" "+a.k.financial(this._v[7])+" \n"+a.k.financial(this._v[2])+" "+a.k.financial(this._v[5])+" "+a.k.financial(this._v[8])+"\n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3],this._v[4],this._v[5],this._v[6],this._v[7],this._v[8]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){n.d(t,{J:()=>_});var i=n(2471),o=n(7192),a=n(810),r=n(3032),s=n(2086),l=n(8775),c=n(3991);Float32Array;class _ extends l.X{constructor(e){super(),this._v=e}get m00(){return this._v[0]}get m10(){return this._v[1]}get m20(){return this._v[2]}get m30(){return this._v[3]}get m01(){return this._v[4]}get m11(){return this._v[5]}get m21(){return this._v[6]}get m31(){return this._v[7]}get m02(){return this._v[8]}get m12(){return this._v[9]}get m22(){return this._v[10]}get m32(){return this._v[11]}get m03(){return this._v[12]}get m13(){return this._v[13]}get m23(){return this._v[14]}get m33(){return this._v[15]}get translateX(){return this._v[12]}get translateY(){return this._v[13]}get translateZ(){return this._v[14]}static get compositionType(){return a.d.Mat4}static zero(){return _.fromCopy16RowMajor(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}static identity(){return new s.a}static dummy(){return new this(new Float32Array(0))}static transpose(e){return e.isIdentityMatrixClass?e:_.fromCopyFloat32ArrayRowMajor(e._v)}static invert(e){if(e.isIdentityMatrixClass)return e;const t=e._v[0]*e._v[5]-e._v[4]*e._v[1],n=e._v[0]*e._v[9]-e._v[8]*e._v[1],i=e._v[0]*e._v[13]-e._v[12]*e._v[1],o=e._v[4]*e._v[9]-e._v[8]*e._v[5],a=e._v[4]*e._v[13]-e._v[12]*e._v[5],r=e._v[8]*e._v[13]-e._v[12]*e._v[9],s=e._v[2]*e._v[7]-e._v[6]*e._v[3],l=e._v[2]*e._v[11]-e._v[10]*e._v[3],c=e._v[2]*e._v[15]-e._v[14]*e._v[3],h=e._v[6]*e._v[11]-e._v[10]*e._v[7],u=e._v[6]*e._v[15]-e._v[14]*e._v[7],d=e._v[10]*e._v[15]-e._v[14]*e._v[11],m=t*d-n*u+i*h+o*c-a*l+r*s;0===m&&console.error("the determinant is 0!");const f=(e._v[5]*d-e._v[9]*u+e._v[13]*h)/m,p=(e._v[8]*u-e._v[4]*d-e._v[12]*h)/m,v=(e._v[7]*r-e._v[11]*a+e._v[15]*o)/m,A=(e._v[10]*a-e._v[6]*r-e._v[14]*o)/m,y=(e._v[9]*c-e._v[1]*d-e._v[13]*l)/m,x=(e._v[0]*d-e._v[8]*c+e._v[12]*l)/m,g=(e._v[11]*i-e._v[3]*r-e._v[15]*n)/m,I=(e._v[2]*r-e._v[10]*i+e._v[14]*n)/m,b=(e._v[1]*u-e._v[5]*c+e._v[13]*s)/m,E=(e._v[4]*c-e._v[0]*u-e._v[12]*s)/m,T=(e._v[3]*a-e._v[7]*i+e._v[15]*t)/m,S=(e._v[6]*i-e._v[2]*a-e._v[14]*t)/m,C=(e._v[5]*l-e._v[1]*h-e._v[9]*s)/m,w=(e._v[0]*h-e._v[4]*l+e._v[8]*s)/m,R=(e._v[7]*n-e._v[3]*o-e._v[11]*t)/m,P=(e._v[2]*o-e._v[6]*n+e._v[10]*t)/m;return _.fromCopy16RowMajor(f,p,v,A,y,x,g,I,b,E,T,S,C,w,R,P)}static invertTo(e,t){if(e.isIdentityMatrixClass)return t.copyComponents(e);const n=e._v[0]*e._v[5]-e._v[4]*e._v[1],i=e._v[0]*e._v[9]-e._v[8]*e._v[1],o=e._v[0]*e._v[13]-e._v[12]*e._v[1],a=e._v[4]*e._v[9]-e._v[8]*e._v[5],r=e._v[4]*e._v[13]-e._v[12]*e._v[5],s=e._v[8]*e._v[13]-e._v[12]*e._v[9],l=e._v[2]*e._v[7]-e._v[6]*e._v[3],c=e._v[2]*e._v[11]-e._v[10]*e._v[3],_=e._v[2]*e._v[15]-e._v[14]*e._v[3],h=e._v[6]*e._v[11]-e._v[10]*e._v[7],u=e._v[6]*e._v[15]-e._v[14]*e._v[7],d=e._v[10]*e._v[15]-e._v[14]*e._v[11],m=n*d-i*u+o*h+a*_-r*c+s*l;0===m&&console.error("the determinant is 0!");const f=(e._v[5]*d-e._v[9]*u+e._v[13]*h)/m,p=(e._v[8]*u-e._v[4]*d-e._v[12]*h)/m,v=(e._v[7]*s-e._v[11]*r+e._v[15]*a)/m,A=(e._v[10]*r-e._v[6]*s-e._v[14]*a)/m,y=(e._v[9]*_-e._v[1]*d-e._v[13]*c)/m,x=(e._v[0]*d-e._v[8]*_+e._v[12]*c)/m,g=(e._v[11]*o-e._v[3]*s-e._v[15]*i)/m,I=(e._v[2]*s-e._v[10]*o+e._v[14]*i)/m,b=(e._v[1]*u-e._v[5]*_+e._v[13]*l)/m,E=(e._v[4]*_-e._v[0]*u-e._v[12]*l)/m,T=(e._v[3]*r-e._v[7]*o+e._v[15]*n)/m,S=(e._v[6]*o-e._v[2]*r-e._v[14]*n)/m,C=(e._v[5]*c-e._v[1]*h-e._v[9]*l)/m,w=(e._v[0]*h-e._v[4]*c+e._v[8]*l)/m,R=(e._v[7]*i-e._v[3]*a-e._v[11]*n)/m,P=(e._v[2]*a-e._v[6]*i+e._v[10]*n)/m;return t.setComponents(f,p,v,A,y,x,g,I,b,E,T,S,C,w,R,P)}static translate(e){return _.fromCopy16RowMajor(1,0,0,e._v[0],0,1,0,e._v[1],0,0,1,e._v[2],0,0,0,1)}static rotateX(e){const t=Math.cos(e),n=Math.sin(e);return _.fromCopy16RowMajor(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1)}static rotateY(e){const t=Math.cos(e),n=Math.sin(e);return _.fromCopy16RowMajor(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1)}static rotateZ(e){const t=Math.cos(e),n=Math.sin(e);return _.fromCopy16RowMajor(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1)}static rotateXYZ(e,t,n){const i=Math.cos(e),o=Math.sin(e),a=Math.cos(t),r=Math.sin(t),s=Math.cos(n),l=Math.sin(n),c=-o,h=-l,u=r*o,d=r*i,m=s*a,f=s*u+h*i,p=s*d+h*c,v=l*a,A=l*u+s*i,y=l*d+s*c,x=-r,g=a*o,I=a*i;return _.fromCopy16RowMajor(m,f,p,0,v,A,y,0,x,g,I,0,0,0,0,1)}static rotate(e){return this.rotateXYZ(e._v[0],e._v[1],e._v[2])}static scale(e){return _.fromCopy16RowMajor(e._v[0],0,0,0,0,e._v[1],0,0,0,0,e._v[2],0,0,0,0,1)}static multiply(e,t){if(e.isIdentityMatrixClass)return t;if(t.isIdentityMatrixClass)return e;const n=e._v,i=t._v,o=n[0]*i[0]+n[4]*i[1]+n[8]*i[2]+n[12]*i[3],a=n[1]*i[0]+n[5]*i[1]+n[9]*i[2]+n[13]*i[3],r=n[2]*i[0]+n[6]*i[1]+n[10]*i[2]+n[14]*i[3],s=n[3]*i[0]+n[7]*i[1]+n[11]*i[2]+n[15]*i[3],l=n[0]*i[4]+n[4]*i[5]+n[8]*i[6]+n[12]*i[7],c=n[1]*i[4]+n[5]*i[5]+n[9]*i[6]+n[13]*i[7],h=n[2]*i[4]+n[6]*i[5]+n[10]*i[6]+n[14]*i[7],u=n[3]*i[4]+n[7]*i[5]+n[11]*i[6]+n[15]*i[7],d=n[0]*i[8]+n[4]*i[9]+n[8]*i[10]+n[12]*i[11],m=n[1]*i[8]+n[5]*i[9]+n[9]*i[10]+n[13]*i[11],f=n[2]*i[8]+n[6]*i[9]+n[10]*i[10]+n[14]*i[11],p=n[3]*i[8]+n[7]*i[9]+n[11]*i[10]+n[15]*i[11],v=n[0]*i[12]+n[4]*i[13]+n[8]*i[14]+n[12]*i[15],A=n[1]*i[12]+n[5]*i[13]+n[9]*i[14]+n[13]*i[15],y=n[2]*i[12]+n[6]*i[13]+n[10]*i[14]+n[14]*i[15],x=n[3]*i[12]+n[7]*i[13]+n[11]*i[14]+n[15]*i[15];return _.fromCopy16RowMajor(o,l,d,v,a,c,m,A,r,h,f,y,s,u,p,x)}static multiplyTo(e,t,n){if(e.isIdentityMatrixClass)return n.copyComponents(t);if(t.isIdentityMatrixClass)return n.copyComponents(e);const i=e._v,o=t._v,a=i[0]*o[0]+i[4]*o[1]+i[8]*o[2]+i[12]*o[3],r=i[1]*o[0]+i[5]*o[1]+i[9]*o[2]+i[13]*o[3],s=i[2]*o[0]+i[6]*o[1]+i[10]*o[2]+i[14]*o[3],l=i[3]*o[0]+i[7]*o[1]+i[11]*o[2]+i[15]*o[3],c=i[0]*o[4]+i[4]*o[5]+i[8]*o[6]+i[12]*o[7],_=i[1]*o[4]+i[5]*o[5]+i[9]*o[6]+i[13]*o[7],h=i[2]*o[4]+i[6]*o[5]+i[10]*o[6]+i[14]*o[7],u=i[3]*o[4]+i[7]*o[5]+i[11]*o[6]+i[15]*o[7],d=i[0]*o[8]+i[4]*o[9]+i[8]*o[10]+i[12]*o[11],m=i[1]*o[8]+i[5]*o[9]+i[9]*o[10]+i[13]*o[11],f=i[2]*o[8]+i[6]*o[9]+i[10]*o[10]+i[14]*o[11],p=i[3]*o[8]+i[7]*o[9]+i[11]*o[10]+i[15]*o[11],v=i[0]*o[12]+i[4]*o[13]+i[8]*o[14]+i[12]*o[15],A=i[1]*o[12]+i[5]*o[13]+i[9]*o[14]+i[13]*o[15],y=i[2]*o[12]+i[6]*o[13]+i[10]*o[14]+i[14]*o[15],x=i[3]*o[12]+i[7]*o[13]+i[11]*o[14]+i[15]*o[15];return n.setComponents(a,c,d,v,r,_,m,A,s,h,f,y,l,u,p,x)}static multiplyTypedArrayTo(e,t,n,i){return t[c.QU](i,e._v,0,n._v),n}static fromQuaternionTo(e,t){const n=e._v[0]*e._v[0],i=e._v[1]*e._v[1],o=e._v[2]*e._v[2],a=e._v[1]*e._v[2],r=e._v[0]*e._v[2],s=e._v[0]*e._v[1],l=e._v[3]*e._v[0],c=e._v[3]*e._v[1],_=e._v[3]*e._v[2],h=1-2*(i+o),u=2*(s-_),d=2*(r+c),m=2*(s+_),f=1-2*(n+o),p=2*(a-l),v=2*(r-c),A=2*(a+l),y=1-2*(n+i);return t.setComponents(h,u,d,0,m,f,p,0,v,A,y,0,0,0,0,1)}toString(){return this._v[0]+" "+this._v[4]+" "+this._v[8]+" "+this._v[12]+" \n"+this._v[1]+" "+this._v[5]+" "+this._v[9]+" "+this._v[13]+" \n"+this._v[2]+" "+this._v[6]+" "+this._v[10]+" "+this._v[14]+" \n"+this._v[3]+" "+this._v[7]+" "+this._v[11]+" "+this._v[15]+" \n"}toStringApproximately(){return r.k.financial(this._v[0])+" "+r.k.financial(this._v[4])+" "+r.k.financial(this._v[8])+" "+r.k.financial(this._v[12])+" \n"+r.k.financial(this._v[1])+" "+r.k.financial(this._v[5])+" "+r.k.financial(this._v[9])+" "+r.k.financial(this._v[13])+" \n"+r.k.financial(this._v[2])+" "+r.k.financial(this._v[6])+" "+r.k.financial(this._v[10])+" "+r.k.financial(this._v[14])+" \n"+r.k.financial(this._v[3])+" "+r.k.financial(this._v[7])+" "+r.k.financial(this._v[11])+" "+r.k.financial(this._v[15])+" \n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3],this._v[4],this._v[5],this._v[6],this._v[7],this._v[8],this._v[9],this._v[10],this._v[11],this._v[12],this._v[13],this._v[14],this._v[15]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){const n=e._v;return Math.abs(n[0]-this._v[0]){n.d(t,{f:()=>o});var i=n(18);class o extends i.a{constructor(e){super(e)}set m00(e){this._v[0]=e}get m00(){return this._v[0]}set m10(e){this._v[1]=e}get m10(){return this._v[1]}set m01(e){this._v[2]=e}get m01(){return this._v[2]}set m11(e){this._v[3]=e}get m11(){return this._v[3]}get className(){return"MutableMatrix22"}static zero(){return super.zero()}static identity(){return super.identity()}static dummy(){return super.dummy()}static transpose(e){return super.transpose(e)}static invert(e){return super.invert(e)}static rotate(e){return super.rotate(e)}static scale(e){return super.scale(e)}static multiply(e,t){return super.multiply(e,t)}clone(){return super.clone()}raw(){return this._v}setAt(e,t,n){return this._v[e+2*t]=n,this}setComponents(e,t,n,i){return this._v[0]=e,this._v[2]=t,this._v[1]=n,this._v[3]=i,this}copyComponents(e){return this._v[0]=e.m00,this._v[2]=e.m01,this._v[1]=e.m10,this._v[3]=e.m11,this}zero(){return this.setComponents(0,0,0,0)}identity(){return this.setComponents(1,0,0,1)}_swap(e,t){this._v[t]=[this._v[e],this._v[e]=this._v[t]][0]}transpose(){return this._swap(1,2),this}invert(){const e=this.determinant();0===e&&console.error("the determinant is 0!");const t=this._v[3]/e,n=this._v[2]/e*-1,i=this._v[1]/e*-1,o=this._v[0]/e;return this.setComponents(t,n,i,o)}rotate(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,-n,n,t)}scale(e){return this.setComponents(e._v[0],0,0,e._v[1])}multiplyScale(e){return this._v[0]*=e._v[0],this._v[2]*=e._v[0],this._v[1]*=e._v[1],this._v[3]*=e._v[1],this}multiply(e){const t=this._v[0]*e._v[0]+this._v[2]*e._v[1],n=this._v[0]*e._v[2]+this._v[2]*e._v[3],i=this._v[1]*e._v[0]+this._v[3]*e._v[1],o=this._v[1]*e._v[2]+this._v[3]*e._v[3];return this.setComponents(t,n,i,o)}multiplyByLeft(e){const t=e._v[0]*this._v[0]+e._v[2]*this._v[1],n=e._v[0]*this._v[2]+e._v[2]*this._v[3],i=e._v[1]*this._v[0]+e._v[3]*this._v[1],o=e._v[1]*this._v[2]+e._v[3]*this._v[3];return this.setComponents(t,n,i,o)}static fromCopy4RowMajor(e,t,n,i){const a=new Float32Array(4);return a[0]=e,a[2]=t,a[1]=n,a[3]=i,new o(a)}static fromCopy4ColumnMajor(e,t,n,i){const a=new Float32Array(4);return a[0]=e,a[2]=n,a[1]=t,a[3]=i,new o(a)}static fromFloat32ArrayColumnMajor(e){return new o(e)}static fromCopyFloat32ArrayColumnMajor(e){const t=new Float32Array(4);return t.set(e),new o(t)}static fromCopyFloat32ArrayRowMajor(e){const t=new Float32Array(4);return t[0]=e[0],t[3]=e[1],t[1]=e[2],t[4]=e[3],new o(t)}static fromCopyMatrix22(e){const t=new Float32Array(4);return t[0]=e._v[0],t[3]=e._v[1],t[1]=e._v[2],t[4]=e._v[3],new o(t)}static fromCopyArray9ColumnMajor(e){const t=new Float32Array(4);return t.set(e),new o(t)}static fromCopyArrayColumnMajor(e){const t=new Float32Array(4);return t.set(e),new o(t)}static fromCopyArray9RowMajor(e){const t=new Float32Array(4);return t[0]=e[0],t[3]=e[1],t[1]=e[2],t[4]=e[3],new o(t)}static fromCopyArrayRowMajor(e){const t=new Float32Array(4);return t[0]=e[0],t[3]=e[1],t[1]=e[2],t[4]=e[3],new o(t)}}},2566:(e,t,n)=>{n.d(t,{x:()=>o});var i=n(1937);class o extends i.h{constructor(e){super(e)}set m00(e){this._v[0]=e}get m00(){return this._v[0]}set m10(e){this._v[1]=e}get m10(){return this._v[1]}set m20(e){this._v[2]=e}get m20(){return this._v[2]}set m01(e){this._v[3]=e}get m01(){return this._v[3]}set m11(e){this._v[4]=e}get m11(){return this._v[4]}set m21(e){this._v[5]=e}get m21(){return this._v[5]}set m02(e){this._v[6]=e}get m02(){return this._v[6]}set m12(e){this._v[7]=e}get m12(){return this._v[7]}set m22(e){this._v[8]=e}get m22(){return this._v[8]}get className(){return"MutableMatrix33"}static zero(){return super.zero()}static identity(){return o.fromCopy9RowMajor(1,0,0,0,1,0,0,0,1)}static dummy(){return super.dummy()}static transpose(e){return super.transpose(e)}static invert(e){return super.invert(e)}static rotateX(e){return super.rotateX(e)}static rotateY(e){return super.rotateY(e)}static rotateZ(e){return super.rotateZ(e)}static rotateXYZ(e,t,n){return super.rotateXYZ(e,t,n)}static rotate(e){return super.rotateXYZ(e._v[0],e._v[1],e._v[2])}static scale(e){return super.scale(e)}static multiply(e,t){return super.multiply(e,t)}clone(){return super.clone()}raw(){return this._v}setAt(e,t,n){return this._v[e+3*t]=n,this}setComponents(e,t,n,i,o,a,r,s,l){return this._v[0]=e,this._v[3]=t,this._v[6]=n,this._v[1]=i,this._v[4]=o,this._v[7]=a,this._v[2]=r,this._v[5]=s,this._v[8]=l,this}copyComponents(e){return this._v[0]=e.m00,this._v[3]=e.m01,this._v[6]=e.m02,this._v[1]=e.m10,this._v[4]=e.m11,this._v[7]=e.m12,this._v[2]=e.m20,this._v[5]=e.m21,this._v[8]=e.m22,this}zero(){return this.setComponents(0,0,0,0,0,0,0,0,0)}identity(){return this.setComponents(1,0,0,0,1,0,0,0,1)}_swap(e,t){this._v[t]=[this._v[e],this._v[e]=this._v[t]][0]}transpose(){return this._swap(1,3),this._swap(2,6),this._swap(5,8),this}invert(){const e=this.determinant();0===e&&console.error("the determinant is 0!");const t=(this._v[4]*this._v[8]-this._v[7]*this._v[5])/e,n=(this._v[6]*this._v[5]-this._v[3]*this._v[8])/e,i=(this._v[3]*this._v[7]-this._v[6]*this._v[4])/e,o=(this._v[7]*this._v[2]-this._v[1]*this._v[8])/e,a=(this._v[0]*this._v[8]-this._v[6]*this._v[2])/e,r=(this._v[6]*this._v[1]-this._v[0]*this._v[7])/e,s=(this._v[1]*this._v[5]-this._v[4]*this._v[2])/e,l=(this._v[3]*this._v[2]-this._v[0]*this._v[5])/e,c=(this._v[0]*this._v[4]-this._v[3]*this._v[1])/e;return this.setComponents(t,n,i,o,a,r,s,l,c)}rotateX(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(1,0,0,0,t,-n,0,n,t)}rotateY(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,0,n,0,1,0,-n,0,t)}rotateZ(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,-n,0,n,t,0,0,0,1)}rotateXYZ(e,t,n){const i=Math.cos(e),o=Math.sin(e),a=Math.cos(t),r=Math.sin(t),s=Math.cos(n),l=Math.sin(n),c=-o,_=-l,h=r*o,u=r*i,d=s*a,m=s*h+_*i,f=s*u+_*c,p=l*a,v=l*h+s*i,A=l*u+s*c,y=-r,x=a*o,g=a*i;return this.setComponents(d,m,f,p,v,A,y,x,g)}rotate(e){return this.rotateXYZ(e._v[0],e._v[1],e._v[2])}scale(e){return this.setComponents(e._v[0],0,0,0,e._v[1],0,0,0,e._v[2])}multiplyScale(e){return this._v[0]*=e._v[0],this._v[3]*=e._v[0],this._v[6]*=e._v[0],this._v[1]*=e._v[1],this._v[4]*=e._v[1],this._v[7]*=e._v[1],this._v[2]*=e._v[2],this._v[5]*=e._v[2],this._v[8]*=e._v[2],this}multiply(e){if(e.isIdentityMatrixClass)return this;const t=this._v[0]*e._v[0]+this._v[3]*e._v[1]+this._v[6]*e._v[2],n=this._v[0]*e._v[3]+this._v[3]*e._v[4]+this._v[6]*e._v[5],i=this._v[0]*e._v[6]+this._v[3]*e._v[7]+this._v[6]*e._v[8],o=this._v[1]*e._v[0]+this._v[4]*e._v[1]+this._v[7]*e._v[2],a=this._v[1]*e._v[3]+this._v[4]*e._v[4]+this._v[7]*e._v[5],r=this._v[1]*e._v[6]+this._v[4]*e._v[7]+this._v[7]*e._v[8],s=this._v[2]*e._v[0]+this._v[5]*e._v[1]+this._v[8]*e._v[2],l=this._v[2]*e._v[3]+this._v[5]*e._v[4]+this._v[8]*e._v[5],c=this._v[2]*e._v[6]+this._v[5]*e._v[7]+this._v[8]*e._v[8];return this.setComponents(t,n,i,o,a,r,s,l,c)}multiplyByLeft(e){if(e.isIdentityMatrixClass)return this;const t=e._v[0]*this._v[0]+e._v[3]*this._v[1]+e._v[6]*this._v[2],n=e._v[0]*this._v[3]+e._v[3]*this._v[4]+e._v[6]*this._v[5],i=e._v[0]*this._v[6]+e._v[3]*this._v[7]+e._v[6]*this._v[8],o=e._v[1]*this._v[0]+e._v[4]*this._v[1]+e._v[7]*this._v[2],a=e._v[1]*this._v[3]+e._v[4]*this._v[4]+e._v[7]*this._v[5],r=e._v[1]*this._v[6]+e._v[4]*this._v[7]+e._v[7]*this._v[8],s=e._v[2]*this._v[0]+e._v[5]*this._v[1]+e._v[8]*this._v[2],l=e._v[2]*this._v[3]+e._v[5]*this._v[4]+e._v[8]*this._v[5],c=e._v[2]*this._v[6]+e._v[5]*this._v[7]+e._v[8]*this._v[8];return this.setComponents(t,n,i,o,a,r,s,l,c)}static fromCopy9RowMajor(e,t,n,i,a,r,s,l,c){const _=new Float32Array(9);return _[0]=e,_[3]=t,_[6]=n,_[1]=i,_[4]=a,_[7]=r,_[2]=s,_[5]=l,_[8]=c,new o(_)}static fromCopy9ColumnMajor(e,t,n,i,a,r,s,l,c){const _=new Float32Array(9);return _[0]=e,_[3]=i,_[6]=s,_[1]=t,_[4]=a,_[7]=l,_[2]=n,_[5]=r,_[8]=c,new o(_)}static fromCopyMatrix44(e){const t=new Float32Array(9);return t.set(e._v),new o(t)}static fromFloat32ArrayColumnMajor(e){return new o(e)}static fromCopyFloat32ArrayColumnMajor(e){const t=new Float32Array(9);return t.set(e),new o(t)}static fromCopyFloat32ArrayRowMajor(e){const t=new Float32Array(9);return t[0]=e[0],t[3]=e[1],t[6]=e[2],t[1]=e[3],t[4]=e[4],t[7]=e[5],t[2]=e[6],t[5]=e[7],t[8]=e[8],new o(t)}static fromCopyMatrix33(e){const t=new Float32Array(9);return t[0]=e._v[0],t[3]=e._v[3],t[6]=e._v[6],t[1]=e._v[1],t[4]=e._v[4],t[7]=e._v[7],t[2]=e._v[2],t[5]=e._v[5],t[8]=e._v[8],new o(t)}static fromCopyArray9ColumnMajor(e){const t=new Float32Array(9);return t.set(e),new o(t)}static fromCopyArrayColumnMajor(e){const t=new Float32Array(9);return t.set(e),new o(t)}static fromCopyArray9RowMajor(e){const t=new Float32Array(9);return t[0]=e[0],t[3]=e[1],t[6]=e[2],t[1]=e[3],t[4]=e[4],t[7]=e[5],t[2]=e[6],t[5]=e[7],t[8]=e[8],new o(t)}static fromCopyArrayRowMajor(e){const t=new Float32Array(9);return t[0]=e[0],t[3]=e[1],t[6]=e[2],t[1]=e[3],t[4]=e[4],t[7]=e[5],t[2]=e[6],t[5]=e[7],t[8]=e[8],new o(t)}static fromCopyQuaternion(e){const t=e._v[0]*e._v[0],n=e._v[1]*e._v[1],i=e._v[2]*e._v[2],a=e._v[1]*e._v[2],r=e._v[0]*e._v[2],s=e._v[0]*e._v[1],l=e._v[3]*e._v[0],c=e._v[3]*e._v[1],_=e._v[3]*e._v[2],h=new Float32Array(9);return h[0]=1-2*(n+i),h[3]=2*(s-_),h[6]=2*(r+c),h[1]=2*(s+_),h[4]=1-2*(t+i),h[7]=2*(a-l),h[2]=2*(r-c),h[5]=2*(a+l),h[8]=1-2*(t+n),new o(h)}}},3496:(e,t,n)=>{n.d(t,{e:()=>o});var i=n(5467);Float32Array;class o extends i.J{constructor(e){super(e)}set m00(e){this._v[0]=e}get m00(){return this._v[0]}set m10(e){this._v[1]=e}get m10(){return this._v[1]}set m20(e){this._v[2]=e}get m20(){return this._v[2]}set m30(e){this._v[3]=e}get m30(){return this._v[3]}set m01(e){this._v[4]=e}get m01(){return this._v[4]}set m11(e){this._v[5]=e}get m11(){return this._v[5]}set m21(e){this._v[6]=e}get m21(){return this._v[6]}set m31(e){this._v[7]=e}get m31(){return this._v[7]}set m02(e){this._v[8]=e}get m02(){return this._v[8]}set m12(e){this._v[9]=e}get m12(){return this._v[9]}set m22(e){this._v[10]=e}get m22(){return this._v[10]}set m32(e){this._v[11]=e}get m32(){return this._v[11]}set m03(e){this._v[12]=e}get m03(){return this._v[12]}set m13(e){this._v[13]=e}get m13(){return this._v[13]}set m23(e){this._v[14]=e}get m23(){return this._v[14]}set m33(e){this._v[15]=e}get m33(){return this._v[15]}get translateX(){return this._v[12]}set translateX(e){this._v[12]=e}get translateY(){return this._v[13]}set translateY(e){this._v[13]=e}get translateZ(){return this._v[14]}set translateZ(e){this._v[14]=e}get className(){return"MutableMatrix44"}static zero(){return o.fromCopy16RowMajor(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}static identity(){return o.fromCopy16RowMajor(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}static dummy(){return super.dummy()}static transpose(e){return e.isIdentityMatrixClass?e:o.fromCopyFloat32ArrayRowMajor(e._v)}static invert(e){return super.invert(e)}static translate(e){return super.translate(e)}static rotateX(e){return super.rotateX(e)}static rotateY(e){return super.rotateY(e)}static rotateZ(e){return super.rotateZ(e)}static rotateXYZ(e,t,n){return super.rotateXYZ(e,t,n)}static rotate(e){return super.rotateXYZ(e._v[0],e._v[1],e._v[2])}static scale(e){return super.scale(e)}static multiply(e,t){return super.multiply(e,t)}clone(){return super.clone()}getRotate(){return super.getRotate()}getTranslate(){return super.getTranslate()}getScale(){return super.getScale()}raw(){return this._v}setAt(e,t,n){return this._v[e+4*t]=n,this}setComponents(e,t,n,i,o,a,r,s,l,c,_,h,u,d,m,f){return this._v[0]=e,this._v[4]=t,this._v[8]=n,this._v[12]=i,this._v[1]=o,this._v[5]=a,this._v[9]=r,this._v[13]=s,this._v[2]=l,this._v[6]=c,this._v[10]=_,this._v[14]=h,this._v[3]=u,this._v[7]=d,this._v[11]=m,this._v[15]=f,this}copyComponents(e){return this._v[0]=e._v[0],this._v[4]=e._v[4],this._v[8]=e._v[8],this._v[12]=e._v[12],this._v[1]=e._v[1],this._v[5]=e._v[5],this._v[9]=e._v[9],this._v[13]=e._v[13],this._v[2]=e._v[2],this._v[6]=e._v[6],this._v[10]=e._v[10],this._v[14]=e._v[14],this._v[3]=e._v[3],this._v[7]=e._v[7],this._v[11]=e._v[11],this._v[15]=e._v[15],this}zero(){return this.setComponents(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}identity(){return this.setComponents(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}_swap(e,t){this._v[t]=[this._v[e],this._v[e]=this._v[t]][0]}transpose(){return this._swap(1,4),this._swap(2,8),this._swap(3,12),this._swap(6,9),this._swap(7,13),this._swap(11,14),this}invert(){const e=this._v[0]*this._v[5]-this._v[4]*this._v[1],t=this._v[0]*this._v[9]-this._v[8]*this._v[1],n=this._v[0]*this._v[13]-this._v[12]*this._v[1],i=this._v[4]*this._v[9]-this._v[8]*this._v[5],o=this._v[4]*this._v[13]-this._v[12]*this._v[5],a=this._v[8]*this._v[13]-this._v[12]*this._v[9],r=this._v[2]*this._v[7]-this._v[6]*this._v[3],s=this._v[2]*this._v[11]-this._v[10]*this._v[3],l=this._v[2]*this._v[15]-this._v[14]*this._v[3],c=this._v[6]*this._v[11]-this._v[10]*this._v[7],_=this._v[6]*this._v[15]-this._v[14]*this._v[7],h=this._v[10]*this._v[15]-this._v[14]*this._v[11],u=e*h-t*_+n*c+i*l-o*s+a*r;0===u&&console.error("the determinant is 0!");const d=(this._v[5]*h-this._v[9]*_+this._v[13]*c)/u,m=(this._v[8]*_-this._v[4]*h-this._v[12]*c)/u,f=(this._v[7]*a-this._v[11]*o+this._v[15]*i)/u,p=(this._v[10]*o-this._v[6]*a-this._v[14]*i)/u,v=(this._v[9]*l-this._v[1]*h-this._v[13]*s)/u,A=(this._v[0]*h-this._v[8]*l+this._v[12]*s)/u,y=(this._v[11]*n-this._v[3]*a-this._v[15]*t)/u,x=(this._v[2]*a-this._v[10]*n+this._v[14]*t)/u,g=(this._v[1]*_-this._v[5]*l+this._v[13]*r)/u,I=(this._v[4]*l-this._v[0]*_-this._v[12]*r)/u,b=(this._v[3]*o-this._v[7]*n+this._v[15]*e)/u,E=(this._v[6]*n-this._v[2]*o-this._v[14]*e)/u,T=(this._v[5]*s-this._v[1]*c-this._v[9]*r)/u,S=(this._v[0]*c-this._v[4]*s+this._v[8]*r)/u,C=(this._v[7]*t-this._v[3]*i-this._v[11]*e)/u,w=(this._v[2]*i-this._v[6]*t+this._v[10]*e)/u;return this.setComponents(d,m,f,p,v,A,y,x,g,I,b,E,T,S,C,w)}translate(e){return this.setComponents(1,0,0,e._v[0],0,1,0,e._v[1],0,0,1,e._v[2],0,0,0,1)}putTranslate(e){return this._v[12]=e._v[0],this._v[13]=e._v[1],this._v[14]=e._v[2],this}addTranslate(e){return this._v[12]+=e._v[0],this._v[13]+=e._v[1],this._v[14]+=e._v[2],this}rotateX(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1)}rotateY(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1)}rotateZ(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1)}rotateXYZ(e,t,n){const i=Math.cos(e),o=Math.sin(e),a=Math.cos(t),r=Math.sin(t),s=Math.cos(n),l=Math.sin(n),c=-o,_=-l,h=r*o,u=r*i,d=s*a,m=s*h+_*i,f=s*u+_*c,p=l*a,v=l*h+s*i,A=l*u+s*c,y=-r,x=a*o,g=a*i;return this.setComponents(d,m,f,0,p,v,A,0,y,x,g,0,0,0,0,1)}rotate(e){return this.rotateXYZ(e._v[0],e._v[1],e._v[2])}scale(e){return this.setComponents(e._v[0],0,0,0,0,e._v[1],0,0,0,0,e._v[2],0,0,0,0,1)}multiplyScale(e){return this._v[0]*=e._v[0],this._v[4]*=e._v[0],this._v[8]*=e._v[0],this._v[12]*=e._v[0],this._v[1]*=e._v[1],this._v[5]*=e._v[1],this._v[9]*=e._v[1],this._v[13]*=e._v[1],this._v[2]*=e._v[2],this._v[6]*=e._v[2],this._v[10]*=e._v[2],this._v[14]*=e._v[2],this}multiply(e){if(e.isIdentityMatrixClass)return this;const t=this._v[0]*e._v[0]+this._v[4]*e._v[1]+this._v[8]*e._v[2]+this._v[12]*e._v[3],n=this._v[0]*e._v[4]+this._v[4]*e._v[5]+this._v[8]*e._v[6]+this._v[12]*e._v[7],i=this._v[0]*e._v[8]+this._v[4]*e._v[9]+this._v[8]*e._v[10]+this._v[12]*e._v[11],o=this._v[0]*e._v[12]+this._v[4]*e._v[13]+this._v[8]*e._v[14]+this._v[12]*e._v[15],a=this._v[1]*e._v[0]+this._v[5]*e._v[1]+this._v[9]*e._v[2]+this._v[13]*e._v[3],r=this._v[1]*e._v[4]+this._v[5]*e._v[5]+this._v[9]*e._v[6]+this._v[13]*e._v[7],s=this._v[1]*e._v[8]+this._v[5]*e._v[9]+this._v[9]*e._v[10]+this._v[13]*e._v[11],l=this._v[1]*e._v[12]+this._v[5]*e._v[13]+this._v[9]*e._v[14]+this._v[13]*e._v[15],c=this._v[2]*e._v[0]+this._v[6]*e._v[1]+this._v[10]*e._v[2]+this._v[14]*e._v[3],_=this._v[2]*e._v[4]+this._v[6]*e._v[5]+this._v[10]*e._v[6]+this._v[14]*e._v[7],h=this._v[2]*e._v[8]+this._v[6]*e._v[9]+this._v[10]*e._v[10]+this._v[14]*e._v[11],u=this._v[2]*e._v[12]+this._v[6]*e._v[13]+this._v[10]*e._v[14]+this._v[14]*e._v[15],d=this._v[3]*e._v[0]+this._v[7]*e._v[1]+this._v[11]*e._v[2]+this._v[15]*e._v[3],m=this._v[3]*e._v[4]+this._v[7]*e._v[5]+this._v[11]*e._v[6]+this._v[15]*e._v[7],f=this._v[3]*e._v[8]+this._v[7]*e._v[9]+this._v[11]*e._v[10]+this._v[15]*e._v[11],p=this._v[3]*e._v[12]+this._v[7]*e._v[13]+this._v[11]*e._v[14]+this._v[15]*e._v[15];return this.setComponents(t,n,i,o,a,r,s,l,c,_,h,u,d,m,f,p)}multiplyByLeft(e){if(e.isIdentityMatrixClass)return this;const t=e._v[0]*this._v[0]+e._v[4]*this._v[1]+e._v[8]*this._v[2]+e._v[12]*this._v[3],n=e._v[0]*this._v[4]+e._v[4]*this._v[5]+e._v[8]*this._v[6]+e._v[12]*this._v[7],i=e._v[0]*this._v[8]+e._v[4]*this._v[9]+e._v[8]*this._v[10]+e._v[12]*this._v[11],o=e._v[0]*this._v[12]+e._v[4]*this._v[13]+e._v[8]*this._v[14]+e._v[12]*this._v[15],a=e._v[1]*this._v[0]+e._v[5]*this._v[1]+e._v[9]*this._v[2]+e._v[13]*this._v[3],r=e._v[1]*this._v[4]+e._v[5]*this._v[5]+e._v[9]*this._v[6]+e._v[13]*this._v[7],s=e._v[1]*this._v[8]+e._v[5]*this._v[9]+e._v[9]*this._v[10]+e._v[13]*this._v[11],l=e._v[1]*this._v[12]+e._v[5]*this._v[13]+e._v[9]*this._v[14]+e._v[13]*this._v[15],c=e._v[2]*this._v[0]+e._v[6]*this._v[1]+e._v[10]*this._v[2]+e._v[14]*this._v[3],_=e._v[2]*this._v[4]+e._v[6]*this._v[5]+e._v[10]*this._v[6]+e._v[14]*this._v[7],h=e._v[2]*this._v[8]+e._v[6]*this._v[9]+e._v[10]*this._v[10]+e._v[14]*this._v[11],u=e._v[2]*this._v[12]+e._v[6]*this._v[13]+e._v[10]*this._v[14]+e._v[14]*this._v[15],d=e._v[3]*this._v[0]+e._v[7]*this._v[1]+e._v[11]*this._v[2]+e._v[15]*this._v[3],m=e._v[3]*this._v[4]+e._v[7]*this._v[5]+e._v[11]*this._v[6]+e._v[15]*this._v[7],f=e._v[3]*this._v[8]+e._v[7]*this._v[9]+e._v[11]*this._v[10]+e._v[15]*this._v[11],p=e._v[3]*this._v[12]+e._v[7]*this._v[13]+e._v[11]*this._v[14]+e._v[15]*this._v[15];return this.setComponents(t,n,i,o,a,r,s,l,c,_,h,u,d,m,f,p)}fromQuaternion(e){const t=e._v[0]*e._v[0],n=e._v[1]*e._v[1],i=e._v[2]*e._v[2],o=e._v[1]*e._v[2],a=e._v[0]*e._v[2],r=e._v[0]*e._v[1],s=e._v[3]*e._v[0],l=e._v[3]*e._v[1],c=e._v[3]*e._v[2],_=1-2*(n+i),h=2*(r-c),u=2*(a+l),d=2*(r+c),m=1-2*(t+i),f=2*(o-s),p=2*(a-l),v=2*(o+s),A=1-2*(t+n);return this.setComponents(_,h,u,0,d,m,f,0,p,v,A,0,0,0,0,1)}static fromCopy16RowMajor(e,t,n,i,a,r,s,l,c,_,h,u,d,m,f,p){const v=new Float32Array(16);return v[0]=e,v[4]=t,v[8]=n,v[12]=i,v[1]=a,v[5]=r,v[9]=s,v[13]=l,v[2]=c,v[6]=_,v[10]=h,v[14]=u,v[3]=d,v[7]=m,v[11]=f,v[15]=p,new o(v)}static fromCopy16ColumnMajor(e,t,n,i,a,r,s,l,c,_,h,u,d,m,f,p){const v=new Float32Array(16);return v[0]=e,v[4]=a,v[8]=c,v[12]=d,v[1]=t,v[5]=r,v[9]=_,v[13]=m,v[2]=n,v[6]=s,v[10]=h,v[14]=f,v[3]=i,v[7]=l,v[11]=u,v[15]=p,new o(v)}static fromCopyMatrix44(e){const t=new Float32Array(16);return t.set(e._v),new o(t)}static fromFloat32ArrayColumnMajor(e){return new o(e)}static fromCopyFloat32ArrayColumnMajor(e){const t=new Float32Array(16);return t.set(e),new o(t)}static fromCopyFloat32ArrayRowMajor(e){const t=new Float32Array(16);return t[0]=e[0],t[4]=e[1],t[8]=e[2],t[12]=e[3],t[1]=e[4],t[5]=e[5],t[9]=e[6],t[13]=e[7],t[2]=e[8],t[6]=e[9],t[10]=e[10],t[14]=e[11],t[3]=e[12],t[7]=e[13],t[11]=e[14],t[15]=e[15],new o(t)}static fromCopyMatrix33(e){const t=new Float32Array(16);return t[0]=e._v[0],t[4]=e._v[3],t[8]=e._v[6],t[12]=0,t[1]=e._v[1],t[5]=e._v[4],t[9]=e._v[7],t[13]=0,t[2]=e._v[2],t[6]=e._v[5],t[10]=e._v[8],t[14]=0,t[3]=0,t[7]=0,t[11]=0,t[15]=1,new o(t)}static fromCopyArray16ColumnMajor(e){const t=new Float32Array(16);return t.set(e),new o(t)}static fromCopyArrayColumnMajor(e){const t=new Float32Array(16);return t.set(e),new o(t)}static fromCopyArray16RowMajor(e){const t=new Float32Array(16);return t[0]=e[0],t[4]=e[1],t[8]=e[2],t[12]=e[3],t[1]=e[4],t[5]=e[5],t[9]=e[6],t[13]=e[7],t[2]=e[8],t[6]=e[9],t[10]=e[10],t[14]=e[11],t[3]=e[12],t[7]=e[13],t[11]=e[14],t[15]=e[15],new o(t)}static fromCopyArrayRowMajor(e){const t=new Float32Array(16);return t[0]=e[0],t[4]=e[1],t[8]=e[2],t[12]=e[3],t[1]=e[4],t[5]=e[5],t[9]=e[6],t[13]=e[7],t[2]=e[8],t[6]=e[9],t[10]=e[10],t[14]=e[11],t[3]=e[12],t[7]=e[13],t[11]=e[14],t[15]=e[15],new o(t)}static fromCopyQuaternion(e){const t=e._v[0]*e._v[0],n=e._v[1]*e._v[1],i=e._v[2]*e._v[2],a=e._v[1]*e._v[2],r=e._v[0]*e._v[2],s=e._v[0]*e._v[1],l=e._v[3]*e._v[0],c=e._v[3]*e._v[1],_=e._v[3]*e._v[2],h=new Float32Array(16);return h[0]=1-2*(n+i),h[4]=2*(s-_),h[8]=2*(r+c),h[12]=0,h[1]=2*(s+_),h[5]=1-2*(t+i),h[9]=2*(a-l),h[13]=0,h[2]=2*(r-c),h[6]=2*(a+l),h[10]=1-2*(t+n),h[14]=0,h[3]=0,h[7]=0,h[11]=0,h[15]=1,new o(h)}}},963:(e,t,n)=>{n.d(t,{y:()=>o});var i=n(9207);class o extends i._{constructor(e){super(e)}set x(e){this._v[0]=e}get x(){return this._v[0]}set y(e){this._v[1]=e}get y(){return this._v[1]}set z(e){this._v[2]=e}get z(){return this._v[2]}set w(e){this._v[3]=e}get w(){return this._v[3]}get className(){return"MutableQuaternion"}static identity(){return o.fromCopy4(0,0,0,1)}static dummy(){return new this(new Float32Array(0))}static invert(e){return super.invert(e)}static qlerp(e,t,n){return super.qlerp(e,t,n)}static lerp(e,t,n){return super.lerp(e,t,n)}static axisAngle(e,t){return super.axisAngle(e,t)}static fromMatrix(e){return super.fromMatrix(e)}static fromPosition(e){return super.fromPosition(e)}static add(e,t){return super.add(e,t)}static subtract(e,t){return super.subtract(e,t)}static multiply(e,t){return super.multiply(e,t)}static multiplyNumber(e,t){return super.multiplyNumber(e,t)}static divideNumber(e,t){return super.divideNumber(e,t)}raw(){return this._v}setAt(e,t){return this._v[e]=t,this}setComponents(e,t,n,i){return this._v[0]=e,this._v[1]=t,this._v[2]=n,this._v[3]=i,this}copyComponents(e){return this.setComponents(e._v[0],e._v[1],e._v[2],e._v[3])}identity(){return this.setComponents(0,0,0,1)}normalize(){const e=this.length();return this.divideNumber(e)}invert(){const e=this.length();return 0===e||(this._v[0]=-this._v[0]/e,this._v[1]=-this._v[1]/e,this._v[2]=-this._v[2]/e,this._v[3]=this._v[3]/e),this}qlerp(e,t,n){let i=e._v[3]*t._v[3]+e._v[0]*t._v[0]+e._v[1]*t._v[1]+e._v[2]*t._v[2];if(0==1-i*i)return this.copyComponents(e);{i>1?i=.999:i<-1&&(i=-.999);let o,a=Math.acos(i);i<0&&a>Math.PI/2?(i=-e._v[3]*t._v[3]-e._v[0]*t._v[0]-e._v[1]*t._v[1]-e._v[2]*t._v[2],a=Math.acos(i),o=-1*Math.sin(a*n)/Math.sin(a)):o=Math.sin(a*n)/Math.sin(a);const r=Math.sin(a*(1-n))/Math.sin(a);this._v[0]=e._v[0]*r+t._v[0]*o,this._v[1]=e._v[1]*r+t._v[1]*o,this._v[2]=e._v[2]*r+t._v[2]*o,this._v[3]=e._v[3]*r+t._v[3]*o}return this}lerp(e,t,n){return this._v[0]=e._v[0]*(1-n)+t._v[0]*n,this._v[1]=e._v[1]*(1-n)+t._v[1]*n,this._v[2]=e._v[2]*(1-n)+t._v[2]*n,this._v[3]=e._v[3]*(1-n)+t._v[3]*n,this}axisAngle(e,t){const n=.5*t,i=Math.sin(n),o=e.length();return 0===o&&console.error("0 division occurred!"),this._v[3]=Math.cos(n),this._v[0]=i*e._v[0]/o,this._v[1]=i*e._v[1]/o,this._v[2]=i*e._v[2]/o,this}fromMatrix(e){const t=e.m00+e.m11+e.m22;if(t>0){const n=.5/Math.sqrt(t+1);this._v[0]=(e.m21-e.m12)*n,this._v[1]=(e.m02-e.m20)*n,this._v[2]=(e.m10-e.m01)*n,this._v[3]=.25/n}else if(e.m00>e.m11&&e.m00>e.m22){const t=2*Math.sqrt(1+e.m00-e.m11-e.m22);this._v[0]=.25*t,this._v[1]=(e.m01+e.m10)/t,this._v[2]=(e.m02+e.m20)/t,this._v[3]=(e.m21-e.m12)/t}else if(e.m11>e.m22){const t=2*Math.sqrt(1+e.m11-e.m00-e.m22);this._v[0]=(e.m01+e.m10)/t,this._v[1]=.25*t,this._v[2]=(e.m12+e.m21)/t,this._v[3]=(e.m02-e.m20)/t}else{const t=2*Math.sqrt(1+e.m22-e.m00-e.m11);this._v[0]=(e.m02+e.m20)/t,this._v[1]=(e.m12+e.m21)/t,this._v[2]=.25*t,this._v[3]=(e.m10-e.m01)/t}return this}fromPosition(e){return this.setComponents(e._v[0],e._v[1],e._v[2],0)}add(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this._v[2]+=e._v[2],this._v[3]+=e._v[3],this}subtract(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this._v[2]-=e._v[2],this._v[3]-=e._v[3],this}multiply(e){const t=e._v[3]*this._v[0]+e._v[2]*this._v[1]+e._v[1]*this._v[2]-e._v[0]*this._v[3],n=-e._v[2]*this._v[0]+e._v[3]*this._v[1]+e._v[0]*this._v[2]-e._v[1]*this._v[3],i=e._v[1]*this._v[0]+e._v[0]*this._v[1]+e._v[3]*this._v[2]-e._v[2]*this._v[3],o=-e._v[0]*this._v[0]-e._v[1]*this._v[1]-e._v[2]*this._v[2]-e._v[3]*this._v[3];return this.setComponents(t,n,i,o)}multiplyNumber(e){return this._v[0]*=e,this._v[1]*=e,this._v[2]*=e,this._v[3]*=e,this}divideNumber(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e,this._v[2]/=e,this._v[3]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0,this._v[2]=1/0,this._v[3]=1/0),this}clone(){return o.fromCopy4(this._v[0],this._v[1],this._v[2],this._v[3])}static fromFloat32Array(e){return new o(e)}static fromCopyArray4(e){return new o(new Float32Array(e))}static fromCopyArray(e){return new o(new Float32Array(e.slice(0,4)))}static fromCopy4(e,t,n,i){return new o(new Float32Array([e,t,n,i]))}static fromCopyQuaternion(e){const t=new Float32Array(4);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],t[3]=e._v[3],new o(t)}static fromCopyVector4(e){const t=new Float32Array(4);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],t[3]=e._v[3],new o(t)}static fromCopyLogQuaternion(e){const t=e._v[0]*e._v[0]+e._v[1]*e._v[1]+e._v[2]*e._v[2],n=Math.sin(t),i=new Float32Array(4);return i[0]=e._v[0]*(n/t),i[1]=e._v[1]*(n/t),i[2]=e._v[2]*(n/t),i[3]=Math.cos(t),new o(i)}}},4267:(e,t,n)=>{n.d(t,{$_:()=>s,DU:()=>r,Et:()=>a});var i=n(3616),o=n(810);class a extends i.ap{constructor(e,{type:t}){super(e,{type:t})}copyComponents(e){this._v[0]=e._v[0]}get x(){return this._v[0]}set x(e){this._v[0]=e}get y(){return 0}get z(){return 0}get w(){return 1}toString(){return"("+this._v[0]+")"}setValue(e){return this.x=e,this}static get compositionType(){return o.d.Scalar}get bytesPerComponent(){return this._v.BYTES_PER_ELEMENT}}class r extends a{constructor(e){super(e,{type:Float32Array})}clone(){return new r(new Float32Array([this.x]))}static one(){return new r(new Float32Array([1]))}static dummy(){return new r(new Float32Array([]))}static zero(){return new r(new Float32Array([0]))}get className(){return"MutableScalar"}}class s extends a{constructor(e){super(e,{type:Float64Array})}clone(){return new s(new Float64Array([this.x]))}static one(){return new s(new Float64Array([1]))}static dummy(){return new s(new Float64Array([]))}static zero(){return new s(new Float64Array([0]))}}},8182:(e,t,n)=>{n.d(t,{NR:()=>a,el:()=>o,th:()=>r});var i=n(2390);class o extends i.pV{constructor(e,{type:t}){super(e,{type:t})}set x(e){this._v[0]=e}get x(){return this._v[0]}set y(e){this._v[1]=e}get y(){return this._v[1]}get z(){return 0}get w(){return 1}raw(){return this._v}setAt(e,t){return this._v[e]=t,this}setComponents(e,t){return this._v[0]=e,this._v[1]=t,this}copyComponents(e){return this.setComponents(e._v[0],e._v[1])}zero(){return this.setComponents(0,0)}one(){return this.setComponents(1,1)}normalize(){const e=this.length();return this.divide(e),this}add(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this}subtract(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this}multiply(e){return this._v[0]*=e,this._v[1]*=e,this}multiplyVector(e){return this._v[0]*=e._v[0],this._v[1]*=e._v[1],this}divide(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0),this}divideVector(e){return 0!==e._v[0]&&0!==e._v[1]?(this._v[0]/=e._v[0],this._v[1]/=e._v[1]):(console.error("0 division occurred!"),this._v[0]=0===e._v[0]?1/0:this._v[0]/e._v[0],this._v[1]=0===e._v[1]?1/0:this._v[1]/e._v[1]),this}get bytesPerComponent(){return this._v.BYTES_PER_ELEMENT}}class a extends o{constructor(e){super(e,{type:Float32Array})}static fromCopyArray2(e){return new a(new Float32Array(e))}static fromCopyArray(e){return new a(new Float32Array(e.slice(0,2)))}static fromFloat32Array(e){return new a(e)}static fromCopyFloat32Array(e){return new a(new Float32Array(e.buffer.slice(0)))}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}get className(){return"MutableVector2"}clone(){return super.clone()}}class r extends o{constructor(e){super(e,{type:Float64Array})}static fromCopyArray(e){return new r(new Float64Array(e))}static zero(){return super._zero(Float64Array)}static one(){return super._one(Float64Array)}static dummy(){return super._dummy(Float64Array)}static normalize(e){return super._normalize(e,Float64Array)}static add(e,t){return super._add(e,t,Float64Array)}static subtract(e,t){return super._subtract(e,t,Float64Array)}static multiply(e,t){return super._multiply(e,t,Float64Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float64Array)}static divide(e,t){return super._divide(e,t,Float64Array)}static divideVector(e,t){return super._divideVector(e,t,Float64Array)}clone(){return super.clone()}}},9190:(e,t,n)=>{n.d(t,{I1:()=>o,d6:()=>a,oV:()=>r});var i=n(2471);class o extends i.pg{constructor(e,{type:t}){super(e,{type:t})}set x(e){this._v[0]=e}get x(){return this._v[0]}set y(e){this._v[1]=e}get y(){return this._v[1]}set z(e){this._v[2]=e}get z(){return this._v[2]}get w(){return 1}raw(){return this._v}setAt(e,t){return this._v[e]=t,this}setComponents(e,t,n){return this._v[0]=e,this._v[1]=t,this._v[2]=n,this}copyComponents(e){return this.setComponents(e._v[0],e._v[1],e._v[2])}zero(){return this.setComponents(0,0,0)}one(){return this.setComponents(1,1,1)}normalize(){const e=this.length();return this.divide(e),this}add(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this._v[2]+=e._v[2],this}subtract(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this._v[2]-=e._v[2],this}multiply(e){return this._v[0]*=e,this._v[1]*=e,this._v[2]*=e,this}multiplyVector(e){return this._v[0]*=e._v[0],this._v[1]*=e._v[1],this._v[2]*=e._v[2],this}divide(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e,this._v[2]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0,this._v[2]=1/0),this}divideVector(e){return 0!==e._v[0]&&0!==e._v[1]&&0!==e._v[2]?(this._v[0]/=e._v[0],this._v[1]/=e._v[1],this._v[2]/=e._v[2]):(console.error("0 division occurred!"),this._v[0]=0===e._v[0]?1/0:this._v[0]/e._v[0],this._v[1]=0===e._v[1]?1/0:this._v[1]/e._v[1],this._v[2]=0===e._v[2]?1/0:this._v[2]/e._v[2]),this}cross(e){const t=this._v[1]*e._v[2]-this._v[2]*e._v[1],n=this._v[2]*e._v[0]-this._v[0]*e._v[2],i=this._v[0]*e._v[1]-this._v[1]*e._v[0];return this.setComponents(t,n,i)}multiplyQuaternion(e){const t=2*e._v[0],n=2*e._v[1],i=2*e._v[2],o=e._v[0]*t,a=e._v[1]*n,r=e._v[2]*i,s=e._v[0]*n,l=e._v[0]*i,c=e._v[1]*i,_=e._v[3]*t,h=e._v[3]*n,u=e._v[3]*i,d=(1-(a+r))*this._v[0]+(s-u)*this._v[1]+(l+h)*this._v[2],m=(s+u)*this._v[0]+(1-(o+r))*this._v[1]+(c-_)*this._v[2],f=(l-h)*this._v[0]+(c+_)*this._v[1]+(1-(o+a))*this._v[2];return this.setComponents(d,m,f)}get bytesPerComponent(){return this._v.BYTES_PER_ELEMENT}static _fromCopy3(e,t,n,i){return new this(new i([e,t,n]),{type:i})}}class a extends o{constructor(e){super(e,{type:Float32Array})}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}static cross(e,t){return super._cross(e,t,Float32Array)}static multiplyQuaternion(e,t){return super._multiplyQuaternion(e,t,Float32Array)}get className(){return"MutableVector3"}static fromCopy3(e,t,n){return super._fromCopy3(e,t,n,Float32Array)}static fromCopy1(e){return super._fromCopy3(e,e,e,Float32Array)}static fromCopyArray3(e){return new a(new Float32Array(e))}static fromCopyArray(e){return new a(new Float32Array(e.slice(0,3)))}static fromFloat32Array(e){return new a(e)}static fromCopyFloat32Array(e){return new a(new Float32Array(e.buffer.slice(0)))}static fromCopyVector3(e){return super._fromCopyVector3(e,Float32Array)}static fromCopyVector4(e){return super._fromCopyVector4(e,Float32Array)}clone(){return super.clone()}static rotateX(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.y=e.y*i-e.z*o,n.z=e.y*o+e.z*i}static rotateY(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.x=e.x*i+e.z*o,n.z=-e.x*o+e.z*i}static rotateZ(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.x=e.x*i-e.y*o,n.y=e.x*o+e.y*i}}class r extends o{constructor(e){super(e,{type:Float64Array})}static zero(){return super._zero(Float64Array)}static one(){return super._one(Float64Array)}static dummy(){return super._dummy(Float64Array)}static normalize(e){return super._normalize(e,Float64Array)}static add(e,t){return super._add(e,t,Float64Array)}static subtract(e,t){return super._subtract(e,t,Float64Array)}static multiply(e,t){return super._multiply(e,t,Float64Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float64Array)}static divide(e,t){return super._divide(e,t,Float64Array)}static divideVector(e,t){return super._divideVector(e,t,Float64Array)}static cross(e,t){return super._cross(e,t,Float64Array)}static multiplyQuaternion(e,t){return super._multiplyQuaternion(e,t,Float64Array)}static fromCopy3(e,t,n){return super._fromCopy3(e,t,n,Float64Array)}static fromCopy1(e){return super._fromCopy3(e,e,e,Float64Array)}static fromCopyArray3(e){return new r(new Float64Array(e))}static fromCopyArray(e){return new r(new Float64Array(e.slice(0,3)))}static rotateX(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.y=e.y*i-e.z*o,n.z=e.y*o+e.z*i}static rotateY(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.x=e.x*i+e.z*o,n.z=-e.x*o+e.z*i}static rotateZ(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.x=e.x*i-e.y*o,n.y=e.x*o+e.y*i}clone(){return super.clone()}}},4536:(e,t,n)=>{n.d(t,{e2:()=>o,hn:()=>r,xQ:()=>a});var i=n(7192);class o extends i.rE{constructor(e,{type:t}){super(e,{type:t}),this.__updateCount=0}set x(e){this._v[0]=e,this.__updateCount++}get x(){return this._v[0]}set y(e){this._v[1]=e,this.__updateCount++}get y(){return this._v[1]}set z(e){this._v[2]=e,this.__updateCount++}get z(){return this._v[2]}set w(e){this._v[3]=e,this.__updateCount++}get w(){return this._v[3]}raw(){return this._v}setAt(e,t){return this._v[e]=t,this.__updateCount++,this}setComponents(e,t,n,i){return this._v[0]=e,this._v[1]=t,this._v[2]=n,this._v[3]=i,this.__updateCount++,this}copyComponents(e){return this.setComponents(e._v[0],e._v[1],e._v[2],e._v[3])}zero(){return this.setComponents(0,0,0,0)}one(){return this.setComponents(1,1,1,1)}get bytesPerComponent(){return this._v.BYTES_PER_ELEMENT}normalize(){const e=this.length();return this.divide(e),this}normalize3(){const e=Math.hypot(this._v[0],this._v[1],this._v[2]);return this.divide(e),this}add(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this._v[2]+=e._v[2],this._v[3]+=e._v[3],this}subtract(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this._v[2]-=e._v[2],this._v[3]-=e._v[3],this}multiply(e){return this._v[0]*=e,this._v[1]*=e,this._v[2]*=e,this._v[3]*=e,this}multiplyVector(e){return this._v[0]*=e._v[0],this._v[1]*=e._v[1],this._v[2]*=e._v[2],this._v[3]*=e._v[3],this}divide(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e,this._v[2]/=e,this._v[3]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0,this._v[2]=1/0,this._v[3]=1/0),this}divideVector(e){return 0!==e._v[0]&&0!==e._v[1]&&0!==e._v[2]&&0!==e._v[3]?(this._v[0]/=e._v[0],this._v[1]/=e._v[1],this._v[2]/=e._v[2],this._v[3]/=e._v[3]):(console.error("0 division occurred!"),this._v[0]=0===e._v[0]?1/0:this._v[0]/e._v[0],this._v[1]=0===e._v[1]?1/0:this._v[1]/e._v[1],this._v[2]=0===e._v[2]?1/0:this._v[2]/e._v[2],this._v[3]=0===e._v[3]?1/0:this._v[3]/e._v[3]),this}get _updateCount(){return this.__updateCount}}class a extends o{constructor(e){super(e,{type:Float32Array})}static fromCopyArray(e){return new a(new Float32Array(e).slice(0,4))}static fromCopyArray4(e){return new a(new Float32Array(e))}static fromCopy4(e,t,n,i){return new a(new Float32Array([e,t,n,i]))}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}get className(){return"MutableVector4"}clone(){return new this.constructor(new this._v.constructor([this._v[0],this._v[1],this._v[2],this._v[3]]))}}class r extends o{constructor(e){super(e,{type:Float64Array})}static zero(){return super._zero(Float64Array)}static one(){return super._one(Float64Array)}static dummy(){return super._dummy(Float64Array)}static normalize(e){return super._normalize(e,Float64Array)}static add(e,t){return super._add(e,t,Float64Array)}static subtract(e,t){return super._subtract(e,t,Float64Array)}static multiply(e,t){return super._multiply(e,t,Float64Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float64Array)}static divide(e,t){return super._divide(e,t,Float64Array)}static divideVector(e,t){return super._divideVector(e,t,Float64Array)}static fromCopyArray4(e){return new r(new Float64Array(e))}static fromCopyArray(e){return new r(new Float64Array(e.slice(0,4)))}static fromCopy4(e,t,n,i){return new r(new Float64Array([e,t,n,i]))}clone(){return super.clone()}}},9207:(e,t,n)=>{n.d(t,{_:()=>l});var i=n(3032),o=n(810),a=n(3632),r=n(2471),s=n(9190);class l extends a.l{constructor(e){super(),this._v=e}get className(){return"Quaternion"}static get compositionType(){return o.d.Vec4}static identity(){return l.fromCopy4(0,0,0,1)}static dummy(){return new this(new Float32Array(0))}static invert(e){const t=e.length();if(0===t)return l.fromCopy4(0,0,0,0);const n=-e._v[0]/t,i=-e._v[1]/t,o=-e._v[2]/t,a=e._v[3]/t;return l.fromCopy4(n,i,o,a)}static invertTo(e,t){const n=e.length();return 0===n?t.setComponents(0,0,0,0):(t._v[0]=-e._v[0]/n,t._v[1]=-e._v[1]/n,t._v[2]=-e._v[2]/n,t._v[3]=e._v[3]/n,t)}static qlerp(e,t,n){let i=e._v[0]*t._v[0]+e._v[1]*t._v[1]+e._v[2]*t._v[2]+e._v[3]*t._v[3];if(0==1-i*i)return e.clone();{i>1?i=.999:i<-1&&(i=-.999);let o=Math.acos(i);const a=Math.sin(o);let r;i<0?(i*=-1,o=Math.acos(i),r=-1*Math.sin(o*n)/a):r=Math.sin(o*n)/a;const s=Math.sin(o*(1-n))/a;let c=e._v[0]*s+t._v[0]*r,_=e._v[1]*s+t._v[1]*r,h=e._v[2]*s+t._v[2]*r,u=e._v[3]*s+t._v[3]*r;const d=Math.hypot(c,_,h,u);return c/=d,_/=d,h/=d,u/=d,l.fromCopy4(c,_,h,u)}}static qlerpTo(e,t,n,i){let o=e._v[0]*t._v[0]+e._v[1]*t._v[1]+e._v[2]*t._v[2]+e._v[3]*t._v[3];if(0==1-o*o)return i.copyComponents(e);{o>1?o=.999:o<-1&&(o=-.999);let a=Math.acos(o);const r=Math.sin(a);let s;o<0?(o*=-1,a=Math.acos(o),s=-1*Math.sin(a*n)/r):s=Math.sin(a*n)/r;const l=Math.sin(a*(1-n))/r;i._v[0]=e._v[0]*l+t._v[0]*s,i._v[1]=e._v[1]*l+t._v[1]*s,i._v[2]=e._v[2]*l+t._v[2]*s,i._v[3]=e._v[3]*l+t._v[3]*s}return i.normalize()}static lerp(e,t,n){const i=e._v[0]*(1-n)+t._v[0]*n,o=e._v[1]*(1-n)+t._v[1]*n,a=e._v[2]*(1-n)+t._v[2]*n,r=e._v[3]*(1-n)+t._v[3]*n;return l.fromCopy4(i,o,a,r)}static lerpTo(e,t,n,i){return i._v[0]=e._v[0]*(1-n)+t._v[0]*n,i._v[1]=e._v[1]*(1-n)+t._v[1]*n,i._v[2]=e._v[2]*(1-n)+t._v[2]*n,i._v[3]=e._v[3]*(1-n)+t._v[3]*n,i}static axisAngle(e,t){const n=.5*t,i=Math.sin(n),o=e.length();return 0===o&&console.error("0 division occurred!"),l.fromCopy4(i*e._v[0]/o,i*e._v[1]/o,i*e._v[2]/o,Math.cos(n))}static fromMatrix(e){const t=l.fromCopy4(0,0,0,1),n=e.m00+e.m11+e.m22;if(n>0){const i=.5/Math.sqrt(n+1);t._v[3]=.25/i,t._v[0]=(e.m21-e.m12)*i,t._v[1]=(e.m02-e.m20)*i,t._v[2]=(e.m10-e.m01)*i}else if(e.m00>e.m11&&e.m00>e.m22){const n=2*Math.sqrt(1+e.m00-e.m11-e.m22);t._v[3]=(e.m21-e.m12)/n,t._v[0]=.25*n,t._v[1]=(e.m01+e.m10)/n,t._v[2]=(e.m02+e.m20)/n}else if(e.m11>e.m22){const n=2*Math.sqrt(1+e.m11-e.m00-e.m22);t._v[3]=(e.m02-e.m20)/n,t._v[0]=(e.m01+e.m10)/n,t._v[1]=.25*n,t._v[2]=(e.m12+e.m21)/n}else{const n=2*Math.sqrt(1+e.m22-e.m00-e.m11);t._v[3]=(e.m10-e.m01)/n,t._v[0]=(e.m02+e.m20)/n,t._v[1]=(e.m12+e.m21)/n,t._v[2]=.25*n}return t}static fromMatrixTo(e,t){const n=e.m00+e.m11+e.m22;if(n>0){const i=.5/Math.sqrt(n+1);t._v[3]=.25/i,t._v[0]=(e.m21-e.m12)*i,t._v[1]=(e.m02-e.m20)*i,t._v[2]=(e.m10-e.m01)*i}else if(e.m00>e.m11&&e.m00>e.m22){const n=2*Math.sqrt(1+e.m00-e.m11-e.m22);t._v[3]=(e.m21-e.m12)/n,t._v[0]=.25*n,t._v[1]=(e.m01+e.m10)/n,t._v[2]=(e.m02+e.m20)/n}else if(e.m11>e.m22){const n=2*Math.sqrt(1+e.m11-e.m00-e.m22);t._v[3]=(e.m02-e.m20)/n,t._v[0]=(e.m01+e.m10)/n,t._v[1]=.25*n,t._v[2]=(e.m12+e.m21)/n}else{const n=2*Math.sqrt(1+e.m22-e.m00-e.m11);t._v[3]=(e.m10-e.m01)/n,t._v[0]=(e.m02+e.m20)/n,t._v[1]=(e.m12+e.m21)/n,t._v[2]=.25*n}return t}static lookFromTo(e,t){return e.isEqual(t)?l.fromCopy4(0,0,0,1):this.qlerp(this.lookForward(e),this.lookForward(t),1)}static lookForward(e){return null==l.__tmp_upVec&&(l.__tmp_upVec=new e.constructor(0,1,0)),this.lookForwardAccordingToThisUp(e,l.__tmp_upVec)}static lookForwardAccordingToThisUp(e,t){const n=e.length();0===n&&console.error("0 division occurred!");const i=e._v[0]/n,o=e._v[1]/n,a=e._v[2]/n,r=t.length();0===r&&console.error("0 division occurred!");const s=t._v[0]/r,c=t._v[1]/r,_=t._v[2]/r;let h=t._v[1]*e._v[2]-t._v[2]*e._v[1],u=t._v[2]*e._v[0]-t._v[0]*e._v[2],d=t._v[0]*e._v[1]-t._v[1]*e._v[0];const m=Math.hypot(h,u,d);0===m&&console.error("0 division occurred!"),h/=m,u/=m,d/=m;const f=h,p=u,v=d,A=s,y=c,x=_,g=i,I=o,b=a,E=f+y+b;if(E>0){const e=Math.sqrt(E+1),t=.5/e;return l.fromCopy4((x-I)*t,(g-v)*t,(p-A)*t,.5*e)}if(f>=y&&f>=b){const e=Math.sqrt(1+f-y-b),t=.5/e;return l.fromCopy4(.5*e,(p+A)*t,(v+g)*t,(x-I)*t)}if(y>b){const e=Math.sqrt(1+y-f-b),t=.5/e;return l.fromCopy4((A+p)*t,.5*e,(I+x)*t,(g-v)*t)}{const e=Math.sqrt(1+b-f-y),t=.5/e;return l.fromCopy4((g+v)*t,(I+x)*t,.5*e,(p-A)*t)}}static fromPosition(e){return l.fromCopy4(e._v[0],e._v[1],e._v[2],0)}static add(e,t){const n=e._v[0]+t._v[0],i=e._v[1]+t._v[1],o=e._v[2]+t._v[2],a=e._v[3]+t._v[3];return l.fromCopy4(n,i,o,a)}static addTo(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n._v[2]=e._v[2]+t._v[2],n._v[3]=e._v[3]+t._v[3],n}static subtract(e,t){const n=e._v[0]-t._v[0],i=e._v[1]-t._v[1],o=e._v[2]-t._v[2],a=e._v[3]-t._v[3];return l.fromCopy4(n,i,o,a)}static subtractTo(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n._v[2]=e._v[2]-t._v[2],n._v[3]=e._v[3]-t._v[3],n}static multiply(e,t){const n=t._v[3]*e._v[0]+t._v[2]*e._v[1]-t._v[1]*e._v[2]+t._v[0]*e._v[3],i=-t._v[2]*e._v[0]+t._v[3]*e._v[1]+t._v[0]*e._v[2]+t._v[1]*e._v[3],o=t._v[1]*e._v[0]-t._v[0]*e._v[1]+t._v[3]*e._v[2]+t._v[2]*e._v[3],a=-t._v[0]*e._v[0]-t._v[1]*e._v[1]-t._v[2]*e._v[2]+t._v[3]*e._v[3];return l.fromCopy4(n,i,o,a)}static multiplyTo(e,t,n){const i=t._v[3]*e._v[0]+t._v[2]*e._v[1]-t._v[1]*e._v[2]+t._v[0]*e._v[3],o=-t._v[2]*e._v[0]+t._v[3]*e._v[1]+t._v[0]*e._v[2]+t._v[1]*e._v[3],a=t._v[1]*e._v[0]-t._v[0]*e._v[1]+t._v[3]*e._v[2]+t._v[2]*e._v[3],r=-t._v[0]*e._v[0]-t._v[1]*e._v[1]-t._v[2]*e._v[2]+t._v[3]*e._v[3];return n.setComponents(i,o,a,r)}static multiplyNumber(e,t){const n=e._v[0]*t,i=e._v[1]*t,o=e._v[2]*t,a=e._v[3]*t;return l.fromCopy4(n,i,o,a)}static multiplyNumberTo(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n._v[2]=e._v[2]*t,n._v[3]=e._v[3]*t,n}static divideNumber(e,t){0===t&&console.error("0 division occurred!");const n=e._v[0]/t,i=e._v[1]/t,o=e._v[2]/t,a=e._v[3]/t;return l.fromCopy4(n,i,o,a)}static divideNumberTo(e,t,n){return 0===t&&console.error("0 division occurred!"),n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t,n._v[2]=e._v[2]/t,n._v[3]=e._v[3]/t,n}toString(){return"("+this._v[0]+", "+this._v[1]+", "+this._v[2]+", "+this._v[3]+")"}toStringApproximately(){return i.k.financial(this._v[0])+" "+i.k.financial(this._v[1])+" "+i.k.financial(this._v[2])+" "+i.k.financial(this._v[3])+"\n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0])1?1:i,i=i<-1?-1:i,e._v[1]=Math.asin(i);const o=2*(this._v[3]*this._v[2]+this._v[0]*this._v[1]),a=1-2*(this._v[1]*this._v[1]+this._v[2]*this._v[2]);return e._v[2]=Math.atan2(o,a),e}toEulerAngles(){const e=new r.P(new Float32Array(3)),t=2*(this._v[3]*this._v[0]+this._v[1]*this._v[2]),n=1-2*(this._v[0]*this._v[0]+this._v[1]*this._v[1]);e._v[0]=Math.atan2(t,n);let i=2*(this._v[3]*this._v[1]-this._v[2]*this._v[0]);i=i>1?1:i,i=i<-1?-1:i,e._v[1]=Math.asin(i);const o=2*(this._v[3]*this._v[2]+this._v[0]*this._v[1]),a=1-2*(this._v[1]*this._v[1]+this._v[2]*this._v[2]);return e._v[2]=Math.atan2(o,a),e}static _divide(e,t){let n,i,o,a;return 0!==t?(n=e._v[0]/t,i=e._v[1]/t,o=e._v[2]/t,a=e._v[3]/t):(console.error("0 division occurred!"),n=1/0,i=1/0,o=1/0,a=1/0),l.fromCopy4(n,i,o,a)}static normalize(e){const t=e.length();return this._divide(e,t)}fromToRotation(e,t){const n=s.d6.fromCopyVector3(e),i=s.d6.fromCopyVector3(t);n.normalize(),i.normalize();const o=n.dot(i);if(o>-1+Number.EPSILON){const e=Math.sqrt(2*(1+o)),t=1/e,a=r.P.multiply(n.cross(i),t);return this._v[0]=a.x,this._v[1]=a.y,this._v[2]=a.z,this._v[3]=.5*e,l.normalize(this)}{let e=r.P.fromCopy3(0,1,0),t=n.cross(e);return t.length()-1+Number.EPSILON){const e=Math.sqrt(2*(1+o)),t=1/e,a=r.P.multiply(n.cross(i),t);return l.fromCopy4(a.x,a.y,a.z,.5*e)}{let e=r.P.fromCopy3(0,1,0),t=n.cross(e);return t.length(){n.d(t,{Ru:()=>s,ap:()=>r,kO:()=>l});var i=n(3032),o=n(3343),a=n(810);class r extends o.O{constructor(e,{type:t}){super(),this._v=e}getValue(){return this._v[0]}getValueInArray(){return[this._v[0]]}get x(){return this._v[0]}get raw(){return this._v}isStrictEqual(e){return this.x===e.x}isEqual(e,t=Number.EPSILON){return Math.abs(e.x-this.x){n.d(t,{EY:()=>l,FM:()=>s,HO:()=>c,ig:()=>_,pV:()=>r});var i=n(3032),o=n(810),a=n(3343);class r extends a.O{constructor(e,{type:t}){super(),this._v=e}get x(){return this._v[0]}get y(){return this._v[1]}get glslStrAsFloat(){return`vec2(${i.k.convertToStringAsGLSLFloat(this._v[0])}, ${i.k.convertToStringAsGLSLFloat(this._v[1])})`}get glslStrAsInt(){return`ivec2(${Math.floor(this._v[0])}, ${Math.floor(this._v[1])})`}static get compositionType(){return o.d.Vec2}static lengthSquared(e){return e.lengthSquared()}static lengthBtw(e,t){return e.lengthTo(t)}static angleOfVectors(e,t){const n=e.length()*t.length();0===n&&console.error("length of a vector is 0!");const i=e.dot(t)/n;return Math.acos(i)}static _zero(e){return this._fromCopyArray2([0,0],e)}static _one(e){return this._fromCopyArray2([1,1],e)}static _dummy(e){return new this(new e,{type:e})}static _normalize(e,t){const n=e.length();return this._divide(e,n,t)}static _add(e,t,n){const i=e._v[0]+t._v[0],o=e._v[1]+t._v[1];return this._fromCopyArray2([i,o],n)}static addTo(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n}static _subtract(e,t,n){const i=e._v[0]-t._v[0],o=e._v[1]-t._v[1];return this._fromCopyArray2([i,o],n)}static subtractTo(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n}static _multiply(e,t,n){const i=e._v[0]*t,o=e._v[1]*t;return this._fromCopyArray2([i,o],n)}static multiplyTo(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n}static _multiplyVector(e,t,n){const i=e._v[0]*t._v[0],o=e._v[1]*t._v[1];return this._fromCopyArray2([i,o],n)}static multiplyVectorTo(e,t,n){return n._v[0]=e._v[0]*t._v[0],n._v[1]=e._v[1]*t._v[1],n}static _divide(e,t,n){let i,o;return 0!==t?(i=e._v[0]/t,o=e._v[1]/t):(console.error("0 division occurred!"),i=1/0,o=1/0),this._fromCopyArray2([i,o],n)}static divideTo(e,t,n){return 0!==t?(n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t):(console.error("0 division occurred!"),n._v[0]=1/0,n._v[1]=1/0),n}static _divideVector(e,t,n){let i,o;return 0!==t._v[0]&&0!==t._v[1]?(i=e._v[0]/t._v[0],o=e._v[1]/t._v[1]):(console.error("0 division occurred!"),i=0===t._v[0]?1/0:e._v[0]/t._v[0],o=0===t._v[1]?1/0:e._v[1]/t._v[1]),this._fromCopyArray2([i,o],n)}static divideVectorTo(e,t,n){return 0!==t._v[0]&&0!==t._v[1]?(n._v[0]=e._v[0]/t._v[0],n._v[1]=e._v[1]/t._v[1]):(console.error("0 division occurred!"),n._v[0]=0===t._v[0]?1/0:e._v[0]/t._v[0],n._v[1]=0===t._v[1]?1/0:e._v[1]/t._v[1]),n}static dot(e,t){return e.dot(t)}toString(){return"("+this._v[0]+", "+this._v[1]+")"}toStringApproximately(){return i.k.financial(this._v[0])+" "+i.k.financial(this._v[1])+"\n"}flattenAsArray(){return[this._v[0],this._v[1]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){n.d(t,{P:()=>s,R1:()=>_,UJ:()=>l,p8:()=>c,pg:()=>r});var i=n(3032),o=n(810),a=n(3343);class r extends a.O{constructor(e,{type:t}){super(),this._v=e}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return 1}get glslStrAsFloat(){return`vec3(${i.k.convertToStringAsGLSLFloat(this._v[0])}, ${i.k.convertToStringAsGLSLFloat(this._v[1])}, ${i.k.convertToStringAsGLSLFloat(this._v[2])})`}get glslStrAsInt(){return`ivec3(${Math.floor(this._v[0])}, ${Math.floor(this._v[1])}, ${Math.floor(this._v[2])})`}static get compositionType(){return o.d.Vec3}static lengthSquared(e){return e.lengthSquared()}static lengthBtw(e,t){return e.lengthTo(t)}static angleOfVectors(e,t){const n=e.length()*t.length();0===n&&console.error("length of a vector is 0!");const i=e.dot(t)/n;return Math.acos(i)}static _zero(e){return this._fromCopyArray([0,0,0],e)}static _one(e){return this._fromCopyArray([1,1,1],e)}static _dummy(e){return new this(new e([]),{type:e})}static _normalize(e,t){const n=e.length();return this._divide(e,n,t)}static _add(e,t,n){const i=e._v[0]+t._v[0],o=e._v[1]+t._v[1],a=e._v[2]+t._v[2];return this._fromCopyArray([i,o,a],n)}static addTo(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n._v[2]=e._v[2]+t._v[2],n}static _subtract(e,t,n){const i=e._v[0]-t._v[0],o=e._v[1]-t._v[1],a=e._v[2]-t._v[2];return this._fromCopyArray([i,o,a],n)}static subtractTo(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n._v[2]=e._v[2]-t._v[2],n}static _multiply(e,t,n){const i=e._v[0]*t,o=e._v[1]*t,a=e._v[2]*t;return this._fromCopyArray([i,o,a],n)}static multiplyTo(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n._v[2]=e._v[2]*t,n}static _multiplyVector(e,t,n){const i=e._v[0]*t._v[0],o=e._v[1]*t._v[1],a=e._v[2]*t._v[2];return this._fromCopyArray([i,o,a],n)}static multiplyVectorTo(e,t,n){return n._v[0]=e._v[0]*t._v[0],n._v[1]=e._v[1]*t._v[1],n._v[2]=e._v[2]*t._v[2],n}static _divide(e,t,n){let i,o,a;return 0!==t?(i=e._v[0]/t,o=e._v[1]/t,a=e._v[2]/t):(console.error("0 division occurred!"),i=1/0,o=1/0,a=1/0),this._fromCopyArray([i,o,a],n)}static divideTo(e,t,n){return 0!==t?(n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t,n._v[2]=e._v[2]/t):(console.error("0 division occurred!"),n._v[0]=1/0,n._v[1]=1/0,n._v[2]=1/0),n}static _divideVector(e,t,n){let i,o,a;return 0!==t._v[0]&&0!==t._v[1]&&0!==t._v[2]?(i=e._v[0]/t._v[0],o=e._v[1]/t._v[1],a=e._v[2]/t._v[2]):(console.error("0 division occurred!"),i=0===t._v[0]?1/0:e._v[0]/t._v[0],o=0===t._v[1]?1/0:e._v[1]/t._v[1],a=0===t._v[2]?1/0:e._v[2]/t._v[2]),this._fromCopyArray([i,o,a],n)}static divideVectorTo(e,t,n){return 0!==t._v[0]&&0!==t._v[1]&&0!==t._v[2]?(n._v[0]=e._v[0]/t._v[0],n._v[1]=e._v[1]/t._v[1],n._v[2]=e._v[2]/t._v[2]):(console.error("0 division occurred!"),n._v[0]=0===t._v[0]?1/0:e._v[0]/t._v[0],n._v[1]=0===t._v[1]?1/0:e._v[1]/t._v[1],n._v[2]=0===t._v[2]?1/0:e._v[2]/t._v[2]),n}static dot(e,t){return e.dot(t)}static _cross(e,t,n){const i=e._v[1]*t._v[2]-e._v[2]*t._v[1],o=e._v[2]*t._v[0]-e._v[0]*t._v[2],a=e._v[0]*t._v[1]-e._v[1]*t._v[0];return this._fromCopyArray([i,o,a],n)}static crossTo(e,t,n){const i=e._v[1]*t._v[2]-e._v[2]*t._v[1],o=e._v[2]*t._v[0]-e._v[0]*t._v[2],a=e._v[0]*t._v[1]-e._v[1]*t._v[0];return n.setComponents(i,o,a)}static _multiplyQuaternion(e,t,n){const i=2*e._v[0],o=2*e._v[1],a=2*e._v[2],r=e._v[0]*i,s=e._v[1]*o,l=e._v[2]*a,c=e._v[0]*o,_=e._v[0]*a,h=e._v[1]*a,u=e._v[3]*i,d=e._v[3]*o,m=e._v[3]*a,f=(1-(s+l))*t._v[0]+(c-m)*t._v[1]+(_+d)*t._v[2],p=(c+m)*t._v[0]+(1-(r+l))*t._v[1]+(h-u)*t._v[2],v=(_-d)*t._v[0]+(h+u)*t._v[1]+(1-(r+s))*t._v[2];return this._fromCopyArray([f,p,v],n)}static multiplyQuaternionTo(e,t,n){const i=2*e._v[0],o=2*e._v[1],a=2*e._v[2],r=e._v[0]*i,s=e._v[1]*o,l=e._v[2]*a,c=e._v[0]*o,_=e._v[0]*a,h=e._v[1]*a,u=e._v[3]*i,d=e._v[3]*o,m=e._v[3]*a,f=(1-(s+l))*t._v[0]+(c-m)*t._v[1]+(_+d)*t._v[2],p=(c+m)*t._v[0]+(1-(r+l))*t._v[1]+(h-u)*t._v[2],v=(_-d)*t._v[0]+(h+u)*t._v[1]+(1-(r+s))*t._v[2];return n.setComponents(f,p,v)}toString(){return"("+this._v[0]+", "+this._v[1]+", "+this._v[2]+")"}toStringApproximately(){return i.k.financial(this._v[0])+" "+i.k.financial(this._v[1])+" "+i.k.financial(this._v[2])+"\n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){n.d(t,{GY:()=>h,Lt:()=>s,Tj:()=>l,cV:()=>_,n9:()=>c,rE:()=>r});var i=n(3032),o=n(810),a=n(3343);class r extends a.O{constructor(e,{type:t}){super(),this._v=e}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return this._v[3]}get glslStrAsFloat(){return`vec4(${i.k.convertToStringAsGLSLFloat(this._v[0])}, ${i.k.convertToStringAsGLSLFloat(this._v[1])}, ${i.k.convertToStringAsGLSLFloat(this._v[2])}, ${i.k.convertToStringAsGLSLFloat(this._v[3])})`}get glslStrAsInt(){return`ivec4(${Math.floor(this._v[0])}, ${Math.floor(this._v[1])}, ${Math.floor(this._v[2])}, ${Math.floor(this._v[3])})`}static _fromCopyArray4(e,t){return new this(new t(e),{type:t})}static _fromCopy4(e,t,n,i,o){return new this(new o([e,t,n,i]),{type:o})}static _fromCopyArray(e,t){return new this(new t(e.slice(0,4)),{type:t})}static _fromCopyVector4(e,t){return new this(new t([e._v[0],e._v[1],e._v[2],e._v[3]]),{type:t})}static _fromCopyVector3(e,t){return new this(new t([e._v[0],e._v[1],e._v[2],1]),{type:t})}static _fromVector2(e,t){return new this(new t([e._v[0],e._v[1],0,1]),{type:t})}static get compositionType(){return o.d.Vec4}static lengthSquared(e){return e.lengthSquared()}static lengthBtw(e,t){return e.lengthTo(t)}static _zero(e){return new this(new e([0,0,0,0]),{type:e})}static _one(e){return new this(new e([1,1,1,1]),{type:e})}static _dummy(e){return new this(new e([]),{type:e})}static _normalize(e,t){const n=e.length();return this._divide(e,n,t)}static _add(e,t,n){return new this(new n([e._v[0]+t._v[0],e._v[1]+t._v[1],e._v[2]+t._v[2],e._v[3]+t._v[3]]),{type:n})}static addTo(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n._v[2]=e._v[2]+t._v[2],n._v[3]=e._v[3]+t._v[3],n}static _subtract(e,t,n){return new this(new n([e._v[0]-t._v[0],e._v[1]-t._v[1],e._v[2]-t._v[2],e._v[3]-t._v[3]]),{type:n})}static subtractTo(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n._v[2]=e._v[2]-t._v[2],n._v[3]=e._v[3]-t._v[3],n}static _multiply(e,t,n){return new this(new n([e._v[0]*t,e._v[1]*t,e._v[2]*t,e._v[3]*t]),{type:n})}static multiplyTo(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n._v[2]=e._v[2]*t,n._v[3]=e._v[3]*t,n}static _multiplyVector(e,t,n){return new this(new n([e._v[0]*t._v[0],e._v[1]*t._v[1],e._v[2]*t._v[2],e._v[3]*t._v[3]]),{type:n})}static multiplyVectorTo(e,t,n){return n._v[0]=e._v[0]*t._v[0],n._v[1]=e._v[1]*t._v[1],n._v[2]=e._v[2]*t._v[2],n._v[3]=e._v[3]*t._v[3],n}static _divide(e,t,n){let i,o,a,r;return 0!==t?(i=e._v[0]/t,o=e._v[1]/t,a=e._v[2]/t,r=e._v[3]/t):(console.error("0 division occurred!"),i=1/0,o=1/0,a=1/0,r=1/0),new this(new n([i,o,a,r]),{type:n})}static divideTo(e,t,n){return 0!==t?(n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t,n._v[2]=e._v[2]/t,n._v[3]=e._v[3]/t):(console.error("0 division occurred!"),n._v[0]=1/0,n._v[1]=1/0,n._v[2]=1/0,n._v[3]=1/0),n}static _divideVector(e,t,n){let i,o,a,r;return 0!==t._v[0]&&0!==t._v[1]&&0!==t._v[2]&&0!==t._v[3]?(i=e._v[0]/t._v[0],o=e._v[1]/t._v[1],a=e._v[2]/t._v[2],r=e._v[3]/t._v[3]):(console.error("0 division occurred!"),i=0===t._v[0]?1/0:e._v[0]/t._v[0],o=0===t._v[1]?1/0:e._v[1]/t._v[1],a=0===t._v[2]?1/0:e._v[2]/t._v[2],r=0===t._v[3]?1/0:e._v[3]/t._v[3]),new this(new n([i,o,a,r]),{type:n})}static divideVectorTo(e,t,n){return 0!==t._v[0]&&0!==t._v[1]&&0!==t._v[2]&&0!==t._v[3]?(n._v[0]=e._v[0]/t._v[0],n._v[1]=e._v[1]/t._v[1],n._v[2]=e._v[2]/t._v[2],n._v[3]=e._v[3]/t._v[3]):(console.error("0 division occurred!"),n._v[0]=0===t._v[0]?1/0:e._v[0]/t._v[0],n._v[1]=0===t._v[1]?1/0:e._v[1]/t._v[1],n._v[2]=0===t._v[2]?1/0:e._v[2]/t._v[2],n._v[3]=0===t._v[3]?1/0:e._v[3]/t._v[3]),n}static dot(e,t){return e.dot(t)}toString(){return"("+this._v[0]+", "+this._v[1]+", "+this._v[2]+", "+this._v[3]+")"}toStringApproximately(){return i.k.financial(this._v[0])+" "+i.k.financial(this._v[1])+" "+i.k.financial(this._v[2])+" "+i.k.financial(this._v[3])+"\n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){n.d(t,{j:()=>i});class i{constructor(e){this._v=e}}},4020:(e,t,n)=>{n.d(t,{mN:()=>o.m,bC:()=>a,XA:()=>r.X,lJ:()=>s.l,Ox:()=>l.O,sZ:()=>c.s,tW:()=>h,SG:()=>d,zU:()=>u,ig:()=>F.ig,HO:()=>F.HO,R1:()=>B.R1,p8:()=>B.p8,GY:()=>_.GY,cV:()=>_.cV,n9:()=>_.n9,cm:()=>m.c,aq:()=>f.a,lW:()=>v,Db:()=>A.D,kj:()=>y.k,ak:()=>x.a,h:()=>g.h,Je:()=>I.J,CE:()=>E,l$:()=>S,f7:()=>C.f,xk:()=>w.x,ec:()=>R.e,yG:()=>P.y,DU:()=>M.DU,Et:()=>M.Et,$_:()=>M.$_,NR:()=>D.NR,el:()=>D.el,th:()=>D.th,d6:()=>b.d6,I1:()=>b.I1,oV:()=>b.oV,xQ:()=>T.xQ,e2:()=>T.e2,hn:()=>T.hn,_f:()=>p._,Ru:()=>N.Ru,ap:()=>N.ap,kO:()=>N.kO,WQ:()=>L,FM:()=>F.FM,pV:()=>F.pV,EY:()=>F.EY,P:()=>B.P,pg:()=>B.pg,UJ:()=>B.UJ,Lt:()=>_.Lt,rE:()=>_.rE,Tj:()=>_.Tj,j8:()=>G.j,Zz:()=>i.Zz,TL:()=>i.TL,RZ:()=>i.sZ,jI:()=>i.jI,F5:()=>i.F5,vP:()=>i.vP,to:()=>i.to,wr:()=>i.wr,nn:()=>i.nn,w0:()=>i.w0,GW:()=>i.GW,t5:()=>i.t5,vk:()=>i.vk,PF:()=>i.PF,Ff:()=>i.Ff,Up:()=>i.Up,Dq:()=>i.Dq,VI:()=>i.VI,hx:()=>i.hx,JI:()=>i.JI,fK:()=>i.fK,lx:()=>i.lx,ns:()=>i.ns,eI:()=>i.p8,n5:()=>i.n5,QU:()=>i.QU,Xg:()=>i.Xg,Rl:()=>i.Rl,_7:()=>i._7});var i=n(3991),o=n(2477);class a{constructor(){this._v=new Float32Array}isTheSourceSame(e){return this._v.buffer===e}}var r=n(8775),s=n(3632),l=n(3343),c=n(1162),_=n(7192);class h extends _.Lt{constructor(e){super(e)}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return this._v[3]}get r(){return this._v[0]}get g(){return this._v[1]}get b(){return this._v[2]}get a(){return this._v[3]}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}clone(){return super.clone()}static fromCopyArray(e){return this._fromCopyArray(e,Float32Array)}static fromCopyArray4(e){return this._fromCopyArray4(e,Float32Array)}static fromCopy4(e,t,n,i){return this._fromCopy4(e,t,n,i,Float32Array)}static fromCopyVector4(e){return this._fromCopyVector4(e,Float32Array)}}const u=new h(new Float32Array([1,1,1,1])),d=new h(new Float32Array([0,0,0,1]));var m=n(346),f=n(2086),p=n(9207);class v{constructor(e){this._v=e}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return 1}static fromFloat32Array(e){return new v(e)}static fromCopyArray3(e){return new p._(new Float32Array(e))}static fromCopyArray(e){return new p._(new Float32Array(e.slice(0,3)))}static fromCopy3(e,t,n){return new p._(new Float32Array([e,t,n]))}static fromCopyLogQuaternion(e){const t=new Float32Array(3);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],new p._(t)}static fromCopyVector4(e){const t=new Float32Array(3);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],new p._(t)}static fromCopyQuaternion(e){const t=Math.acos(e.w),n=Math.sin(t),i=new Float32Array(3);return i[0]=e.x*(t/n),i[1]=e.y*(t/n),i[2]=e.z*(t/n),new v(i)}get className(){return"LogQuaternion"}}var A=n(8547),y=n(3032),x=n(18),g=n(1937),I=n(5467),b=n(9190);class E extends b.d6{constructor(e){super(e)}get x(){return this._v[0]}set x(e){this._v[0]=e}get y(){return this._v[1]}set y(e){this._v[1]=e}get z(){return this._v[2]}set z(e){this._v[2]=e}get w(){return 1}get r(){return this._v[0]}set r(e){this._v[0]=e}get g(){return this._v[1]}set g(e){this._v[1]=e}get b(){return this._v[2]}set b(e){this._v[2]=e}get a(){return 1}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}static cross(e,t){return super._cross(e,t,Float32Array)}clone(){return super.clone()}}var T=n(4536);class S extends T.xQ{constructor(e){super(e)}get x(){return this._v[0]}set x(e){this._v[0]=e}get y(){return this._v[1]}set y(e){this._v[1]=e}get z(){return this._v[2]}set z(e){this._v[2]=e}get w(){return this._v[3]}set w(e){this._v[3]=e}get r(){return this._v[0]}set r(e){this._v[0]=e}get g(){return this._v[1]}set g(e){this._v[1]=e}get b(){return this._v[2]}set b(e){this._v[2]=e}get a(){return this._v[3]}set a(e){this._v[3]=e}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}clone(){return super.clone()}}var C=n(7035),w=n(2566),R=n(3496),P=n(963),M=n(4267),D=n(8182),N=n(3616),B=n(2471);class L{constructor(e){this.__is_position_updated=!0,this.__is_scale_updated=!0,this.__is_rotation_updated=!0,this.__is_trs_matrix_updated=!0,this.__updateCount=0,this.__position=b.d6.dummy(),this.__scale=b.d6.dummy(),this.__rotation=P.y.dummy(),this.__matrix=R.e.dummy(),void 0!==e?this.setTransform(e.positionInner,b.d6.fromCopyVector3(e.eulerAnglesInner),e.scaleInner,P.y.fromCopyQuaternion(e.rotationInner),e.matrixInner):(this.__position=b.d6.zero(),this.__scale=b.d6.one(),this.__rotation=P.y.identity(),this.__matrix=R.e.identity())}clone(){return new L(this)}set position(e){this.__position.copyComponents(e),this.__is_position_updated=!0,this.__is_trs_matrix_updated=!1,this.__updateTransform()}get position(){return this.positionInner.clone()}get positionInner(){return this.__is_position_updated||this.__is_trs_matrix_updated&&(this.__matrix.getTranslateTo(this.__position),this.__is_position_updated=!0),this.__position}set eulerAngles(e){const t=Math.sin(.5*e._v[0]),n=Math.cos(.5*e._v[0]),i=Math.sin(.5*e._v[1]),o=Math.cos(.5*e._v[1]),a=Math.sin(.5*e._v[2]),r=Math.cos(.5*e._v[2]);this.rotation=P.y.fromCopy4(t*o*r-n*i*a,n*i*r+t*o*a,n*o*a-t*i*r,n*o*r+t*i*a)}get eulerAngles(){return this.eulerAnglesInner.clone()}get eulerAnglesInner(){return this.__rotation.toEulerAngles()}set scale(e){this.__scale.copyComponents(e),this.__is_scale_updated=!0,this.__is_trs_matrix_updated=!1,this.__updateTransform()}get scale(){return this.scaleInner.clone()}get scaleInner(){return this.__is_scale_updated||this.__is_trs_matrix_updated&&(this.__matrix.getScaleTo(this.__scale),this.__is_scale_updated=!0),this.__scale}set rotation(e){this.__rotation.copyComponents(e),this.__is_rotation_updated=!0,this.__is_trs_matrix_updated=!1,this.__updateTransform()}get rotation(){return this.rotationInner.clone()}get rotationInner(){return this.__is_rotation_updated?this.__rotation:!this.__is_rotation_updated&&this.__is_trs_matrix_updated?(this.__is_rotation_updated=!0,this.__rotation.fromMatrix(this.__matrix),this.__rotation):this.__rotation}__updateTransform(){this.__updateEulerAngles(),this.__updatePosition(),this.__updateScale(),this.__needUpdate()}__updateEulerAngles(){!this.__is_rotation_updated&&this.__is_trs_matrix_updated&&(this.__rotation.fromMatrix(this.__matrix),this.__is_rotation_updated=!0)}__updatePosition(){!this.__is_position_updated&&this.__is_trs_matrix_updated&&(this.__matrix.getTranslateTo(this.__position),this.__is_position_updated=!0)}__updateScale(){!this.__is_scale_updated&&this.__is_trs_matrix_updated&&(this.__matrix.getScaleTo(this.__scale),this.__is_scale_updated=!0)}__updateMatrix(){if(!this.__is_trs_matrix_updated&&this.__is_position_updated&&this.__is_rotation_updated&&this.__is_scale_updated){const e=this.__matrix.fromQuaternion(this.__rotation),t=L.__tmpMatrix44_0.scale(this.__scale);e.multiply(t).putTranslate(this.__position),this.__is_trs_matrix_updated=!0}}set matrix(e){this.__matrix.copyComponents(e),this.__is_trs_matrix_updated=!0,this.__is_position_updated=!1,this.__is_rotation_updated=!1,this.__is_scale_updated=!1,this.__updateTransform()}get matrix(){return this.matrixInner.clone()}get matrixInner(){if(this.__is_trs_matrix_updated)return this.__matrix;const e=this.scaleInner,t=e._v[0],n=e._v[1],i=e._v[2],o=this.rotationInner,a=o._v[0]*o._v[0],r=o._v[1]*o._v[1],s=o._v[2]*o._v[2],l=o._v[1]*o._v[2],c=o._v[0]*o._v[2],_=o._v[0]*o._v[1],h=o._v[3]*o._v[0],u=o._v[3]*o._v[1],d=o._v[3]*o._v[2],m=1-2*(r+s),f=2*(_-d),p=2*(c+u),v=2*(_+d),A=1-2*(a+s),y=2*(l-h),x=2*(c-u),g=2*(l+h),I=1-2*(a+r),b=this.positionInner;return this.__matrix.m00=m*t,this.__matrix.m01=f*n,this.__matrix.m02=p*i,this.__matrix.m03=b.x,this.__matrix.m10=v*t,this.__matrix.m11=A*n,this.__matrix.m12=y*i,this.__matrix.m13=b.y,this.__matrix.m20=x*t,this.__matrix.m21=g*n,this.__matrix.m22=I*i,this.__matrix.m23=b.z,this.__matrix.m30=0,this.__matrix.m31=0,this.__matrix.m32=0,this.__matrix.m33=1,this.__is_trs_matrix_updated=!0,this.__matrix}__needUpdate(){this.__updateCount++}get updateCount(){return this.__updateCount}set rotateMatrix44(e){this.rotation=L.__tmpQuaternion_0.fromMatrix(e)}get rotateMatrix44(){return I.J.fromCopyQuaternion(this.rotation)}setPropertiesFromJson(e){let t=e;"string"==typeof e&&(t=JSON.parse(e));for(const e in t)t.hasOwnProperty(e)&&e in this&&("quaternion"===e?this.rotation=p._.fromCopyArray4(t[e]):this[e]="matrix"===e?I.J.fromCopyArray16RowMajor(t[e]):B.P.fromCopyArray(t[e]))}setRotationFromNewUpAndFront(e,t){const n=e,i=b.d6.crossTo(n,t,L.__tmpVector3_0),o=b.d6.crossTo(i,n,L.__tmpVector3_1),a=L.__tmpMatrix44_0.setComponents(i.x,n.x,o.x,0,i.y,n.y,o.y,0,i.z,n.z,o.z,0,0,0,0,1);this.rotateMatrix44=a}headToDirection(e,t){const n=L.__tmpVector3_0.copyComponents(e).normalize(),i=L.__tmpVector3_1.copyComponents(t).normalize(),o=b.d6.crossTo(n,i,L.__tmpVector3_2),a=B.P.dot(n,i),r=Math.acos(a);this.rotation=L.__tmpQuaternion_0.axisAngle(o,r)}setTransform(e,t,n,i,o){this.__is_trs_matrix_updated=!1,null!=o&&(this.__matrix=o.clone(),this.__is_trs_matrix_updated=!0,this.__is_position_updated=!1,this.__is_rotation_updated=!1,this.__is_scale_updated=!1),null!=e&&(this.__position=e.clone(),this.__is_position_updated=!0),null!=t&&null!=i?(this.__rotation=i.clone(),this.__is_rotation_updated=!0):null!=t?this.__is_rotation_updated=!1:null!=i&&(this.__rotation=i.clone(),this.__is_rotation_updated=!0),null!=n&&(this.__scale=n.clone(),this.__is_scale_updated=!0),this.__updateTransform()}}L.__tmpMatrix44_0=R.e.zero(),L.__tmpVector3_0=b.d6.zero(),L.__tmpVector3_1=b.d6.zero(),L.__tmpVector3_2=b.d6.zero(),L.__tmpQuaternion_0=P.y.identity();var F=n(2390),G=n(4255)},3991:(e,t,n)=>{n.d(t,{Dq:()=>h,F5:()=>g,Ff:()=>c,GW:()=>a,JI:()=>m,PF:()=>l,QU:()=>T,Rl:()=>C,TL:()=>A,Up:()=>_,VI:()=>u,Xg:()=>M,Zz:()=>v,_7:()=>w,fK:()=>f,hx:()=>d,jI:()=>x,lx:()=>p,n5:()=>E,nn:()=>i,ns:()=>I,p8:()=>b,sZ:()=>y,t5:()=>r,to:()=>R,vP:()=>S,vk:()=>s,w0:()=>o,wr:()=>P});const i=Symbol("get1"),o=Symbol("get1_offset"),a=Symbol("get1_offsetAsComposition"),r=Symbol("get2"),s=Symbol("get2_offset"),l=Symbol("get2_offsetAsComposition"),c=Symbol("get3"),_=Symbol("get3_offset"),h=Symbol("get3_offsetAsComposition"),u=Symbol("get4"),d=Symbol("get4_offset"),m=Symbol("get4_offsetAsComposition"),f=Symbol("getN_offset"),p=Symbol("getN_offsetAsComposition"),v=Symbol("add2"),A=Symbol("add2_offset"),y=Symbol("add3"),x=Symbol("add3_offset"),g=Symbol("add4"),I=Symbol("mulArray3WithScalar_offset"),b=Symbol("mulArray4WithScalar_offset"),E=Symbol("mulArrayNWithScalar_offset"),T=Symbol("mulThatAndThisToOutAsMat44_offsetAsComposition"),S=Symbol("add4_offset"),C=Symbol("qlerp_offsetAsComposition"),w=Symbol("scalar_lerp_offsetAsComposition"),R=Symbol("array3_lerp_offsetAsComposition"),P=Symbol("arrayN_lerp_offsetAsComposition"),M=Symbol("normalizeArray4"),D=[Array,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array],N=[a,l,i,o,r,s,c,_,h,u,d,m,f,p,v,A,y,x,g,S,I,b,E,T,C,w,R,P,M],B=[function(e){return[this[e]]},function(e){return[this[2*e],this[2*e+1]]},function(){return[this[0]]},function(e){return[this[e]]},function(){return[this[0],this[1]]},function(e){return[this[e],this[e+1]]},function(){return[this[0],this[1],this[2]]},function(e){return[this[e],this[e+1],this[e+2]]},function(e){return[this[3*e],this[3*e+1],this[3*e+2]]},function(){return[this[0],this[1],this[2],this[3]]},function(e){return[this[e],this[e+1],this[e+2],this[e+3]]},function(e){return[this[4*e],this[4*e+1],this[4*e+2],this[4*e+3]]},function(e,t){const n=new Array(t);for(let i=0;i1?a=.999:a<-1&&(a=-.999);let r=Math.acos(a);const s=Math.sin(r);let l;a<0?(a*=-1,r=Math.acos(a),l=-1*Math.sin(r*t)/s):l=Math.sin(r*t)/s;const c=Math.sin(r*(1-t))/s;o[0]=this[0+4*n]*c+e[0+4*i]*l,o[1]=this[1+4*n]*c+e[1+4*i]*l,o[2]=this[2+4*n]*c+e[2+4*i]*l,o[3]=this[3+4*n]*c+e[3+4*i]*l}return o},function(e,t,n,i){return this[n]*(1-t)+e[i]*t},function(e,t,n,i){const o=new Array(3);for(let a=0;a<3;a++)o[a]=this[3*n+a]*(1-t)+e[3*i+a]*t;return o},function(e,t,n,i,o){const a=new Array(t);for(let r=0;r{n.d(t,{U:()=>m});var i=n(3999),o=n(810),a=n(2390),r=n(2471),s=n(7192),l=n(8182),c=n(9190),_=n(4536),h=n(1937),u=n(3496),d=n(4690);class m{constructor({bufferView:e,byteOffsetInBufferView:t,compositionType:n,componentType:a,byteStride:r,count:s,raw:l,max:c,min:h,arrayLength:u,normalized:m}){var f,p,v,A,y,x,g,I;this.__compositionType=o.d.Unknown,this.__componentType=i.r.Unknown,this.__count=0,this.__takenCount=0,this.__byteStride=0,this.__max=_.xQ.fromCopyArray([-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]),this.__min=_.xQ.fromCopyArray([Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE]),this.__arrayLength=1,this.__normalized=!1,this.__isMinMixDirty=!0,this.__version=0,this.__bufferView=e,this.__byteOffsetInRawArrayBufferOfBuffer=e.byteOffsetInRawArrayBufferOfBuffer+t,this.__compositionType=n,this.__componentType=a,this.__count=s,this.__arrayLength=u,d.Is.exist(c)&&this.__max.setComponents(null!==(f=c[0])&&void 0!==f?f:-Number.MAX_VALUE,null!==(p=c[1])&&void 0!==p?p:-Number.MAX_VALUE,null!==(v=c[2])&&void 0!==v?v:-Number.MAX_VALUE,null!==(A=c[3])&&void 0!==A?A:-Number.MAX_VALUE),d.Is.exist(h)&&this.__min.setComponents(null!==(y=h[0])&&void 0!==y?y:Number.MAX_VALUE,null!==(x=h[1])&&void 0!==x?x:Number.MAX_VALUE,null!==(g=h[2])&&void 0!==g?g:Number.MAX_VALUE,null!==(I=h[3])&&void 0!==I?I:Number.MAX_VALUE),d.Is.exist(c)&&d.Is.exist(h)&&(this.__isMinMixDirty=!1),this.__raw=l,this.__normalized=m,this.__byteStride=r,0===this.__byteStride&&(this.__byteStride=this.__compositionType.getNumberOfComponents()*this.__componentType.getSizeInBytes()*this.__arrayLength);const b=this.getTypedArrayClass(this.__componentType);this.__typedArrayClass=b;const E=this.__byteStride-this.__compositionType.getNumberOfComponents()*this.__componentType.getSizeInBytes(),T=this.__raw.byteLength-this.__byteOffsetInRawArrayBufferOfBuffer,S=this.byteStride*this.__count-E;T=this.__count&&console.error("You are trying to allocate more than you have secured.");const t=new this.__typedArrayClass(e,this.__byteOffsetInRawArrayBufferOfBuffer+this.__byteStride*this.__takenCount,this.__compositionType.getNumberOfComponents()*this.__arrayLength);return t._accessor=this,t._idx_of_accessor=this.__takenCount,this.__takenCount+=1,t}_takeExistedOne(e){const t=this.__raw;e>=this.__count&&console.error("You are trying to allocate more than you have secured.");const n=new this.__typedArrayClass(t,this.__byteOffsetInRawArrayBufferOfBuffer+this.__byteStride*e,this.__compositionType.getNumberOfComponents()*this.__arrayLength);return n._accessor=this,n._idx_of_accessor=e,n}get takenCount(){return this.takenCount}get numberOfComponents(){return this.__compositionType.getNumberOfComponents()}get componentSizeInBytes(){return this.__componentType.getSizeInBytes()}get elementSizeInBytes(){return this.numberOfComponents*this.componentSizeInBytes}get elementCount(){return this.__count}get byteLength(){return this.__byteStride*this.__count}get componentType(){return this.__componentType}get compositionType(){return this.__compositionType}getTypedArray(){return this.__typedArray}getUint8Array(){return new Uint8Array(this.bufferView.buffer.getArrayBuffer(),this.byteOffsetInRawArrayBufferOfBuffer,this.byteLength)}get isAoS(){return!this.isSoA}get isSoA(){return this.byteStride===this.__compositionType.getNumberOfComponents()*this.__componentType.getSizeInBytes()}get byteStride(){return this.__byteStride}getScalar(e,{indicesAccessor:t,endian:n=!0}){let i=e;return t&&(i=t.getScalar(e,{})),this.__dataViewGetter(this.__byteStride*i,n)}getScalarAt(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;return n&&(o=n.getScalar(e,{})),this.__dataViewGetter(this.__byteStride*o+t,i)}getVec2AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n)]}getVec3AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n)]}getVec4AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n)]}getMat3AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n),this.__dataViewGetter(this.__byteStride*i+4*o,n),this.__dataViewGetter(this.__byteStride*i+5*o,n),this.__dataViewGetter(this.__byteStride*i+6*o,n),this.__dataViewGetter(this.__byteStride*i+7*o,n),this.__dataViewGetter(this.__byteStride*i+8*o,n)]}getMat4AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n),this.__dataViewGetter(this.__byteStride*i+4*o,n),this.__dataViewGetter(this.__byteStride*i+5*o,n),this.__dataViewGetter(this.__byteStride*i+6*o,n),this.__dataViewGetter(this.__byteStride*i+7*o,n),this.__dataViewGetter(this.__byteStride*i+8*o,n),this.__dataViewGetter(this.__byteStride*i+9*o,n),this.__dataViewGetter(this.__byteStride*i+10*o,n),this.__dataViewGetter(this.__byteStride*i+11*o,n),this.__dataViewGetter(this.__byteStride*i+12*o,n),this.__dataViewGetter(this.__byteStride*i+13*o,n),this.__dataViewGetter(this.__byteStride*i+14*o,n),this.__dataViewGetter(this.__byteStride*i+15*o,n)]}getVec2(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return a.FM.fromCopyArray2([this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n)])}getVec3(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return r.P.fromCopyArray([this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n)])}getVec4(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return s.Lt.fromCopyArray([this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n)])}getMat3(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return h.h.fromCopy9RowMajor(this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n),this.__dataViewGetter(this.__byteStride*i+4*o,n),this.__dataViewGetter(this.__byteStride*i+5*o,n),this.__dataViewGetter(this.__byteStride*i+6*o,n),this.__dataViewGetter(this.__byteStride*i+7*o,n),this.__dataViewGetter(this.__byteStride*i+8*o,n))}getMat4(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return u.e.fromCopy16RowMajor(this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n),this.__dataViewGetter(this.__byteStride*i+4*o,n),this.__dataViewGetter(this.__byteStride*i+5*o,n),this.__dataViewGetter(this.__byteStride*i+6*o,n),this.__dataViewGetter(this.__byteStride*i+7*o,n),this.__dataViewGetter(this.__byteStride*i+8*o,n),this.__dataViewGetter(this.__byteStride*i+9*o,n),this.__dataViewGetter(this.__byteStride*i+10*o,n),this.__dataViewGetter(this.__byteStride*i+11*o,n),this.__dataViewGetter(this.__byteStride*i+12*o,n),this.__dataViewGetter(this.__byteStride*i+13*o,n),this.__dataViewGetter(this.__byteStride*i+14*o,n),this.__dataViewGetter(this.__byteStride*i+15*o,n))}getVec2To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i))}getVec3To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i),this.__dataViewGetter(this.__byteStride*o+2*a,i))}getVec4To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i),this.__dataViewGetter(this.__byteStride*o+2*a,i),this.__dataViewGetter(this.__byteStride*o+3*a,i))}getMat3To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i),this.__dataViewGetter(this.__byteStride*o+2*a,i),this.__dataViewGetter(this.__byteStride*o+3*a,i),this.__dataViewGetter(this.__byteStride*o+4*a,i),this.__dataViewGetter(this.__byteStride*o+5*a,i),this.__dataViewGetter(this.__byteStride*o+6*a,i),this.__dataViewGetter(this.__byteStride*o+7*a,i),this.__dataViewGetter(this.__byteStride*o+8*a,i))}getMat4To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i),this.__dataViewGetter(this.__byteStride*o+2*a,i),this.__dataViewGetter(this.__byteStride*o+3*a,i),this.__dataViewGetter(this.__byteStride*o+4*a,i),this.__dataViewGetter(this.__byteStride*o+5*a,i),this.__dataViewGetter(this.__byteStride*o+6*a,i),this.__dataViewGetter(this.__byteStride*o+7*a,i),this.__dataViewGetter(this.__byteStride*o+8*a,i),this.__dataViewGetter(this.__byteStride*o+9*a,i),this.__dataViewGetter(this.__byteStride*o+10*a,i),this.__dataViewGetter(this.__byteStride*o+11*a,i),this.__dataViewGetter(this.__byteStride*o+12*a,i),this.__dataViewGetter(this.__byteStride*o+13*a,i),this.__dataViewGetter(this.__byteStride*o+14*a,i),this.__dataViewGetter(this.__byteStride*o+15*a,i))}setScalar(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{})),this.__dataViewSetter(this.__byteStride*o,t,i),this.__isMinMixDirty=!0,this.__version++}setVec2(e,t,n,{indicesAccessor:i,endian:o=!0}){let a=e;i&&(a=i.getScalar(e,{}));const r=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*a,t,o),this.__dataViewSetter(this.__byteStride*a+1*r,n,o),this.__isMinMixDirty=!0,this.__version++}setVec3(e,t,n,i,{indicesAccessor:o,endian:a=!0}){let r=e;o&&(r=o.getScalar(e,{}));const s=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*r,t,a),this.__dataViewSetter(this.__byteStride*r+1*s,n,a),this.__dataViewSetter(this.__byteStride*r+2*s,i,a),this.__isMinMixDirty=!0,this.__version++}setVec4(e,t,n,i,o,{indicesAccessor:a,endian:r=!0}){let s=e;a&&(s=a.getScalar(e,{}));const l=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*s,t,r),this.__dataViewSetter(this.__byteStride*s+1*l,n,r),this.__dataViewSetter(this.__byteStride*s+2*l,i,r),this.__dataViewSetter(this.__byteStride*s+3*l,o,r),this.__isMinMixDirty=!0,this.__version++}setMat4(e,t,n,i,o,a,r,s,l,c,_,h,u,d,m,f,p,{indicesAccessor:v,endian:A=!0}){let y=e;v&&(y=v.getScalar(e,{}));const x=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*y,t,A),this.__dataViewSetter(this.__byteStride*y+1*x,n,A),this.__dataViewSetter(this.__byteStride*y+2*x,i,A),this.__dataViewSetter(this.__byteStride*y+3*x,o,A),this.__dataViewSetter(this.__byteStride*y+4*x,a,A),this.__dataViewSetter(this.__byteStride*y+5*x,r,A),this.__dataViewSetter(this.__byteStride*y+6*x,s,A),this.__dataViewSetter(this.__byteStride*y+7*x,l,A),this.__dataViewSetter(this.__byteStride*y+8*x,c,A),this.__dataViewSetter(this.__byteStride*y+9*x,_,A),this.__dataViewSetter(this.__byteStride*y+10*x,h,A),this.__dataViewSetter(this.__byteStride*y+11*x,u,A),this.__dataViewSetter(this.__byteStride*y+12*x,d,A),this.__dataViewSetter(this.__byteStride*y+13*x,m,A),this.__dataViewSetter(this.__byteStride*y+14*x,f,A),this.__dataViewSetter(this.__byteStride*y+15*x,p,A),this.__isMinMixDirty=!0,this.__version++}setVec2AsVector(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*o,t.x,i),this.__dataViewSetter(this.__byteStride*o+1*a,t.y,i),this.__isMinMixDirty=!0,this.__version++}setVec3AsVector(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*o,t.x,i),this.__dataViewSetter(this.__byteStride*o+1*a,t.y,i),this.__dataViewSetter(this.__byteStride*o+2*a,t.z,i),this.__isMinMixDirty=!0,this.__version++}setVec4AsVector(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*o,t.x,i),this.__dataViewSetter(this.__byteStride*o+1*a,t.y,i),this.__dataViewSetter(this.__byteStride*o+2*a,t.z,i),this.__dataViewSetter(this.__byteStride*o+3*a,t.w,i),this.__isMinMixDirty=!0,this.__version++}setMat4AsMatrix44(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*o,t._v[0],i),this.__dataViewSetter(this.__byteStride*o+1*a,t._v[1],i),this.__dataViewSetter(this.__byteStride*o+2*a,t._v[2],i),this.__dataViewSetter(this.__byteStride*o+3*a,t._v[3],i),this.__dataViewSetter(this.__byteStride*o+4*a,t._v[4],i),this.__dataViewSetter(this.__byteStride*o+5*a,t._v[5],i),this.__dataViewSetter(this.__byteStride*o+6*a,t._v[6],i),this.__dataViewSetter(this.__byteStride*o+7*a,t._v[7],i),this.__dataViewSetter(this.__byteStride*o+8*a,t._v[8],i),this.__dataViewSetter(this.__byteStride*o+9*a,t._v[9],i),this.__dataViewSetter(this.__byteStride*o+10*a,t._v[10],i),this.__dataViewSetter(this.__byteStride*o+11*a,t._v[11],i),this.__dataViewSetter(this.__byteStride*o+12*a,t._v[12],i),this.__dataViewSetter(this.__byteStride*o+13*a,t._v[13],i),this.__dataViewSetter(this.__byteStride*o+14*a,t._v[14],i),this.__dataViewSetter(this.__byteStride*o+15*a,t._v[15],i),this.__isMinMixDirty=!0,this.__version++}copyFromTypedArray(e){const t=this.numberOfComponents;for(let n=0;n{n.d(t,{l:()=>l});var i=n(1050),o=n(810),a=n(3999),r=n(3449),s=n(2253);class l{constructor({byteLength:e,buffer:t,name:n,byteAlign:i}){this.__byteLength=0,this.__byteOffset=0,this.__takenBytesIndex=0,this.__name="",this.__bufferViews=[],this.__name=n,this.__byteLength=e,this.__byteAlign=i,t instanceof Uint8Array?(this.__raw=t.buffer,this.__byteOffset=t.byteOffset):this.__raw=t}set name(e){this.__name=e}get name(){return this.__name}getArrayBuffer(){return this.__raw}__padding(e,t){const n=r.j.calcPaddingBytes(e,t);return n>0&&console.info("Padding bytes added to takenBytesIndex."),n}takeBufferView({byteLengthToNeed:e,byteStride:t}){const n=e;if(n+this.__takenBytesIndex>this.byteLength){const e=`The size of the BufferView you are trying to take exceeds the byte length left in the Buffer.\nBuffer.byteLength: ${this.byteLength}, Buffer.takenSizeInByte: ${this.takenSizeInByte},\nbyteSizeToTake: ${n}, the byte length left in the Buffer: ${this.__byteLength-this.__takenBytesIndex}`;return new s.UG({message:e,error:void 0})}const o=new i.q({buffer:this,byteOffsetInBuffer:this.__takenBytesIndex,defaultByteStride:t,byteLength:n,raw:this.__raw});return this.__takenBytesIndex+=n,this.__takenBytesIndex=r.j.addPaddingBytes(this.__takenBytesIndex,this.__byteAlign),this.__bufferViews.push(o),new s.Ok(o)}takeBufferViewWithByteOffset({byteLengthToNeed:e,byteStride:t,byteOffset:n}){if(e+n>this.byteLength){const t=`The size of the BufferView you are trying to take exceeds the byte length left in the Buffer.\nBuffer.byteLength: ${this.byteLength}, Buffer.takenSizeInByte: ${this.takenSizeInByte},\nbyteSizeToTake: ${e}, the byte length left in the Buffer: ${this.__byteLength-this.__takenBytesIndex}`;return new s.UG({message:t,error:void 0})}const o=new i.q({buffer:this,byteOffsetInBuffer:n,defaultByteStride:t,byteLength:e,raw:this.__raw}),a=Uint8Array.BYTES_PER_ELEMENT*e+n;return this.__takenBytesIndex{n.d(t,{q:()=>a});var i=n(5519),o=n(2253);class a{constructor({buffer:e,byteOffsetInBuffer:t,defaultByteStride:n,byteLength:i,raw:o}){this.__defaultByteStride=0,this.__takenByte=0,this.__takenAccessorCount=0,this.__accessors=[],this.__buffer=e,this.__byteOffsetInBuffer=t,this.__byteOffsetInRawArrayBufferOfBuffer=e.byteOffsetInRawArrayBuffer+t,this.__byteLength=i,this.__defaultByteStride=n,this.__raw=o}get defaultByteStride(){return this.__defaultByteStride}get byteLength(){return this.__byteLength}get byteOffsetInBuffer(){return this.__byteOffsetInRawArrayBufferOfBuffer-this.__buffer.byteOffsetInRawArrayBuffer}get byteOffsetInRawArrayBufferOfBuffer(){return this.__byteOffsetInRawArrayBufferOfBuffer}get buffer(){return this.__buffer}get isSoA(){return!this.isAoS}get isAoS(){for(const e of this.__accessors)if(e.isAoS)return!0;return!1}getUint8Array(){return new Uint8Array(this.__raw,this.__byteOffsetInRawArrayBufferOfBuffer,this.__byteLength)}takeAccessor({compositionType:e,componentType:t,count:n,byteStride:i=this.defaultByteStride,max:o,min:a,arrayLength:r=1,normalized:s=!1}){return this.__takeAccessorInner({compositionType:e,componentType:t,count:n,byteStride:i,max:o,min:a,normalized:s,arrayLength:r})}takeAccessorWithByteOffset({compositionType:e,componentType:t,count:n,byteOffsetInBufferView:i,byteStride:o=this.defaultByteStride,max:a,min:r,normalized:s=!1}){return this.__takeAccessorInnerWithByteOffset({compositionType:e,componentType:t,count:n,byteStride:o,byteOffsetInBufferView:i,max:a,min:r,normalized:s})}__takeAccessorInner({compositionType:e,componentType:t,count:n,byteStride:a,max:r,min:s,arrayLength:l,normalized:c}){const _=this.__takenByte;let h=a;if(0===h&&(h=e.getNumberOfComponents()*t.getSizeInBytes()*l),this.__takenByte+h*(n-1)+t.getSizeInBytes()*e.getNumberOfComponents()>this.byteLength){const e=`The size of the Accessor you are trying to take exceeds the byte length left in the BufferView.\nBufferView.byteLength: ${this.byteLength}, BufferView.takenSizeInByte: ${this.__takenByte}, Accessor.byteStride: ${a}, Accessor.count: ${n};\nbyteSizeToTake: ${h*n}, the byte length left in the Buffer: ${this.byteLength-this.__takenByte}`;return new o.UG({message:e,error:void 0})}const u=new i.U({bufferView:this,byteOffsetInBufferView:_,compositionType:e,componentType:t,byteStride:a,count:n,raw:this.__raw,max:r,min:s,arrayLength:l,normalized:c});return this.__accessors.push(u),this.__takenByte+=h*n,new o.Ok(u)}__takeAccessorInnerWithByteOffset({compositionType:e,componentType:t,count:n,byteStride:a,byteOffsetInBufferView:r,max:s,min:l,normalized:c}){if(this.__takenByte+a*(n-1)+t.getSizeInBytes()*e.getNumberOfComponents()>this.byteLength){const e=`The size of the Accessor you are trying to take exceeds the byte length left in the BufferView.\nBufferView.byteLength: ${this.byteLength}, BufferView.takenSizeInByte: ${this.__takenByte}, Accessor.byteStride: ${a}, Accessor.count: ${n};\nbyteSizeToTake: ${a*n}, the byte length left in the Buffer: ${this.byteLength-this.__takenByte}`;return new o.UG({message:e,error:void 0})}const _=new i.U({bufferView:this,byteOffsetInBufferView:r,compositionType:e,componentType:t,byteStride:a,count:n,raw:this.__raw,max:s,min:l,arrayLength:1,normalized:c});return this.__accessors.push(_),new o.Ok(_)}isSame(e){return this.byteLength===e.byteLength&&this.byteOffsetInRawArrayBufferOfBuffer===e.byteOffsetInRawArrayBufferOfBuffer&&this.defaultByteStride===e.defaultByteStride&&this.buffer.getArrayBuffer()===e.buffer.getArrayBuffer()}}},3449:(e,t,n)=>{n.d(t,{j:()=>a});var i=n(3738),o=n(4252);class a{static isNode(){return void 0===window&&"undefined"!=typeof process&&!0}static btoa(e){if(a.isNode()){let t;return t=Buffer.isBuffer(e)?e:Buffer.from(e.toString(),"binary"),t.toString("base64")}return btoa(e)}static atob(e){return a.isNode()?Buffer.from(e,"base64").toString("binary"):atob(e)}static dataUriToArrayBuffer(e){const t=e.split(","),n=a.atob(t[1]),i=n.length,o=new ArrayBuffer(i),r=new Uint8Array(o);for(let e=0;e{if(a.isNode());else{const a=new XMLHttpRequest;t?(a.onload=e=>{let i=null;i=t?a.response:a.responseText,n(o,i)},a.open("GET",e,!0),a.responseType="arraybuffer"):(a.onreadystatechange=()=>{if(4!==a.readyState||2!==Math.floor(a.status/100)&&0!==a.status)i&&i(r,a.status);else{let e=null;e=t?a.response:a.responseText,n(o,e)}},a.open("GET",e,!0)),a.send(null)}}))}static toCRC32(e){let t=0,n=0,i=0;const o=a.crc32table;t^=-1;for(let a=0,r=e.length;a>>8^n;return(-1^t)>>>0}static accessBinaryAsImage(e,t,n,i){const o=this.takeBufferViewAsUint8Array(t,e,n);return this.accessArrayBufferAsImage(o,i)}static createBlobImageUriFromUint8Array(e,t){const n=new Blob([e],{type:t});return URL.createObjectURL(n)}static takeBufferViewAsUint8Array(e,t,n){var i;const o=e.bufferViews[t];let a=null!==(i=o.byteOffset)&&void 0!==i?i:0;const r=o.byteLength;let s=n;return n instanceof Uint8Array&&(s=n.buffer,a+=n.byteOffset),new Uint8Array(s,a,r)}static accessArrayBufferAsImage(e,t){const n=this.uint8ArrayToStringInner(new Uint8Array(e));return this.getImageType(t)+a.btoa(n)}static uint8ArrayToStringInner(e){const t=new Array(e.byteLength);for(let n=0;n{const i=new Image;if(i.crossOrigin="Anonymous",e.match(/^blob:/)||e.match(/^data:/))i.onload=()=>{n(i)},i.src=e;else{const o=(e,i)=>{const o=new Uint8Array(i),r=a.createBlobImageUriFromUint8Array(o,t);e.onload=()=>{n(e),URL.revokeObjectURL(r)},e.src=r};(()=>{const t=new XMLHttpRequest;var n;t.onreadystatechange=(n=i,function(){4===t.readyState&&200===t.status&&o(n,t.response)}),t.open("GET",e),t.responseType="arraybuffer",t.send()})()}}))}static createDefaultGltfOptions(){return{files:{},loaderExtension:void 0,defaultMaterialHelperName:void 0,defaultMaterialHelperArgumentArray:[],statesOfElements:[{targets:[],states:{enable:[],functions:{}},isTransparent:!0,opacity:1,isTextureImageToLoadPreMultipliedAlpha:!1}],tangentCalculationMode:1,extendedJson:void 0,__importedType:"undefined"}}static async fetchArrayBuffer(e){try{const t=await fetch(e,{mode:"cors"}),n=await t.arrayBuffer();return new i.Ok(n)}catch(t){return new i.UG({message:`fetchArrayBuffer failed. uri: ${e}`,error:t})}}static getResizedCanvas(e,t){const n=document.createElement("canvas"),i=this.getNearestPowerOfTwo(e.width),o=this.getNearestPowerOfTwo(e.height),a=o/i;let r=0,s=0;return i>o?(r=Math.min(i,t),s=r*a):(s=Math.min(o,t),r=s/a),n.width=r,n.height=s,n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,r,s),[n,r,s]}static detectTransparentPixelExistence(e,t=1){const n=e.width,i=e.height;let o,a;e instanceof ImageData?a=e:e instanceof HTMLImageElement?(o=document.createElement("canvas").getContext("2d"),o.drawImage(e,0,0),a=o.getImageData(0,0,n,i)):(o=e.getContext("2d"),o.drawImage(e,0,0),a=o.getImageData(0,0,n,i));for(let e=0;e{n.d(t,{Jx:()=>i,bm:()=>r,cu:()=>a,li:()=>o});class i{constructor({index:e,str:t,noCheckStrUnique:n}){if(null==i.__indices.get(this.constructor)&&i.__indices.set(this.constructor,[]),null==i.__strings.get(this.constructor)&&i.__strings.set(this.constructor,[]),-1!==i.__indices.get(this.constructor).indexOf(e))throw new Error("Dont use duplicate index.");if(!0!==n&&-1!==i.__strings.get(this.constructor).indexOf(t))throw new Error("Dont use duplicate str.");this.index=e,this.str=t,this.symbol=Symbol(t),i.__indices.get(this.constructor).push(e),i.__strings.get(this.constructor).push(t)}toString(){return this.str}toJSON(){return this.index}}function o({typeList:e,index:t}){const n=e.find((e=>e.index===t));if(n)return n}function a({typeList:e,str:t}){const n=e.find((e=>e.str.toLowerCase()===t.toLowerCase()));if(n)return n}function r({typeList:e,str:t}){const n=e.find((e=>e.str===t));if(n)return n}i.__indices=new Map,i.__strings=new Map},4690:(e,t,n)=>{n.d(t,{Is:()=>r,V:()=>i});const i={defined:(e,...t)=>void 0!==e,undefined:(e,...t)=>void 0===e,null:(e,...t)=>null===e,exist:(e,...t)=>null!=e,function:(e,...t)=>"function"==typeof e,true:(e,...t)=>!0===e,truly:(e,...t)=>!!e,false:(e,...t)=>!1===e,falsy:(e,...t)=>!e,stringContaining:(e,t)=>-1!==e.indexOf(t)},o={not:e=>function(){return e.apply(null,[...arguments])},all:e=>function(){return Array.isArray(arguments[0])?arguments[0].every(e):[...arguments].every(e)},any:e=>function(){return Array.isArray(arguments[0])?arguments[0].some(e):[...arguments].some(e)}},a={defined:(e,...t)=>void 0===e,undefined:(e,...t)=>void 0!==e,null:(e,...t)=>null!==e,exist:(e,...t)=>null==e,function:(e,...t)=>"function"!=typeof e,true:(e,...t)=>!0!==e,truly:(e,...t)=>!e,false:(e,...t)=>!1!==e,falsy:(e,...t)=>!!e};for(const e in o)if(Object.prototype.hasOwnProperty.call(o,e)){i[e]={};for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[e][t]="not"===e?o[e](a[t]):o[e](i[t]))}const r=i},6098:(e,t,n)=>{n.d(t,{$z:()=>T,CW:()=>E,Jx:()=>c,Kf:()=>S,LS:()=>f,OB:()=>l,Qj:()=>x,YU:()=>A,Zs:()=>m,_z:()=>g,bh:()=>d,dK:()=>I,eD:()=>u,fK:()=>s,fY:()=>h,j3:()=>b,kS:()=>r,t0:()=>_,tS:()=>y,vV:()=>v,wv:()=>p});var i=n(4690);const o=function(){const e=["iPod","iPad","iPhone","Android"];for(let t=0;t0)return!0;return a()},a=function(){return navigator.userAgent.indexOf("Macintosh")>-1&&"ontouchend"in document},r=({value:e,defaultValue:t})=>null==e?t:e,s=(e,t)=>!!i.Is.exist(t)&&(e(t),!0),l=(e,t)=>i.Is.exist(t)?e(t):t,c=(e,t)=>!!i.Is.exist(t)&&(e(t),!0),_=(e,t)=>i.Is.exist(t)?e(t):t,h=(e,t)=>!i.Is.undefined(t)||(e(),!1),u=(e,t)=>i.Is.undefined(t)?e():t,d=(e,t)=>{i.Is.undefined(t)&&e()},m=(e,t)=>i.Is.undefined(t)?e():t,f=(e,t)=>null==t?e:t,p=({value:e,compensation:t})=>null==e?t():e,v=e=>null==e?[]:e,A=e=>null==e?new Map:e,y=(e,t)=>e>t?{result:!0,greater:e,less:t}:{result:!1,greater:t,less:e},x=(e,t)=>e{const t=e.split(/\r\n|\r|\n/);let n="";for(let e=0;e=100&&(o=": "),n+=i+o+t[e]+"\n"}return n};function I(e){if(null==e)throw new Error(`Expected 'val' to be existed, but received ${e}`)}function b(e){return JSON.parse(JSON.stringify(e))}function E(e,t){const n=document.createElement("a");n.download=e;const i=new Blob([t],{type:"octet/stream"}),o=URL.createObjectURL(i);n.href=o;const a=new MouseEvent("click");n.dispatchEvent(a),URL.revokeObjectURL(o)}function T(e,t){const n=document.createElement("a");n.download=e;const i=new Blob([t],{type:"octet/stream"}),o=URL.createObjectURL(i);n.href=o;const a=new MouseEvent("click");n.dispatchEvent(a),URL.revokeObjectURL(o)}const S=Object.freeze({isMobileVr:function(){return/(Pacific Build.+OculusBrowser.+SamsungBrowser.+)|(SamsungBrowser)|(Mobile VR)/i.test(window.navigator.userAgent)},isMobile:o,isIOS:function(){const e=["iPod","iPad","iPhone"];for(let t=0;t0)return!0;return a()},isSafari:function(){return navigator.userAgent.indexOf("Safari")>0&&-1===navigator.userAgent.indexOf("Chrome")},preventDefaultForDesktopOnly:function(e){o()||e.preventDefault()},isObject:function(e){return e instanceof Object&&!(e instanceof Array)},fillTemplate:function(e,t){return new Function("return `"+e+"`;").call(t)},isNode:function(){return"undefined"!=typeof process&&!0},concatArrayBuffers:function(e,t,n,i){let o,a=0;for(let e=0;enull!=i&&s+e>i?s+e-i:0;let s=0;const l=(t,i)=>{const a=r(t);return a?(o.set(new Uint8Array(e[i],n[i],a),s),s+=a,!0):(o.set(new Uint8Array(e[i],n[i],t),s),s+=t,!1)},c=e=>{const t=r(e);return t?(o.set(new Uint8Array(t),s),s+=t,!0):(o.set(new Uint8Array(e),s),s+=e,!1)};for(let i=0;i0?a:0;if(l(t[i]-r,i))return o.buffer;if(r>0&&c(r))return o.buffer}return null!=i&&s{const o=new Uint8Array(new ArrayBuffer(e));let a=0;for(const e in t){const r=t[e],s=new Uint8Array(r,n[e],i[e]);o.set(s,a),a+=i[e]}return o.buffer},addLineNumberToCode:g,downloadArrayBuffer:E,downloadTypedArray:T})},6312:(e,t,n)=>{n.d(t,{Hq:()=>s,W:()=>c,Wx:()=>a,Zz:()=>l,bD:()=>r});var i=n(4690);const o="The value does not exist!";class a{constructor(e){this.value=e}set(e){this.value=e}then(e){return i.Is.exist(this.value)?e(this.value):new s}unwrapOrDefault(e){return i.Is.exist(this.value)?this.value:e}unwrapOrElse(e){return i.Is.exist(this.value)?this.value:e()}unwrapForce(){if(i.Is.exist(this.value))return this.value;throw new ReferenceError(o)}unwrapOrUndefined(){return i.Is.exist(this.value)?this.value:void 0}has(){return i.Is.exist(this.value)}doesNotHave(){return!i.Is.exist(this.value)}}class r{constructor(e){this.value=e}then(e){return e(this.value)}unwrapOrDefault(e){return this.value}unwrapOrElse(e){return this.value}unwrapForce(){return this.value}unwrapOrUndefined(){return this.value}get(){return this.value}has(){return!0}doesNotHave(){return!1}}class s{then(){return this}unwrapOrDefault(e){return e}unwrapOrElse(e){return e(void 0)}unwrapForce(){throw new ReferenceError(o)}unwrapOrUndefined(){}has(){return!1}doesNotHave(){return!0}}function l(e){if(!e.has())throw new ReferenceError(o)}function c(e){if(e.has())throw new ReferenceError(o)}},3738:(e,t,n)=>{n.d(t,{Mr:()=>c,Ok:()=>a,UD:()=>s,UG:()=>r,Z6:()=>l});var i=n(4690);class o{constructor(e){this.val=e}match(e){this instanceof a?e.Ok(this.val):this instanceof r&&e.Err(this.val),i.Is.exist(e.Finally)&&e.Finally()}name(){return this.constructor.name}}class a extends o{constructor(e){super(e)}unwrap(e){return this.val}unwrapForce(){return this.val}true(){return!0}isOk(){return!0}isErr(){return!1}get(){return this.val}}class r extends o{constructor(e){super(e),this.__rnException=new c(this.val)}unwrap(e){e(this.val)}unwrapForce(){throw this.__rnException}false(){return!1}isOk(){return!1}isErr(){return!0}getRnError(){return this.val}toString(){return this.__rnException.stack}}function s(e){if(e.isErr())throw new Error("This is Err. No Ok.")}function l(e){if(e.isOk())throw new Error("This is Ok. No Err.")}class c extends Error{constructor(e){super(`\n message: ${e.message}\n error: ${e.error instanceof r?"see below Exception ↓"+e.error:e.error}\n`),this.err=e,this.name=c._prefix}getRnError(){return this.err}}c._prefix="\nRhodonite Exception"},4252:(e,t,n)=>{n.d(t,{n:()=>i});class i extends Promise{constructor(e){super(((e,t)=>{})),this.name="",this.__callbackObj={promiseAllNum:0,resolvedNum:0,rejectedNum:0,pendingNum:0,processedPromises:[]},this.__promise=e instanceof Promise?e:new Promise(e)}static resolve(e){if(e instanceof Promise)return new i(e);if(e instanceof i)return e;if(null!=e.then){const t=new i(((t,n)=>{t(e)}));return t.then=e.then,t}return new i(((t,n)=>{t(e)}))}static all(e,t){if(t){const n=[],o={promiseAllNum:e.length,resolvedNum:0,rejectedNum:0,pendingNum:e.length,processedPromises:[]};for(const a of e){const e=i.resolve(a);e.__callback=t,e.__callbackObj=o,n.push(e)}return new i(Promise.all(n))}return new i(Promise.all(e))}static race(e){return new i(Promise.race(e))}then(e,t){let n;return e&&(n=t=>(0!==this.__callbackObj.promiseAllNum&&-1===this.__callbackObj.processedPromises.indexOf(this)&&(this.__callbackObj.pendingNum--,this.__callbackObj.resolvedNum++,this.__callbackObj.processedPromises.push(this)),this.__callback&&this.__callback(this.__callbackObj),e(t))),this.__promise.then(n,t)}catch(e){return new i(this.__promise.catch(e))}finally(e){return this.__promise.finally(e)}static reject(e){return new i(Promise.reject(e))}}},3581:(e,t,n)=>{n.d(t,{q:()=>i});class i{static _processBegin(){0===i.__currentProcessBeginTime&&(i.__systemStartTime=performance.now()),i.__currentProcessBeginTime=performance.now()}static _processEnd(){i.__lastProcessEndTime=performance.now(),i.__lastTickTimeInterval=i.__lastProcessEndTime-i.__currentProcessBeginTime}static get timeFromSystemStart(){return i.__systemStartTime-performance.now()/1e3}static get lastTickTimeInterval(){return i.__lastTickTimeInterval/1e3}}i.__currentProcessBeginTime=0,i.__lastProcessEndTime=0,i.__lastTickTimeInterval=0,i.__systemStartTime=0},2852:(e,t,n)=>{n.d(t,{Bx:()=>r,Lq:()=>s,lI:()=>a});var i=n(4690);const o="The value does not exist!";class a{constructor(){this.__weakMap=new WeakMap}set(e,t){this.__weakMap.set(e,t)}unwrapOrDefault(e,t){const n=this.__weakMap.get(e);return i.Is.exist(n)?n:t}unwrapOrElse(e,t){const n=this.__weakMap.get(e);return i.Is.exist(n)?n:t()}unwrapForce(e){const t=this.__weakMap.get(e);if(i.Is.exist(t))return t;throw new ReferenceError(o)}unwrapOrUndefined(e){return this.__weakMap.get(e)}has(e){return this.__weakMap.has(e)}}class r{constructor(e,t){this.__weakMap=new WeakMap,this.__weakMap.set(e,t)}unwrapOrDefault(e,t){return this.__weakMap.get(e)}unwrapOrElse(e,t){return this.__weakMap.get(e)}unwrapForce(e){return this.__weakMap.get(e)}get(e){return this.__weakMap.get(e)}unwrapOrUndefined(e){return this.__weakMap.get(e)}has(e){return!0}}class s{then(){return this}unwrapOrDefault(e,t){return t}unwrapOrElse(e,t){return t(void 0)}unwrapForce(e){throw new ReferenceError(o)}unwrapOrUndefined(e){}has(){return!1}}},2253:(e,t,n)=>{n.d(t,{Ct:()=>a,j4:()=>l.j,Jx:()=>c.Jx,UG:()=>C.UG,Lk:()=>E,Is:()=>i.Is,V5:()=>i.V,Kf:()=>T.Kf,Hq:()=>S.Hq,Ok:()=>C.Ok,Wx:()=>S.Wx,Mr:()=>C.Mr,ni:()=>w.n,bD:()=>S.bD,bs:()=>o,qp:()=>R.q,Lq:()=>P.Lq,lI:()=>P.lI,Bx:()=>P.Bx,li:()=>c.li,cu:()=>c.cu,bm:()=>c.bm,_z:()=>T._z,W:()=>S.W,dK:()=>T.dK,Zz:()=>S.Zz,Z6:()=>C.Z6,UD:()=>C.UD,U2:()=>b,AB:()=>I,j3:()=>T.j3,LS:()=>T.LS,CW:()=>T.CW,$z:()=>T.$z,tS:()=>T.tS,WF:()=>T.Jx,t0:()=>T.t0,fK:()=>T.fK,OB:()=>T.OB,bh:()=>T.bh,Zs:()=>T.Zs,fY:()=>T.fY,eD:()=>T.eD,Qj:()=>T.Qj,vV:()=>T.vV,YU:()=>T.YU,oz:()=>r,EY:()=>s,wv:()=>T.wv,kS:()=>T.kS});var i=n(4690);class o{constructor(){this.__weakMap=new WeakMap}set(e,t){return!this.__weakMap.has(e)&&(this.__weakMap.set(e,t),!0)}has(e){return!!this.__weakMap.has(e)}get(e){const t=this.__weakMap.get(e);if(!i.Is.not.exist(t))return this.__weakMap.get(e)}delete(e){return!!this.__weakMap.has(e)&&(this.__weakMap.delete(e),!0)}}class a{constructor(){this.__symbolWeakMap=new o}register(e){this.__symbolWeakMap.set(Symbol(),e)}}const r=e=>{const t=new WeakMap;return n=>{if(t.has(n))return t.get(n);const i=e(n);return t.set(n,i),i}},s=e=>{const t=new Map;return n=>{if(t.has(n))return t.get(n);const i=e(n);return t.set(n,i),i}};var l=n(3449),c=n(2343),_=n(2471),h=n(2566),u=n(3032),d=n(9190),m=n(1162),f=n(8182),p=n(9849);function v(e,t,n){const i=1<e.valuet.value?1:0));for(let e=0;eet?1:0));for(let e=0;e{n.d(t,{q:()=>r});var i=n(4020),o=n(2471),a=n(4690);class r{constructor(){if(this.__localScale=o.P.one(),a.Is.not.exist(r.__world)){const e=new OIMO.World({timestep:1/60,iterations:8,broadphase:2,worldscale:1,random:r.__worldProperty.random,info:!1,gravity:[r.__worldProperty.gravity.x,r.__worldProperty.gravity.y,r.__worldProperty.gravity.z]});r.__world=e}}setShape(e,t){const n=r.__world;this.__localScale=e.size,this.__property={type:e.type.str.toLowerCase(),size:[e.size.x,e.size.y,e.size.z],pos:[e.position.x,e.position.y,e.position.z],rot:[e.rotation.x,e.rotation.y,e.rotation.z],move:e.move,density:e.density,friction:e.friction,restitution:e.restitution},this.__body=n.add(this.__property),this.__entity=t}update(){if(void 0===this.__entity)return;const e=this.__body.getPosition(),t=this.__body.getQuaternion();this.__entity.getSceneGraph().setPositionWithoutPhysics(o.P.fromCopy3(e.x,e.y,e.z)),this.__entity.getSceneGraph().setRotationWithoutPhysics(i._f.fromCopy4(t.x,t.y,t.z,t.w))}setPosition(e){const t=r.__world;if(void 0===this.__entity)return;this.__body.remove();const n=this.__property;this.__property={type:n.type,size:[n.size[0],n.size[1],n.size[2]],pos:[e.x,e.y,e.z],rot:[this.__entity.eulerAngles.x,this.__entity.eulerAngles.y,this.__entity.eulerAngles.z],move:n.move,density:n.density,friction:n.friction,restitution:n.restitution},this.__body=t.add(this.__property)}setEulerAngle(e){const t=r.__world;if(void 0===this.__entity)return;const n=this.__body.getPosition();this.__body.remove();const o=this.__property;this.__property={type:o.type,size:[o.size[0],o.size[1],o.size[2]],pos:[n.x,n.y,n.z],rot:[i.kj.radianToDegree(e.x),i.kj.radianToDegree(e.y),i.kj.radianToDegree(e.z)],move:o.move,density:o.density,friction:o.friction,restitution:o.restitution},this.__body=t.add(this.__property)}setScale(e){const t=r.__world;if(void 0===this.__entity)return;const n=this.__body.getPosition();this.__body.remove();const i=this.__property;this.__property={type:i.type,size:[this.__localScale.x*e.x,this.__localScale.y*e.y,this.__localScale.z*e.z],pos:[n.x,n.y,n.z],rot:[this.__entity.eulerAngles.x,this.__entity.eulerAngles.y,this.__entity.eulerAngles.z],move:i.move,density:i.density,friction:i.friction,restitution:i.restitution},this.__body=t.add(this.__property)}static update(){a.Is.exist(r.__world)&&r.__world.step()}}r.__worldProperty={gravity:o.P.fromCopy3(0,-9.8,0),random:!0}},7987:(e,t,n)=>{n.d(t,{F:()=>r});var i=n(2251),o=n(8430),a=n(1296);class r{static getCgApiResourceRepository(){const e=a.V7.isWebGL2Approach(o.l.currentProcessApproach)?"webgl":"webgpu",t=i.x.getInstance().getModule(e);return"webgl"===e?t.WebGLResourceRepository.getInstance():t.WebGpuResourceRepository.getInstance()}static getWebGLResourceRepository(){return i.x.getInstance().getModule("webgl").WebGLResourceRepository.getInstance()}}r.InvalidCGAPIResourceUid=-1},8206:(e,t,n)=>{n.d(t,{A:()=>o});var i=n(9002);class o extends i.S{constructor(){super(),this.__renderPasses=[]}clone(){const e=new o,t=[];for(const e of this.__renderPasses)t.push(e.clone());return e.addRenderPasses(t),e}addRenderPasses(e){for(const t of e)this.__renderPasses.push(t)}clearRenderPasses(){this.__renderPasses.length=0}get renderPasses(){return this.__renderPasses}setViewport(e){for(const t of this.__renderPasses)t.setViewport(e)}}},3981:(e,t,n)=>{n.d(t,{R:()=>a});var i=n(9002),o=n(4690);class a extends i.S{constructor(){super(),this.__expressions=[],this.__expressionQueries=[]}addExpression(e,{inputRenderPasses:t,outputs:n}={inputRenderPasses:[],outputs:[]}){if(o.Is.exist(n))for(const t of n){let n=t.renderPass.instance;o.Is.exist(t.renderPass.instance)?n=t.renderPass.instance:o.Is.exist(t.renderPass.index)?n=e.renderPasses[t.renderPass.index]:o.Is.exist(t.renderPass.uniqueName)&&(n=i.S.getRnObjectByName(t.renderPass.uniqueName)),o.Is.exist(n)&&n.setFramebuffer(t.frameBuffer)}this.__expressions.push({expression:e,inputRenderPasses:o.Is.exist(t)?t:[]})}getColorAttachmentFromInputOf(e,t={renderPass:{index:0},colorAttachmentIndex:0,framebufferType:a.FrameBuffer}){return new Promise((n=>{const i=function*(){const e=yield;return n(e),e}();this.__expressionQueries.push([e,t.renderPass,t.colorAttachmentIndex,i,t.framebufferType])}))}resolve(){for(const[e,t,n,a,r]of this.__expressionQueries)for(const s of this.__expressions)if(e===s.expression){let e,l=t.instance;if(o.Is.exist(t.instance)?l=t.instance:o.Is.exist(t.index)?l=s.inputRenderPasses[t.index]:o.Is.exist(t.uniqueName)&&(l=i.S.getRnObjectByName(t.uniqueName)),"ResolveFrameBuffer2"===r?e=l.getResolveFramebuffer2():"ResolveFrameBuffer"===r?e=l.getResolveFramebuffer():"FrameBuffer"===r&&(e=l.getFramebuffer()),o.Is.exist(e)){const t=e.getColorAttachedRenderTargetTexture(n);o.Is.exist(t)&&(a.next(t),a.next(t))}}}clearExpressions(){this.__expressions.length=0}get expressions(){return this.__expressions.map((e=>e.expression))}setViewport(e){for(const t of this.__expressions)t.expression.setViewport(e)}}a.FrameBuffer="FrameBuffer",a.ResolveFrameBuffer="ResolveFrameBuffer",a.ResolveFrameBuffer2="ResolveFrameBuffer2"},4512:(e,t,n)=>{n.d(t,{C:()=>h});var i=n(9002),o=n(8491),a=n(7192),r=n(2251),s=n(3952),l=n(4536),c=n(4710),_=n(8430);class h extends i.S{constructor(){super(),this.__entities=[],this.__sceneGraphDirectlyAdded=[],this.__topLevelSceneGraphComponents=[],this.toClearColorBuffer=!1,this.toClearDepthBuffer=!0,this.toClearStencilBuffer=!1,this.isDepthTest=!0,this.clearColor=a.Lt.fromCopyArray([1,1,1,1]),this.clearDepth=1,this.clearStencil=0,this.cullFrontFaceCCW=!0,this.__primitiveMaterial=new Map,this.isVrRendering=!0,this.isOutputForVr=!1,this.toRenderOpaquePrimitives=!0,this.toRenderTransparentPrimitives=!0,this.toRenderEffekseerEffects=!1,this.drawCount=1,this.__renderPassUID=++h.__mesh_uid_count}clone(){var e,t,n,i;const o=new h;return o.__entities=this.__entities.concat(),o.__sceneGraphDirectlyAdded=this.__sceneGraphDirectlyAdded.concat(),o.__topLevelSceneGraphComponents=null===(e=this.__topLevelSceneGraphComponents)||void 0===e?void 0:e.concat(),o.__meshComponents=null===(t=this.__meshComponents)||void 0===t?void 0:t.concat(),o.__frameBuffer=this.__frameBuffer,o.__resolveFrameBuffer=this.__resolveFrameBuffer,o.__resolveFrameBuffer2=this.__resolveFrameBuffer2,o.__viewport=null===(n=this.__viewport)||void 0===n?void 0:n.clone(),o.toClearColorBuffer=this.toClearColorBuffer,o.toClearDepthBuffer=this.toClearDepthBuffer,o.toClearStencilBuffer=this.toClearStencilBuffer,o.isDepthTest=this.isDepthTest,o.clearColor=this.clearColor.clone(),o.clearDepth=this.clearDepth,o.clearStencil=this.clearStencil,o.cameraComponent=this.cameraComponent,o.cullFrontFaceCCW=this.cullFrontFaceCCW,o.__material=this.__material,o.__primitiveMaterial=new Map(this.__primitiveMaterial),o.__webglRenderingStrategy=this.__webglRenderingStrategy,o.isVrRendering=this.isVrRendering,o.isOutputForVr=this.isOutputForVr,o.toRenderOpaquePrimitives=this.toRenderOpaquePrimitives,o.toRenderTransparentPrimitives=this.toRenderTransparentPrimitives,o.__preEachDrawFunc=this.__preEachDrawFunc,o.__postEachRenderFunc=this.__postEachRenderFunc,o.__renderTargetColorAttachments=null===(i=this.__renderTargetColorAttachments)||void 0===i?void 0:i.concat(),o}setPreDrawFunction(e){this.__preEachDrawFunc=e}unsetPreDrawFunction(){this.__preEachDrawFunc=void 0}doPreEachDraw(e){null!=this.__preEachDrawFunc&&this.__preEachDrawFunc(e)}setPostRenderFunction(e){this.__postEachRenderFunc=e}doPostRender(){null!=this.__postEachRenderFunc&&this.__postEachRenderFunc()}addEntities(e){for(const t of e){const e=t.getSceneGraph();this.__sceneGraphDirectlyAdded.push(e);const n=o.a.flattenHierarchy(e,!1).map((e=>e.entity)),i=this.__entities.concat(n).reduce(((e,t)=>(e.set(t.entityUID,t),e)),new Map);this.__entities=Array.from(i.values())}this.__meshComponents=void 0,this.__topLevelSceneGraphComponents=void 0,this.__collectMeshComponents(),this.__collectTopLevelSceneGraphComponents()}get entities(){return this.__entities}clearEntities(){this.__meshComponents=void 0,this.__topLevelSceneGraphComponents=void 0,this.__entities=[]}__collectTopLevelSceneGraphComponents(){if(null==this.__topLevelSceneGraphComponents){const e=t=>(t.parent&&e(t.parent),t);this.__topLevelSceneGraphComponents=this.__sceneGraphDirectlyAdded.map((t=>e(t)));const t=new Set(this.__topLevelSceneGraphComponents);this.__topLevelSceneGraphComponents=Array.from(t)}}__collectMeshComponents(){null==this.__meshComponents&&(this.__meshComponents=[],this.__entities.filter((e=>{const t=e.getComponentByComponentTID(c.z.MeshComponentTID);t&&this.__meshComponents.push(t)})))}get meshComponents(){var e;return null!==(e=this.__meshComponents)&&void 0!==e?e:[]}get sceneTopLevelGraphComponents(){return null!=this.__topLevelSceneGraphComponents?this.__topLevelSceneGraphComponents:[]}setFramebuffer(e){this.__frameBuffer=e,null!=e?this.setViewport(a.Lt.fromCopyArray([0,0,e.width,e.height])):this.__viewport=void 0}setRenderTargetColorAttachments(e){this.__renderTargetColorAttachments=e}getRenderTargetColorAttachments(){return this.__renderTargetColorAttachments}getFramebuffer(){return this.__frameBuffer}removeFramebuffer(){this.__frameBuffer=void 0}setViewport(e){null!=this.__viewport?this.__viewport.copyComponents(e):this.__viewport=l.xQ.fromCopyArray([e.x,e.y,e.z,e.w])}getViewport(){let e=this.__viewport;return null!=e&&(e=h.__tmp_Vector4_0.copyComponents(e)),e}setResolveFramebuffer(e){const t=s.x.getInstance().currentWebGLContextWrapper;t&&t.isWebGL2?this.__resolveFrameBuffer=e:console.error("resolve framebuffer is unavailable in this webgl context")}getResolveFramebuffer(){return this.__resolveFrameBuffer}setResolveFramebuffer2(e){const t=s.x.getInstance().currentWebGLContextWrapper;t&&t.isWebGL2?this.__resolveFrameBuffer2=e:console.error("resolve framebuffer is unavailable in this webgl context")}getResolveFramebuffer2(){return this.__resolveFrameBuffer2}_copyFramebufferToResolveFramebuffers(){this.__copyFramebufferToResolveFramebufferInner(this.__resolveFrameBuffer),this.__copyFramebufferToResolveFramebufferInner(this.__resolveFrameBuffer2)}__copyFramebufferToResolveFramebufferInner(e){if(null==e)return;const t=s.x.getInstance(),n=t.getWebGLResource(this.__frameBuffer.cgApiResourceUid),i=t.getWebGLResource(e.cgApiResourceUid),o=t.currentWebGLContextWrapper.getRawContextAsWebGL2();o.bindFramebuffer(o.READ_FRAMEBUFFER,n),o.bindFramebuffer(o.DRAW_FRAMEBUFFER,i),o.blitFramebuffer(0,0,this.__frameBuffer.width,this.__frameBuffer.height,0,0,e.width,e.height,o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT,o.NEAREST),o.bindFramebuffer(o.READ_FRAMEBUFFER,null),o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null)}__setupMaterial(e){e.isEmptyMaterial()||this.__setWebglRenderingStrategyIfNotYet(this.__webglRenderingStrategy).setupShaderForMaterial(e)}setMaterialForPrimitive(e,t){this.__primitiveMaterial.set(t,e),this.__setupMaterial(e)}setMaterial(e){this.__material=e,this.__setupMaterial(e)}get material(){return this.__material}__setWebglRenderingStrategyIfNotYet(e){if(null!=e)return e;const t=_.l.currentProcessApproach,n=r.x.getInstance().getModule("webgl").getRenderingStrategy(t);return this.__webglRenderingStrategy=n,n}__getMaterialOf(e){return this.__primitiveMaterial.get(e)}__hasMaterialOf(e){return this.__primitiveMaterial.has(e)}getAppropriateMaterial(e){let t;return t=this.__hasMaterialOf(e)?this.__getMaterialOf(e):null!=this.material?this.material:e.material,t}get renderPassUID(){return this.__renderPassUID}}h.__tmp_Vector4_0=l.xQ.zero(),h.__mesh_uid_count=-1},4327:(e,t,n)=>{n.d(t,{Pj:()=>c,iC:()=>l,ls:()=>s});var i=n(7683),o=n(4690),a=n(8430),r=n(7987);function s(e){return!(!e.isEmptyMaterial()&&-1!==e._shaderProgramUid)}function l(e){if(e.mesh._variationVBOUid!==r.F.InvalidCGAPIResourceUid){const t=e.mesh.getPrimitiveNumber();let n=0;for(let i=0;i{n.d(t,{U:()=>a});var i=n(4690),o=n(6098);class a{constructor(){this.__subscriberMap=new Map}subscribe(e,t){let n=this.__subscriberMap.get(e);return i.Is.not.exist(n)&&(this.__subscriberMap.set(e,[]),n=this.__subscriberMap.get(e)),n.push(t)-1}unsubscribe(e,t){const n=this.__subscriberMap.get(e);null!=n&&n.splice(t,1)}unsubscribeAll(e){this.__subscriberMap.delete(e)}publishAsync(e,t){let n=0;const i=(0,o.vV)(this.__subscriberMap.get(e));for(const e of i)setTimeout(e.bind(this,t),0),n++;return n}publishSync(e,t){let n=0;const i=(0,o.vV)(this.__subscriberMap.get(e));for(const e of i)e(t),n++;return n}}},4742:(e,t,n)=>{n.d(t,{$t:()=>j,Cf:()=>E,EY:()=>Q,K2:()=>H,KA:()=>k,KP:()=>U,KQ:()=>q,Lf:()=>h,RO:()=>y,Ry:()=>b,Rz:()=>w,SG:()=>C,Ss:()=>s,Tr:()=>W,UB:()=>T,VS:()=>z,Yw:()=>R,_6:()=>v,_Q:()=>u,ad:()=>O,ak:()=>l,cA:()=>A,cE:()=>g,cG:()=>r,cS:()=>f,fA:()=>x,hD:()=>S,hd:()=>B,jO:()=>X,jP:()=>V,jX:()=>F,k$:()=>d,k4:()=>a,lO:()=>m,lc:()=>I,lv:()=>M,n9:()=>c,oM:()=>P,p2:()=>G,pt:()=>D,q7:()=>p,us:()=>L,vE:()=>_,yy:()=>N,zU:()=>o});var i=n(4690);const o="mousedown",a="mousemove",r="mouseup",s="wheel",l="mouseenter",c="mouseleave",_="mouseover",h="click",u="keydown",d="keyup",m="keypress",f="pointerdown",p="MSPointerDown",v="pointermove",A="MSPointerMove",y="pointerup",x="MSPointerUp",g="pointercancel",I="pointerenter",b="pointerleave",E="pointerover",T="pointerout",S="resize",C="orientationchange",w="tap",R="doubletap",P="longtap",M="hold",D="drag",N="swipe",B="pinch",L="touchstart",F="touchmove",G="touchend",z="touchcancel",V="touchenter",O="touchleave",U="touchover",k="touchout";function Q(e){const t=void 0!==document.ontouchstart,n=window.navigator.pointerEnabled,i=window.navigator.msPointerEnabled;return{start:n?f:i?p:t?L:o,move:n?v:i?A:t?F:a,end:n?y:i?x:t?G:r,click:h}[e]}const W="None",X="CameraController",q="GizmoTranslation",H="GizmoScale";class j{static register(e,t){this.__inputHandlingStateMap.set(e,t),this.__activeMap.set(e,!0),this.__processEventListeners()}static unregister(e){this.__activeMap.set(e,!1),this.__inputHandlingStateMap.delete(e),this.__processEventListeners()}static setActive(e,t){this.__activeMap.set(e,t),e===q&&t?this.__activeMap.set(H,!1):e===H&&t&&this.__activeMap.set(q,!1),this.__processEventListeners()}static __addEventListeners(e){const t=j.__inputHandlingStateMap.get(e);if(i.Is.exist(t))for(const e of t)e.eventTargetDom.addEventListener(e.eventName,e.handler,e.options)}static __removeEventListeners(e){const t=j.__inputHandlingStateMap.get(e);if(i.Is.exist(t))for(const e of t)e.eventTargetDom.removeEventListener(e.eventName,e.handler,e.options)}static __processEventListeners(){const e=j.__inputHandlingStateMap.get(q),t=j.__inputHandlingStateMap.get(H);j.__inputHandlingStateMap.get(X)&&(this.__addEventListeners(X),this.__currentState=X),e&&(this.__addEventListeners(q),this.__removeEventListeners(H),this.__currentState=q),t&&(this.__addEventListeners(H),this.__removeEventListeners(q),this.__currentState=H)}static enableCameraController(){this.__addEventListeners(X),this.__activeMap.set(X,!0),this.__processEventListeners()}static disableCameraController(){this.__removeEventListeners(X),this.__activeMap.set(X,!1),this.__processEventListeners()}static getCurrentState(){return this.__currentState}}j.__inputHandlingStateMap=new Map,j.__activeMap=new Map,j.__currentState=W},2251:(e,t,n)=>{n.d(t,{x:()=>i});class i{constructor(){this.__modules=new Map}async loadModule(e,t){let i;return"webgl"===e.toLowerCase()?i=await(await Promise.resolve().then(n.bind(n,8511))).default:"webgpu"===e.toLowerCase()?i=await(await Promise.resolve().then(n.bind(n,7235))).default:"effekseer"===e.toLowerCase()?(i=await(await Promise.resolve().then(n.bind(n,3995))).Effekseer,i.EffekseerComponent.wasmModuleUri=null==t?void 0:t.wasm):"pbr"===e.toLowerCase()?i=await(await Promise.resolve().then(n.bind(n,5649))).default:"xr"===e.toLowerCase()&&(i=await(await Promise.resolve().then(n.bind(n,9131))).default),this.__modules.set(e,i),i}getModule(e){return this.__modules.get(e)}static getInstance(){return this.__instance||(this.__instance=new i),this.__instance}}},3648:(e,t,n)=>{n.d(t,{x:()=>C});var i=n(4507),o=n(2404),a=n(7683),r=n(2251),s=n(7987),l=n(9721),c=n(8206),_=n(1350),h=n(224),u=n(9286),d=n(7348),m=n(2471),f=n(9646),p=n(3581),v=n(8430),A=n(6098),y=n(4690),x=n(7973),g=n(3258),I=n(3981),b=n(7192),E=n(4512),T=n(4710),S=n(2192);class C{constructor(){}static startRenderLoop(e,...t){this.__renderLoopFunc=e,this.__args=t;const n=this.__getAnimationFrameObject();this.__animationFrameId=n.requestAnimationFrame(((n,i)=>{const o=r.x.getInstance().getModule("xr");if(y.Is.exist(o)){const e=o.WebXRSystem.getInstance();e.isReadyForWebXR&&e._preRender(n,i);const t=o.WebARSystem.getInstance();t.isReadyForWebAR&&t._preRender(n,i)}if(e.apply(e,[n,...t]),y.Is.exist(o)){const e=o.WebXRSystem.getInstance();e.isReadyForWebXR&&e._postRender();const t=o.WebARSystem.getInstance();t.isReadyForWebAR&&t._preRender(n,i)}this.startRenderLoop(e,...t)}))}static __getAnimationFrameObject(){let e=window;const t=r.x.getInstance().getModule("xr");if(y.Is.exist(t)){const n=t.WebXRSystem.getInstance(),i=t.WebARSystem.getInstance();if(n.requestedToEnterWebXR?e=n.xrSession:i.requestedToEnterWebAR&&(e=i.arSession),y.Is.not.exist(e))return window}return e}static stopRenderLoop(){this.__getAnimationFrameObject().cancelAnimationFrame(this.__animationFrameId),this.__animationFrameId=-1}static restartRenderLoop(){null!=this.__renderLoopFunc&&this.startRenderLoop(this.__renderLoopFunc,0,this.__args)}static processAuto(e=b.Lt.fromCopy4(0,0,0,1)){if(y.Is.not.exist(C.__expressionForProcessAuto)){const t=new c.A,n=new E.C;n.toClearColorBuffer=!0,n.toClearDepthBuffer=!0,n.clearColor=e;const i=new E.C;t.addRenderPasses([n,i]),C.__expressionForProcessAuto=t,C.__renderPassForProcessAuto=i}C.__renderPassForProcessAuto.clearEntities();const t=_.g._getEntities();C.__renderPassForProcessAuto.addEntities(t),this.process([C.__expressionForProcessAuto])}static process(e){if("undefined"!=typeof spector&&spector.setMarker("Rn#"),this.__processApproach===a.V.None)throw new Error("Choose a process approach first.");p.q._processBegin();let t=e;e instanceof I.R&&(t=e.expressions),h.M.current===l.w.InvalidObjectUID&&C.createCamera();const n=s.F.getWebGLResourceRepository(),c=r.x.getInstance().getModule("xr"),_=o.C.getComponentTIDs(),u=o.C.getRenderingComponentTIDs();for(const e of l.w._processStages){const r="common_"+e.methodName;if(e===i.I.Render)for(const i of t)for(const t of u){const s=o.C.getComponentClass(t),l=i.renderPasses.length;for(let o=0;o{e.preventDefault(),this.stopRenderLoop(),console.error("WebGL context lost occurred.")}).bind(this)),e.canvas.addEventListener("webglcontextrestored",(()=>{console.error("WebGL context restored."),this.restartRenderLoop()})),await(0,S.Cb)(),t}static get processApproach(){return this.__processApproach}static resizeCanvas(e,t){s.F.getCgApiResourceRepository().resizeCanvas(e,t)}static getCanvasSize(){return s.F.getWebGLResourceRepository().getCanvasSize()}static getCurrentWebGLContextWrapper(){return this.__cgApiResourceRepository.currentWebGLContextWrapper}}C.__processApproach=a.V.None,C.__renderPassTickCount=0,C.__animationFrameId=-1,C.__args=[],C.__stageMethods=new Map},8430:(e,t,n)=>{n.d(t,{l:()=>i});const i={currentProcessApproach:n(7683).V.None}},7290:(e,t,n)=>{n.d(t,{y:()=>_});var i=n(9002),o=n(9216),a=n(3999),r=n(5981),s=n(9849),l=n(810),c=n(4690);class _ extends i.S{constructor(){super(),this.__width=0,this.__height=0,this.__level=0,this.__internalFormat=r.d.RGBA8,this.__format=o.V.RGBA,this.__type=a.r.UnsignedByte,this.__hasTransparentPixels=!1,this.__isTextureReady=!1,this.__startedToLoad=!1,this.__name="untitled",this._textureResourceUid=-1,this._samplerResourceUid=-1,this.__textureUid=++_.__textureUidCount}get textureUID(){return this.__textureUid}get width(){return this.__width}set width(e){this.__width=e}get height(){return this.__height}set height(e){this.__height=e}get isTextureReady(){return this.__isTextureReady}get startedToLoad(){return this.__startedToLoad}get htmlImageElement(){return this.__htmlImageElement}get htmlCanvasElement(){const e=document.createElement("canvas"),t=null==e?void 0:e.getContext("2d");return this.__htmlCanvasElement=e,c.Is.exist(t)&&c.Is.exist(this.__htmlImageElement)&&(e.width=this.__htmlImageElement.width,e.height=this.__htmlImageElement.height,t.drawImage(this.__htmlImageElement,0,0,this.__htmlImageElement.width,this.__htmlImageElement.height)),this.__htmlCanvasElement}get uri(){return this.__uri}static getRhodoniteTexture(e){return this.__textureMap.get(e)}set name(e){this.__name=e}get name(){return this.__name}getImageData(e,t,n,i){return void 0===this.__canvasContext&&this.createInternalCanvasContext(),this.__canvasContext.getImageData(e,t,n,i)}getPixelAs(e,t,n){const i=this.getImageData(e,t,1,1).data;return n.compositionType===l.d.Vec4?new n(new Float32Array([i[0],i[1],i[2],i[3]])):new n(new Float32Array([i[0],i[1],i[2]]))}getPixelAsArray(e,t){return this.getImageData(e,t,1,1).data}setPixel(e,t,n){const i=this.getImageData(e,t,1,1),o=i.data,a=n.constructor.compositionType.getNumberOfComponents();for(let e=0;e{n.d(t,{B:()=>s});var i=n(7290),o=n(1986),a=n(7987),r=n(5981);class s extends i.y{constructor(){super(),this.mipmapLevelNumber=1,this.hdriFormat=o.c.LDR_SRGB,this.isNamePosNeg=!1}async loadTextureImages(){this.__startedToLoad=!0;const e=a.F.getWebGLResourceRepository(),[t,n]=await e.createCubeTextureFromFiles(this.baseUriToLoad,this.mipmapLevelNumber,this.isNamePosNeg,this.hdriFormat);this._recommendedTextureSampler=n,this._textureResourceUid=t,this.__isTextureReady=!0}loadTextureImagesAsync(){this.__startedToLoad=!0,a.F.getWebGLResourceRepository().createCubeTextureFromFiles(this.baseUriToLoad,this.mipmapLevelNumber,this.isNamePosNeg,this.hdriFormat).then((([e,t])=>{this._textureResourceUid=e,this._recommendedTextureSampler=t})).then((()=>{this.__isTextureReady=!0}))}loadTextureImagesFromBasis(e,{magFilter:t=r.d.Linear,minFilter:n=r.d.LinearMipmapLinear,wrapS:i=r.d.Repeat,wrapT:o=r.d.Repeat}={}){this.__startedToLoad=!0,"undefined"==typeof BASIS&&console.error("Failed to call BASIS() function. Please check to import basis_transcoder.js."),BASIS().then((r=>{const{initializeBasis:s}=r;s();const l=new(0,r.BasisFile)(e);if(!l.startTranscoding())return console.error("failed to start transcoding."),l.close(),void l.delete();const c=a.F.getWebGLResourceRepository().createCubeTextureFromBasis(l,{magFilter:t,minFilter:n,wrapS:i,wrapT:o});this._textureResourceUid=c,this.__isTextureReady=!0,l.close(),l.delete()}))}load1x1Texture(e="rgba(0,0,0,1)"){const t=document.createElement("canvas");t.width=1,t.height=1;const n=t.getContext("2d");n.fillStyle=e,n.fillRect(0,0,1,1);const i=a.F.getCgApiResourceRepository(),[o,r]=i.createCubeTexture(1,[{posX:t,negX:t,posY:t,negY:t,posZ:t,negZ:t}],1,1);this._textureResourceUid=o,this.__isTextureReady=!0}generateTextureFromTypedArrays(e,t,n){const o=a.F.getWebGLResourceRepository(),[r,s]=o.createCubeTexture(e.length,e,t,n);this._recommendedTextureSampler=s,this._textureResourceUid=r,this.__isTextureReady=!0,this.__startedToLoad=!0,i.y.__textureMap.set(this._textureResourceUid,this)}importWebGLTextureDirectly(e,t=0,n=0){this.__width=t,this.__height=n;const o=a.F.getWebGLResourceRepository().setWebGLTextureDirectly(e);this._textureResourceUid=o,this.__startedToLoad=!0,this.__isTextureReady=!0,i.y.__textureMap.set(o,this)}}},4392:(e,t,n)=>{n.d(t,{_:()=>c});var i=n(7290),o=n(5981),a=n(9216),r=n(3999),s=n(7987),l=n(7192);class c extends i.y{constructor(){super()}create({width:e,height:t,level:n=0,internalFormat:i=o.d.RGB8,format:s=a.V.RGBA,type:l=r.r.UnsignedByte}){this.__width=e,this.__height=t,this.__level=n,this.__internalFormat=i,this.__format=s,this.__type=l,this.__createRenderTargetTexture()}set _fbo(e){this.__fbo=e}get fbo(){return this.__fbo}__createRenderTargetTexture(){const e=s.F.getWebGLResourceRepository().createRenderTargetTexture({width:this.__width,height:this.__height,level:this.__level,internalFormat:this.__internalFormat,format:this.__format,type:this.__type});this._textureResourceUid=e,i.y.__textureMap.set(e,this)}resize(e,t){this.destroy3DAPIResources(),this.__width=e,this.__height=t,this.__createRenderTargetTexture()}destroy3DAPIResources(){return i.y.__textureMap.delete(this._textureResourceUid),s.F.getWebGLResourceRepository().deleteTexture(this._textureResourceUid),this._textureResourceUid=s.F.InvalidCGAPIResourceUid,!0}getTexturePixelData(){const e=s.F.getWebGLResourceRepository(),t=e.currentWebGLContextWrapper.getRawContext(),n=e.getWebGLResource(this.__fbo.framebufferUID);t.bindFramebuffer(t.FRAMEBUFFER,n);const i=new Uint8Array(this.width*this.height*4);return null!=t.readBuffer&&t.readBuffer(36064+this.__fbo.whichColorAttachment(this)),t.readPixels(0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,i),t.bindFramebuffer(t.FRAMEBUFFER,null),i}downloadTexturePixelData(){const e=this.getTexturePixelData(),t=document.createElement("canvas");t.width=this.__width,t.height=this.__height;const n=t.getContext("2d"),i=new ImageData(new Uint8ClampedArray(e.buffer),this.__width,this.__height);n.putImageData(i,this.__width,this.__height);const o=t.toDataURL("image/png"),a=document.createElement("a"),r=document.createEvent("MouseEvent");a.href=o,a.download="texture.png",r.initEvent("click",!0,!0),a.dispatchEvent(r)}getPixelValueAt(e,t,n){let i=n;return i||(i=this.getTexturePixelData()),l.Lt.fromCopyArray([i[4*(t*this.width+e)+0],i[4*(t*this.width+e)+1],i[4*(t*this.width+e)+2],i[4*(t*this.width+e)+3]])}generateMipmap(){const e=s.F.getWebGLResourceRepository(),t=e.currentWebGLContextWrapper.getRawContext(),n=e.getWebGLResource(this._textureResourceUid);t.bindTexture(t.TEXTURE_2D,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)}}},580:(e,t,n)=>{n.d(t,{Z:()=>a});var i=n(1296),o=n(7987);class a{constructor(e){var t,n;this.__samplerResourceUid=-1,this.__minFilter=e.minFilter,this.__magFilter=e.magFilter,this.__wrapS=e.wrapS,this.__wrapT=e.wrapT,this.__wrapR=null!==(t=e.wrapR)&&void 0!==t?t:i.dI.Repeat,this.__anisotropy=null===(n=e.anisotropy)||void 0===n||n}create(){const e=o.F.getCgApiResourceRepository();this.__samplerResourceUid=e.createTextureSampler({minFilter:this.__minFilter,magFilter:this.__magFilter,wrapS:this.__wrapS,wrapT:this.__wrapT,wrapR:this.__wrapR,anisotropy:this.__anisotropy})}get created(){return-1!==this.__samplerResourceUid}get minFilter(){return this.__minFilter}get magFilter(){return this.__magFilter}get wrapS(){return this.__wrapS}get wrapT(){return this.__wrapT}get wrapR(){return this.__wrapR}get _samplerResourceUid(){return this.__samplerResourceUid}}},2575:(e,t,n)=>{n.d(t,{x:()=>u});var i=n(9216),o=n(3999),a=n(5981),r=n(7290),s=n(7987),l=n(3258),c=n(3449),_=n(3667),h=n(2251);class u extends r.y{constructor(){super(),this.autoResize=!0,this.autoDetectTransparency=!1}get hasDataToLoadLazy(){return null!=this.__uriToLoadLazy||null!=this.__imgToLoadLazy}generateTextureFromBasis(e,t){var n;this.__startedToLoad=!0,"undefined"==typeof BASIS&&console.error("Failed to call BASIS() function. Please check to import basis_transcoder.js."),u.__loadedBasisFunc?u.__BasisFile?this.__setBasisTexture(e,t):null===(n=u.__basisLoadPromise)||void 0===n||n.then((()=>{this.__setBasisTexture(e,t)})):(u.__loadedBasisFunc=!0,u.__basisLoadPromise=new Promise((n=>{BASIS().then((i=>{const{initializeBasis:o}=i;o(),u.__BasisFile=i.BasisFile,this.__setBasisTexture(e,t),n()}))})))}__setBasisTexture(e,{level:t=0,internalFormat:n=a.d.RGBA8,format:l=i.V.RGBA,type:c=o.r.UnsignedByte,generateMipmap:_=!0}={}){this.__startedToLoad=!0;const h=new u.__BasisFile(e);if(!h.startTranscoding())return console.error("failed to start transcoding."),h.close(),void h.delete();const d=s.F.getWebGLResourceRepository().createCompressedTextureFromBasis(h,{border:0,format:l,type:c});this._textureResourceUid=d,this.__isTextureReady=!0,r.y.__textureMap.set(d,this),h.close(),h.delete()}async generateTextureFromKTX2(e){this.__startedToLoad=!0;const t=await _.N.getInstance().transcode(e);this.__width=t.width,this.__height=t.height,this.generateCompressedTextureWithMipmapFromTypedArray(t.mipmapData,t.compressionTextureType)}generateTextureFromImage(e,{level:t=0,internalFormat:n=a.d.RGBA8,format:r=i.V.RGBA,type:s=o.r.UnsignedByte,generateMipmap:l=!0}={}){this.__imgToLoadLazy=e,this.__optionsToLoadLazy={level:t,internalFormat:n,format:r,type:s,generateMipmap:l}}async loadFromImgLazy(){var e,t,n,_,h,u,d,m,f,p;if(null==this.__imgToLoadLazy)return;const v=this.__imgToLoadLazy,A=null!==(t=null===(e=this.__optionsToLoadLazy)||void 0===e?void 0:e.level)&&void 0!==t?t:0,y=null!==(_=null===(n=this.__optionsToLoadLazy)||void 0===n?void 0:n.internalFormat)&&void 0!==_?_:a.d.RGBA8,x=null!==(u=null===(h=this.__optionsToLoadLazy)||void 0===h?void 0:h.format)&&void 0!==u?u:i.V.RGBA,g=null!==(m=null===(d=this.__optionsToLoadLazy)||void 0===d?void 0:d.type)&&void 0!==m?m:o.r.UnsignedByte,I=null===(p=null===(f=this.__optionsToLoadLazy)||void 0===f?void 0:f.generateMipmap)||void 0===p||p;this.__startedToLoad=!0,this.__htmlImageElement=v;let b=v;if(this.autoResize){const[e,t,n]=c.j.getResizedCanvas(b,l.D.maxSizeLimitOfNonCompressedTexture);b=e,this.__width=t,this.__height=n,this.__htmlCanvasElement=e}this.autoDetectTransparency&&(this.__hasTransparentPixels=c.j.detectTransparentPixelExistence(b)),this.__width=b.width,this.__height=b.height;const E=s.F.getCgApiResourceRepository();let T;if(b instanceof HTMLImageElement)T=await E.createTextureFromHTMLImageElement(b,{level:A,internalFormat:y,width:this.__width,height:this.__height,border:0,format:x,type:g,generateMipmap:I});else{if(!(b instanceof HTMLCanvasElement))throw new Error("Unsupported image type.");T=E.createTextureFromImageBitmapData(b,{level:A,internalFormat:y,width:this.__width,height:this.__height,border:0,format:x,type:g,generateMipmap:I})}this._textureResourceUid=T,this.__isTextureReady=!0,this.__uri=v.src,r.y.__textureMap.set(T,this),this.__imgToLoadLazy=void 0}generateTextureFromUri(e,{level:t=0,internalFormat:n=a.d.RGBA8,format:r=i.V.RGBA,type:s=o.r.UnsignedByte,generateMipmap:l=!0}={}){this.__uriToLoadLazy=e,this.__optionsToLoadLazy={level:t,internalFormat:n,format:r,type:s,generateMipmap:l}}async loadFromUrlLazy(){var e,t,n,_,h,u,d,m,f,p;if(null==this.__uriToLoadLazy)return;const v=this.__uriToLoadLazy,A=null!==(t=null===(e=this.__optionsToLoadLazy)||void 0===e?void 0:e.level)&&void 0!==t?t:0,y=null!==(_=null===(n=this.__optionsToLoadLazy)||void 0===n?void 0:n.internalFormat)&&void 0!==_?_:a.d.RGBA8,x=null!==(u=null===(h=this.__optionsToLoadLazy)||void 0===h?void 0:h.format)&&void 0!==u?u:i.V.RGBA,g=null!==(m=null===(d=this.__optionsToLoadLazy)||void 0===d?void 0:d.type)&&void 0!==m?m:o.r.UnsignedByte,I=null===(p=null===(f=this.__optionsToLoadLazy)||void 0===f?void 0:f.generateMipmap)||void 0===p||p;return this.__uri=v,this.__startedToLoad=!0,new Promise(((e,t)=>{this.__img=new Image,v.match(/^data:/)||(this.__img.crossOrigin="Anonymous"),this.__img.onload=()=>{this.__htmlImageElement=this.__img;let t=this.__img;if(this.autoResize){const[e,n,i]=c.j.getResizedCanvas(t,l.D.maxSizeLimitOfNonCompressedTexture);t=e,this.__width=n,this.__height=i,this.__htmlCanvasElement=e}this.autoDetectTransparency&&(this.__hasTransparentPixels=c.j.detectTransparentPixelExistence(t)),this.__width=t.width,this.__height=t.height;const n=s.F.getCgApiResourceRepository();let i=s.F.InvalidCGAPIResourceUid;(async()=>{if(t instanceof HTMLImageElement)i=await n.createTextureFromHTMLImageElement(t,{level:A,internalFormat:y,width:this.__width,height:this.__height,border:0,format:x,type:g,generateMipmap:I});else{if(!(t instanceof HTMLCanvasElement))throw new Error("Unsupported image type");{const e=n.createTextureFromImageBitmapData(t,{level:A,internalFormat:y,width:this.__width,height:this.__height,border:0,format:x,type:g,generateMipmap:I});i=e}}this._textureResourceUid=i,this.__isTextureReady=!0,r.y.__textureMap.set(i,this),this.__uriToLoadLazy=void 0,e()})()},this.__img.src=v}))}generate1x1TextureFrom(e="rgba(255,255,255,1)"){const t=document.createElement("canvas");t.width=1,t.height=1,this.__width=1,this.__height=1;const n=t.getContext("2d");n.fillStyle=e,n.fillRect(0,0,1,1);const l=s.F.getCgApiResourceRepository().createTextureFromImageBitmapData(t,{level:0,internalFormat:a.d.RGBA8,width:1,height:1,border:0,format:i.V.RGBA,type:o.r.UnsignedByte,generateMipmap:!1});this._textureResourceUid=l,this.__isTextureReady=!0,r.y.__textureMap.set(l,this)}async generateSheenLutTextureFromDataUri(){const e=h.x.getInstance().getModule("pbr"),t=s.F.getWebGLResourceRepository(),n=await t.createTextureFromDataUri(e.sheen_E_and_DGTerm,{level:0,internalFormat:a.d.RGBA8,border:0,format:i.V.RGBA,type:o.r.UnsignedByte,generateMipmap:!1});this._textureResourceUid=n,this.__isTextureReady=!0,r.y.__textureMap.set(n,this)}generateTextureFromTypedArray(e,{level:t=0,internalFormat:n=a.d.RGBA8,format:l=i.V.RGBA,generateMipmap:c=!0}={}){const _=o.r.fromTypedArray(e),h=s.F.getWebGLResourceRepository().createTextureFromTypedArray(e,{level:t,internalFormat:n,width:this.__width,height:this.__height,border:0,format:l,type:_,generateMipmap:c});this._textureResourceUid=h,this.__isTextureReady=!0,r.y.__textureMap.set(h,this)}generateCompressedTextureFromTypedArray(e,t,n,i){this.__width=t,this.__height=n;const o={level:0,width:t,height:n,buffer:e},a=s.F.getWebGLResourceRepository().createCompressedTexture([o],i);this._textureResourceUid=a,this.__isTextureReady=!0,r.y.__textureMap.set(a,this)}generateCompressedTextureWithMipmapFromTypedArray(e,t){const n=e.find((e=>0===e.level));if(null==n)throw new Error("texture data with level 0 is not found");this.__width=n.width,this.__height=n.height;const i=s.F.getWebGLResourceRepository().createCompressedTexture(e,t);this._textureResourceUid=i,this.__isTextureReady=!0,r.y.__textureMap.set(i,this)}importWebGLTextureDirectly(e,t=0,n=0){this.__width=t,this.__height=n;const i=s.F.getWebGLResourceRepository().setWebGLTextureDirectly(e);this._textureResourceUid=i,this.__startedToLoad=!0,this.__isTextureReady=!0,r.y.__textureMap.set(i,this)}destroy3DAPIResources(){return r.y.__textureMap.delete(this._textureResourceUid),s.F.getWebGLResourceRepository().deleteTexture(this._textureResourceUid),this._textureResourceUid=s.F.InvalidCGAPIResourceUid,this.__isTextureReady=!1,this.__startedToLoad=!1,!0}}u.__loadedBasisFunc=!1},9849:(e,t,n)=>{n.d(t,{h:()=>i});class i{constructor(e,t,n){this.__channels=n,this.__width=e,this.__height=t,this.__data=new Float32Array(e*t*n)}resize(e,t,n){this.__width=e,this.__height=t,this.__channels=n,this.__data=new Float32Array(i.transfer(this.__data.buffer,e*t*n*4))}setPixelAtChannel(e,t,n,i){this.__data[t*this.__width*this.__channels+e*this.__channels+n]=i}get width(){return this.__width}get height(){return this.__height}get data(){return this.__data}getPixel(e,t,n){return this.__data[t*this.__width*this.__channels+e*this.__channels+n]}getPixelAs(e,t,n,i){return 3===n?new i(new Float32Array([this.__data[t*this.__width*this.__channels+e*this.__channels+0],this.__data[t*this.__width*this.__channels+e*this.__channels+1],this.__data[t*this.__width*this.__channels+e*this.__channels+2]])):4===n?new i(new Float32Array([this.__data[t*this.__width*this.__channels+e*this.__channels+0],this.__data[t*this.__width*this.__channels+e*this.__channels+1],this.__data[t*this.__width*this.__channels+e*this.__channels+2],this.__data[t*this.__width*this.__channels+e*this.__channels+3]])):void 0}getPixelAsArray(e,t){const n=[];for(let i=0;i=e.byteLength){let t=0,i=e.byteLength;[8,4,2,1].forEach((o=>{if(i>=o){const a=function(e,t,n,i,o){let a=Uint8Array;switch(e){case 8:a=Float64Array;break;case 4:a=Float32Array;break;case 2:a=Uint16Array;break;default:a=Uint8Array}const r=new a(t,i,Math.trunc(o/e)),s=new a(n,i,Math.trunc(o/e));for(let e=0;e{n.r(t),n.d(t,{default:()=>i});const i=Object.freeze({sheen_E_and_DGTerm:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGkmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNy4yLWMwMDAgNzkuNTY2ZWJjNWI0LCAyMDIyLzA1LzA5LTA4OjI1OjU1ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9S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()=>ur,w_G:()=>$r,wce:()=>Z,wm0:()=>Zl,wpZ:()=>K_,wrZ:()=>an,x6H:()=>nl,xHF:()=>R,xIw:()=>lr,xR7:()=>oe,xUI:()=>Ol,xp:()=>ye,xug:()=>e_,xyr:()=>Mi,y$A:()=>yo,y1m:()=>Ur,y3j:()=>Hs,y3r:()=>Uc,y8S:()=>_l,y9I:()=>Ft,yD3:()=>Vt,yYj:()=>Pi,yZM:()=>o_,yZh:()=>Ac,ycd:()=>Cc,yd2:()=>gs,yun:()=>Al,yx3:()=>Ma,z8r:()=>tc,zSL:()=>K,zSP:()=>Be,zfW:()=>Xl,zsc:()=>wa});const i=256,o=1024,a=16384,r=0,s=1,l=2,c=3,_=4,h=5,u=6,d=0,m=1,f=768,p=769,v=770,A=771,y=772,x=773,g=774,I=775,b=776,E=32769,T=32770,S=32771,C=32772,w=32774,R=32778,P=32779,M=32777,D=32777,N=34877,B=32968,L=32969,F=32970,G=32971,z=32773,V=34964,O=34965,U=2849,k=33901,Q=33902,W=2885,X=2886,q=2928,H=2930,j=2931,Y=2932,K=2961,J=2962,Z=2964,$=2965,ee=2966,te=2967,ne=2963,ie=2968,oe=34816,ae=34817,re=34818,se=34819,le=36003,ce=36004,_e=36005,he=2978,ue=3088,de=3106,me=3107,fe=3317,pe=3333,ve=3379,Ae=3386,ye=3408,xe=3410,ge=3411,Ie=3412,be=3413,Ee=3414,Te=3415,Se=10752,Ce=32824,we=32873,Re=32936,Pe=32937,Me=32938,De=32939,Ne=34467,Be=7936,Le=7937,Fe=7938,Ge=35738,ze=35739,Ve=37444,Oe=35044,Ue=35040,ke=35048,Qe=34962,We=34963,Xe=34660,qe=34661,He=34342,je=34338,Ye=34339,Ke=34340,Je=34341,Ze=34922,$e=34373,et=34975,tt=2884,nt=1028,it=1029,ot=1032,at=3042,rt=2929,st=3024,lt=32823,ct=32926,_t=32928,ht=3089,ut=2960,dt=0,mt=1280,ft=1281,pt=1282,vt=1285,At=37442,yt=2304,xt=2305,gt=4352,It=4353,bt=4354,Et=33170,Tt=5120,St=5121,Ct=5122,wt=5123,Rt=5124,Pt=5125,Mt=5126,Dt=6402,Nt=6406,Bt=6407,Lt=6408,Ft=6409,Gt=6410,zt=5121,Vt=32819,Ot=32820,Ut=33635,kt=35632,Qt=35633,Wt=35713,Xt=35712,qt=35714,Ht=35715,jt=35717,Yt=35721,Kt=35718,Jt=34921,Zt=36347,$t=36348,en=35661,tn=35660,nn=34930,on=36349,an=35663,rn=35724,sn=35725,ln=512,cn=519,_n=513,hn=514,un=515,dn=516,mn=518,fn=517,pn=7680,vn=7681,An=7682,yn=7683,xn=5386,gn=34055,In=34056,bn=9728,En=9729,Tn=9984,Sn=9985,Cn=9986,wn=9987,Rn=10240,Pn=10241,Mn=10242,Dn=10243,Nn=3553,Bn=5890,Ln=34067,Fn=34068,Gn=34069,zn=34070,Vn=34071,On=34072,Un=34073,kn=34074,Qn=34076,Wn=33984,Xn=33985,qn=33986,Hn=33987,jn=33988,Yn=33989,Kn=33990,Jn=33991,Zn=33992,$n=33993,ei=33994,ti=33995,ni=33996,ii=33997,oi=33998,ai=33999,ri=34e3,si=34001,li=34002,ci=34003,_i=34004,hi=34005,ui=34006,di=34007,mi=34008,fi=34009,pi=34010,vi=34011,Ai=34012,yi=34013,xi=34014,gi=34015,Ii=34016,bi=10497,Ei=33071,Ti=33648,Si=35664,Ci=35665,wi=35666,Ri=35667,Pi=35668,Mi=35669,Di=35670,Ni=35671,Bi=35672,Li=35673,Fi=35674,Gi=35675,zi=35676,Vi=35678,Oi=35680,Ui=36336,ki=36337,Qi=36338,Wi=36339,Xi=36340,qi=36341,Hi=36160,ji=36161,Yi=32854,Ki=32855,Ji=36194,Zi=33189,$i=6401,eo=36168,to=34041,no=36162,io=36163,oo=36164,ao=36176,ro=36177,so=36178,lo=36179,co=36180,_o=36181,ho=36048,uo=36049,mo=36050,fo=36051,po=36064,vo=36096,Ao=36128,yo=33306,xo=0,go=36053,Io=36054,bo=36055,Eo=36057,To=36061,So=36006,Co=36007,wo=34024,Ro=1286,Po=37440,Mo=37441,Do=37443,No=3074,Bo=3314,Lo=3315,Fo=3316,Go=3330,zo=3331,Vo=3332,Oo=32874,Uo=32877,ko=32878,Qo=32883,Wo=33e3,Xo=33001,qo=34045,Ho=35657,jo=35658,Yo=35071,Ko=35076,Jo=35077,Zo=35659,$o=35723,ea=35977,ta=34229,na=37154,ia=37157,oa=37137,aa=36203,ra=6403,sa=32849,la=32856,ca=32857,_a=32879,ha=32882,ua=33082,da=33083,ma=33084,fa=33085,pa=34892,va=34893,Aa=35904,ya=35905,xa=35907,ga=34894,Ia=34836,ba=34837,Ea=34842,Ta=34843,Sa=35866,Ca=35869,wa=35898,Ra=35901,Pa=36208,Ma=36209,Da=36214,Na=36215,Ba=36220,La=36221,Fa=36226,Ga=36227,za=36232,Va=36233,Oa=36238,Ua=36239,ka=36244,Qa=36248,Wa=36249,Xa=33321,qa=33323,Ha=33325,ja=33326,Ya=33327,Ka=33328,Ja=33329,Za=33330,$a=33331,er=33332,tr=33333,nr=33334,ir=33335,or=33336,ar=33337,rr=33338,sr=33339,lr=33340,cr=36756,_r=36757,hr=36758,ur=36759,dr=36975,mr=37167,fr=33503,pr=33640,vr=35899,Ar=35902,yr=36269,xr=34042,gr=5131,Ir=33319,br=33320,Er=36255,Tr=34917,Sr=34918,Cr=34919,wr=35887,Rr=36202,Pr=34852,Mr=34853,Dr=34854,Nr=34855,Br=34856,Lr=34857,Fr=34858,Gr=34859,zr=34860,Vr=34861,Or=34862,Ur=34863,kr=34864,Qr=34865,Wr=34866,Xr=34867,qr=34868,Hr=36063,jr=36065,Yr=36066,Kr=36067,Jr=36068,Zr=36069,$r=36070,es=36071,ts=36072,ns=36073,is=36074,os=36075,as=36076,rs=36077,ss=36078,ls=36079,cs=35679,_s=35682,hs=36289,us=36292,ds=36293,ms=36298,fs=36299,ps=36300,vs=36303,As=36306,ys=36307,xs=36308,gs=36311,Is=36183,bs=35097,Es=35051,Ts=35052,Ss=35053,Cs=35055,ws=36662,Rs=36663,Ps=36662,Ms=36663,Ds=35685,Ns=35686,Bs=35687,Ls=35688,Fs=35689,Gs=35690,zs=36294,Vs=36295,Os=36296,Us=35863,ks=36764,Qs=35069,Ws=35070,Xs=35967,qs=35968,Hs=35971,js=35972,Ys=35973,Ks=35976,Js=35978,Zs=35979,$s=35980,el=35981,tl=35982,nl=35983,il=36386,ol=36387,al=36388,rl=36389,sl=33296,ll=33297,cl=33298,_l=33299,hl=33300,ul=33301,dl=33302,ml=33303,fl=33304,pl=35056,vl=36006,Al=36008,yl=36009,xl=36010,gl=36011,Il=36052,bl=36182,El=35345,Tl=35368,Sl=35369,Cl=35370,wl=35371,Rl=35373,Pl=35374,Ml=35375,Dl=35376,Nl=35377,Bl=35379,Ll=35380,Fl=35382,Gl=35383,zl=35384,Vl=35386,Ol=35387,Ul=35388,kl=35389,Ql=35390,Wl=35391,Xl=35392,ql=35394,Hl=35395,jl=35396,Yl=35398,Kl=37138,Jl=37139,Zl=37140,$l=37141,ec=37142,tc=37143,nc=37144,ic=37145,oc=37146,ac=37147,rc=37148,sc=37149,lc=1,cc=6144,_c=6145,hc=6146,uc=32775,dc=32776,mc=33190,fc=35041,pc=35042,vc=35045,Ac=35046,yc=35049,xc=35050,gc=36012,Ic=36013,bc=4294967295,Ec=-1,Tc=37447,Sc=35070,Cc=37445,wc=37446,Rc=34047,Pc=34046,Mc=33776,Dc=33777,Nc=33778,Bc=33779,Lc=35916,Fc=35917,Gc=35918,zc=35919,Vc=37488,Oc=37489,Uc=37490,kc=37491,Qc=37492,Wc=37493,Xc=37494,qc=37495,Hc=37496,jc=37497,Yc=35840,Kc=35842,Jc=35841,Zc=35843,$c=36196,e_=35986,t_=35986,n_=34798,i_=37808,o_=37809,a_=37810,r_=37811,s_=37812,l_=37813,c_=37814,__=37815,h_=37816,u_=37817,d_=37818,m_=37819,f_=37820,p_=37821,v_=37840,A_=37841,y_=37842,x_=37843,g_=37844,I_=37845,b_=37846,E_=37847,T_=37848,S_=37849,C_=37850,w_=37851,R_=37852,P_=37853,M_=34042,D_=36193,N_=34836,B_=34837,L_=33297,F_=35863,G_=32775,z_=32776,V_=35904,O_=35906,U_=35907,k_=33296,Q_=35723,W_=36064,X_=36065,q_=36066,H_=36067,j_=36068,Y_=36069,K_=36070,J_=36071,Z_=36072,$_=36073,eh=36074,th=36075,nh=36076,ih=36077,oh=36078,ah=36079,rh=34853,sh=34854,lh=34855,ch=34856,_h=34857,hh=34858,uh=34859,dh=34860,mh=34861,fh=34862,ph=34863,vh=34864,Ah=34865,yh=34866,xh=34867,gh=34868,Ih=36063,bh=34852,Eh=34229,Th=34916,Sh=34917,Ch=34918,wh=34919,Rh=35007,Ph=36392,Mh=36795},4350:(e,t,n)=>{n.d(t,{C:()=>o,j:()=>i});const i="gltf_node_index";function o(e,t){return e.magFilter===t.magFilter&&e.minFilter===t.minFilter&&e.wrapS===t.wrapS&&e.wrapT===t.wrapT}},10:(e,t,n)=>{n.d(t,{_$8:()=>a._$8,lkt:()=>a.lkt,Td9:()=>a.Td9,wEd:()=>a.wEd,ogk:()=>a.ogk,AY1:()=>a.AY1,fNk:()=>a.fNk,Y0n:()=>a.Y0n,WPj:()=>a.WPj,gOo:()=>a.gOo,$LR:()=>a.$LR,faJ:()=>a.faJ,TdU:()=>a.TdU,UAv:()=>a.UAv,Q$l:()=>a.Q$l,wIF:()=>a.wIF,ZXb:()=>a.ZXb,hzX:()=>a.hzX,r9F:()=>a.r9F,Kzo:()=>a.Kzo,ttq:()=>a.ttq,XG_:()=>a.XG_,HPC:()=>a.HPC,QH$:()=>a.QH$,_1o:()=>a._1o,EZ0:()=>a.EZ0,N9T:()=>a.N9T,vgW:()=>a.vgW,tqi:()=>a.tqi,iU2:()=>a.iU2,BWL:()=>a.BWL,F_m:()=>a.F_m,$et:()=>a.$et,gx8:()=>a.gx8,Y8m:()=>a.Y8m,Wlc:()=>a.Wlc,krQ:()=>a.krQ,YCV:()=>a.YCV,p7w:()=>a.p7w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Uh,C9t:()=>a.C9t,I4M:()=>a.I4M,XZ2:()=>a.XZ2,s7G:()=>a.s7G,bsK:()=>a.bsK,vEN:()=>a.vEN,cqm:()=>a.cqm,eFf:()=>a.eFf,lQo:()=>a.lQo,Ith:()=>a.Ith,GIj:()=>a.GIj,_sJ:()=>a._sJ,j3U:()=>r.j,bup:()=>o,CLY:()=>r.C});var i=n(810);function o(e){switch(e.className){case"Scalar":return i.d.Scalar;case"Vector2":return i.d.Vec2;case"Vector3":return i.d.Vec3;case"Vector4":return i.d.Vec4;case"Matrix22":return i.d.Mat2;case"Matrix33":return i.d.Mat3;case"Matrix44":return i.d.Mat4;default:return console.error("CompositionType.Unknown"),i.d.Unknown}}var a=n(7461),r=n(4350)},5551:(e,t,n)=>{n.d(t,{d:()=>m});var i,o,a,r,s,l,c=n(3346),_=n(7192),h=function(e,t,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(e,n):o?o.value=n:t.set(e,n),n},u=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};const d=-1;class m{constructor(e,t,n){this.__webglVersion=1,this.width=0,this.height=0,this.__activeTextureBackup=-1,this.__activeTextures2D=[],this.__activeTexturesCube=[],this.__isDebugMode=!1,this.__viewport_left=0,this.__viewport_top=0,this.__viewport_width=0,this.__viewport_height=0,this.__default_viewport_left=0,this.__default_viewport_top=0,this.__default_viewport_width=0,this.__default_viewport_height=0,i.set(this,d),o.set(this,d),a.set(this,d),r.set(this,d),s.set(this,d),l.set(this,d),this.__maxVertexUniformVectors=d,this.__maxFragmentUniformVectors=d,this._isWebXRMode=!1,this.__extensions=new Map,this.__gl=e,this.width=t.width,this.height=t.height,this.canvas=t,this.__viewport_width=this.__default_viewport_width=this.width,this.__viewport_height=this.__default_viewport_height=this.height,this.__isDebugMode=n,this.is_multiview=!0,"WebGL2RenderingContext"===this.__gl.constructor.name&&(this.__webglVersion=2,this.webgl2ExtTFL=this.__getExtension(c.c.TextureFloatLinear),this.webgl2ExtTFA=this.__getExtension(c.c.TextureFilterAnisotropic),this.webgl2ExtCBF=this.__getExtension(c.c.ColorBufferFloatWebGL2),this.webgl2ExtCBHF=this.__getExtension(c.c.ColorBufferHalfFloatWebGL2),this.webgl2ExtCTAstc=this.__getCompressedTextureExtension(c.c.CompressedTextureAstc),this.webgl2ExtCTS3tc=this.__getCompressedTextureExtension(c.c.CompressedTextureS3tc),this.webgl2ExtCTPvrtc=this.__getCompressedTextureExtension(c.c.CompressedTexturePvrtc),this.webgl2ExtCTAtc=this.__getCompressedTextureExtension(c.c.CompressedTextureAtc),this.webgl2ExtCTEtc=this.__getCompressedTextureExtension(c.c.CompressedTextureEtc),this.webgl2ExtCTEtc1=this.__getCompressedTextureExtension(c.c.CompressedTextureEtc1),this.webgl2ExtCTBptc=this.__getCompressedTextureExtension(c.c.CompressedTextureBptc),this.webgl2ExtMLTVIEW=this.__getExtension(c.c.OculusMultiview),this.webgl2ExtMLTVIEW?this.webgl2ExtMLTVIEW.is_multisample=!0:(this.webgl2ExtMLTVIEW=this.__getExtension(c.c.OvrMultiview2),this.webgl2ExtMLTVIEW?this.webgl2ExtMLTVIEW.is_multisample=!1:(console.warn("Neither OCULUS_multiview nor OVR_multiview2 extensions are supported"),this.is_multiview=!1)),this.webgl2ExtGmanWM=this.__getCompressedTextureExtension(c.c.GMAN_WEBGL_MEMORY)),this.__getUniformBufferInfo(),this.__getMaxUniformVectors()}getRawContext(){return this.__gl}getRawContextAsWebGL1(){return this.__gl}getRawContextAsWebGL2(){return this.__gl}get viewport(){return _.Lt.fromCopyArray([this.__viewport_left,this.__viewport_top,this.__viewport_width,this.__viewport_height])}get defaultViewport(){return _.Lt.fromCopyArray([this.__default_viewport_left,this.__default_viewport_top,this.__default_viewport_width,this.__default_viewport_height])}isSupportWebGL1Extension(e){return!!this.__getExtension(e)}isNotSupportWebGL1Extension(e){return!this.isSupportWebGL1Extension(e)}get isDebugMode(){return this.__isDebugMode}getIsWebGL2(e){return this.isWebGL2}get isWebGL2(){return 2===this.__webglVersion}createVertexArray(){return this.getIsWebGL2(this.__gl)?this.__gl.createVertexArray():null!=this.webgl1ExtVAO?this.webgl1ExtVAO.createVertexArrayOES():void 0}deleteVertexArray(e){this.getIsWebGL2(this.__gl)?this.__gl.deleteVertexArray(e):null!=this.webgl1ExtVAO&&this.webgl1ExtVAO.deleteVertexArrayOES(e)}bindVertexArray(e){this.getIsWebGL2(this.__gl)?this.__gl.bindVertexArray(e):null!=this.webgl1ExtVAO&&this.webgl1ExtVAO.bindVertexArrayOES(e)}vertexAttribDivisor(e,t){this.getIsWebGL2(this.__gl)?this.__gl.vertexAttribDivisor(e,t):this.webgl1ExtIA.vertexAttribDivisorANGLE(e,t)}drawElementsInstanced(e,t,n,i,o){this.getIsWebGL2(this.__gl)?this.__gl.drawElementsInstanced(e,t,n,i,o):this.webgl1ExtIA.drawElementsInstancedANGLE(e,t,n,i,o)}drawArraysInstanced(e,t,n,i){this.getIsWebGL2(this.__gl)?this.__gl.drawArraysInstanced(e,t,n,i):this.webgl1ExtIA.drawArraysInstancedANGLE(e,t,n,i)}colorAttachment(e){return 36064+e}drawBuffers(e){const t=this.__gl;if(0===e.length)return void t.drawBuffers([t.NONE]);const n=e[0].webGLConstantValue();t.drawBuffers(e.map((e=>e.webGLConstantValue()))),n===t.NONE||0===e.length?t.colorMask(!1,!1,!1,!1):t.colorMask(!0,!0,!0,!0)}__activeTexture(e){if(this.__activeTextureBackup!==e){switch(e){case 0:this.__gl.activeTexture(this.__gl.TEXTURE0);break;case 1:this.__gl.activeTexture(this.__gl.TEXTURE1);break;case 2:this.__gl.activeTexture(this.__gl.TEXTURE2);break;case 3:this.__gl.activeTexture(this.__gl.TEXTURE3);break;case 4:this.__gl.activeTexture(this.__gl.TEXTURE4);break;case 5:this.__gl.activeTexture(this.__gl.TEXTURE5);break;case 6:this.__gl.activeTexture(this.__gl.TEXTURE6);break;case 7:this.__gl.activeTexture(this.__gl.TEXTURE7);break;case 8:this.__gl.activeTexture(this.__gl.TEXTURE8);break;case 9:this.__gl.activeTexture(this.__gl.TEXTURE9);break;case 10:this.__gl.activeTexture(this.__gl.TEXTURE10);break;case 11:this.__gl.activeTexture(this.__gl.TEXTURE11);break;case 12:this.__gl.activeTexture(this.__gl.TEXTURE12);break;case 13:this.__gl.activeTexture(this.__gl.TEXTURE13);break;case 14:this.__gl.activeTexture(this.__gl.TEXTURE14);break;case 15:this.__gl.activeTexture(this.__gl.TEXTURE15)}this.__activeTextureBackup=e}}bindTexture2D(e,t){this.__activeTexture(e),this.__gl.bindTexture(this.__gl.TEXTURE_2D,t),this.__activeTextures2D[e]=t}bindTextureSampler(e,t){this.__gl.bindSampler(e,t)}bindTextureCube(e,t){this.__activeTexture(e),this.__gl.bindTexture(this.__gl.TEXTURE_CUBE_MAP,t),this.__activeTexturesCube[e]=t}unbindTexture2D(e){this.__activeTexture(e),this.__gl.bindTexture(this.__gl.TEXTURE_2D,null),delete this.__activeTextures2D[e]}unbindTextureCube(e){this.__activeTexture(e),this.__gl.bindTexture(this.__gl.TEXTURE_CUBE_MAP,null),delete this.__activeTexturesCube[e]}unbindTextures(){for(let e=0;e{n.d(t,{c:()=>P});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:1,str:"OES_vertex_array_object"}),r=new o({index:2,str:"OES_texture_float"}),s=new o({index:3,str:"OES_texture_half_float"}),l=new o({index:4,str:"OES_texture_float_linear"}),c=new o({index:5,str:"OES_texture_half_float_linear"}),_=new o({index:6,str:"ANGLE_instanced_arrays"}),h=new o({index:7,str:"EXT_texture_filter_anisotropic"}),u=new o({index:8,str:"OES_element_index_uint"}),d=new o({index:9,str:"EXT_shader_texture_lod"}),m=new o({index:10,str:"OES_standard_derivatives"}),f=new o({index:11,str:"WEBGL_draw_buffers"}),p=new o({index:12,str:"EXT_blend_minmax"}),v=new o({index:13,str:"WEBGL_color_buffer_float"}),A=new o({index:14,str:"WEBGL_compressed_texture_astc"}),y=new o({index:15,str:"WEBGL_compressed_texture_s3tc"}),x=new o({index:16,str:"WEBGL_compressed_texture_pvrtc"}),g=new o({index:17,str:"WEBGL_compressed_texture_atc"}),I=new o({index:18,str:"WEBGL_compressed_texture_etc"}),b=new o({index:19,str:"WEBGL_compressed_texture_etc1"}),E=new o({index:20,str:"EXT_texture_compression_bptc"}),T=new o({index:21,str:"GMAN_webgl_memory"}),S=new o({index:22,str:"EXT_color_buffer_float"}),C=new o({index:23,str:"EXT_color_buffer_half_float"}),w=new o({index:24,str:"OCULUS_multiview"}),R=new o({index:25,str:"OVR_multiview2"}),P=Object.freeze({VertexArrayObject:a,TextureFloat:r,TextureHalfFloat:s,TextureFloatLinear:l,TextureHalfFloatLinear:c,InstancedArrays:_,TextureFilterAnisotropic:h,ElementIndexUint:u,ShaderTextureLod:d,ShaderDerivatives:m,DrawBuffers:f,BlendMinmax:p,ColorBufferFloatWebGL1:v,CompressedTextureAstc:A,CompressedTextureS3tc:y,CompressedTexturePvrtc:x,CompressedTextureAtc:g,CompressedTextureEtc:I,CompressedTextureEtc1:b,CompressedTextureBptc:E,ColorBufferFloatWebGL2:S,ColorBufferHalfFloatWebGL2:C,OculusMultiview:w,OvrMultiview2:R,GMAN_WEBGL_MEMORY:T})},3952:(e,t,n)=>{n.d(t,{x:()=>C});var i=n(7987),o=n(128),a=n(5981),r=n(9216),s=n(810),l=n(3999),c=n(5551),_=n(3032),h=n(4587),u=n(4392),d=n(1986),m=n(7192),f=n(8422),p=n(6098),v=n(3449),A=n(290),y=n(3346),x=n(4690),g=n(3648),I=n(3007),b=n(3258),E=n(7461),T=n(580);const S=n(3705);class C extends i.F{constructor(){super(),this.__webglContexts=new Map,this.__resourceCounter=i.F.InvalidCGAPIResourceUid,this.__webglResources=new Map,this.__samplerClampToEdgeLinearUid=i.F.InvalidCGAPIResourceUid,this.__samplerClampToEdgeNearestUid=i.F.InvalidCGAPIResourceUid,this.__samplerRepeatNearestUid=i.F.InvalidCGAPIResourceUid,this.__samplerRepeatLinearUid=i.F.InvalidCGAPIResourceUid,this.__samplerShadowUid=i.F.InvalidCGAPIResourceUid,this.__samplerRepeatTriLinearUid=i.F.InvalidCGAPIResourceUid,this.__samplerRepeatAnisotropyLinearUid=i.F.InvalidCGAPIResourceUid}static getInstance(){return this.__instance||(this.__instance=new C),this.__instance}addWebGLContext(e,t,n,i){const o=new c.d(e,t,i);this.__webglContexts.set("default",o),n&&(this.__glw=o)}generateWebGLContext(e,t,n,i,o,a=!0){const r=e.getContext("webgl2",o);return this.addWebGLContext(r,e,n,i),p.Kf.isSafari()&&(b.D.isUboEnabled=!1),r}get currentWebGLContextWrapper(){return this.__glw}getResourceNumber(){return++this.__resourceCounter}__registerResource(e){const t=this.getResourceNumber();return e._resourceUid=t,this.__webglResources.set(t,e),t}getWebGLResource(e){const t=this.__webglResources.get(e);return null!=t?t:null}createIndexBuffer(e){const t=this.__glw.getRawContext();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");this.__glw.bindVertexArray(null);const n=t.createBuffer(),i=this.__registerResource(n);return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.getTypedArray(),t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),i}updateIndexBuffer(e,t){const n=this.__glw,i=null==n?void 0:n.getRawContext();if(x.Is.not.exist(i))throw new Error("No WebGLRenderingContext set as Default.");const o=this.__webglResources.get(t);if(x.Is.not.exist(o))throw new Error("Not found IBO.");n.bindVertexArray(null),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,o),i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,0,e.getTypedArray()),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,null)}createVertexBuffer(e){const t=this.__glw.getRawContext();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");this.__glw.bindVertexArray(null);const n=t.createBuffer(),i=this.__registerResource(n);return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,e.getUint8Array(),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),i}createVertexBufferFromTypedArray(e){const t=this.__glw.getRawContext();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");this.__glw.bindVertexArray(null);const n=t.createBuffer(),i=this.__registerResource(n);return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),i}updateVertexBuffer(e,t){const n=this.__glw,i=null==n?void 0:n.getRawContext();if(!x.Is.exist(i))throw new Error("No WebGLRenderingContext set as Default.");const o=this.__webglResources.get(t);if(!x.Is.exist(o))throw new Error("Not found VBO.");n.bindVertexArray(null),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferSubData(i.ARRAY_BUFFER,0,e.bufferView.getUint8Array()),i.bindBuffer(i.ARRAY_BUFFER,null)}createVertexArray(){if(null==this.__glw)throw new Error("No WebGLRenderingContext set as Default.");const e=this.__glw.createVertexArray();if(!x.Is.not.exist(e))return this.__registerResource(e)}bindTexture2D(e,t){const n=this.getWebGLResource(t);this.__glw.bindTexture2D(e,n)}bindTextureSampler(e,t){if(-1===t)this.__glw.bindTextureSampler(e,null);else{const n=this.getWebGLResource(t);this.__glw.bindTextureSampler(e,n)}}bindTextureCube(e,t){const n=this.getWebGLResource(t);this.__glw.bindTextureCube(e,n)}createVertexBufferAndIndexBuffer(e){let t;e.hasIndices()&&(t=this.createIndexBuffer(e.indicesAccessor));const n=[];for(let e=0;e{const r=this.createVertexBuffer(t),s=o.T.toAttributeSlotFromJoinedString(e.attributeSemantics[a]);n[s]=!0,i.push(r)})),{vaoHandle:-1,iboHandle:t,vboHandles:i,attributesFlags:n,setComplete:!1}}updateVertexBufferAndIndexBuffer(e,t){t.iboHandle&&this.updateIndexBuffer(e.indicesAccessor,t.iboHandle);const n=e.attributeAccessors;for(let e=0;e{s.bindAttribLocation(h,a[t].getAttributeSlot(),e)})),s.linkProgram(h),l&&!this.__checkShaderProgramLinkStatus(e.materialTypeName,h,t,n))return i.F.InvalidCGAPIResourceUid;h.__SPECTOR_rebuildProgram=this.rebuildProgramBySpector.bind(h);const u=this.__registerResource(h);return s.deleteShader(c),s.deleteShader(_),u}__checkShaderCompileStatus(e,t,n,i){const o=this.__glw.getRawContext();if(x.Is.false(o.getShaderParameter(t,o.COMPILE_STATUS))&&x.Is.false(o.isContextLost())){console.log("MaterialTypeName: "+e);const a=p.Kf.addLineNumberToCode(n);console.log(a);const r=o.getShaderInfoLog(t);return void 0===i?(console.error("An error occurred compiling the shaders:"+r),!1):(i(r),!1)}return!0}__checkShaderProgramLinkStatus(e,t,n,i){const o=this.__glw.getRawContext();if(x.Is.false(o.getProgramParameter(t,o.LINK_STATUS))&&x.Is.false(o.isContextLost())){console.log("MaterialTypeName: "+e),console.log(p.Kf.addLineNumberToCode("Vertex Shader:")),console.log(p.Kf.addLineNumberToCode(n)),console.log(p.Kf.addLineNumberToCode("Fragment Shader:")),console.log(p.Kf.addLineNumberToCode(i));const a=o.getProgramInfoLog(t);return console.error("Unable to initialize the shader program: "+a),!1}return!0}setupUniformLocations(e,t,n){const i=this.__glw,o=i.getRawContext(),a=this.getWebGLResource(e),r=t.length;for(let e=0;e{const n=this.getWebGLResource(e);if(null==n)throw new Error("Nothing Element Array Buffer at index "+t);c.bindBuffer(c.ARRAY_BUFFER,n),c.enableVertexAttribArray(o.T.toAttributeSlotFromJoinedString(a.attributeSemantics[t])),c.vertexAttribPointer(o.T.toAttributeSlotFromJoinedString(a.attributeSemantics[t]),a.attributeCompositionTypes[t].getNumberOfComponents(),a.attributeComponentTypes[t].index,a.attributeAccessors[t].normalized,a.attributeAccessors[t].byteStride,0)})),r!==i.F.InvalidCGAPIResourceUid){const e=this.getWebGLResource(r);if(null==e)throw new Error("Nothing Element Array Buffer at index");c.bindBuffer(c.ARRAY_BUFFER,e),c.enableVertexAttribArray(o.T.Instance.getAttributeSlot()),c.vertexAttribPointer(o.T.Instance.getAttributeSlot(),s.d.Vec4.getNumberOfComponents(),l.r.Float.index,!1,0,0),this.__glw.vertexAttribDivisor(o.T.Instance.getAttributeSlot(),1)}c.bindBuffer(c.ARRAY_BUFFER,null),this.__glw.bindVertexArray(null),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,null)}createTexStorage2D({levels:e,internalFormat:t,width:n,height:i}){const o=this.__glw.getRawContextAsWebGL2(),a=o.createTexture();this.__glw.bindTexture2D(0,a),o.texStorage2D(E.CbE,e,t.index,n,i);const r=this.__registerResource(a);return this.__glw.unbindTexture2D(0),r}createTextureSampler({magFilter:e,minFilter:t,wrapS:n,wrapT:i,wrapR:o,anisotropy:a,isPremultipliedAlpha:r}){const s=this.__glw.getRawContextAsWebGL2(),l=s.createSampler(),c=this.__registerResource(l);return s.samplerParameteri(l,s.TEXTURE_MIN_FILTER,t.index),s.samplerParameteri(l,s.TEXTURE_MAG_FILTER,e.index),s.samplerParameteri(l,s.TEXTURE_WRAP_S,n.index),s.samplerParameteri(l,s.TEXTURE_WRAP_T,i.index),s.samplerParameteri(l,s.TEXTURE_WRAP_R,o.index),a&&this.__glw.webgl2ExtTFA&&s.samplerParameteri(l,this.__glw.webgl2ExtTFA.TEXTURE_MAX_ANISOTROPY_EXT,4),c}createOrGetTextureSamplerClampToEdgeLinear(){if(this.__samplerClampToEdgeLinearUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerClampToEdgeLinearUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE)}return this.__samplerClampToEdgeLinearUid}createOrGetTextureSamplerClampToEdgeNearest(){if(this.__samplerClampToEdgeNearestUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerClampToEdgeNearestUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE)}return this.__samplerClampToEdgeNearestUid}createOrGetTextureSamplerRepeatNearest(){if(this.__samplerRepeatNearestUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerRepeatNearestUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.REPEAT)}return this.__samplerRepeatNearestUid}createOrGetTextureSamplerRepeatLinear(){if(this.__samplerRepeatLinearUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerRepeatLinearUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.REPEAT)}return this.__samplerRepeatLinearUid}createOrGetTextureSamplerRepeatTriLinear(){if(this.__samplerRepeatTriLinearUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerRepeatTriLinearUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.REPEAT)}return this.__samplerRepeatTriLinearUid}createOrGetTextureSamplerShadow(){if(this.__samplerShadowUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerShadowUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.samplerParameteri(t,e.TEXTURE_COMPARE_FUNC,e.LESS)}return this.__samplerShadowUid}createOrGetTextureSamplerRepeatAnisotropyLinear(){if(this.__samplerRepeatAnisotropyLinearUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerRepeatAnisotropyLinearUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.REPEAT),e.samplerParameteri(t,this.__glw.webgl2ExtTFA.TEXTURE_MAX_ANISOTROPY_EXT,4)}return this.__samplerRepeatAnisotropyLinearUid}createTextureFromImageBitmapData(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:l}){const c=this.__glw.getRawContextAsWebGL2(),_=c.createTexture(),h=this.__registerResource(_);this.__glw.bindTexture2D(0,_);const u=l?Math.max(Math.log2(i),Math.log2(o)):1;return c.texStorage2D(E.CbE,u,n.index,i,o),c.texSubImage2D(c.TEXTURE_2D,0,0,0,r.index,s.index,e),this.__createTextureInner(c,i,o,l),h}__createTextureInner(e,t,n,i){_.k.isPowerOfTwoTexture(t,n)&&i&&1!==n&&1!==t&&e.generateMipmap(e.TEXTURE_2D),this.__glw.unbindTexture2D(0)}async createTextureFromHTMLImageElement(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:l}){const c=this.__glw.getRawContextAsWebGL2(),_=c.createTexture(),h=this.__registerResource(_);this.__glw.bindTexture2D(0,_);const u=l?Math.max(Math.log2(i),Math.log2(o)):1;return c.texStorage2D(E.CbE,u,n.index,i,o),c.texSubImage2D(c.TEXTURE_2D,0,0,0,r.index,s.index,e),this.__createTextureInner(c,i,o,l),h}createTextureFromTypedArray(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:l}){const c=this.__glw.getRawContextAsWebGL2(),_=c.createTexture(),h=this.__registerResource(_);this.__glw.bindTexture2D(0,_);const u=l?Math.max(Math.log2(i),Math.log2(o)):1;return c.texStorage2D(E.CbE,u,n.index,i,o),c.texSubImage2D(c.TEXTURE_2D,0,0,0,i,o,r.index,s.index,e),this.__createTextureInner(c,i,o,l),h}createCompressedTexture(e,t){const n=this.__glw.getRawContext(),i=n.createTexture(),o=this.__registerResource(i);this.__glw.bindTexture2D(0,i);const a=t.index;for(const t of e)n.compressedTexImage2D(n.TEXTURE_2D,t.level,a,t.width,t.height,0,t.buffer);return this.__glw.unbindTexture2D(0),o}createCompressedTextureFromBasis(e,{border:t,format:n,type:i}){let o,a;const r=this.__glw.getRawContext(),s=r.createTexture(),l=this.__registerResource(s);r.bindTexture(r.TEXTURE_2D,s);const c=r.getExtension("WEBGL_compressed_texture_s3tc");c&&(o=A.l.BC3,a=c.COMPRESSED_RGBA_S3TC_DXT5_EXT);const _=r.getExtension("WEBGL_compressed_texture_etc1");_&&(o=A.l.ETC1,a=_.COMPRESSED_RGB_ETC1_WEBGL);const h=r.getExtension("WEBGL_compressed_texture_atc");h&&(o=A.l.ATC_RGBA,a=h.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL);const u=r.getExtension("WEBGL_compressed_texture_etc");u&&(o=A.l.ETC2,a=u.COMPRESSED_RGBA8_ETC2_EAC);const d=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");d&&(o=A.l.PVRTC1_RGBA,a=d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG);const m=r.getExtension("WEBGL_compressed_texture_astc");m&&(o=A.l.ASTC,a=m.COMPRESSED_RGBA_ASTC_4x4_KHR);const f=e.getNumLevels(0);for(let n=0;n=2?a.d.NearestMipmapNearest:a.d.Nearest,h=a.d.Nearest):(_=e>=2?a.d.LinearMipmapLinear:a.d.Linear,h=a.d.Linear);const u=new T.Z({wrapS:l,wrapT:c,minFilter:_,magFilter:h});u.create();const m=(e,t,a)=>{if(e.hdriFormat===d.c.HDR_LINEAR){const n=this.__glw.getRawContextAsWebGL2();n.texImage2D(t,a,n.RGB32F,e.width,e.height,0,n.RGB,n.FLOAT,e.dataFloat)}else e instanceof HTMLImageElement||e instanceof HTMLCanvasElement?o.texImage2D(t,a,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,e):o.texImage2D(t,a,o.RGBA,n/2**a,i/2**a,0,o.RGBA,o.UNSIGNED_BYTE,e)};for(let e=0;enew Promise(((t,a)=>{let r=0;const s=[];let c=".jpg";i===d.c.HDR_LINEAR?c=".hdr":i===d.c.RGBE_PNG&&(c=".RGBE.PNG");let _="_right_",h="_left_",u="_top_",m="_bottom_",f="_front_",p="_back_";n&&(_="_posx_",h="_negx_",u="_posy_",m="_negy_",f="_posz_",p="_negz_");const v=[[e+_+l+c,o.TEXTURE_CUBE_MAP_POSITIVE_X],[e+h+l+c,o.TEXTURE_CUBE_MAP_NEGATIVE_X],[e+u+l+c,o.TEXTURE_CUBE_MAP_POSITIVE_Y],[e+m+l+c,o.TEXTURE_CUBE_MAP_NEGATIVE_Y],[e+f+l+c,o.TEXTURE_CUBE_MAP_POSITIVE_Z],[e+p+l+c,o.TEXTURE_CUBE_MAP_NEGATIVE_Z]];for(let e=0;e{r++,s.push(o),6===r&&t(s)},o.onerror=()=>{a(o.uri)},o.src=v[e][0]}}));let c;try{c=await t()}catch(e){try{c=await t()}catch(e){console.error(`failed to load ${e}`)}}const _={};for(const e of c){switch(e.side){case o.TEXTURE_CUBE_MAP_POSITIVE_X:_.posX=e;break;case o.TEXTURE_CUBE_MAP_POSITIVE_Y:_.posY=e;break;case o.TEXTURE_CUBE_MAP_POSITIVE_Z:_.posZ=e;break;case o.TEXTURE_CUBE_MAP_NEGATIVE_X:_.negX=e;break;case o.TEXTURE_CUBE_MAP_NEGATIVE_Y:_.negY=e;break;case o.TEXTURE_CUBE_MAP_NEGATIVE_Z:_.negZ=e}0===l&&(r=e.width,s=e.height)}a.push(_)}return this.createCubeTexture(t,a,r,s)}createCubeTextureFromBasis(e,{magFilter:t=a.d.Linear,minFilter:n=a.d.LinearMipmapLinear,wrapS:i=a.d.Repeat,wrapT:o=a.d.Repeat,border:r=0}){const s=this.__glw.getRawContext();let l,c;const _=s.createTexture(),h=this.__registerResource(_);this.__glw.bindTextureCube(0,_);const u=s.getExtension("WEBGL_compressed_texture_s3tc");u&&(l=A.l.BC3,c=u.COMPRESSED_RGBA_S3TC_DXT5_EXT);const d=s.getExtension("WEBGL_compressed_texture_etc1");d&&(l=A.l.ETC1,c=d.COMPRESSED_RGB_ETC1_WEBGL);const m=s.getExtension("WEBGL_compressed_texture_atc");m&&(l=A.l.ATC_RGBA,c=m.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL);const f=s.getExtension("WEBGL_compressed_texture_etc");f&&(l=A.l.ETC2,c=f.COMPRESSED_RGBA8_ETC2_EAC);const p=s.getExtension("WEBGL_compressed_texture_pvrtc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");p&&(l=A.l.PVRTC1_RGBA,c=p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG);const v=s.getExtension("WEBGL_compressed_texture_astc");v&&(l=A.l.ASTC,c=v.COMPRESSED_RGBA_ASTC_4x4_KHR);const y=e.getNumImages(),x=e.getNumLevels(0);if(s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,i.index),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,o.index),x>=2)s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,n.index),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,t.index);else{let e=n;n===a.d.LinearMipmapLinear&&(e=a.d.Linear),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,e.index),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,t.index)}for(let t=0;t{const l=new Image;e.match(/^data:/)||(l.crossOrigin="Anonymous"),l.onload=()=>{const e=l.width,c=l.height,_=this.createTextureFromHTMLImageElement(l,{level:t,internalFormat:n,width:e,height:c,border:i,format:o,type:a,generateMipmap:r});s(_)},l.src=e}))}updateLevel0TextureAndGenerateMipmap(e,t,{width:n,height:i,format:o,type:a}){const r=this.getWebGLResource(e);this.__glw.bindTexture2D(0,r);const s=this.__glw.getRawContextAsWebGL2();s.texSubImage2D(s.TEXTURE_2D,0,0,0,n,i,o.index,a.index,t),s.generateMipmap(s.TEXTURE_2D),this.__glw.unbindTexture2D(0)}updateTexture(e,t,{level:n,xoffset:i,yoffset:o,width:a,height:r,format:s,type:l}){const c=this.getWebGLResource(e);this.__glw.bindTexture2D(0,c);const _=this.__glw.getRawContextAsWebGL2();_.texSubImage2D(_.TEXTURE_2D,n,0,0,a,r,s.index,l.index,t),this.__glw.unbindTexture2D(0)}deleteFrameBufferObject(e){const t=this.getWebGLResource(e),n=this.__glw.getRawContext();null!=t&&(n.deleteFramebuffer(t),this.__webglResources.delete(e))}deleteRenderBuffer(e){const t=this.__glw.getRawContext(),n=this.getWebGLResource(e);t.deleteRenderbuffer(n),this.__webglResources.delete(e)}deleteTexture(e){const t=this.getWebGLResource(e),n=this.__glw.getRawContext();null!=t&&(n.deleteTexture(t),this.__webglResources.delete(e))}createDummyTexture(e="rgba(255,255,255,1)"){const t=document.createElement("canvas");t.width=1,t.height=1;const n=t.getContext("2d");return n.fillStyle=e,n.fillRect(0,0,1,1),this.createTextureFromImageBitmapData(t,{level:0,internalFormat:a.d.RGBA8,width:1,height:1,border:0,format:r.V.RGBA,type:l.r.UnsignedByte,generateMipmap:!1})}createDummyBlackTexture(){return this.__createDummyTextureInner("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg==")}createDummyWhiteTexture(){return this.__createDummyTextureInner("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5/hPwAIAgL/4d1j8wAAAABJRU5ErkJggg==")}createDummyNormalTexture(){return this.__createDummyTextureInner("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOsr///HwAGgAL+v1RumAAAAABJRU5ErkJggg==")}__createDummyTextureInner(e){const t=v.j.base64ToArrayBuffer(e);return this.createTextureFromTypedArray(new Uint8Array(t),{level:0,internalFormat:a.d.RGBA8,width:1,height:1,border:0,format:r.V.RGBA,type:l.r.UnsignedByte,generateMipmap:!1})}createUniformBuffer(e){const t=this.__glw.getRawContextAsWebGL2();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");const n=t.createBuffer(),i=this.__registerResource(n);return t.bindBuffer(t.UNIFORM_BUFFER,n),t.bufferData(t.UNIFORM_BUFFER,e,t.DYNAMIC_DRAW),t.bindBuffer(t.UNIFORM_BUFFER,null),i}updateUniformBuffer(e,t,n,i){const o=this.__glw.getRawContextAsWebGL2(),a=this.getWebGLResource(e);o.bindBuffer(o.UNIFORM_BUFFER,a),o.bufferSubData(o.UNIFORM_BUFFER,0,t,n,i),o.bindBuffer(o.UNIFORM_BUFFER,null)}bindUniformBlock(e,t,n){const i=this.__glw.getRawContextAsWebGL2();if(null==i)throw new Error("No WebGLRenderingContext set as Default.");const o=this.getWebGLResource(e),a=i.getUniformBlockIndex(o,t);i.uniformBlockBinding(o,a,n)}bindUniformBufferBase(e,t){const n=this.__glw.getRawContextAsWebGL2();if(null==n)throw new Error("No WebGLRenderingContext set as Default.");const i=this.getWebGLResource(t);n.bindBufferBase(n.UNIFORM_BUFFER,e,i)}deleteUniformBuffer(e){const t=this.__glw.getRawContext();null==t&&new Error("No WebGLRenderingContext set as Default.");const n=this.getWebGLResource(e);this.__webglResources.delete(e),t.deleteBuffer(n)}setupUniformBufferDataArea(e){const t=this.__glw.getRawContextAsWebGL2();null==t&&new Error("No WebGLRenderingContext set as Default.");const n=t.createBuffer(),i=this.__registerResource(n),o=this.__glw.getMaxConventionUniformBlocks(),a=this.__glw.getAlignedMaxUniformBlockSize(),r=new Float32Array(a*o/4);x.Is.exist(e)&&r.set(e.subarray(0,r.length)),t.bindBuffer(t.UNIFORM_BUFFER,n),t.bufferData(t.UNIFORM_BUFFER,r,t.DYNAMIC_DRAW,0,0);for(let e=0;e{n.d(t,{X:()=>R});var i=n(3952),o=n(9286),a=n(9216),r=n(3999),s=n(5981),l=n(752),c=n(4097),_=n(1845),h=n(7987),u=n(4587),d=n(810),m=n(9721),f=n(8491),p=n(9974),v=n(2404),A=n(3258),y=n(224),x=n(7348),g=n(4710),I=n(6098),b=n(6406),E=n(2251),T=n(4690),S=n(6683),C=n(903),w=n(4327);class R{constructor(){this.__webglResourceRepository=i.x.getInstance(),this.__dataTextureUid=h.F.InvalidCGAPIResourceUid,this.__dataUBOUid=h.F.InvalidCGAPIResourceUid,this.__lastShader=h.F.InvalidCGAPIResourceUid,this.__lastRenderPassTickCount=-1,this._totalSizeOfGPUShaderDataStorageExceptMorphData=0,this.__latestPrimitivePositionAccessorVersions=[]}static dumpDataTextureBuffer(){this.__isDebugOperationToDataTextureBufferDone=!1}static getVertexShaderMethodDefinitions_dataTexture(){return`\n\n mat4 get_worldMatrix(float instanceId)\n {\n int index = ${m.w.getLocationOffsetOfMemberOfComponent(f.a,"worldMatrix")} + 4 * int(instanceId);\n mat4 matrix = fetchMat4(index);\n\n return matrix;\n }\n\n\n mat3 get_normalMatrix(float instanceId) {\n int index = ${m.w.getLocationOffsetOfMemberOfComponent(f.a,"normalMatrix")} * 4 + 9 * int(instanceId);\n mat3 matrix = fetchMat3No16BytesAligned(index);\n return matrix;\n }\n\n bool get_isVisible(float instanceId) {\n int index = ${m.w.getLocationOffsetOfMemberOfComponent(f.a,"isVisible")} * 4 + int(instanceId);\n float visibility = fetchScalarNo16BytesAligned(index);\n return (visibility > 0.5) ? true : false;\n }\n\n bool get_isBillboard(float instanceId) {\n int index = ${m.w.getLocationOffsetOfMemberOfComponent(f.a,"isBillboard")} * 4 + int(instanceId);\n float isBillboard = fetchScalarNo16BytesAligned(index);\n return (isBillboard > 0.5) ? true : false;\n }\n\n#ifdef RN_IS_VERTEX_SHADER\n #ifdef RN_IS_MORPHING\n vec3 get_position(float vertexId, vec3 basePosition) {\n vec3 position = basePosition;\n int scalar_idx = 3 * int(vertexId);\n for (int i=0; i<${A.D.maxVertexMorphNumberInShader}; i++) {\n\n int basePosIn4bytes = u_dataTextureMorphOffsetPosition[i] * 4 + scalar_idx;\n vec3 addPos = fetchVec3No16BytesAligned(basePosIn4bytes);\n\n position += addPos * u_morphWeights[i];\n if (i == u_morphTargetNumber-1) {\n break;\n }\n }\n\n return position;\n }\n #endif\n#endif\n`}setupShaderForMaterial(e){const t=i.x.getInstance().currentWebGLContextWrapper,n=e._createProgramWebGL(R.getVertexShaderMethodDefinitions_dataTexture(),R.__getShaderProperty,t.isWebGL2);return e._setupBasicUniformsLocations(),e._setUniformLocationsOfMaterialNodes(!1),e._setupAdditionalUniformLocations(b.Z.getPointSpriteShaderSemanticsInfoArray(),!1),R.__globalDataRepository._setUniformLocationsForDataTextureModeOnly(e._shaderProgramUid),n}_reSetupShaderForMaterialBySpector(e,t,n){const i=e._createProgramByUpdatedSources(t,n);return e._setupBasicUniformsLocations(),e._setUniformLocationsOfMaterialNodes(!1),e._setupAdditionalUniformLocations(b.Z.getPointSpriteShaderSemanticsInfoArray(),!1),R.__globalDataRepository._setUniformLocationsForDataTextureModeOnly(e._shaderProgramUid),i}static __getShaderProperty(e,t,n,i,o){var a,s;const l=t.compositionType.getGlslStr(t.componentType);let c;const _=d.d.isTexture(t.compositionType),h=t.semantic.str.replace(".","_");let u="";const m=t.compositionType.getGlslStr(t.componentType);let f="";t.arrayLength&&(f=`[${t.arrayLength}]`),(t.needUniformInDataTextureMode||_)&&(u=` uniform ${m} u_${h}${f};\n`);const p=t.compositionType.getVec4SizeOfProperty(),v=t.compositionType.getNumberOfComponents(),A=R.getOffsetOfPropertyInShader(i,n,e);-1===A&&console.error("Could not get the location offset of the property.");const y=p*(null!==(a=t.arrayLength)&&void 0!==a?a:1);c=`int vec4_idx = ${A} + ${y} * instanceId;\n`,d.d.isArray(t.compositionType)&&(c=`int vec4_idx = ${A} + ${y} * instanceId + ${p} * idxOfArray;\n`,c+=`int scalar_idx = ${4*A} + ${v*(null!==(s=t.arrayLength)&&void 0!==s?s:1)} * instanceId + ${v} * idxOfArray;\n`);let x="";t.componentType===r.r.Int&&t.compositionType!==d.d.Scalar&&(x="i");let g="";if(_||t.needUniformInDataTextureMode){if(!_&&t.needUniformInDataTextureMode){if(!o&&t.arrayLength)return`\n${u}\n`;{let e="";return t.arrayLength&&(e="[idxOfArray]"),`${u}\n${l} get_${h}(highp float _instanceId, const int idxOfArray) {\n return u_${h}${e};\n}\n`}}return u}{g+=`\n${l} get_${h}(highp float _instanceId, const int idxOfArray) {\n int instanceId = int(_instanceId);\n ${c}\n `;let e=`${u}\n${g}`;switch(t.compositionType){case d.d.Vec4:case d.d.Vec4Array:e+=" highp vec4 val = fetchElement(vec4_idx);\n";break;case d.d.Vec3:e+=" vec4 col0 = fetchElement(vec4_idx);\n",e+=` highp ${x}vec3 val = ${x}vec3(col0.xyz);`;break;case d.d.Vec3Array:e+=" vec3 val = fetchVec3No16BytesAligned(scalar_idx);\n";break;case d.d.Vec2:e+=" highp vec4 col0 = fetchElement(vec4_idx);\n",e+=` highp ${x}vec2 val = ${x}vec2(col0.xy);`;break;case d.d.Vec2Array:e+=" highp vec2 val = fetchVec2No16BytesAligned(scalar_idx);\n";break;case d.d.Scalar:e+=" vec4 col0 = fetchElement(vec4_idx);\n",t.componentType===r.r.Int?e+=" int val = int(col0.x);":t.componentType===r.r.Bool?e+=" bool val = bool(col0.x);":e+=" float val = col0.x;";break;case d.d.ScalarArray:e+=" float col0 = fetchScalarNo16BytesAligned(scalar_idx);\n",t.componentType===r.r.Int?e+=" int val = int(col0);":t.componentType===r.r.Bool?e+=" bool val = bool(col0);":e+=" float val = col0;";break;case d.d.Mat4:case d.d.Mat4Array:e+=" mat4 val = fetchMat4(vec4_idx);\n";break;case d.d.Mat3:e+=" mat3 val = fetchMat3(vec4_idx);\n";break;case d.d.Mat3Array:e+=" mat3 val = fetchMat3No16BytesAligned(scalar_idx);\n";break;case d.d.Mat2:e+=" mat2 val = fetchMat2(vec4_idx);\n";break;case d.d.Mat2Array:e+=" mat2 val = fetchMat2No16BytesAligned(scalar_idx);\n";break;case d.d.Mat4x3Array:e+=" mat4x3 val = fetchMat4x3(vec4_idx);\n";break;default:e+=""}return e+="\n return val;\n}\n",e}}static getOffsetOfPropertyInShader(e,t,n){return e?x.$.getInstance().getLocationOffsetOfProperty(t):C.r.getLocationOffsetOfMemberOfMaterial(n,t)}$load(e){const t=e.mesh;if(T.Is.not.exist(t))c.$.alertNoMeshSet(e);else if(R.__currentComponentSIDs=R.__globalDataRepository.getValue(u.f5.CurrentComponentSIDs,0),(0,w.iC)(e)||(0,b.M)(this,e),!this.__isMeshSetup(t)){this.deleteDataTexture(),(0,w.Pj)(t);const e=t.getPrimitiveNumber();for(let n=0;nc&&console.warn("The buffer size exceeds the size of the data texture.");const l=new Float32Array(t.getArrayBuffer(),i,s/4);this.__webglResourceRepository.updateTexture(this.__dataTextureUid,l,{level:0,xoffset:0,yoffset:0,width:o.B.bufferWidthLength,height:n,format:a.V.RGBA,type:r.r.Float}),R.__isDebugOperationToDataTextureBufferDone||(I.Kf.downloadTypedArray("Rhodonite_dataTextureBuffer.bin",l),R.__isDebugOperationToDataTextureBufferDone=!0)}else{const n=e.getBuffer(l.$.GPUVertexData);let _,h=0,u=new ArrayBuffer(0);T.Is.exist(n)&&(h=n.takenSizeInByte,u=n.getArrayBuffer());{const n=e.getBuffer(l.$.GPUVertexData);let a=0;T.Is.exist(n)&&(a=n.takenSizeInByte);let r=new ArrayBuffer(0);T.Is.exist(n)&&(r=n.getArrayBuffer());const s=t.takenSizeInByte-i,h=4*(o.B.bufferWidthLength-s/4/4%o.B.bufferWidthLength)*4,u=I.Kf.concatArrayBuffers2({finalSize:c,srcs:[t.getArrayBuffer(),r],srcsCopySize:[s+h,a],srcsOffset:[i,0]});s+h+a>c&&console.warn("The buffer size exceeds the size of the data texture."),_=new Float32Array(u),A.D.totalSizeOfGPUShaderDataStorageExceptMorphData=t.takenSizeInByte+h}this.__dataTextureUid=this.__webglResourceRepository.createTextureFromTypedArray(_,{level:0,internalFormat:s.d.RGBA32F,width:o.B.bufferWidthLength,height:o.B.bufferHeightLength,border:0,format:a.V.RGBA,type:r.r.Float,generateMipmap:!1})}}deleteDataTexture(){null!=this.__dataTextureUid&&(this.__webglResourceRepository.deleteTexture(this.__dataTextureUid),this.__dataTextureUid=h.F.InvalidCGAPIResourceUid)}common_$prerender(){this.__createAndUpdateDataTexture(),this.__createAndUpdateUBO(),this.__lightComponents=v.C.getComponentsWithType(S.r)}__isUboUse(){return this.__webglResourceRepository.currentWebGLContextWrapper.isWebGL2&&A.D.isUboEnabled}__createAndUpdateUBO(){if(this.__isUboUse()){const e=this.__webglResourceRepository.currentWebGLContextWrapper,t=e.getAlignedMaxUniformBlockSize(),n=e.getMaxConventionUniformBlocks(),i=o.B.getInstance().getBuffer(l.$.GPUInstanceData);if(this.__dataUBOUid===h.F.InvalidCGAPIResourceUid)this.__dataUBOUid=this.__webglResourceRepository.setupUniformBufferDataArea(new Float32Array(i.getArrayBuffer()));else{const e=new Float32Array(i.getArrayBuffer());this.__webglResourceRepository.updateUniformBuffer(this.__dataUBOUid,e,0,t*n/4)}}}attachGPUData(e){}attachGPUDataInner(e,t){}attachShaderProgram(e){const t=e._shaderProgramUid;if(t!==this.__lastShader){const e=this.__webglResourceRepository.currentWebGLContextWrapper.getRawContext(),n=this.__webglResourceRepository.getWebGLResource(t);e.useProgram(n),this.__lastShader=t}}attachVertexData(e,t,n,i){}attachVertexDataInner(e,t,n,i,o){const a=t.vertexHandles,r=i.getRawContext(),s=this.__webglResourceRepository.getWebGLResource(e.getVaoUids(n));if(null!=s)i.bindVertexArray(s);else{this.__webglResourceRepository.setVertexDataToPipeline(a,t,e._variationVBOUid);const n=this.__webglResourceRepository.getWebGLResource(a.iboHandle);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,n)}}static getInstance(){return this.__instance||(this.__instance=new R),this.__instance}__setCurrentComponentSIDsForEachRenderPass(e,t,n){if(n){const e=E.x.getInstance().getModule("xr").WebXRSystem.getInstance();let n=-1;e.isWebXRMode&&(n=e.isMultiView()?e._getCameraComponentSIDAt(0):e._getCameraComponentSIDAt(t)),R.__currentComponentSIDs._v[g.z.CameraComponentTID]=n}else{let t=e.cameraComponent;null==t&&(t=v.C.getComponent(y.M,y.M.current)),R.__currentComponentSIDs._v[g.z.CameraComponentTID]=t?t.componentSID:-1}}__setCurrentComponentSIDsForEachPrimitive(e,t,n){R.__currentComponentSIDs._v[0]=t.materialSID,e.uniform1fv(n.currentComponentSIDs,R.__currentComponentSIDs._v)}common_$render(e,t,n){"undefined"!=typeof spector&&spector.setMarker("| | DataTexture:common_$render#");const i=this.__webglResourceRepository.currentWebGLContextWrapper,o=i.getRawContext(),a=b.Z.isVrMainPass(t),r=b.Z.getDisplayNumber(a);for(let n=0;n{n.d(t,{I:()=>E});var i=n(3952),o=n(1845),a=n(7987),r=n(4587),s=n(2404),l=n(6683),c=n(3258),_=n(9216),h=n(3999),u=n(5981),d=n(9974),m=n(810),f=n(1813),p=n(9286),v=n(5324),A=n(752),y=n(7348),x=n(6098),g=n(6406),I=n(4690),b=n(4327);class E{constructor(){this.__webglResourceRepository=i.x.getInstance(),this.__dataTextureUid=a.F.InvalidCGAPIResourceUid,this.__lastShader=-1,this.__lastRenderPassTickCount=-1,this.__latestPrimitivePositionAccessorVersions=[]}setupShaderForMaterial(e){const t=i.x.getInstance().currentWebGLContextWrapper,n=e._createProgramWebGL(E.__vertexShaderMethodDefinitions_uniform,r.f5.getShaderProperty,t.isWebGL2);e._setupBasicUniformsLocations(),e._setUniformLocationsOfMaterialNodes(!0);const o=E.componentMatrices,a=g.Z.getPointSpriteShaderSemanticsInfoArray();return e._setupAdditionalUniformLocations(o.concat(a),!0),E.__globalDataRepository._setUniformLocationsForUniformModeOnly(e._shaderProgramUid),n}_reSetupShaderForMaterialBySpector(e,t,n){const i=e._createProgramByUpdatedSources(t,n);e._setupBasicUniformsLocations(),e._setUniformLocationsOfMaterialNodes(!0);const o=E.componentMatrices,a=g.Z.getPointSpriteShaderSemanticsInfoArray();return e._setupAdditionalUniformLocations(o.concat(a),!0),E.__globalDataRepository._setUniformLocationsForUniformModeOnly(e._shaderProgramUid),i}$load(e){const t=e.mesh;if(I.Is.exist(t)&&((0,b.iC)(e)||(0,g.M)(this,e),!this.__isMeshSetup(t))){(0,b.Pj)(t);const e=t.getPrimitiveNumber();for(let n=0;np.B.bufferHeightLength&&console.warn("The buffer size exceeds the size of the data texture.");const t=p.B.bufferWidthLength*p.B.bufferHeightLength*4*4,n=x.Kf.concatArrayBuffers2({finalSize:t,srcs:[e.getArrayBuffer()],srcsCopySize:[e.takenSizeInByte],srcsOffset:[0]}),i=new Float32Array(n);this.__dataTextureUid=this.__webglResourceRepository.createTextureFromTypedArray(i,{level:0,internalFormat:u.d.RGBA32F,width:p.B.bufferWidthLength,height:p.B.bufferHeightLength,border:0,format:_.V.RGBA,type:h.r.Float,generateMipmap:!1})}}attachGPUData(e){}attachShaderProgram(e){}attachVertexData(e,t,n,i){}attachVertexDataInner(e,t,n,i,o){const a=t.vertexHandles,r=this.__webglResourceRepository.getWebGLResource(e.getVaoUidsByPrimitiveUid(n)),s=i.getRawContext();if(null!=r)i.bindVertexArray(r);else{this.__webglResourceRepository.setVertexDataToPipeline(a,t,o);const e=this.__webglResourceRepository.getWebGLResource(a.iboHandle);s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e)}}dettachVertexData(e){const t=e.getRawContext();e.bindVertexArray&&e.bindVertexArray(null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),t.bindBuffer(t.ARRAY_BUFFER,null)}static getInstance(){return this.__instance||(this.__instance=new E),this.__instance}common_$render(e,t,n){"undefined"!=typeof spector&&spector.setMarker("| | Uniform:$render#");const i=this.__webglResourceRepository.currentWebGLContextWrapper,o=i.getRawContext(),a=g.Z.isVrMainPass(t),r=g.Z.getDisplayNumber(a);for(let s=0;s{n.d(t,{Z:()=>r});var i=n(7683),o=n(6042),a=n(9430);const r=function(e){return i.V.isDataTextureApproach(e)?a.X.getInstance():(i.V.isUniformApproach(e),o.I.getInstance())}},8511:(e,t,n)=>{n.r(t),n.d(t,{default:()=>_});var i=n(3007),o=n(836),a=n(5551),r=n(3952),s=n(6042),l=n(9430);const c=Object.freeze({getRenderingStrategy:i.Z,GLSLShader:o.m,WebGLContextWrapper:a.d,WebGLResourceRepository:r.x,WebGLStrategyUniform:s.I,WebGLStrategyDataTexture:l.X}),_=c;(0,eval)("this").RnWebGL=c},836:(e,t,n)=>{n.d(t,{m:()=>l});var i=n(7683),o=n(4587),a=n(128),r=n(3952),s=n(8430);class l{constructor(){this.__webglResourceRepository=r.x.getInstance()}get glsl_fragColor(){const e=this.__webglResourceRepository;return null!=e.currentWebGLContextWrapper&&e.currentWebGLContextWrapper.isWebGL2?"":"gl_FragColor = rt0;\n"}get glsl_textureCube(){return this.__webglResourceRepository.currentWebGLContextWrapper.isWebGL2?"texture":"textureCube"}static get glslMainBegin(){return"\nvoid main() {\n"}static get glslMainEnd(){return"\n}\n "}getGlslVertexShaderProperies(e=""){return e}get prerequisites(){return"uniform float u_materialSID;\n"}get mainPrerequisites(){const e=s.l.currentProcessApproach;return i.V.isDataTextureApproach(e)?"\n":"\n "}static getStringFromShaderAnyDataType(e){return e instanceof o.wy?"u_"+e.str:a.T.isInstanceOfVertexAttributeClass(e)?e.shaderStr:e}}},2647:(e,t,n)=>{n.d(t,{I:()=>o});var i=n(836);class o extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__valueInputs=t,this.__valueOutputs=n}get vertexShaderDefinitions(){let e=`void ${this.__functionName}(\nin bool context,\n `;for(let t=0;t{n.d(t,{$:()=>o});var i=n(836);class o extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__valueInputs=t,this.__valueOutputs=n}get vertexShaderDefinitions(){let e=`void ${this.__functionName}(`;for(let t=0;t{n.d(t,{i:()=>a});var i=n(836),o=n(3999);class a extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__compositionType=t,this.__componentType=n,this.__constantValueStr=""}setConstantValue(e){let t="";this.__componentType.isFloatingPoint()?t=e.glslStrAsFloat:this.__componentType.isInteger()?t=e.glslStrAsInt:this.__componentType===o.r.Bool&&(t=e.x?"true":"false"),this.__constantValueStr=t}get vertexShaderDefinitions(){return`\n void ${this.__functionName}(\n out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n outValue = ${this.__constantValueStr};\n }\n `}get pixelShaderDefinitions(){return`\n void ${this.__functionName}(\n out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n outValue = ${this.__constantValueStr};\n }\n `}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},4212:(e,t,n)=>{n.d(t,{x:()=>a});var i=n(836),o=n(3591);class a extends i.m{constructor(){super()}static getInstance(){return this.__instance||(this.__instance=new a),this.__instance}get vertexShaderDefinitions(){return"\n void outPosition(in vec4 inPosition) {\n gl_Position = inPosition;\n }\n "}get vertexShaderBody(){return"\n\n "}get pixelShaderDefinitions(){const e=this.glsl_fragColor;let t="";return""!==e&&(t="vec4"),`\n void outColor(in vec4 inColor) {\n ${t} rt0 = inColor;\n ${e}\n }\n `}getPixelShaderBody(){return""}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}a.materialElement=o.Z.PBRShading},4109:(e,t,n)=>{n.d(t,{p:()=>o});var i=n(836);class o extends i.m{constructor(){super()}get vertexShaderDefinitions(){return"\n "}get pixelShaderDefinitions(){return"\n "}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},6796:(e,t,n)=>{n.d(t,{S:()=>o});var i=n(836);class o extends i.m{constructor(){super(),this.__materialNodeUid=0,this.vertexShaderBody="\n "}set materialNodeUid(e){this.__materialNodeUid=e}getPixelShaderBody(){return"\n "}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},204:(e,t,n)=>{n.d(t,{$:()=>o});var i=n(836);class o extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__compositionType=t,this.__componentType=n,this.__variableName="",this.__valueStr=""}setVariableName(e){this.__variableName=e}setDefaultValue(e){this.__valueStr=e.toString()}get vertexShaderDefinitions(){return`\n uniform ${this.__compositionType.getGlslStr(this.__componentType)} u_${this.__variableName}; // initialValue=${this.__valueStr}\n void ${this.__functionName}(out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n#else\n float materialSID = u_materialSID;\n#endif\n\noutValue = get_${this.__variableName}(materialSID, 0);\n }\n `}get pixelShaderDefinitions(){return`\n uniform ${this.__compositionType.getGlslStr(this.__componentType)} u_${this.__variableName}; // initialValue=${this.__valueStr}\n void ${this.__functionName}(out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n#else\n float materialSID = u_materialSID;\n#endif\n\noutValue = get_${this.__variableName}(materialSID, 0);\n }\n `}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},9071:(e,t,n)=>{n.d(t,{e:()=>o});var i=n(836);class o extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__compositionType=t,this.__componentType=n,this.__variableName=""}setVariableName(e){this.__variableName=e}get vertexShaderDefinitions(){return`\n out ${this.__compositionType.getGlslStr(this.__componentType)} ${this.__variableName};\n void ${this.__functionName}(\n in ${this.__compositionType.getGlslStr(this.__componentType)} value) {\n ${this.__variableName} = value;\n }\n `}get pixelShaderDefinitions(){return`\n in ${this.__compositionType.getGlslStr(this.__componentType)} ${this.__variableName};\n void ${this.__functionName}(\n out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n outValue = ${this.__variableName};\n }\n `}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},3667:(e,t,n)=>{n.d(t,{N:()=>T}),new Uint8Array([0]);const i=[171,75,84,88,32,50,48,187,13,10,26,10];var o,a,r,s,l,c,_,h,u;(u=o||(o={}))[u.NONE=0]="NONE",u[u.BASISLZ=1]="BASISLZ",u[u.ZSTD=2]="ZSTD",u[u.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(a||(a={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(r||(r={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(s||(s={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(l||(l={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(c||(c={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(_||(_={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(h||(h={}));class d{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=o.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:a.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:r.UNSPECIFIED,colorPrimaries:s.SRGB,transferFunction:s.SRGB,flags:c.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}}class m{constructor(e,t,n,i){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=i,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==t&&ie.arrayBuffer())).then((e=>WebAssembly.instantiate(e,g))).then(this._init):WebAssembly.instantiate(Buffer.from(b,"base64"),g).then(this._init),A)}_init(e){y=e.instance,g.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!y)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,i=y.exports.malloc(n);x.set(e,i),t=t||Number(y.exports.ZSTD_findDecompressedSize(i,n));const o=y.exports.malloc(t),a=y.exports.ZSTD_decompress(o,t,i,n),r=x.slice(o,o+a);return y.exports.free(i),y.exports.free(o),r}}const b="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAw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BfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFI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iEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQ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gAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAa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EEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANg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AAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",E="ETC1_RGB";class T{constructor(){"undefined"==typeof MSC_TRANSCODER&&console.error("Failed to call MSC_TRANSCODER() function. Please check to import msc_basis_transcoder.js."),this.__mscTranscoderPromise=this.__loadMSCTranscoder()}static getInstance(){return this.__instance||(this.__instance=new T),this.__instance}transcode(e){const t=this.__parse(e);if(t.pixelDepth>0)throw new Error("Only 2D textures are currently supported");if(t.layerCount>1)throw new Error("Array textures are not currently supported");if(t.faceCount>1)throw new Error("Cube textures are not currently supported");return t.supercompressionScheme===o.ZSTD?(null==T.__zstdDecoder&&(T.__zstdDecoder=new I),T.__zstdDecoder.init().then((()=>this.__mscTranscoderPromise.then((()=>this.__transcodeData(t)))))):this.__mscTranscoderPromise.then((()=>this.__transcodeData(t)))}__loadMSCTranscoder(){return new Promise((e=>{T.__mscTranscoderModule&&e(),MSC_TRANSCODER().then((t=>{t.initTranscoders(),T.__mscTranscoderModule=t,e()}))}))}__getDeviceDependentParameters(e){const t=p.F.getWebGLResourceRepository().currentWebGLContextWrapper,n=t.webgl2ExtCTAstc||t.webgl1ExtCTAstc,i=t.webgl2ExtCTBptc||t.webgl1ExtCTBptc,o=t.webgl2ExtCTS3tc||t.webgl1ExtCTS3tc,a=t.webgl2ExtCTPvrtc||t.webgl1ExtCTPvrtc,r=t.webgl2ExtCTEtc||t.webgl1ExtCTEtc,s=t.webgl2ExtCTEtc1||t.webgl1ExtCTEtc1;let l,c;return n?(l="ASTC_4x4_RGBA",c=v.b.ASTC_RGBA_4x4):i?(l="BC7_RGBA",c=v.b.BPTC_RGBA):o?e?(l="BC3_RGBA",c=v.b.S3TC_RGBA_DXT5):(l="BC1_RGB",c=v.b.S3TC_RGB_DXT1):a?e?(l="PVRTC1_4_RGBA",c=v.b.PVRTC_RGBA_4BPPV1):(l="PVRTC1_4_RGB",c=v.b.PVRTC_RGB_4BPPV1):r?e?(l="ETC2_RGBA",c=v.b.ETC2_RGBA8_EAC):(l=E,c=v.b.ETC2_RGB8):s?(l=E,c=v.b.ETC1_RGB):(l="RGBA32",c=v.b.RGBA8_EXT),{transcodeTargetStr:l,compressionTextureType:c}}__parse(e){return function(e){const t=new Uint8Array(e.buffer,e.byteOffset,i.length);if(t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||t[4]!==i[4]||t[5]!==i[5]||t[6]!==i[6]||t[7]!==i[7]||t[8]!==i[8]||t[9]!==i[9]||t[10]!==i[10]||t[11]!==i[11])throw new Error("Missing KTX 2.0 identifier.");const n=new d,o=17*Uint32Array.BYTES_PER_ELEMENT,a=new m(e,i.length,o,!0);n.vkFormat=a._nextUint32(),n.typeSize=a._nextUint32(),n.pixelWidth=a._nextUint32(),n.pixelHeight=a._nextUint32(),n.pixelDepth=a._nextUint32(),n.layerCount=a._nextUint32(),n.faceCount=a._nextUint32();const r=a._nextUint32();n.supercompressionScheme=a._nextUint32();const s=a._nextUint32(),l=a._nextUint32(),c=a._nextUint32(),_=a._nextUint32(),h=a._nextUint64(),u=a._nextUint64(),p=new m(e,i.length+o,3*r*8,!0);for(let t=0;t>t),l=Math.max(1,i>>t),f=new u.ImageInfo(m,r,l,t);let p=e.levels[t].levelData;const y=e.levels[t].uncompressedByteLength,x=f.numBlocksX*f.numBlocksY*c.bytesPlane[0];e.supercompressionScheme===o.ZSTD&&(p=T.__zstdDecoder.decode(p,y));let g=0;const I=t*Math.max(e.layerCount,1)*a*Math.max(e.pixelDepth,1);for(let n=0;n0?c.rgbSliceByteLength:0,f.alphaByteLength=c.alphaSliceByteLength,a=n.transcodeImage(v,i,f,0,!1)}if(null!=(null==a?void 0:a.transcodedImage)){const e=a.transcodedImage.get_typed_memory_view().slice();a.transcodedImage.delete();const n={level:t,width:r,height:l,buffer:e};A.push(n)}}}return y}__hasAlpha(e,t){return 1===t?e.samples[0].channelID===h.RGBA:2===e.samples.length&&(e.samples[0].channelID===_.AAA||e.samples[1].channelID===_.AAA)}}},3870:(e,t,n)=>{n.d(t,{V:()=>i});class i{constructor(e,t,n){this.__canvas=e,this.__context=e.getContext("webgpu"),this.__gpuAdapter=t,this.__gpuDevice=n;const i=navigator.gpu.getPreferredCanvasFormat();this.__context.configure({device:this.__gpuDevice,format:i,alphaMode:"opaque"})}get canvas(){return this.__canvas}get gpuAdapter(){return this.__gpuAdapter}get gpuDevice(){return this.__gpuDevice}get context(){return this.__context}}},1193:(e,t,n)=>{n.d(t,{g:()=>_});var i=n(3449),o=n(810),a=n(5981),r=n(128),s=n(4690),l=n(7987),c=n(580);class _ extends l.F{constructor(){super(),this.__webGpuResources=new Map,this.__webGpuRenderPipelineMap=new Map,this.__materialStateVersionMap=new Map,this.__resourceCounter=l.F.InvalidCGAPIResourceUid,this.__bindGroupTextureMap=new Map,this.__bindGroupLayoutTextureMap=new Map,this.__bindGroupSamplerMap=new Map,this.__bindGroupLayoutSamplerMap=new Map}addWebGpuDeviceWrapper(e){this.__webGpuDeviceWrapper=e}static getInstance(){return this.__instance||(this.__instance=new _),this.__instance}getResourceNumber(){return++this.__resourceCounter}__registerResource(e){const t=this.getResourceNumber();return e._resourceUid=t,this.__webGpuResources.set(t,e),t}getCanvasSize(){const e=this.__webGpuDeviceWrapper.canvas;return[e.width,e.height]}createTextureFromImageBitmapData(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:l}){const c=this.__webGpuDeviceWrapper.gpuDevice,_=c.createTexture({size:[i,o,1],format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT});return c.queue.copyExternalImageToTexture({source:e},{texture:_},[i,o]),this.__registerResource(_)}createTextureSampler({magFilter:e,minFilter:t,wrapS:n,wrapT:i,wrapR:o,anisotropy:r,isPremultipliedAlpha:s}){const l=this.__webGpuDeviceWrapper.gpuDevice,c=r?4:1,_={magFilter:e.webgpu,minFilter:t.webgpu,mipmapFilter:t===a.d.LinearMipmapLinear||t===a.d.NearestMipmapLinear?"linear":"nearest",addressModeU:n.webgpu,addressModeV:i.webgpu,addressModeW:o.webgpu,lodMinClamp:0,lodMaxClamp:0,maxAnisotropy:c};"nearest"!==_.magFilter&&"nearest"!==_.minFilter&&"nearest"!==_.mipmapFilter||(_.maxAnisotropy=1);const h=l.createSampler(_);return this.__registerResource(h)}createVertexBuffer(e){const t=this.__webGpuDeviceWrapper.gpuDevice.createBuffer({size:e.byteLength,usage:GPUBufferUsage.VERTEX,mappedAtCreation:!0});return new Uint8Array(t.getMappedRange()).set(e.getUint8Array()),t.unmap(),this.__registerResource(t)}createVertexBufferFromTypedArray(e){const t=this.__webGpuDeviceWrapper.gpuDevice.createBuffer({size:e.byteLength,usage:GPUBufferUsage.VERTEX,mappedAtCreation:!0});return new Uint8Array(t.getMappedRange()).set(new Uint8Array(e.buffer)),t.unmap(),this.__registerResource(t)}createIndexBuffer(e){const t=this.__webGpuDeviceWrapper.gpuDevice,n=i.j.addPaddingBytes(e.byteLength,4),o=t.createBuffer({size:n,usage:GPUBufferUsage.INDEX,mappedAtCreation:!0});return new Uint8Array(o.getMappedRange()).set(e.getUint8Array()),o.unmap(),this.__registerResource(o)}updateVertexBuffer(e,t){const n=this.__webGpuResources.get(t);if(s.Is.not.exist(n))throw new Error("Not found VBO.");n.mapAsync(GPUMapMode.WRITE).then((()=>{new Uint8Array(n.getMappedRange()).set(e.bufferView.getUint8Array()),n.unmap()}))}updateIndexBuffer(e,t){const n=this.__webGpuResources.get(t);if(s.Is.not.exist(n))throw new Error("Not found IBO.");n.mapAsync(GPUMapMode.WRITE).then((()=>{new Uint8Array(n.getMappedRange()).set(e.getUint8Array()),n.unmap()}))}deleteVertexBuffer(e){const t=this.__webGpuResources.get(e);if(s.Is.not.exist(t))throw new Error("Not found VBO.");t.destroy(),this.__webGpuResources.delete(e)}createVertexBufferAndIndexBuffer(e){let t;e.hasIndices()&&(t=this.createIndexBuffer(e.indicesAccessor));const n=[];for(let e=0;e{const a=this.createVertexBuffer(t),s=r.T.toAttributeSlotFromJoinedString(e.attributeSemantics[o]);n[s]=!0,i.push(a)})),{vaoHandle:-1,iboHandle:t,vboHandles:i,attributesFlags:n,setComplete:!1}}updateVertexBufferAndIndexBuffer(e,t){t.iboHandle&&this.updateIndexBuffer(e.indicesAccessor,t.iboHandle);const n=e.attributeAccessors;for(let e=0;e{const n=this.__webGpuResources.get(e);r.setVertexBuffer(t+1,n)})),e.hasIndices()){const t=this.__webGpuResources.get(c.iboHandle),n=e.getIndexBitSize();r.setIndexBuffer(t,n);const i=e.indicesAccessor;r.drawIndexed(i.elementCount,_.meshEntitiesInner.length)}else{const t=e.attributeAccessors[0].elementCount;r.draw(t,_.meshEntitiesInner.length)}r.end()}getOrCreateRenderPipeline(e,t,n,i){if(this.__webGpuRenderPipelineMap.has(e)){if(this.__materialStateVersionMap.get(e)===n.stateVersion)return this.__webGpuRenderPipelineMap.get(e);this.__webGpuRenderPipelineMap.delete(e),this.__materialStateVersionMap.delete(e),this.__bindGroupTextureMap.delete(e),this.__bindGroupLayoutTextureMap.delete(e),this.__bindGroupSamplerMap.delete(e),this.__bindGroupLayoutSamplerMap.delete(e)}this.createBindGroup(e,n);const o=this.__webGpuDeviceWrapper.gpuDevice,a=navigator.gpu.getPreferredCanvasFormat(),s=this.__webGpuResources.get(n._shaderProgramUid);null!=s&&new Error("Shader Modules is not found");const l=[];l.push({stepMode:"instance",attributes:[{shaderLocation:r.T.Instance.getAttributeSlot(),offset:0,format:"float32x4"}],arrayStride:16}),t.attributeAccessors.forEach(((e,n)=>{const i={shaderLocation:r.T.toAttributeSlotFromJoinedString(t.attributeSemantics[n]),offset:0,format:e.componentType.webgpu+e.compositionType.webgpu};l.push({stepMode:"vertex",arrayStride:t.attributeAccessors[n].actualByteStride,attributes:[i]})}));const c=o.createPipelineLayout({bindGroupLayouts:[this.__bindGroupLayoutStorageBuffer,this.__bindGroupLayoutTextureMap.get(e),this.__bindGroupLayoutSamplerMap.get(e)]}),_=t.primitiveMode.getWebGPUTypeStr(),h=o.createRenderPipeline({layout:c,vertex:{module:s.vsModule,entryPoint:"main",constants:{_materialSID:n.materialSID},buffers:l},fragment:{module:s.fsModule,entryPoint:"main",constants:{_materialSID:n.materialSID},targets:[{format:a}]},primitive:{topology:_},depthStencil:{depthWriteEnabled:!0,depthCompare:"less",format:"depth24plus"}});return this.__webGpuRenderPipelineMap.set(e,h),this.__materialStateVersionMap.set(e,n.stateVersion),h}flush(){this.__webGpuDeviceWrapper.gpuDevice.queue.submit([this.__commandEncoder.finish()]),this.__commandEncoder=void 0}createCubeTexture(e,t,n,i){const o=[];(t[0].posX instanceof ImageBitmap||t[0].posX instanceof HTMLCanvasElement)&&(o.push(t[0].posX),o.push(t[0].negX),o.push(t[0].posY),o.push(t[0].negY),o.push(t[0].posZ),o.push(t[0].negZ));const r=this.__webGpuDeviceWrapper.gpuDevice,s=r.createTexture({dimension:"2d",size:[o[0].width,o[0].height,6],format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT});for(let e=0;e{const t=e.info;if(o.d.isTexture(t.compositionType)){const t=e.value[0],n=e.value[1],o=e.value[2],l=this.__webGpuResources.get(n._textureResourceUid);i.push({binding:t,resource:l.createView()}),a.push({binding:t,texture:{viewDimension:"2d"},visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT}),o.created||o.create();const c=this.__webGpuResources.get(o._samplerResourceUid);r.push({binding:t,resource:c}),s.push({binding:t,sampler:{type:"filtering"},visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT})}}));const l={entries:a},c=n.createBindGroupLayout(l),_=n.createBindGroup({layout:c,entries:i});this.__bindGroupTextureMap.set(e,_),this.__bindGroupLayoutTextureMap.set(e,c);const h={entries:s},u=n.createBindGroupLayout(h),d=n.createBindGroup({layout:u,entries:r});this.__bindGroupSamplerMap.set(e,d),this.__bindGroupLayoutSamplerMap.set(e,u)}}async createTextureFromHTMLImageElement(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:c}){e.crossOrigin="Anonymous";let _=l.F.InvalidCGAPIResourceUid;await e.decode();const h=await createImageBitmap(e);return _=this.createTextureFromImageBitmapData(h,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:c}),_}recreateSystemDepthTexture(){const e=this.__webGpuDeviceWrapper.gpuDevice,t=this.__webGpuDeviceWrapper.canvas;null!=this.__systemDepthTexture&&this.__systemDepthTexture.destroy(),this.__systemDepthTexture=e.createTexture({size:[t.width,t.height],format:"depth24plus",usage:GPUTextureUsage.RENDER_ATTACHMENT})}resizeCanvas(e,t){const n=this.__webGpuDeviceWrapper.canvas;n.width=e,n.height=t,this.recreateSystemDepthTexture()}}},2161:(e,t,n)=>{n.d(t,{p:()=>b});var i=n(4097),o=n(9974),a=n(9286),r=n(752),s=n(1845),l=n(4690),c=n(7987),_=n(4327),h=n(1193),u=n(9721),d=n(8491),m=n(7348),f=n(903),p=n(810),v=n(3999),A=n(4587),y=n(2251),x=n(4710),g=n(2404),I=n(224);class b{constructor(){this.__latestPrimitivePositionAccessorVersions=[],this.__storageBufferUid=c.F.InvalidCGAPIResourceUid}static getInstance(){return this.__instance||(this.__instance=new b),this.__instance}static getVertexShaderMethodDefinitions_storageBuffer(){return`\n\n fn get_worldMatrix(instanceId: u32) -> mat4x4\n {\n let index: u32 = ${u.w.getLocationOffsetOfMemberOfComponent(d.a,"worldMatrix")}u + 4u * instanceId;\n let matrix = fetchMat4(index);\n\n return matrix;\n }\n`}static __getShaderProperty(e,t,n,i){var o,a;const r=t.compositionType.toWGSLType(t.componentType),s=t.semantic.str.replace(".","_");if(p.d.isTexture(t.compositionType))return"";const l=t.compositionType.getVec4SizeOfProperty(),c=t.compositionType.getNumberOfComponents(),_=b.getOffsetOfPropertyInShader(i,n,e);let h;-1===_&&console.error("Could not get the location offset of the property.");const u=l*(null!==(o=t.arrayLength)&&void 0!==o?o:1);h=` let vec4_idx: u32 = ${_}u + ${u}u * instanceId;\n`,p.d.isArray(t.compositionType)&&(h=` let vec4_idx: u32 = ${_}u + ${u} * instanceId + ${l}u * idxOfArray;\n`,h+=` let scalar_idx: u32 = ${4*_} + ${c*(null!==(a=t.arrayLength)&&void 0!==a?a:1)} * instanceId + ${c}u * idxOfArray;\n`);let d=`\nfn get_${s}(instanceId: u32, idxOfArray: u32) -> ${r} {\n${h}\n`;switch(t.compositionType){case p.d.Vec4:case p.d.Vec4Array:d+=" let val = fetchElement(vec4_idx);\n";break;case p.d.Vec3:d+=" let col0 = fetchElement(vec4_idx);\n",d+=` let val = ${r}(col0.xyz);`;break;case p.d.Vec3Array:d+=" let val = fetchVec3No16BytesAligned(scalar_idx);\n";break;case p.d.Vec2:d+=" let col0 = fetchElement(vec4_idx);\n",d+=` let val = ${r}(col0.xy);`;break;case p.d.Vec2Array:d+=" let val = fetchVec2No16BytesAligned(scalar_idx);\n";break;case p.d.Scalar:d+=" let col0 = fetchElement(vec4_idx);\n",t.componentType===v.r.Int?d+=" let val = i32(col0.x);":t.componentType===v.r.Bool?d+=" let val = bool(col0.x);":d+=" let val = col0.x;";break;case p.d.ScalarArray:d+=" let col0 = fetchScalarNo16BytesAligned(scalar_idx);\n",t.componentType===v.r.Int?d+=" let val = i32(col0);":t.componentType===v.r.Bool?d+=" let val = bool(col0);":d+=" let val = col0;";break;case p.d.Mat4:case p.d.Mat4Array:d+=" let val = fetchMat4(vec4_idx);\n";break;case p.d.Mat3:d+=" let val = fetchMat3(vec4_idx);\n";break;case p.d.Mat3Array:d+=" let val = fetchMat3No16BytesAligned(scalar_idx);\n";break;case p.d.Mat2:d+=" let val = fetchMat2(vec4_idx);\n";break;case p.d.Mat2Array:d+=" let val = fetchMat2No16BytesAligned(scalar_idx);\n";break;case p.d.Mat4x3Array:d+=" let val = fetchMat4x3(vec4_idx);\n";break;default:d+=""}return d+="\n return val;\n}\n",d}static getOffsetOfPropertyInShader(e,t,n){return e?m.$.getInstance().getLocationOffsetOfProperty(t):f.r.getLocationOffsetOfMemberOfMaterial(n,t)}$load(e){const t=e.mesh;if(l.Is.exist(t)&&(b.__currentComponentSIDs=b.__globalDataRepository.getValue(A.f5.CurrentComponentSIDs,0),(0,_.iC)(e)||this.__setupShaderProgramForMeshComponent(e),!this.__isMeshSetup(t))){(0,_.Pj)(t);const e=t.getPrimitiveNumber();for(let n=0;n{n.r(t),n.d(t,{default:()=>s});var i=n(3870),o=n(1193),a=n(2161);const r=Object.freeze({WebGpuDeviceWrapper:i.V,WebGpuResourceRepository:o.g,WebGpuStrategyBasic:a.p}),s=r;(0,eval)("this").RnWebGpu=r},5514:(e,t,n)=>{n.d(t,{RQ:()=>x,sz:()=>T,KA:()=>g,_0:()=>E});const i={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})},o={xAxis:0,yAxis:0,button:0,state:i.ComponentState.DEFAULT};class a{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===i.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(o)}updateFromComponent({xAxis:e,yAxis:t,button:n,state:o}){const{normalizedXAxis:a,normalizedYAxis:r}=function(e=0,t=0){let n=e,i=t;if(Math.sqrt(e*e+t*t)>1){const o=Math.atan2(t,e);n=Math.cos(o),i=Math.sin(o)}return{normalizedXAxis:.5*n+.5,normalizedYAxis:.5*i+.5}}(e,t);switch(this.componentProperty){case i.ComponentProperty.X_AXIS:this.value=this.states.includes(o)?a:.5;break;case i.ComponentProperty.Y_AXIS:this.value=this.states.includes(o)?r:.5;break;case i.ComponentProperty.BUTTON:this.value=this.states.includes(o)?n:0;break;case i.ComponentProperty.STATE:this.valueNodeProperty===i.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(o):this.value=this.states.includes(o)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class r{constructor(e,t){if(!(e&&t&&t.visualResponses&&t.gamepadIndices&&0!==Object.keys(t.gamepadIndices).length))throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach((e=>{const n=new a(t.visualResponses[e]);this.visualResponses[e]=n})),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:i.ComponentState.DEFAULT,button:void 0!==this.gamepadIndices.button?0:void 0,xAxis:void 0!==this.gamepadIndices.xAxis?0:void 0,yAxis:void 0!==this.gamepadIndices.yAxis?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=i.ComponentState.DEFAULT,void 0!==this.gamepadIndices.button&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||1===this.values.button?this.values.state=i.ComponentState.PRESSED:(t.touched||this.values.button>i.ButtonTouchThreshold)&&(this.values.state=i.ComponentState.TOUCHED)}void 0!==this.gamepadIndices.xAxis&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===i.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>i.AxisTouchThreshold&&(this.values.state=i.ComponentState.TOUCHED)),void 0!==this.gamepadIndices.yAxis&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===i.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>i.AxisTouchThreshold&&(this.values.state=i.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach((e=>{e.updateFromComponent(this.values)}))}}class s{constructor(e,t,n){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=n,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach((e=>{const t=this.layoutDescription.components[e];this.components[e]=new r(e,t)})),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach((t=>{e.push(t.data)})),e}updateFromGamepad(){Object.values(this.components).forEach((e=>{e.updateFromGamepad(this.xrInputSource.gamepad)}))}}async function l(e){const t=await fetch(e);if(t.ok)return t.json();throw new Error(t.statusText)}var c=n(2749),_=n(6694),h=n(4690),u=n(9207),d=n(2471),m=n(6098),f=n(9190),p=n(2566);const v=new Map,A=Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON_1:"button_1",BUTTON_2:"button_2",BUTTON_3:"button_3",BUTTON_SPECIAL:"button_special"}),y=new Map;async function x(e,t,n){const{profile:i,assetPath:o}=await async function(e,t,n=null,i=!0){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const o=await async function(e){if(!e)throw new Error("No basePath supplied");return await l(`${e}/profilesList.json`)}(t);let a;if(e.profiles.some((e=>{const n=o[e];return n&&(a={profileId:e,profilePath:`${t}/${n.path}`,deprecated:!!n.deprecated}),!!a})),!a){if(!n)throw new Error("No matching profile name found");const e=o[n];if(!e)throw new Error(`No matching profile name found and default profile "${n}" missing.`);a={profileId:n,profilePath:`${t}/${e.path}`,deprecated:!!e.deprecated}}const r=await l(a.profilePath);let s;if(i){let t;if(t="any"===e.handedness?r.layouts[Object.keys(r.layouts)[0]]:r.layouts[e.handedness],!t)throw new Error(`No matching handedness, ${e.handedness}, in profile ${a.profileId}`);t.assetPath&&(s=a.profilePath.replace("profile.json",t.assetPath))}return{profile:r,assetPath:s}}(e,t),a=new s(e,i,o);v.set(e,a);const r=await async function(e){const t=await c.Z.importFromUri(e.assetUrl);return function(e,t){Object.values(e.components).forEach((e=>{e.touchPointNodeName&&t.getChildByName(e.touchPointNodeName,!0)}))}(e,t),t}(a);if(r.isOk())return _.e.convertToRhodoniteObject(r.get())}function g(e,t,n){Array.from(v.values()).forEach((t=>{t.updateFromGamepad(),Object.keys(t.components).forEach((i=>{!function(e,t,n,i){const o=y.get(e.rootNodeName);if(h.Is.not.exist(o))return;if(0===I)return void(I=i);const a=1e-6*(i-I);switch(o){case A.TRIGGER:!function(e,t,n,i){let o=0;const a=y.get(e.rootNodeName);("pressed"===e.values.state||"touched"===e.values.state)&&(console.log(a,e.values.button,t),o=(0,m.kS)({value:e.values.button,defaultValue:0})*i),"right"===t&&(o*=-1),b.x-=.1*o,b.y-=.1*o,b.z-=.1*o,b.x=Math.max(b.x,.05),b.y=Math.max(b.y,.05),b.z=Math.max(b.z,.05),b.x=Math.min(b.x,3),b.y=Math.min(b.y,3),b.z=Math.min(b.z,3),n.viewerScale.copyComponents(b)}(e,t,n,a);break;case A.THUMBSTICK:!function(e,t,n,i){const o=y.get(e.rootNodeName);let a=0,r=0;"pressed"===e.values.state?(console.log(o,e.values.button,e.values.state,t),a=(0,m.kS)({value:e.values.xAxis,defaultValue:0})*i,r=(0,m.kS)({value:e.values.yAxis,defaultValue:0})*i):"touched"===e.values.state&&(a=(0,m.kS)({value:e.values.xAxis,defaultValue:0})*i,r=(0,m.kS)({value:e.values.yAxis,defaultValue:0})*i),a=Math.min(a,1),r=Math.min(r,1);const s=f.d6.zero();"right"===t?(n.viewerAzimuthAngle.x-=.15*a,s.y-=.1*r*n.viewerScale.x):(s.x+=.25*a*n.viewerScale.x,s.z+=.25*r*n.viewerScale.x);p.x.fromCopyQuaternion(n.viewerOrientation).multiply(p.x.rotateY(n.viewerAzimuthAngle.x)).multiplyVectorTo(s,s),n.viewerTranslate.add(s)}(e,t,n,a);break;case A.SQUEEZE:!function(e,t,n,i){const o=y.get(e.rootNodeName);("pressed"===e.values.state||"touched"===e.values.state)&&console.log(o,e.values.button,t)}(e,t);break;case A.BUTTON_1:case A.BUTTON_2:case A.BUTTON_3:case A.BUTTON_SPECIAL:!function(e,t,n,i){const o=y.get(e.rootNodeName);("pressed"===e.values.state||"touched"===e.values.state)&&console.log(o,e.values.button,e.values.state,t)}(e,t);break;case A.TOUCHPAD:"pressed"===(r=e).values.state||"touched"===r.values.state&&0!==r.values.yAxis&&r.values.yAxis}var r}(t.components[i],t.xrInputSource.handedness,n,e)}))}))}y.set("a_button",A.BUTTON_1),y.set("b_button",A.BUTTON_2),y.set("x_button",A.BUTTON_1),y.set("y_button",A.BUTTON_2),y.set("thumbrest",A.BUTTON_3),y.set("menu",A.BUTTON_SPECIAL),y.set("xr_standard_trigger",A.TRIGGER),y.set("xr_standard_squeeze",A.SQUEEZE),y.set("xr_standard_thumbstick",A.THUMBSTICK),y.set("xr_standard_touchpad",A.TOUCHPAD),y.set("trigger",A.TRIGGER),y.set("squeeze",A.SQUEEZE),y.set("thumbstick",A.THUMBSTICK),y.set("touchpad",A.TOUCHPAD);let I=0;const b=f.d6.one();function E(e,t){const n=e.getTagValue("rnEntitiesByNames");Object.values(t.components).forEach((e=>{for(const t in e.visualResponses){const i=e.visualResponses[t],o=n.get(i.valueNodeName);if(h.Is.not.exist(o))console.warn("The entity of the controller doesn't exist");else if("visibility"===i.valueNodeProperty)o.getSceneGraph().isVisible=!!i.value;else if("transform"===i.valueNodeProperty){const e=n.get(i.minNodeName),t=n.get(i.maxNodeName);if(h.Is.not.exist(e)||h.Is.not.exist(t)){console.warn("The min/max Node of the component of the controller doesn't exist");continue}const a=e.getTransform(),r=t.getTransform();o.getTransform().quaternion=u._.qlerp(a.localRotationInner,r.localRotationInner,i.value),o.getTransform().localPosition=d.P.lerp(a.localPositionInner,r.localPositionInner,i.value)}}}))}function T(e){return v.get(e)}},2102:(e,t,n)=>{n.d(t,{X:()=>v});var i=n(7987),o=n(2471),a=n(3496),r=n(7192),s=n(3648),l=n(2251),c=n(5514),_=n(4690),h=n(9190),u=n(963),d=n(4267),m=n(7973),f=n(8583);const p=o.P.fromCopyArray([0,1.1,0]);class v{constructor(){this.__isWebXRMode=!1,this.__spaceType="local",this.__requestedToEnterWebXR=!1,this.__isReadyForWebXR=!1,this.__defaultPositionInLocalSpaceMode=p,this.__canvasWidthForVR=0,this.__canvasHeightForVR=0,this.__controllerEntities=[],this.__xrInputSources=[],this.__viewerTranslate=h.d6.zero(),this.__viewerAzimuthAngle=d.DU.zero(),this.__viewerOrientation=u.y.identity(),this.__viewerScale=h.d6.one(),this.__multiviewFramebufferHandle=-1,this.__multiviewColorTextureHandle=-1,this.__viewerEntity=m._.createGroupEntity(),this.__viewerEntity.tryToSetUniqueName("WebXR Viewer",!0),this.__viewerEntity.tryToSetTag({tag:"type",value:"background-assets"}),this.__leftCameraEntity=m._.createCameraEntity(),this.__leftCameraEntity.tryToSetUniqueName("WebXR Left Camera",!0),this.__leftCameraEntity.tryToSetTag({tag:"type",value:"background-assets"}),this.__leftCameraEntity.getCamera()._xrLeft=!0,this.__rightCameraEntity=m._.createCameraEntity(),this.__rightCameraEntity.tryToSetUniqueName("WebXR Right Camera",!0),this.__rightCameraEntity.tryToSetTag({tag:"type",value:"background-assets"}),this.__rightCameraEntity.getCamera()._xrRight=!0,this.__viewerEntity.getSceneGraph().addChild(this.__leftCameraEntity.getSceneGraph()),this.__viewerEntity.getSceneGraph().addChild(this.__rightCameraEntity.getSceneGraph())}async readyForWebXR(e,t){this.__basePath=t,await l.x.getInstance().loadModule("xr");const n=i.F.getWebGLResourceRepository().currentWebGLContextWrapper;if(null==n)return console.error("WebGL Context is not ready yet."),[];if(this.__glw=n,!await navigator.xr.isSessionSupported("immersive-vr"))throw new Error("WebXR is not supported in this environment.");if(e)e.style.display="block";else{const e=document.createElement("p"),t=document.createElement("a");t.setAttribute("id","enter-vr");const i=document.createTextNode("Enter VR");t.appendChild(i),e.appendChild(t);const o=n.canvas;o.parentNode.insertBefore(e,o),window.addEventListener("click",this.enterWebXR.bind(this))}return this.__isReadyForWebXR=!0,[]}async enterWebXR({initialUserPosition:e,callbackOnXrSessionStart:t=(()=>{}),callbackOnXrSessionEnd:n=(()=>{}),profilePriorities:o=[]}){const a=i.F.getWebGLResourceRepository().currentWebGLContextWrapper;if(null!=a&&this.__isReadyForWebXR){let i;const r=await navigator.xr.requestSession("immersive-vr");this.__xrSession=r,r.addEventListener("end",(()=>{a.__gl.bindFramebuffer(a.__gl.FRAMEBUFFER,null),this.__xrSession=void 0,this.__webglLayer=void 0,this.__xrViewerPose=void 0,this.__xrReferenceSpace=void 0,this.__spaceType="local",this.__isReadyForWebXR=!1,this.__requestedToEnterWebXR=!1,this.__setWebXRMode(!1),f.rFg._makeShaderInvalidateToAllMaterials(),this.__defaultPositionInLocalSpaceMode=p,console.log("XRSession ends."),s.x.stopRenderLoop(),s.x.restartRenderLoop(),n()}));const l=new Promise((e=>{r.addEventListener("inputsourceschange",(t=>{this.__onInputSourcesChange(t,e,o)}))}));return i=await r.requestReferenceSpace("local"),this.__spaceType="local",this.__defaultPositionInLocalSpaceMode=null!=e?e:p,this.__xrReferenceSpace=i,s.x.stopRenderLoop(),await this.__setupWebGLLayer(r,t),this.__requestedToEnterWebXR=!0,s.x.restartRenderLoop(),console.warn("End of enterWebXR."),l}console.error("WebGL context or WebXRSession is not ready yet.")}async exitWebXR(){null!=this.__xrSession&&await this.__xrSession.end()}getCanvasWidthForVr(){return this.__canvasWidthForVR}getCanvasHeightForVr(){return this.__canvasHeightForVR}getControllerEntities(){return this.__controllerEntities}get leftViewMatrix(){return this.__leftCameraEntity.getCamera().viewMatrix}get rightViewMatrix(){return this.__rightCameraEntity.getCamera().viewMatrix}get leftProjectionMatrix(){var e;const t=null===(e=this.__xrViewerPose)||void 0===e?void 0:e.views[0];return a.e.fromCopyFloat32ArrayColumnMajor(_.Is.exist(t)?t.projectionMatrix:a.e.identity()._v)}get rightProjectionMatrix(){var e;const t=null===(e=this.__xrViewerPose)||void 0===e?void 0:e.views[1];return a.e.fromCopyFloat32ArrayColumnMajor(_.Is.exist(t)?t.projectionMatrix:a.e.identity()._v)}get framebuffer(){var e,t;return this.__multiviewFramebufferHandle>0?i.F.getWebGLResourceRepository().getWebGLResource(this.__multiviewFramebufferHandle):null===(t=null===(e=this.__xrSession)||void 0===e?void 0:e.renderState.baseLayer)||void 0===t?void 0:t.framebuffer}isMultiView(){return this.__multiviewFramebufferHandle>0}get requestedToEnterWebXR(){return this.__requestedToEnterWebXR}get xrSession(){return this.__xrSession}get requestedToEnterWebVR(){return this.__requestedToEnterWebXR}get isWebXRMode(){return this.__isWebXRMode}__setWebXRMode(e){this.__isWebXRMode=e,this.__glw._isWebXRMode=e}get isReadyForWebXR(){return this.__isReadyForWebXR}static getInstance(){return this.__instance||(this.__instance=new v),this.__instance}_getViewMatrixAt(e){return 0===e?this.leftViewMatrix:this.rightViewMatrix}_getProjectMatrixAt(e){return 0===e?this.leftProjectionMatrix:this.rightProjectionMatrix}_getViewportAt(e){return 0===e?this._getLeftViewport():this._getRightViewport()}_getLeftViewport(){return r.Lt.fromCopyArray([0,0,this.__canvasWidthForVR/2,this.__canvasHeightForVR])}_getRightViewport(){return this.__multiviewFramebufferHandle>0?r.Lt.fromCopyArray([0,0,this.__canvasWidthForVR/2,this.__canvasHeightForVR]):r.Lt.fromCopyArray([this.__canvasWidthForVR/2,0,this.__canvasWidthForVR/2,this.__canvasHeightForVR])}_setValuesToGlobalDataRepository(){this.__leftCameraEntity.getCamera().projectionMatrix=this.leftProjectionMatrix,this.__rightCameraEntity.getCamera().projectionMatrix=this.rightProjectionMatrix,this.__leftCameraEntity.getCamera().setValuesToGlobalDataRepository(),this.__rightCameraEntity.getCamera().setValuesToGlobalDataRepository()}_getCameraWorldPositionAt(e){var t;const n=null===(t=this.__xrViewerPose)||void 0===t?void 0:t.views[e];if(_.Is.exist(n)){const e=n.transform.position,t=this.__defaultPositionInLocalSpaceMode,i=this.__viewerTranslate,a=o.P.add(o.P.fromCopyArray([e.x,e.y,e.z]),t);return o.P.fromCopyArray([(a.x+i.x)*this.__viewerScale.x,(a.y+i.y)*this.__viewerScale.y,(a.z+i.z)*this.__viewerScale.z])}return this.__defaultPositionInLocalSpaceMode}_getCameraComponentSIDAt(e){return 0===e?this.__leftCameraEntity.getCamera().componentSID:this.__rightCameraEntity.getCamera().componentSID}_preRender(e,t){this.isWebXRMode&&this.__requestedToEnterWebXR&&null!=t&&(this.__updateView(t),this.__updateInputSources(t),(0,c.KA)(e,t,{viewerTranslate:this.__viewerTranslate,viewerScale:this.__viewerScale,viewerOrientation:this.__viewerOrientation,viewerAzimuthAngle:this.__viewerAzimuthAngle}))}_postRender(){if(this.__isWebXRMode){const e=this.__glw.getRawContextAsWebGL2();if(this.__multiviewFramebufferHandle>0){const t=i.F.getWebGLResourceRepository();e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[e.DEPTH_STENCIL_ATTACHMENT]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.__xrSession.renderState.baseLayer.framebuffer);const n=t.getWebGLResource(this.__multiviewColorTextureHandle);this.__webglStereoUtil.blit(n,0,0,1,1,this.__canvasWidthForVR,this.__canvasHeightForVR)}}this.requestedToEnterWebVR}async __onInputSourcesChange(e,t,n){this.__xrInputSources.length=0;for(const t of e.added){this.__xrInputSources.push(t);const e=await(0,c.RQ)(t,this.__basePath,n);_.Is.exist(e)&&(this.__controllerEntities.push(e),this.__viewerEntity.getSceneGraph().addChild(e.getSceneGraph()))}t(this.__controllerEntities)}__setCameraInfoFromXRViews(e){if(_.Is.not.exist(e))return void console.warn("xrViewerPose not exist");const t=e.views[0],n=e.views[1];if(_.Is.not.exist(t)||_.Is.not.exist(n))return;const i=e.transform.orientation;this.__viewerOrientation.x=i.x,this.__viewerOrientation.y=i.y,this.__viewerOrientation.z=i.z,this.__viewerOrientation.w=i.w;const r=a.e.fromCopyFloat32ArrayColumnMajor(null==t?void 0:t.transform.matrix),s=a.e.fromCopyFloat32ArrayColumnMajor(null==n?void 0:n.transform.matrix),l=this.__viewerScale.x,c=t.transform.position,u=h.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate),d=h.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate),m=o.P.fromCopyArray([c.x,c.y,c.z]),f=o.P.fromCopyArray([c.x,c.y,c.z]),p=h.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate).add(m),v=h.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate).add(f),A=(u.x+d.x)/2,y=(u.z+d.z)/2,x=(p.x+v.x)/2,g=(p.z+v.z)/2,I=this.__viewerEntity.getTransform();I.localPosition=o.P.fromCopyArray([A,0,y]),I.localScale=o.P.fromCopyArray([l,l,l]),I.localEulerAngles=o.P.fromCopyArray([0,this.__viewerAzimuthAngle.x,0]),r.translateY=p.y,r.translateX=p.x-x,r.translateZ=p.z-g,r.translateY+=m.y,r.translateX+=m.x,r.translateZ+=m.z,s.translateY=v.y,s.translateX=v.x-x,s.translateZ=v.z-g,s.translateY+=f.y,s.translateX+=f.x,s.translateZ+=f.z,this.__leftCameraEntity.getTransform().localMatrix=r,this.__rightCameraEntity.getTransform().localMatrix=s}async __setupWebGLLayer(e,t){var n;const o=null===(n=this.__glw)||void 0===n?void 0:n.getRawContextAsWebGL2();if(null!=o){await o.makeXRCompatible(),this.__webglLayer=new window.XRWebGLLayer(e,o);const n=this.__webglLayer;e.updateRenderState({baseLayer:n,depthNear:.01,depthFar:1e3});const a=i.F.getWebGLResourceRepository();this.__canvasWidthForVR=n.framebufferWidth,this.__canvasHeightForVR=n.framebufferHeight,console.log(this.__canvasWidthForVR),console.log(this.__canvasHeightForVR),this.__multiviewFramebufferHandle,f.rFg._makeShaderInvalidateToAllMaterials(),a.resizeCanvas(this.__canvasWidthForVR,this.__canvasHeightForVR),this.__setWebXRMode(!0),t()}else console.error("WebGL context is not ready for WebXR.")}__updateView(e){this.__xrViewerPose=e.getViewerPose(this.__xrReferenceSpace),this.__setCameraInfoFromXRViews(this.__xrViewerPose)}__updateInputSources(e){this.__xrInputSources.forEach(((t,n)=>{if(_.Is.exist(t.gripSpace)){const i=e.getPose(t.gripSpace,this.__xrReferenceSpace);if(_.Is.exist(i)){const e=this.__controllerEntities[n];if(_.Is.exist(e)){const n=a.e.fromCopyFloat32ArrayColumnMajor(i.transform.matrix),o=a.e.fromCopyMatrix44(n);o.translateY+=this.__defaultPositionInLocalSpaceMode.y,o.translateY+=this.__viewerTranslate.y,e.getTransform().localMatrix=o;const r=(0,c.sz)(t);_.Is.exist(r)?(0,c._0)(e,r):console.warn("motionController not found")}}}}))}}},9131:(e,t,n)=>{n.r(t),n.d(t,{default:()=>A});var i=n(2102),o=n(7973),a=n(3496),r=n(963),s=n(4267),l=n(9190),c=n(2471),_=n(4690),h=n(6312),u=n(7987),d=n(2251),m=n(3648);const f=c.P.fromCopyArray([0,1.1,0]);class p{constructor(){this.__oGlw=new h.Hq,this.__isReadyForWebAR=!1,this.__oArSession=new h.Hq,this.__oWebglLayer=new h.Hq,this.__spaceType="local",this.__isWebARMode=!1,this.__requestedToEnterWebAR=!1,this.__oArViewerPose=new h.Hq,this.__oArReferenceSpace=new h.Hq,this.__defaultPositionInLocalSpaceMode=f,this.__canvasWidthForAR=0,this.__canvasHeightForAR=0,this._cameraEntity=o._.createCameraEntity(),this.__viewerTranslate=l.d6.zero(),this.__viewerAzimuthAngle=s.DU.zero(),this.__viewerOrientation=r.y.identity(),this.__viewerScale=l.d6.one(),this._cameraEntity.tryToSetUniqueName("WebAR Viewer",!0),this._cameraEntity.tryToSetTag({tag:"type",value:"background-assets"})}static getInstance(){return this.__instance||(this.__instance=new p),this.__instance}async readyForWebAR(e){await d.x.getInstance().loadModule("xr");const t=u.F.getWebGLResourceRepository().currentWebGLContextWrapper;if(null==t)throw new Error("WebGL Context is not ready yet.");if(this.__oGlw=new h.bD(t),!await navigator.xr.isSessionSupported("immersive-ar"))throw new Error("WebAR is not supported in this environment.");if(console.log("WebAR is supported."),e)e.style.display="block";else{const e=document.createElement("p"),n=document.createElement("a");n.setAttribute("id","enter-ar");const i=document.createTextNode("Enter AR");n.appendChild(i),e.appendChild(n);const o=t.canvas;o.parentNode.insertBefore(e,o),window.addEventListener("click",this.enterWebAR.bind(this))}return this.__isReadyForWebAR=!0,[]}async enterWebAR({initialUserPosition:e,callbackOnXrSessionStart:t=(()=>{}),callbackOnXrSessionEnd:n=(()=>{})}){const i=u.F.getWebGLResourceRepository().currentWebGLContextWrapper;if(null!=i&&this.__isReadyForWebAR){const o=await navigator.xr.requestSession("immersive-vr");this.__oArSession=new h.bD(o),o.addEventListener("end",(()=>{i.__gl.bindFramebuffer(i.__gl.FRAMEBUFFER,null),this.__oArSession=new h.Hq,this.__oWebglLayer=new h.Hq,this.__oArViewerPose=new h.Hq,this.__oArReferenceSpace=new h.Hq,this.__spaceType="local",this.__isReadyForWebAR=!1,this.__requestedToEnterWebAR=!1,this.__isWebARMode=!1,this.__defaultPositionInLocalSpaceMode=f,console.log("XRSession ends."),m.x.stopRenderLoop(),m.x.restartRenderLoop(),n()}));const a=await o.requestReferenceSpace("local");return this.__spaceType="local",this.__defaultPositionInLocalSpaceMode=null!=e?e:f,this.__oArReferenceSpace=new h.bD(a),m.x.stopRenderLoop(),await this.__setupWebGLLayer(o,t),this.__requestedToEnterWebAR=!0,m.x.restartRenderLoop(),void console.warn("End of enterWebXR.")}console.error("WebGL context or WebXRSession is not ready yet.")}async __setupWebGLLayer(e,t){const n=this.__oGlw.unwrapForce().getRawContext();if(null!=n){await n.makeXRCompatible(),this.__oWebglLayer=new h.bD(window.XRWebGLLayer(e,n));const i=this.__oWebglLayer.unwrapForce();e.updateRenderState({baseLayer:i,depthNear:.1,depthFar:1e4});const o=u.F.getWebGLResourceRepository();this.__canvasWidthForAR=i.framebufferWidth,this.__canvasHeightForAR=i.framebufferHeight,console.log(this.__canvasWidthForAR),console.log(this.__canvasHeightForAR),o.resizeCanvas(this.__canvasWidthForAR,this.__canvasHeightForAR),this.__isWebARMode=!0,t()}else console.error("WebGL context is not ready for WebXR.")}async exitWebAR(){this.__oArSession.has()&&await this.__oArSession.get().end()}getCanvasWidthForVr(){return this.__canvasWidthForAR}getCanvasHeightForVr(){return this.__canvasHeightForAR}get viewMatrix(){return this._cameraEntity.getCamera().viewMatrix}__updateView(e){this.__oArViewerPose=new h.bD(e.getViewerPose(this.__oArReferenceSpace.unwrapForce())),this.__setCameraInfoFromXRViews(this.__oArViewerPose.unwrapForce())}__setCameraInfoFromXRViews(e){if(_.Is.not.exist(e))return void console.warn("xrViewerPose not exist");const t=e.views[0];if(_.Is.not.exist(t))return;const n=e.transform.orientation;this.__viewerOrientation.x=n.x,this.__viewerOrientation.y=n.y,this.__viewerOrientation.z=n.z,this.__viewerOrientation.w=n.w;const i=a.e.fromCopyFloat32ArrayColumnMajor(null==t?void 0:t.transform.matrix),o=this.__viewerScale.x,r=t.transform.position,s=l.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate),h=c.P.fromCopyArray([r.x,r.y,r.z]),u=l.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate).add(h),d=s.x,m=s.z,f=u.x,p=u.z,v=this._cameraEntity.getTransform();v.localPosition=c.P.fromCopyArray([d,0,m]),v.localScale=c.P.fromCopyArray([o,o,o]),v.localEulerAngles=c.P.fromCopyArray([0,this.__viewerAzimuthAngle.x,0]),i.translateY=u.y,i.translateX=u.x-f,i.translateZ=u.z-p,i.translateY+=h.y,i.translateX+=h.x,i.translateZ+=h.z,this._cameraEntity.getTransform().localMatrix=i}get projectionMatrix(){const e=this.__oArViewerPose.unwrapForce().views[0];return a.e.fromCopyFloat32ArrayColumnMajor(_.Is.exist(e)?e.projectionMatrix:a.e.identity()._v)}_preRender(e,t){this.isWebARMode&&this.__requestedToEnterWebAR&&null!=t&&this.__updateView(t)}_postRender(){this.isWebARMode&&this.__oGlw.unwrapForce().getRawContext(),this.requestedToEnterWebAR}get isWebARMode(){return this.__isWebARMode}get isReadyForWebAR(){return this.__isReadyForWebAR}get requestedToEnterWebAR(){return this.__requestedToEnterWebAR}get arSession(){return this.__oArSession.unwrapOrUndefined()}get framebuffer(){var e,t;return null===(t=null===(e=this.__oArSession.unwrapOrUndefined())||void 0===e?void 0:e.renderState.baseLayer)||void 0===t?void 0:t.framebuffer}}const v=Object.freeze({WebXRSystem:i.X,WebARSystem:p}),A=v;(0,eval)("this").RnXR=v},5337:(e,t,n)=>{n.d(t,{Z:()=>i});const i={version:"48c8e47-dirty",branch:"feat/webgpu"}},6893:function(){(function(){function l(e){throw e}var r=void 0,t,aa=this;function v(e,t){var n,i=e.split("."),o=aa;!(i[0]in o)&&o.execScript&&o.execScript("var "+i[0]);for(;i.length&&(n=i.shift());)i.length||t===r?o=o[n]?o[n]:o[n]={}:o[n]=t}var y="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView,z;for(new(y?Uint8Array:Array)(256),z=0;256>z;++z)for(var B=z,ba=7,B=B>>>1;B;B>>>=1)--ba;var ca=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],C=y?new Uint32Array(ca):ca,a;if(aa.Uint8Array!==r)try{eval("String.fromCharCode.apply(null, new Uint8Array([0]));")}catch(e){String.fromCharCode.apply=(a=String.fromCharCode.apply,function(e,t){return a.call(String.fromCharCode,e,Array.prototype.slice.call(t))})}function D(e){var t,n,i,o,a,r,s,l,c,_,h=e.length,u=0,d=Number.POSITIVE_INFINITY;for(l=0;lu&&(u=e[l]),e[l]>=1;for(_=i<<16|l,c=r;cG;G++)switch(!0){case 143>=G:F.push([G+48,8]);break;case 255>=G:F.push([G-144+400,9]);break;case 279>=G:F.push([G-256+0,7]);break;case 287>=G:F.push([G-280+192,8]);break;default:l("invalid literal: "+G)}var fa=function(){function e(e){switch(!0){case 3===e:return[257,e-3,0];case 4===e:return[258,e-4,0];case 5===e:return[259,e-5,0];case 6===e:return[260,e-6,0];case 7===e:return[261,e-7,0];case 8===e:return[262,e-8,0];case 9===e:return[263,e-9,0];case 10===e:return[264,e-10,0];case 12>=e:return[265,e-11,1];case 14>=e:return[266,e-13,1];case 16>=e:return[267,e-15,1];case 18>=e:return[268,e-17,1];case 22>=e:return[269,e-19,2];case 26>=e:return[270,e-23,2];case 30>=e:return[271,e-27,2];case 34>=e:return[272,e-31,2];case 42>=e:return[273,e-35,3];case 50>=e:return[274,e-43,3];case 58>=e:return[275,e-51,3];case 66>=e:return[276,e-59,3];case 82>=e:return[277,e-67,4];case 98>=e:return[278,e-83,4];case 114>=e:return[279,e-99,4];case 130>=e:return[280,e-115,4];case 162>=e:return[281,e-131,5];case 194>=e:return[282,e-163,5];case 226>=e:return[283,e-195,5];case 257>=e:return[284,e-227,5];case 258===e:return[285,e-258,0];default:l("invalid length: "+e)}}var t,n,i=[];for(t=3;258>=t;t++)n=e(t),i[t]=n[2]<<24|n[1]<<16|n[0];return i}();function I(e,t){switch(this.l=[],this.m=32768,this.d=this.f=this.c=this.t=0,this.input=y?new Uint8Array(e):e,this.u=!1,this.n=J,this.K=!1,!t&&(t={})||(t.index&&(this.c=t.index),t.bufferSize&&(this.m=t.bufferSize),t.bufferType&&(this.n=t.bufferType),t.resize&&(this.K=t.resize)),this.n){case ga:this.a=32768,this.b=new(y?Uint8Array:Array)(32768+this.m+258);break;case J:this.a=0,this.b=new(y?Uint8Array:Array)(this.m),this.e=this.W,this.B=this.R,this.q=this.V;break;default:l(Error("invalid inflate mode"))}}y&&new Uint32Array(fa);var ga=0,J=1;I.prototype.r=function(){for(;!this.u;){var e=K(this,3);switch(1&e&&(this.u=!0),e>>>=1){case 0:var t=this.input,n=this.c,i=this.b,o=this.a,a=t.length,s=r,c=i.length,_=r;switch(this.d=this.f=0,n+1>=a&&l(Error("invalid uncompressed block header: LEN")),s=t[n++]|t[n++]<<8,n+1>=a&&l(Error("invalid uncompressed block header: NLEN")),s===~(t[n++]|t[n++]<<8)&&l(Error("invalid uncompressed block header: length verify")),n+s>t.length&&l(Error("input buffer is broken")),this.n){case ga:for(;o+s>i.length;){if(s-=_=c-o,y)i.set(t.subarray(n,n+_),o),o+=_,n+=_;else for(;_--;)i[o++]=t[n++];this.a=o,i=this.e(),o=this.a}break;case J:for(;o+s>i.length;)i=this.e({H:2});break;default:l(Error("invalid inflate mode"))}if(y)i.set(t.subarray(n,n+s),o),o+=s,n+=s;else for(;s--;)i[o++]=t[n++];this.c=n,this.a=o,this.b=i;break;case 1:this.q(ha,ia);break;case 2:var h,u,d,m,f=K(this,5)+257,p=K(this,5)+1,v=K(this,4)+4,A=new(y?Uint8Array:Array)(L.length),x=r,g=r,I=r,b=r,E=r;for(E=0;E=R?8:255>=R?9:279>=R?7:8;var ha=D(Q),S=new(y?Uint8Array:Array)(30),T,ra;for(T=0,ra=S.length;T=s&&l(Error("input buffer is broken")),i|=a[r++]<>>t,e.d=o-t,e.c=r,n}function M(e,t){for(var n,i,o=e.f,a=e.d,r=e.input,s=e.c,c=r.length,_=t[0],h=t[1];a=c);)o|=r[s++]<>>16)>a&&l(Error("invalid code length: "+i)),e.f=o>>i,e.d=a-i,e.c=s,65535&n}function U(e){e=e||{},this.files=[],this.v=e.comment}function V(e,t){t=t||{},this.input=y&&e instanceof Array?new Uint8Array(e):e,this.c=0,this.ba=t.verify||!1,this.j=t.password}t=I.prototype,t.q=function(e,t){var n=this.b,i=this.a;this.C=e;for(var o,a,r,s,l=n.length-258;256!==(o=M(this,e));)if(256>o)i>=l&&(this.a=i,n=this.e(),i=this.a),n[i++]=o;else for(s=la[a=o-257],0=l&&(this.a=i,n=this.e(),i=this.a);s--;)n[i]=n[i++-r];for(;8<=this.d;)this.d-=8,this.c--;this.a=i},t.V=function(e,t){var n=this.b,i=this.a;this.C=e;for(var o,a,r,s,l=n.length;256!==(o=M(this,e));)if(256>o)i>=l&&(l=(n=this.e()).length),n[i++]=o;else for(s=la[a=o-257],0l&&(l=(n=this.e()).length);s--;)n[i]=n[i++-r];for(;8<=this.d;)this.d-=8,this.c--;this.a=i},t.e=function(){var e,t,n=new(y?Uint8Array:Array)(this.a-32768),i=this.a-32768,o=this.b;if(y)n.set(o.subarray(32768,n.length));else for(e=0,t=n.length;ee;++e)o[e]=o[i+e];return this.a=32768,o},t.W=function(e){var t,n,i,o=this.input.length/this.c+1|0,a=this.input,r=this.b;return e&&("number"==typeof e.H&&(o=e.H),"number"==typeof e.P&&(o+=e.P)),n=2>o?(i=(a.length-this.c)/this.C[2]/2*258|0)t&&(this.b.length=t),e=this.b),this.buffer=e},U.prototype.L=function(e){this.j=e},U.prototype.s=function(e){var t=65535&e[2]|2;return t*(1^t)>>8&255},U.prototype.k=function(e,t){e[0]=(C[255&(e[0]^t)]^e[0]>>>8)>>>0,e[1]=1+(6681*(20173*(e[1]+(255&e[0]))>>>0)>>>0)>>>0,e[2]=(C[255&(e[2]^e[1]>>>24)]^e[2]>>>8)>>>0},U.prototype.T=function(e){var t,n,i=[305419896,591751049,878082192];for(y&&(i=new Uint32Array(i)),t=0,n=e.length;t>>0,this.z=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.J=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.h=e[t++]|e[t++]<<8,this.g=e[t++]|e[t++]<<8,this.F=e[t++]|e[t++]<<8,this.ea=e[t++]|e[t++]<<8,this.ga=e[t++]|e[t++]<<8,this.fa=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,this.$=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.filename=String.fromCharCode.apply(null,y?e.subarray(t,t+=this.h):e.slice(t,t+=this.h)),this.X=y?e.subarray(t,t+=this.g):e.slice(t,t+=this.g),this.v=y?e.subarray(t,t+this.F):e.slice(t,t+this.F),this.length=t-this.offset};var va={N:1,ca:8,da:2048};function $(e){var t,n,i,o,a=[],s={};if(!e.i){if(e.o===r){var c,_=e.input;if(!e.D)e:{var h,u=e.input;for(h=u.length-12;0>>0,e.o=(_[c++]|_[c++]<<8|_[c++]<<16|_[c++]<<24)>>>0,e.w=_[c++]|_[c++]<<8,e.v=y?_.subarray(c,c+e.w):_.slice(c,c+e.w)}for(t=e.o,i=0,o=e.aa;i>>0,this.z=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.J=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.h=e[t++]|e[t++]<<8,this.g=e[t++]|e[t++]<<8,this.filename=String.fromCharCode.apply(null,y?e.subarray(t,t+=this.h):e.slice(t,t+=this.h)),this.X=y?e.subarray(t,t+=this.g):e.slice(t,t+=this.g),this.length=t-this.offset},t=V.prototype,t.Y=function(){var e,t,n,i=[];for(this.i||$(this),e=0,t=(n=this.i).length;e>>8^C[255&(p^c[v])];for(A=x>>3;A--;v+=8)p=(p=(p=(p=(p=(p=(p=(p=p>>>8^C[255&(p^c[v])])>>>8^C[255&(p^c[v+1])])>>>8^C[255&(p^c[v+2])])>>>8^C[255&(p^c[v+3])])>>>8^C[255&(p^c[v+4])])>>>8^C[255&(p^c[v+5])])>>>8^C[255&(p^c[v+6])])>>>8^C[255&(p^c[v+7])];_=(4294967295^p)>>>0,o.p!==_&&l(Error("wrong crc: file=0x"+o.p.toString(16)+", data=0x"+_.toString(16)))}return c},t.L=function(e){this.j=e},t.k=U.prototype.k,t.S=U.prototype.T,t.s=U.prototype.s,v("Zlib.Unzip",V),v("Zlib.Unzip.prototype.decompress",V.prototype.r),v("Zlib.Unzip.prototype.getFilenames",V.prototype.Y),v("Zlib.Unzip.prototype.setPassword",V.prototype.L)}).call(this)},3705:function(t,n,i){var o;o=function(){function t(){var e,t,s=document.createElement("canvas"),l="t",c=1,_=2.2,h=null;return s.__defineGetter__("exposure",(function(){return c})),s.__defineSetter__("exposure",(function(n){c=n,h&&(r(h,c,_,t.data),e.putImageData(t,0,0))})),s.__defineGetter__("gamma",(function(){return _})),s.__defineSetter__("gamma",(function(n){_=n,h&&(r(h,c,_,t.data),e.putImageData(t,0,0))})),s.__defineGetter__("dataFloat",(function(){return a(h)})),s.__defineGetter__("dataRGBE",(function(){return h})),s.toHDRBlob=function(e,t,i){function o(e,t,n){var i=e.createShader(n);return e.shaderSource(i,t),e.compileShader(i),i}var r=t&&t.match(/rgb9_e5/i)?new Uint8Array(n(a(h)).buffer):new Uint8Array(h.buffer),s=this.width,l=this.height;if(s*l*4=400)return this.onerror();for(var e,t="",n=0,i=new Uint8Array(this.response);!t.match(/\n\n[^\n]+\n/g);)t+=String.fromCharCode(i[n++]);if("32-bit_rle_rgbe"!=(e=t.match(/FORMAT=(.*)$/m)[1]))return console.warn("unknown format : "+e),this.onerror();for(var o=t.split(/\n/).reverse()[1].split(" "),a=1*o[3],r=1*o[1],s=new Uint8Array(a*r*4),l=0,c=0;c0;)if(s.set(i.slice(n,n+=4),l),1==s[l]&&1==s[l+1]&&1==s[l+2])for(s[l+3];m>0;m--)s.set(s.slice(l-4,l),l),l+=4,u--;else u--,l+=4}else{if((_[2]<<8)+_[3]!=a)return console.warn("HDR line mismatch .."),this.onerror();for(var m=0;m<4;m++)for(var f,p,v=m*a,A=(m+1)*a;v128)for(p=f[0]-128;p-- >0;)h[v++]=f[1];else for(p=f[0]-1,h[v++]=f[1];p-- >0;)h[v++]=i[n++];for(m=0;m>2,a=(t=t||new Float32Array(3*o),0);a>>23)*i,t[3*a+1]=(n>>>14&511)*i,t[3*a+2]=(n>>>5&511)*i;return t}function o(t,n){for(var i,o,a,r,s,l=t.byteLength/12|0,c=(n=n||new Uint8Array(4*l),0);c>2,o=(t=t||new Float32Array(3*i),0);o>2,s=(i=i||new Uint8ClampedArray(4*r),0);s{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{__webpack_require__.d(__webpack_exports__,{Z:()=>M});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{AABB:()=>t.mNG,AABBGizmo:()=>t.qfN,AbsoluteAnimation:()=>t.lam,AbstractArrayBufferBaseMathNumber:()=>t.bCT,AbstractCameraController:()=>t.mC0,AbstractMaterialContent:()=>t.PxB,AbstractMatrix:()=>t.XAY,AbstractQuaternion:()=>t.lJH,AbstractShaderNode:()=>t.VI2,AbstractTexture:()=>t.yEY,AbstractVector:()=>t.OxW,Accessor:()=>t.U_s,AddShaderNode:()=>t.yd$,AlphaMode:()=>t.FvO,AnimationAssigner:()=>t.tVY,AnimationAttribute:()=>t.sdx,AnimationComponent:()=>t.cwg,AnimationInterpolation:()=>t.kOi,AttributeNormalShaderNode:()=>t.Sy_,AttributePositionShaderNode:()=>t.JRY,Axis:()=>t.RDh,BasisCompressionType:()=>t.l6R,BlendShapeComponent:()=>t.xTt,BlockBeginShader:()=>c.I,BlockBeginShaderNode:()=>t.afv,BlockEndShader:()=>_.$,BlockEndShaderNode:()=>t.fgK,BoneDataType:()=>t.Nh_,Buffer:()=>t.lWr,BufferUse:()=>t.$HW,BufferView:()=>t.qP0,CGAPIResourceRepository:()=>t.FOu,Cache:()=>t.CtF,CameraComponent:()=>t.Myt,CameraControllerComponent:()=>t.SPq,CameraControllerType:()=>t.MyC,CameraType:()=>t.iM5,CapsuleCollider:()=>t.zmi,ClassicShadingShader:()=>d,ColorGradingUsingLUTsMaterialContent:()=>t.h_U,ColorRgb:()=>t.sZ3,ColorRgba:()=>t.tWC,ComplexVertexAttribute:()=>t.et4,Component:()=>t.wA2,ComponentRepository:()=>t.C2e,ComponentType:()=>t.reR,CompositionType:()=>t.dh2,CompressionTextureType:()=>t.bfi,Config:()=>t.DeH,ConstRgbaBlack:()=>t.SGm,ConstRgbaWhite:()=>t.zUz,ConstVector2_0_0:()=>t.igI,ConstVector2_1_1:()=>t.HOX,ConstVector3_0_0_0:()=>t.R1o,ConstVector3_1_1_1:()=>t.p8_,ConstVector4_0_0_0_0:()=>t.GYQ,ConstVector4_0_0_0_1:()=>t.cV0,ConstVector4_1_1_1_1:()=>t.n9W,ConstantVariableShader:()=>m.i,ConstantVariableShaderNode:()=>t.GFx,Cube:()=>t.Xv,CubeTexture:()=>t.BtG,CustomMaterialContent:()=>t.fZl,DataUtil:()=>t.j4H,DefaultTextures:()=>t.kTl,DepthEncodeMaterialContent:()=>t.Q5_,DetectHighLuminanceMaterialContent:()=>t.tlJ,DotProductShaderNode:()=>t.jLO,DrcPointCloudImporter:()=>t.c5O,EVENT_CLICK:()=>t.Lfs,EVENT_KEY_DOWN:()=>t._QQ,EVENT_KEY_PRESS:()=>t.lOB,EVENT_KEY_UP:()=>t.k$j,EVENT_MOUSE_DOWN:()=>t.zUJ,EVENT_MOUSE_ENTER:()=>t.ak0,EVENT_MOUSE_LEAVE:()=>t.n9,EVENT_MOUSE_MOVE:()=>t.k4,EVENT_MOUSE_OVER:()=>t.vE_,EVENT_MOUSE_UP:()=>t.cG$,EVENT_MOUSE_WHEEL:()=>t.Sss,EVENT_MSPOINTER_DOWN:()=>t.q7F,EVENT_MSPOINTER_MOVE:()=>t.cAE,EVENT_MSPOINTER_UP:()=>t.fAB,EVENT_ORIENTATION_CHANGE:()=>t.SGU,EVENT_POINTER_CANCEL:()=>t.cEP,EVENT_POINTER_DOWN:()=>t.cSB,EVENT_POINTER_ENTER:()=>t.lcf,EVENT_POINTER_LEAVE:()=>t.RyN,EVENT_POINTER_MOVE:()=>t._6o,EVENT_POINTER_OUT:()=>t.UB9,EVENT_POINTER_OVER:()=>t.Cfj,EVENT_POINTER_UP:()=>t.ROv,EVENT_RESIZE:()=>t.hDl,EVENT_TOUCH_CANCEL:()=>t.VS3,EVENT_TOUCH_DOUBLE_TAP:()=>t.Ywc,EVENT_TOUCH_DRAG:()=>t.pt8,EVENT_TOUCH_END:()=>t.p22,EVENT_TOUCH_ENTER:()=>t.jPE,EVENT_TOUCH_HOLD:()=>t.lv,EVENT_TOUCH_LEAVE:()=>t.adG,EVENT_TOUCH_LONG_TAP:()=>t.oM$,EVENT_TOUCH_MOVE:()=>t.jXG,EVENT_TOUCH_OUT:()=>t.fAN,EVENT_TOUCH_OVER:()=>t.KP1,EVENT_TOUCH_PINCH:()=>t.hdu,EVENT_TOUCH_START:()=>t.uso,EVENT_TOUCH_SWIPE:()=>t.yyZ,EVENT_TOUCH_TAP:()=>t.Rz4,Effekseer:()=>T.A,EffekseerComponent:()=>T.D,EndShader:()=>f.x,Entity:()=>t.JHW,EntityHelper:()=>t._nU,EntityRepository:()=>t.gIQ,EntityUIDOutputMaterialContent:()=>t.zFq,EnumClass:()=>t.Jxr,EnvConstantMaterialContent:()=>t.Zfh,Err:()=>t.UGl,EventPubSub:()=>t.U7Y,Expression:()=>t.A2z,FileType:()=>t.Tv5,ForwardRenderPipeline:()=>t.n8g,Frame:()=>t.RQC,FrameBuffer:()=>t.uLm,Frustum:()=>t.iWj,FurnaceTestMaterialContent:()=>t.bLY,GLSLShader:()=>l.m,GLTF2_EXPORT_DRACO:()=>t.Dy6,GLTF2_EXPORT_EMBEDDED:()=>t.jll,GLTF2_EXPORT_GLB:()=>t.Dbu,GLTF2_EXPORT_GLTF:()=>t.ESz,GLTF2_EXPORT_NO_DOWNLOAD:()=>t.S5k,GL_ACTIVE_ATTRIBUTES:()=>E._$8,GL_ACTIVE_TEXTURE:()=>E.lkt,GL_ACTIVE_UNIFORMS:()=>E.Td9,GL_ACTIVE_UNIFORM_BLOCKS:()=>E.wEd,GL_ALIASED_LINE_WIDTH_RANGE:()=>E.ogk,GL_ALIASED_POINT_SIZE_RANGE:()=>E.AY1,GL_ALPHA:()=>E.fNk,GL_ALPHA_BITS:()=>E.Y0n,GL_ALREADY_SIGNALED:()=>E.WPj,GL_ALWAYS:()=>E.gOo,GL_ANY_SAMPLES_PASSED:()=>E.$LR,GL_ANY_SAMPLES_PASSED_CONSERVATIVE:()=>E.faJ,GL_ARRAY_BUFFER:()=>E.TdU,GL_ARRAY_BUFFER_BINDING:()=>E.UAv,GL_ATTACHED_SHADERS:()=>E.Q$l,GL_BACK:()=>E.wIF,GL_BLEND:()=>E.ZXb,GL_BLEND_COLOR:()=>E.hzX,GL_BLEND_DST_ALPHA:()=>E.r9F,GL_BLEND_DST_RGB:()=>E.Kzo,GL_BLEND_EQUATION:()=>E.ttq,GL_BLEND_EQUATION_ALPHA:()=>E.XG_,GL_BLEND_EQUATION_RGB:()=>E.HPC,GL_BLEND_SRC_ALPHA:()=>E.QH$,GL_BLEND_SRC_RGB:()=>E._1o,GL_BLUE_BITS:()=>E.EZ0,GL_BOOL:()=>E.N9T,GL_BOOL_VEC2:()=>E.vgW,GL_BOOL_VEC3:()=>E.tqi,GL_BOOL_VEC4:()=>E.iU2,GL_BROWSER_DEFAULT_WEBGL:()=>E.BWL,GL_BUFFER_SIZE:()=>E.F_m,GL_BUFFER_USAGE:()=>E.$et,GL_CCW:()=>E.gx8,GL_CLAMP_TO_EDGE:()=>E.Y8m,GL_COLOR:()=>E.Wlc,GL_COLOR_ATTACHMENT0:()=>E.krQ,GL_COLOR_ATTACHMENT0_WEBGL:()=>E.YCV,GL_COLOR_ATTACHMENT1:()=>E.p7w,GL_COLOR_ATTACHMENT10:()=>E.Axb,GL_COLOR_ATTACHMENT10_WEBGL:()=>E.eqO,GL_COLOR_ATTACHMENT11:()=>E.gwn,GL_COLOR_ATTACHMENT11_WEBGL:()=>E.BM1,GL_COLOR_ATTACHMENT12:()=>E.w4x,GL_COLOR_ATTACHMENT12_WEBGL:()=>E.CCZ,GL_COLOR_ATTACHMENT13:()=>E.FQh,GL_COLOR_ATTACHMENT13_WEBGL:()=>E.AOk,GL_COLOR_ATTACHMENT14:()=>E.rjz,GL_COLOR_ATTACHMENT14_WEBGL:()=>E.LwI,GL_COLOR_ATTACHMENT15:()=>E._8G,GL_COLOR_ATTACHMENT15_WEBGL:()=>E.ZC4,GL_COLOR_ATTACHMENT1_WEBGL:()=>E.$9l,GL_COLOR_ATTACHMENT2:()=>E.Bky,GL_COLOR_ATTACHMENT2_WEBGL:()=>E.qNf,GL_COLOR_ATTACHMENT3:()=>E.I2u,GL_COLOR_ATTACHMENT3_WEBGL:()=>E.oC9,GL_COLOR_ATTACHMENT4:()=>E.ip$,GL_COLOR_ATTACHMENT4_WEBGL:()=>E.HBF,GL_COLOR_ATTACHMENT5:()=>E._Mr,GL_COLOR_ATTACHMENT5_WEBGL:()=>E.vpR,GL_COLOR_ATTACHMENT6:()=>E.w_G,GL_COLOR_ATTACHMENT6_WEBGL:()=>E.wpZ,GL_COLOR_ATTACHMENT7:()=>E.UBE,GL_COLOR_ATTACHMENT7_WEBGL:()=>E.L8z,GL_COLOR_ATTACHMENT8:()=>E.egt,GL_COLOR_ATTACHMENT8_WEBGL:()=>E.J6F,GL_COLOR_ATTACHMENT9:()=>E.O27,GL_COLOR_ATTACHMENT9_WEBGL:()=>E.L4c,GL_COLOR_BUFFER_BIT:()=>E.$FK,GL_COLOR_CLEAR_VALUE:()=>E.FEv,GL_COLOR_WRITEMASK:()=>E.Ut4,GL_COMPARE_REF_TO_TEXTURE:()=>E.M_A,GL_COMPILE_STATUS:()=>E.MKG,GL_COMPRESSED_R11_EAC:()=>E.d6W,GL_COMPRESSED_RG11_EAC:()=>E.y3r,GL_COMPRESSED_RGB8_ETC2:()=>E.L3p,GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:()=>E.aLt,GL_COMPRESSED_RGBA8_ETC2_EAC:()=>E.DM,GL_COMPRESSED_RGBA_ASTC_10X10_KHR:()=>E.Hfs,GL_COMPRESSED_RGBA_ASTC_10X5_KHR:()=>E.ObQ,GL_COMPRESSED_RGBA_ASTC_10X6_KHR:()=>E.Q2$,GL_COMPRESSED_RGBA_ASTC_10X8_KHR:()=>E.kvX,GL_COMPRESSED_RGBA_ASTC_12X10_KHR:()=>E.U05,GL_COMPRESSED_RGBA_ASTC_12X12_KHR:()=>E.nsH,GL_COMPRESSED_RGBA_ASTC_4X4_KHR:()=>E.mrS,GL_COMPRESSED_RGBA_ASTC_5X4_KHR:()=>E.yZM,GL_COMPRESSED_RGBA_ASTC_5X5_KHR:()=>E.ij3,GL_COMPRESSED_RGBA_ASTC_6X5_KHR:()=>E.qSO,GL_COMPRESSED_RGBA_ASTC_6X6_KHR:()=>E.Fh_,GL_COMPRESSED_RGBA_ASTC_8X5_KHR:()=>E._zC,GL_COMPRESSED_RGBA_ASTC_8X6_KHR:()=>E.$9u,GL_COMPRESSED_RGBA_ASTC_8X8_KHR:()=>E.Gow,GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:()=>E.$1s,GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:()=>E.$PT,GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:()=>E.fYk,GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:()=>E.DcX,GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:()=>E.bTO,GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:()=>E.TsK,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:()=>E.G00,GL_COMPRESSED_RGB_ATC_WEBGL:()=>E.xug,GL_COMPRESSED_RGB_ETC1_WEBGL:()=>E.mhR,GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG:()=>E.Awc,GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG:()=>E.EW4,GL_COMPRESSED_RGB_S3T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()=>E.F8G,GL_COMPRESSED_TEXTURE_FORMATS:()=>E.r4j,GL_CONDITION_SATISFIED:()=>E.oRF,GL_CONSTANT_ALPHA:()=>E.HN$,GL_CONSTANT_COLOR:()=>E.obT,GL_CONTEXT_LOST_WEBGL:()=>E.Ahs,GL_COPY_READ_BUFFER:()=>E.jIl,GL_COPY_READ_BUFFER_BINDING:()=>E.F0I,GL_COPY_WRITE_BUFFER:()=>E.Pa5,GL_COPY_WRITE_BUFFER_BINDING:()=>E.$XJ,GL_CULL_FACE:()=>E.tef,GL_CULL_FACE_MODE:()=>E.lkd,GL_CURRENT_PROGRAM:()=>E.Gi2,GL_CURRENT_QUERY:()=>E.pcv,GL_CURRENT_QUERY_EXT:()=>E.bye,GL_CURRENT_VERTEX_ATTRIB:()=>E.tV_,GL_CW:()=>E.PU5,GL_DATA_BYTE:()=>E.q7Q,GL_DATA_FLOAT:()=>E.OT$,GL_DATA_INT:()=>E.Nq4,GL_DATA_SHORT:()=>E._TP,GL_DATA_UNSIGNED_BYTE:()=>E.Ywg,GL_DATA_UNSIGNED_INT:()=>E.M_8,GL_DATA_UNSIGNED_SHORT:()=>E.rkl,GL_DECR:()=>E.nTe,GL_DECR_WRAP:()=>E.k4y,GL_DELETE_STATUS:()=>E.Pw6,GL_DEPTH:()=>E.gLP,GL_DEPTH24_STENCIL8:()=>E.pmD,GL_DEPTH32F_STENCIL8:()=>E.WB9,GL_DEPTH_ATTACHMENT:()=>E.ksX,GL_DEPTH_BITS:()=>E.Ro9,GL_DEPTH_BUFFER_BIT:()=>E.GuG,GL_DEPTH_CLEAR_VALUE:()=>E.WRC,GL_DEPTH_COMPONENT:()=>E.pEo,GL_DEPTH_COMPONENT16:()=>E.r7P,GL_DEPTH_COMPONENT24:()=>E.LjI,GL_DEPTH_COMPONENT32F:()=>E.FcV,GL_DEPTH_FUNC:()=>E.hvl,GL_DEPTH_RANGE:()=>E.w97,GL_DEPTH_STENCIL:()=>E.Bwm,GL_DEPTH_STENCIL_AT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,GL_DST_ALPHA:()=>E.J$B,GL_DST_COLOR:()=>E.koL,GL_DYNAMIC_COPY:()=>E.KCX,GL_DYNAMIC_DRAW:()=>E.Kn$,GL_DYNAMIC_READ:()=>E.opG,GL_ELEMENT_ARRAY_BUFFER:()=>E.hAw,GL_ELEMENT_ARRAY_BUFFER_BINDING:()=>E.fMn,GL_EQUAL:()=>E.IuO,GL_FASTEST:()=>E.wGk,GL_FLOAT_32_UNSIGNED_INT_24_8_REV:()=>E.wER,GL_FLOAT_MAT2:()=>E.a$d,GL_FLOAT_MAT2X3:()=>E.h$M,GL_FLOAT_MAT2X4:()=>E.d8l,GL_FLOAT_MAT3:()=>E.ODf,GL_FLOAT_MAT3X2:()=>E.oud,GL_FLOAT_MAT3X4:()=>E.LhK,GL_FLOAT_MAT4:()=>E.wSW,GL_FLOAT_MAT4X2:()=>E.ozE,GL_FLOAT_MAT4X3:()=>E.Dq,GL_FLOAT_VEC2:()=>E.e3O,GL_FLOAT_VEC3:()=>E.qhU,GL_FLOAT_VEC4:()=>E.dtP,GL_FRAGMENT_SHADER:()=>E.QoZ,GL_FRAGMENT_SHADER_DERIVATIVE_HINT:()=>E.AQL,GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:()=>E.Qh0,GL_FRAMEBUFFER:()=>E.Iqe,GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:()=>E.vEJ,GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:()=>E.BSP,GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:()=>E.Yhe,GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:()=>E.U4r,GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:()=>E.MLp,GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:()=>E.$ri,GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:()=>E.hCR,GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:()=>E.y8S,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:()=>E.UlJ,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:()=>E.KY4,GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:()=>E.HHs,GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:()=>E.HGq,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:()=>E.jD8,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:()=>E.dIe,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:()=>E.$TT,GL_FRAMEBUFFER_BINDING:()=>E.F06,GL_FRAMEBUFFER_COMPLETE:()=>E.Erj,GL_FRAMEBUFFER_DEFAULT:()=>E.AjE,GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:()=>E.Qlq,GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:()=>E.URo,GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:()=>E.lmp,GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:()=>E.rfC,GL_FRAMEBUFFER_UNSUPPORTED:()=>E.JZg,GL_FRONT:()=>E.dte,GL_FRONT_AND_BACK:()=>E.cN,GL_FRONT_FACE:()=>E.gI2,GL_FUNC_ADD:()=>E.gNb,GL_FUNC_REVERSE_SUBTRACT:()=>E.lJZ,GL_FUNC_SUBSTRACT:()=>E.xHF,GL_GENERATE_MIPMAP_HINT:()=>E.NyC,GL_GEQUAL:()=>E.qbs,GL_GPU_DISJOINT_EXT:()=>E.FpK,GL_GREATER:()=>E.hys,GL_GREEN_BITS:()=>E.jtX,GL_HALF_FLOAT:()=>E.XpU,GL_HALF_FLOAT_OES:()=>E.fb9,GL_HIGH_FLOAT:()=>E.w8k,GL_HIGH_INT:()=>E.F8$,GL_IMPLEMENTATION_COLOR_READ_FORMAT:()=>E.az3,GL_IMPLEMENTATION_COLOR_READ_TYPE:()=>E.AKO,GL_INCR:()=>E.uyu,GL_INCR_WRAP:()=>E.It5,GL_INTERLEAVED_ATTRIBS:()=>E.MNF,GL_INT_2_10_10_10_REV:()=>E.Seb,GL_INT_SAMPLER_2D:()=>E.qiu,GL_INT_SAMPLER_2D_ARRAY:()=>E.uU2,GL_INT_SAMPLER_3D:()=>E.PnX,GL_INT_SAMPLER_CUBE:()=>E.WfD,GL_INT_VEC2:()=>E.RS3,GL_INT_VEC3:()=>E.yYj,GL_INT_VEC4:()=>E.xyr,GL_INVALID_ENUM:()=>E.JC7,GL_INVALID_FRAMEBUFFER_OPERATION:()=>E.aXw,GL_INVALID_INDEX:()=>E.h2K,GL_INVALID_OPERATION:()=>E.lZq,GL_INVALID_VALUE:()=>E.Qpw,GL_INVERT:()=>E.SUn,GL_KEEP:()=>E.Rk$,GL_LEQUAL:()=>E.Vfd,GL_LESS:()=>E.hyR,GL_LINEAR:()=>E.utc,GL_LINEAR_MIPMAP_LINEAR:()=>E.Onn,GL_LINEAR_MIPMAP_NEAREST:()=>E.D68,GL_LINES:()=>E.CB7,GL_LINE_LOOP:()=>E.Jxz,GL_LINE_STRIP:()=>E.M0t,GL_LINE_WIDTH:()=>E.uik,GL_LINK_STATUS:()=>E.WNe,GL_LOW_FLOAT:()=>E.B2j,GL_LOW_INT:()=>E.OJ6,GL_LUMINANCE:()=>E.y9I,GL_LUMINANCE_ALPHA:()=>E.VPl,GL_MAX:()=>E.bQw,GL_MAX_3D_TEXTURE_SIZE:()=>E.TSE,GL_MAX_ARRAY_TEXTURE_LAYERS:()=>E.Dn,GL_MAX_CLIENT_WAIT_TIMEOUT_WEBGL:()=>E.Tr4,GL_MAX_COLOR_ATTACHMENTS:()=>E.DM2,GL_MAX_COLOR_ATTACHMENTS_WEBGL:()=>E.AA5,GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:()=>E.lPV,GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:()=>E.QZz,GL_MAX_COMBINED_UNIFORM_BLOCKS:()=>E.PKw,GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:()=>E.Dgg,GL_MAX_CUBE_MAP_TEXTURE_SIZE:()=>E.ly5,GL_MAX_DRAW_BUFFERS:()=>E.TQ9,GL_MAX_DRAW_BUFFERS_WEBGL:()=>E.GuK,GL_MAX_ELEMENTS_INDICES:()=>E.iIj,GL_MAX_ELEMENTS_VERTICES:()=>E.$OY,GL_MAX_ELEMENT_INDEX:()=>E.SKn,GL_MAX_EXT:()=>E.VdM,GL_MAX_FRAGMENT_INPUT_COMPONENTS:()=>E.YNJ,GL_MAX_FRAGMENT_UNIFORM_BLOCKS:()=>E.PUO,GL_MAX_FRAGMENT_UNIFORM_COMPONENTS:()=>E.Jvo,GL_MAX_FRAGMENT_UNIFORM_VECTORS:()=>E.JJY,GL_MAX_PROGRAM_TEXEL_OFFSET:()=>E._b_,GL_MAX_RENDERBUFFER_SIZE:()=>E.ml9,GL_MAX_SAMPLES:()=>E.WBe,GL_MAX_SERVER_WAIT_TIMEOUT:()=>E.epv,GL_MAX_TEXTURE_IMAGE_UNITS:()=>E.D8i,GL_MAX_TEXTURE_LOD_BIAS:()=>E.kky,GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:()=>E.oR$,GL_MAX_TEXTURE_SIZE:()=>E.S1v,GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:()=>E.QkI,GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:()=>E._YZ,GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:()=>E.Mlt,GL_MAX_UNIFORM_BLOCK_SIZE:()=>E.uri,GL_MAX_UNIFORM_BUFFER_BINDINGS:()=>E.E6I,GL_MAX_VARYING_COMPONENTS:()=>E.Cj5,GL_MAX_VARYING_VECTORS:()=>E.jHY,GL_MAX_VERTEX_ATTRIBS:()=>E.hfp,GL_MAX_VERTEX_OUTPUT_COMPONENTS:()=>E.ksA,GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:()=>E.Rw3,GL_MAX_VERTEX_UNIFORM_BLOCKS:()=>E.SH3,GL_MAX_VERTEX_UNIFORM_COMPONENTS:()=>E.Ft1,GL_MAX_VERTEX_UNIFORM_VECTORS:()=>E.N8N,GL_MAX_VIEWPORT_DIMS:()=>E.oDL,GL_MEDIUM_FLOAT:()=>E.fL$,GL_MEDIUM_INT:()=>E.XEX,GL_MIN:()=>E.Awz,GL_MIN_EXT:()=>E.fxg,GL_MIN_PROGRAM_TEXEL_OFFSET:()=>E.pc5,GL_MIRRORED_REPEAT:()=>E.GjS,GL_NEAREST:()=>E.R1c,GL_NEAREST_MIPMAP_LINEAR:()=>E.vTv,GL_NEAREST_MIPMAP_NEAREST:()=>E.wWb,GL_NEVER:()=>E.shP,GL_NICEST:()=>E.wVD,GL_NONE:()=>E.Hh0,GL_NOTEQUAL:()=>E.UnN,GL_NO_ERROR:()=>E.Wen,GL_OBJECT_TYPE:()=>E.BHy,GL_ONE:()=>E.Qak,GL_ONE_MINUS_CONSTANT_ALPHA:()=>E.D__,GL_ONE_MINUS_CONSTANT_COLOR:()=>E.$rK,GL_ONE_MINUS_DST_ALPHA:()=>E.X5J,GL_ONE_MINUS_DST_COLOR:()=>E.hOW,GL_ONE_MINUS_SRC_ALPHA:()=>E.GR4,GL_ONE_MINUS_SRC_COLOR:()=>E.IDP,GL_OUT_OF_MEMORY:()=>E.gcz,GL_PACK_ALIGNMENT:()=>E.XPs,GL_PACK_ROW_LENGTH:()=>E.wMK,GL_PACK_SKIP_PIXELS:()=>E.voy,GL_PACK_SKIP_ROWS:()=>E.VNU,GL_PIXEL_PACK_BUFFER:()=>E.OAM,GL_PIXEL_PACK_BUFFER_BINDING:()=>E.vce,GL_PIXEL_UNPACK_BUFFER:()=>E.fsJ,GL_PIXEL_UNPACK_BUFFER_BINDING:()=>E.mED,GL_PIXEL_UNSIGNED_BYTE:()=>E.vnd,GL_PIXEL_UNSIGNED_SHORT_4_4_4_4:()=>E.yD3,GL_PIXEL_UNSIGNED_SHORT_5_5_5_1:()=>E.kyN,GL_PIXEL_UNSIGNED_SHORT_5_6_5:()=>E.nJx,GL_POINTS:()=>E.u$A,GL_POLYGON_OFFSET_FACTOR:()=>E.tzR,GL_POLYGON_OFFSET_FILL:()=>E.Lbl,GL_POLYGON_OFFSET_UNITS:()=>E.DEk,GL_QUERY_COUNTER_BITS_EXT:()=>E.HPM,GL_QUERY_RESULT:()=>E.dbf,GL_QUERY_RESULT_AVAILABLE:()=>E.vPW,GL_QUERY_RESULT_AVAILABLE_EXT:()=>E.KAt,GL_QUERY_RESULT_EXT:()=>E._UX,GL_R11F_G11F_B10F:()=>E.zsc,GL_R16F:()=>E.oY_,GL_R16I:()=>E.gj3,GL_R16UI:()=>E.oqe,GL_R32F:()=>E.uER,GL_R32I:()=>E._TF,GL_R32UI:()=>E.YlY,GL_R8:()=>E.cYm,GL_R8I:()=>E._EH,GL_R8UI:()=>E.S00,GL_R8_SNORM:()=>E.w9H,GL_RASTERIZER_DISCARD:()=>E.ZXo,GL_READ_BUFFER:()=>E._Ir,GL_READ_FRAMEBUFFER:()=>E.yun,GL_READ_FRAMEBUFFER_BINDING:()=>E.bXZ,GL_RED:()=>E.ZhV,GL_RED_BITS:()=>E.jZr,GL_RED_INTEGER:()=>E.iKz,GL_RENDERBUFFER:()=>E.vPm,GL_RENDERBUFFER_ALPHA_SIZE:()=>E.Ysb,GL_RENDERBUFFER_BINDING:()=>E.qk$,GL_RENDERBUFFER_BLUE_SIZE:()=>E.pBm,GL_RENDERBUFFER_DEPTH_SIZE:()=>E.lbA,GL_RENDERBUFFER_GREEN_SIZE:()=>E.OSM,GL_RENDERBUFFER_HEIGHT:()=>E.Bxb,GL_RENDERBUFFER_INTERNAL_FORMAT:()=>E.TpV,GL_RENDERBUFFER_RED_SIZE:()=>E.eco,GL_RENDERBUFFER_SAMPLES:()=>E.CW9,GL_RENDERBUFFER_STENCIL_SIZE:()=>E.Dm9,GL_RENDERBUFFER_WIDTH:()=>E._ZX,GL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AMPLER_BINDING:()=>E.FSc,GL_SAMPLER_CUBE:()=>E.vUb,GL_SAMPLER_CUBE_SHADOW:()=>E.rWQ,GL_SAMPLES:()=>E.L_4,GL_SAMPLE_ALPHA_TO_COVERAGE:()=>E.oIP,GL_SAMPLE_BUFFERS:()=>E.Od7,GL_SAMPLE_COVERAGE:()=>E.Nu1,GL_SAMPLE_COVERAGE_INVERT:()=>E.JGk,GL_SAMPLE_COVERAGE_VALUE:()=>E.VJW,GL_SCISSOR_BOX:()=>E.LCZ,GL_SCISSOR_TEST:()=>E.iku,GL_SEPARATE_ATTRIBS:()=>E.ixi,GL_SHADER_TYPE:()=>E.wrZ,GL_SHADING_LANGUAGE_VERSION:()=>E.SFW,GL_SIGNALED:()=>E._M2,GL_SIGNED_NORMALIZED:()=>E.oiY,GL_SRC_ALPHA:()=>E.B3l,GL_SRC_ALPHA_SATURATE:()=>E.JRp,GL_SRC_COLOR:()=>E.o9e,GL_SRGB:()=>E.GTV,GL_SRGB8:()=>E.LQI,GL_SRGB8_ALPHA8:()=>E.TsT,GL_SRGB8_ALPHA8_EXT:()=>E.SNQ,GL_SRGB_ALPHA_EXT:()=>E.VFW,GL_SRGB_EXT:()=>E.Hjq,GL_STATIC_COPY:()=>E.yZh,GL_STATIC_DRAW:()=>E.o4I,GL_STATIC_READ:()=>E.Spp,GL_STENCIL:()=>E.EH4,GL_STENCIL_ATTACHMENT:()=>E.m88,GL_STENCIL_BACK_FAIL:()=>E._5_,GL_STENCIL_BACK_FUNC:()=>E.xR7,GL_STENCIL_BACK_PASS_DEPTH_FAIL:()=>E.WK5,GL_STENCIL_BACK_PASS_DEPTH_PASS:()=>E.PNz,GL_STENCIL_BACK_REF:()=>E.hoP,GL_STENCIL_BACK_VALUE_MASK:()=>E.n0B,GL_STENCIL_BACK_WRITEMASK:()=>E.Z$r,GL_STENCIL_BITS:()=>E.ad4,GL_STENCIL_BUFFER_BIT:()=>E.BbZ,GL_STENCIL_CLEAR_VALUE:()=>E.zSL,GL_STENCIL_FAIL:()=>E.wce,GL_STENCIL_FUNC:()=>E.Qbd,GL_STENCIL_INDEX:()=>E.OBi,GL_STENCIL_INDEX8:()=>E.VX_,GL_STENCIL_PASS_DEPTH_FAIL:()=>E.O5p,GL_STENCIL_PASS_DEPTH_PASS:()=>E.OiW,GL_STENCIL_REF:()=>E.nVM,GL_STENCIL_TEST:()=>E.lxv,GL_STENCIL_VALUE_MASK:()=>E.b6i,GL_STENCIL_WRITEMASK:()=>E.Q$q,GL_STREAM_COPY:()=>E.kMJ,GL_STREAM_DRAW:()=>E.RIC,GL_STREAM_READ:()=>E.BTT,GL_SUBPIXEL_BITS:()=>E.xp,GL_SYNC_CONDITION:()=>E.vHc,GL_SYNC_FENCE:()=>E.YoK,GL_SYNC_FLAGS:()=>E.lF1,GL_SYNC_FLUSH_COMMANDS_BIT:()=>E.tFw,GL_SYNC_GPU_COMMANDS_COMPLETE:()=>E.z8r,GL_SYNC_STATUS:()=>E.wm0,GL_TEXTURE:()=>E.p8j,GL_TEXTURE0:()=>E.Lmx,GL_TEXTURE1:()=>E.ZrN,GL_TEXTURE10:()=>E.M1Q,GL_TEXTURE11:()=>E.nPy,GL_TEXTURE12:()=>E.SX1,GL_TEXTURE13:()=>E.pYl,GL_TEXTURE14:()=>E.EPR,GL_TEXTURE15:()=>E.kpL,GL_TEXTURE16:()=>E.RjA,GL_TEXTURE17:()=>E.uJm,GL_TEXTURE18:()=>E.Wtd,GL_TEXTURE19:()=>E.emu,GL_TEXTURE2:()=>E.Ehj,GL_TEXTURE20:()=>E.iVc,GL_TEXTURE21:()=>E.Bvy,GL_TEXTURE22:()=>E.pJJ,GL_TEXTURE23:()=>E.WQq,GL_TEXTURE24:()=>E.AC$,GL_TEXTURE25:()=>E.jol,GL_TEXTURE26:()=>E.kOB,GL_TEXTURE27:()=>E.RO1,GL_TEXTURE28:()=>E.Uu$,GL_TEXTURE29:()=>E.Kwr,GL_TEXTURE3:()=>E._mt,GL_TEXTURE30:()=>E.S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=>E.aK$,GL_TIMEOUT_IGNORED:()=>E.eke,GL_TIMESTAMP_EXT:()=>E.Qt8,GL_TIME_ELAPSED_EXT:()=>E.sr4,GL_TRANSFORM_FEEDBACK:()=>E.Sa0,GL_TRANSFORM_FEEDBACK_ACTIVE:()=>E.vWN,GL_TRANSFORM_FEEDBACK_BINDING:()=>E.C6I,GL_TRANSFORM_FEEDBACK_BUFFER:()=>E.AQZ,GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:()=>E.x6H,GL_TRANSFORM_FEEDBACK_BUFFER_MODE:()=>E.H2K,GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:()=>E.f5L,GL_TRANSFORM_FEEDBACK_BUFFER_START:()=>E.ILt,GL_TRANSFORM_FEEDBACK_PAUSED:()=>E.ccF,GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:()=>E.VYu,GL_TRANSFORM_FEEDBACK_VARYINGS:()=>E.y3j,GL_TRIANGLES:()=>E.FgH,GL_TRIANGLE_FAN:()=>E.vtI,GL_TRIANGLE_STRIP:()=>E.uCq,GL_UNIFORM_ARRAY_STRIDE:()=>E.qWZ,GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS:()=>E.t75,GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:()=>E.Kzi,GL_UNIFORM_BLOCK_BINDING:()=>E.tNI,GL_UNIFORM_BLOCK_DATA_SIZE:()=>E.zfW,GL_UNIFORM_BLOCK_INDEX:()=>E.mcF,GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:()=>E.Nyi,GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:()=>E.sxC,GL_UNIFORM_BUFFER:()=>E.q__,GL_UNIFORM_BUFFER_BINDING:()=>E.DBb,GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:()=>E.mMN,GL_UNIFORM_BUFFER_SIZE:()=>E.rve,GL_UNIFORM_BUFFER_START:()=>E.o7C,GL_UNIFORM_IS_ROW_MAJOR:()=>E.HM$,GL_UNIFORM_MATRIX_STRIDE:()=>E.mS1,GL_UNIFORM_OFFSET:()=>E.xUI,GL_UNIFORM_SIZE:()=>E.djG,GL_UNIFORM_TYPE:()=>E.Kn4,GL_UNMASKED_RENDERER_WEBGL:()=>E.jGD,GL_UNMASKED_VENDOR_WEBGL:()=>E.ycd,GL_UNPACK_ALIGNMENT:()=>E.GM3,GL_UNPACK_COLORSPACE_CONVERSION_WEBGL:()=>E.XxT,GL_UNPACK_FLIP_Y_WEBGL:()=>E.PYx,GL_UNPACK_IMAGE_HEIGHT:()=>E.EVZ,GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL:()=>E.WYY,GL_UNPACK_ROW_LENGTH:()=>E.m7j,GL_UNPACK_SKIP_IMAGES:()=>E.SK7,GL_UNPACK_SKIP_PIXELS:()=>E.YrP,GL_UNPACK_SKIP_ROWS:()=>E.bd_,GL_UNSIGNALED:()=>E.n9O,GL_UNSIGNED_INT_10F_11F_11F_REV:()=>E.nQ9,GL_UNSIGNED_INT_24_8:()=>E.bTv,GL_UNSIGNED_INT_24_8_WEBGL:()=>E.iyB,GL_UNSIGNED_INT_2_10_10_10_REV:()=>E.LX0,GL_UNSIGNED_INT_5_9_9_9_REV:()=>E.vEp,GL_UNSIGNED_INT_SAMPLER_2D:()=>E.Zx4,GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:()=>E.yd2,GL_UNSIGNED_INT_SAMPLER_3D:()=>E.ZtN,GL_UNSIGNED_INT_SAMPLER_CUBE:()=>E.lg3,GL_UNSIGNED_INT_VEC2:()=>E.DAo,GL_UNSIGNED_INT_VEC3:()=>E.TAU,GL_UNSIGNED_INT_VEC4:()=>E.Ki3,GL_UNSIGNED_NORMALIZED:()=>E.Dr$,GL_UNSIGNED_NORMALIZED_EXT:()=>E.$z8,GL_VALIDATE_STATUS:()=>E.eQR,GL_VENDOR:()=>E.zSP,GL_VERSION:()=>E.$bm,GL_VERTEX_ARRAY_BINDING:()=>E.RGR,GL_VERTEX_ARRAY_BINDING_OES:()=>E.fsT,GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:()=>E.HRE,GL_VERTEX_ATTRIB_ARRAY_DIVISOR:()=>E.LUh,GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:()=>E.C9t,GL_VERTEX_ATTRIB_ARRAY_ENABLED:()=>E.I4M,GL_VERTEX_ATTRIB_ARRAY_INTEGER:()=>E.XZ2,GL_VERTEX_ATTRIB_ARRAY_NORMALIZED:()=>E.s7G,GL_VERTEX_ATTRIB_ARRAY_POINTER:()=>E.bsK,GL_VERTEX_ATTRIB_ARRAY_SIZE:()=>E.vEN,GL_VERTEX_ATTRIB_ARRAY_STRIDE:()=>E.cqm,GL_VERTEX_ATTRIB_ARRAY_TYPE:()=>E.eFf,GL_VERTEX_SHADER:()=>E.lQo,GL_VIEWPORT:()=>E.Ith,GL_WAIT_FAILED:()=>E.GIj,GL_ZERO:()=>E._sJ,GetComponentFromEntities:()=>t.swI,Gizmo:()=>t.tb4,GlobalDataRepository:()=>t.$jt,GlobalRetarget:()=>t.B5B,GlobalRetargetReverse:()=>t.GZk,Gltf2Exporter:()=>t.ObQ,Gltf2Importer:()=>t.Zb6,GltfImporter:()=>t.j6Y,GreaterShaderNode:()=>t.imh,Grid:()=>t.rjZ,HdriFormat:()=>t.czt,INPUT_HANDLING_STATE_CAMERA_CONTROLLER:()=>t.jOP,INPUT_HANDLING_STATE_GIZMO_SCALE:()=>t.K2G,INPUT_HANDLING_STATE_GIZMO_TRANSLATION:()=>t.KQz,INPUT_HANDLING_STATE_NONE:()=>t.Tr1,IShape:()=>t.ALp,IdentityMatrix33:()=>t.cmF,IdentityMatrix44:()=>t.aqQ,IfStatementShader:()=>p.p,IfStatementShaderNode:()=>t.uP$,ImageUtil:()=>t.LkB,InputManager:()=>t.$tz,Is:()=>t.Is,IsObj:()=>t.V5,Joint:()=>t.d90,KTX2TextureLoader:()=>x.N,LightComponent:()=>t.r0A,LightGizmo:()=>t.SUW,LightType:()=>t.vBC,Line:()=>t.x12,LocatorGizmo:()=>t.klP,LogQuaternion:()=>t.lW,MToonMaterialContent:()=>t.fQ$,MatCapMaterialContent:()=>t.Svh,Material:()=>t.F5T,MaterialHelper:()=>t.G$p,MaterialRepository:()=>t.rFg,MathClassUtil:()=>t.Db6,MathUtil:()=>t.kj,Matrix22:()=>t.ak,Matrix33:()=>t.haE,Matrix44:()=>t.Jeh,MemoryManager:()=>t.B_3,Mesh:()=>t.Kj0,MeshComponent:()=>t.$tA,MeshHelper:()=>t.tVI,MeshRendererComponent:()=>t.YZ_,MiscUtil:()=>t.KfE,ModelConverter:()=>t.eDb,ModuleManager:()=>t.xJl,MultiplyShaderNode:()=>t.P4J,MutableColorRgb:()=>t.CEM,MutableColorRgba:()=>t.l$X,MutableMatrix22:()=>t.f7L,MutableMatrix33:()=>t.xkj,MutableMatrix44:()=>t.ecr,MutableQuaternion:()=>t.yGy,MutableScalar:()=>t.DUM,MutableScalar_:()=>t.EtM,MutableScalard:()=>t.$_9,MutableVector2:()=>t.NRp,MutableVector2_:()=>t.elw,MutableVector2d:()=>t.th1,MutableVector3:()=>t.d6n,MutableVector3_:()=>t.I18,MutableVector3d:()=>t.oVE,MutableVector4:()=>t.xQg,MutableVector4_:()=>t.e2p,MutableVector4d:()=>t.hnX,None:()=>t.Hq9,NormalMatrixShaderNode:()=>t.fbG,NormalizeShaderNode:()=>t.dHi,OimoPhysicsStrategy:()=>t.qiF,Ok:()=>t.Ok,Option:()=>t.Wxm,OrbitCameraController:()=>t.jfW,OutColorShaderNode:()=>t.y8Z,OutPositionShaderNode:()=>t.Nus,PhysicsComponent:()=>t.ZeV,PixelFormat:()=>t.VIj,Plane:()=>t.JOQ,Primitive:()=>t.WV0,PrimitiveMode:()=>t.TcR,PrimitiveSortKey_BitLength_Depth:()=>t.Qob,PrimitiveSortKey_BitLength_Material:()=>t.xzx,PrimitiveSortKey_BitLength_PrimitiveType:()=>t.aKP,PrimitiveSortKey_BitLength_TranslucencyType:()=>t.IMH,PrimitiveSortKey_BitOffset_Material:()=>t.V_R,PrimitiveSortKey_BitOffset_PrimitiveType:()=>t.Y1P,PrimitiveSortKey_BitOffset_TranslucencyType:()=>t.Yxr,PrimitiveSortKey_BitOffset_ViewportLayer:()=>t.BHz,ProcessApproach:()=>t.V7o,ProcessApproachClass:()=>t.yvy,ProcessStage:()=>t.Iqz,ProjectionMatrixShaderNode:()=>t.DEK,Quaternion:()=>t._fP,RenderBuffer:()=>t.NiD,RenderBufferTarget:()=>t.G22,RenderPass:()=>t.CDd,RenderPassHelper:()=>t.$Og,RenderTargetTexture:()=>t._iX,RenderableHelper:()=>t.L0o,RhodoniteImportExtension:()=>t.zYy,RnException:()=>t.MrI,RnObject:()=>t.S7_,RnPromise:()=>t.niV,Sampler:()=>t.Z46,Scalar:()=>t.Rus,ScalarToVector4ShaderNode:()=>t.udm,Scalar_:()=>t.apw,Scalard:()=>t.kOh,ScaleGizmo:()=>t.que,SceneGraphComponent:()=>t.aj7,ShaderGraphResolver:()=>t.dBk,ShaderNode:()=>t.Zp7,ShaderSemantics:()=>t.f5e,ShaderSemanticsClass:()=>t.wyA,ShaderType:()=>t.HoG,ShaderVariableType:()=>t.LvG,ShaderVariableUpdateInterval:()=>t.axw,ShaderityMaterialContent:()=>t.unQ,ShaderityUtilityWebGL:()=>t.uQo,ShadingModel:()=>t.DAE,ShadowMap:()=>t.l6Z,ShadowMapDecodeClassicMaterialContent:()=>t.RKA,SimpleVertexAttribute:()=>t.OCV,SkeletalComponent:()=>t.YbW,Some:()=>t.bDM,Sphere:()=>t.aLr,SphereCollider:()=>t.BMK,SymbolWeakMap:()=>t.bsk,SynthesizeHdrMaterialContent:()=>t.dob,System:()=>t.xP7,SystemState:()=>t.lBd,TagGltf2NodeIndex:()=>E.j3U,Texture:()=>t.xEZ,TextureDataFloat:()=>t.h36,TextureFetchMaterialNode:()=>t.IW4,TextureFetchShader:()=>v.S,TextureParameter:()=>t.dIQ,Time:()=>t.qpU,Transform3D:()=>t.WQ0,TransformComponent:()=>t.Uvn,TranslationGizmo:()=>t.ug2,UniformDataShader:()=>A.$,UniformDataShaderNode:()=>t.X1h,VERSION:()=>P,VRMColliderGroup:()=>t.Dit,VRMSpring:()=>t.U4t,VRMSpringBone:()=>t.$bl,VRMSpringBonePhysicsStrategy:()=>t.tM2,VarianceShadowMapDecodeClassicMaterialContent:()=>t.Q_Q,VaryingInVariableShaderNode:()=>t.hLT,VaryingOutVariableShaderNode:()=>t.H9W,VaryingVariableShader:()=>y.e,Vector2:()=>t.FM8,Vector2_:()=>t.pV,Vector2d:()=>t.EYs,Vector3:()=>t.Pa4,Vector3AndScalarToVector4ShaderNode:()=>t.TaZ,Vector3_:()=>t.pg_,Vector3d:()=>t.UJ,Vector4:()=>t.Ltg,Vector4_:()=>t.rEL,Vector4d:()=>t.Tjf,VectorN:()=>t.j8u,VertexAttribute:()=>t.TaT,VertexAttributeClass:()=>t.x$u,VideoTexture:()=>t.fO1,ViewMatrixShaderNode:()=>t.UaW,Visibility:()=>t.EEb,Vrm0xImporter:()=>t.ao$,VrmComponent:()=>t.ZAV,VrmImporter:()=>t.pbL,VrmaImporter:()=>t.vTZ,WalkThroughCameraController:()=>t.IsZ,WeakNone:()=>t.Lq7,WeakOption:()=>t.lIh,WeakSome:()=>t.Bxs,WebGLContextWrapper:()=>n.d,WebGLExtension:()=>i.c,WebGLResourceRepository:()=>o.x,WebGLStrategyDataTexture:()=>r.X,WebGLStrategyUniform:()=>s.I,WebGpuDeviceWrapper:()=>g.V,WebGpuResourceRepository:()=>I.g,WebGpuStrategyBasic:()=>b.p,WebXRSystem:()=>C.X,WellKnownComponentTIDs:()=>t.zzN,WireframeMaterialNode:()=>t.sqk,WorldMatrixShaderNode:()=>t.KRN,_from:()=>t.lim,_fromString:()=>t.cuJ,_fromStringCaseSensitively:()=>t.bmc,_getPropertyIndex:()=>t.VlM,_getPropertyIndex2:()=>t.ULo,add2:()=>t.Zzs,add2_offset:()=>t.TLr,add3:()=>t.sZE,add3_offset:()=>t.jIe,add4:()=>t.F5f,add4_offset:()=>t.vPp,addLineNumberToCode:()=>t._zI,applyMixins:()=>t.efS,array3_lerp_offsetAsComposition:()=>t.to5,arrayN_lerp_offsetAsComposition:()=>t.wrt,assertDoesNotHave:()=>t.Waq,assertExist:()=>t.dKe,assertHas:()=>t.ZzZ,assertIsErr:()=>t.Z65,assertIsOk:()=>t.UDi,calcAlignedByteLength:()=>t.Kyk,combineImages:()=>t.U28,convertHTMLImageElementToCanvas:()=>t.ABp,createAndAddGltf2BufferView:()=>t.CTh,createEffekseer:()=>t.OHV,createMotionController:()=>S.RQ,deepCopyUsingJsonStringify:()=>t.j37,defaultAnimationTrackName:()=>t.vAU,defaultValue:()=>t.LSm,detectFormatByArrayBuffers:()=>t.Dhi,detectFormatByUri:()=>t.jeP,downloadArrayBuffer:()=>t.CWu,downloadTypedArray:()=>t.$z2,dummyAnisotropyTexture:()=>t.Lx$,dummyBlackCubeTexture:()=>t.pnp,dummyBlackTexture:()=>t.mge,dummyBlueTexture:()=>t.$RV,dummySRGBGrayTexture:()=>t.GVY,dummyWhiteTexture:()=>t.Dx8,enhanceArray:()=>t.OTk,fromTensorToCompositionType:()=>E.bup,get1:()=>t.nnL,get1_offset:()=>t.w08,get1_offsetAsComposition:()=>t.GWg,get2:()=>t.t5w,get2_offset:()=>t.vk8,get2_offsetAsComposition:()=>t.PFe,get3:()=>t.Ffi,get3_offset:()=>t.Upt,get3_offsetAsComposition:()=>t.Dq2,get4:()=>t.VIV,get4_offset:()=>t.hxV,get4_offsetAsComposition:()=>t.JIQ,getEvent:()=>t.EYp,getMotionController:()=>S.sz,getN_offset:()=>t.fKE,getN_offsetAsComposition:()=>t.lxk,getWebXRSystem:()=>R,greaterThan:()=>t.tSN,ifDefinedThen:()=>t.JxS,ifDefinedThenWithReturn:()=>t.t0P,ifExistsThen:()=>t.fK9,ifExistsThenWithReturn:()=>t.OBD,ifNotExistsThen:()=>t.bhs,ifNotExistsThenWithReturn:()=>t.ZsA,ifUndefinedThen:()=>t.fYc,ifUndefinedThenWithReturn:()=>t.eD0,initDefaultTextures:()=>t.Cb2,isMaterialsSetup:()=>t.iCj,isSameGlTF2TextureSampler:()=>E.CLY,isSkipDrawing:()=>t.lsI,lessThan:()=>t.QjB,mulArray3WithScalar_offset:()=>t.nsy,mulArray4WithScalar_offset:()=>t.p8g,mulArrayNWithScalar_offset:()=>t.n5i,mulThatAndThisToOutAsMat44_offsetAsComposition:()=>t.QUJ,normalizeArray4:()=>t.XgD,nullishToEmptyArray:()=>t.vVE,nullishToEmptyMap:()=>t.YUA,objectCachify:()=>t.ozT,primitiveCachify1:()=>t.EY5,qlerp_offsetAsComposition:()=>t.Rlh,scalar_lerp_offsetAsComposition:()=>t._7O,setupShaderProgramForMeshComponent:()=>a.M,sheenLutTexture:()=>t.NBV,updateGamePad:()=>S.KA,updateMotionControllerModel:()=>S._0,updateVBOAndVAO:()=>t.PjQ,valueWithCompensation:()=>t.wv6,valueWithDefault:()=>t.kSU});var t=__webpack_require__(8583),n=__webpack_require__(5551),i=__webpack_require__(3346),o=__webpack_require__(3952),a=__webpack_require__(6406),r=__webpack_require__(9430),s=__webpack_require__(6042),l=(__webpack_require__(3007),__webpack_require__(836)),c=__webpack_require__(2647),_=__webpack_require__(5211),h=__webpack_require__(3258),u=__webpack_require__(3591);class d extends l.m{constructor(){super(),this.vertexShaderBody="\n\n\n "}static getInstance(){return this.__instance||(this.__instance=new d),this.__instance}get vertexShaderDefinitions(){return"\n\n"}get pixelShaderDefinitions(){return`\nuniform int u_shadingModel;\nuniform float u_shininess;\n\nstruct Light {\n vec4 lightPosition;\n vec4 lightDirection;\n vec4 lightIntensity;\n};\nuniform Light u_lights[${h.D.maxLightNumberInShader}];\nuniform int u_lightNumber;\nuniform vec3 u_viewPosition;\n\n\nbool classicShading(\n in vec3 diffuseColor,\n in vec3 position_inWorld,\n in vec3 normal_inWorld,\n out vec3 outColor\n )\n{\n // Lighting\n outColor = vec3(0.0, 0.0, 0.0);\n if (u_shadingModel > 0) {\n\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n for (int i = 0; i < ${h.D.maxLightNumberInShader}; i++) {\n if (i >= u_lightNumber) {\n break;\n }\n\n vec3 lightDirection = u_lights[i].lightDirection.xyz;\n float lightType = u_lights[i].lightPosition.w;\n float spotCosCutoff = u_lights[i].lightDirection.w;\n float spotExponent = u_lights[i].lightIntensity.w;\n\n if (0.75 < lightType) { // is pointlight or spotlight\n lightDirection = normalize(u_lights[i].lightPosition.xyz - position_inWorld.xyz);\n }\n float spotEffect = 1.0;\n if (lightType > 1.75) { // is spotlight\n spotEffect = dot(u_lights[i].lightDirection.xyz, lightDirection);\n if (spotEffect > spotCosCutoff) {\n spotEffect = pow(spotEffect, spotExponent);\n } else {\n spotEffect = 0.0;\n }\n }\n\n vec3 incidentLight = spotEffect * u_lights[i].lightIntensity.xyz;\n// incidentLight *= M_PI;\n\n normal_inWorld = normalize(normal_inWorld);\n\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, lightDirection)) * incidentLight;\n\n if (u_shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(u_viewPosition - position_inWorld.xyz);\n vec3 halfVector = normalize(lightDirection + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), u_shininess);\n } else if (u_shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(u_viewPosition - position_inWorld.xyz);\n vec3 R = reflect(lightDirection, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), u_shininess);\n }\n\n }\n\n outColor = diffuse + specular;\n } else {\n outColor = diffuseColor;\n }\n}\n\n `}get pixelShaderBody(){return""}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}d.materialElement=u.Z.PBRShading;var m=__webpack_require__(9214),f=__webpack_require__(4212),p=__webpack_require__(4109),v=__webpack_require__(6796),A=__webpack_require__(204),y=__webpack_require__(9071),x=__webpack_require__(3667),g=__webpack_require__(3870),I=__webpack_require__(1193),b=__webpack_require__(2161),E=__webpack_require__(10),T=__webpack_require__(8107),S=__webpack_require__(5514),C=__webpack_require__(2102),w=__webpack_require__(2251);function R(){return w.x.getInstance().getModule("xr").WebXRSystem.getInstance()}__webpack_require__(9131);const P=__webpack_require__(5337).Z,M=e})();var __webpack_exports__default=__webpack_exports__.Z;export{__webpack_exports__default as default}; \ No newline at end of file diff --git a/libs/rhodonite/v0.11.7/rhodonite.min.js b/libs/rhodonite/v0.11.7/rhodonite.min.js index 8e1df8dd..905da7b8 100644 --- a/libs/rhodonite/v0.11.7/rhodonite.min.js +++ b/libs/rhodonite/v0.11.7/rhodonite.min.js @@ -1,2 +1,2 @@ /*! For license information please see rhodonite.min.js.LICENSE.txt */ -var Rn;(()=>{var __webpack_modules__={4878:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord_0;\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec3 v_position_inWorld;\n\nuniform int u_envHdriFormat; // initialValue=0\nuniform float u_envRotation; // initialValue=0\nuniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)\nuniform samplerCube u_colorEnvTexture; // initialValue=(0,black)\nuniform bool u_makeOutputSrgb; // initialValue=true\nuniform bool u_inverseEnvironment; // initialValue=true\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\nvoid main() {\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // diffuseColor\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture\n\n // adapt OpenGL (RenderMan) CubeMap convention\n float envRotation = get_envRotation(materialSID, 0);\n float rot = envRotation + 3.1415;\n mat3 rotEnvMatrix = mat3(cos(rot), 0.0, -sin(rot), 0.0, 1.0, 0.0, sin(rot), 0.0, cos(rot));\n vec3 envNormal = normalize(rotEnvMatrix * v_position_inWorld);\n\n if (get_inverseEnvironment(materialSID, 0)) {\n envNormal.x *= -1.0;\n }\n\n vec4 diffuseTexel = texture(u_colorEnvTexture, envNormal);\n vec3 textureColor;\n int EnvHdriFormat = get_envHdriFormat(materialSID, 0);\n if (EnvHdriFormat == 0) { // LDR_SRGB\n textureColor = srgbToLinear(diffuseTexel.rgb);\n } else if (EnvHdriFormat == 3) { // RGBE\n textureColor = diffuseTexel.rgb * pow(2.0, diffuseTexel.a*255.0-128.0);\n } else {\n textureColor = diffuseTexel.rgb;\n }\n diffuseColor *= textureColor;\n\n rt0 = vec4(diffuseColor, alpha);\n\nfloat makeOutputSrgb = float(get_makeOutputSrgb(materialSID, 0));\nrt0.rgb = mix(rt0.rgb, linearToSrgb(rt0.rgb), makeOutputSrgb);\n\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0}},5757:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\n\nout vec2 v_texcoord_0;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec3 v_position_inWorld;\n\nuniform bool u_enableViewMatrix; // initialValue=true\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n\n if (get_enableViewMatrix(materialSID, 0)) {\n mat4 rotateMatrix = viewMatrix;\n rotateMatrix[3][0] = 0.0;\n rotateMatrix[3][1] = 0.0;\n rotateMatrix[3][2] = 0.0;\n gl_Position = projectionMatrix * rotateMatrix * worldMatrix * vec4(a_position, 1.0);\n } else {\n gl_Position = projectionMatrix * worldMatrix * vec4(a_position, 1.0);\n }\n\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n v_normal_inWorld = normalMatrix * a_normal;\n\n v_color = a_color;\n v_position_inWorld = (worldMatrix * vec4(a_position, 1.0)).xyz;\n v_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1}},3034:e=>{e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./../../dist/",n(n.s="./src/index.ts")}({"./src/index.ts":function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("./src/main/Shaderity.ts"));t.default=o.default},"./src/main/Reflection.ts":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class i{constructor(e,t){this.__attributeSemanticsMap=new Map,this.__uniformSemanticsMap=new Map,this.__attributes=[],this.__varyings=[],this.__uniforms=[],this.__splittedShaderCode=e,this.__shaderStage=t,this.__setDefaultAttributeAndUniformSemanticsMap()}get attributes(){return this.__attributes}get varyings(){return this.__varyings}get uniforms(){return this.__uniforms}get attributesNames(){return this.__attributes.map((e=>e.name))}get attributesSemantics(){return this.__attributes.map((e=>e.semantic))}get attributesTypes(){return this.__attributes.map((e=>e.type))}addAttributeSemanticsMap(e){this.__attributeSemanticsMap=new Map([...this.__attributeSemanticsMap,...e])}addUniformSemanticsMap(e){this.__uniformSemanticsMap=new Map([...this.__uniformSemanticsMap,...e])}addAttributeSemantics(e,t){this.__attributeSemanticsMap.set(e,t)}addUniformSemantics(e,t){this.__uniformSemanticsMap.set(e,t)}resetAttributeSemantics(){this.__attributeSemanticsMap=new Map}resetUniformSemantics(){this.__uniformSemanticsMap=new Map}reflect(){const e=this.__splittedShaderCode,t=this.__shaderStage;for(const n of e)this.__matchAttribute(n,t)?this.__addAttribute(n):this.__matchVarying(n,t)?this.__addVarying(n,t):n.match(/^(?![\/])[\t ]*uniform[\t ]+/)&&this.__addUniform(n)}__setDefaultAttributeAndUniformSemanticsMap(){this.__attributeSemanticsMap.set("position","POSITION"),this.__attributeSemanticsMap.set("color$","COLOR_0"),this.__attributeSemanticsMap.set("color_?0","COLOR_0"),this.__attributeSemanticsMap.set("texcoord$","TEXCOORD_0"),this.__attributeSemanticsMap.set("texcoord_?0","TEXCOORD_0"),this.__attributeSemanticsMap.set("texcoord_?1","TEXCOORD_1"),this.__attributeSemanticsMap.set("texcoord_?2","TEXCOORD_2"),this.__attributeSemanticsMap.set("normal","NORMAL"),this.__attributeSemanticsMap.set("tangent","TANGENT"),this.__attributeSemanticsMap.set("joint$","JOINTS_0"),this.__attributeSemanticsMap.set("bone$","JOINTS_0"),this.__attributeSemanticsMap.set("joint_?0","JOINTS_0"),this.__attributeSemanticsMap.set("bone_?0","JOINTS_0"),this.__attributeSemanticsMap.set("weight$","WEIGHTS_0"),this.__attributeSemanticsMap.set("weight_?0","WEIGHTS_0"),this.__uniformSemanticsMap.set("worldmatrix","WorldMatrix"),this.__uniformSemanticsMap.set("normalmatrix","NormalMatrix"),this.__uniformSemanticsMap.set("viewmatrix","ViewMatrix"),this.__uniformSemanticsMap.set("projectionmatrix","ProjectionMatrix"),this.__uniformSemanticsMap.set("modelviewmatrix","ModelViewMatrix")}__matchAttribute(e,t){return"vertex"===t&&e.match(/^(?![\/])[\t ]*(attribute|in)[\t ]+.+;/)}__addAttribute(e){const t={name:"",type:"float",semantic:"UNKNOWN"},n=e.match(i.attributeAndVaryingTypeRegExp);if(n){const o=n[1];t.type=o;const a=n[2];t.name=a;const r=e.match(i.semanticRegExp);if(r)t.semantic=r[1];else for(let[e,n]of this.__attributeSemanticsMap)a.match(new RegExp(e,"i"))&&(t.semantic=n)}this.__attributes.push(t)}__matchVarying(e,t){return"vertex"===t?e.match(/^(?![\/])[\t ]*(varying|out)[\t ]+.+;/):e.match(/^(?![\/])[\t ]*(varying|in)[\t ]+.+;/)}__addVarying(e,t){const n={name:"",type:"float",inout:"in"},o=e.match(i.attributeAndVaryingTypeRegExp);if(o){const e=o[1];n.type=e;const i=o[2];n.name=i,n.inout="vertex"===t?"out":"in"}this.__varyings.push(n)}__addUniform(e){const t={name:"",type:"float",semantic:"UNKNOWN"},n=e.match(i.uniformTypeRegExp);if(n){const o=n[1];t.type=o;const a=n[2];t.name=a;const r=e.match(i.semanticRegExp);if(r)t.semantic=r[1];else for(let[e,n]of this.__uniformSemanticsMap)a.match(new RegExp(e,"i"))&&(t.semantic=n)}this.__uniforms.push(t)}}t.default=i,i.attributeAndVaryingTypeRegExp=/[\t ]+(float|int|vec2|vec3|vec4|mat2|mat3|mat4|ivec2|ivec3|ivec4)[\t ]+(\w+);/,i.uniformTypeRegExp=/[\t ]+(float|int|vec2|vec3|vec4|mat2|mat3|mat4|ivec2|ivec3|ivec4|sampler2D|samplerCube|sampler3D)[\t ]+(\w+);/,i.semanticRegExp=/<.*semantic[\t ]*=[\t ]*(\w+).*>/},"./src/main/ShaderEditor.ts":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static _insertDefinition(e,t){const n=t.replace(/#define[\t ]+/,"");e.unshift(`#define ${n}`)}static _fillTemplate(e,t){const n=e.replace(/\/\*[\t ]*shaderity:[\t ]*(@{[\t ]*)(\S+)([\t ]*})[\t ]*\*\//g,"${this.$2}");return new Function("return `"+n+"`;").call(t)}}},"./src/main/ShaderTransformer.ts":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static _transformToGLSLES1(e,t,n){return this.__convertOrInsertVersionGLSLES1(e),this.__removeES3Qualifier(e,n),this.__convertIn(e,t),this.__convertOut(e,t,n),this.__removePrecisionForES3(e),this.__convertTextureFunctionToES1(e,t,n),e}static _transformToGLSLES3(e,t){return this.__convertOrInsertVersionGLSLES3(e),this.__convertAttribute(e,t),this.__convertVarying(e,t),this.__convertTextureCube(e),this.__convertTexture2D(e),this.__convertTexture2DProd(e),this.__convertTexture3D(e),this.__convertTexture3DProd(e),e}static _transformTo(e,t,n,i){return e.match(/webgl2|es3/i)?this._transformToGLSLES3(t,n):e.match(/webgl1|es1/i)?this._transformToGLSLES1(t,n,i):(console.error("Invalid Version"),t)}static __convertOrInsertVersionGLSLES1(e){this.__removeFirstMatchingLine(e,/^(?![\/])[\t ]*#[\t ]*version[\t ]+.*/),e.unshift("#version 100")}static __convertOrInsertVersionGLSLES3(e){this.__removeFirstMatchingLine(e,/^(?![\/])[\t ]*#[\t ]*version[\t ]+.*/),e.unshift("#define GLSL_ES3"),e.unshift("#version 300 es")}static __convertIn(e,t){let n;n=t?function(e,t){return"varying "+t}:function(e,t){return"attribute "+t},this.__replaceLine(e,/^(?![\/])[\t ]*in[\t ]+((highp|mediump|lowp|)[\t ]*\w+[\t ]*\w+[\t ]*;)/,n)}static __convertOut(e,t,n){if(t){const t=this.__removeOutQualifier(e,n);if(null==t)return;this.__addGLFragColor(t,e,n)}else{const t=/^(?![\/])[\t ]*out[\t ]+((highp|mediump|lowp|)[\t ]*\w+[\t ]*\w+[\t ]*;)/,n=function(e,t){return"varying "+t};this.__replaceLine(e,t,n)}}static __removeOutQualifier(e,t){const n=/^(?![\/])[\t ]*out[\t ]+((highp|mediump|lowp|)[\t ]*\w+[\t ]*(\w+)[\t ]*;)/;let i;for(let t=0;t=0;e--){const n=t[e];if(!s&&n.match(i)&&(t[e]=n.replace(i,`$1\n${r}\n}\n`),s=!0),n.match(o)&&t.splice(e,0,r),n.match(a))break}if(!s){const e="__removeOutQualifier: Not found the closing brackets for the main function";this.__outError(t,t.length,e,n)}}static __removeES3Qualifier(e,t){this.__removeVaryingQualifier(e,t),this.__removeLayout(e)}static __removeVaryingQualifier(e,t){const n=/^(?![\/])[\t ]*(flat|smooth)[\t ]*((in|out)[\t ]+.*)/;for(let i=0;i"flat"===o?(this.__outError(e,i+1,"__removeVaryingQualifier: glsl es1 does not support flat qualifier",t),n):a))}static __removeLayout(e){this.__replaceLine(e,/^(?![\/])[\t ]*layout[\t ]*\([\t ]*location[\t ]*\=[\t ]*\d[\t ]*\)[\t ]+/g,"")}static __removePrecisionForES3(e){const t=/^(?![\/])[\t ]*precision[\t ]+(highp|mediump|lowp)[\t ]+(\w+)[\t ]*;/;for(let n=0;n=0;r--){if(!e[r].match(/\{/))continue;const t=null===(i=this.__getBracketSection(e,r).match(/.*\((.*)\)/))||void 0===i?void 0:i[1];if(null==t)return;const s=t.split(","),l=/[\n\t ]*(highp|mediump|lowp|)[\n\t ]*(sampler\w+)[\n\t ]*(\w+)[\n\t ]*/;if(null!==(o=s[0].match(l))&&void 0!==o?o:s[0].match(/^[\n\t ]*$/)){for(const t of s){const i=t.match(l);if(null==i)continue;const o=i[2],s=i[3];if(a.get(s)){const t="__createArgumentSamplerMap: duplicate variable name";this.__outError(e,r,t,n)}a.set(s,o)}break}}return a}static __getBracketSection(e,t){let n=0;for(let i=t;i>=0;i--)if(e[i].match(/\(/)){n=i;break}let i="";for(let o=n;o<=t;o++)i+=e[o];return i}static __convertAttribute(e,t){t||this.__replaceLine(e,/^(?![\/])[\t ]*attribute[\t ]+/g,"in ")}static __convertVarying(e,t){const n=t?"in ":"out ";this.__replaceLine(e,/^(?![\/])[\t ]*varying[\t ]+/g,n)}static __convertTextureCube(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(textureCube)(${t}+)`,"g");this.__replaceLine(e,n,"$1texture$3")}static __convertTexture2D(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture2D)(${t}+)`,"g");this.__replaceLine(e,n,"$1texture$3")}static __convertTexture2DProd(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture2DProj)(${t}+)`,"g");this.__replaceLine(e,n,"$1textureProj$3")}static __convertTexture3D(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture3D)(${t}+)`,"g");this.__replaceLine(e,n,"$1texture$3")}static __convertTexture3DProd(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture3DProj)(${t}+)`,"g");this.__replaceLine(e,n,"$1textureProj$3")}static __regSymbols(){return"[!\"#$%&'()*+-.,/:;<=>?@[\\]^`{|}~\t\n ]"}static __replaceLine(e,t,n){for(let i=0;i=0&&!e[t].match(o);t--)if(e[t]===i)return;console.error(n),e.push(i)}}}},"./src/main/Shaderity.ts":function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("./src/main/Reflection.ts")),a=i(n("./src/main/ShaderTransformer.ts")),r=i(n("./src/main/ShaderEditor.ts")),s=i(n("./src/main/Utility.ts")),l=i(n("./src/main/ShaderityObjectCreator.ts"));t.default=class{static transformToGLSLES1(e,t=!1){const n=s.default._splitByLineFeedCode(e.code),i=a.default._transformToGLSLES1(n,e.isFragmentShader,t);return{code:s.default._joinSplittedLine(i),shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}static transformToGLSLES3(e){const t=s.default._splitByLineFeedCode(e.code),n=a.default._transformToGLSLES3(t,e.isFragmentShader);return{code:s.default._joinSplittedLine(n),shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}static transformTo(e,t,n=!1){const i=s.default._splitByLineFeedCode(t.code),o=a.default._transformTo(e,i,t.isFragmentShader,n);return{code:s.default._joinSplittedLine(o),shaderStage:t.shaderStage,isFragmentShader:t.isFragmentShader}}static createShaderityObjectCreator(e){return new l.default(e)}static fillTemplate(e,t){const n=this.__copyShaderityObject(e);return n.code=r.default._fillTemplate(n.code,t),n}static insertDefinition(e,t){const n=this.__copyShaderityObject(e),i=s.default._splitByLineFeedCode(e.code);return r.default._insertDefinition(i,t),n.code=s.default._joinSplittedLine(i),n}static createReflectionObject(e){const t=s.default._splitByLineFeedCode(e.code);return new o.default(t,e.shaderStage)}static __copyShaderityObject(e){return{code:e.code,shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}}},"./src/main/ShaderityObjectCreator.ts":function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("./src/main/Utility.ts"));class a{constructor(e){this.__functionIdCount=0,this.__defineDirectiveNames=[],this.__extensions=[],this.__globalPrecision={int:"highp",float:"highp",sampler2D:"highp",samplerCube:"highp",sampler3D:"highp",sampler2DArray:"highp",isampler2D:"highp",isamplerCube:"highp",isampler3D:"highp",isampler2DArray:"highp",usampler2D:"highp",usamplerCube:"highp",usampler3D:"highp",usampler2DArray:"highp",sampler2DShadow:"highp",samplerCubeShadow:"highp",sampler2DArrayShadow:"highp"},this.__structDefinitions=[],this.__globalConstantValues=[],this.__globalConstantStructValues=[],this.__attributes=[],this.__varyings=[],this.__uniforms=[],this.__uniformStructs=[],this.__uniformBufferObjects=[],this.__functions=[],this.__mainFunctionCode="void main() {}",this.__outputColorVariableName="renderTarget0",this.__shaderStage=e}addDefineDirective(e){this.__defineDirectiveNames.some((t=>t===e))?console.warn("addDefineDirective: this define directive is already set"):this.__defineDirectiveNames.push(e)}addExtension(e,t="enable"){this.__extensions.some((t=>t.extensionName===e))?console.warn("addExtension: this extension is already set"):this.__extensions.push({extensionName:e,behavior:t})}addStructDefinition(e,t){this.__structDefinitions.some((t=>t.structName===e))?console.error(`addStructDefinition: duplicate struct type name ${e}`):this.__structDefinitions.push({structName:e,memberObjects:t})}addGlobalConstantValue(e,t,n){this.__globalConstantValues.some((t=>t.variableName===e))?console.error(`addGlobalConstantValue: duplicate variable name ${e}`):o.default._isValidComponentCount(t,n)?(o.default._isIntType(t)&&a.__existNonIntegerValue(n)&&console.warn(`addGlobalConstantValue: non-integer value is set to ${e}`),this.__globalConstantValues.push({variableName:e,type:t,values:n})):console.error(`addGlobalConstantValue: the component count of ${e} is invalid`)}addGlobalConstantStructValue(e,t,n){this.__globalConstantStructValues.some((e=>e.variableName===t))?console.error(`addGlobalConstantStructValue: duplicate variable name ${t}`):this.__globalConstantStructValues.push({variableName:t,structName:e,values:n})}addAttributeDeclaration(e,t,n){"vertex"===this.__shaderStage?this.__attributes.some((t=>t.variableName===e))?console.error(`addAttribute: duplicate variable name ${e}`):this.__attributes.push({variableName:e,type:t,precision:null==n?void 0:n.precision,location:null==n?void 0:n.location}):console.error("addAttribute: this method is for vertex shader only")}addVaryingDeclaration(e,t,n){if(this.__varyings.some((t=>t.variableName===e)))return void console.error(`addVarying: duplicate variable name ${e}`);const i=o.default._isIntType(t);let a=null==n?void 0:n.interpolationType;if(i&&"flat"!==a){if(null!=a)return void console.error("addVarying: the interpolationType must be flat for integer types");console.warn("addVarying: set the interpolationType of integer types to flat to avoid compilation error"),a="flat"}this.__varyings.push({variableName:e,type:t,precision:null==n?void 0:n.precision,interpolationType:a})}addUniformDeclaration(e,t,n){this.__uniforms.some((t=>t.variableName===e))?console.error(`addUniform: duplicate variable name ${e}`):("bool"===t&&null!=(null==n?void 0:n.precision)&&(console.warn("addUniform: remove the specification of precision for bool type to avoid compilation error"),n.precision=void 0),this.__uniforms.push({variableName:e,type:t,precision:null==n?void 0:n.precision}))}addUniformStructDeclaration(e,t){this.__uniformStructs.some((e=>e.variableName===t))?console.error(`addUniformStructDeclaration: duplicate variable name ${t}`):this.__uniformStructs.push({variableName:t,structName:e})}addUniformBufferObjectDeclaration(e,t,n){if(this.__uniformBufferObjects.some((t=>t.blockName===e)))console.error(`addUniformBufferObjectDeclaration: duplicate block name ${e}`);else{for(const e of this.__uniformBufferObjects)for(const n of e.variableObjects)for(const e of t)if(n.variableName===e.variableName)return void console.error(`addUniformBufferObjectDeclaration: duplicate variable name ${e.variableName}`);this.__uniformBufferObjects.push({blockName:e,variableObjects:t,instanceName:null==n?void 0:n.instanceName})}}addFunctionDefinition(e,t){var n,i;const o=this.__functionIdCount++,a=null!==(n=null==t?void 0:t.dependencyLevel)&&void 0!==n?n:0;return this.__functions[a]=null!==(i=this.__functions[a])&&void 0!==i?i:[],this.__functions[a].push({functionCode:e,functionId:o}),o}updateGlobalPrecision(e){Object.assign(this.__globalPrecision,e)}updateStructDefinition(e,t){const n=this.__structDefinitions.findIndex((t=>t.structName===e));-1!==n?this.__structDefinitions[n].memberObjects=t:console.error(`updateStructDefinition: the struct type name ${e} is not exist`)}updateGlobalConstantValue(e,t){const n=this.__globalConstantValues.findIndex((t=>t.variableName===e));if(-1===n)return void console.warn(`updateGlobalConstantValue: the variable name ${e} is not exist`);const i=this.__globalConstantValues[n].type;o.default._isValidComponentCount(i,t)?(o.default._isIntType(i)&&a.__existNonIntegerValue(t)&&console.warn(`updateGlobalConstantValue: the ${e} has a non-integer value.`),this.__globalConstantValues[n].values=t):console.error("updateGlobalConstantValue: the component count is invalid")}updateGlobalConstantStructValue(e,t){const n=this.__globalConstantStructValues.findIndex((t=>t.variableName===e));-1!==n?this.__globalConstantStructValues[n].values=t:console.error(`updateGlobalConstantStructValue: the variable name ${e} is not exist`)}updateMainFunction(e){this.__mainFunctionCode=e}updateOutputColorVariableName(e){"fragment"===this.__shaderStage?0!==e.length?this.__outputColorVariableName=e:console.error("updateOutputColorVariableName: invalid outColorVariableName"):console.error("updateOutputColorVariableName: this method is for fragment shader only")}removeDefineDirective(e){const t=this.__defineDirectiveNames.indexOf(e);-1!==t?this.__defineDirectiveNames.splice(t,1):console.warn("removedDefineDirective: this define directive is not exist")}removeExtension(e){const t=this.__extensions.findIndex((t=>t.extensionName===e));-1!==t?this.__extensions.splice(t,1):console.warn("removeExtension: this extension is not exist")}removeStructDefinition(e){const t=this.__structDefinitions.findIndex((t=>t.structName===e));-1!==t?this.__structDefinitions.splice(t,1):console.error(`removeStructDefinition: the struct type name ${e} is not exist`)}removeGlobalConstantValue(e){const t=this.__globalConstantValues.findIndex((t=>t.variableName===e));-1!==t?this.__globalConstantValues.splice(t,1):console.warn(`removeGlobalConstantValue: the variable name ${e} is not exist`)}removeGlobalConstantStructValue(e){const t=this.__globalConstantStructValues.findIndex((t=>t.variableName===e));-1!==t?this.__globalConstantStructValues.splice(t,1):console.error(`updateGlobalConstantStructValue: the variable name ${e} is not exist`)}removeAttributeDeclaration(e){const t=this.__attributes.findIndex((t=>t.variableName===e));-1!==t?this.__attributes.splice(t,1):console.warn(`removeAttribute: the variable name ${e} is not exist`)}removeVaryingDeclaration(e){const t=this.__varyings.findIndex((t=>t.variableName===e));-1!==t?this.__varyings.splice(t,1):console.warn(`removeVarying: the variable name ${e} is not exist`)}removeUniformDeclaration(e){const t=this.__uniforms.findIndex((t=>t.variableName===e));-1!==t?this.__uniforms.splice(t,1):console.warn(`removeUniform: the variable name ${e} is not exist`)}removeUniformStructDeclaration(e){const t=this.__uniformStructs.findIndex((t=>t.variableName===e));-1!==t?this.__uniformStructs.splice(t,1):console.warn(`removeUniformStructDeclaration: the variable name ${e} is not exist`)}removeUniformBufferObjectDeclaration(e){const t=this.__uniformBufferObjects.findIndex((t=>t.blockName===e));-1!==t?this.__uniformBufferObjects.splice(t,1):console.warn(`removeUniformStructDeclaration: the variable name ${e} is not exist`)}removeFunctionDefinition(e){this.__fillEmptyFunctions(),(e<0||e>=this.__functionIdCount)&&console.warn("removeFunctionDefinition: invalid function id");for(const t of this.__functions){const n=t.findIndex((t=>t.functionId===e));if(-1!==n)return void t.splice(n,1)}console.warn(`removeFunctionDefinition: not found the function of functionId ${e}`)}createShaderityObject(){return{code:this.__createShaderCode(),shaderStage:this.__shaderStage,isFragmentShader:"fragment"===this.__shaderStage}}static __existNonIntegerValue(e){for(const t of e)if(!Number.isInteger(t))return!0;return!1}__createShaderCode(){return this.__fillEmptyFunctions(),"#version 300 es\n\n"+this.__createDefineDirectiveShaderCode()+this.__createExtensionShaderCode()+this.__createGlobalPrecisionShaderCode()+this.__createStructDefinitionShaderCode()+this.__createGlobalConstantValueShaderCode()+this.__createGlobalConstantStructValueShaderCode()+this.__createAttributeDeclarationShaderCode()+this.__createVaryingDeclarationShaderCode()+this.__createOutputColorDeclarationShaderCode()+this.__createUniformDeclarationShaderCode()+this.__createUniformStructDeclarationShaderCode()+this.__createUniformBufferObjectShaderCode()+this.__createFunctionDefinitionShaderCode()+this.__createMainFunctionDefinitionShaderCode()}__fillEmptyFunctions(){var e;for(let t=0;te.structName===t.structName));if(-1===n){console.error(`__createGlobalConstantStructValueShaderCode: the struct type ${t.structName} is not defined`);continue}e+=`const ${t.structName} ${t.variableName} = ${t.structName} (\n`;const i=this.__structDefinitions[n];if(i.memberObjects.length===Object.keys(t.values).length)if(i.memberObjects.some((e=>o.default._isSamplerType(e.type))))console.error(`__createGlobalConstantStructValueShaderCode: ConstantStructValue (${t.variableName}) cannot have sampler type parameter`);else{for(let n=0;ne.structName===n))?e+=`uniform ${n} ${t.variableName};\n`:console.error(`__createUniformStructDeclarationShaderCode: the struct type ${n} is not defined`)}return o.default._addLineFeedCodeIfNotNullString(e)}__createUniformBufferObjectShaderCode(){let e="";for(const t of this.__uniformBufferObjects){e+=`layout (std140) uniform ${t.blockName} {\n`;for(let n=0;n{"use strict";n.d(t,{D:()=>f});var i=n(9721),o=n(1350),a=n(8491),r=n(4507),s=n(6692),l=n(224),c=n(2404),_=n(4710),h=n(7987),u=n(3258),d=n(3496),m=n(4690);class f extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.type="efk",this.playJustAfterLoaded=!1,this.isLoop=!1,this.isPause=!1,this.randomSeed=-1,this.isImageLoadWithCredential=!1,this.__speed=1,this.__isInitialized=!1,this.isLoadEffect=!1,u.D.noWebGLTex2DStateCache=!0}static get componentTID(){return _.z.EffekseerComponentTID}cancelLoop(){clearInterval(this.__timer)}isPlay(){return!!m.Is.exist(this.__handle)&&!!this.__handle.exists&&!this.isPause}play(){return m.Is.not.exist(this.__context)?(console.warn("No Effekseer context yet"),!1):m.Is.not.exist(this.__effect)?(console.warn("No Effekseer effect yet"),!1):(this.stop(),this.isPause=!1,this.__handle=this.__context.play(this.__effect,0,0,0),m.Is.exist(this.__handle)&&m.Is.exist(this.__handle.setRandomSeed)&&this.randomSeed>0&&this.__handle.setRandomSeed(this.randomSeed),!0)}continue(){this.isPause=!1}pause(){m.Is.exist(this.__handle)&&(this.isPause=!0,clearInterval(this.__timer))}stop(){m.Is.exist(this.__handle)&&(this.__handle.stop(),this.isPause=!0,clearInterval(this.__timer))}set playSpeed(e){this.__handle&&this.__handle.setSpeed(e),this.__speed=e}get playSpeed(){return this.__speed}setTime(e){if(!this.play())return!1;if(m.Is.not.exist(this.__context))return!1;let t=0;const n=.0166;for(t=n;t<=e;)if(this.__context.update(t/n),t+=n,e{this.playJustAfterLoaded&&(this.play(),this.moveStageTo(r.I.Logic))},o=(e,t)=>{console.error(e,t)};if("efkpkg"===this.type){if(m.Is.not.exist(f.Unzip))return console.error("Please Set an Unzip object to EffekseerComponent.Unzip"),!1;this.__effect=this.__context.loadEffectPackage(n,f.Unzip,1,i.bind(this),o.bind(this))}else this.__effect=this.__context.loadEffect(n,1,i.bind(this),o.bind(this));return!0}$load(){!this.__isInitialized&&m.Is.not.exist(this.__context)&&m.Is.not.exist(this.__effect)&&(m.Is.exist(f.wasmModuleUri)?effekseer.initRuntime(f.wasmModuleUri,(()=>{this.__createEffekseerContext()&&this.moveStageTo(r.I.Logic)}),(()=>{console.error("Failed to initialize Effekseer")})):this.__createEffekseerContext()&&this.moveStageTo(r.I.Logic))}$logic(){if(this.isPause||m.Is.exist(this.__context)&&m.Is.false(this.isPause)&&this.__context.update(),null!=this.__handle){const e=f.__tmp_identityMatrix_0.copyComponents(this.__sceneGraphComponent.matrixInner);this.__handle.setMatrix(e._v),this.__handle.setSpeed(this.__speed)}this.isPause||this.isLoop&&(this.isPlay()||this.play()),this.moveStageTo(r.I.Render)}_destroy(){m.Is.exist(this.__context)&&(this.__context.releaseEffect(!this.__effect),effekseer.releaseContext(this.__context),this.__context=void 0),m.Is.exist(this.__handle)&&(this.__handle=void 0),this.__effect=void 0}$render(){if(m.Is.not.exist(this.__effect))return void this.moveStageTo(r.I.Load);const e=c.C.getComponent(l.M,l.M.current),t=f.__tmp_identityMatrix_0,n=f.__tmp_identityMatrix_1;e?(t.copyComponents(e.viewMatrix),n.copyComponents(e.projectionMatrix)):(t.identity(),n.identity()),m.Is.exist(this.__context)&&(this.__context.setProjectionMatrix(n._v),this.__context.setCameraMatrix(t._v),this.__context.draw()),this.moveStageTo(r.I.Logic)}static sort_$render(e){return m.Is.false(e.toRenderEffekseerEffects)?[]:c.C.getComponentsWithType(f).map((e=>e.componentSID))}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getEffekseer(){return this.getComponentByComponentTID(f.componentTID)}}return(0,o.e)(e,n),e}}f.ANIMATION_EVENT_PLAY=0,f.ANIMATION_EVENT_PAUSE=1,f.ANIMATION_EVENT_END=2,f.wasmModuleUri=void 0,f.__tmp_identityMatrix_0=d.e.identity(),f.__tmp_identityMatrix_1=d.e.identity(),c.C.registerComponentClass(f)},8107:(e,t,n)=>{"use strict";n.d(t,{A:()=>i.Effekseer,D:()=>o.D});var i=n(3995),o=n(7015)},3995:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Effekseer:()=>s});var i=n(7015),o=n(1350),a=n(6692),r=n(8491);const s=Object.freeze({EffekseerComponent:i.D,createEffekseerEntity:function(){const e=o.g.createEntity(),t=o.g.addComponentToEntity(a.U,e),n=o.g.addComponentToEntity(r.a,t);return o.g.addComponentToEntity(i.D,n)}})},3658:(e,t,n)=>{"use strict";n.d(t,{m:()=>a});var i=n(2471),o=n(4690);class a{constructor(){this.zNearMax=.1,this.zFarScalingFactor=1e5,this.autoCalculateZNearAndZFar=!0}_calcZNearInner(e,t,n){if(this.autoCalculateZNearAndZFar&&o.Is.exist(this.__targetEntity)){const o=this.__targetEntity.getSceneGraph().worldAABB,a=i.P.lengthBtw(t,o.centerPoint),r=o.centerPoint.x-t.x,s=o.centerPoint.y-t.y,l=o.centerPoint.z-t.z,c=(r*n.x+s*n.y+l*n.z)/(Math.hypot(r,s,l)*n.length());e.zNearInner=Math.max(Math.min(a*c-o.lengthCenterToCorner,this.zNearMax),.01)}else e.zNearInner=e.zNear}_calcZFarInner(e){this.autoCalculateZNearAndZFar?e.zFarInner=e.zNearInner*this.zFarScalingFactor:e.zNearInner=e.zFar}}},6547:(e,t,n)=>{"use strict";n.d(t,{j:()=>d});var i=n(2471),o=n(9190),a=n(3032),r=n(2566),s=n(5467),l=n(3496),c=n(3658),_=n(4690),h=n(4742),u=n(3258);class d extends c.m{constructor(){super(),this.dollyScale=2,this.scaleOfLengthCenterToCamera=1,this.moveSpeed=1,this.followTargetAABB=!1,this.autoUpdate=!0,this.__updated=!1,this.__fixedDolly=!1,this.__fixedLengthOfCenterToEye=1,this.__isMouseDown=!1,this.__lastMouseDownTimeStamp=0,this.__lastMouseUpTimeStamp=0,this.__originalY=-1,this.__originalX=-1,this.__buttonNumber=0,this.__mouse_translate_y=0,this.__mouse_translate_x=0,this.__efficiency=1,this.__lengthOfCenterToEye=1,this.__fovyBias=1,this.__scaleOfTranslation=2.8,this.__mouseTranslateVec=o.d6.zero(),this.__newEyeVec=o.d6.zero(),this.__newCenterVec=o.d6.zero(),this.__newUpVec=o.d6.zero(),this.__newTangentVec=o.d6.zero(),this.__isSymmetryMode=!0,this.__rot_bgn_x=0,this.__rot_bgn_y=0,this.__rot_x=0,this.__rot_y=0,this.__dolly=.5,this.__eyeVec=o.d6.zero(),this.__centerVec=o.d6.zero(),this.__upVec=o.d6.zero(),this.__scaleOfZNearAndZFar=5e3,this.__doPreventDefault=!1,this.__isPressingShift=!1,this.__isPressingCtrl=!1,this.__pinchInOutControl=!1,this.__pinchInOutOriginalDistance=null,this.__resetDollyTouchTime=0,this.__mouseDownFunc=this.__mouseDown.bind(this),this.__mouseUpFunc=this.__mouseUp.bind(this),this.__mouseMoveFunc=this.__mouseMove.bind(this),this.__touchDownFunc=this.__touchDown.bind(this),this.__touchUpFunc=this.__touchUp.bind(this),this.__touchMoveFunc=this.__touchMove.bind(this),this.__pinchInOutFunc=this.__pinchInOut.bind(this),this.__pinchInOutEndFunc=this.__pinchInOutEnd.bind(this),this.__mouseWheelFunc=this.__mouseWheel.bind(this),this.__mouseDblClickFunc=this.__mouseDblClick.bind(this),this.__contextMenuFunc=this.__contextMenu.bind(this),this.__pressShiftFunc=this.__pressShift.bind(this),this.__releaseShiftFunc=this.__releaseShift.bind(this),this.__pressCtrlFunc=this.__pressCtrl.bind(this),this.__releaseCtrlFunc=this.__releaseCtrl.bind(this),this.__resetDollyAndPositionFunc=this.__resetDollyAndPosition.bind(this),this.registerEventListeners()}resetDollyAndTranslation(){this.__dolly=.5,this.__mouse_translate_x=0,this.__mouse_translate_y=0,this.__mouseTranslateVec=o.d6.zero()}setTarget(e){this.__targetEntity=e,this.__originalTargetAABB=void 0,this.__updated=!1}getTarget(){return this.__targetEntity}set doPreventDefault(e){this.__doPreventDefault=e}get doPreventDefault(){return this.__doPreventDefault}__mouseDown(e){this.__tryToPreventDefault(e),this.__isPressingCtrl||(this.__originalX=e.clientX,this.__originalY=e.clientY,this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y,this.__isMouseDown=!0,this.__lastMouseDownTimeStamp=e.timeStamp,console.log("original",this.__originalX,this.__originalY),this.__updated=!1)}__mouseMove(e){if(this.__tryToPreventDefault(e),_.Is.false(this.isMouseDown))return;if(this.__isPressingCtrl)return;0===this.__buttonNumber&&(this.__buttonNumber=e.buttons);const t=e.clientX,n=e.clientY;switch(this.__buttonNumber){case 1:this.__isPressingShift?this.__parallelTranslateControl(this.__originalX,this.__originalY,t,n):(this.__rotateControl(this.__originalX,this.__originalY,t,n),this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y);break;case 2:this.__zoomControl(this.__originalX,t);break;case 4:this.__parallelTranslateControl(this.__originalX,this.__originalY,t,n);break;default:return}this.__originalX=t,this.__originalY=n,this.__updated=!1}__mouseUp(e){this.__buttonNumber=0,this.__originalX=-1,this.__originalY=-1,this.__isMouseDown=!1,this.__lastMouseUpTimeStamp=e.timeStamp,this.__updated=!1}__touchDown(e){this.__tryToPreventDefault(e),1===e.touches.length?(this.__originalX=e.touches[0].clientX,this.__originalY=e.touches[0].clientY,this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y):(this.__originalX=.5*(e.touches[0].clientX+e.touches[1].clientX),this.__originalY=.5*(e.touches[0].clientY+e.touches[1].clientY)),this.__isMouseDown=!0,this.__lastMouseDownTimeStamp=e.timeStamp}__touchMove(e){if(this.__tryToPreventDefault(e),_.Is.false(this.isMouseDown))return;let t=e.touches[0].clientX,n=e.touches[0].clientY;1===e.touches.length?(t=e.touches[0].clientX,n=e.touches[0].clientY,this.__rotateControl(this.__originalX,this.__originalY,t,n),this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y):(t=.5*(e.touches[0].clientX+e.touches[1].clientX),n=.5*(e.touches[0].clientY+e.touches[1].clientY),this.__parallelTranslateControl(this.__originalX,this.__originalY,t,n)),this.__originalX=t,this.__originalY=n}__touchUp(e){const t=e.touches.length;0===t?(this.__originalX=-1,this.__originalY=-1):1===t?(this.__originalX=e.touches[0].clientX,this.__originalY=e.touches[0].clientY,this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y):(this.__originalX=.5*(e.touches[0].clientX+e.touches[1].clientX),this.__originalY=.5*(e.touches[0].clientY+e.touches[1].clientY)),this.__isMouseDown=!1,this.__lastMouseUpTimeStamp=e.timeStamp}set rotX(e){this.__rot_x=e}get rotX(){return this.__rot_x}set rotY(e){this.__rot_y=e}get rotY(){return this.__rot_y}set maximumY(e){this.__maximum_y=e}set minimumY(e){this.__minimum_y=e}__rotateControl(e,t,n,i){const o=(n-e)*this.__efficiency*.3,a=(i-t)*this.__efficiency*.3;this.__rot_x=this.__rot_bgn_x-o,this.__rot_y=this.__rot_bgn_y-a,null!=this.__maximum_y&&this.__rot_y>this.__maximum_y&&(this.__rot_y=this.__maximum_y),null!=this.__minimum_y&&this.__rot_y35&&(this.__pinchInOutOriginalDistance=t,this.__pinchInOutControl=!0));const i=n/t;this.dolly*=Math.pow(i*this.__efficiency,2.2/15),this.__pinchInOutOriginalDistance=t}__pinchInOutEnd(e){e.touches.length<2&&(this.__pinchInOutControl=!1,this.__pinchInOutOriginalDistance=null)}__tryToPreventDefault(e){this.__doPreventDefault&&e.preventDefault()}__mouseWheel(e){this.__tryToPreventDefault(e),this.dolly+=Math.sign(e.deltaY)/200}__contextMenu(e){this.__tryToPreventDefault(e)}set dolly(e){e=Math.min(e,1),e=Math.max(e,1e-4);let t=Math.pow(e,5);t=Math.max(t,1e-4),this.__dolly=t}get dolly(){return Math.pow(this.__dolly,.2)}__mouseDblClick(e){e.shiftKey?this.__mouseTranslateVec.zero():e.ctrlKey&&(this.__rot_y=0,this.__rot_x=0,this.__rot_bgn_y=0,this.__rot_bgn_x=0)}__resetDollyAndPosition(e){if(e.touches.length>1)return;const t=(new Date).getTime();t-this.__resetDollyTouchTime<300?(this.dolly=Math.pow(.5,1/2.2),this.__mouseTranslateVec.zero(),this.__rot_x=0,this.__rot_y=0):this.__resetDollyTouchTime=t}__pressShift(e){!0===e.shiftKey&&(this.__isPressingShift=!0)}__releaseShift(e){!1===e.shiftKey&&(this.__isPressingShift=!1)}__pressCtrl(e){!0===e.ctrlKey&&(this.__isPressingCtrl=!0)}__releaseCtrl(e){!1===e.ctrlKey&&(this.__isPressingCtrl=!1)}registerEventListeners(){let e=window;_.Is.exist(u.D.eventTargetDom)&&(e=u.D.eventTargetDom),"ontouchend"in document?h.$t.register(h.jO,[{eventName:"touchstart",handler:this.__touchDownFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchmove",handler:this.__touchMoveFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchend",handler:this.__touchUpFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchmove",handler:this.__pinchInOutFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchend",handler:this.__pinchInOutEndFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchstart",handler:this.__resetDollyAndPositionFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"contextmenu",handler:this.__contextMenuFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"dblclick",handler:this.__mouseDblClickFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}]):h.$t.register(h.jO,[{eventName:"mousedown",handler:this.__mouseDownFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseup",handler:this.__mouseUpFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseleave",handler:this.__mouseUpFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mousemove",handler:this.__mouseMoveFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keydown",handler:this.__pressShiftFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keyup",handler:this.__releaseShiftFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keydown",handler:this.__pressCtrlFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keyup",handler:this.__releaseCtrlFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"contextmenu",handler:this.__contextMenuFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"wheel",handler:this.__mouseWheelFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"dblclick",handler:this.__mouseDblClickFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}])}unregisterEventListeners(){h.$t.unregister(h.jO)}__getFovyFromCamera(e){return e.fovy?e.fovy:a.k.radianToDegree(2*Math.atan(Math.abs(e.top-e.bottom)/(2*e.zNear)))}logic(e){this.__updated&&!this.autoUpdate||(this.__updateTargeting(e),this.__calculateInfluenceOfController(),this.__updateCameraComponent(e),this.__updated=!0)}__updateTargeting(e){const t=e.eye,n=e._direction,i=e._up,r=this.__eyeVec,l=this.__centerVec,c=this.__upVec.copyComponents(i);if(null==this.__targetEntity)r.copyComponents(t),l.copyComponents(n);else{if(null==this.__originalTargetAABB){const e=this.__targetEntity.tryToGetSceneGraph().worldAABB;this.__originalTargetAABB=e.clone()}if(this.followTargetAABB){const e=this.__targetEntity.tryToGetSceneGraph().worldAABB;l.copyComponents(e.centerPoint)}else l.copyComponents(this.__originalTargetAABB.centerPoint);const i=o.d6.subtractTo(t,n,r).normalize();let _=this.__fixedDolly?this.__fixedLengthOfCenterToEye:this.__originalTargetAABB.lengthCenterToCorner*(1+1/Math.tan(a.k.degreeToRadian(e.fovy/2)))*this.scaleOfLengthCenterToCamera;Math.abs(_)<1e-5&&(_=1),i.multiply(_).add(l);const h=e.entity.tryToGetSceneGraph();if(null!=h){const e=s.J.invertTo(h.matrixInner,d.__tmpMat44_0);e.multiplyVector3To(l,l),e.multiplyVector3To(r,r),e.multiplyVector3To(c,c)}}}__calculateInfluenceOfController(){const e=o.d6.subtractTo(this.__eyeVec,this.__centerVec,d.__tmpVec3_0);this.__fixedDolly?this.__lengthOfCenterToEye=this.__fixedLengthOfCenterToEye:(e.multiply(this.__dolly*this.dollyScale),this.__lengthOfCenterToEye=e.length());const t=this.__newUpVec,n=this.__newEyeVec,s=this.__newCenterVec,l=this.__newTangentVec;if(this.__isSymmetryMode){const c=d.__tmpVec3_1;c.setComponents(e.x,0,e.z);let _=i.P.angleOfVectors(c,d.__tmp_up);_*=Math.sign(c.cross(d.__tmp_up).y);const h=d.__tmp_rotateM_X,u=d.__tmp_rotateM_Y,m=d.__tmp_rotateM_Reset,f=d.__tmp_rotateM_Revert;h.rotateX(a.k.degreeToRadian(this.__rot_y)),u.rotateY(a.k.degreeToRadian(this.__rot_x)),m.rotateY(a.k.degreeToRadian(_)),f.rotateY(a.k.degreeToRadian(-_));const p=d.__tmp_rotateM;r.x.multiplyTo(h,m,p),p.multiplyByLeft(u),p.multiplyByLeft(f),p.multiplyVectorTo(this.__upVec,t),p.multiplyVectorTo(e,n).add(this.__centerVec),s.copyComponents(this.__centerVec);const v=d.__tmpVec3_2;o.d6.subtractTo(s,n,v),o.d6.crossTo(t,v,l),n.add(this.__mouseTranslateVec),s.add(this.__mouseTranslateVec)}else{const i=d.__tmp_rotateM_X,c=d.__tmp_rotateM_Y;i.rotateX(a.k.degreeToRadian(this.__rot_y)),c.rotateY(a.k.degreeToRadian(this.__rot_x));const _=r.x.multiplyTo(c,i,d.__tmp_rotateM);_.multiplyVectorTo(this.__upVec,t),_.multiplyVectorTo(e,n).add(this.__centerVec),s.copyComponents(this.__centerVec);const h=d.__tmpVec3_1;o.d6.subtractTo(s,n,h),o.d6.crossTo(t,h,l),n.add(this.__mouseTranslateVec),s.add(this.__mouseTranslateVec)}}__updateCameraComponent(e){const t=d.__tmpVec3_0.copyComponents(this.__newCenterVec);t.subtract(this.__newEyeVec).normalize(),this._calcZNearInner(e,this.__newEyeVec,t),this._calcZFarInner(e);const n=e.zFar/e.zNear/this.__scaleOfZNearAndZFar,i=e.left+n,o=e.right+n,r=e.top+n,s=e.bottom+n,l=this.__getFovyFromCamera(e);this.__fovyBias=Math.tan(a.k.degreeToRadian(l/2)),e.eyeInner=this.__newEyeVec,e.directionInner=this.__newCenterVec,e.upInner=this.__newUpVec,e.leftInner=i,e.rightInner=o,e.topInner=r,e.bottomInner=s,e.fovyInner=l}set scaleOfZNearAndZFar(e){this.__scaleOfZNearAndZFar=e}get scaleOfZNearAndZFar(){return this.__scaleOfZNearAndZFar}get isMouseDown(){return this.__isMouseDown}get lastMouseDownTimeStamp(){return this.__lastMouseDownTimeStamp}get lastMouseUpTimeStamp(){return this.__lastMouseUpTimeStamp}setFixedDollyTrue(e){this.__fixedLengthOfCenterToEye=e,this.__fixedDolly=!0}unsetFixedDolly(){this.__fixedDolly=!1}}d.__tmp_up=i.P.fromCopyArray([0,0,1]),d.__tmpVec3_0=o.d6.zero(),d.__tmpVec3_1=o.d6.zero(),d.__tmpVec3_2=o.d6.zero(),d.__tmp_rotateM_X=r.x.identity(),d.__tmp_rotateM_Y=r.x.identity(),d.__tmp_rotateM=r.x.identity(),d.__tmp_rotateM_Reset=r.x.identity(),d.__tmp_rotateM_Revert=r.x.identity(),d.__tmpMat44_0=l.e.identity()},4478:(e,t,n)=>{"use strict";n.d(t,{I:()=>u});var i=n(5467),o=n(8547),a=n(9190),r=n(2566),s=n(3496),l=n(3658),c=n(3032),_=n(4690),h=n(4742);class u extends l.m{constructor(e={eventTargetDom:document,verticalSpeed:1,horizontalSpeed:1,turnSpeed:.25,mouseWheelSpeedScale:1,inverseVerticalRotating:!1,inverseHorizontalRotating:!1}){super(),this._isKeyDown=!1,this._isMouseDrag=!1,this._lastKeyCode=-1,this._currentDir=a.d6.fromCopyArray([0,0,-1]),this._currentPos=a.d6.fromCopyArray([0,0,0]),this._currentCenter=a.d6.fromCopyArray([0,0,-1]),this._currentHorizontalDir=a.d6.fromCopyArray([0,0,-1]),this._newDir=a.d6.fromCopyArray([0,0,-1]),this._isMouseDown=!1,this._clickedMouseXOnCanvas=-1,this._clickedMouseYOnCanvas=-1,this._draggedMouseXOnCanvas=-1,this._draggedMouseYOnCanvas=-1,this._deltaMouseXOnCanvas=-1,this._deltaMouseYOnCanvas=-1,this._mouseXAdjustScale=1,this._mouseYAdjustScale=1,this._deltaY=-1,this._deltaX=-1,this._mouseUpBind=this._mouseUp.bind(this),this._mouseDownBind=this._mouseDown.bind(this),this._mouseMoveBind=this._mouseMove.bind(this),this._mouseWheelBind=this._mouseWheel.bind(this),this.__doPreventDefault=!1,this._needInitialize=!0,this._horizontalSpeed=e.horizontalSpeed,this._verticalSpeed=e.verticalSpeed,this._turnSpeed=e.turnSpeed,this._mouseXAdjustScale=this._turnSpeed,this._mouseYAdjustScale=this._turnSpeed,this._mouseWheelSpeedScale=e.mouseWheelSpeedScale,this._inverseVerticalRotating=e.inverseVerticalRotating,this._inverseHorizontalRotating=e.inverseHorizontalRotating,this.reset(),this._onKeydown=e=>{this._isKeyDown=!0,this._lastKeyCode=e.keyCode},this._onKeyup=e=>{this._isKeyDown=!1,this._lastKeyCode=-1};const t=e.eventTargetDom;this.registerEventListeners(t)}registerEventListeners(e=document){this._eventTargetDom=e;const t=[{eventName:"keydown",handler:this._onKeydown,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keyup",handler:this._onKeyup,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}];"ontouchend"in document&&t.push({eventName:"touchstart",handler:this._mouseDownBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchend",handler:this._mouseUpBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchmove",handler:this._mouseMoveBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}),"onmouseup"in document&&t.push({eventName:"mousedown",handler:this._mouseDownBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseup",handler:this._mouseUpBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseleave",handler:this._mouseUpBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mousemove",handler:this._mouseMoveBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}),"onwheel"in document&&t.push({eventName:"wheel",handler:this._mouseWheelBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}),h.$t.register(h.jO,t)}unregisterEventListeners(){h.$t.unregister(h.jO)}__tryToPreventDefault(e){this.__doPreventDefault&&e.preventDefault()}_mouseWheel(e){if(null===this._currentDir)return;const t=-1*Math.sign(e.deltaY)*this._mouseWheelSpeedScale*this._horizontalSpeed,n=u.__tmp_Vec3_0;n.setComponents(this._currentDir.x,0,this._currentDir.z).normalize();const i=a.d6.multiplyTo(n,t,u.__tmp_Vec3_1);this._currentPos.add(i),this._currentCenter.add(i)}_mouseDown(e){this.__tryToPreventDefault(e),this._isMouseDown=!0;const t=e.target.getBoundingClientRect();return this._clickedMouseXOnCanvas=e.clientX-t.left,this._clickedMouseYOnCanvas=e.clientY-t.top,!1}_mouseMove(e){if(this.__tryToPreventDefault(e),!this._isMouseDown)return;const t=e.target.getBoundingClientRect();this._draggedMouseXOnCanvas=e.clientX-t.left,this._draggedMouseYOnCanvas=e.clientY-t.top,this._deltaMouseXOnCanvas=this._draggedMouseXOnCanvas-this._clickedMouseXOnCanvas,this._deltaMouseYOnCanvas=this._draggedMouseYOnCanvas-this._clickedMouseYOnCanvas,this._isMouseDrag=!0}_mouseUp(e){this._isMouseDown=!1,this._isMouseDrag=!1;const t=e.target;if(null==(null==t?void 0:t.getBoundingClientRect))return;const n=t.getBoundingClientRect();this._clickedMouseXOnCanvas=e.clientX-n.left,this._clickedMouseYOnCanvas=e.clientY-n.top}tryReset(){}reset(){this._isKeyDown=!1,this._lastKeyCode=-1,this._currentPos.zero(),this._currentCenter.setComponents(0,0,-1),this._currentDir.setComponents(0,0,-1),this._currentHorizontalDir.setComponents(0,0,-1),this._isMouseDown=!1,this._isMouseDrag=!1,this._draggedMouseXOnCanvas=-1,this._draggedMouseYOnCanvas=-1,this._deltaMouseXOnCanvas=-1,this._deltaMouseYOnCanvas=-1,this._mouseXAdjustScale=this._turnSpeed,this._mouseYAdjustScale=this._turnSpeed,this._deltaY=0,this._deltaX=0,this._newDir.setComponents(0,0,-1)}logic(e){this.__updateCameraComponent(e)}__updateCameraComponent(e){const t=this.__targetEntity.getSceneGraph().worldAABB;if(this._needInitialize&&null!=t){const n=t.lengthCenterToCorner*(1+1/Math.tan(c.k.degreeToRadian(e.fovy/2)));this._currentPos.copyComponents(t.centerPoint),this._currentPos.z+=n,this._currentCenter.copyComponents(t.centerPoint),this._currentDir.setComponents(0,0,-1);const o=e.entity.tryToGetSceneGraph();if(_.Is.exist(o)){const e=i.J.invertTo(o.matrixInner,u.__tmpInvMat);e.multiplyVector3To(this._currentPos,this._currentPos),e.multiplyVector3To(this._currentCenter,this._currentCenter)}this._needInitialize=!1}const n=this._deltaY/90;this._newDir.x=this._currentDir.x*(1-n),this._newDir.y=n,this._newDir.z=this._currentDir.z*(1-n),this._newDir.normalize(),this._currentHorizontalDir.x=this._currentDir.x,this._currentHorizontalDir.y=0,this._currentHorizontalDir.z=this._currentDir.z,this._currentHorizontalDir.normalize();const o=u.__tmp_Vec3_0.zero();switch(this._lastKeyCode){case 87:case 38:o.x=this._currentHorizontalDir.x*this._horizontalSpeed,o.z=this._currentHorizontalDir.z*this._horizontalSpeed;break;case 65:case 37:o.x=this._currentHorizontalDir.z*this._horizontalSpeed,o.z=-this._currentHorizontalDir.x*this._horizontalSpeed;break;case 83:case 40:o.x=-this._currentHorizontalDir.x*this._horizontalSpeed,o.z=-this._currentHorizontalDir.z*this._horizontalSpeed;break;case 68:case 39:o.x=-this._currentHorizontalDir.z*this._horizontalSpeed,o.z=this._currentHorizontalDir.x*this._horizontalSpeed;break;case 81:o.x=-this._newDir.x*this._horizontalSpeed,o.y=-this._newDir.y*this._horizontalSpeed,o.z=-this._newDir.z*this._horizontalSpeed;break;case 69:o.x=this._newDir.x*this._horizontalSpeed,o.y=this._newDir.y*this._horizontalSpeed,o.z=this._newDir.z*this._horizontalSpeed;break;case 82:o.y=this._verticalSpeed;break;case 70:o.y=-this._verticalSpeed}if(this._currentPos.add(o),this._currentCenter.add(o),this._isMouseDrag){this._inverseHorizontalRotating?this._deltaX=this._deltaMouseXOnCanvas*this._mouseXAdjustScale:this._deltaX=-this._deltaMouseXOnCanvas*this._mouseXAdjustScale,this._inverseVerticalRotating?this._deltaY+=this._deltaMouseYOnCanvas*this._mouseYAdjustScale:this._deltaY+=-this._deltaMouseYOnCanvas*this._mouseYAdjustScale,this._deltaY=Math.max(-120,Math.min(50,this._deltaY));const e=u.__tmpRotateMat.rotateY(c.k.degreeToRadian(this._deltaX));e.multiplyVectorTo(this._currentDir,this._currentDir);const t=a.d6.subtractTo(this._currentCenter,this._currentPos,u.__tmp_Vec3_1);e.multiplyVectorTo(t,t),t.x=t.x*(1-n),t.y=n,t.z=t.z*(1-n),t.normalize(),this._currentCenter.copyComponents(this._currentPos),this._currentCenter.add(t),this._clickedMouseXOnCanvas=this._draggedMouseXOnCanvas,this._clickedMouseYOnCanvas=this._draggedMouseYOnCanvas,this._deltaMouseXOnCanvas=0,this._deltaMouseYOnCanvas=0}e.eyeInner=this._currentPos,e.directionInner=this._currentCenter,e.upInner=e._up,e.leftInner=e.left,e.rightInner=e.right,e.topInner=e.top,e.bottomInner=e.bottom,e.fovyInner=e.fovy,this._calcZNearInner(e,this._currentPos,this._newDir),this._calcZFarInner(e)}getDirection(){return null!==this._currentCenter?this._newDir.clone():null}set horizontalSpeed(e){this._horizontalSpeed=e}get horizontalSpeed(){return this._horizontalSpeed}set verticalSpeed(e){this._verticalSpeed=e}get verticalSpeed(){return this._verticalSpeed}set mouseWheelSpeed(e){this._mouseWheelSpeedScale=e}get mouseWheelSpeed(){return this._mouseWheelSpeedScale}setTarget(e){const t=e.tryToGetSceneGraph().worldAABB.lengthCenterToCorner/10;this.verticalSpeed=t,this.horizontalSpeed=t,this.__targetEntity=e,this._needInitialize=!0}getTarget(){return this.__targetEntity}get allInfo(){const e={};return e.verticalSpeed=this.verticalSpeed,e.horizontalSpeed=this.horizontalSpeed,e._turnSpeed=this._turnSpeed,this._currentPos&&(e._currentPos=this._currentPos.clone()),this._currentCenter&&(e._currentCenter=this._currentCenter.clone()),this._currentDir&&(e._currentDir=this._currentDir.clone()),e._deltaY=this._deltaY,e._newDir=this._newDir.clone(),e}set allInfo(e){let t=e;"string"==typeof e&&(t=JSON.parse(e));for(const e in t)t.hasOwnProperty(e)&&e in this&&(this[e]="quaternion"===e?o.D.cloneOfMathObjects(o.D.arrayToQuaternion(t[e])):o.D.cloneOfMathObjects(o.D.arrayToVectorOrMatrix(t[e])))}}u.__tmpInvMat=s.e.identity(),u.__tmpRotateMat=r.x.identity(),u.__tmp_Vec3_0=a.d6.zero(),u.__tmp_Vec3_1=a.d6.zero()},1564:(e,t,n)=>{"use strict";n.d(t,{c:()=>S});var i=n(9721),o=n(2404),a=n(1350),r=n(4710),s=n(3498),l=n(6692),c=n(4507),_=n(6098),h=n(8827),u=n(9207),d=n(2471),m=n(4690),f=n(8107),p=n(6456),v=n(7305),A=n(3991);function y(e,t,n){const i=n;return t.sampler.interpolationMethod===v.k.CubicSpline?4===t.sampler.outputComponentN?i[A.hx](3*t.sampler.outputComponentN*e+t.sampler.outputComponentN):3===t.sampler.outputComponentN?i[A.Up](3*t.sampler.outputComponentN*e+t.sampler.outputComponentN):1===t.sampler.outputComponentN?i[A.w0](3*t.sampler.outputComponentN*e+t.sampler.outputComponentN):i[A.fK](3*t.sampler.outputComponentN*e+t.sampler.outputComponentN,t.sampler.outputComponentN):4===t.sampler.outputComponentN?i[A.JI](e):3===t.sampler.outputComponentN?i[A.Dq](e):1===t.sampler.outputComponentN?i[A.GW](e):i[A.lx](e,t.sampler.outputComponentN)}function g(e,t){let n=0,i=0,o=e.length-1,a=0;for(;i<=o&&t>=e[i]&&t<=e[o];)if(n=Math.floor(i+(t-e[i])*(o-i)/(e[o]-e[i])),e[n].5?0===this.__isEffekseerState&&(null===(e=this.__effekseerComponent)||void 0===e||e.play()):1===this.__isEffekseerState&&(null===(t=this.__effekseerComponent)||void 0===t||t.pause()),this.__isEffekseerState=r[0])}}if(m.Is.exist(this.__secondActiveAnimationTrackName)&&this.__interpolationRatioBtwFirstAndSecond>0){const e=this.__animationTracks.get(this.__secondActiveAnimationTrackName);if(void 0!==e)for(const[t,i]of e){const e=s.s.fromString(t).index,o=x(i,n,e);if(e===s.s.Quaternion.index){const e=u._.fromCopyArray4(o);this.__transformComponent.localRotation=u._.qlerp(this.__transformComponent.localRotationInner,e,this.__interpolationRatioBtwFirstAndSecond)}else if(e===s.s.Translate.index){const e=d.P.fromCopyArray3(o);this.__transformComponent.localPosition=d.P.lerp(this.__transformComponent.localPositionInner,e,this.__interpolationRatioBtwFirstAndSecond)}else if(e===s.s.Scale.index){const e=d.P.fromCopyArray3(o);this.__transformComponent.localScale=d.P.lerp(this.__transformComponent.localScaleInner,e,this.__interpolationRatioBtwFirstAndSecond)}else if(e===s.s.Weights.index){const e=o;for(let t=0;t{const t=new Map;return this.__animationTracks.set(e,t),t}}),l={sampler:{input:n,output:i,outputComponentN:o,interpolationMethod:a},target:{pathName:t,entity:this.entity},belongTrackName:e};s.set(t,l);const c=n[0],h=n[n.length-1],u={name:e,minStartInputTime:c,maxEndInputTime:h};S.__animationGlobalInfo.set(e,u),S.__pubsub.publishAsync(S.Event.ChangeAnimationInfo,{infoMap:new Map(S.__animationGlobalInfo)}),this.entity.getTransform()._backupTransformAsRest()}getStartInputValueOfAnimation(e){const t=null!=e?e:this.__firstActiveAnimationTrackName;if(void 0===t){const e=Array.from(S.__animationGlobalInfo.values());return 0===e.length?0:e[0].maxEndInputTime}return(0,_.kS)({value:S.__animationGlobalInfo.get(t),defaultValue:b}).minStartInputTime}getEndInputValueOfAnimation(e){const t=null!=e?e:this.__firstActiveAnimationTrackName;if(void 0===t){const e=Array.from(S.__animationGlobalInfo.values());return 0===e.length?0:e[0].maxEndInputTime}return(0,_.kS)({value:S.__animationGlobalInfo.get(t),defaultValue:b}).maxEndInputTime}static getAnimationList(){return Array.from(this.__animationGlobalInfo.keys())}static getAnimationInfo(){return new Map(this.__animationGlobalInfo)}getAnimationTrackNames(){return Array.from(this.__animationTracks.keys())}getAnimationChannelsOfTrack(e){return this.__animationTracks.get(e)}get isAnimating(){return this.__isAnimating}static get startInputValue(){if(0===o.C.getComponentsWithType(S).length)return 0;{const e=Array.from(this.__animationGlobalInfo.values());return e[e.length-1].minStartInputTime}}static get endInputValue(){if(0===o.C.getComponentsWithType(S).length)return 0;{const e=Array.from(this.__animationGlobalInfo.values());return e[e.length-1].maxEndInputTime}}static get componentTID(){return r.z.AnimationComponentTID}get componentTID(){return r.z.AnimationComponentTID}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getAnimation(){return this.getComponentByComponentTID(r.z.AnimationComponentTID)}}return(0,a.e)(e,n),e}addKeyFrame(e,t,n,i){const o=n/i,a=o,r=(n+1)/i,l=this.__animationTracks.get(e);if(m.Is.not.exist(l))return!1;const c=l.get(t);if(m.Is.not.exist(c))return!1;ArrayBuffer.isView(c.sampler.input)&&(c.sampler.input=Array.from(c.sampler.input)),ArrayBuffer.isView(c.sampler.output)&&(c.sampler.output=Array.from(c.sampler.output));const _=s.s.fromString(t).index,h=x(c,S.globalTime,_);if(0===c.sampler.input.length)c.sampler.input.push(a),c.sampler.output.push(...h);else if(1===c.sampler.input.length){const e=c.sampler.input[0];r{"use strict";n.d(t,{x:()=>l});var i=n(9721),o=n(2404),a=n(1350),r=n(4710),s=n(4507);class l extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__weights=[],this.__targetNames=[],this.moveStageTo(s.I.Logic)}static get componentTID(){return r.z.BlendShapeComponentTID}get componentTID(){return r.z.BlendShapeComponentTID}set weights(e){this.__weights=e}get weights(){return this.__weights}set targetNames(e){this.__targetNames=e}get targetNames(){return this.__targetNames}setWeightByIndex(e,t){this.__weights[e]=t}$logic(){}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getBlendShape(){return this.getComponentByComponentTID(r.z.BlendShapeComponentTID)}}return(0,a.e)(e,n),e}}o.C.registerComponentClass(l)},224:(e,t,n)=>{"use strict";n.d(t,{M:()=>S});var i=n(2404),o=n(9721),a=n(1350),r=n(4710),s=n(2471),l=n(7192),c=n(9646),_=n(5467),h=n(8491),u=n(752),d=n(3999),m=n(3496),f=n(4507),p=n(4536),v=n(9190),A=n(6477),y=n(3258),g=n(7348),x=n(4587),I=n(3032),b=n(2251),E=n(4690),T=n(5634);class S extends o.w{constructor(e,t,n,i){if(super(e,t,n,i),this._eyeInner=v.d6.dummy(),this._direction=v.d6.dummy(),this._directionInner=v.d6.dummy(),this._up=v.d6.dummy(),this._upInner=v.d6.dummy(),this._filmWidth=36,this._filmHeight=24,this._focalLength=20,this.primitiveMode=!1,this._corner=p.xQ.dummy(),this._cornerInner=p.xQ.dummy(),this._parameters=p.xQ.dummy(),this._parametersInner=p.xQ.dummy(),this.__type=c.i.Perspective,this._projectionMatrix=m.e.dummy(),this.__isProjectionMatrixUpToDate=!1,this._viewMatrix=m.e.dummy(),this.__isViewMatrixUpToDate=!1,this._xrLeft=!1,this._xrRight=!1,this.isSyncToLight=!1,this.__frustum=new A.i,this._setMaxNumberOfComponent(Math.max(10,Math.floor(y.D.maxEntityNumber/100))),this.setFovyAndChangeFocalLength(90),-1===S.current&&(S.current=t),this.registerMember(u.$.CPUGeneric,"eyeInner",v.d6,d.r.Float,[0,0,0]),this.registerMember(u.$.CPUGeneric,"direction",v.d6,d.r.Float,[0,0,-1]),this.registerMember(u.$.CPUGeneric,"up",v.d6,d.r.Float,[0,1,0]),this.registerMember(u.$.CPUGeneric,"directionInner",v.d6,d.r.Float,[0,0,-1]),this.registerMember(u.$.CPUGeneric,"upInner",v.d6,d.r.Float,[0,1,0]),this.registerMember(u.$.CPUGeneric,"corner",p.xQ,d.r.Float,[-1,1,1,-1]),this.registerMember(u.$.CPUGeneric,"cornerInner",p.xQ,d.r.Float,[-1,1,1,-1]),this.registerMember(u.$.CPUGeneric,"parameters",p.xQ,d.r.Float,[.1,1e4,90,1]),this.registerMember(u.$.CPUGeneric,"parametersInner",p.xQ,d.r.Float,[.1,1e4,90,1]),this.registerMember(u.$.CPUGeneric,"projectionMatrix",m.e,d.r.Float,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.registerMember(u.$.CPUGeneric,"viewMatrix",m.e,d.r.Float,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.submitToAllocation(y.D.maxCameraNumber,i),i)return;const o=g.$.getInstance();o.takeOne(x.f5.ViewMatrix),o.takeOne(x.f5.ProjectionMatrix),o.takeOne(x.f5.ViewPosition)}static set current(e){this.__current=e}static get current(){return this.__current}set type(e){this.__type=e,e===c.i.Orthographic?(this._parameters.z=1,this._parameters.w=1,this._parametersInner.z=1,this._parametersInner.w=1):(this.setFovyAndChangeFocalLength(90),this._parameters.w=1,this._parametersInner.z=90,this._parametersInner.w=1)}get type(){return this.__type}get eye(){return S._eye}set eye(e){throw Error("In Rhodonite, eye is always (0,0,0). Use TransformComponent for Camera positioning.")}get eyeInner(){return this._eyeInner}set eyeInner(e){this._eyeInner.copyComponents(e)}set upInner(e){this._upInner.copyComponents(e)}set up(e){this._up.copyComponents(e)}get up(){return this._up.clone()}get upInner(){return this._upInner}set direction(e){const t=this._direction,n=e,i=this._up;let o;if(0===v.d6.crossTo(n,i,S.__tmpVector3_0).length()){const e=v.d6.crossTo(t,i,S.__tmpVector3_1);o=v.d6.crossTo(e,n,S.__tmpVector3_2)}else{const e=v.d6.multiplyTo(n,n.dot(i),S.__tmpVector3_1);o=v.d6.subtractTo(i,e,S.__tmpVector3_2)}this._up.copyComponents(o).normalize(),this._direction.copyComponents(n)}set directionInner(e){this._directionInner.copyComponents(e)}get direction(){return this._direction.clone()}get directionInner(){return this._directionInner}set corner(e){this._corner.copyComponents(e)}get corner(){return this._corner.clone()}set left(e){this._corner.x=e}set leftInner(e){this._cornerInner.x=e}get left(){return this._corner.x}set right(e){this._corner.y=e}set rightInner(e){this._cornerInner.y=e}get right(){return this._corner.y}set top(e){this._corner.z=e}set topInner(e){this._cornerInner.z=e}get top(){return this._corner.z}set bottom(e){this._corner.w=e}set bottomInner(e){this._cornerInner.w=e}get bottom(){return this._corner.w}set cornerInner(e){this._cornerInner.copyComponents(e)}get cornerInner(){return this._cornerInner}set parametersInner(e){this._parametersInner.copyComponents(e)}get parametersInner(){return this._parametersInner}get parameters(){return this._parameters.clone()}set zNear(e){this._parameters.x=e}set zNearInner(e){this._parametersInner.x=e}get zNearInner(){return this._parametersInner.x}get zNear(){return this._parameters.x}set focalLength(e){this._focalLength=e,this._parameters.z=2*I.k.radianToDegree(Math.atan(this._filmHeight/(2*e)))}get focalLength(){return this._focalLength}set zFar(e){this._parameters.y=e}set zFarInner(e){this._parametersInner.y=e}get zFarInner(){return this._parametersInner.y}get zFar(){return this._parameters.y}setFovyAndChangeFilmSize(e){this._parameters.z=e,this._filmHeight=2*this.focalLength*Math.tan(I.k.degreeToRadian(e)/2),this._filmWidth=this._filmHeight*this.aspect}setFovyAndChangeFocalLength(e){this._parameters.z=e,this._focalLength=this._filmHeight/2/Math.tan(I.k.degreeToRadian(e)/2)}get fovy(){return this._parameters.z}set fovyInner(e){this._parametersInner.z=e}set aspect(e){this._parameters.w=e,this._filmWidth=this._filmHeight*e}set aspectInner(e){this._parametersInner.w=e}get aspectInner(){return this._parametersInner.w}get aspect(){return this._parameters.w}set xMag(e){this._parameters.z=e}get xMag(){return this._parameters.z}set yMag(e){this._parameters.w=e}get yMag(){return this._parameters.w}static get componentTID(){return r.z.CameraComponentTID}get componentTID(){return r.z.CameraComponentTID}calcProjectionMatrix(){const e=this._parametersInner.x,t=this._parametersInner.y;if(this.type===c.i.Perspective){const n=this._parametersInner.z,i=this._parametersInner.w,o=1/Math.tan(.5*n*Math.PI/180),a=o/i;this._projectionMatrix.setComponents(a,0,0,0,0,o,0,0,0,0,-(t+e)/(t-e),-2*t*e/(t-e),0,0,-1,0)}else if(this.type===c.i.Orthographic){const n=this._parametersInner.z,i=this._parametersInner.w;this._projectionMatrix.setComponents(1/n,0,0,0,0,1/i,0,0,0,0,-2/(t-e),-(t+e)/(t-e),0,0,0,1)}else{const n=this._cornerInner.x,i=this._cornerInner.y,o=this._cornerInner.z,a=this._cornerInner.w;this._projectionMatrix.setComponents(2*e/(i-n),0,(i+n)/(i-n),0,0,2*e/(o-a),(o+a)/(o-a),0,0,0,-(t+e)/(t-e),-2*t*e/(t-e),0,0,-1,0)}return this._projectionMatrix}calcViewMatrix(){const e=this.eyeInner,t=v.d6.subtractTo(this._directionInner,e,S.__tmpVector3_0).normalize(),n=v.d6.crossTo(t,this._upInner,S.__tmpVector3_1).normalize(),i=v.d6.crossTo(n,t,S.__tmpVector3_2);if(this._viewMatrix.setComponents(n.x,n.y,n.z,-s.P.dot(n,e),i.x,i.y,i.z,-s.P.dot(i,e),-t.x,-t.y,-t.z,s.P.dot(t,e),0,0,0,1),!this.primitiveMode){const e=m.e.invertTo(this.__sceneGraphComponent.matrixInner,S.__tmpMatrix44_0);this._viewMatrix.multiply(e)}return this._viewMatrix}get viewMatrix(){return this._viewMatrix}set viewMatrix(e){this._viewMatrix.copyComponents(e)}get projectionMatrix(){if(this._xrLeft||this._xrRight){const e=b.x.getInstance().getModule("xr");if(null==e?void 0:e.WebXRSystem.getInstance().isWebXRMode){const t=e.WebXRSystem.getInstance();if(this._xrLeft)return t.leftProjectionMatrix;if(this._xrRight)return t.rightProjectionMatrix}}return this._projectionMatrix}set projectionMatrix(e){this._projectionMatrix.copyComponents(e)}get viewProjectionMatrix(){return m.e.multiplyTo(this._projectionMatrix,this._viewMatrix,S.__tmpMatrix44_0)}get biasViewProjectionMatrix(){return m.e.multiplyTo(this._projectionMatrix,this._viewMatrix,S.__tmpMatrix44_0),m.e.multiplyTo(S.__biasMatrix,S.__tmpMatrix44_0,S.__tmpMatrix44_1)}setValuesToGlobalDataRepositoryOnlyMatrices(){S.__globalDataRepository.setValue(x.f5.ViewMatrix,this.componentSID,this.viewMatrix),S.__globalDataRepository.setValue(x.f5.ProjectionMatrix,this.componentSID,this.projectionMatrix)}setValuesToGlobalDataRepository(){S.__globalDataRepository.setValue(x.f5.ViewMatrix,this.componentSID,this.viewMatrix),S.__globalDataRepository.setValue(x.f5.ProjectionMatrix,this.componentSID,this.projectionMatrix),S.__globalDataRepository.setValue(x.f5.ViewPosition,this.componentSID,this.worldPosition)}get worldPosition(){var e;return null===(e=this.__sceneGraphComponent)||void 0===e||e.matrixInner.multiplyVector3To(this.eyeInner,S.returnVector3),S.returnVector3}updateFrustum(){this.__frustum.update(this.viewMatrix,this.projectionMatrix)}get frustum(){return this.__frustum}$create(){this.__sceneGraphComponent=a.g.getComponentOfEntity(this.__entityUid,h.a),this.moveStageTo(f.I.Logic)}$logic({renderPass:e}){const t=this.entity.tryToGetLight();if(this.isSyncToLight&&E.Is.exist(t)){if(this._eyeInner.copyComponents(S._eye),this._directionInner.copyComponents(this._direction),this._upInner.copyComponents(this._up),t.type===T.v.Spot)this.type=c.i.Perspective,this.setFovyAndChangeFilmSize(I.k.radianToDegree(t.outerConeAngle)),this._cornerInner.copyComponents(this._corner),this.aspect=1,this.zNear=.1,this.zFar=-1!==t.range?t.range:1e4,this._parametersInner.copyComponents(this._parameters);else if(t.type===T.v.Directional){this.type=c.i.Orthographic;const e=t.shadowAreaSizeForDirectionalLight;this._cornerInner.copyComponents(l.Lt.fromCopy4(-e,e,e,-e)),this.aspect=1,this.zNear=.1,this.zFar=-1!==t.range?t.range:100,this._parametersInner.copyComponents(this._parameters)}}else{const e=this.entity.tryToGetCameraController();E.Is.exist(e)?this._parametersInner.w=this._parameters.w:this.primitiveMode||(this._eyeInner.copyComponents(S._eye),this._directionInner.copyComponents(this._direction),this._upInner.copyComponents(this._up),this._cornerInner.copyComponents(this._corner),this._parametersInner.copyComponents(this._parameters))}this.calcViewMatrix(),this._xrLeft||this._xrRight||this.calcProjectionMatrix(),this.setValuesToGlobalDataRepository()}static getCurrentCameraEntity(){return i.C.getComponent(this,this.current).entity}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getCamera(){return this.getComponentByComponentTID(r.z.CameraComponentTID)}}return(0,a.e)(e,n),e}}S._eye=s.P.zero(),S.__current=-1,S.returnVector3=v.d6.zero(),S.__globalDataRepository=g.$.getInstance(),S.__tmpVector3_0=v.d6.zero(),S.__tmpVector3_1=v.d6.zero(),S.__tmpVector3_2=v.d6.zero(),S.__tmpMatrix44_0=m.e.zero(),S.__tmpMatrix44_1=m.e.zero(),S.__biasMatrix=_.J.fromCopy16ColumnMajor(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1),i.C.registerComponentClass(S)},5496:(e,t,n)=>{"use strict";n.d(t,{S:()=>u});var i=n(9721),o=n(1350),a=n(224),r=n(4507),s=n(2404),l=n(4710),c=n(6547),_=n(4478),h=n(8914);class u extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__cameraController=new c.j}set type(e){this.__cameraController.unregisterEventListeners(),e===h.M.Orbit?this.__cameraController=new c.j:e===h.M.WalkThrough?this.__cameraController=new _.I:console.warn("Not support type!")}get type(){return this.__cameraController instanceof c.j?h.M.Orbit:h.M.WalkThrough}get controller(){return this.__cameraController}static get componentTID(){return l.z.CameraControllerComponentTID}get componentTID(){return l.z.CameraControllerComponentTID}$create(){this.__cameraComponent=o.g.getComponentOfEntity(this.__entityUid,a.M),this.moveStageTo(r.I.Logic)}$logic(){this.__cameraController&&this.__cameraController.logic(this.__cameraComponent)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getCameraController(){return this.getComponentByComponentTID(l.z.CameraControllerComponentTID)}}return(0,o.e)(e,n),e}}s.C.registerComponentClass(u)},6683:(e,t,n)=>{"use strict";n.d(t,{r:()=>A});var i=n(2404),o=n(9721),a=n(1350),r=n(4710),s=n(5634),l=n(2471),c=n(8491),_=n(4507),h=n(3258),u=n(7348),d=n(4587),m=n(4536),f=n(4255),p=n(6128),v=n(4690);class A extends o.w{constructor(e,t,n,i){super(e,t,n,i),this.type=s.v.Point,this.__intensity=l.P.fromCopyArray([1,1,1]),this.__initialDirection=l.P.fromCopyArray([0,0,-1]),this.__direction=l.P.fromCopyArray([0,0,-1]),this.innerConeAngle=0,this.outerConeAngle=Math.PI/4,this.range=-1,this.enable=!0,this.shadowAreaSizeForDirectionalLight=10,this._setMaxNumberOfComponent(Math.max(10,Math.floor(h.D.maxEntityNumber/100)))}static get componentTID(){return r.z.LightComponentTID}get componentTID(){return r.z.LightComponentTID}get direction(){return this.__direction}set intensity(e){this.__intensity=e}get intensity(){return this.__intensity}get _up(){return l.P.fromCopy3(0,1,0)}set isLightGizmoVisible(e){e?(v.Is.not.defined(this.__lightGizmo)&&(this.__lightGizmo=new p.SU(this.entity),this.__lightGizmo._setup()),this.__lightGizmo.isVisible=!0):v.Is.defined(this.__lightGizmo)&&(this.__lightGizmo.isVisible=!1)}get isLightGizmoVisible(){return!!v.Is.defined(this.__lightGizmo)&&this.__lightGizmo.isVisible}$create(){this.__sceneGraphComponent=a.g.getComponentOfEntity(this.__entityUid,c.a),this.moveStageTo(_.I.Load)}$load(){const e=i.C.getComponentsWithType(A);A.__globalDataRepository.getValue(d.f5.CurrentComponentSIDs,0)._v[r.z.LightComponentTID]=e.length,A.__lightPositions=A.__globalDataRepository.getValue(d.f5.LightPosition,0),A.__lightDirections=A.__globalDataRepository.getValue(d.f5.LightDirection,0),A.__lightIntensities=A.__globalDataRepository.getValue(d.f5.LightIntensity,0),A.__lightProperties=A.__globalDataRepository.getValue(d.f5.LightProperty,0),this.moveStageTo(_.I.Logic)}__updateGizmo(){v.Is.defined(this.__lightGizmo)&&this.__lightGizmo.isSetup&&this.isLightGizmoVisible&&this.__lightGizmo._update()}$logic(){this.__direction=this.__sceneGraphComponent.normalMatrixInner.multiplyVector(this.__initialDirection);const e=1/Math.max(.001,Math.cos(this.innerConeAngle)-Math.cos(this.outerConeAngle)),t=-Math.cos(this.outerConeAngle)*e;A.__lightDirections._v[3*this.componentSID+0]=this.__direction.x,A.__lightDirections._v[3*this.componentSID+1]=this.__direction.y,A.__lightDirections._v[3*this.componentSID+2]=this.__direction.z;const n=this.__sceneGraphComponent.worldPosition;A.__lightPositions._v[3*this.componentSID+0]=n.x,A.__lightPositions._v[3*this.componentSID+1]=n.y,A.__lightPositions._v[3*this.componentSID+2]=n.z,A.__lightIntensities._v[3*this.componentSID+0]=this.__intensity.x,A.__lightIntensities._v[3*this.componentSID+1]=this.__intensity.y,A.__lightIntensities._v[3*this.componentSID+2]=this.__intensity.z,A.__lightProperties._v[4*this.componentSID+0]=this.enable?this.type.index:-1,A.__lightProperties._v[4*this.componentSID+1]=this.range,A.__lightProperties._v[4*this.componentSID+2]=e,A.__lightProperties._v[4*this.componentSID+3]=t,this.__updateGizmo()}_destroy(){super._destroy(),A.__lightIntensities._v[3*this.componentSID+0]=0,A.__lightIntensities._v[3*this.componentSID+1]=0,A.__lightIntensities._v[3*this.componentSID+2]=0}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getLight(){return this.getComponentByComponentTID(r.z.LightComponentTID)}}return(0,a.e)(e,n),e}}A.__globalDataRepository=u.$.getInstance(),A.__tmp_vec4=m.xQ.zero(),A.__lightPositions=new f.j(new Float32Array(0)),A.__lightDirections=new f.j(new Float32Array(0)),A.__lightIntensities=new f.j(new Float32Array(0)),A.__lightProperties=new f.j(new Float32Array(0)),i.C.registerComponentClass(A)},4097:(e,t,n)=>{"use strict";n.d(t,{$:()=>A});var i=n(2404),o=n(9721),a=n(1350),r=n(4710),s=n(4507),l=n(2471),c=n(7192),_=n(8491),h=n(5467),u=n(3496),d=n(8547),m=n(9190),f=n(4690),p=n(6456),v=n(6098);class A extends o.w{constructor(e,t,n,i){super(e,t,n,i),this.__viewDepth=-Number.MAX_VALUE,this.isPickable=!0,this.moveStageTo(s.I.Create)}static get componentTID(){return r.z.MeshComponentTID}get componentTID(){return r.z.MeshComponentTID}setMesh(e){this.__mesh=e,e._belongToMeshComponent(this)}unsetMesh(){return null!=this.__mesh&&(this.__mesh=void 0,!0)}get mesh(){return this.__mesh}calcViewDepth(e){if(f.Is.not.exist(this.__mesh))return Number.MAX_VALUE;const t=this.__mesh.AABB.centerPoint,n=this.entity.tryToGetSkeletal();f.Is.exist(n)&&f.Is.exist(n._bindShapeMatrix)&&n._bindShapeMatrix.multiplyVector3To(this.__mesh.AABB.centerPoint,t);const i=this.entity.getSceneGraph().matrixInner.multiplyVector3To(t,A.__tmpVector3_0),o=e.viewMatrix.multiplyVector3To(i,A.__tmpVector3_1);return this.__viewDepth=o.z,this.__viewDepth}get viewDepth(){return this.__viewDepth}static alertNoMeshSet(e){console.debug("No mesh is set on this MeshComponent:"+e.componentSID)}castRay(e,t,n=0){if(this.__mesh){let i=e,o=t;if(this.__sceneGraphComponent){const a=h.J.invert(this.__sceneGraphComponent.matrixInner);i=l.P.fromCopyVector4(a.multiplyVector(c.Lt.fromCopyVector3(e)));const r=l.P.add(e,t),s=l.P.fromCopyVector4(a.multiplyVector(c.Lt.fromCopyVector3(r)));o=l.P.normalize(l.P.subtract(s,i));const _=this.__mesh.castRay(i,o,n);let u=null;if(f.Is.defined(_.data)&&_.data.t>=0)return u=l.P.fromCopyVector4(this.__sceneGraphComponent.matrixInner.multiplyVector(c.Lt.fromCopyVector3(_.data.position))),{result:!0,data:{t:_.data.t,u:_.data.u,v:_.data.v,position:u}}}}return{result:!1}}castRayFromScreenInLocal(e,t,n,i,o=0){if(this.__mesh&&this.__sceneGraphComponent){const a=u.e.multiplyTo(n.projectionMatrix,n.viewMatrix,A.__tmpMatrix44_0).multiply(this.__sceneGraphComponent.matrixInner).invert(),r=d.D.unProjectTo(e,t,0,a,i,A.__tmpVector3_0),s=d.D.unProjectTo(e,t,1,a,i,A.__tmpVector3_1),l=m.d6.subtractTo(s,r,A.__tmpVector3_2).normalize(),c=this.__mesh.castRay(r,l,o);if(f.Is.defined(c.data)&&c.data.t>=0)return{result:!0,data:{t:c.data.t,u:c.data.u,v:c.data.v,position:c.data.position}}}return{result:!1}}castRayFromScreenInWorld(e,t,n,i,o=0){const a=this.castRayFromScreenInLocal(e,t,n,i,o);if(this.__mesh&&this.__sceneGraphComponent&&a.result){(0,v.dK)(a.data);const e=this.__sceneGraphComponent.matrixInner.multiplyVector3To(a.data.position,A.__returnVector3);return{result:!0,data:{t:a.data.t,u:a.data.u,v:a.data.v,position:e}}}return a}$create(){this.__blendShapeComponent=a.g.getComponentOfEntity(this.__entityUid,p.x),this.__sceneGraphComponent=a.g.getComponentOfEntity(this.__entityUid,_.a),this.moveStageTo(s.I.Load)}static common_$load({processApproach:e}){const t=i.C.getComponentsWithType(A);for(const e of t){const t=e.mesh;if(!f.Is.exist(t))continue;const n=t.getPrimitiveNumber();for(let i=0;i0&&this.__mesh._calcBaryCentricCoord(),this.moveStageTo(s.I.Logic))}$logic(){}_shallowCopyFrom(e){const t=e;this.__viewDepth=t.__viewDepth,f.Is.exist(t.__mesh)&&this.setMesh(t.__mesh),this.isPickable=t.isPickable}_destroy(){this.__mesh&&(this.__mesh=void 0)}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getMesh(){return this.getComponentByComponentTID(r.z.MeshComponentTID)}}return(0,a.e)(e,n),e}}A.__tmpVector3_0=m.d6.zero(),A.__tmpVector3_1=m.d6.zero(),A.__tmpVector3_2=m.d6.zero(),A.__returnVector3=m.d6.zero(),A.__tmpMatrix44_0=u.e.zero(),A.__latestPrimitivePositionAccessorVersion=0,i.C.registerComponentClass(A)},9974:(e,t,n)=>{"use strict";n.d(t,{Y:()=>d});var i=n(2404),o=n(9721),a=n(4097),r=n(4507),s=n(1350),l=n(4710),c=n(224),_=n(2251),h=n(4339),u=n(4327);class d extends o.w{constructor(e,t,n,i){super(e,t,n,i),this.diffuseCubeMapContribution=1,this.specularCubeMapContribution=1,this.rotationOfCubeMap=0,this._readyForRendering=!1}static get componentTID(){return l.z.MeshRendererComponentTID}get componentTID(){return l.z.MeshRendererComponentTID}$create(){this.__meshComponent=s.g.getComponentOfEntity(this.__entityUid,a.$),this.moveStageTo(r.I.Load)}static common_$load({processApproach:e}){const t=_.x.getInstance().getModule("webgl");d.__webglRenderingStrategy=t.getRenderingStrategy(e)}$load(){d.__webglRenderingStrategy.$load(this.__meshComponent),this.diffuseCubeMap&&!this.diffuseCubeMap.startedToLoad&&this.diffuseCubeMap.loadTextureImagesAsync(),this.specularCubeMap&&!this.specularCubeMap.startedToLoad&&this.specularCubeMap.loadTextureImagesAsync()}static common_$prerender(){d.__webglRenderingStrategy.common_$prerender()}static sort_$render(e){return d.sort_$render_inner(e)}static sort_$render_inner(e){let t=e.cameraComponent;null==t&&(t=i.C.getComponent(c.M,c.M.current));let n=[];const o=e.meshComponents;n=d.__cullingWithViewFrustum(t,o,e),n=Array.from(new Set(n)),n.sort(((e,t)=>{const n=e._sortkey-t._sortkey;return 0===n?e._viewDepth-t._viewDepth:n}));const a=n.map((e=>e.primitiveUid));a.push(-1),d._lastOpaqueIndex=n.length-1,d._lastTransparentIndex=-1,d._firstTransparentSortKey=-1,d._lastTransparentSortKey=-1;for(let e=0;e>i&1){d._lastOpaqueIndex=e-1,d._firstTransparentSortKey=t._sortkey;break}}return n.length>0&&(d._lastTransparentIndex=n.length-1,d._lastTransparentSortKey=n[n.length-1]._sortkey),a}static __cullingWithViewFrustum(e,t,n){let i=[];if(e&&d.isViewFrustumCullingEnabled){e.updateFrustum();const n=e.frustum,o=(e,t)=>{if("background-assets"===e.entity.getTagValue("type")||n.culling(e)){t.push(e),e.entity.getSceneGraph()._isCulled=!1;const n=e.entity.tryToGetSkeletal();void 0!==n&&(n._isCulled=!1)}else{e.entity.getSceneGraph()._isCulled=!0;const t=e.entity.tryToGetSkeletal();void 0!==t&&(t._isCulled=!0)}};for(const e of t)o(e,i)}else i=n.meshComponents;const o=[];for(let t=0;t{"use strict";n.d(t,{Z:()=>c});var i=n(9721),o=n(2404),a=n(1350),r=n(4710),s=n(4507),l=n(5800);class c extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__strategy=new l.t,this.moveStageTo(s.I.Logic)}static get componentTID(){return r.z.PhysicsComponentTID}get componentTID(){return r.z.PhysicsComponentTID}get strategy(){return this.__strategy}static common_$logic(){}$logic(){this.__strategy.update()}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getPhysics(){return this.getComponentByComponentTID(r.z.PhysicsComponentTID)}}return(0,a.e)(e,n),e}}o.C.registerComponentClass(c)},8491:(e,t,n)=>{"use strict";n.d(t,{a:()=>I});var i=n(2404),o=n(9721),a=n(5467),r=n(1350),s=n(3999),l=n(4710),c=n(752),_=n(4507),h=n(3496),u=n(2566),d=n(2471),m=n(2477),f=n(9190),p=n(817),v=n(7326),A=n(4690),y=n(9244),g=n(7859),x=n(4020);class I extends o.w{constructor(e,t,n,i){super(e,t,n,i),this.__children=[],this.__gizmoChildren=[],this._worldMatrix=h.e.dummy(),this._worldMatrixRest=h.e.dummy(),this._normalMatrix=u.x.dummy(),this.__isWorldMatrixUpToDate=!1,this.__isWorldMatrixRestUpToDate=!1,this.__isNormalMatrixUpToDate=!1,this.__tmpMatrix=h.e.identity(),this.__worldAABB=new m.m,this.__isWorldAABBDirty=!0,this._isVisible=x.DU.dummy(),this._isBillboard=x.DU.dummy(),this.__transformGizmoSpace="world",this.__latestPrimitivePositionAccessorVersion=0,this.toMakeWorldMatrixTheSameAsLocalMatrix=!1,this.isRootJoint=!1,this.jointIndex=-1,this._isCulled=!1,I.__sceneGraphs.push(this),this.registerMember(c.$.GPUInstanceData,"worldMatrix",h.e,s.r.Float,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.registerMember(c.$.GPUInstanceData,"normalMatrix",u.x,s.r.Float,[1,0,0,0,1,0,0,0,1]),this.registerMember(c.$.GPUInstanceData,"isVisible",x.DU,s.r.Float,[1]),this.registerMember(c.$.GPUInstanceData,"isBillboard",x.DU,s.r.Float,[0]),this.submitToAllocation(this.maxNumberOfComponent,i)}set isVisible(e){this._isVisible.setValue(e?1:0)}get isVisible(){return 1===this._isVisible.getValue()}setVisibilityRecursively(e){this.isVisible=e;for(const t of this.__children)t.setVisibilityRecursively(e)}set isBillboard(e){this._isBillboard.setValue(e?1:0)}get isBillboard(){return 1===this._isBillboard.getValue()}setIsBillboardRecursively(e){this._isBillboard.setValue(e?1:0);for(const t of this.__children)t.isBillboard=e}set isAABBGizmoVisible(e){e?(A.Is.not.defined(this.__aabbGizmo)&&(this.__aabbGizmo=new p.q(this.entity),this.__aabbGizmo._setup()),this.__aabbGizmo.isVisible=!0):A.Is.exist(this.__aabbGizmo)&&(this.__aabbGizmo.isVisible=!1)}get isAABBGizmoVisible(){return!!A.Is.exist(this.__aabbGizmo)&&this.__aabbGizmo.isVisible}set isLocatorGizmoVisible(e){e?(A.Is.not.defined(this.__locatorGizmo)&&(this.__locatorGizmo=new v.k(this.entity),this.__locatorGizmo._setup()),this.__locatorGizmo.isVisible=!0):A.Is.exist(this.__locatorGizmo)&&(this.__locatorGizmo.isVisible=!1)}get isLocatorGizmoVisible(){return!!A.Is.exist(this.__locatorGizmo)&&this.__locatorGizmo.isVisible}set isTranslationGizmoVisible(e){e?(A.Is.not.defined(this.__translationGizmo)&&(this.__translationGizmo=new y.u(this.entity),this.__translationGizmo._setup()),this.__translationGizmo.isVisible=!0):A.Is.exist(this.__translationGizmo)&&(this.__translationGizmo.isVisible=!1)}get isTranslationGizmoVisible(){return!!A.Is.exist(this.__translationGizmo)&&this.__translationGizmo.isVisible}set isScaleGizmoVisible(e){e?(A.Is.not.defined(this.__scaleGizmo)&&(this.__scaleGizmo=new g.q(this.entity),this.__scaleGizmo._setup()),this.__scaleGizmo.isVisible=!0):A.Is.exist(this.__scaleGizmo)&&(this.__scaleGizmo.isVisible=!1)}get isScaleGizmoVisible(){return!!A.Is.exist(this.__scaleGizmo)&&this.__scaleGizmo.isVisible}static getTopLevelComponents(){return I.__sceneGraphs.filter((e=>e.isTopLevel))}isJoint(){return this.jointIndex>=0}static get componentTID(){return l.z.SceneGraphComponentTID}get componentTID(){return l.z.SceneGraphComponentTID}setWorldMatrixRestDirty(){this.matrixRestInner,this.setWorldMatrixRestDirtyRecursively()}setWorldMatrixRestDirtyRecursively(){this.__isWorldMatrixRestUpToDate=!1,this.children.forEach((e=>{e.setWorldMatrixRestDirtyRecursively()}))}setWorldMatrixDirty(){var e;this.setWorldMatrixDirtyRecursively(),null===(e=this.parent)||void 0===e||e.setWorldAABBDirtyParentRecursively()}setWorldMatrixDirtyRecursively(){this.__isWorldMatrixUpToDate=!1,this.__isNormalMatrixUpToDate=!1,this.__isWorldAABBDirty=!0,this.children.forEach((e=>{e.setWorldMatrixDirtyRecursively()}))}setWorldAABBDirtyParentRecursively(){var e;this.__isWorldAABBDirty=!0,null===(e=this.parent)||void 0===e||e.setWorldAABBDirtyParentRecursively()}addChild(e){A.Is.exist(e.__parent)&&e.__parent.removeChild(e),e.__parent=this,this.__children.push(e)}removeChild(e){const t=this.__children.indexOf(e);t>=0&&this.__children.splice(t,1),e.__parent=void 0}_addGizmoChild(e){e.__parent=this,this.__gizmoChildren.push(e)}get isTopLevel(){return null==this.__parent}get children(){return this.__children}get parent(){return this.__parent}get matrixInner(){return this.__isWorldMatrixUpToDate||(this._worldMatrix.copyComponents(this.__calcWorldMatrixRecursively()),this.__isWorldMatrixUpToDate=!0),this._worldMatrix}get matrix(){return this.matrixInner.clone()}get matrixRestInner(){return this.__isWorldMatrixRestUpToDate||(this._worldMatrixRest.copyComponents(this.__calcWorldMatrixRestRecursively()),this.__isWorldMatrixRestUpToDate=!0),this._worldMatrix}get matrixRest(){return this.matrixRestInner.clone()}get normalMatrixInner(){return this.__isNormalMatrixUpToDate||(a.J.invertTo(this.matrixInner,I.invertedMatrix44),this._normalMatrix.copyComponents(I.invertedMatrix44.transpose()),this.__isNormalMatrixUpToDate=!0),this._normalMatrix}get entityWorldMatrix(){return this.entityWorldMatrixInner.clone()}get entityWorldMatrixInner(){const e=this.entity.tryToGetSkeletal();return A.Is.exist(e)&&e.isWorldMatrixUpdated?e.worldMatrixInner:this.entity.getSceneGraph().matrixInner}get normalMatrix(){return this.normalMatrixInner.clone()}isWorldMatrixUpToDateRecursively(){return!!this.__isWorldMatrixUpToDate&&(!this.__parent||this.__parent.isWorldMatrixUpToDateRecursively())}__calcWorldMatrixRecursively(){if(this.__isWorldMatrixUpToDate)return this._worldMatrix;const e=r.g.getEntity(this.__entityUid).getTransform();if(null==this.__parent||this.toMakeWorldMatrixTheSameAsLocalMatrix)return e.localMatrixInner;const t=this.__parent.__calcWorldMatrixRecursively();return h.e.multiplyTo(t,e.localMatrixInner,this.__tmpMatrix)}__calcWorldMatrixRestRecursively(){if(this.__isWorldMatrixRestUpToDate)return this._worldMatrixRest;const e=r.g.getEntity(this.__entityUid).getTransform();if(null==this.__parent||this.toMakeWorldMatrixTheSameAsLocalMatrix)return e.localMatrixRestInner;const t=this.__parent.__calcWorldMatrixRestRecursively();return h.e.multiplyTo(t,e.localMatrixRestInner,this.__tmpMatrix)}getQuaternionRecursively(){if(A.Is.not.exist(this.parent))return this.entity.getTransform().localRotation;const e=this.parent.getQuaternionRecursively();return x._f.multiply(e,this.entity.getTransform().localRotation)}static flattenHierarchy(e,t){const n=[];t&&!e.isJoint()||n.push(e);const i=e.children;for(let e=0;e{var t;return null===(t=e.parent)||void 0===t?void 0:t.removeChild(e)}))}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getSceneGraph(){return void 0===this.__sceneGraphComponent&&(this.__sceneGraphComponent=this.getComponentByComponentTID(l.z.SceneGraphComponentTID)),this.__sceneGraphComponent}get parent(){return this.getSceneGraph().parent}get matrix(){return this.getSceneGraph().matrix}get matrixInner(){return this.getSceneGraph().matrixInner}get position(){return this.getSceneGraph().position}set position(e){this.getSceneGraph().position=e}get positionRest(){return this.getSceneGraph().positionRest}get scale(){return this.getSceneGraph().scale}set scale(e){this.getSceneGraph().scale=e}get eulerAngles(){return this.getSceneGraph().eulerAngles}set eulerAngles(e){this.getSceneGraph().eulerAngles=e}get rotation(){return this.getSceneGraph().rotation}set rotation(e){this.getSceneGraph().rotation=e}get rotationRest(){return this.getSceneGraph().rotationRest}addChild(e){this.getSceneGraph().addChild(e)}get children(){return this.getSceneGraph().children}removeChild(e){this.getSceneGraph().removeChild(e)}}return(0,r.e)(e,n),e}}I.__originVector3=d.P.zero(),I.returnVector3=f.d6.zero(),I.__sceneGraphs=[],I.isJointAABBShouldBeCalculated=!1,I.invertedMatrix44=h.e.fromCopyArray16ColumnMajor([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),I.__tmpAABB=new m.m,i.C.registerComponentClass(I)},5684:(e,t,n)=>{"use strict";n.d(t,{G:()=>a});var i=n(4020),o=n(4690);class a{constructor(e){this.__srcEntity=e}getSrcPGRestQ(e){let t;const n=e.getSceneGraph().parent;return t=o.Is.exist(n)?n.getRotationRest((e=>{const t=e.parent;if(o.Is.exist(t)){const e=t.entity.tryToGetVrm();return o.Is.exist(e)}return!0})):i._f.identity(),t}getDstPGRestQ(e){let t;const n=e.getSceneGraph().parent;return t=o.Is.exist(n)?n.getRotationRest((e=>{const t=e.parent;if(o.Is.exist(t)){const e=t.entity.tryToGetVrm();return o.Is.exist(e)}return!0})):i._f.identity(),t}retargetQuaternion(e){const t=this.__srcEntity,n=t.getTransform().localRotationInner,o=t.getTransform().localRotationRestInner,r=this.getSrcPGRestQ(t),s=i._f.multiply(r,i._f.multiply(n,i._f.multiply(i._f.invert(o),i._f.invert(r)))),l=e.getTransform().localRotationRestInner,c=this.getDstPGRestQ(e),_=i._f.multiply(i._f.invert(c),i._f.multiply(s,i._f.multiply(c,l)));return i._f.multiply(i._f.multiply(a.__rev,_),i._f.invert(a.__rev))}retargetTranslate(e){const t=this.__srcEntity,n=t.getTransform().localPositionInner,o=t.getTransform().localPositionRestInner,r=this.getSrcPGRestQ(t),s=i.P.subtract(n,o),l=r.transformVector3(s),c=e.getTransform().localPositionRestInner,_=this.getDstPGRestQ(e),h=i.P.add(_.transformVector3Inverse(l),c);if(t.uniqueName.indexOf("hips")>=0){const e=i.P.multiply(h,t.parent.scale.x);return a.__rev.transformVector3(e)}return h}retargetScale(e){return this.__srcEntity.getTransform().localScaleInner}}a.__rev=i._f.fromAxisAngle(i.P.fromCopy3(0,1,0),Math.PI)},1656:(e,t,n)=>{"use strict";n.d(t,{Y:()=>y});var i=n(2404),o=n(9721),a=n(1350),r=n(4710),s=n(5467),l=n(4507),c=n(9190),_=n(963),h=n(3032),u=n(4536),d=n(3496),m=n(4587),f=n(7348),p=n(3258),v=n(1226),A=n(2253);class y extends o.w{constructor(e,t,n,i){super(e,t,n,i),this._jointIndices=[],this.__joints=[],this.isSkinning=!0,this.__qArray=new Float32Array(0),this.__tsArray=new Float32Array(0),this.__tqArray=new Float32Array(0),this.__sqArray=new Float32Array(0),this.__qtsArray=new Float32Array(0),this.__qtsInfo=u.xQ.dummy(),this.__matArray=new Float32Array(0),this.__worldMatrix=d.e.identity(),this.__isWorldMatrixVanilla=!0,this._isCulled=!1,this.moveStageTo(l.I.Logic),i||(y.__tookGlobalDataNumMath.abs(t.y)?Math.abs(t.x)>Math.abs(t.z)?t.x:t.z:Math.abs(t.y)>Math.abs(t.z)?t.y:t.z,this.__tsArray[4*e+3]=n}if(p.D.boneDataType===v.N.Vec4x2){const o=h.k.packNormalizedVec4ToVec2(i.x,i.y,i.z,i.w,Math.pow(2,12));this.__tqArray[4*e+0]=n.m03,this.__tqArray[4*e+1]=n.m13,this.__tqArray[4*e+2]=n.m23,this.__sqArray[4*e+0]=t.x,this.__sqArray[4*e+1]=t.y,this.__sqArray[4*e+2]=t.z,this.__tqArray[4*e+3]=o[0],this.__sqArray[4*e+3]=o[1]}else p.D.boneDataType===v.N.Vec4x2Old&&(this.__tsArray[4*e+0]=n.m03,this.__tsArray[4*e+1]=n.m13,this.__tsArray[4*e+2]=n.m23,this.__qArray[4*e+0]=i.x,this.__qArray[4*e+1]=i.y,this.__qArray[4*e+2]=i.z,this.__qArray[4*e+3]=i.w);if(p.D.boneDataType===v.N.Vec4x1){this.__tsArray[4*e+0]=n.m03,this.__tsArray[4*e+1]=n.m13,this.__tsArray[4*e+2]=n.m23;const t=h.k.packNormalizedVec4ToVec2(i.x,i.y,i.z,i.w,Math.pow(2,12));this.__qtsArray[4*e+0]=t[0],this.__qtsArray[4*e+1]=t[1]}}}if(p.D.boneDataType===v.N.Vec4x1){let e=1,t=1,n=1;for(let i=0;ie&&(e=o);const a=Math.abs(this.__tsArray[4*i+1]);a>t&&(t=a);const r=Math.abs(this.__tsArray[4*i+2]);r>n&&(n=r)}this.__qtsInfo.x=e,this.__qtsInfo.y=t,this.__qtsInfo.z=n,this.__qtsInfo.w=1;for(let i=0;i{"use strict";n.d(t,{U:()=>h});var i=n(9721),o=n(2404),a=n(1350),r=n(4710),s=n(4507),l=n(9190),c=n(4020),_=n(2253);class h extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__pose=new c.WQ,this.__updateCountAtLastLogic=0,this.moveStageTo(s.I.Create)}$create(){this.__sceneGraphComponent=this.entity.tryToGetSceneGraph(),this.moveStageTo(s.I.Logic)}static get renderedPropertyCount(){return null}static get componentTID(){return r.z.TransformComponentTID}get componentTID(){return r.z.TransformComponentTID}get restOrPose(){return void 0!==this.__rest?this.__rest:this.__pose}_backupTransformAsRest(){void 0===this.__rest&&(this.__rest=this.__pose.clone(),this.entity.tryToGetSceneGraph().setWorldMatrixRestDirty())}_restoreTransformFromRest(){void 0!==this.__rest&&this.__pose.setTransform(this.__rest.positionInner,l.d6.fromCopyVector3(this.__rest.eulerAnglesInner),this.__rest.scaleInner,c.yG.fromCopyQuaternion(this.__rest.rotationInner),this.__rest.matrixInner)}get localTransform(){return this.__pose}set localTransform(e){this.__pose.setTransform(e.positionInner,l.d6.fromCopyVector3(e.eulerAnglesInner),e.scaleInner,c.yG.fromCopyQuaternion(e.rotationInner),e.matrixInner)}get localTransformRest(){return this.restOrPose}set localTransformRest(e){_.Is.undefined(this.__rest)&&(this.__rest=new c.WQ),this.__rest.setTransform(e.positionInner,l.d6.fromCopyVector3(e.eulerAnglesInner),e.scaleInner,c.yG.fromCopyQuaternion(e.rotationInner),e.matrixInner)}set localPosition(e){this.__pose.position=e}get localPosition(){return this.__pose.position}get localPositionInner(){return this.__pose.positionInner}set localPositionRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.position=e}get localPositionRest(){return this.restOrPose.position}get localPositionRestInner(){return this.restOrPose.positionInner}set localEulerAngles(e){this.__pose.eulerAngles=e}get localEulerAngles(){return this.__pose.eulerAngles}get localEulerAnglesInner(){return this.__pose.eulerAnglesInner}set localEulerAnglesRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.eulerAngles=e}get localEulerAnglesRest(){return this.restOrPose.eulerAngles}get localEulerAnglesRestInner(){return this.restOrPose.eulerAnglesInner}set localScale(e){this.__pose.scale=e}get localScale(){return this.__pose.scale}get localScaleInner(){return this.__pose.scaleInner}set localScaleRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.scale=e}get localScaleRest(){return this.restOrPose.scale}get localScaleRestInner(){return this.restOrPose.scaleInner}set localRotation(e){this.__pose.rotation=e}get localRotation(){return this.__pose.rotation}get localRotationInner(){return this.__pose.rotationInner}set localRotationRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.rotation=e}get localRotationRest(){return this.restOrPose.rotation}get localRotationRestInner(){return this.restOrPose.rotationInner}set localMatrix(e){this.__pose.matrix=e}get localMatrix(){return this.__pose.matrix}get localMatrixInner(){return this.__pose.matrixInner}set localMatrixRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.matrix=e}get localMatrixRest(){return this.restOrPose.matrix}get localMatrixRestInner(){return this.restOrPose.matrixInner}$logic(){this.__updateCountAtLastLogic!==this.__pose.updateCount&&(this.__sceneGraphComponent.setWorldMatrixDirty(),this.__updateCountAtLastLogic=this.__pose.updateCount)}_shallowCopyFrom(e){const t=e;this.__pose=t.__pose.clone(),null!=t.__rest&&(this.__rest=t.__rest.clone()),this.__updateCountAtLastLogic=t.__updateCountAtLastLogic}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getTransform(){return void 0===this.__transformComponent&&(this.__transformComponent=this.getComponentByComponentTID(r.z.TransformComponentTID)),this.__transformComponent}set localPosition(e){this.getTransform().localPosition=e}get localPosition(){return this.localPositionInner.clone()}get localPositionInner(){return this.getTransform().localPositionInner}set localPositionRest(e){this.getTransform().localPositionRest=e}get localPositionRest(){return this.getTransform().localPositionRest}get localPositionRestInner(){return this.getTransform().localPositionRestInner}set localScale(e){this.getTransform().localScale=e}get localScale(){return this.localScaleInner.clone()}get localScaleInner(){return this.getTransform().localScaleInner}set localScaleRest(e){this.getTransform().localScaleRest=e}get localScaleRest(){return this.getTransform().localScaleRest}get localScaleRestInner(){return this.getTransform().localScaleRestInner}set localEulerAngles(e){this.getTransform().localEulerAngles=e}get localEulerAngles(){return this.localEulerAnglesInner.clone()}get localEulerAnglesInner(){return this.getTransform().localEulerAnglesInner}set localEulerAnglesRest(e){this.getTransform().localEulerAnglesRest=e}get localEulerAnglesRest(){return this.localEulerAnglesRestInner.clone()}get localEulerAnglesRestInner(){return this.getTransform().localEulerAnglesRestInner}set localRotation(e){this.getTransform().localRotation=e}get localRotation(){return this.localRotationInner.clone()}get localRotationInner(){return this.getTransform().localRotationInner}set localRotationRest(e){this.getTransform().localRotationRest=e}get localRotationRest(){return this.localQuaternionRestInner.clone()}get localRotationRestInner(){return this.getTransform().localRotationRestInner}set localMatrix(e){this.getTransform().localMatrix=e}get localMatrix(){return this.localMatrixInner.clone()}get localMatrixInner(){return this.getTransform().localMatrixInner}set localMatrixRest(e){this.getTransform().localMatrixRest=e}get localMatrixRest(){return this.localMatrixRestInner.clone()}get localMatrixRestInner(){return this.getTransform().localMatrixRestInner}}return(0,a.e)(e,n),e}}o.C.registerComponentClass(h)},605:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(9721),o=n(2404),a=n(1350),r=n(4507),s=n(2253),l=n(4710);class c extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__expressions=new Map,this.__weights=new Map,this._version="",this.moveStageTo(r.I.Logic)}static get componentTID(){return l.z.VrmComponentTID}get componentTID(){return l.z.VrmComponentTID}setVrmExpressions(e){for(const t of e)this.__expressions.set(t.name,t),this.__weights.set(t.name,0)}setExpressionWeight(e,t){const n=this.__expressions.get(e);if(!s.Is.not.exist(n)){this.__weights.set(e,t);for(const e of n.binds){const n=a.g.getEntity(e.entityIdx).tryToGetBlendShape();s.Is.exist(n)&&n.setWeightByIndex(e.blendShapeIdx,t)}}}getExpressionWeight(e){return this.__weights.get(e)}getExpressionNames(){return Array.from(this.__expressions.keys())}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getVrm(){return void 0===this.__vrmComponent&&(this.__vrmComponent=this.getComponentByComponentTID(l.z.VrmComponentTID)),this.__vrmComponent}}return(0,a.e)(e,n),e}}o.C.registerComponentClass(c)},4710:(e,t,n)=>{"use strict";n.d(t,{z:()=>i});const i=Object.freeze({AnimationComponentTID:1,TransformComponentTID:2,SceneGraphComponentTID:3,MeshComponentTID:4,MeshRendererComponentTID:5,LightComponentTID:6,CameraControllerComponentTID:7,CameraComponentTID:8,SkeletalComponentTID:9,BlendShapeComponentTID:10,PhysicsComponentTID:11,EffekseerComponentTID:12,VrmComponentTID:13,ConstraintComponentTID:14,maxWellKnownTidNumber:14})},1409:(e,t,n)=>{"use strict";n.d(t,{l:()=>v,cw:()=>i.c,xT:()=>a.x,My:()=>r.M,SP:()=>s.S,B5:()=>f,GZ:()=>p.G,r0:()=>l.r,$t:()=>c.$,YZ:()=>_.Y,Ze:()=>h.Z,aj:()=>u.a,Yb:()=>A.Y,Uv:()=>y.U,ZA:()=>g.Z,zz:()=>x.z,vA:()=>o});var i=n(1564);const o="Default";var a=n(6456),r=n(224),s=n(5496),l=n(6683),c=n(4097),_=n(9974),h=n(3826),u=n(8491),d=n(4020),m=n(4690);class f{constructor(e){this.__srcEntity=e}getSrcPGRestQ(e){let t;const n=e.getSceneGraph().parent;return t=m.Is.exist(n)?n.getRotationRest((e=>{const t=e.parent;if(m.Is.exist(t)){const e=t.entity.tryToGetVrm();return m.Is.exist(e)}return!0})):d._f.identity(),t}getDstPGRestQ(e){let t;const n=e.getSceneGraph().parent;return t=m.Is.exist(n)?n.getRotationRest((e=>{const t=e.parent;if(m.Is.exist(t)){const e=t.entity.tryToGetVrm();return m.Is.exist(e)}return!0})):d._f.identity(),t}retargetQuaternion(e){const t=this.__srcEntity,n=t.getTransform().localRotationInner,i=t.getTransform().localRotationRestInner,o=this.getSrcPGRestQ(t),a=d._f.multiply(o,d._f.multiply(n,d._f.multiply(d._f.invert(i),d._f.invert(o)))),r=e.getTransform().localRotationRestInner,s=this.getDstPGRestQ(e);return d._f.multiply(d._f.invert(s),d._f.multiply(a,d._f.multiply(s,r)))}retargetTranslate(e){const t=this.__srcEntity,n=t.getTransform().localPositionInner,i=t.getTransform().localPositionRestInner,o=this.getSrcPGRestQ(t),a=d.P.subtract(n,i),r=o.transformVector3(a),s=e.getTransform().localPositionRestInner,l=this.getDstPGRestQ(e),c=d.P.add(l.transformVector3Inverse(r),s);return t.uniqueName.indexOf("hips")>=0?d.P.multiply(c,t.parent.scale.x):c}retargetScale(e){return this.__srcEntity.getTransform().localScaleInner}}var p=n(5684);class v{constructor(e){this.__srcEntity=e}retargetQuaternion(e){return this.__srcEntity.getTransform().localRotationInner}retargetTranslate(e){return this.__srcEntity.getTransform().localPositionInner}retargetScale(e){return this.__srcEntity.getTransform().localScaleInner}}var A=n(1656),y=n(6692),g=n(605),x=n(4710)},9721:(e,t,n)=>{"use strict";n.d(t,{w:()=>c});var i=n(9286),o=n(1350),a=n(4507),r=n(2404),s=n(3258),l=n(9002);class c extends l.S{constructor(e,t,n,o){super(),this._isAlive=!0,this.__currentProcessStage=a.I.Create,this.__byteOffsetOfThisComponent=-1,this.__maxComponentNumber=s.D.maxEntityNumber,this.__entityUid=e,this._component_sid=t,c._processStages.forEach((e=>{this.isExistProcessStageMethod(e)&&null==c.__componentsOfProcessStages.get(e)&&(c.__componentsOfProcessStages.set(e,new Int32Array(s.D.maxEntityNumber)),c.__lengthOfArrayOfProcessStages.set(e,0))})),this.__memoryManager=i.B.getInstance(),this.__entityRepository=n}moveStageTo(e){this.__currentProcessStage=e}_setMaxNumberOfComponent(e){this.__maxComponentNumber=e}get maxNumberOfComponent(){return this.__maxComponentNumber}static get componentTID(){return 0}get componentTID(){return 0}get componentSID(){return this._component_sid}get entityUID(){return this.__entityUid}get currentProcessStage(){return this.__currentProcessStage}static doesTheProcessStageMethodExist(e,t){return null!=e.prototype[t.methodName]}isExistProcessStageMethod(e){return null!=this[e.methodName]}static process({componentType:e,processStage:t,processApproach:n,strategy:i,renderPass:o,renderPassTickCount:a}){if(!c.doesTheProcessStageMethodExist(e,t))return;const s=t.methodName,l=this.__componentsOfProcessStages.get(t),_=r.C._getComponentsIncludingDead(e);for(let e=0;e{o.set(e.bufferUse,[])})),i.forEach((e=>{o.get(e.bufferUse).push(e)}));for(const e of o.keys()){const t=o.get(e);c.__byteLengthSumOfMembers.has(n)||c.__byteLengthSumOfMembers.set(n,new Map);const i=c.__byteLengthSumOfMembers.get(n);i.has(e)||i.set(e,0),t.forEach((t=>{i.set(e,i.get(e)+t.compositionType.getNumberOfComponents()*t.componentType.getSizeInBytes())})),t.length}for(const i of o.keys())o.get(i).forEach((i=>{const o=c.takeAccessor(i.bufferUse,i.memberName,n,i.compositionType,i.componentType,e);t["_byteOffsetOfAccessorInBuffer_"+i.memberName]=o.byteOffsetInBuffer,t["_byteOffsetOfAccessorInComponent_"+i.memberName]=o.byteOffsetInBufferView}))}(this);const o=c.__members.get(n);for(const e of o.keys())o.get(e).forEach((e=>{this.takeOne(e.memberName,e.dataClassType,e.initValues,t,this._component_sid)}))}get entity(){return o.g.getEntity(this.__entityUid)}static getDataByteInfoInner(e,t){const n=e["_"+t]._v,i=n.byteOffset,o=n.byteLength,a=n.length,r=i/4/4;return{byteLength:o,byteOffsetInBuffer:i,byteOffsetInThisComponent:this["_byteOffsetOfAccessorInComponent_"+t]+e.componentSID*a*4,locationOffsetInBuffer:r,locationOffsetInThisComponent:this["_byteOffsetOfAccessorInComponent_"+t]+e.componentSID*a,thisComponentByteOffsetInBuffer:e.__byteOffsetOfThisComponent,thisComponentLocationOffsetInBuffer:e.__byteOffsetOfThisComponent/4/4,componentNumber:a}}getDataByteInfo(e){return c.getDataByteInfoInner(this,e)}static getDataByteInfoByComponentSID(e,t,n){const i=r.C.getComponent(e,t);if(i)return c.getDataByteInfoInner(i,n)}static getDataByteInfoByEntityUID(e,t,n){const i=o.g.getComponentOfEntity(t,e);if(i)return c.getDataByteInfoInner(i,n)}static getLocationOffsetOfMemberOfComponent(e,t){return r.C.getComponent(e,0)["_byteOffsetOfAccessorInBuffer_"+t]/4/4}addThisComponentToEntity(e,t){throw"Invalid Calling"}static getCompositionTypeOfMember(e,t){const n=this.__memberInfo.get(t).find((t=>t.memberName===e));return null!=n?n.compositionType:void 0}static getComponentTypeOfMember(e,t){const n=this.__memberInfo.get(t).find((t=>t.memberName===e));return null!=n?n.componentType:void 0}_destroy(){this._isAlive=!1}_shallowCopyFrom(e){}}c.invalidComponentSID=-1,c.__componentsOfProcessStages=new Map,c.__lengthOfArrayOfProcessStages=new Map,c.__bufferViews=new Map,c.__accessors=new Map,c.__byteLengthSumOfMembers=new Map,c.__memberInfo=new Map,c.__members=new Map,c._processStages=[a.I.Create,a.I.Load,a.I.Logic,a.I.PreRender,a.I.Render]},2404:(e,t,n)=>{"use strict";n.d(t,{C:()=>s});var i=n(9721),o=n(4690),a=n(3258),r=n(4710);class s{constructor(){}static registerComponentClass(e){s.__componentClasses.set(e.componentTID,e)}static deregisterComponentClass(e){s.__componentClasses.delete(e)}static getComponentClass(e){return this.__componentClasses.get(e)}static createComponent(e,t,n){const a=s.__componentClasses.get(e);if(o.Is.exist(a)){let r=this.__component_sid_count_map.get(e);o.Is.not.exist(r)&&(this.__component_sid_count_map.set(e,0),r=i.w.invalidComponentSID);const s=this.__components.get(e);let l=-1;if(o.Is.exist(s))for(let e=0;ee._isAlive))}static _getComponentsIncludingDead(e){return this.__components.get(e.componentTID)}static getMemoryBeginIndex(e){let t=0;for(let n=0;ne._isAlive))}static getComponentTIDs(){const e=Array.from(this.__components.keys());return e.sort(((e,t)=>e-t)),e}static getRenderingComponentTIDs(){const e=[];return this.__components.has(r.z.MeshRendererComponentTID)&&e.push(r.z.MeshRendererComponentTID),this.__components.has(r.z.EffekseerComponentTID)&&e.push(r.z.EffekseerComponentTID),e}}s.__component_sid_count_map=new Map,s.__components=new Map,s.__componentClasses=new Map},3258:(e,t,n)=>{"use strict";n.d(t,{D:()=>_});var i=n(1226),o=n(2253);let a=41,r=33,s=Math.pow(2,12),l=Math.pow(2,12),c=i.N.Mat44x1;"undefined"!=typeof navigator&&(o.Kf.isMobile()||o.Kf.isMobileVr())&&(a=4,r=32,s=512,l=512);const _={maxEntityNumber:5e3,maxLightNumberInShader:4,maxVertexMorphNumberInShader:a,maxMaterialInstanceForEachType:10,boneDataType:c,maxSkeletonNumber:r,maxCameraNumber:20,maxSizeLimitOfNonCompressedTexture:512,maxSkeletalBoneNumber:300,maxSkeletalBoneNumberForUniformMode:50,dataTextureWidth:s,dataTextureHeight:l,noWebGLTex2DStateCache:!1,maxMorphTargetNumber:4,totalSizeOfGPUShaderDataStorageExceptMorphData:0,isUboEnabled:!1,eventTargetDom:void 0}},1328:(e,t,n)=>{"use strict";n.d(t,{J:()=>r});var i=n(9002),o=n(4690),a=n(4710);class r extends i.S{constructor(e,t,n){super(),this._myLatestCopyEntityUID=r.invalidEntityUID,this.___entity_uid=e,this._isAlive=t,this.__components=o.Is.exist(n)?n:new Map}get entityUID(){return this.___entity_uid}_setComponent(e,t){this.__components.set(e.componentTID,t)}hasComponent(e){return this.__components.has(e.componentTID)}getComponent(e){return this.__components.get(e.componentTID)}getComponentByComponentTID(e){return this.__components.get(e)}_removeComponent(e){this.__components.delete(e)}tryToGetAnimation(){return this.getComponentByComponentTID(a.z.AnimationComponentTID)}tryToGetBlendShape(){return this.getComponentByComponentTID(a.z.BlendShapeComponentTID)}tryToGetCamera(){return this.getComponentByComponentTID(a.z.CameraComponentTID)}tryToGetCameraController(){return this.getComponentByComponentTID(a.z.CameraControllerComponentTID)}tryToGetLight(){return this.getComponentByComponentTID(a.z.LightComponentTID)}tryToGetMesh(){return this.getComponentByComponentTID(a.z.MeshComponentTID)}tryToGetMeshRenderer(){return this.getComponentByComponentTID(a.z.MeshRendererComponentTID)}tryToGetPhysics(){return this.getComponentByComponentTID(a.z.PhysicsComponentTID)}tryToGetSceneGraph(){return this.getComponentByComponentTID(a.z.SceneGraphComponentTID)}tryToGetSkeletal(){return this.getComponentByComponentTID(a.z.SkeletalComponentTID)}tryToGetTransform(){return this.getComponentByComponentTID(a.z.TransformComponentTID)}tryToGetVrm(){return this.getComponentByComponentTID(a.z.VrmComponentTID)}tryToGetConstraint(){return this.getComponentByComponentTID(a.z.ConstraintComponentTID)}_destroy(){this.__components.forEach((e=>{e._destroy()})),this._isAlive=!1}}r.invalidEntityUID=-1},1350:(e,t,n)=>{"use strict";n.d(t,{e:()=>c,g:()=>l});var i=n(1328),o=n(2404),a=n(6098),r=n(4690),s=n(4710);class l{constructor(){}static createEntity(){let e=-1;for(let t=0;tl.getEntity(e.entity._myLatestCopyEntityUID).tryToGetSceneGraph()));t.setJoints(e)}const i=e.tryToGetSceneGraph();r.Is.exist(i)&&i.children.forEach((e=>{l.__setJoints(e.entity)}))}static _shallowCopyEntityInner(e){const t=this.createEntity();t._tags=Object.assign({},e._tags),e._myLatestCopyEntityUID=t.entityUID;for(let n=1;n<=s.z.maxWellKnownTidNumber;n++){const i=e.getComponentByComponentTID(n);if(r.Is.exist(i)){this.tryToAddComponentToEntityByTID(n,t);const e=t.getComponentByComponentTID(n);r.Is.exist(e)&&e._shallowCopyFrom(i)}}return t}static __handleTagData(e){const t=e._tags;if(r.Is.exist(t)){const n=Object.keys(t);for(const t of n){if("rnEntities"===t){const t=e.getTagValue("rnEntities").map((e=>l.getEntity(e._myLatestCopyEntityUID)));e.tryToSetTag({tag:"rnEntities",value:t})}if("rnEntitiesByNames"===t){const t=e.getTagValue("rnEntitiesByNames");for(const e of Object.keys(t)){const n=t.get(e);t.set(e,l.getEntity(n._myLatestCopyEntityUID))}e.tryToSetTag({tag:"rnEntitiesByNames",value:t})}}}const n=e.tryToGetSceneGraph();r.Is.exist(n)&&n.children.forEach((e=>{l.__handleTagData(e.entity)}))}static tryToAddComponentToEntityByTID(e,t){const n=o.C.getComponentClass(e);return r.Is.not.exist(n)?t:this.addComponentToEntity(n,t)}static addComponentToEntity(e,t){if(t.hasComponent(e))return console.log("This entity already has the Component."),t;const n=o.C.createComponent(e.componentTID,t.entityUID,this);return(0,a.wv)({value:this._components[t.entityUID],compensation:()=>{const e=new Map;return this._components[t.entityUID]=e,e}}).set(e.componentTID,n),n.addThisComponentToEntity(t,e),t._setComponent(e,n),t}static removeComponentFromEntity(e,t){let n=this._components[t.entityUID];null==n&&(n=new Map,this._components[t.entityUID]=n);const i=n.get(e.componentTID);return r.Is.exist(i)&&(i._destroy(),n.delete(e.componentTID),t._removeComponent(e.componentTID)),t}static getEntity(e){return this.__entities[e]}static getComponentOfEntity(e,t){const n=this._components[e];let i=null;return null!=n?(i=n.get(t.componentTID),null!=i?i:null):i}static searchByTags(e){const t=[];for(const n of this.__entities)n.matchTags(e)&&t.push(n);return t}static getEntityByUniqueName(e){for(const t of this.__entities)if(t.uniqueName===e)return t}static _getEntities(){return this.__entities.filter((e=>e._isAlive))}static getEntitiesNumber(){return this.__entities.filter((e=>e._isAlive)).length}}function c(e,t){Object.getOwnPropertyNames(t.prototype).forEach((n=>{Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t.prototype,n)||Object.create(null))}))}l.__entity_uid_count=i.J.invalidEntityUID,l.__entities=[],l._components=[]},7348:(e,t,n)=>{"use strict";n.d(t,{$:()=>b});var i=n(4587),o=n(752),a=n(9286),r=n(810),s=n(3999),l=n(8547),c=n(7987),_=n(5324),h=n(4255),u=n(1813),d=n(3258),m=n(3616),f=n(7192),p=n(2471),v=n(3496),A=n(4710),y=n(1226),g=n(7683),x=n(1181),I=n(4020);class b{constructor(){this.__fields=new Map}initialize(e){const t={semantic:i.f5.CurrentComponentSIDs,compositionType:r.d.ScalarArray,componentType:s.r.Float,arrayLength:A.z.maxWellKnownTidNumber,stage:_.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,needUniformInDataTextureMode:!0,initialValue:new h.j(new Float32Array(A.z.maxWellKnownTidNumber))};this.__registerProperty(t,1),this.takeOne(i.f5.CurrentComponentSIDs);const n={semantic:i.f5.ViewMatrix,compositionType:r.d.Mat4,componentType:s.r.Float,stage:_.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,initialValue:v.e.identity()},o={semantic:i.f5.ProjectionMatrix,compositionType:r.d.Mat4,componentType:s.r.Float,stage:_.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,initialValue:v.e.identity()},a={semantic:i.f5.ViewPosition,compositionType:r.d.Vec3,componentType:s.r.Float,stage:_.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:p.P.fromCopyArray([0,0,1])};this.__registerProperty(n,d.D.maxCameraNumber),this.__registerProperty(o,d.D.maxCameraNumber),this.__registerProperty(a,d.D.maxCameraNumber);const l=g.V.isUniformApproach(e)?d.D.maxSkeletalBoneNumberForUniformMode:d.D.maxSkeletalBoneNumber,c={semantic:i.f5.BoneMatrix,compositionType:r.d.Mat4Array,arrayLength:l,componentType:s.r.Float,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,soloDatum:!0,initialValue:new h.j(new Float32Array(0))},x={semantic:i.f5.BoneQuaternion,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,soloDatum:!0,initialValue:new h.j(new Float32Array(0))},b={semantic:i.f5.BoneTranslateScale,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,soloDatum:!0,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:new h.j(new Float32Array(0))},E={semantic:i.f5.BoneTranslatePackedQuat,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,soloDatum:!0,initialValue:new h.j(new Float32Array(0))},T={semantic:i.f5.BoneScalePackedQuat,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,soloDatum:!0,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:new h.j(new Float32Array(0))},S={semantic:i.f5.BoneCompressedChunk,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,soloDatum:!0,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:new h.j(new Float32Array(0))},C={semantic:i.f5.BoneCompressedInfo,compositionType:r.d.Vec4,componentType:s.r.Float,soloDatum:!0,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:f.Lt.zero()},w={semantic:i.f5.SkinningMode,compositionType:r.d.Scalar,componentType:s.r.Int,stage:_.H.VertexAndPixelShader,min:0,max:1,isCustomSetting:!0,updateInterval:u.a.EveryTime,initialValue:m.Ru.fromCopyNumber(-1)};d.D.boneDataType===y.N.Mat44x1?this.__registerProperty(c,d.D.maxSkeletonNumber):d.D.boneDataType===y.N.Vec4x2?(this.__registerProperty(E,d.D.maxSkeletonNumber),this.__registerProperty(T,d.D.maxSkeletonNumber)):d.D.boneDataType===y.N.Vec4x2Old?(this.__registerProperty(x,d.D.maxSkeletonNumber),this.__registerProperty(b,d.D.maxSkeletonNumber)):d.D.boneDataType===y.N.Vec4x1&&(this.__registerProperty(b,d.D.maxSkeletonNumber),this.__registerProperty(S,d.D.maxSkeletonNumber),this.__registerProperty(C,1),this.takeOne(i.f5.BoneCompressedInfo)),this.__registerProperty(w,1),this.takeOne(i.f5.SkinningMode);const R={semantic:i.f5.LightPosition,compositionType:r.d.Vec3Array,componentType:s.r.Float,stage:_.H.PixelShader,arrayLength:d.D.maxLightNumberInShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.EveryTime,initialValue:new h.j(new Float32Array(d.D.maxLightNumberInShader))},P={semantic:i.f5.LightDirection,compositionType:r.d.Vec3Array,componentType:s.r.Float,stage:_.H.PixelShader,arrayLength:d.D.maxLightNumberInShader,min:-1,max:1,isCustomSetting:!0,initialValue:new h.j(new Float32Array(d.D.maxLightNumberInShader)),updateInterval:u.a.EveryTime},D={semantic:i.f5.LightIntensity,compositionType:r.d.Vec3Array,componentType:s.r.Float,stage:_.H.PixelShader,arrayLength:d.D.maxLightNumberInShader,min:0,max:10,isCustomSetting:!0,initialValue:new h.j(new Float32Array(d.D.maxLightNumberInShader)),updateInterval:u.a.EveryTime},M={semantic:i.f5.LightProperty,compositionType:r.d.Vec4Array,componentType:s.r.Float,stage:_.H.PixelShader,arrayLength:d.D.maxLightNumberInShader,min:0,max:10,isCustomSetting:!0,initialValue:new h.j(new Float32Array(d.D.maxLightNumberInShader)),updateInterval:u.a.EveryTime};this.__registerProperty(R,1),this.__registerProperty(P,1),this.__registerProperty(D,1),this.__registerProperty(M,1),this.takeOne(i.f5.LightDirection),this.takeOne(i.f5.LightIntensity),this.takeOne(i.f5.LightPosition),this.takeOne(i.f5.LightProperty);const N={semantic:i.f5.LightNumber,compositionType:r.d.Scalar,componentType:s.r.Int,stage:_.H.VertexAndPixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:m.Ru.fromCopyNumber(0)};this.__registerProperty(N,1),this.takeOne(i.f5.LightNumber);const B={semantic:i.f5.BackBufferTextureSize,compositionType:r.d.Vec2,componentType:s.r.Float,stage:_.H.PixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isCustomSetting:!0,needUniformInDataTextureMode:!0,updateInterval:u.a.EveryTime,initialValue:I.FM.fromCopy2(0,0)};this.__registerProperty(B,1),this.takeOne(i.f5.BackBufferTextureSize);const L={semantic:i.f5.VrState,compositionType:r.d.Vec2,componentType:s.r.Int,stage:_.H.PixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isCustomSetting:!0,needUniformInDataTextureMode:!0,updateInterval:u.a.EveryTime,initialValue:I.FM.fromCopy2(0,0)};this.__registerProperty(L,1),this.takeOne(i.f5.VrState)}static getInstance(){return this.__instance||(this.__instance=new b),this.__instance}__registerProperty(e,t){const n=(0,x.V)(e),i=a.B.getInstance().createOrGetBuffer(o.$.GPUInstanceData),l=(0,x.K)(e),c=i.takeBufferView({byteLengthToNeed:l*t,byteStride:0}).unwrapForce();let _=e.arrayLength;r.d.isArray(e.compositionType)&&null==_&&(_=100);const h={shaderSemanticsInfo:e,values:[],maxCount:t,accessor:c.takeAccessor({compositionType:e.compositionType,componentType:s.r.Float,count:t,byteStride:l,arrayLength:_}).unwrapForce()};this.__fields.set(n,h)}takeOne(e){const t=(0,i.UL)(e),n=this.__fields.get(t);if(n){const e=n.shaderSemanticsInfo,t=n.accessor.takeOne(),i=n.values.length,o=l.D.initWithFloat32Array(e.initialValue,e.initialValue,t,e.compositionType);return n.values[i]=o,o}}setValue(e,t,n){const o=(0,i.UL)(e),a=this.__fields.get(o);if(a){const e=a.values[t];l.D._setForce(e,n)}}getValue(e,t){const n=(0,i.UL)(e),o=this.__fields.get(n);if(o)return o.values[t]}getGlobalPropertyStruct(e){return this.__fields.get(e)}getGlobalProperties(){return Array.from(this.__fields.values())}_setUniformLocationsForUniformModeOnly(e){const t=c.F.getWebGLResourceRepository(),n=[];this.__fields.forEach(((e,t)=>{const i=e.shaderSemanticsInfo;n.push(i)})),t.setupUniformLocations(e,n,!0)}_setUniformLocationsForDataTextureModeOnly(e){const t=c.F.getWebGLResourceRepository(),n=[];this.__fields.forEach(((e,t)=>{const i=e.shaderSemanticsInfo;i.needUniformInDataTextureMode&&n.push(i)})),t.setupUniformLocations(e,n,!0)}setUniformValues(e){const t=c.F.getWebGLResourceRepository();this.__fields.forEach(((n,i)=>{const o=n.shaderSemanticsInfo,a=n.values;for(let n=0;n{const r=o.shaderSemanticsInfo;r.stage!==_.H.VertexShader&&r.stage!==_.H.VertexAndPixelShader||(e+=n("",r,a,!0,i)),r.stage!==_.H.PixelShader&&r.stage!==_.H.VertexAndPixelShader||(t+=n("",r,a,!0,i))})),[e,t]}}},9286:(e,t,n)=>{"use strict";n.d(t,{B:()=>s});var i=n(4235),o=n(752),a=n(3258),r=n(6098);class s{constructor(e,t,n){this.__buffers={},this.__buffersOnDemand=new Map,this.__memorySizeRatios={},this.__memorySizeRatios[o.$.CPUGeneric.str]=e,this.__memorySizeRatios[o.$.GPUInstanceData.str]=t,this.__memorySizeRatios[o.$.GPUVertexData.str]=n}static createInstanceIfNotCreated({cpuGeneric:e,gpuInstanceData:t,gpuVertexData:n}){return this.__instance||(this.__instance=new s(e,t,n)),this.__instance}__makeMultipleOf4byteSize(e){return e+(e%4==0?0:4-e%4)}static getInstance(){return this.__instance}__createBuffer(e){const t=s.bufferWidthLength*s.bufferHeightLength*4*4*this.__memorySizeRatios[e.str],n=new ArrayBuffer(this.__makeMultipleOf4byteSize(t));let a=4;e!==o.$.GPUInstanceData&&e!==o.$.GPUVertexData||(a=16);const r=new i.l({byteLength:n.byteLength,buffer:n,name:e.str,byteAlign:a});return this.__buffers[r.name]=r,r}getBuffer(e){return this.__buffers[e.toString()]}createOrGetBuffer(e){let t=this.__buffers[e.toString()];return null==t&&(t=this.__createBuffer(e)),t}createBufferOnDemand(e,t,n){const a=new ArrayBuffer(e),r=new i.l({byteLength:a.byteLength,buffer:a,name:o.$.UBOGeneric.toString(),byteAlign:n});return this.__buffersOnDemand.set(t.objectUID,r),r}getBufferOnDemand(e){return this.__buffersOnDemand.get(e.objectUID)}static get bufferWidthLength(){return a.D.dataTextureWidth}static get bufferHeightLength(){return a.D.dataTextureHeight}printMemoryUsage(){const e=this.__buffers[o.$.CPUGeneric.toString()],t=this.__buffers[o.$.GPUInstanceData.toString()],n=this.__buffers[o.$.GPUVertexData.toString()];console.log("Memory Usage in Memory Manager:"),console.log(`CPUGeneric: ${e.takenSizeInByte} byte of ${e.byteLength} bytes. (${e.takenSizeInByte/e.byteLength*100} %) `),console.log(`GPUInstanceData: ${t.takenSizeInByte} byte of ${t.byteLength} bytes. (${t.takenSizeInByte/t.byteLength*100} %) `),null!=n&&console.log(`GPUVertexData: ${n.takenSizeInByte} byte of ${n.byteLength} bytes. (${n.takenSizeInByte/n.byteLength*100} %) `)}dumpBuffer(e){const t=this.__buffers[e.toString()];return r.Kf.downloadArrayBuffer(e.toString(),t.getArrayBuffer()),t}}},9002:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var i=n(6098);class o{constructor(){this.__objectUid=o.currentMaxObjectCount++,this._tags={},this.__combinedTagString="",this.__uniqueName=`${this.constructor.name}__uid_${this.__objectUid}`,this.__updateInfo(this.__uniqueName)}__updateInfo(e){o.__objects[this.__objectUid]=this,o.__uniqueNames[this.__objectUid]=e,o.__objectsByNameMap.set(this.__uniqueName,this)}static searchByTag(e,t){for(const n of o.__objects)if(n.getTagValue(e)===t)return n}get objectUID(){return this.__objectUid}static getRnObject(e){return o.__objects[e]}static getRnObjectByName(e){return o.__objectsByNameMap.get(e)}tryToSetUniqueName(e,t){if(-1!==o.__uniqueNames.indexOf(e)){if(t){const t=e+"_("+this.__objectUid+")";if(-1===o.__uniqueNames.indexOf(t))return this.__uniqueName=t,o.__uniqueNames[this.__objectUid]=this.__uniqueName,o.__objectsByNameMap.set(this.__uniqueName,this),!0}return!1}return this.__uniqueName=e,o.__uniqueNames[this.__objectUid]=this.__uniqueName,o.__objectsByNameMap.set(this.__uniqueName,this),!0}validateTagString(e){return!new RegExp(/[!"#$%&'()\*\+\-\s\.,\/:;<=>?@\[\\\]^`{|}~]/g).test(e)}tryToSetTag(e){return!!this.validateTagString(e.tag)&&(this.hasTag(e.tag)&&this.removeTag(e.tag),this._tags[e.tag]=e.value,this.__combinedTagString+=`${e.tag}:${e.value} `,!0)}getTagValue(e){return this._tags[e]}getTag(e){return{tag:e,value:this._tags[e]}}hasTag(e){return null!=this._tags[e]}removeTag(e){this._tags[e],this.__combinedTagString.replace(this.__combinedTagString,""),delete this._tags[e]}matchTag(e,t){return this._tags[e]===t}matchTagsAsFreeStrings(e){let t="^";for(let n=0;n{"use strict";n.d(t,{F:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}toGltfString(){return"TRANSLUCENT"===this.str?"BLEND":this.str}}const a=new o({index:0,str:"OPAQUE"}),r=new o({index:1,str:"MASK"}),s=new o({index:2,str:"TRANSLUCENT"}),l=new o({index:3,str:"ADDITIVE"}),c=[a,r,s,l],_=Object.freeze({Opaque:a,Mask:r,Translucent:s,Additive:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})},fromGlTFString:function(e){return"BLEND"===e?s:(0,i.cu)({typeList:c,str:e})}})},3498:(e,t,n)=>{"use strict";n.d(t,{s:()=>h});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Quaternion"}),r=new o({index:1,str:"Translate"}),s=new o({index:2,str:"Scale"}),l=new o({index:3,str:"Weights"}),c=new o({index:4,str:"Effekseer"}),_=[a,r,s,l,c],h=Object.freeze({Quaternion:a,Translate:r,Scale:s,Weights:l,Effekseer:c,from:function(e){return(0,i.li)({typeList:_,index:e})},fromString:function(e){return(0,i.cu)({typeList:_,str:e})}})},7305:(e,t,n)=>{"use strict";n.d(t,{k:()=>c});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}get GltfString(){return this.str.toUpperCase()}}const a=new o({index:0,str:"Linear"}),r=new o({index:1,str:"Step"}),s=new o({index:2,str:"CubicSpline"}),l=[a,r,s],c=Object.freeze({Linear:a,Step:r,CubicSpline:s,from:function(e){return(0,i.li)({typeList:l,index:e})},fromString:function(e){return(0,i.cu)({typeList:l,str:e})}})},290:(e,t,n)=>{"use strict";n.d(t,{l:()=>b});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"ETC1"}),r=new o({index:1,str:"ETC2"}),s=new o({index:2,str:"BC1"}),l=new o({index:3,str:"BC3"}),c=new o({index:4,str:"BC4"}),_=new o({index:5,str:"BC5"}),h=new o({index:6,str:"BC7_M6_OPAQUE"}),u=new o({index:7,str:"BC7_M5"}),d=new o({index:8,str:"PVRTC1_RGB"}),m=new o({index:9,str:"PVRTC1_RGBA"}),f=new o({index:10,str:"ASTC"}),p=new o({index:11,str:"ATC_RGB"}),v=new o({index:12,str:"ATC_RGBA"}),A=new o({index:13,str:"RGBA32"}),y=new o({index:14,str:"RGB565"}),g=new o({index:15,str:"BGR565"}),x=new o({index:16,str:"RGBA4444"}),I=[a,r,s,l,c,_,u,h,d,m,f,p,v,A,y,g,x],b=Object.freeze({ETC1:a,ETC2:r,BC1:s,BC3:l,BC4:c,BC5:_,BC7_M5:u,BC7_M6_OPAQUE:h,PVRTC1_RGB:d,PVRTC1_RGBA:m,ASTC:f,ATC_RGB:p,ATC_RGBA:v,RGBA32:A,RGB565:y,BGR565:g,RGBA4444:x,from:function(e){return(0,i.li)({typeList:I,index:e})},fromString:function(e){return(0,i.cu)({typeList:I,str:e})}})},7009:(e,t,n)=>{"use strict";n.d(t,{C:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:32774,str:"Equation_FUNC_ADD"}),r=new o({index:1,str:"ONE"}),s=new o({index:770,str:"ONE_ALPHA"}),l=new o({index:771,str:"ONE_MINUS_SRC_ALPHA"}),c=[a,r,s,l],_=Object.freeze({EquationFuncAdd:a,One:r,SrcAlpha:s,OneMinusSrcAlpha:l,from:function(e){return(0,i.li)({typeList:c,index:e})}})},1226:(e,t,n)=>{"use strict";n.d(t,{N:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Mat44x1"}),r=new o({index:1,str:"Vec4x2"}),s=new o({index:2,str:"Vec4x2Old"}),l=new o({index:3,str:"Vec4x1"}),c=[a,r,l],_=Object.freeze({Mat44x1:a,Vec4x2:r,Vec4x2Old:s,Vec4x1:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})}})},752:(e,t,n)=>{"use strict";n.d(t,{$:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"GPUInstanceData"}),r=new o({index:1,str:"GPUVertexData"}),s=new o({index:2,str:"UBOGeneric"}),l=new o({index:3,str:"CPUGeneric"}),c=[a,r,s,l],_=Object.freeze({GPUInstanceData:a,GPUVertexData:r,UBOGeneric:s,CPUGeneric:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})}})},8914:(e,t,n)=>{"use strict";n.d(t,{M:()=>l});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Orbit"}),r=new o({index:1,str:"WalkThrough"}),s=[a,r],l=Object.freeze({Orbit:a,WalkThrough:r,from:function(e){return(0,i.li)({typeList:s,index:e})},fromString:function(e){return(0,i.cu)({typeList:s,str:e})}})},9646:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Perspective"}),r=new o({index:1,str:"Orthographic"}),s=new o({index:2,str:"Frustum"}),l=[a,r,s],c=Object.freeze({Perspective:a,Orthographic:r,Frustum:s,from:function(e){return(0,i.li)({typeList:l,index:e})},fromString:function(e){return(0,i.cu)({typeList:l,str:e})}})},3999:(e,t,n)=>{"use strict";n.d(t,{r:()=>v});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t,sizeInBytes:n}){super({index:e,str:t}),this.__sizeInBytes=n}getSizeInBytes(){return this.__sizeInBytes}isFloatingPoint(){return 5126===this.index||5127===this.index||36193===this.index}isInteger(){return 5120===this.index||5121===this.index||5122===this.index||5123===this.index||5124===this.index||5125===this.index}}const a=new o({index:5119,str:"UNKNOWN",sizeInBytes:0}),r=new o({index:5120,str:"BYTE",sizeInBytes:1}),s=new o({index:5121,str:"UNSIGNED_BYTE",sizeInBytes:1}),l=new o({index:5122,str:"SHORT",sizeInBytes:2}),c=new o({index:5123,str:"UNSIGNED_SHORT",sizeInBytes:2}),_=new o({index:5124,str:"INT",sizeInBytes:4}),h=new o({index:5125,str:"UNSIGNED_INT",sizeInBytes:4}),u=new o({index:5126,str:"FLOAT",sizeInBytes:4}),d=new o({index:5127,str:"DOUBLE",sizeInBytes:8}),m=new o({index:35670,str:"BOOL",sizeInBytes:1}),f=new o({index:5131,str:"HALF_FLOAT",sizeInBytes:2}),p=[a,r,s,l,c,_,h,u,d,f,m],v=Object.freeze({Unknown:a,Byte:r,UnsignedByte:s,Short:l,UnsignedShort:c,Int:_,UnsignedInt:h,Float:u,Double:d,Bool:m,HalfFloat:f,from:function(e){return(0,i.li)({typeList:p,index:e})},fromTypedArray:function(e){return e instanceof Int8Array?r:e instanceof Uint8Array||e instanceof Uint8ClampedArray?s:e instanceof Int16Array?l:e instanceof Uint16Array?c:e instanceof Int32Array?_:e instanceof Uint32Array?h:e instanceof Float32Array?u:e instanceof Float64Array?d:a},toTypedArray:function(e){return e===r?Int8Array:e===s?Uint8Array:e===l?Int16Array:e===c?Uint16Array:e===_?Int32Array:e===h?Uint32Array:e===u?Float32Array:e===d?Float64Array:void 0},toGltf2AccessorComponentType:function(e){return e.index},fromString:function(e){return(0,i.cu)({typeList:p,str:e})},fromGlslString:function(e){let t=e;switch(e){case"bool":t="BOOL";break;case"int":case"ivec2":case"ivec3":case"ivec4":case"sampler2D":case"sampler2DShadow":case"sampler2DRect":case"sampler3D":case"samplerCube":t="INT";break;case"float":case"vec2":case"vec3":case"vec4":case"mat2":case"mat3":case"mat4":t="FLOAT"}return(0,i.cu)({typeList:p,str:t})}})},810:(e,t,n)=>{"use strict";n.d(t,{d:()=>T});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t,glslStr:n,hlslStr:i,numberOfComponents:o,vec4SizeOfProperty:a,isArray:r=!1}){super({index:e,str:t}),this.__numberOfComponents=o,this.__glslStr=n,this.__hlslStr=i,this.__vec4SizeOfProperty=a,this.__isArray=r}getNumberOfComponents(){return this.__numberOfComponents}getGlslStr(e){return 5126===e.index||5127===e.index||this===T.Texture2D||this===T.Texture2DShadow||this===T.Texture2DRect||this===T.TextureCube?this.__glslStr:5120===e.index||5122===e.index||5124===e.index?this===T.Scalar||this===T.ScalarArray?"int":"i"+this.__glslStr:35670===e.index?"bool":"unknown"}getGlslInitialValue(e){if(5126===e.index||5127===e.index){if(this===T.Scalar)return"0.0";if(2===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0)";if(3===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0)";if(4===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0, 0.0)";if(9===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)";if(16===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)"}else if(5120===e.index||5122===e.index||5124===e.index){if(this===T.Scalar)return"0";if(2===this.__numberOfComponents)return this.__glslStr+"(0, 0)";if(3===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0)";if(4===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0, 0)";if(9===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0, 0, 0, 0, 0, 0, 0)";if(16===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"}else if(35670===e.index){if(this===T.Scalar)return"false";if(2===this.__numberOfComponents)return this.__glslStr+"(false, false)";if(3===this.__numberOfComponents)return this.__glslStr+"(false, false, false)";if(4===this.__numberOfComponents)return this.__glslStr+"(false, false, false, false)"}return"unknown"}getVec4SizeOfProperty(){return this.__vec4SizeOfProperty}}const a=new o({index:-1,str:"UNKNOWN",glslStr:"unknown",hlslStr:"unknown",numberOfComponents:0,vec4SizeOfProperty:0}),r=new o({index:0,str:"SCALAR",glslStr:"float",hlslStr:"float",numberOfComponents:1,vec4SizeOfProperty:1}),s=new o({index:1,str:"VEC2",glslStr:"vec2",hlslStr:"float2",numberOfComponents:2,vec4SizeOfProperty:1}),l=new o({index:2,str:"VEC3",glslStr:"vec3",hlslStr:"float3",numberOfComponents:3,vec4SizeOfProperty:1}),c=new o({index:3,str:"VEC4",glslStr:"vec4",hlslStr:"float4",numberOfComponents:4,vec4SizeOfProperty:1}),_=new o({index:4,str:"MAT2",glslStr:"mat2",hlslStr:"float2x2",numberOfComponents:4,vec4SizeOfProperty:2}),h=new o({index:5,str:"MAT3",glslStr:"mat3",hlslStr:"float3x3",numberOfComponents:9,vec4SizeOfProperty:3}),u=new o({index:6,str:"MAT4",glslStr:"mat4",hlslStr:"float4x4",numberOfComponents:16,vec4SizeOfProperty:4}),d=new o({index:7,str:"TEXTURE_2D",glslStr:"sampler2D",hlslStr:"Texture2D",numberOfComponents:1,vec4SizeOfProperty:1}),m=new o({index:8,str:"TEXTURE_CUBE_MAP",glslStr:"samplerCube",hlslStr:"TextureCube",numberOfComponents:1,vec4SizeOfProperty:1}),f=new o({index:9,str:"SCALAR_ARRAY",glslStr:"float",hlslStr:"float",numberOfComponents:1,vec4SizeOfProperty:1,isArray:!0}),p=new o({index:10,str:"VEC2_ARRAY",glslStr:"vec2",hlslStr:"float2",numberOfComponents:2,vec4SizeOfProperty:1,isArray:!0}),v=new o({index:11,str:"VEC3_ARRAY",glslStr:"vec3",hlslStr:"float3",numberOfComponents:3,vec4SizeOfProperty:1,isArray:!0}),A=new o({index:12,str:"VEC4_ARRAY",glslStr:"vec4",hlslStr:"float4",numberOfComponents:4,vec4SizeOfProperty:1,isArray:!0}),y=new o({index:13,str:"MAT4_ARRAY",glslStr:"mat4",hlslStr:"float4x4",numberOfComponents:16,vec4SizeOfProperty:4,isArray:!0}),g=new o({index:14,str:"MAT3_ARRAY",glslStr:"mat3",hlslStr:"float3x3",numberOfComponents:9,vec4SizeOfProperty:3,isArray:!0}),x=new o({index:15,str:"MAT2_ARRAY",glslStr:"mat2",hlslStr:"float2x2",numberOfComponents:4,vec4SizeOfProperty:2,isArray:!0}),I=new o({index:16,str:"TEXTURE_2D_SHADOW",glslStr:"highp sampler2DShadow",hlslStr:"Texture2D",numberOfComponents:1,vec4SizeOfProperty:1}),b=new o({index:17,str:"TEXTURE_2D_RECT",glslStr:"sampler2DRect",hlslStr:"Texture2D",numberOfComponents:1,vec4SizeOfProperty:1}),E=[a,r,s,l,c,_,h,u,p,v,A,f,x,g,y,d,I,b,m],T=Object.freeze({Unknown:a,Scalar:r,Vec2:s,Vec3:l,Vec4:c,Mat2:_,Mat3:h,Mat4:u,ScalarArray:f,Vec2Array:p,Vec3Array:v,Vec4Array:A,Mat2Array:x,Mat3Array:g,Mat4Array:y,Texture2D:d,Texture2DShadow:I,TextureCube:m,Texture2DRect:b,from:function(e){return(0,i.li)({typeList:E,index:e})},fromString:function(e){return(0,i.cu)({typeList:E,str:e})},vectorFrom:function(e){let t="";switch(e){case 1:t="scalar";break;case 2:t="vec2";break;case 3:t="vec3";break;case 4:t="vec4";break;default:console.error("not found appropriate Vectors")}return(0,i.cu)({typeList:E,str:t})},fromGlslString:function(e){let t=e;switch(e){case"bool":case"int":case"float":t="scalar";break;case"ivec2":t="vec2";break;case"ivec3":t="vec3";break;case"ivec4":t="vec4";break;case"sampler2D":t="TEXTURE_2D";break;case"sampler2DShadow":t="TEXTURE_2D_SHADOW";break;case"sampler2DRect":t="TEXTURE_2D_RECT";break;case"samplerCube":t="TEXTURE_CUBE_MAP"}return(0,i.cu)({typeList:E,str:t})},isArray:function(e){return e===f||e===p||e===v||e===A||e===y||e===g||e===x},isTexture:function(e){return e===d||e===m||e===I||e===b},toGltf2AnimationAccessorCompositionType:function(e){switch(e){case 1:return r;case 2:return s;case 3:return l;case 4:return c;default:throw new Error("Invalid componentN")}},toGltf2AccessorCompositionTypeString:function(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";case 9:return"MAT3";case 16:return"MAT4";default:throw new Error("Invalid componentN")}},toGltf2AnimationAccessorCompositionTypeString:function(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";default:throw new Error("Invalid componentN")}},toGltf2SquareMatrixAccessorCompositionTypeString:function(e){switch(e){case 4:return"VEC4";case 9:return"MAT3";case 16:return"MAT4";default:throw new Error("Invalid componentN")}}})},1715:(e,t,n)=>{"use strict";n.d(t,{b:()=>X});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:37808,str:"COMPRESSED_RGBA_ASTC_4x4_KHR"}),r=new o({index:37809,str:"COMPRESSED_RGBA_ASTC_5x4_KHR"}),s=new o({index:37810,str:"COMPRESSED_RGBA_ASTC_5x5_KHR"}),l=new o({index:37811,str:"COMPRESSED_RGBA_ASTC_6x5_KHR"}),c=new o({index:37812,str:"COMPRESSED_RGBA_ASTC_6x6_KHR"}),_=new o({index:37813,str:"COMPRESSED_RGBA_ASTC_8x5_KHR"}),h=new o({index:37814,str:"COMPRESSED_RGBA_ASTC_8x6_KHR"}),u=new o({index:37815,str:"COMPRESSED_RGBA_ASTC_8x8_KHR"}),d=new o({index:37816,str:"COMPRESSED_RGBA_ASTC_10x5_KHR"}),m=new o({index:37817,str:"COMPRESSED_RGBA_ASTC_10x6_KHR"}),f=new o({index:37818,str:"COMPRESSED_RGBA_ASTC_10x8_KHR"}),p=new o({index:37819,str:"COMPRESSED_RGBA_ASTC_10x10_KHR"}),v=new o({index:37820,str:"COMPRESSED_RGBA_ASTC_12x10_KHR"}),A=new o({index:37821,str:"COMPRESSED_RGBA_ASTC_12x12_KHR"}),y=new o({index:37840,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR"}),g=new o({index:37841,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR"}),x=new o({index:37842,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR"}),I=new o({index:37843,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR"}),b=new o({index:37844,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR"}),E=new o({index:37845,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR"}),T=new o({index:37846,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR"}),S=new o({index:37847,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR"}),C=new o({index:37848,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR"}),w=new o({index:37849,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR"}),R=new o({index:37850,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR"}),P=new o({index:37851,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR"}),D=new o({index:37852,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR"}),M=new o({index:37853,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR"}),N=new o({index:33776,str:"COMPRESSED_RGB_S3TC_DXT1_EXT"}),B=new o({index:33777,str:"COMPRESSED_RGBA_S3TC_DXT1_EXT"}),L=new o({index:33778,str:"COMPRESSED_RGBA_S3TC_DXT3_EXT"}),F=new o({index:33779,str:"COMPRESSED_RGBA_S3TC_DXT5_EXT"}),G=new o({index:36492,str:"COMPRESSED_RGBA_BPTC_UNORM_EXT"}),V=new o({index:35842,str:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"}),z=new o({index:35840,str:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG"}),O=new o({index:37496,str:"COMPRESSED_RGBA8_ETC2_EAC"}),U=new o({index:37492,str:"COMPRESSED_RGB8_ETC2"}),k=new o({index:36196,str:"COMPRESSED_RGB_ETC1_WEBGL"}),Q=new o({index:32856,str:"RGBA8_EXT"}),W=[a,r,s,l,c,_,h,u,d,m,f,p,v,A,y,g,x,I,b,E,T,S,C,w,R,P,D,M,N,B,L,F,G,V,z,O,U,k,Q],X=Object.freeze({ASTC_RGBA_4x4:a,ASTC_RGBA_5x4:r,ASTC_RGBA_5x5:s,ASTC_RGBA_6x5:l,ASTC_RGBA_6x6:c,ASTC_RGBA_8x5:_,ASTC_RGBA_8x6:h,ASTC_RGBA_8x8:u,ASTC_RGBA_10x5:d,ASTC_RGBA_10x6:m,ASTC_RGBA_10x8:f,ASTC_RGBA_10x10:p,ASTC_RGBA_12x10:v,ASTC_RGBA_12x12:A,ASTC_SRGB_4x4:y,ASTC_SRGB_5x4:g,ASTC_SRGB_5x5:x,ASTC_SRGB_6x5:I,ASTC_SRGB_6x6:b,ASTC_SRGB_8x5:E,ASTC_SRGB_8x6:T,ASTC_SRGB_8x8:S,ASTC_SRGB_10x5:C,ASTC_SRGB_10x6:w,ASTC_SRGB_10x8:R,ASTC_SRGB_10x10:P,ASTC_SRGB_12x10:D,ASTC_SRGB_12x12:M,S3TC_RGB_DXT1:N,S3TC_RGBA_DXT1:B,S3TC_RGBA_DXT3:L,S3TC_RGBA_DXT5:F,BPTC_RGBA:G,PVRTC_RGBA_4BPPV1:V,PVRTC_RGB_4BPPV1:z,ETC2_RGBA8_EAC:O,ETC2_RGB8:U,ETC1_RGB:k,RGBA8_EXT:Q,from:function(e){return(0,i.li)({typeList:W,index:e})},fromString:function(e){return(0,i.cu)({typeList:W,str:e})}})},7338:(e,t,n)=>{"use strict";n.d(t,{T:()=>u});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t,ext:n,brand:i}){super({index:e,str:t}),this.extension=n,this.brand=i}}const a=new o({index:-1,str:"unknown",ext:"unknown",brand:"UnKnown"}),r=new o({index:0,str:"gltf",ext:"gltf",brand:"glTF"}),s=new o({index:1,str:"glb",ext:"glb",brand:"glTF"}),l=new o({index:2,str:"vrm",ext:"vrm",brand:"VRM"}),c=new o({index:3,str:"drc",ext:"drc",brand:"Draco"}),_=new o({index:4,str:"efk",ext:"efk",brand:"EffekseerEffect"}),h=[a,r,s,l,c,_],u=Object.freeze({Unknown:a,Gltf:r,GltfBinary:s,VRM:l,Draco:c,EffekseerEffect:_,from:function(e){return(0,i.li)({typeList:h,index:e})},fromString:function(e){const t=(0,i.cu)({typeList:h,str:e});return null!=t?t:a},isGltfOrGlb:function(e){return e===r||e===s}})},1986:(e,t,n)=>{"use strict";n.d(t,{c:()=>u});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:".ldr_srgb"}),r=new o({index:1,str:".ldr_linear"}),s=new o({index:2,str:".hdr"}),l=new o({index:3,str:".rgbe.png"}),c=new o({index:4,str:".rgb9_e5.png"}),_=new o({index:5,str:".exr"}),h=[a,r,s,l,c,_],u=Object.freeze({LDR_SRGB:a,LDR_LINEAR:r,HDR_LINEAR:s,RGBE_PNG:l,RGB9_E5_PNG:c,OpenEXR:_,from:function(e){return(0,i.li)({typeList:h,index:e})},fromString:function(e){return(0,i.cu)({typeList:h,str:e})}})},5634:(e,t,n)=>{"use strict";n.d(t,{v:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Directional"}),r=new o({index:1,str:"Point"}),s=new o({index:2,str:"Spot"}),l=new o({index:3,str:"Ambient"}),c=[r,a,s,l],_=Object.freeze({Point:r,Directional:a,Spot:s,Ambient:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})}})},9216:(e,t,n)=>{"use strict";n.d(t,{V:()=>d});var i=n(10),o=n(2343);class a extends o.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const r=new a({index:6402,str:"DEPTH_COMPONENT"}),s=new a({index:6406,str:"ALPHA"}),l=new a({index:i.SJU,str:"RG"}),c=new a({index:6407,str:"RGB"}),_=new a({index:6408,str:"RGBA"}),h=new a({index:6409,str:"LUMINANCE"}),u=new a({index:6410,str:"LUMINANCE_ALPHA"}),d=Object.freeze({DepthComponent:r,Alpha:s,RG:l,RGB:c,RGBA:_,Luminance:h,LuminanceAlpha:u})},8696:(e,t,n)=>{"use strict";n.d(t,{T:()=>m});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:-1,str:"UNKNOWN"}),r=new o({index:0,str:"POINTS"}),s=new o({index:1,str:"LINES"}),l=new o({index:2,str:"LINE_LOOP"}),c=new o({index:3,str:"LINE_STRIP"}),_=new o({index:4,str:"TRIANGLES"}),h=new o({index:5,str:"TRIANGLE_STRIP"}),u=new o({index:6,str:"TRIANGLE_FAN"}),d=[a,r,s,l,c,_,h,u],m=Object.freeze({Unknown:a,Points:r,Lines:s,LineLoop:l,LineStrip:c,Triangles:_,TriangleStrip:h,TriangleFan:u,from:function(e){return(0,i.li)({typeList:d,index:e})}})},7683:(e,t,n)=>{"use strict";n.d(t,{V:()=>c,y:()=>o});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}get webGLVersion(){switch(this){case r:case s:return 2;default:return 0}}}const a=new o({index:0,str:"NONE"}),r=new o({index:1,str:"UNIFORM"}),s=new o({index:2,str:"DataTexture"}),l=new o({index:3,str:"WebGPU"}),c=Object.freeze({isDataTextureApproach:e=>e===s,isUniformApproach:e=>e===r,isWebGpuApproach:e=>e===l,None:a,Uniform:r,DataTexture:s,WebGPU:l,isWebGL2Approach:e=>{switch(e){case r:case s:return!0;default:return!1}}})},4507:(e,t,n)=>{"use strict";n.d(t,{I:()=>f});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t,methodName:n}){super({index:e,str:t}),this.methodName=n}}const a=new o({index:-1,str:"UNKNOWN",methodName:"$unknown"}),r=new o({index:0,str:"CREATE",methodName:"$create"}),s=new o({index:1,str:"LOAD",methodName:"$load"}),l=new o({index:2,str:"MOUNT",methodName:"$mount"}),c=new o({index:3,str:"LOGIC",methodName:"$logic"}),_=new o({index:4,str:"PRE_RENDER",methodName:"$prerender"}),h=new o({index:5,str:"RENDER",methodName:"$render"}),u=new o({index:6,str:"UNMOUNT",methodName:"$unmount"}),d=new o({index:7,str:"DISCARD",methodName:"$discard"}),m=[a,r,s,l,c,_,h,u,d],f=Object.freeze({Unknown:a,Create:r,Load:s,Mount:l,Logic:c,PreRender:_,Render:h,Unmount:u,Discard:d,from:function(e){return(0,i.li)({typeList:m,index:e})}})},8422:(e,t,n)=>{"use strict";n.d(t,{G:()=>E});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}webGLConstantValue(){return-2===this.index?0:-1===this.index?1029:36064+this.index}}const a=new o({index:-2,str:"NONE"}),r=new o({index:-1,str:"BACK"}),s=new o({index:0,str:"COLOR_ATTACHMENT0"}),l=new o({index:1,str:"COLOR_ATTACHMENT1"}),c=new o({index:2,str:"COLOR_ATTACHMENT2"}),_=new o({index:3,str:"COLOR_ATTACHMENT3"}),h=new o({index:4,str:"COLOR_ATTACHMENT4"}),u=new o({index:5,str:"COLOR_ATTACHMENT5"}),d=new o({index:6,str:"COLOR_ATTACHMENT6"}),m=new o({index:7,str:"COLOR_ATTACHMENT7"}),f=new o({index:8,str:"COLOR_ATTACHMENT8"}),p=new o({index:9,str:"COLOR_ATTACHMENT9"}),v=new o({index:10,str:"COLOR_ATTACHMENT10"}),A=new o({index:11,str:"COLOR_ATTACHMENT11"}),y=new o({index:12,str:"COLOR_ATTACHMENT12"}),g=new o({index:13,str:"COLOR_ATTACHMENT13"}),x=new o({index:14,str:"COLOR_ATTACHMENT14"}),I=new o({index:15,str:"COLOR_ATTACHMENT15"}),b=[a,r,s,l,c,_,h,u,d,m,f,p,v,A,y,g,x,I],E=Object.freeze({None:a,Back:r,ColorAttachment0:s,ColorAttachment1:l,ColorAttachment2:c,ColorAttachment3:_,ColorAttachment4:h,ColorAttachment5:u,ColorAttachment6:d,ColorAttachment7:m,ColorAttachment8:f,ColorAttachment9:p,ColorAttachment10:v,ColorAttachment11:A,ColorAttachment12:y,ColorAttachment13:g,ColorAttachment14:x,ColorAttachment15:I,from:function(e){return(0,i.li)({typeList:b,index:e})}})},3591:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"ClassicShading"}),r=new o({index:1,str:"PBRShading"}),s=(new o({index:2,str:"Lerp"}),new o({index:3,str:"Add"}),[a,r]),l=Object.freeze({ClassicShading:a,PBRShading:r,from:function(e){return(0,i.li)({typeList:s,index:e})},fromString:function(e){return(0,i.cu)({typeList:s,str:e})}})},4587:(e,t,n)=>{"use strict";n.d(t,{UL:()=>St,f5:()=>Ct,wy:()=>a});var i=n(2343),o=n(810);class a extends i.Jx{constructor({str:e}){super({index:++a.__indexCount*a._scale,str:e,noCheckStrUnique:!0}),a.__classes[this.index]=this}static getShaderSemanticByIndex(e){return this.__classes[Math.abs(e)-Math.abs(e)%this._scale]}static isNonArrayShaderSemanticIndex(e){return e>=this._scale}static isArrayAndZeroIndexShaderSemanticIndex(e){return e<0&&Math.abs(e)%a._scale==0}static isArrayAndNonZeroIndexShaderSemanticIndex(e){return e<0&&Math.abs(e)%a._scale!=0}static getIndexCount(){return a.__indexCount}}a.__indexCount=-1,a._scale=1e4,a.__classes=[];const r=new a({str:"worldMatrix"}),s=new a({str:"viewMatrix"}),l=new a({str:"isBillboard"}),c=new a({str:"enableViewMatrix"}),_=new a({str:"projectionMatrix"}),h=new a({str:"normalMatrix"}),u=new a({str:"boneMatrix"}),d=new a({str:"baseColorFactor"}),m=new a({str:"baseColorTexture"}),f=new a({str:"normalTexture"}),p=new a({str:"metallicRoughnessTexture"}),v=new a({str:"occlusionTexture"}),A=new a({str:"emissiveFactor"}),y=new a({str:"emissiveTexture"}),g=new a({str:"lightNumber"}),x=new a({str:"lightPosition"}),I=new a({str:"lightDirection"}),b=new a({str:"lightIntensity"}),E=new a({str:"lightProperty"}),T=new a({str:"metallicRoughnessFactor"}),S=new a({str:"brdfLutTexture"}),C=new a({str:"diffuseEnvTexture"}),w=new a({str:"specularEnvTexture"}),R=new a({str:"inverseEnvironment"}),P=new a({str:"iblParameter"}),D=new a({str:"viewPosition"}),M=new a({str:"wireframe"}),N=new a({str:"diffuseColorFactor"}),B=new a({str:"diffuseColorTexture"}),L=new a({str:"shininess"}),F=new a({str:"shadingModel"}),G=new a({str:"skinningMode"}),V=new a({str:"generalTexture"}),z=new a({str:"vertexAttributesExistenceArray"}),O=new a({str:"boneQuaternion"}),U=new a({str:"boneTranslateScale"}),k=new a({str:"boneTranslatePackedQuat"}),Q=new a({str:"boneScalePackedQuat"}),W=new a({str:"boneCompressedChunk"}),X=new a({str:"boneCompressedInfo"}),q=new a({str:"pointSize"}),H=new a({str:"colorEnvTexture"}),j=new a({str:"pointDistanceAttenuation"}),Y=new a({str:"hdriFormat"}),K=new a({str:"screenInfo"}),J=new a({str:"depthTexture"}),Z=new a({str:"lightViewProjectionMatrix"}),$=new a({str:"anisotropy"}),ee=new a({str:"clearcoatParameter"}),te=new a({str:"sheenColorFactor"}),ne=new a({str:"sheenColorTexture"}),ie=new a({str:"sheenRoughnessFactor"}),oe=new a({str:"sheenRoughnessTexture"}),ae=new a({str:"sheenLutTexture"}),re=new a({str:"specularGlossinessFactor"}),se=new a({str:"specularGlossinessTexture"}),le=new a({str:"entityUID"}),ce=new a({str:"morphTargetNumber"}),_e=new a({str:"dataTextureMorphOffsetPosition"}),he=new a({str:"morphWeights"}),ue=new a({str:"currentComponentSIDs"}),de=new a({str:"alphaCutoff"}),me=new a({str:"alphaTexture"}),fe=new a({str:"makeOutputSrgb"}),pe=new a({str:"framebufferWidth"}),ve=new a({str:"clearCoatFactor"}),Ae=new a({str:"clearCoatTexture"}),ye=new a({str:"clearCoatRoughnessFactor"}),ge=new a({str:"clearCoatRoughnessTexture"}),xe=new a({str:"clearCoatNormalTexture"}),Ie=new a({str:"transmissionFactor"}),be=new a({str:"transmissionTexture"}),Ee=new a({str:"backBufferTexture"}),Te=new a({str:"backBufferTextureSize"}),Se=new a({str:"thicknessFactor"}),Ce=new a({str:"thicknessTexture"}),we=new a({str:"attenuationDistance"}),Re=new a({str:"attenuationColor"}),Pe=new a({str:"isOutputHDR"}),De=new a({str:"baseColorTextureTransform"}),Me=new a({str:"baseColorTextureRotation"}),Ne=new a({str:"normalTextureTransform"}),Be=new a({str:"normalTextureRotation"}),Le=new a({str:"metallicRoughnessTextureTransform"}),Fe=new a({str:"metallicRoughnessTextureRotation"}),Ge=new a({str:"normalTexcoordIndex"}),Ve=new a({str:"baseColorTexcoordIndex"}),ze=new a({str:"metallicRoughnessTexcoordIndex"}),Oe=new a({str:"occlusionTexcoordIndex"}),Ue=new a({str:"occlusionTextureTransform"}),ke=new a({str:"occlusionTextureRotation"}),Qe=new a({str:"emissiveTexcoordIndex"}),We=new a({str:"emissiveTextureTransform"}),Xe=new a({str:"emissiveTextureRotation"}),qe=new a({str:"normalScale"}),He=new a({str:"occlusionStrength"}),je=new a({str:"envRotation"}),Ye=new a({str:"envHdriFormat"}),Ke=new a({str:"vrState"}),Je=new a({str:"enableLinearToSrgb"}),Ze=new a({str:"specularFactor"}),$e=new a({str:"specularTexture"}),et=new a({str:"specularColorFactor"}),tt=new a({str:"specularColorTexture"}),nt=new a({str:"ior"}),it=new a({str:"depthBiasPV"}),ot=new a({str:"clearCoatTextureTransform"}),at=new a({str:"clearCoatTextureRotation"}),rt=new a({str:"clearCoatRoughnessTextureTransform"}),st=new a({str:"clearCoatRoughnessTextureRotation"}),lt=new a({str:"clearCoatNormalTextureTransform"}),ct=new a({str:"clearCoatNormalTextureRotation"}),_t=new a({str:"clearCoatTexcoordIndex"}),ht=new a({str:"clearCoatRoughnessTexcoordIndex"}),ut=new a({str:"clearCoatNormalTexcoordIndex"}),dt=new a({str:"iridescenceFactor"}),mt=new a({str:"iridescenceTexture"}),ft=new a({str:"iridescenceIor"}),pt=new a({str:"iridescenceThicknessMinimum"}),vt=new a({str:"iridescenceThicknessMaximum"}),At=new a({str:"iridescenceThicknessTexture"}),yt=new a({str:"gaussianKernelSize"}),gt=new a({str:"anisotropyStrength"}),xt=new a({str:"anisotropyRotation"}),It=new a({str:"anisotropyTexture"}),bt=new a({str:"gaussianRatio"}),Et=new a({str:"isHorizontal"}),Tt=[r,s,l,c,_,h,u,d,m,f,p,v,A,y,g,x,I,b,E,T,S,C,w,R,P,D,M,N,B,L,F,G,V,z,O,U,k,Q,W,X,q,H,j,Y,K,J,Z,$,ee,te,ne,ie,oe,ae,re,se,le,ce,_e,he,ue,de,me,fe,pe,ve,Ae,ye,ge,xe,Ie,be,Ee,Te,Se,Ce,we,Re,Pe,De,Me,Ne,Be,Le,Fe,Ge,Ve,ze,Oe,Ue,ke,Qe,We,Xe,qe,He,je,Ye,Ke,Je,Ze,$e,et,tt,nt,it,ot,at,rt,st,lt,ct,_t,ht,ut,dt,mt,ft,pt,vt,At,yt,bt,Et,gt,xt,It];function St(e){return e.index}const Ct=Object.freeze({from:function(e){return(0,i.li)({typeList:Tt,index:e})},fromString:function(e){return(0,i.cu)({typeList:Tt,str:e})},fromStringCaseSensitively:function(e){return(0,i.bm)({typeList:Tt,str:e})},WorldMatrix:r,ViewMatrix:s,IsBillboard:l,EnableViewMatrix:c,ProjectionMatrix:_,NormalMatrix:h,BoneMatrix:u,BaseColorFactor:d,BaseColorTexture:m,NormalTexture:f,MetallicRoughnessTexture:p,OcclusionTexture:v,EmissiveFactor:A,EmissiveTexture:y,LightNumber:g,LightPosition:x,LightDirection:I,LightIntensity:b,LightProperty:E,MetallicRoughnessFactor:T,BrdfLutTexture:S,DiffuseEnvTexture:C,SpecularEnvTexture:w,InverseEnvironment:R,IBLParameter:P,ViewPosition:D,Wireframe:M,DiffuseColorFactor:N,DiffuseColorTexture:B,Shininess:L,ShadingModel:F,SkinningMode:G,GeneralTexture:V,VertexAttributesExistenceArray:z,BoneQuaternion:O,BoneTranslateScale:U,BoneTranslatePackedQuat:k,BoneScalePackedQuat:Q,BoneCompressedChunk:W,BoneCompressedInfo:X,PointSize:q,ColorEnvTexture:H,PointDistanceAttenuation:j,HDRIFormat:Y,ScreenInfo:K,DepthTexture:J,LightViewProjectionMatrix:Z,Anisotropy:$,ClearCoatParameter:ee,SheenColorFactor:te,SheenColorTexture:ne,SheenRoughnessFactor:ie,SheenRoughnessTexture:oe,SheenLutTexture:ae,SpecularGlossinessFactor:re,SpecularGlossinessTexture:se,ClearCoatFactor:ve,ClearCoatTexture:Ae,ClearCoatRoughnessFactor:ye,ClearCoatRoughnessTexture:ge,ClearCoatNormalTexture:xe,TransmissionFactor:Ie,TransmissionTexture:be,BackBufferTexture:Ee,BackBufferTextureSize:Te,ThicknessFactor:Se,ThicknessTexture:Ce,AttenuationDistance:we,AttenuationColor:Re,fullSemanticStr:function(e){let t="";return null!=e.prefix&&(t=e.prefix),t+e.semantic.str},getShaderProperty:(e,t,n,i,r)=>{if(t.isComponentData)return"";const s=t.compositionType.getGlslStr(t.componentType);let l=Ct.fullSemanticStr(t);const c=t.compositionType.getGlslStr(t.componentType);let _="";t.arrayLength&&(_=`[${t.arrayLength}]`);const h=` uniform ${c} u_${l}${_};\n`;let u="";if(n<0||o.d.isArray(t.compositionType)){if(Math.abs(n)%a._scale!=0&&!o.d.isArray(t.compositionType))return"";l.match(/\[.+?\]/)?l=l.replace(/\[.+?\]/g,"[i]"):l+="[i]",u+=r?`\n ${s} val;\n int i = index;\n return u_${l};\n `:`\n ${s} val;\n for (int i=0; i<${t.arrayLength}; i++) {\n if (i == index) {\n val = u_${l};\n break;\n }\n }\n return val;\n `}else u+=`return u_${l};`;let d="";return o.d.isTexture(t.compositionType)||(d=`\n ${s} get_${t.semantic.str}(float instanceId, int index) {\n ${u}\n }\n`),`${h}${d}`},EntityUID:le,MorphTargetNumber:ce,DataTextureMorphOffsetPosition:_e,MorphWeights:he,CurrentComponentSIDs:ue,AlphaCutoff:de,AlphaTexture:me,MakeOutputSrgb:fe,FramebufferWidth:pe,IsOutputHDR:Pe,BaseColorTextureTransform:De,BaseColorTextureRotation:Me,NormalTextureTransform:Ne,NormalTextureRotation:Be,MetallicRoughnessTextureTransform:Le,MetallicRoughnessTextureRotation:Fe,NormalTexcoordIndex:Ge,BaseColorTexcoordIndex:Ve,MetallicRoughnessTexcoordIndex:ze,OcclusionTexcoordIndex:Oe,OcclusionTextureTransform:Ue,OcclusionTextureRotation:ke,EmissiveTexcoordIndex:Qe,EmissiveTextureTransform:We,EmissiveTextureRotation:Xe,NormalScale:qe,OcclusionStrength:He,envRotation:je,EnvHdriFormat:Ye,VrState:Ke,EnableLinearToSrgb:Je,SpecularFactor:Ze,SpecularTexture:$e,SpecularColorFactor:et,SpecularColorTexture:tt,Ior:nt,DepthBiasPV:it,ClearCoatTextureTransform:ot,ClearCoatTextureRotation:at,ClearCoatRoughnessTextureTransform:rt,ClearCoatRoughnessTextureRotation:st,ClearCoatNormalTextureTransform:lt,ClearCoatNormalTextureRotation:ct,ClearCoatTexcoordIndex:_t,ClearCoatRoughnessTexcoordIndex:ht,ClearCoatNormalTexcoordIndex:ut,IridescenceFactor:dt,IridescenceTexture:mt,IridescenceIor:ft,IridescenceThicknessMinimum:pt,IridescenceThicknessMaximum:vt,IridescenceThicknessTexture:At,GaussianKernelSize:yt,GaussianRatio:bt,IsHorizontal:Et,AnisotropyStrength:gt,AnisotropyRotation:xt,AnisotropyTexture:It})},1181:(e,t,n)=>{"use strict";n.d(t,{K:()=>o,V:()=>a});var i=n(810);function o(e){const t=e.compositionType.getNumberOfComponents()*e.componentType.getSizeInBytes();let n=t;if(n%16!=0&&(n=t+16-t%16),i.d.isArray(e.compositionType)){const t=e.arrayLength;null!=t?n*=t:(console.error("semanticInfo has invalid maxIndex!"),n*=100)}return n}function a(e){return e.semantic.index}},5324:(e,t,n)=>{"use strict";n.d(t,{H:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:1,str:"VertexShader"}),r=new o({index:2,str:"PixelShader"}),s=new o({index:3,str:"VertexAndPixelShader"}),l=new o({index:4,str:"ComputeShader"}),c=[a,r,s,l],_=Object.freeze({VertexShader:a,PixelShader:r,VertexAndPixelShader:s,ComputeShader:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})}})},1813:(e,t,n)=>{"use strict";n.d(t,{a:()=>c});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"FirstTimeOnly"}),r=new o({index:1,str:"EveryTime"}),s=new o({index:2,str:"RenderPass"}),l=[a,r,s],c=Object.freeze({FirstTimeOnly:a,EveryTime:r,RenderPass:s,from:function(e){return(0,i.li)({typeList:l,index:e})},fromString:function(e){return(0,i.cu)({typeList:l,str:e})}})},9840:(e,t,n)=>{"use strict";n.d(t,{D:()=>h});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:-1,str:"UNKNOWN"}),r=new o({index:0,str:"CONSTANT"}),s=new o({index:1,str:"LAMBERT"}),l=new o({index:2,str:"BLINN"}),c=new o({index:3,str:"PHONG"}),_=[a,r,s,l,c],h=Object.freeze({Unknown:a,Constant:r,Lambert:s,BlinnPhong:l,Phong:c,from:function(e){return(0,i.li)({typeList:_,index:e})}})},5981:(e,t,n)=>{"use strict";n.d(t,{d:()=>O});var i=n(10),o=n(2343),a=n(9216);class r extends o.Jx{constructor({index:e,str:t,webgpu:n}){super({index:e,str:t}),this.__webgpu=n}get webgpu(){if(void 0===this.__webgpu)throw new Error(`does not support ${this.str}`);return this.__webgpu}}const s=new r({index:9728,str:"NEAREST"}),l=new r({index:9729,str:"LINEAR"}),c=new r({index:9984,str:"NEAREST_MIPMAP_NEAREST"}),_=new r({index:9985,str:"LINEAR_MIPMAP_NEAREST"}),h=new r({index:9986,str:"NEAREST_MIPMAP_LINEAR"}),u=new r({index:9987,str:"LINEAR_MIPMAP_LINEAR"}),d=new r({index:10240,str:"TEXTURE_MAG_FILTER"}),m=new r({index:10241,str:"TEXTURE_MIN_FILTER"}),f=new r({index:10242,str:"TEXTURE_WRAP_S"}),p=new r({index:10243,str:"TEXTURE_WRAP_T"}),v=new r({index:3553,str:"TEXTURE_2D"}),A=new r({index:5890,str:"TEXTURE"}),y=new r({index:33984,str:"TEXTURE0"}),g=new r({index:33985,str:"TEXTURE1"}),x=new r({index:34016,str:"ACTIVE_TEXTURE"}),I=new r({index:10497,str:"REPEAT"}),b=new r({index:33071,str:"CLAMP_TO_EDGE"}),E=new r({index:33648,str:"MIRRORED_REPEAT"}),T=new r({index:32849,str:"RGB8"}),S=new r({index:32856,str:"RGBA8",webgpu:"rgba8unorm"}),C=new r({index:32857,str:"RGB10_A2"}),w=new r({index:i.uLG,str:"RG16F"}),R=new r({index:i.uM4,str:"RG32F"}),P=new r({index:34843,str:"RGB16F"}),D=new r({index:34837,str:"RGB32F"}),M=new r({index:34842,str:"RGBA16F"}),N=new r({index:34836,str:"RGBA32F"}),B=new r({index:33189,str:"DEPTH_COMPONENT16"}),L=new r({index:33190,str:"DEPTH_COMPONENT24"}),F=new r({index:36012,str:"DEPTH_COMPONENT32F"}),G=new r({index:35056,str:"DEPTH24_STENCIL8"}),V=new r({index:36013,str:"DEPTH32F_STENCIL8"}),z=[s,l,c,_,h,u,d,m,f,p,v,A,y,g,x,I,b,E,T,S,C,w,R,P,D,M,N,B,L,F,G,V],O=Object.freeze({Nearest:s,Linear:l,NearestMipmapNearest:c,LinearMipmapNearest:_,NearestMipmapLinear:h,LinearMipmapLinear:u,TextureMagFilter:d,TextureMinFilter:m,TextureWrapS:f,TextureWrapT:p,Texture2D:v,Texture:A,Texture0:y,Texture1:g,ActiveTexture:x,Repeat:I,ClampToEdge:b,MirroredRepeat:E,RGB8:T,RGBA8:S,RGB10_A2:C,RG16F:w,RG32F:R,RGB16F:P,RGB32F:D,RGBA16F:M,RGBA32F:N,Depth16:B,Depth24:L,Depth32F:F,Depth24Stencil8:G,Depth32FStencil8:V,from:function(e){return(0,o.li)({typeList:z,index:e})},migrateToWebGL1InternalFormat:function(e){if(e.index===S.index)return a.V.RGBA;if(e.index===T.index)return a.V.RGB;throw new Error("Unsupported texture parameter")}})},128:(e,t,n)=>{"use strict";n.d(t,{T:()=>x,x:()=>a});var i=n(2343),o=n(3738);class a extends i.Jx{constructor({str:e,shaderStr:t,attributeSlot:n,gltfComponentN:i}){super({index:a.__indexCount++,str:e}),this.__attributeSlot=n,this.__shaderStr=t,this.__gltfComponentN=i}getAttributeSlot(){return this.__attributeSlot}get shaderStr(){return this.__shaderStr}get attributeTypeName(){return this.str}_setShaderStr(e){this.__shaderStr=this.__shaderStr+e}get X(){return`${this.attributeTypeName}.X`}get Y(){return`${this.attributeTypeName}.Y`}get Z(){return`${this.attributeTypeName}.Z`}get W(){return`${this.attributeTypeName}.W`}get XY(){return`${this.attributeTypeName}.X,${this.attributeTypeName}.Y`}get XYZ(){return`${this.attributeTypeName}.X,${this.attributeTypeName}.Y,${this.attributeTypeName}.Z`}get XYZW(){return`${this.attributeTypeName}.X,${this.attributeTypeName}.Y,${this.attributeTypeName}.Z,${this.attributeTypeName}.W`}getVertexAttributeComponentsAsGltf(){if(1===this.__gltfComponentN)return this.X;if(2===this.__gltfComponentN)return this.XY;if(3===this.__gltfComponentN)return this.XYZ;if(4===this.__gltfComponentN)return this.XYZW;throw new o.Mr({message:"Invalid gltf component number",error:this.__gltfComponentN})}static __createVertexAttributeClass(e){return new a(e)}}a.__indexCount=-1;const r=a.__createVertexAttributeClass({str:"UNKNOWN",shaderStr:"a_unknown",attributeSlot:-1,gltfComponentN:0}),s=a.__createVertexAttributeClass({str:"POSITION",shaderStr:"a_position",attributeSlot:0,gltfComponentN:3}),l=a.__createVertexAttributeClass({str:"NORMAL",shaderStr:"a_normal",attributeSlot:1,gltfComponentN:3}),c=a.__createVertexAttributeClass({str:"TANGENT",shaderStr:"a_tangent",attributeSlot:2,gltfComponentN:3}),_=a.__createVertexAttributeClass({str:"TEXCOORD_0",shaderStr:"a_texcoord_0",attributeSlot:3,gltfComponentN:2}),h=a.__createVertexAttributeClass({str:"TEXCOORD_1",shaderStr:"a_texcoord_1",attributeSlot:4,gltfComponentN:2}),u=a.__createVertexAttributeClass({str:"COLOR_0",shaderStr:"a_color_0",attributeSlot:5,gltfComponentN:4}),d=a.__createVertexAttributeClass({str:"JOINTS_0",shaderStr:"a_joints_0",attributeSlot:6,gltfComponentN:4}),m=a.__createVertexAttributeClass({str:"WEIGHTS_0",shaderStr:"a_weights_0",attributeSlot:7,gltfComponentN:4}),f=a.__createVertexAttributeClass({str:"INSTANCE",shaderStr:"a_instanceInfo",attributeSlot:8,gltfComponentN:4}),p=a.__createVertexAttributeClass({str:"FACE_NORMAL",shaderStr:"a_faceNormal",attributeSlot:9,gltfComponentN:3}),v=a.__createVertexAttributeClass({str:"BARY_CENTRIC_COORD",shaderStr:"a_baryCentricCoord",attributeSlot:10,gltfComponentN:3}),A=a.__createVertexAttributeClass({str:"TEXCOORD_2",shaderStr:"a_texcoord_2",attributeSlot:11,gltfComponentN:2}),y=[r,s,l,c,_,h,u,d,m,f,p,v,A],g=y.length-1,x=Object.freeze({Unknown:r,Position:s,Normal:l,Tangent:c,Texcoord0:_,Texcoord1:h,Color0:u,Joints0:d,Weights0:m,Instance:f,FaceNormal:p,BaryCentricCoord:v,AttributeTypeNumber:g,isInstanceOfVertexAttributeClass:function(e){return e instanceof a},toVertexAttributeSemanticJoinedStringAsGltfStyle:function(e){switch(e){case s:case u:case l:case c:return e.XYZ;case _:case h:case A:return e.XY;case d:case m:case f:case p:case v:return e.XYZW;default:throw new Error("Invalied glTF VertexAttributeEnum")}},toAttributeSlotFromJoinedString:function(e){switch(e){case s.XYZ:return s.getAttributeSlot();case u.XYZ:return u.getAttributeSlot();case l.XYZ:return l.getAttributeSlot();case c.XYZ:return c.getAttributeSlot();case _.XY:return _.getAttributeSlot();case h.XY:return h.getAttributeSlot();case A.XY:return A.getAttributeSlot();case d.XYZW:return d.getAttributeSlot();case m.XYZW:return m.getAttributeSlot();case f.XYZW:return f.getAttributeSlot();case p.XYZ:return p.getAttributeSlot();case v.XYZ:return v.getAttributeSlot();default:throw new Error("Invalied glTF VertexAttributeEnum")}},toVectorComponentN:function(e){return e.split(",").length},from:function(e){return(0,i.li)({typeList:y,index:e})},fromString:function(e){let t=e;return"COLOR"===e?t="COLOR_0":"TEXCOORD"===e?t="TEXCOORD_0":"JOINTS"===e?t="JOINTS_0":"WEIGHTS"===e&&(t="WEIGHTS_0"),(0,i.cu)({typeList:y,str:t})}})},1296:(e,t,n)=>{"use strict";n.d(t,{Fv:()=>i.F,sd:()=>o.s,kO:()=>a.k,l6:()=>r.l,Nh:()=>s.N,$H:()=>l.$,My:()=>c.M,iM:()=>_.i,re:()=>h.r,dh:()=>u.d,bf:()=>d.b,Tv:()=>m.T,cz:()=>f.c,vB:()=>p.v,VI:()=>v.V,Tc:()=>A.T,V7:()=>y.V,yv:()=>y.y,Iq:()=>g.I,G2:()=>x.G,Zp:()=>I.Z,f5:()=>b.f5,wy:()=>b.wy,Ho:()=>T.H,Lv:()=>D,ax:()=>M.a,DA:()=>N.D,J1:()=>V,dI:()=>z.d,T:()=>O.T,x$:()=>O.x,EE:()=>q,Vl:()=>E.V,UL:()=>b.UL,Ky:()=>E.K});var i=n(5704),o=n(3498),a=n(7305),r=n(290),s=n(1226),l=n(752),c=n(8914),_=n(9646),h=n(3999),u=n(810),d=n(1715),m=n(7338),f=n(1986),p=n(5634),v=n(9216),A=n(8696),y=n(7683),g=n(4507),x=n(8422),I=n(3591),b=n(4587),E=n(1181),T=n(5324),S=n(2343);class C extends S.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const w=new C({index:1,str:"Varying"}),R=new C({index:2,str:"ReadOnlyData"}),P=[w,R],D=Object.freeze({Varying:w,ReadOnlyData:R,from:function(e){return(0,S.li)({typeList:P,index:e})},fromString:function(e){return(0,S.cu)({typeList:P,str:e})}});var M=n(1813),N=n(9840);class B extends S.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const L=new B({index:0,str:"Standard"}),F=new B({index:1,str:"Variance"}),G=[L,F],V=Object.freeze({Standard:L,Variance:F,from:function(e){return(0,S.li)({typeList:G,index:e})},fromString:function(e){return(0,S.cu)({typeList:G,str:e})}});var z=n(5981),O=n(128);class U extends S.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const k=new U({index:0,str:"Neutral"}),Q=new U({index:1,str:"Visible"}),W=new U({index:-1,str:"Invisible"}),X=[Q,W,k],q=Object.freeze({Visible:Q,Invisible:W,Neutral:k,from:function(e){return(0,S.li)({typeList:X,index:e})},fromString:function(e){return(0,S.cu)({typeList:X,str:e})}})},6477:(e,t,n)=>{"use strict";n.d(t,{i:()=>s});var i=n(7192),o=n(5467),a=n(3496),r=n(4536);class s{constructor(){this.top=r.xQ.zero(),this.bottom=r.xQ.zero(),this.right=r.xQ.zero(),this.left=r.xQ.zero(),this.zNear=r.xQ.zero(),this.zFar=r.xQ.zero(),this.__updated=!1,this.__vp=a.e.zero(),this.__invProjMat=a.e.zero(),this.__invViewMat=a.e.zero(),this.corners=[]}update(e,t){o.J.multiplyTo(t,e,this.__vp),this.zNear.x=this.__vp.m20+this.__vp.m30,this.zNear.y=this.__vp.m21+this.__vp.m31,this.zNear.z=this.__vp.m22+this.__vp.m32,this.zNear.w=this.__vp.m23+this.__vp.m33,this.zNear.normalize3(),this.zFar.x=-this.__vp.m20+this.__vp.m30,this.zFar.y=-this.__vp.m21+this.__vp.m31,this.zFar.z=-this.__vp.m22+this.__vp.m32,this.zFar.w=-this.__vp.m23+this.__vp.m33,this.zFar.normalize3(),this.bottom.x=this.__vp.m10+this.__vp.m30,this.bottom.y=this.__vp.m11+this.__vp.m31,this.bottom.z=this.__vp.m12+this.__vp.m32,this.bottom.w=this.__vp.m13+this.__vp.m33,this.bottom.normalize3(),this.top.x=-this.__vp.m10+this.__vp.m30,this.top.y=-this.__vp.m11+this.__vp.m31,this.top.z=-this.__vp.m12+this.__vp.m32,this.top.w=-this.__vp.m13+this.__vp.m33,this.top.normalize3(),this.left.x=this.__vp.m00+this.__vp.m30,this.left.y=this.__vp.m01+this.__vp.m31,this.left.z=this.__vp.m02+this.__vp.m32,this.left.w=this.__vp.m03+this.__vp.m33,this.left.normalize3(),this.right.x=-this.__vp.m00+this.__vp.m30,this.right.y=-this.__vp.m01+this.__vp.m31,this.right.z=-this.__vp.m02+this.__vp.m32,this.right.w=-this.__vp.m03+this.__vp.m33,this.right.normalize3();const n=[i.Lt.fromCopy4(-1,1,1,1),i.Lt.fromCopy4(1,1,1,1),i.Lt.fromCopy4(1,-1,1,1),i.Lt.fromCopy4(-1,-1,1,1),i.Lt.fromCopy4(-1,1,-1,1),i.Lt.fromCopy4(1,1,-1,1),i.Lt.fromCopy4(1,-1,-1,1),i.Lt.fromCopy4(-1,-1,-1,1)];o.J.invertTo(t,this.__invProjMat),o.J.invertTo(e,this.__invViewMat);for(let e=0;e<8;e++)n[e]=this.__invProjMat.multiplyVector(n[e]),n[e]=i.Lt.fromCopy4(n[e].x/n[e].w,n[e].y/n[e].w,n[e].z/n[e].w,1),this.corners[e]=this.__invViewMat.multiplyVector(n[e])}culling(e){const t=e.entity.getSceneGraph().worldAABB;for(let e=0;e<6;e++){let n=0;const i=this.getPlane(e);if(n+=i.x*t.minPoint.x+i.y*t.minPoint.y+i.z*t.minPoint.z+i.w<0?1:0,n+=i.x*t.maxPoint.x+i.y*t.minPoint.y+i.z*t.minPoint.z+i.w<0?1:0,n+=i.x*t.minPoint.x+i.y*t.maxPoint.y+i.z*t.minPoint.z+i.w<0?1:0,n+=i.x*t.maxPoint.x+i.y*t.maxPoint.y+i.z*t.minPoint.z+i.w<0?1:0,n+=i.x*t.minPoint.x+i.y*t.minPoint.y+i.z*t.maxPoint.z+i.w<0?1:0,n+=i.x*t.maxPoint.x+i.y*t.minPoint.y+i.z*t.maxPoint.z+i.w<0?1:0,n+=i.x*t.minPoint.x+i.y*t.maxPoint.y+i.z*t.maxPoint.z+i.w<0?1:0,n+=i.x*t.maxPoint.x+i.y*t.maxPoint.y+i.z*t.maxPoint.z+i.w<0?1:0,8===n)return!1}let n=0;n=0;for(let e=0;e<8;e++)n+=this.corners[e].x>t.maxPoint.x?1:0;if(8===n)return!1;n=0;for(let e=0;e<8;e++)n+=this.corners[e].xt.maxPoint.y?1:0;if(8===n)return!1;n=0;for(let e=0;e<8;e++)n+=this.corners[e].yt.maxPoint.z?1:0;if(8===n)return!1;n=0;for(let e=0;e<8;e++)n+=this.corners[e].z{"use strict";n.d(t,{K:()=>m});var i=n(128),o=n(8696),a=n(9286),r=n(752),s=n(3999),l=n(810),c=n(2471),_=n(2477),h=n(7987),u=n(9190),d=n(4690);class m{constructor(){this.__primitives=[],this.__opaquePrimitives=[],this.__transparentPrimitives=[],this.__morphPrimitives=[],this.__localAABB=new _.m,this.__vaoUids=[],this.__variationVBOUid=h.F.InvalidCGAPIResourceUid,this.__latestPrimitivePositionAccessorVersion=0,this.__belongToEntities=[],this.tangentCalculationMode=1,this.__hasFaceNormal=!1,this.__meshUID=++m.__mesh_uid_count}getVaoUids(e){return this.__vaoUids[e]}getVaoUidsByPrimitiveUid(e){const t=this.__primitives.findIndex((t=>t.primitiveUid===e));return this.__vaoUids[t]}get meshEntitiesInner(){return this.__belongToEntities}_belongToMeshComponent(e){this.__belongToEntities.push(e.entity)}addPrimitive(e){e._belongToMesh(this),null!=e.material&&e.material.isBlend()?this.__transparentPrimitives.push(e):this.__opaquePrimitives.push(e),this.__setPrimitives(this.__opaquePrimitives.concat(this.__transparentPrimitives))}__setPrimitives(e){this.__primitives=e}isAllBlend(){return this.__transparentPrimitives.length>0&&0===this.__opaquePrimitives.length}isBlendPartially(){return this.__transparentPrimitives.length>0&&this.__opaquePrimitives.length>0}isOpaque(){return 0===this.__transparentPrimitives.length&&this.__opaquePrimitives.length>0}getPrimitiveAt(e){return this.__primitives[e]}getPrimitiveNumber(){return this.__primitives.length}updateVariationVBO(){const e=h.F.getWebGLResourceRepository();this.__variationVBOUid!==h.F.InvalidCGAPIResourceUid&&e.deleteVertexBuffer(this.__variationVBOUid);const t=this.__belongToEntities.length,n=new Float32Array(4*t);for(let e=0;e{const o=t.getAttribute(i),a=o.elementCount;for(let e=0;e{"use strict";n.d(t,{W:()=>A});var i=n(8696),o=n(128),a=n(9002),r=n(3999),s=n(9286),l=n(810),c=n(2477),_=n(1469),h=n(7987),u=n(2471),d=n(9190),m=n(4690),f=n(4339),p=n(2852),v=n(6312);class A extends a.S{constructor(){super(),this.__mode=i.T.Unknown,this.__material=_.G.createEmptyMaterial(),this.__materialVariants=new Map,this.__currentVariantName=void 0,this._prevMaterial=_.G.createEmptyMaterial(),this.__attributes=new Map,this.__oIndices=new v.Hq,this.__primitiveUid=-1,this.__aabb=new c.m,this.__targets=[],this.__latestPositionAccessorVersion=0,this.__woMesh=new p.Lq,this._sortkey=0,this._viewDepth=0}setMaterialVariant(e,t){this.__materialVariants.set(e,t)}applyMaterialVariant(e){const t=this.__materialVariants.get(e);t&&(this.material=t,this.__currentVariantName=e)}getVariantNames(){return Array.from(this.__materialVariants.keys())}getVariantMaterial(e){return this.__materialVariants.get(e)}set material(e){this.__material=e,this.setSortKey(f.Yx,e.alphaMode.index),e._addBelongPrimitive(this)}get material(){return this.__material}setSortKey(e,t){const n=t<{c+=e.byteLength}));let _=c;null!=i&&(_+=i.byteLength);const h=s.B.getInstance().createBufferOnDemand(_,this,4);let u,d,m;if(null!=i){u=r.r.fromTypedArray(i),d=h.takeBufferView({byteLengthToNeed:i.byteLength,byteStride:0}).unwrapForce(),m=d.takeAccessor({compositionType:l.d.Scalar,componentType:u,count:i.byteLength/u.getSizeInBytes()}).unwrapForce();for(let e=0;e{const a=l.d.vectorFrom(o.T.toVectorComponentN(t[i]));v[i]=r.r.fromTypedArray(e[i]);const s=f.takeAccessor({compositionType:a,componentType:r.r.fromTypedArray(e[i]),count:n.byteLength/a.getNumberOfComponents()/v[i].getSizeInBytes()}).unwrapForce();s.copyFromTypedArray(n),p.push(s)}));const A=new Map;for(let e=0;e{e.push(t)})),e}getAttribute(e){return this.__attributes.get(e)}get attributeSemantics(){const e=[];return this.__attributes.forEach(((t,n)=>{e.push(n)})),e}get attributeEntries(){return this.__attributes.entries()}get attributeCompositionTypes(){const e=[];return this.__attributes.forEach(((t,n)=>{e.push(t.compositionType)})),e}get attributeComponentTypes(){const e=[];return this.__attributes.forEach(((t,n)=>{e.push(t.componentType)})),e}get primitiveMode(){return this.__mode}get primitiveUid(){return this.__primitiveUid}get positionAccessorVersion(){if(null!=this.__cachePositionAccessor)return this.__cachePositionAccessor.version;{const e=this.__attributes.get(o.T.Position.XYZ);return null!=e?(this.__cachePositionAccessor=e,e.version):void 0}}get AABB(){if(this.__aabb.isVanilla()||this.positionAccessorVersion!==this.__latestPositionAccessorVersion){const e=this.__attributes.get(o.T.Position.XYZ),t=e.min;this.__aabb.minPoint=A.__tmpVec3_0.setComponents(t[0],t[1],t[2]);const n=e.max;this.__aabb.maxPoint=A.__tmpVec3_0.setComponents(n[0],n[1],n[2]),this.__latestPositionAccessorVersion=e.version}return this.__aabb}setVertexAttribute(e,t){this.__attributes.set(t,e)}removeIndices(){this.__oIndices=new v.Hq}setIndices(e){this.__oIndices=new v.bD(e)}setBlendShapeTargets(e){this.__targets=e}getBlendShapeTargets(){return this.__targets.concat()}get targets(){return this.__targets}isBlend(){return!(null==this.material||!this.material.isBlend())}isOpaque(){return!this.isBlend()}create3DAPIVertexData(){if(null!=this.__vertexHandles)return!1;const e=h.F.getWebGLResourceRepository();return this.__vertexHandles=e.createVertexBufferAndIndexBuffer(this),!0}update3DAPIVertexData(){const e=this.__vertexHandles;return!m.Is.not.exist(this.__vertexHandles)&&(h.F.getWebGLResourceRepository().updateVertexBufferAndIndexBuffer(this,e),!0)}delete3DAPIVertexData(){return null!=this.__vertexHandles&&(h.F.getWebGLResourceRepository().deleteVertexDataResources(this.__vertexHandles),this.__vertexHandles=void 0,!0)}get vertexHandles(){return this.__vertexHandles}castRay(e,t,n,o,a,r){let s=Number.MAX_VALUE,l=3;if(this.__mode===i.T.TriangleStrip)l=1;else if(this.__mode===i.T.Points)return{result:!1};let c=0,_=0,h=0,d=0;if(this.hasIndices()){const i=this.__oIndices.unwrapForce();for(let u=0;ui.elementCount-1)break;const p=i.getScalar(f,{}),v=i.getScalar(f+1,{}),A=i.getScalar(f+2,{}),y=this.__castRayInnerTomasMoller(e,t,u,p,v,A,n,o,a,r);m.Is.false(y)||m.Is.not.exist(y.data)||y.data.t-c&&!l)return{result:!1}}}const h=this.__attributes.get(o.T.Position.XYZ),m=h.getVec3(i,{}),f=h.getVec3(a,{}),p=h.getVec3(r,{}),v=d.d6.zero(),A=d.d6.zero(),y=d.d6.zero(),g=d.d6.zero(),x=d.d6.zero();let I=0,b=0;d.d6.subtractTo(f,m,v),d.d6.subtractTo(p,m,A),d.d6.crossTo(t,A,y);const E=u.P.dot(v,y);if(E>1e-4){if(d.d6.subtractTo(e,m,g),I=u.P.dot(g,y),I<0||I>E)return{result:!1};if(d.d6.crossTo(g,v,x),b=u.P.dot(t,x),b<0||I+b>E)return{result:!1}}else{if(!(E<-1e-4))return{result:!1};if(d.d6.subtractTo(e,m,g),I=u.P.dot(g,y),I>0||I0||I+b{"use strict";n.d(t,{X:()=>l});var i=n(8696),o=n(128),a=n(2471),r=n(4690),s=n(3713);class l extends s.A{generate(e){var t;const n={widthVector:null!==(t=e.widthVector)&&void 0!==t?t:a.P.fromCopy3(1,1,1),color:e.color,material:e.material},s=[-n.widthVector.x,n.widthVector.y,-n.widthVector.z,n.widthVector.x,n.widthVector.y,-n.widthVector.z,n.widthVector.x,n.widthVector.y,n.widthVector.z,-n.widthVector.x,n.widthVector.y,n.widthVector.z,-n.widthVector.x,-n.widthVector.y,-n.widthVector.z,n.widthVector.x,-n.widthVector.y,-n.widthVector.z,n.widthVector.x,-n.widthVector.y,n.widthVector.z,-n.widthVector.x,-n.widthVector.y,n.widthVector.z,-n.widthVector.x,-n.widthVector.y,n.widthVector.z,n.widthVector.x,-n.widthVector.y,n.widthVector.z,n.widthVector.x,n.widthVector.y,n.widthVector.z,-n.widthVector.x,n.widthVector.y,n.widthVector.z,-n.widthVector.x,-n.widthVector.y,-n.widthVector.z,n.widthVector.x,-n.widthVector.y,-n.widthVector.z,n.widthVector.x,n.widthVector.y,-n.widthVector.z,-n.widthVector.x,n.widthVector.y,-n.widthVector.z,n.widthVector.x,-n.widthVector.y,-n.widthVector.z,n.widthVector.x,-n.widthVector.y,n.widthVector.z,n.widthVector.x,n.widthVector.y,n.widthVector.z,n.widthVector.x,n.widthVector.y,-n.widthVector.z,-n.widthVector.x,-n.widthVector.y,-n.widthVector.z,-n.widthVector.x,-n.widthVector.y,n.widthVector.z,-n.widthVector.x,n.widthVector.y,n.widthVector.z,-n.widthVector.x,n.widthVector.y,-n.widthVector.z],l=r.Is.not.exist(n.color)?[]:[n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a],c=[o.T.Position.XYZ,o.T.Normal.XYZ,o.T.Texcoord0.XY],_=[new Float32Array(s),new Float32Array([0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),new Float32Array([0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1])];r.Is.exist(n.color)&&(c.push(o.T.Color0.XYZ),_.push(new Float32Array(l)));const h=i.T.Triangles;this.copyVertexData({attributes:_,attributeSemantics:c,primitiveMode:h,indices:new Uint16Array([3,1,0,2,1,3,4,5,7,7,5,6,8,9,11,11,9,10,15,13,12,14,13,15,19,17,16,18,17,19,20,21,23,23,21,22]),material:n.material})}}},3713:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(1845);class o extends i.W{}},9561:(e,t,n)=>{"use strict";n.d(t,{J:()=>r});var i=n(128),o=n(8696),a=n(3713);class r extends a.A{generate(e){var t,n,a,r,s,l;const c={width:null!==(t=e.width)&&void 0!==t?t:1,height:null!==(n=e.height)&&void 0!==n?n:1,uSpan:null!==(a=e.uSpan)&&void 0!==a?a:1,vSpan:null!==(r=e.vSpan)&&void 0!==r?r:1,isUVRepeat:null!==(s=e.isUVRepeat)&&void 0!==s&&s,flipTextureCoordinateY:null!==(l=e.flipTextureCoordinateY)&&void 0!==l&&l,material:e.material},_=[];for(let e=0;e<=c.vSpan;e++)for(let t=0;t<=c.uSpan;t++)_.push((t/c.uSpan-.5)*c.width),_.push(0),_.push((e/c.vSpan-.5)*c.height);const h=[];for(let e=0;e{"use strict";n.d(t,{BH:()=>c,IM:()=>a,Qo:()=>_,V_:()=>s,Y1:()=>r,Yx:()=>l,aK:()=>i,xz:()=>o});const i=3,o=10,a=2,r=0,s=i,l=i+o,c=i+o+a,_=32},817:(e,t,n)=>{"use strict";n.d(t,{q:()=>h});var i=n(8082),o=n(8696),a=n(128),r=n(1845),s=n(2471),l=n(6214),c=n(7973),_=n(4690);class h extends i.t{constructor(e){super(e)}get isSetup(){return null!=this.__topEntity}_setup(){if(this.__toSkipSetup())return;this.__topEntity=c._.createMeshEntity(),this.__topEntity.tryToSetUniqueName(`AABBGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph());const e=this.__topEntity.tryToGetMesh();h.__mesh=new l.K,h.__mesh.addPrimitive(h.generatePrimitive()),e.setMesh(h.__mesh),this.setGizmoTag()}static generatePrimitive(){const e=new Uint32Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,3,3,7,7,4,4,0,1,2,2,6,6,5,5,1,0,1,1,5,5,4,4,0,3,2,2,6,6,7,7,3]),t=new Float32Array([-1,-1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,1,1]);return r.W.createPrimitive({indices:e,attributeSemantics:[a.T.Position.XYZ],attributes:[t],primitiveMode:o.T.Lines})}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph().worldAABB;this.__topEntity.getTransform().localPosition=e.centerPoint,this.__topEntity.getTransform().localScale=s.P.fromCopyArray([e.sizeX/2,e.sizeY/2,e.sizeZ/2])}_destroy(){_.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}}},8082:(e,t,n)=>{"use strict";n.d(t,{t:()=>a});var i=n(9002),o=n(8491);class a extends i.S{constructor(e){super(),this.__isVisible=!1,this.__target=e,this.setGizmoTag()}set isVisible(e){this.__setVisible(e)}get isVisible(){return this.__isVisible}__setVisible(e){this.__isVisible=e,this.__topEntity&&this.__topEntity.getSceneGraph().setVisibilityRecursively(e)}__toSkipSetup(){return!!this.isSetup||!!this.__target.matchTag("Being","gizmo")}setGizmoTag(){if(this.__topEntity){this.__topEntity.tryToSetTag({tag:"Being",value:"gizmo"}),this.__topEntity.tryToSetTag({tag:"Gizmo",value:"top"});const e=o.a.flattenHierarchy(this.__topEntity.getSceneGraph(),!1);for(const t of e)t.entity.tryToSetTag({tag:"Being",value:"gizmo"});this.__topEntity.tryToSetTag({tag:"type",value:"background-assets"})}}}},7326:(e,t,n)=>{"use strict";n.d(t,{k:()=>h});var i=n(8696),o=n(128),a=n(6214),r=n(1845),s=n(7973),l=n(2471),c=n(4690),_=n(8082);class h extends _.t{constructor(e){super(e)}get isSetup(){return null!=this.__topEntity}set length(e){h.__length=e}get length(){return h.__length}_setup(){if(this.__toSkipSetup())return;this.__topEntity=s._.createMeshEntity(),this.__topEntity.tryToSetUniqueName(`LocatorGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph());const e=this.__topEntity.tryToGetMesh();h.__mesh=new a.K,h.__mesh.addPrimitive(h.__generatePrimitive()),e.setMesh(h.__mesh),this.setGizmoTag()}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph(),t=e.worldAABB;t.isVanilla()?this.__topEntity.getTransform().localPosition=e.position:this.__topEntity.getTransform().localPosition=t.centerPoint,this.__topEntity.getTransform().localScale=l.P.fromCopyArray([Math.max(1,t.isVanilla()?1:t.sizeX/2),Math.max(1,t.isVanilla()?1:t.sizeY/2),Math.max(1,t.isVanilla()?1:t.sizeZ/2)])}static __generatePrimitive(){const e=new Float32Array([0,0,0,this.__length,0,0,0,0,0,0,this.__length,0,0,0,0,0,0,this.__length]),t=new Float32Array([1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1]);return r.W.createPrimitive({attributeSemantics:[o.T.Position.XYZ,o.T.Color0.XYZ],attributes:[e,t],primitiveMode:i.T.Lines})}_destroy(){c.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}}h.__length=1},7859:(e,t,n)=>{"use strict";n.d(t,{q:()=>C});var i=n(224),o=n(2404),a=n(3258),r=n(5704),s=n(8696),l=n(4587),c=n(128),_=n(6214),h=n(1845),u=n(7597),d=n(9561),m=n(7973),f=n(1469),p=n(3032),v=n(1937),A=n(5467),y=n(2566),g=n(9207),x=n(2471),I=n(7192),b=n(4690),E=n(6098),T=n(4742),S=n(8082);class C extends S.t{constructor(e){super(e),this.__pickStatedPoint=x.P.zero(),this.__deltaPoint=x.P.one(),this.__targetScaleBackup=x.P.one(),this.__isPointerDown=!1,this.__onPointerDownFunc=this.__onPointerDown.bind(this),this.__onPointerMoveFunc=this.__onPointerMove.bind(this),this.__onPointerUpFunc=this.__onPointerUp.bind(this)}get isSetup(){return null!=this.__topEntity}set length(e){C.__length=e}get length(){return C.__length}set isVisible(e){if(!1===this.__isVisible&&!0===e){let e=window;if(b.Is.exist(a.D.eventTargetDom)&&(e=a.D.eventTargetDom),T.$t.register(T.K2,[{eventName:(0,T.EY)("start"),handler:this.__onPointerDownFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:(0,T.EY)("move"),handler:this.__onPointerMoveFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:(0,T.EY)("end"),handler:this.__onPointerUpFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:"pointerleave",handler:this.__onPointerUpFunc,options:{},classInstance:this,eventTargetDom:e}]),this.__topEntity.getSceneGraph().addChild(C.__groupEntity.getSceneGraph()),C.__latestTargetEntity=this.__target,"local"===C.__space){const e=this.__target.getSceneGraph();let t=g._.identity();b.Is.exist(e)&&(t=e.getQuaternionRecursively()),C.__groupEntity.getTransform().localRotation=t}else"world"===C.__space&&(C.__groupEntity.getTransform().localRotation=g._.fromCopy4(0,0,0,1))}!0===this.__isVisible&&!1===e&&(T.$t.unregister(T.K2),this.__deltaPoint=this.__target.getTransform().localScale,this.__pickStatedPoint=x.P.zero(),this.__isPointerDown=!1,this.__targetScaleBackup=this.__target.getTransform().localScale,C.__activeAxis="none"),T.$t.setActive(T.K2,e),this.__setVisible(e),C.__xyPlaneEntity.getSceneGraph().isVisible=!1,C.__yzPlaneEntity.getSceneGraph().isVisible=!1,C.__zxPlaneEntity.getSceneGraph().isVisible=!1}setSpace(e){C.__space=e,this.__isVisible&&(this.isVisible=!1,this.isVisible=!0)}get isVisible(){return this.__isVisible}_setup(){this.__toSkipSetup()||(this.__topEntity=m._.createGroupEntity(),this.__topEntity.tryToSetUniqueName(`ScaleGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph()),b.Is.not.exist(C.__xCubeEntity)&&(this.xMesh(),this.xEdgeMesh()),b.Is.not.exist(C.__yCubeEntity)&&(this.yMesh(),this.yEdgeMesh()),b.Is.not.exist(C.__zCubeEntity)&&(this.zMesh(),this.zEdgeMesh()),b.Is.not.exist(C.__xyPlaneEntity)&&this.xyPlane(),b.Is.not.exist(C.__yzPlaneEntity)&&this.yzPlane(),b.Is.not.exist(C.__zxPlaneEntity)&&this.zxPlane(),b.Is.not.exist(C.__groupEntity)&&(C.__groupEntity=m._.createGroupEntity()),this.__topEntity.getSceneGraph().addChild(C.__groupEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__xCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__yCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__zCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__xyPlaneEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__yzPlaneEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__zxPlaneEntity.getSceneGraph()),C.__latestTargetEntity=this.__target,this.setGizmoTag())}zxPlane(){C.__zxPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_zxPlane",!0),C.__zxPlaneEntity.getSceneGraph().isVisible=!1,C.__zxPlaneMaterial=f.G.createClassicUberMaterial(),C.__zxPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,.5,0,0])),C.__zxPlaneMaterial.alphaMode=r.F.Translucent,C.__zxPlaneMesh=new _.K,C.__zxPlanePrimitive=new d.J,C.__zxPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__zxPlaneMaterial}),C.__zxPlaneMesh.addPrimitive(C.__zxPlanePrimitive),C.__zxPlaneEntity.getMesh().setMesh(C.__zxPlaneMesh)}yzPlane(){C.__yzPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_yzPlane",!0),C.__yzPlaneEntity.getSceneGraph().isVisible=!1,C.__yzPlaneEntity.getTransform().localEulerAngles=x.P.fromCopy3(0,0,p.k.degreeToRadian(90)),C.__yzPlaneMaterial=f.G.createClassicUberMaterial(),C.__yzPlaneMaterial.alphaMode=r.F.Translucent,C.__yzPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([.5,0,0,0])),C.__yzPlaneMesh=new _.K,C.__yzPlanePrimitive=new d.J,C.__yzPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__yzPlaneMaterial}),C.__yzPlaneMesh.addPrimitive(C.__yzPlanePrimitive),C.__yzPlaneEntity.getMesh().setMesh(C.__yzPlaneMesh)}xyPlane(){C.__xyPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_xyPlane",!0),C.__xyPlaneEntity.getSceneGraph().isVisible=!1,C.__xyPlaneEntity.getTransform().localEulerAngles=x.P.fromCopy3(p.k.degreeToRadian(90),0,0),C.__xyPlaneMaterial=f.G.createClassicUberMaterial(),C.__xyPlaneMaterial.alphaMode=r.F.Translucent,C.__xyPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,0,.5,0])),C.__xyPlaneMesh=new _.K,C.__xyPlanePrimitive=new d.J,C.__xyPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__xyPlaneMaterial}),C.__xyPlaneMesh.addPrimitive(C.__xyPlanePrimitive),C.__xyPlaneEntity.getMesh().setMesh(C.__xyPlaneMesh)}zMesh(){C.__zCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_zCube",!0),C.__zCubeEntity.getTransform().localPosition=x.P.fromCopy3(0,0,1),C.__zCubeMesh=new _.K,C.__zCubeMaterial=f.G.createClassicUberMaterial(),C.__zCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,0,1,1])),C.__zCubePrimitive=new u.X,C.__zCubePrimitive.generate({widthVector:x.P.fromCopy3(.05,.05,1),material:C.__zCubeMaterial}),C.__zCubeMesh.addPrimitive(C.__zCubePrimitive),C.__zCubeEntity.getMesh().setMesh(C.__zCubeMesh)}yMesh(){C.__yCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_yCube",!0),C.__yCubeEntity.getTransform().localPosition=x.P.fromCopy3(0,1,0),C.__yCubeMesh=new _.K,C.__yCubeMaterial=f.G.createClassicUberMaterial(),C.__yCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,1,0,1])),C.__yCubePrimitive=new u.X,C.__yCubePrimitive.generate({widthVector:x.P.fromCopy3(.05,1,.05),material:C.__yCubeMaterial}),C.__yCubeMesh.addPrimitive(C.__yCubePrimitive),C.__yCubeEntity.getMesh().setMesh(C.__yCubeMesh)}xMesh(){C.__xCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_xCube",!0),C.__xCubeEntity.getTransform().localPosition=x.P.fromCopy3(1,0,0),C.__xCubeMesh=new _.K,C.__xCubeMaterial=f.G.createClassicUberMaterial(),C.__xCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([1,0,0,1])),C.__xCubePrimitive=new u.X,C.__xCubePrimitive.generate({widthVector:x.P.fromCopy3(1,.05,.05),material:C.__xCubeMaterial}),C.__xCubeMesh.addPrimitive(C.__xCubePrimitive),C.__xCubeEntity.getMesh().setMesh(C.__xCubeMesh)}xEdgeMesh(){C.__xEdgeCubeEntity=m._.createMeshEntity(),C.__xEdgeCubeEntity.tryToSetUniqueName("ScaleGizmo_xEdgeCube",!0),C.__xEdgeCubeEntity.getTransform().localPosition=x.P.fromCopy3(1,0,0),C.__xEdgeCubeMesh=new _.K,C.__xEdgeCubePrimitive=new u.X,C.__xEdgeCubePrimitive.generate({widthVector:x.P.fromCopy3(.1,.1,.1),material:C.__xCubeMaterial}),C.__xEdgeCubeMesh.addPrimitive(C.__xEdgeCubePrimitive),C.__xEdgeCubeEntity.getMesh().setMesh(C.__xEdgeCubeMesh),C.__xCubeEntity.addChild(C.__xEdgeCubeEntity.getSceneGraph())}yEdgeMesh(){C.__yEdgeCubeEntity=m._.createMeshEntity(),C.__yEdgeCubeEntity.tryToSetUniqueName("ScaleGizmo_yEdgeCube",!0),C.__yEdgeCubeEntity.getTransform().localPosition=x.P.fromCopy3(0,1,0),C.__yEdgeCubeMesh=new _.K,C.__yEdgeCubePrimitive=new u.X,C.__yEdgeCubePrimitive.generate({widthVector:x.P.fromCopy3(.1,.1,.1),material:C.__yCubeMaterial}),C.__yEdgeCubeMesh.addPrimitive(C.__yEdgeCubePrimitive),C.__yEdgeCubeEntity.getMesh().setMesh(C.__yEdgeCubeMesh),C.__yCubeEntity.addChild(C.__yEdgeCubeEntity.getSceneGraph())}zEdgeMesh(){C.__zEdgeCubeEntity=m._.createMeshEntity(),C.__zEdgeCubeEntity.tryToSetUniqueName("ScaleGizmo_zEdgeCube",!0),C.__zEdgeCubeEntity.getTransform().localPosition=x.P.fromCopy3(0,0,1),C.__zEdgeCubeMesh=new _.K,C.__zEdgeCubePrimitive=new u.X,C.__zEdgeCubePrimitive.generate({widthVector:x.P.fromCopy3(.1,.1,.1),material:C.__zCubeMaterial}),C.__zEdgeCubeMesh.addPrimitive(C.__zEdgeCubePrimitive),C.__zEdgeCubeEntity.getMesh().setMesh(C.__zEdgeCubeMesh),C.__zCubeEntity.addChild(C.__zEdgeCubeEntity.getSceneGraph())}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph(),t=e.worldAABB;t.isVanilla()?this.__topEntity.getTransform().localPosition=e.position:this.__topEntity.getTransform().localPosition=t.centerPoint;const n=Math.max(t.sizeX,t.sizeY,t.sizeZ);this.__topEntity.getTransform().localScale=x.P.fromCopyArray([Math.min(1,t.isVanilla()?1:n/2),Math.min(1,t.isVanilla()?1:n/2),Math.min(1,t.isVanilla()?1:n/2)]),this.__isPointerDown&&C.__latestTargetEntity===this.__target&&(this.__target.getTransform().localScale=this.__deltaPoint.clone())}static __generatePrimitive(){const e=new Float32Array([0,0,0,this.__length,0,0,0,0,0,0,this.__length,0,0,0,0,0,0,this.__length]),t=new Float32Array([1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1]);return h.W.createPrimitive({attributeSemantics:[c.T.Position.XYZ,c.T.Color0.XYZ],attributes:[e,t],primitiveMode:s.T.Lines})}__onPointerDown(e){e.preventDefault(),this.__isPointerDown=!0,C.__originalX=e.clientX,C.__originalY=e.clientY;const t=this.__target.getSceneGraph().matrix.getRotate(),n=x.P.one();let i=v.h.fromCopy9RowMajor(n.x*t.m00,n.x*t.m01,n.x*t.m02,n.y*t.m10,n.y*t.m11,n.y*t.m12,n.z*t.m20,n.z*t.m21,n.z*t.m22);"local"===C.__space?i=v.h.transpose(i):"world"===C.__space&&(i=y.x.identity());const{xResult:o,yResult:a,zResult:r}=C.castRay(e);o.result&&((0,E.dK)(o.data),this.__pickStatedPoint=i.multiplyVector(o.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="x"),a.result&&((0,E.dK)(a.data),this.__pickStatedPoint=i.multiplyVector(a.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="y"),r.result&&((0,E.dK)(r.data),this.__pickStatedPoint=i.multiplyVector(r.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="z"),C.__latestTargetEntity===this.__target&&(this.__targetScaleBackup=this.__target.getTransform().localScale)}__onPointerMove(e){if(e.preventDefault(),b.Is.false(this.__isPointerDown))return;const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current),_=this.__target.getSceneGraph().matrix.getRotate(),h=x.P.one();let u=v.h.fromCopy9RowMajor(h.x*_.m00,h.x*_.m01,h.x*_.m02,h.y*_.m10,h.y*_.m11,h.y*_.m12,h.z*_.m20,h.z*_.m21,h.z*_.m22);"local"===C.__space?u=v.h.transpose(u):"world"===C.__space&&(u=y.x.identity());let d=this.__pickStatedPoint.clone();if("x"===C.__activeAxis){const e=C.__xyPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=u.multiplyVector(e.data.position);d=x.P.fromCopy3(t.x,d.y,d.z),console.log("Move:"+e.data.position.toStringApproximately())}T.$t.disableCameraController()}if("y"===C.__activeAxis){const e=C.__xyPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=u.multiplyVector(e.data.position);d=x.P.fromCopy3(d.x,t.y,d.z),console.log("Move:"+e.data.position.toStringApproximately())}T.$t.disableCameraController()}if("z"===C.__activeAxis){const e=C.__yzPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=u.multiplyVector(e.data.position);d=x.P.fromCopy3(d.x,d.y,t.z),console.log("Move:"+e.data.position.toStringApproximately())}T.$t.disableCameraController()}const m=this.__target.getSceneGraph().worldAABB,f=x.P.multiply(x.P.subtract(d,this.__pickStatedPoint),1/m.lengthCenterToCorner);if(console.log(`${this.__target.uniqueName}: `+f.toStringApproximately()),"local"===C.__space)this.__deltaPoint=x.P.add(this.__targetScaleBackup,f),this.__deltaPoint=x.P.fromCopy3(Math.max(this.__deltaPoint.x,.01),Math.max(this.__deltaPoint.y,.01),Math.max(this.__deltaPoint.z,.01));else if("world"===C.__space){const e=A.J.fromCopyQuaternion(this.__target.getSceneGraph().getQuaternionRecursively()),t=A.J.multiply(e,A.J.scale(this.__targetScaleBackup)).getScale();let n=I.Lt.add(f,t);n=I.Lt.fromCopy4(Math.max(n.x,.01),Math.max(n.y,.01),Math.max(n.z,.01),Math.max(n.w,.01)),this.__deltaPoint=A.J.multiply(A.J.invert(e),A.J.scale(n)).getScale(),this.__deltaPoint=x.P.fromCopy3(Math.max(this.__deltaPoint.x,.01),Math.max(this.__deltaPoint.y,.01),Math.max(this.__deltaPoint.z,.01))}}__onPointerUp(e){e.preventDefault(),this.__isPointerDown=!1,C.__activeAxis="none",T.$t.enableCameraController(),C.__latestTargetEntity===this.__target&&(this.__targetScaleBackup=this.__target.getTransform().localScale)}static castRay2(e){const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current);return C.__groupEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0,[])}static castRay(e){const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current);return{xResult:C.__xCubeEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0),yResult:C.__yCubeEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0),zResult:C.__zCubeEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0)}}_destroy(){b.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}}C.__originalX=0,C.__originalY=0,C.__activeAxis="none",C.__space="world",C.__length=1},9244:(e,t,n)=>{"use strict";n.d(t,{u:()=>C});var i=n(224),o=n(2404),a=n(3258),r=n(5704),s=n(8696),l=n(4587),c=n(128),_=n(6214),h=n(1845),u=n(7597),d=n(9561),m=n(7973),f=n(1469),p=n(5467),v=n(3032),A=n(1937),y=n(2566),g=n(9207),x=n(2471),I=n(7192),b=n(4690),E=n(6098),T=n(4742),S=n(8082);class C extends S.t{constructor(e){super(e),this.__pickStatedPoint=x.P.zero(),this.__deltaPoint=x.P.zero(),this.__targetPointBackup=x.P.zero(),this.__isPointerDown=!1,this.__onPointerDownFunc=this.__onPointerDown.bind(this),this.__onPointerMoveFunc=this.__onPointerMove.bind(this),this.__onPointerUpFunc=this.__onPointerUp.bind(this)}get isSetup(){return null!=this.__topEntity}set length(e){C.__length=e}get length(){return C.__length}set isVisible(e){if(!1===this.__isVisible&&!0===e){let e=window;if(b.Is.exist(a.D.eventTargetDom)&&(e=a.D.eventTargetDom),T.$t.register(T.KQ,[{eventName:(0,T.EY)("start"),handler:this.__onPointerDownFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:(0,T.EY)("move"),handler:this.__onPointerMoveFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:(0,T.EY)("end"),handler:this.__onPointerUpFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:"pointerleave",handler:this.__onPointerUpFunc,options:{},classInstance:this,eventTargetDom:e}]),this.__topEntity.getSceneGraph().addChild(C.__groupEntity.getSceneGraph()),this.__latestTargetEntity=this.__target,"local"===C.__space){const e=this.__target.getSceneGraph().parent;let t=g._.identity();b.Is.exist(e)&&(t=e.getQuaternionRecursively()),C.__groupEntity.getTransform().localRotation=t}else"world"===C.__space&&(C.__groupEntity.getTransform().localRotation=g._.fromCopy4(0,0,0,1))}!0===this.__isVisible&&!1===e&&(T.$t.unregister(T.KQ),this.__deltaPoint=this.__target.getTransform().localPosition,this.__pickStatedPoint=x.P.zero(),this.__isPointerDown=!1,this.__targetPointBackup=this.__target.getTransform().localPosition,C.__activeAxis="none"),T.$t.setActive(T.KQ,e),this.__setVisible(e),C.__xyPlaneEntity.getSceneGraph().isVisible=!1,C.__yzPlaneEntity.getSceneGraph().isVisible=!1,C.__zxPlaneEntity.getSceneGraph().isVisible=!1}setSpace(e){C.__space=e,this.__isVisible&&(this.isVisible=!1,this.isVisible=!0)}get isVisible(){return this.__isVisible}_setup(){this.__toSkipSetup()||(this.__topEntity=m._.createGroupEntity(),this.__topEntity.tryToSetUniqueName(`TranslationGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph()),b.Is.not.exist(C.__xCubeEntity)&&(C.__xCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_xCube",!0),C.__xCubeEntity.getTransform().localPosition=x.P.fromCopy3(1,0,0),C.__xCubeMesh=new _.K,C.__xCubeMaterial=f.G.createClassicUberMaterial(),C.__xCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([1,0,0,1])),C.__xCubePrimitive=new u.X,C.__xCubePrimitive.generate({widthVector:x.P.fromCopy3(1,.05,.05),material:C.__xCubeMaterial}),C.__xCubeMesh.addPrimitive(C.__xCubePrimitive),C.__xCubeEntity.getMesh().setMesh(C.__xCubeMesh)),b.Is.not.exist(C.__yCubeEntity)&&(C.__yCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_yCube",!0),C.__yCubeEntity.getTransform().localPosition=x.P.fromCopy3(0,1,0),C.__yCubeMesh=new _.K,C.__yCubeMaterial=f.G.createClassicUberMaterial(),C.__yCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,1,0,1])),C.__yCubePrimitive=new u.X,C.__yCubePrimitive.generate({widthVector:x.P.fromCopy3(.05,1,.05),material:C.__yCubeMaterial}),C.__yCubeMesh.addPrimitive(C.__yCubePrimitive),C.__yCubeEntity.getMesh().setMesh(C.__yCubeMesh)),b.Is.not.exist(C.__zCubeEntity)&&(C.__zCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_zCube",!0),C.__zCubeEntity.getTransform().localPosition=x.P.fromCopy3(0,0,1),C.__zCubeMesh=new _.K,C.__zCubeMaterial=f.G.createClassicUberMaterial(),C.__zCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,0,1,1])),C.__zCubePrimitive=new u.X,C.__zCubePrimitive.generate({widthVector:x.P.fromCopy3(.05,.05,1),material:C.__zCubeMaterial}),C.__zCubeMesh.addPrimitive(C.__zCubePrimitive),C.__zCubeEntity.getMesh().setMesh(C.__zCubeMesh)),b.Is.not.exist(C.__xyPlaneEntity)&&(C.__xyPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_xyPlane",!0),C.__xyPlaneEntity.getSceneGraph().isVisible=!1,C.__xyPlaneEntity.getTransform().localEulerAngles=x.P.fromCopy3(v.k.degreeToRadian(90),0,0),C.__xyPlaneMaterial=f.G.createClassicUberMaterial(),C.__xyPlaneMaterial.alphaMode=r.F.Translucent,C.__xyPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,0,.5,0])),C.__xyPlaneMesh=new _.K,C.__xyPlanePrimitive=new d.J,C.__xyPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__xyPlaneMaterial}),C.__xyPlaneMesh.addPrimitive(C.__xyPlanePrimitive),C.__xyPlaneEntity.getMesh().setMesh(C.__xyPlaneMesh)),b.Is.not.exist(C.__yzPlaneEntity)&&(C.__yzPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_yzPlane",!0),C.__yzPlaneEntity.getSceneGraph().isVisible=!1,C.__yzPlaneEntity.getTransform().localEulerAngles=x.P.fromCopy3(0,0,v.k.degreeToRadian(90)),C.__yzPlaneMaterial=f.G.createClassicUberMaterial(),C.__yzPlaneMaterial.alphaMode=r.F.Translucent,C.__yzPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([.5,0,0,0])),C.__yzPlaneMesh=new _.K,C.__yzPlanePrimitive=new d.J,C.__yzPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__yzPlaneMaterial}),C.__yzPlaneMesh.addPrimitive(C.__yzPlanePrimitive),C.__yzPlaneEntity.getMesh().setMesh(C.__yzPlaneMesh)),b.Is.not.exist(C.__zxPlaneEntity)&&(C.__zxPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_zxPlane",!0),C.__zxPlaneEntity.getSceneGraph().isVisible=!1,C.__zxPlaneMaterial=f.G.createClassicUberMaterial(),C.__zxPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,.5,0,0])),C.__zxPlaneMaterial.alphaMode=r.F.Translucent,C.__zxPlaneMesh=new _.K,C.__zxPlanePrimitive=new d.J,C.__zxPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__zxPlaneMaterial}),C.__zxPlaneMesh.addPrimitive(C.__zxPlanePrimitive),C.__zxPlaneEntity.getMesh().setMesh(C.__zxPlaneMesh)),b.Is.not.exist(C.__groupEntity)&&(C.__groupEntity=m._.createGroupEntity()),this.__topEntity.getSceneGraph().addChild(C.__groupEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__xCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__yCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__zCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__xyPlaneEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__yzPlaneEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__zxPlaneEntity.getSceneGraph()),this.__latestTargetEntity=this.__target,this.setGizmoTag())}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph(),t=e.worldAABB;t.isVanilla()?this.__topEntity.getTransform().localPosition=e.position:this.__topEntity.getTransform().localPosition=t.centerPoint;const n=Math.max(t.sizeX,t.sizeY,t.sizeZ);this.__topEntity.getTransform().localScale=x.P.fromCopyArray([Math.min(1,t.isVanilla()?1:n/2),Math.min(1,t.isVanilla()?1:n/2),Math.min(1,t.isVanilla()?1:n/2)]),this.__isPointerDown&&this.__latestTargetEntity===this.__target&&(this.__target.getTransform().localPosition=this.__deltaPoint.clone())}static __generatePrimitive(){const e=new Float32Array([0,0,0,this.__length,0,0,0,0,0,0,this.__length,0,0,0,0,0,0,this.__length]),t=new Float32Array([1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1]);return h.W.createPrimitive({attributeSemantics:[c.T.Position.XYZ,c.T.Color0.XYZ],attributes:[e,t],primitiveMode:s.T.Lines})}__onPointerDown(e){e.preventDefault(),this.__isPointerDown=!0,C.__originalX=e.clientX,C.__originalY=e.clientY;const t=this.__target.getSceneGraph().parent;let n=p.J.identity();b.Is.exist(t)&&(n=t.matrixInner.getRotate());const i=x.P.one();let o=A.h.fromCopy9RowMajor(i.x*n.m00,i.x*n.m01,i.x*n.m02,i.y*n.m10,i.y*n.m11,i.y*n.m12,i.z*n.m20,i.z*n.m21,i.z*n.m22);"local"===C.__space?o=A.h.transpose(o):"world"===C.__space&&(o=y.x.identity());const{xResult:a,yResult:r,zResult:s}=C.castRay(e);a.result&&((0,E.dK)(a.data),this.__pickStatedPoint=o.multiplyVector(a.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="x"),r.result&&((0,E.dK)(r.data),this.__pickStatedPoint=o.multiplyVector(r.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="y"),s.result&&((0,E.dK)(s.data),this.__pickStatedPoint=o.multiplyVector(s.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="z"),this.__latestTargetEntity===this.__target&&(this.__targetPointBackup=this.__target.getTransform().localPosition)}__onPointerMove(e){if(e.preventDefault(),b.Is.false(this.__isPointerDown))return;const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current),_=this.__target.getSceneGraph().parent;let h=p.J.identity();b.Is.exist(_)&&(h=_.matrixInner.getRotate());const u=x.P.one();let d=A.h.fromCopy9RowMajor(u.x*h.m00,u.x*h.m01,u.x*h.m02,u.y*h.m10,u.y*h.m11,u.y*h.m12,u.z*h.m20,u.z*h.m21,u.z*h.m22);"local"===C.__space?d=A.h.transpose(d):"world"===C.__space&&(d=y.x.identity());let m=this.__pickStatedPoint.clone();if("x"===C.__activeAxis){const e=C.__xyPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=d.multiplyVector(e.data.position);m=x.P.fromCopy3(t.x,m.y,m.z)}T.$t.disableCameraController()}if("y"===C.__activeAxis){const e=C.__xyPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=d.multiplyVector(e.data.position);m=x.P.fromCopy3(m.x,t.y,m.z)}T.$t.disableCameraController()}if("z"===C.__activeAxis){const e=C.__yzPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=d.multiplyVector(e.data.position);m=x.P.fromCopy3(m.x,m.y,t.z)}T.$t.disableCameraController()}const f=x.P.subtract(m,this.__pickStatedPoint);if(0!==f.length())if(console.log(`${this.__target.uniqueName}: `+f.toStringApproximately()),"local"===C.__space)this.__deltaPoint=x.P.add(f,this.__targetPointBackup);else if("world"===C.__space){const e=this.__target.getSceneGraph().parent;let t=p.J.identity();b.Is.exist(e)&&(t=e.matrix.getRotate());const n=x.P.one();let i=A.h.fromCopy9RowMajor(n.x*t.m00,n.x*t.m01,n.x*t.m02,n.y*t.m10,n.y*t.m11,n.y*t.m12,n.z*t.m20,n.z*t.m21,n.z*t.m22);i=A.h.transpose(i);const o=x.P.add(this.__targetPointBackup,i.multiplyVector(f));this.__deltaPoint=o}}__onPointerUp(e){e.preventDefault(),this.__isPointerDown=!1,C.__activeAxis="none",T.$t.enableCameraController(),this.__latestTargetEntity===this.__target&&(this.__targetPointBackup=this.__target.getTransform().localPosition)}static castRay2(e){const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current);return C.__groupEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0,[])}static castRay(e){const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current);return{xResult:C.__xCubeEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0),yResult:C.__yCubeEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0),zResult:C.__zCubeEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0)}}_destroy(){b.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}}C.__originalX=0,C.__originalY=0,C.__activeAxis="none",C.__space="world",C.__length=1},6128:(e,t,n)=>{"use strict";n.d(t,{qf:()=>i.q,tb:()=>o.t,SU:()=>d,kl:()=>a.k,qu:()=>m.q,ug:()=>f.u});var i=n(817),o=n(8082),a=n(7326),r=n(8696),s=n(128),l=n(6214),c=n(1845),_=n(7973),h=n(2471),u=n(4690);class d extends o.t{constructor(e){super(e)}get isSetup(){return null!=this.__topEntity}_setup(){if(this.__toSkipSetup())return;this.__topEntity=_._.createMeshEntity(),this.__topEntity.tryToSetUniqueName(`LightGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph());const e=this.__topEntity.tryToGetMesh();d.__mesh=new l.K,d.__mesh.addPrimitive(d.__generatePrimitive()),e.setMesh(d.__mesh),this.setGizmoTag()}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph(),t=e.worldAABB;t.isVanilla()?this.__topEntity.getTransform().localPosition=e.position:this.__topEntity.getTransform().localPosition=t.centerPoint,this.__topEntity.getTransform().localRotation=e.rotation,this.__topEntity.getTransform().localScale=h.P.fromCopyArray([Math.max(1,t.isVanilla()?1:t.sizeX/2),Math.max(1,t.isVanilla()?1:t.sizeY/2),Math.max(1,t.isVanilla()?1:t.sizeZ/2)])}_destroy(){u.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}static __generatePrimitive(){const e=new Float32Array([0,0,0,0,0,-this.__length,0,0,-this.__length,-.1,0,.2-this.__length,-.1,0,.2-this.__length,0,0,.2-this.__length]);return c.W.createPrimitive({attributeSemantics:[s.T.Position.XYZ],attributes:[e],primitiveMode:r.T.Lines})}}d.__length=1;var m=n(7859),f=n(9244)},7973:(e,t,n)=>{"use strict";n.d(t,{_:()=>p});var i=n(1350),o=n(6692),a=n(8491),r=n(4097),s=n(9974),l=n(5496),c=n(1656),_=n(3826),h=n(224),u=n(6683);function d(){const e=i.g.createEntity();return i.g.addComponentToEntity(o.U,e)}function m(){const e=d();return i.g.addComponentToEntity(a.a,e)}function f(){const e=m();return i.g.addComponentToEntity(h.M,e)}const p=Object.freeze({createEntity:function(){return i.g.createEntity()},createTransformEntity:d,createGroupEntity:m,createMeshEntity:function(){const e=m(),t=i.g.addComponentToEntity(r.$,e);return i.g.addComponentToEntity(s.Y,t)},createCameraEntity:f,createCameraControllerEntity:function(){const e=f();return i.g.addComponentToEntity(l.S,e)},createSkeletalEntity:function(){const e=m();return i.g.addComponentToEntity(c.Y,e)},createLightEntity:function(){const e=m();return i.g.addComponentToEntity(u.r,e)},createLightWithCameraEntity:function(){const e=m(),t=i.g.addComponentToEntity(u.r,e),n=i.g.addComponentToEntity(h.M,t);return n.getCamera().isSyncToLight=!0,n},createPhysicsEntity:function(){const e=m();return i.g.addComponentToEntity(_.Z,e)}})},1469:(e,t,n)=>{"use strict";n.d(t,{G:()=>j});var i=n(3258),o=n(621),a=n(9764),r=n(8774),s=n(1554),l=n(2795),c=n(4507),_=n(8287),h=n(9604),u=n(7369),d=n(6863),m=n(9330),f=n(968),p=n(8283),v=n(4587),A=n(3999),y=n(810),g=n(5324),x=n(4255);const I={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec3 v_baryCentricCoord;\nout vec4 v_shadowCoord;\n\nuniform float u_pointSize; // initialValue=30\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0,0.1,0.01)\n\n// BiasMatrix * LightProjectionMatrix * LightViewMatrix, See: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/#basic-shader\nuniform mat4 u_depthBiasPV; // initialValue=(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n\n v_color = a_color;\n v_normal_inWorld = normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n v_shadowCoord = get_depthBiasPV(materialSID, 0) * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},b={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec3 v_baryCentricCoord;\nin vec4 v_shadowCoord;\n\nuniform int u_shadingModel; // initialValue=0\nuniform float u_alphaCutoff; // initialValue=0.01\nuniform float u_shininess; // initialValue=5\nuniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)\nuniform sampler2D u_diffuseColorTexture; // initialValue=(0,white)\nuniform sampler2D u_normalTexture; // initialValue=(1,blue)\nuniform vec4 u_diffuseColorTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_diffuseColorTextureRotation; // initialValue=0\nuniform sampler2DShadow u_depthTexture; // initialValue=(2,white)\n\n/* shaderity: @{renderTargetBegin} */\n\n// #pragma shaderity: require(../common/deliot2019SeamlessTexture.glsl)\n// uniform sampler2D u_tInvTexture; // initialValue=(1,white)\n// uniform vec3 u_colorSpaceOrigin;\n// uniform vec3 u_colorSpaceVector1;\n// uniform vec3 u_colorSpaceVector2;\n// uniform vec3 u_colorSpaceVector3;\n// uniform vec4 u_scaleTranslate;\n\n\nvec2 uvTransform(vec2 scale, vec2 offset, float rotation, vec2 uv) {\n mat3 translationMat = mat3(1,0,0, 0,1,0, offset.x, offset.y, 1);\n mat3 rotationMat = mat3(\n cos(rotation), -sin(rotation), 0,\n sin(rotation), cos(rotation), 0,\n 0, 0, 1\n );\n mat3 scaleMat = mat3(scale.x,0,0, 0,scale.y,0, 0,0,1);\n\n mat3 matrix = translationMat * rotationMat * scaleMat;\n vec2 uvTransformed = ( matrix * vec3(uv.xy, 1) ).xy;\n\n return uvTransformed;\n}\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n\n\n // diffuseColor (Considered to be premultiplied alpha)\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture (Considered to be premultiplied alpha)\n vec4 diffuseColorTextureTransform = get_diffuseColorTextureTransform(materialSID, 0);\n float diffuseColorTextureRotation = get_diffuseColorTextureRotation(materialSID, 0);\n vec2 diffuseColorTexUv = uvTransform(diffuseColorTextureTransform.xy, diffuseColorTextureTransform.zw, diffuseColorTextureRotation, v_texcoord_0);\n vec4 textureColor = texture(u_diffuseColorTexture, diffuseColorTexUv);\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n\n#ifdef RN_IS_ALPHAMODE_MASK\n float alphaCutoff = get_alphaCutoff(materialSID, 0);\n if (alpha < alphaCutoff) {\n discard;\n }\n#endif\n\n\n // Lighting\n vec3 shadingColor = vec3(0.0, 0.0, 0.0);\n#ifdef RN_IS_LIGHTING\n int shadingModel = get_shadingModel(materialSID, 0);\n if (shadingModel > 0) {\n\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */ ; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n // Diffuse\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, light.direction)) * light.attenuatedIntensity;\n\n float shininess = get_shininess(materialSID, 0);\n int shadingModel = get_shadingModel(materialSID, 0);\n\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n\n // Specular\n if (shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 halfVector = normalize(light.direction + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), shininess);\n } else if (shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 R = reflect(light.direction, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), shininess);\n }\n\n }\n\n shadingColor = diffuse + specular;\n } else {\n shadingColor = diffuseColor;\n }\n#else\n shadingColor = diffuseColor;\n#endif\n\n // Shadow\n#ifdef RN_USE_SHADOW_MAPPING\n float visibility = 1.0;\n float bias = 0.001;\n\n // Non PCF\n // if ( textureProj( u_depthTexture, v_shadowCoord ).r < (v_shadowCoord.z - bias) / v_shadowCoord.w ) {\n // visibility = 0.5;\n // }\n // shadingColor *= visibility;\n\n // Hardware PCF\n vec4 shadowCoord = v_shadowCoord;\n shadowCoord.z -= bias;\n shadingColor *= textureProj( u_depthTexture, shadowCoord ) * 0.5 + 0.5;\n\n // shadingColor.rgb = texture( u_depthTexture, v_shadowCoord.xy ).rrr;\n // shadingColor.rgb = vec3(v_shadowCoord.xy, 0.0);\n // shadingColor.rgb = vec3(diffuseColorTexUv, 0.0);\n // shadingColor.rgb = vec3(texture( u_depthTexture, diffuseColorTexUv).rrr);\n // shadingColor.rgb = texture( u_depthTexture, diffuseColorTexUv).rgb;\n // shadingColor.rgb = vec3(textureProj( u_depthTexture, v_shadowCoord ).z, 0.0, 0.0);\n alpha = 1.0;\n#endif\n\n rt0 = vec4(shadingColor * alpha, alpha);\n // rt0 = vec4(u_lightNumber, 0.0, 0.0, 1.0);\n // rt0 = vec4(1.0, 0.0, 0.0, 1.0);\n // rt0 = vec4(normal_inWorld*0.5+0.5, 1.0);\n\n#ifdef RN_IS_ALPHAMODE_OPAQUE\n rt0.a = 1.0;\n#elif defined(RN_IS_ALPHAMODE_MASK)\n rt0.a = 1.0;\n#endif\n\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},E={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec2 a_texcoord_1;\nin vec2 a_texcoord_2;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec2 v_texcoord_1;\nout vec2 v_texcoord_2;\nout vec3 v_baryCentricCoord;\nout float v_instanceInfo;\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n in vec4 a_tangent;\n out vec3 v_tangent_inWorld;\n out vec3 v_binormal_inWorld;\n#endif\n#ifdef RN_USE_SHADOW_MAPPING\n out vec4 v_shadowCoord;\n#endif\n\nuniform float u_pointSize; // initialValue=30, soloDatum=true\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0.0, 0.1, 0.01), soloDatum=true\n\n#ifdef RN_IS_MORPHING\nuniform int u_morphTargetNumber; // initialValue=0, isCustomSetting=true, soloDatum=true, needUniformInDataTextureMode=true\n// uniform int u_dataTextureMorphOffsetPosition[];\n// uniform int u_morphWeights[]; //\n#endif\n\n// BiasMatrix * LightProjectionMatrix * LightViewMatrix, See: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/#basic-shader\nuniform mat4 u_depthBiasPV; // initialValue=(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n v_color = a_color;\n\n bool isSkinning = false;\n\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n v_texcoord_0 = a_texcoord_0;\n v_texcoord_1 = a_texcoord_1;\n v_texcoord_2 = a_texcoord_2;\n\n #ifdef RN_USE_TANGENT_ATTRIBUTE\n v_tangent_inWorld = normalMatrix * a_tangent.xyz;\n v_binormal_inWorld = cross(v_tangent_inWorld, v_normal_inWorld) * a_tangent.w;\n #endif\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n\n v_instanceInfo = a_instanceInfo.x;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n#ifdef RN_USE_SHADOW_MAPPING\n v_shadowCoord = get_depthBiasPV(materialSID, 0) * v_position_inWorld;\n#endif\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},T={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec2 v_texcoord_1;\nin vec2 v_texcoord_2;\nin vec3 v_baryCentricCoord;\nin float v_instanceInfo;\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n in vec3 v_tangent_inWorld;\n in vec3 v_binormal_inWorld;\n#endif\n\n#ifdef RN_USE_SHADOW_MAPPING\nin vec4 v_shadowCoord;\n#endif\n\nuniform vec4 u_baseColorFactor; // initialValue=(1,1,1,1)\nuniform sampler2D u_baseColorTexture; // initialValue=(0,white)\nuniform vec2 u_metallicRoughnessFactor; // initialValue=(1,1)\nuniform sampler2D u_metallicRoughnessTexture; // initialValue=(1,white)\nuniform sampler2D u_occlusionTexture; // initialValue=(3,white)\nuniform vec3 u_emissiveFactor; // initialValue=(0,0,0)\nuniform sampler2D u_emissiveTexture; // initialValue=(4,white)\nuniform vec3 u_wireframe; // initialValue=(0,0,1)\nuniform bool u_isOutputHDR; // initialValue=0\nuniform bool u_makeOutputSrgb; // initialValue=1\nuniform vec4 u_iblParameter; // initialValue=(1,1,1,1), isCustomSetting=true\nuniform ivec2 u_hdriFormat; // initialValue=(0,0), isCustomSetting=true\nuniform samplerCube u_diffuseEnvTexture; // initialValue=(5,white), isCustomSetting=true\nuniform samplerCube u_specularEnvTexture; // initialValue=(6,white), isCustomSetting=true\nuniform vec4 u_baseColorTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_baseColorTextureRotation; // initialValue=0\nuniform vec4 u_metallicRoughnessTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_metallicRoughnessTextureRotation; // initialValue=0\nuniform int u_baseColorTexcoordIndex; // initialValue=0\nuniform int u_metallicRoughnessTexcoordIndex; // initialValue=0\nuniform int u_occlusionTexcoordIndex; // initialValue=0\nuniform vec4 u_occlusionTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_occlusionTextureRotation; // initialValue=0\nuniform int u_emissiveTexcoordIndex; // initialValue=0\nuniform vec4 u_emissiveTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_emissiveTextureRotation; // initialValue=0\nuniform float u_occlusionStrength; // initialValue=1\nuniform bool u_inverseEnvironment; // initialValue=true\nuniform float u_ior; // initialValue=1.5\n\n#ifdef RN_USE_NORMAL_TEXTURE\n uniform sampler2D u_normalTexture; // initialValue=(2,black)\n uniform vec4 u_normalTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_normalTextureRotation; // initialValue=(0)\n uniform int u_normalTexcoordIndex; // initialValue=(0)\n uniform float u_normalScale; // initialValue=(1)\n#endif\n\n#ifdef RN_USE_CLEARCOAT\n uniform float u_clearCoatFactor; // initialValue=0\n uniform float u_clearCoatRoughnessFactor; // initialValue=0\n uniform vec4 u_clearCoatTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_clearCoatTextureRotation; // initialValue=0\n uniform vec4 u_clearCoatRoughnessTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_clearCoatRoughnessTextureRotation; // initialValue=0\n uniform vec4 u_clearCoatNormalTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_clearCoatNormalTextureRotation; // initialValue=0\n uniform int u_clearCoatTexcoordIndex; // initialValue=(0)\n uniform int u_clearCoatRoughnessTexcoordIndex; // initialValue=(0)\n uniform int u_clearCoatNormalTexcoordIndex; // initialValue=(0)\n#endif\n\n#ifdef RN_USE_TRANSMISSION\n uniform float u_transmissionFactor; // initialValue=(0)\n#endif\n\n#ifdef RN_USE_VOLUME\n uniform float u_thicknessFactor; // initialValue=(0)\n uniform float u_attenuationDistance; // initialValue=(0.000001)\n uniform vec3 u_attenuationColor; // initialValue=(1,1,1)\n#endif\n\n#ifdef RN_USE_SHEEN\n uniform vec3 u_sheenColorFactor; // initialValue=(0,0,0)\n uniform float u_sheenRoughnessFactor; // initialValue=(0)\n#endif\n\n#ifdef RN_USE_SPECULAR\n uniform float u_specularFactor; // initialValue=1.0\n uniform vec3 u_specularColorFactor; // initialValue=(1,1,1)\n#endif\n\n#ifdef RN_USE_IRIDESCENCE\n uniform float u_iridescenceFactor; // initialValue=0\n uniform float u_iridescenceIor; // initialValue=1.3\n uniform float u_iridescenceThicknessMinimum; // initialValue=100\n uniform float u_iridescenceThicknessMaximum; // initialValue=400\n#endif\n\n#ifdef RN_USE_ANISOTROPY\n uniform float u_anisotropyStrength; // initialValue=0\n uniform vec2 u_anisotropyRotation; // initialValue=(1,0)\n#endif\n\nuniform float u_alphaCutoff; // initialValue=(0.01)\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float M_PI = 3.141592653589793;\nconst float RECIPROCAL_PI = 0.3183098861837907;\nconst float c_MinRoughness = 0.04;\n\nfloat angular_n_h(float NH) {\n return acos(NH);\n}\n\nfloat d_phong(float NH, float c1) {\n return pow(\n cos(acos(NH))\n , c1\n );\n}\n\n// this is from https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 envBRDFApprox( float Roughness, float NoV ) {\n const vec4 c0 = vec4(-1, -0.0275, -0.572, 0.022 );\n const vec4 c1 = vec4(1, 0.0425, 1.04, -0.04 );\n vec4 r = Roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( -9.28 * NoV ) ) * r.x + r.y;\n vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n return AB;\n}\n\n// GGX NDF\nfloat d_ggx(float NH, float alphaRoughness) {\n float roughnessSqr = alphaRoughness * alphaRoughness;\n float f = (roughnessSqr - 1.0) * NH * NH + 1.0;\n return roughnessSqr / (M_PI * f * f);\n}\n\nfloat d_torrance_reiz(float NH, float c3) {\n float CosSquared = NH*NH;\n float TanSquared = (1.0 - CosSquared)/CosSquared;\n //return (1.0/M_PI) * sq(c3/(CosSquared * (c3*c3 + TanSquared))); // gamma = 2, aka GGX\n return (1.0/sqrt(M_PI)) * (sq(c3)/(CosSquared * (c3*c3 + TanSquared))); // gamma = 1, D_Berry\n}\n\nfloat d_beckmann(float NH, float m) {\n float co = 1.0 / (4.0 * m * m * NH * NH * NH * NH);\n float expx = exp((NH * NH - 1.0) / (m * m * NH * NH));\n return co * expx;\n}\n\n// the same as glTF WebGL sample\n// https://github.com/KhronosGroup/glTF-WebGL-PBR/blob/88eda8c5358efe03128b72b6c5f5f6e5b6d023e1/shaders/pbr-frag.glsl#L188\n// That is, Unreal Engine based approach, but modified to use alphaRoughness (squared artist's roughness parameter),\n// and based on 'Separable Masking and Shadowing' approximation (propesed by Christophe Schlick)\n// https://www.cs.virginia.edu/~jdl/bib/appearance/analytic%20models/schlick94b.pdf\nfloat g_shielding(float NL, float NV, float alphaRoughness) {\n float r = alphaRoughness;\n\n // Local Shadowing using \"Schlick-Smith\" Masking Function\n float localShadowing = 2.0 * NL / (NL + sqrt(r * r + (1.0 - r * r) * (NL * NL)));\n\n // Local Masking using \"Schlick-Smith\" Masking Function\n float localMasking = 2.0 * NV / (NV + sqrt(r * r + (1.0 - r * r) * (NV * NV)));\n\n return localShadowing * localMasking;\n}\n\n// The code from https://google.github.io/filament/Filament.html#listing_approximatedspecularv\n// The idea is from [Heitz14] Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs.\nfloat v_SmithGGXCorrelated(float NL, float NV, float alphaRoughness) {\n float a2 = alphaRoughness * alphaRoughness;\n float GGXV = NL * sqrt(NV * NV * (1.0 - a2) + a2);\n float GGXL = NV * sqrt(NL * NL * (1.0 - a2) + a2);\n return 0.5 / (GGXV + GGXL);\n}\n\nfloat v_SmithGGXCorrelatedFast(float NL, float NV, float alphaRoughness) {\n float a = alphaRoughness;\n float GGXV = NL * (NV * (1.0 - a) + a);\n float GGXL = NV * (NL * (1.0 - a) + a);\n return 0.5 / (GGXV + GGXL);\n}\n\n// The Schlick Approximation to Fresnel\nfloat fresnel(float f0, float f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = x * x2 * x2;\n return f0 + (f90 - f0) * x5;\n}\n\nvec3 fresnel(vec3 f0, vec3 f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = x * x2 * x2;\n return f0 + (f90 - f0) * x5;\n}\n\nvec3 fresnel(vec3 f0, float f90, float VdotH)\n{\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = x * x2 * x2;\n return f0 + (f90 - f0) * x5;\n}\n\nfloat fresnel(float f0, float VdotH)\n{\n float f90 = 1.0; //clamp(50.0 * f0, 0.0, 1.0);\n return fresnel(f0, f90, VdotH);\n}\nvec3 fresnel(vec3 f0, float VdotH)\n{\n float f90 = 1.0; //clamp(50.0 * f0, 0.0, 1.0);\n return fresnel(f0, f90, VdotH);\n}\n\nvec3 cook_torrance_specular_brdf(float NH, float NL, float NV, vec3 F, float alphaRoughness) {\n float D = d_ggx(NH, alphaRoughness);\n float V = v_SmithGGXCorrelated(NL, NV, alphaRoughness);\n return vec3(D)*vec3(V)*F;\n// float G = g_shielding(NL, NV, alphaRoughness);\n// return vec3(D)*vec3(G)*F/vec3(4.0*NL*NV);\n\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#diffuse-brdf\nvec3 diffuse_brdf(vec3 albedo)\n{\n // (1/pi) * diffuseAlbedo\n return RECIPROCAL_PI * albedo;\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#specular-brdf\nfloat specular_brdf(float alphaRoughness, float NdotL, float NdotV, float NdotH) {\n float V = v_SmithGGXCorrelated(NdotL, NdotV, alphaRoughness);\n float D = d_ggx(NdotH, alphaRoughness);\n return V * D;\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_transmission#implementation-notes\nfloat specular_btdf(float alphaRoughness, float NdotL, float NdotV, float NdotHt) {\n float V = v_SmithGGXCorrelated(NdotL, NdotV, alphaRoughness);\n float D = d_ggx(NdotHt, alphaRoughness);\n return V * D;\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#fresnel\nvec3 conductor_fresnel(vec3 f0, float brdf, float alphaRoughness, float VdotH) {\n return vec3(brdf) * (f0.rgb + (vec3(1.0) - f0.rgb) * vec3(pow(1.0 - abs(VdotH), 5.0)));\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#fresnel\nvec3 fresnel_mix(float ior, vec3 base, vec3 layer, float VdotH) {\n float f0 = pow((1.0 - ior)/(1.0 + ior), 2.0);\n float fr = f0 + (1.0 - f0) * pow(1.0 - abs(VdotH), 5.0);\n return mix(base, layer, fr);\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#metal-brdf-and-dielectric-brdf\nvec3 metal_brdf(float perceptualRoughness, vec3 baseColor, float NdotL, float NdotV, float NdotH, float VdotH) {\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n return conductor_fresnel(\n baseColor,\n specular_brdf(alphaRoughness, NdotL, NdotV, NdotH),\n alphaRoughness,\n VdotH\n );\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#metal-brdf-and-dielectric-brdf\nvec3 dielectric_brdf(float ior, vec3 baseColor, float perceptualRoughness, float NdotL, float NdotV, float NdotH, float VdotH) {\n vec3 base = diffuse_brdf(baseColor);\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n vec3 layer = vec3(specular_brdf(alphaRoughness, NdotL, NdotV, NdotH));\n return fresnel_mix(ior, base, layer, VdotH);\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat#layering\nvec3 coated_material_s(vec3 base, float perceptualRoughness, float clearcoatRoughness, float clearcoat, float VdotNc, float LdotNc, float NdotHc) {\n float clearcoatFresnel = 0.04 + (1.0 - 0.04) * pow(1.0 - abs(VdotNc), 5.0);\n float clearcoatAlpha = clearcoatRoughness * clearcoatRoughness;\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n float D = d_ggx(NdotHc, clearcoatAlpha);\n float V = v_SmithGGXCorrelated(LdotNc, VdotNc, clearcoatAlpha);\n float f_clearcoat = clearcoatFresnel * D * V;\n\n // base = (f_diffuse + f_specular) in https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat#layering\n return base * vec3(1.0 - clearcoat * clearcoatFresnel) + vec3(f_clearcoat * clearcoat);\n}\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\nfloat srgbToLinear(float value) {\n return pow(value, 2.2);\n}\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nfloat linearToSrgb(float value) {\n return pow(value, 1.0/2.2);\n}\n\n// Roughness Dependent Fresnel\n// https://www.jcgt.org/published/0008/01/03/paper.pdf\nvec3 fresnelSchlickRoughness(vec3 F0, float cosTheta, float roughness)\n{\n vec3 Fr = max(vec3(1.0 - roughness), F0) - F0;\n vec3 k_S = F0 + Fr * pow(1.0 - cosTheta, 5.0);\n return k_S;\n}\n\nvec3 fresnelSchlickRoughnessWithIridescence(\n vec3 F0, float cosTheta, float roughness,\n vec3 iridescenceFresnel, float iridescence\n )\n{\n vec3 Fr = max(vec3(1.0 - roughness), F0) - F0;\n vec3 k_S = mix(F0 + Fr * pow(1.0 - cosTheta, 5.0), iridescenceFresnel, iridescence);\n return k_S;\n}\n\n// From: https://github.com/KhronosGroup/glTF-Sample-Viewer/blob/e2c7b8c8bd12916c1a387cd41f9ef061edc718df/source/Renderer/shaders/brdf.glsl#L44-L66\nvec3 Schlick_to_F0(vec3 f, vec3 f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = clamp(x * x2 * x2, 0.0, 0.9999);\n\n return (f - f90 * x5) / (1.0 - x5);\n}\n\nfloat Schlick_to_F0(float f, float f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = clamp(x * x2 * x2, 0.0, 0.9999);\n\n return (f - f90 * x5) / (1.0 - x5);\n}\n\nvec3 Schlick_to_F0(vec3 f, float VdotH) {\n return Schlick_to_F0(f, vec3(1.0), VdotH);\n}\n\nfloat Schlick_to_F0(float f, float VdotH) {\n return Schlick_to_F0(f, 1.0, VdotH);\n}\n\nvec3 normalBlendingUDN(sampler2D baseMap, sampler2D detailMap, vec2 baseUv, vec2 detailUv) {\n vec3 t = texture(baseMap, baseUv).xyz * 2.0 - 1.0;\n vec3 u = texture(detailMap, detailUv).xyz * 2.0 - 1.0;\n vec3 r = normalize(vec3(t.xy + u.xy, t.z));\n return r;\n}\n\nvec2 uvTransform(vec2 scale, vec2 offset, float rotation, vec2 uv) {\n mat3 translationMat = mat3(1,0,0, 0,1,0, offset.x, offset.y, 1);\n mat3 rotationMat = mat3(\n cos(rotation), -sin(rotation), 0,\n sin(rotation), cos(rotation), 0,\n 0, 0, 1\n );\n mat3 scaleMat = mat3(scale.x,0,0, 0,scale.y,0, 0,0,1);\n\n mat3 matrix = translationMat * rotationMat * scaleMat;\n vec2 uvTransformed = ( matrix * vec3(uv.xy, 1) ).xy;\n\n return uvTransformed;\n}\n\n// https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_volume/README.md#attenuation\nvec3 volumeAttenuation(vec3 attenuationColor, float attenuationDistance, vec3 intensity, float transmissionDistance)\n{\n if (attenuationDistance == 0.0) { // means Infinite distance\n return intensity; // No attenuation\n } else {\n vec3 attenuationCo = -log(attenuationColor) / attenuationDistance;\n vec3 attenuatedTransmittance = exp(-attenuationCo * transmissionDistance);\n return intensity * attenuatedTransmittance;\n }\n}\n\nfloat IsotropicNDFFiltering(vec3 normal, float roughness2) {\n float SIGMA2 = 0.15915494;\n float KAPPA = 0.18;\n vec3 dndu = dFdx(normal);\n vec3 dndv = dFdy(normal);\n float kernelRoughness2 = SIGMA2 * (dot(dndu, dndu) + dot(dndv, dndv));\n float clampedKernelRoughness2 = min(kernelRoughness2, KAPPA);\n float filteredRoughness2 = saturate(roughness2 + clampedKernelRoughness2);\n return filteredRoughness2;\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_anisotropy\nfloat D_GGX_anisotropic(float NdotH, float TdotH, float BdotH, float at, float ab)\n{\n float a2 = at * ab;\n vec3 f = vec3(ab * TdotH, at * BdotH, a2 * NdotH);\n float w2 = a2 / dot(f, f);\n return a2 * w2 * w2 / M_PI;\n}\n\nfloat V_GGX_anisotropic(float NdotL, float NdotV, float BdotV, float TdotV, float TdotL, float BdotL,\n float at, float ab)\n{\n float GGXV = NdotL * length(vec3(at * TdotV, ab * BdotV, NdotV));\n float GGXL = NdotV * length(vec3(at * TdotL, ab * BdotL, NdotL));\n float v = 0.5 / (GGXV + GGXL);\n return clamp(v, 0.0, 1.0);\n}\n\nvec3 BRDF_specularAnisotropicGGX(vec3 F, float alphaRoughness,\n float VdotH, float NdotL, float NdotV, float NdotH, float BdotV, float TdotV,\n float TdotL, float BdotL, float TdotH, float BdotH, float anisotropy)\n{\n float at = mix(alphaRoughness, 1.0, anisotropy * anisotropy);\n float ab = alphaRoughness;\n\n float V = V_GGX_anisotropic(NdotL, NdotV, BdotV, TdotV, TdotL, BdotL, at, ab);\n float D = D_GGX_anisotropic(NdotH, TdotH, BdotH, at, ab);\n\n return F * V * D;\n}\n\n#ifdef RN_USE_SHEEN\nfloat d_Charlie(float sheenPerceptualRoughness, float NoH) {\n // Estevez and Kulla 2017, \"Production Friendly Microfacet Sheen BRDF\"\n float alphaG = sheenPerceptualRoughness * sheenPerceptualRoughness;\n float invAlpha = 1.0 / alphaG;\n float cos2h = NoH * NoH;\n float sin2h = 1.0 - cos2h;\n return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen#sheen-visibility\nfloat sheenSimpleVisibility(float NdotL, float NdotV) {\n return 1.0 / (4.0 * (NdotL + NdotV - NdotL * NdotV));\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen#sheen-visibility\nfloat charlieL(float x, float alphaG) {\n float oneMinusAlphaSq = (1.0 - alphaG) * (1.0 - alphaG);\n float a = mix(21.5473, 25.3245, oneMinusAlphaSq);\n float b = mix(3.82987, 3.32435, oneMinusAlphaSq);\n float c = mix(0.19823, 0.16801, oneMinusAlphaSq);\n float d = mix(-1.97760, -1.27393, oneMinusAlphaSq);\n float e = mix(-4.32054, -4.85967, oneMinusAlphaSq);\n return a / (1.0 + b * pow(x, c)) + d * x + e;\n}\n\nfloat lambdaSheen(float cosTheta, float alphaG)\n{\n return abs(cosTheta) < 0.5 ? exp(charlieL(cosTheta, alphaG)) : exp(2.0 * charlieL(0.5, alphaG) - charlieL(1.0 - cosTheta, alphaG));\n}\n\nfloat sheenCharlieVisibility(float NdotL, float NdotV, float sheenPerceptualRoughness) {\n float alphaG = sheenPerceptualRoughness * sheenPerceptualRoughness;\n float sheenVisibility = 1.0 / ((1.0 + lambdaSheen(NdotV, alphaG) + lambdaSheen(NdotL, alphaG)) * (4.0 * NdotV * NdotL));\n return sheenVisibility;\n}\n\nvec3 sheen_brdf(vec3 sheenColor, float sheenPerceptualRoughness, float NdotL, float NdotV, float NdotH) {\n float sheenDistribution = d_Charlie(sheenPerceptualRoughness, NdotH);\n float sheenVisibility = sheenCharlieVisibility(NdotL, NdotV, sheenPerceptualRoughness);\n return sheenColor * sheenDistribution * sheenVisibility;\n}\n\n#endif\n#ifdef RN_USE_IRIDESCENCE\n\n// XYZ to REC709(sRGB) conversion matrix\nconst mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n);\n\n// Assume air interface for top\nvec3 Fresnel0ToIor(vec3 F0) {\n vec3 sqrtF0 = sqrt(F0);\n return (vec3(1.0) + sqrtF0) / (vec3(1.0) - sqrtF0);\n}\n\n// Conversion from IOR to F0\n// ior is a value between 1.0 and 3.0. 1.0 is air interface\nvec3 IorToFresnel0(vec3 transmittedIor, float incidentIor) {\n return sq((transmittedIor - vec3(incidentIor)) / (transmittedIor + vec3(incidentIor)));\n}\nfloat IorToFresnel0(float transmittedIor, float incidentIor) {\n return sq((transmittedIor - incidentIor) / (transmittedIor + incidentIor));\n}\n\n/**\n * From: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_iridescence#analytic-spectral-integration\n */\nvec3 evalSensitivity(float OPD, vec3 shift) {\n float phase = 2.0 * M_PI * OPD * 1.0e-9;\n vec3 val = vec3(5.4856e-13, 4.4201e-13, 5.2481e-13);\n vec3 pos = vec3(1.6810e+06, 1.7953e+06, 2.2084e+06);\n vec3 var = vec3(4.3278e+09, 9.3046e+09, 6.6121e+09);\n\n vec3 xyz = val * sqrt(2.0 * M_PI * var) * cos(pos * phase + shift) * exp(-(phase * phase) * var);\n xyz.x += 9.7470e-14 * sqrt(2.0 * M_PI * 4.5282e+09) * cos(2.2399e+06 * phase + shift[0]) * exp(-4.5282e+09 * (phase * phase));\n xyz /= 1.0685e-7;\n\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n}\n\n\n/**\n * From: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_iridescence#iridescence-fresnel\n */\nvec3 calcIridescence(float outsideIor, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0) {\n\n\n // iridescenceIor is the index of refraction of the thin-film layer\n // Force iridescenceIor -> outsideIOR when thinFilmThickness -> 0.0\n float iridescenceIor = mix(outsideIor, eta2, smoothstep(0.0, 0.03, thinFilmThickness));\n\n // To calculate the reflectances R12 and R23 at the viewing angles (angle hitting the thin-film layer)\n // and (angle after refraction in the thin-film) Schlick Fresnel is again used.\n // This approximation allows to eliminate the split into S and P polarization for the exact Fresnel equations.\n // can be calculated using Snell's law (with being outsideIor and being iridescenceIor):\n float sinTheta2Sq = sq(outsideIor / iridescenceIor) * (1.0 - sq(cosTheta1));\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n\n // Handle total internal reflection\n if (cosTheta2Sq < 0.0) {\n return vec3(1.0);\n }\n\n float cosTheta2 = sqrt(cosTheta2Sq);\n\n /// Material Interfaces\n // The iridescence model defined by Belcour/Barla models two material interfaces\n // - one from the outside to the thin-film layer\n // and another one from the thin-film to the base material. These two interfaces are defined as follows:\n\n // First interface (from the outside to the thin-film layer)\n float R0 = IorToFresnel0(iridescenceIor, outsideIor);\n float R12 = fresnel(R0, cosTheta1);\n float R21 = R12;\n float T121 = 1.0 - R12;\n\n // Second interface (from the thin-film to the base material)\n vec3 baseIor = Fresnel0ToIor(baseF0 + 0.0001); // guard against 1.0\n vec3 R1 = IorToFresnel0(baseIor, iridescenceIor);\n vec3 R23 = fresnel(R1, cosTheta2);\n\n // phi12 and phi23 define the base phases per interface and are approximated with 0.0\n // if the IOR of the hit material (iridescenceIor or baseIor) is higher\n // than the IOR of the previous material (outsideIor or iridescenceIor) and π otherwise.\n // Also here, polarization is ignored. float phi12 = 0.0;\n\n // First interface (from the outside to the thin-film layer)\n float phi12 = 0.0;\n if (iridescenceIor < outsideIor) phi12 = M_PI;\n float phi21 = M_PI - phi12;\n\n // Second interface (from the thin-film to the base material)\n vec3 phi23 = vec3(0.0);\n if (baseIor[0] < iridescenceIor) phi23[0] = M_PI;\n if (baseIor[1] < iridescenceIor) phi23[1] = M_PI;\n if (baseIor[2] < iridescenceIor) phi23[2] = M_PI;\n\n // OPD (optical path difference)\n float OPD = 2.0 * iridescenceIor * thinFilmThickness * cosTheta2;\n // Phase shift\n vec3 phi = vec3(phi21) + phi23;\n\n // Compound terms\n vec3 R123 = clamp(R12 * R23, 1e-5, 0.9999);\n vec3 r123 = sqrt(R123);\n vec3 Rs = (T121 * T121) * R23 / (vec3(1.0) - R123);\n\n // Reflectance term for m = 0 (DC term amplitude)\n vec3 C0 = R12 + Rs;\n vec3 I = C0;\n\n // Reflectance term for m > 0 (pairs of diracs)\n vec3 Cm = Rs - T121;\n for (int m = 1; m <= 2; ++m)\n {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity(float(m) * OPD, float(m) * phi);\n I += Cm * Sm;\n }\n\n vec3 F_iridescence = max(I, vec3(0.0));\n\n return F_iridescence;\n}\n\n#endif\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\n#ifdef RN_USE_SHADOW_MAPPING\n\nconst float g_minVariance = 0.00001;\n\nfloat chebyshevUpperBound(vec2 moments, float t) {\n float p = (t <= moments.x) ? 1.0 : 0.0;\n\n float variance = moments.y - sq(moments.x);\n variance = max(variance, g_minVariance);\n\n float d = t - moments.x;\n float p_max = variance / (variance + sq(d));\n\n return max(p, p_max);\n}\n\nfloat varianceShadowContribution(vec2 lightTexCoord, float distanceToLight) {\n vec2 moments = texture(u_depthTexture, lightTexCoord).xy;\n\n return chebyshevUpperBound(moments, distanceToLight);\n}\n\n#endif\n\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nvec3 get_irradiance(vec3 normal_forEnv, float materialSID, ivec2 hdriFormat) {\n vec4 diffuseTexel = texture(u_diffuseEnvTexture, normal_forEnv);\n\n vec3 irradiance;\n if (hdriFormat.x == 0) {\n // LDR_SRGB\n irradiance = srgbToLinear(diffuseTexel.rgb);\n }\n else if (hdriFormat.x == 3) {\n // RGBE\n irradiance = diffuseTexel.rgb * pow(2.0, diffuseTexel.a*255.0-128.0);\n }\n else {\n irradiance = diffuseTexel.rgb;\n }\n\n return irradiance;\n}\n\nfloat scaleForLod(float perceptualRoughness, float ior)\n{\n // Scale roughness to the range [0, 1],\n // ior=1.0 will be scale 0,\n // ior=1.5 will be scale 1.0,\n // ior=2 will be scale 1.0 (clamped)\n //\n\n float scale = clamp(ior * 2.0 - 2.0, 0.0, 1.0);\n return perceptualRoughness * scale;\n}\n\n#ifdef RN_USE_TRANSMISSION\nvec3 get_sample_from_backbuffer(float materialSID, vec2 sampleCoord, float perceptualRoughness, float ior) {\n ivec2 vrState = get_vrState(0.0, 0);\n vec2 backBufferTextureSize = get_backBufferTextureSize(materialSID, 0);\n float backBufferTextureLength = max(backBufferTextureSize.x, backBufferTextureSize.y);\n if (vrState.x == 1) { // For VR\n backBufferTextureLength = max(backBufferTextureSize.x / 2.0, backBufferTextureSize.y);\n sampleCoord.x = sampleCoord.x * 0.5;\n if (vrState.y == 1) { // For right eye\n sampleCoord.x += 0.5;\n }\n }\n float framebufferLod = log2(backBufferTextureLength) * scaleForLod(perceptualRoughness, ior);\n\n #ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n vec3 transmittedLight = texture2DLodEXT(u_backBufferTexture, sampleCoord, framebufferLod).rgb;\n #elif defined(GLSL_ES3)\n vec3 transmittedLight = textureLod(u_backBufferTexture, sampleCoord, framebufferLod).rgb;\n #else\n vec3 transmittedLight = texture(u_backBufferTexture, sampleCoord).rgb;\n #endif\n\n return transmittedLight;\n}\n#endif\n\nvec3 get_radiance(vec3 reflection, float lod, ivec2 hdriFormat) {\n #ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n vec4 specularTexel = textureCubeLodEXT(u_specularEnvTexture, reflection, lod);\n #elif defined(GLSL_ES3)\n vec4 specularTexel = textureLod(u_specularEnvTexture, reflection, lod);\n #else\n vec4 specularTexel = texture(u_specularEnvTexture, reflection);\n #endif\n\n// #pragma shaderity: require(./../common/fetchCubeTexture.glsl)\n\n vec3 radiance;\n if (hdriFormat.y == 0) {\n // LDR_SRGB\n radiance = srgbToLinear(specularTexel.rgb);\n }\n else if (hdriFormat.y == 3) {\n // RGBE\n radiance = specularTexel.rgb * pow(2.0, specularTexel.a*255.0-128.0);\n }\n else {\n radiance = specularTexel.rgb;\n }\n\n return radiance;\n}\n\n// from glTF Sample Viewer: https://github.com/KhronosGroup/glTF-Sample-Viewer\nvec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior)\n{\n vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior);\n mat4 worldMatrix = get_worldMatrix(v_instanceInfo);\n\n vec3 modelScale;\n modelScale.x = length(vec3(worldMatrix[0].xyz));\n modelScale.y = length(vec3(worldMatrix[1].xyz));\n modelScale.z = length(vec3(worldMatrix[2].xyz));\n\n return normalize(refractionVector) * thickness * modelScale;\n}\n\nstruct IblResult\n{\n vec3 specular;\n vec3 diffuse;\n vec3 FssEss;\n};\n\nIblResult getIBLRadianceGGX(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection)\n{\n // get radiance\n float mipCount = iblParameter.x;\n float lod = (perceptualRoughness * (mipCount - 1.0));\n vec3 radiance = get_radiance(reflection, lod, hdriFormat);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughness(F0, NdotV, perceptualRoughness);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Specular IBL\n vec3 specular = FssEss * radiance;\n\n // scale with user parameters\n float IBLSpecularContribution = iblParameter.z;\n specular *= IBLSpecularContribution;\n\n result.specular = specular;\n\n return result;\n}\n\nIblResult getIBLRadianceGGXWithIridescence(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection, vec3 iridescenceFresnel, float iridescence)\n{\n // get radiance\n float mipCount = iblParameter.x;\n float lod = (perceptualRoughness * (mipCount - 1.0));\n vec3 radiance = get_radiance(reflection, lod, hdriFormat);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughnessWithIridescence(F0, NdotV, perceptualRoughness, iridescenceFresnel, iridescence);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Specular IBL\n vec3 specular = FssEss * radiance;\n\n // scale with user parameters\n float IBLSpecularContribution = iblParameter.z;\n specular *= IBLSpecularContribution;\n\n result.specular = specular;\n\n return result;\n}\n\nIblResult getIBLRadianceLambertian(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection)\n{\n // get irradiance\n vec3 irradiance = get_irradiance(normal_forEnv, materialSID, hdriFormat);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughness(F0, NdotV, perceptualRoughness);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Multiple scattering, Fdez-Aguera's approach\n float Ems = (1.0 - (f_ab.x + f_ab.y));\n vec3 F_avg = F0 + (1.0 - F0) / 21.0;\n vec3 FmsEms = Ems * FssEss * F_avg / (1.0 - F_avg * Ems);\n vec3 k_D = albedo * (1.0 - FssEss - FmsEms);\n\n // Diffuse IBL\n vec3 diffuse = (FmsEms + k_D) * irradiance;\n\n // scale with user parameters\n float IBLDiffuseContribution = iblParameter.y;\n diffuse *= IBLDiffuseContribution;\n\n result.diffuse = diffuse;\n\n return result;\n}\n\nIblResult getIBLRadianceLambertianWithIridescence(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection, vec3 iridescenceF0, float iridescence)\n{\n // get irradiance\n vec3 irradiance = get_irradiance(normal_forEnv, materialSID, hdriFormat);\n\n // Use the maximum component of the iridescence Fresnel color\n // Maximum is used instead of the RGB value to not get inverse colors for the diffuse BRDF\n vec3 iridescenceF0Max = vec3(max(max(iridescenceF0.r, iridescenceF0.g), iridescenceF0.b));\n\n // Blend between base F0 and iridescence F0\n vec3 mixedF0 = mix(F0, iridescenceF0Max, iridescence);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughness(mixedF0, NdotV, perceptualRoughness);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Multiple scattering, Fdez-Aguera's approach\n float Ems = (1.0 - (f_ab.x + f_ab.y));\n vec3 F_avg = mixedF0 + (1.0 - mixedF0) / 21.0;\n vec3 FmsEms = Ems * FssEss * F_avg / (1.0 - F_avg * Ems);\n vec3 k_D = albedo * (1.0 - FssEss - FmsEms);\n\n // Diffuse IBL\n vec3 diffuse = (FmsEms + k_D) * irradiance;\n\n // scale with user parameters\n float IBLDiffuseContribution = iblParameter.y;\n diffuse *= IBLDiffuseContribution;\n\n result.diffuse = diffuse;\n\n return result;\n}\n\n#ifdef RN_USE_SHEEN\nvec3 sheenIBL(float NdotV, float sheenPerceptualRoughness, vec3 sheenColor, vec4 iblParameter, vec3 reflection, ivec2 hdriFormat)\n{\n float mipCount = iblParameter.x;\n float lod = (sheenPerceptualRoughness * (mipCount - 1.0));\n\n vec2 sheenLutUV = vec2(NdotV, sheenPerceptualRoughness);\n float brdf = texture(u_sheenLutTexture, sheenLutUV).b;\n vec3 sheenLight = get_radiance(reflection, lod, hdriFormat);\n float IBLSpecularContribution = iblParameter.z;\n sheenLight *= IBLSpecularContribution;\n\n return sheenLight * sheenColor * brdf;\n}\n#endif\n\nvec3 getNormalForEnv(mat3 rotEnvMatrix, vec3 normal_inWorld, float materialSID) {\n vec3 normal_forEnv = rotEnvMatrix * normal_inWorld;\n if (get_inverseEnvironment(materialSID, 0)) {\n normal_forEnv.x *= -1.0;\n }\n return normal_forEnv;\n}\n\nvec3 getReflection(mat3 rotEnvMatrix, vec3 viewDirection, vec3 normal_inWorld, float materialSID, float perceptualRoughness, float anisotropy, vec3 anisotropyDirection) {\n#ifdef RN_USE_ANISOTROPY\n\n float tangentRoughness = mix(perceptualRoughness, 1.0, anisotropy * anisotropy);\n vec3 anisotropicTangent = cross(anisotropyDirection, viewDirection);\n vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);\n float bendFactor = 1.0 - anisotropy * (1.0 - perceptualRoughness);\n float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor;\n vec3 bentNormal = normalize(mix(anisotropicNormal, normal_inWorld, bendFactorPow4));\n vec3 reflection = rotEnvMatrix * reflect(-viewDirection, bentNormal);\n#else\n vec3 reflection = rotEnvMatrix * reflect(-viewDirection, normal_inWorld);\n#endif\n if (get_inverseEnvironment(materialSID, 0)) {\n reflection.x *= -1.0;\n }\n return reflection;\n}\n\nvec3 IBLContribution(float materialSID, vec3 normal_inWorld, float NdotV, vec3 viewDirection,\n vec3 albedo, vec3 F0, float perceptualRoughness, float clearcoatRoughness, vec3 clearcoatNormal_inWorld,\n float clearcoat, float VdotNc, vec3 geomNormal_inWorld, float cameraSID, float transmission, vec3 v_position_inWorld,\n float thickness, vec3 sheenColor, float sheenRoughness, float albedoSheenScalingNdotV, float ior,\n vec3 iridescenceFresnel, vec3 iridescenceF0, float iridescence, float anisotropy, vec3 anisotropyDirection)\n{\n vec4 iblParameter = get_iblParameter(materialSID, 0);\n float rot = iblParameter.w + 3.1415;\n mat3 rotEnvMatrix = mat3(cos(rot), 0.0, -sin(rot), 0.0, 1.0, 0.0, sin(rot), 0.0, cos(rot));\n ivec2 hdriFormat = get_hdriFormat(materialSID, 0);\n\n vec3 normal_forEnv = getNormalForEnv(rotEnvMatrix, normal_inWorld, materialSID);\n vec3 reflection = getReflection(rotEnvMatrix, viewDirection, normal_inWorld, materialSID, perceptualRoughness, anisotropy, anisotropyDirection);\n\n // IBL\n #ifdef RN_USE_IRIDESCENCE\n IblResult baseRadianceResult = getIBLRadianceGGXWithIridescence(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection, iridescenceFresnel, iridescence);\n IblResult baseLambertianResult = getIBLRadianceLambertianWithIridescence(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection, iridescenceF0, iridescence);\n #else\n IblResult baseRadianceResult = getIBLRadianceGGX(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection);\n IblResult baseLambertianResult = getIBLRadianceLambertian(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection);\n #endif\n\n#ifdef RN_USE_TRANSMISSION\n vec3 refractedRay = getVolumeTransmissionRay(geomNormal_inWorld, viewDirection, thickness, ior);\n vec3 refractedRayFromVPosition = v_position_inWorld + refractedRay;\n vec4 ndcPoint = get_projectionMatrix(cameraSID, 0) * get_viewMatrix(cameraSID, 0) * vec4(refractedRayFromVPosition, 1.0);\n vec2 refractionCoords = ndcPoint.xy / ndcPoint.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec3 transmittedLight = get_sample_from_backbuffer(materialSID, refractionCoords, perceptualRoughness, ior);\n\n#ifdef RN_USE_VOLUME\n vec3 attenuationColor = get_attenuationColor(materialSID, 0);\n float attenuationDistance = get_attenuationDistance(materialSID, 0);\n transmittedLight = volumeAttenuation(attenuationColor, attenuationDistance, transmittedLight, length(refractedRay));\n#endif\n\n vec3 transmissionComp = (vec3(1.0) - baseRadianceResult.FssEss) * transmittedLight * albedo;\n vec3 diffuse = mix(baseLambertianResult.diffuse, transmissionComp, transmission);\n vec3 base = diffuse + baseRadianceResult.specular;\n#else\n vec3 base = baseLambertianResult.diffuse + baseRadianceResult.specular;\n#endif\n\n#ifdef RN_USE_SHEEN\n vec3 sheen = sheenIBL(NdotV, sheenRoughness, sheenColor, iblParameter, reflection, hdriFormat);\n vec3 color = sheen + base * albedoSheenScalingNdotV;\n#else\n vec3 color = base;\n#endif\n\n#ifdef RN_USE_CLEARCOAT\n float VdotNg = dot(geomNormal_inWorld, viewDirection);\n vec3 clearcoatNormal_forEnv = getNormalForEnv(rotEnvMatrix, normal_inWorld, materialSID);\n IblResult coatResult = getIBLRadianceGGX(materialSID, VdotNc, viewDirection, vec3(0.0), F0,\n clearcoatRoughness, iblParameter, hdriFormat, rotEnvMatrix, clearcoatNormal_forEnv, reflection);\n vec3 coatLayer = coatResult.specular;\n\n float clearcoatFresnel = 0.04 + (1.0 - 0.04) * pow(1.0 - abs(VdotNc), 5.0);\n vec3 coated = color * vec3(1.0 - clearcoat * clearcoatFresnel) + vec3(coatLayer * clearcoat);\n return coated;\n#else\n return color;\n#endif\n\n}\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvec2 getTexcoord(int texcoordIndex) {\n vec2 texcoord;\n if(texcoordIndex == 2){\n texcoord = v_texcoord_2;\n } else if(texcoordIndex == 1){\n texcoord = v_texcoord_1;\n }else{\n texcoord = v_texcoord_0;\n }\n return texcoord;\n}\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n mat3 getTBN(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord) {\n vec3 tangent_inWorld = normalize(v_tangent_inWorld);\n vec3 binormal_inWorld = normalize(v_binormal_inWorld);\n mat3 tbnMat_tangent_to_world = mat3(tangent_inWorld, binormal_inWorld, normal_inWorld);\n\n return tbnMat_tangent_to_world;\n }\n#else\n // This is based on http://www.thetenthplanet.de/archives/1180\n mat3 cotangent_frame(vec3 normal_inWorld, vec3 position, vec2 uv) {\n uv = gl_FrontFacing ? uv : -uv;\n\n // get edge vectors of the pixel triangle\n vec3 dp1 = dFdx(position);\n vec3 dp2 = dFdy(position);\n vec2 duv1 = dFdx(uv);\n vec2 duv2 = dFdy(uv);\n\n // solve the linear system\n vec3 dp2perp = cross(dp2, normal_inWorld);\n vec3 dp1perp = cross(normal_inWorld, dp1);\n vec3 tangent = dp2perp * duv1.x + dp1perp * duv2.x;\n vec3 bitangent = dp2perp * duv1.y + dp1perp * duv2.y;\n bitangent *= -1.0;\n\n // construct a scale-invariant frame\n float invMat = inversesqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));\n return mat3(tangent * invMat, bitangent * invMat, normal_inWorld);\n }\n\n mat3 getTBN(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord) {\n mat3 tbnMat_tangent_to_world = cotangent_frame(normal_inWorld, -viewVector, texcoord);\n\n return tbnMat_tangent_to_world;\n }\n#endif\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // View vector\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n vec3 viewVector = viewPosition - v_position_inWorld.xyz;\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n vec3 geomNormal_inWorld = normal_inWorld;\n vec4 normalTextureTransform = get_normalTextureTransform(materialSID, 0);\n float normalTextureRotation = get_normalTextureRotation(materialSID, 0);\n int normalTexcoordIndex = get_normalTexcoordIndex(materialSID, 0);\n vec2 normalTexcoord = getTexcoord(normalTexcoordIndex);\n vec2 normalTexUv = uvTransform(normalTextureTransform.xy, normalTextureTransform.zw, normalTextureRotation, normalTexcoord);\n mat3 TBN = getTBN(normal_inWorld, viewVector, normalTexUv);\n #ifdef RN_USE_NORMAL_TEXTURE\n vec3 normalTexValue = texture(u_normalTexture, normalTexUv).xyz;\n if(normalTexValue.b >= 128.0 / 255.0) {\n // normal texture is existence\n vec3 normalTex = normalTexValue * 2.0 - 1.0;\n float normalScale = get_normalScale(materialSID, 0);\n vec3 scaledNormal = normalize(normalTex * vec3(normalScale, normalScale, 1.0));\n normal_inWorld = normalize(TBN * scaledNormal);\n }\n #endif\n\n // BaseColorFactor\n vec3 baseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n vec4 baseColorFactor = get_baseColorFactor(materialSID, 0);\n if (v_color != baseColor && baseColorFactor.rgb != baseColor) {\n baseColor = v_color * baseColorFactor.rgb;\n alpha = baseColorFactor.a;\n } else if (v_color == baseColor) {\n baseColor = baseColorFactor.rgb;\n alpha = baseColorFactor.a;\n } else if (baseColorFactor.rgb == baseColor) {\n baseColor = v_color;\n } else {\n baseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // BaseColor (take account for BaseColorTexture)\n vec4 baseColorTextureTransform = get_baseColorTextureTransform(materialSID, 0);\n float baseColorTextureRotation = get_baseColorTextureRotation(materialSID, 0);\n int baseColorTexcoordIndex = get_baseColorTexcoordIndex(materialSID, 0);\n vec2 baseColorTexcoord = getTexcoord(baseColorTexcoordIndex);\n vec2 baseColorTexUv = uvTransform(baseColorTextureTransform.xy, baseColorTextureTransform.zw, baseColorTextureRotation, baseColorTexcoord);\n vec4 textureColor = texture(u_baseColorTexture, baseColorTexUv);\n baseColor *= srgbToLinear(textureColor.rgb);\n alpha *= textureColor.a;\n\n#ifdef RN_IS_ALPHAMODE_MASK\n float alphaCutoff = get_alphaCutoff(materialSID, 0);\n if (alpha < alphaCutoff) {\n discard;\n }\n#endif\n\n\n // NdotV\n vec3 viewDirection = normalize(viewVector);\n float NdotV = saturateEpsilonToOne(dot(normal_inWorld, viewDirection));\n\n#ifdef RN_USE_ANISOTROPY\n float anisotropy = get_anisotropyStrength(materialSID, 0);\n vec2 anisotropyRotation = get_anisotropyRotation(materialSID, 0);\n vec2 direction = anisotropyRotation;\n vec3 anisotropyTex = texture(u_anisotropyTexture, baseColorTexUv).rgb;\n direction = anisotropyTex.rg * 2.0 - vec2(1.0);\n direction = mat2(anisotropyRotation.x, anisotropyRotation.y, -anisotropyRotation.y, anisotropyRotation.x) * normalize(direction);\n anisotropy *= anisotropyTex.b;\n vec3 anisotropicT = normalize(TBN * vec3(direction, 0.0));\n vec3 anisotropicB = normalize(cross(geomNormal_inWorld, anisotropicT));\n float BdotV = dot(anisotropicB, viewDirection);\n float TdotV = dot(anisotropicT, viewDirection);\n#else\n float anisotropy = 0.0;\n vec3 anisotropicB = vec3(0.0, 0.0, 0.0);\n#endif\n\n // Clearcoat\n#ifdef RN_USE_CLEARCOAT\n float clearcoatFactor = get_clearCoatFactor(materialSID, 0);\n vec4 clearcoatTextureTransform = get_clearCoatTextureTransform(materialSID, 0);\n float clearcoatTextureRotation = get_clearCoatTextureRotation(materialSID, 0);\n int clearCoatTexcoordIndex = get_clearCoatTexcoordIndex(materialSID, 0);\n vec2 clearCoatTexcoord = getTexcoord(clearCoatTexcoordIndex);\n vec2 clearcoatTexUv = uvTransform(clearcoatTextureTransform.xy, clearcoatTextureTransform.zw, clearcoatTextureRotation, clearCoatTexcoord);\n float clearcoatTexture = texture(u_clearCoatTexture, clearcoatTexUv).r;\n float clearcoat = clearcoatFactor * clearcoatTexture;\n#else\n float clearcoat = 0.0;\n#endif // RN_USE_CLEARCOAT\n\n // Transmission\n#ifdef RN_USE_TRANSMISSION\n float transmissionFactor = get_transmissionFactor(materialSID, 0);\n float transmissionTexture = texture(u_transmissionTexture, baseColorTexUv).r;\n float transmission = transmissionFactor * transmissionTexture;\n // alpha *= transmission;\n#else\n float transmission = 0.0;\n#endif // RN_USE_TRANSMISSION\n\n#ifdef RN_IS_LIGHTING\n // Metallic & Roughness\n vec2 metallicRoughnessFactor = get_metallicRoughnessFactor(materialSID, 0);\n float perceptualRoughness = metallicRoughnessFactor.y;\n float metallic = metallicRoughnessFactor.x;\n\n vec4 metallicRoughnessTextureTransform = get_metallicRoughnessTextureTransform(materialSID, 0);\n float metallicRoughnessTextureRotation = get_metallicRoughnessTextureRotation(materialSID, 0);\n int metallicRoughnessTexcoordIndex = get_metallicRoughnessTexcoordIndex(materialSID, 0);\n vec2 metallicRoughnessTexcoord = getTexcoord(metallicRoughnessTexcoordIndex);\n vec2 metallicRoughnessTexUv = uvTransform(metallicRoughnessTextureTransform.xy, metallicRoughnessTextureTransform.zw, metallicRoughnessTextureRotation, metallicRoughnessTexcoord);\n vec4 ormTexel = texture(u_metallicRoughnessTexture, metallicRoughnessTexUv);\n perceptualRoughness = ormTexel.g * perceptualRoughness;\n metallic = ormTexel.b * metallic;\n\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n metallic = clamp(metallic, 0.0, 1.0);\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n // filter NDF for specular AA\n // https://jcgt.org/published/0010/02/02/\n float alphaRoughness2 = alphaRoughness * alphaRoughness;\n float filteredRoughness2 = IsotropicNDFFiltering(normal_inWorld, alphaRoughness2);\n perceptualRoughness = sqrt(sqrt(filteredRoughness2));\n\n#ifdef RN_USE_SPECULAR\n float specularTexture = texture(u_specularTexture, baseColorTexUv).a;\n float specular = get_specularFactor(materialSID, 0) * specularTexture;\n vec3 specularColorTexture = srgbToLinear(texture(u_specularTexture, baseColorTexUv).rgb);\n vec3 specularColor = get_specularColorFactor(materialSID, 0) * specularColorTexture;\n#else\n float specular = 1.0;\n vec3 specularColor = vec3(1.0, 1.0, 1.0);\n#endif // RN_USE_SPECULAR\n\n // F0, F90\n float ior = get_ior(materialSID, 0);\n float outsideIor = 1.0;\n vec3 dielectricSpecularF0 = min(\n ((ior - outsideIor) / (ior + outsideIor)) * ((ior - outsideIor) / (ior + outsideIor)) * specularColor,\n vec3(1.0)\n ) * specular;\n vec3 dielectricSpecularF90 = vec3(specular);\n vec3 F0 = mix(dielectricSpecularF0, baseColor.rgb, metallic);\n vec3 F90 = mix(dielectricSpecularF90, vec3(1.0), metallic);\n\n // Albedo\n vec3 black = vec3(0.0);\n vec3 albedo = mix(baseColor.rgb, black, metallic);\n\n rt0 = vec4(0.0, 0.0, 0.0, alpha);\n\n// Iridescence\n#ifdef RN_USE_IRIDESCENCE\n float iridescenceFactor = get_iridescenceFactor(materialSID, 0);\n float iridescenceTexture = texture(u_iridescenceTexture, baseColorTexUv).r;\n float iridescence = iridescenceFactor * iridescenceTexture;\n float iridescenceIor = get_iridescenceIor(materialSID, 0);\n float thicknessRatio = texture(u_iridescenceThicknessTexture, baseColorTexUv).r;\n float iridescenceThicknessMinimum = get_iridescenceThicknessMinimum(materialSID, 0);\n float iridescenceThicknessMaximum = get_iridescenceThicknessMaximum(materialSID, 0);\n float iridescenceThickness = mix(iridescenceThicknessMinimum, iridescenceThicknessMaximum, thicknessRatio);\n\n vec3 iridescenceFresnel = calcIridescence(1.0, iridescenceIor, NdotV, iridescenceThickness, F0);\n vec3 iridescenceF0 = Schlick_to_F0(iridescenceFresnel, NdotV);\n\n#else\n float iridescence = 0.0;\n vec3 iridescenceFresnel = vec3(0.0);\n vec3 iridescenceF0 = F0;\n#endif // RN_USE_IRIDESCENCE\n\n#ifdef RN_USE_CLEARCOAT\n // Clearcoat\n float clearcoatRoughnessFactor = get_clearCoatRoughnessFactor(materialSID, 0);\n int clearCoatRoughnessTexcoordIndex = get_clearCoatRoughnessTexcoordIndex(materialSID, 0);\n vec2 clearCoatRoughnessTexcoord = getTexcoord(clearCoatRoughnessTexcoordIndex);\n vec4 clearcoatRoughnessTextureTransform = get_clearCoatRoughnessTextureTransform(materialSID, 0);\n float clearcoatRoughnessTextureRotation = get_clearCoatRoughnessTextureRotation(materialSID, 0);\n vec2 clearcoatRoughnessTexUv = uvTransform(clearcoatRoughnessTextureTransform.xy, clearcoatRoughnessTextureTransform.zw, clearcoatRoughnessTextureRotation, clearCoatRoughnessTexcoord);\n float textureRoughnessTexture = texture(u_clearCoatRoughnessTexture, clearcoatRoughnessTexUv).g;\n float clearcoatRoughness = clearcoatRoughnessFactor * textureRoughnessTexture;\n\n int clearCoatNormalTexcoordIndex = get_clearCoatNormalTexcoordIndex(materialSID, 0);\n vec2 clearCoatNormalTexcoord = getTexcoord(clearCoatNormalTexcoordIndex);\n vec4 clearcoatNormalTextureTransform = get_clearCoatNormalTextureTransform(materialSID, 0);\n float clearcoatNormalTextureRotation = get_clearCoatNormalTextureRotation(materialSID, 0);\n vec2 clearcoatNormalTexUv = uvTransform(clearcoatNormalTextureTransform.xy, clearcoatNormalTextureTransform.zw, clearcoatNormalTextureRotation, clearCoatNormalTexcoord);\n vec3 textureNormal_tangent = texture(u_clearCoatNormalTexture, clearcoatNormalTexUv).xyz * vec3(2.0) - vec3(1.0);\n vec3 clearcoatNormal_inWorld = normalize(TBN * textureNormal_tangent);\n float VdotNc = saturateEpsilonToOne(dot(viewDirection, clearcoatNormal_inWorld));\n#else\n float clearcoatRoughness = 0.0;\n vec3 clearcoatNormal_inWorld = vec3(0.0);\n float VdotNc = 0.0;\n#endif // RN_USE_CLEARCOAT\n\n#ifdef RN_USE_VOLUME\n // Volume\n float thicknessFactor = get_thicknessFactor(materialSID, 0);\n float thicknessTexture = texture(u_thicknessTexture, baseColorTexUv).g;\n float attenuationDistance = get_attenuationDistance(materialSID, 0);\n vec3 attenuationColor = get_attenuationColor(materialSID, 0);\n float thickness = thicknessFactor * thicknessTexture;\n#else\n float thickness = 0.0;\n vec3 attenuationColor = vec3(0.0);\n float attenuationDistance = 0.000001;\n#endif // RN_USE_VOLUME\n\n#ifdef RN_USE_SHEEN\n // Sheen\n vec3 sheenColorFactor = get_sheenColorFactor(materialSID, 0);\n vec3 sheenColorTexture = texture(u_sheenColorTexture, baseColorTexUv).rgb;\n float sheenRoughnessFactor = get_sheenRoughnessFactor(materialSID, 0);\n float sheenRoughnessTexture = texture(u_sheenRoughnessTexture, baseColorTexUv).a;\n vec3 sheenColor = sheenColorFactor * sheenColorTexture;\n float sheenRoughness = clamp(sheenRoughnessFactor * sheenRoughnessTexture, 0.000001, 1.0);\n float albedoSheenScalingNdotV = 1.0 - max3(sheenColor) * texture(u_sheenLutTexture, vec2(NdotV, sheenRoughness)).r;\n#else\n vec3 sheenColor = vec3(0.0);\n float sheenRoughness = 0.000001;\n float albedoSheenScalingNdotV = 1.0;\n#endif // RN_USE_SHEEN\n\n // Lighting\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n // Fresnel\n vec3 halfVector = normalize(light.direction + viewDirection);\n float VdotH = dot(viewDirection, halfVector);\n vec3 F = fresnel(F0, F90, VdotH);\n\n float NdotL = saturateEpsilonToOne(dot(normal_inWorld, light.direction));\n\n // Diffuse\n vec3 diffuseBrdf = diffuse_brdf(albedo);\n vec3 pureDiffuse = (vec3(1.0) - F) * diffuseBrdf * vec3(NdotL) * light.attenuatedIntensity;\n\n#ifdef RN_USE_TRANSMISSION\n vec3 refractionVector = refract(-viewDirection, normal_inWorld, 1.0 / ior);\n Light transmittedLightFromUnderSurface = light;\n transmittedLightFromUnderSurface.pointToLight -= refractionVector;\n vec3 transmittedLightDirectionFromUnderSurface = normalize(transmittedLightFromUnderSurface.pointToLight);\n transmittedLightFromUnderSurface.direction = transmittedLightDirectionFromUnderSurface;\n\n vec3 Ht = normalize(viewDirection + transmittedLightFromUnderSurface.direction);\n float NdotHt = saturateEpsilonToOne(dot(normal_inWorld, Ht));\n float NdotLt = saturateEpsilonToOne(dot(normal_inWorld, transmittedLightFromUnderSurface.direction));\n\n vec3 transmittedContrib = (vec3(1.0) - F) * specular_btdf(alphaRoughness, NdotLt, NdotV, NdotHt) * albedo * transmittedLightFromUnderSurface.attenuatedIntensity;\n\n#ifdef RN_USE_VOLUME\n vec3 attenuationColor = get_attenuationColor(materialSID, 0);\n float attenuationDistance = get_attenuationDistance(materialSID, 0);\n transmittedContrib = volumeAttenuation(attenuationColor, attenuationDistance, transmittedContrib, length(transmittedLightFromUnderSurface.pointToLight));\n#endif // RN_USE_VOLUME\n\n vec3 diffuseContrib = mix(pureDiffuse, vec3(transmittedContrib), transmission);\n#else\n vec3 diffuseContrib = pureDiffuse;\n#endif // RN_USE_TRANSMISSION\n\n // Specular\n float NdotH = saturateEpsilonToOne(dot(normal_inWorld, halfVector));\n#ifdef RN_USE_ANISOTROPY\n float TdotL = dot(anisotropicT, light.direction);\n float BdotL = dot(anisotropicB, light.direction);\n float TdotH = dot(anisotropicT, halfVector);\n float BdotH = dot(anisotropicB, halfVector);\n vec3 specularContrib = BRDF_specularAnisotropicGGX(F, alphaRoughness, VdotH, NdotL, NdotV, NdotH, BdotV, TdotV, TdotL, BdotL, TdotH, BdotH, anisotropy) * vec3(NdotL) * light.attenuatedIntensity;\n#else\n vec3 specularContrib = cook_torrance_specular_brdf(NdotH, NdotL, NdotV, F, alphaRoughness) * vec3(NdotL) * light.attenuatedIntensity;\n#endif // RN_USE_ANISOTROPY\n // Base Layer\n vec3 baseLayer = diffuseContrib + specularContrib;\n\n#ifdef RN_USE_SHEEN\n // Sheen\n vec3 sheenContrib = sheen_brdf(sheenColor, sheenRoughness, NdotL, NdotV, NdotH) * NdotL * light.attenuatedIntensity;\n float albedoSheenScaling = min(\n albedoSheenScalingNdotV,\n 1.0 - max3(sheenColor) * texture(u_sheenLutTexture, vec2(NdotL, sheenRoughness)).r);\n vec3 color = sheenContrib + baseLayer * albedoSheenScaling;\n#else\n vec3 color = baseLayer;\n float albedoSheenScaling = 1.0;\n#endif // RN_USE_SHEEN\n\n#ifdef RN_USE_CLEARCOAT\n // Clear Coat Layer\n float NdotHc = saturateEpsilonToOne(dot(clearcoatNormal_inWorld, halfVector));\n float LdotNc = saturateEpsilonToOne(dot(light.direction, clearcoatNormal_inWorld));\n vec3 coated = coated_material_s(color, perceptualRoughness,\n clearcoatRoughness, clearcoat, VdotNc, LdotNc, NdotHc);\n rt0.xyz += coated;\n#else\n rt0.xyz += color;\n#endif // RN_USE_CLEARCOAT\n }\n\n#ifdef RN_USE_SHADOW_MAPPING\n float bias = 0.001;\n vec2 shadowCoord = v_shadowCoord.xy / v_shadowCoord.w;\n float shadowContribusion = 1.0;\n if (shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0) {\n shadowContribusion = varianceShadowContribution(shadowCoord, (v_shadowCoord.z - bias)/v_shadowCoord.w);\n }\n // rt0.rgb = rt0.rgb * (0.5 + shadowContribusion * 0.5);\n rt0.rgb = rt0.rgb * shadowContribusion;\n#endif\n\n vec3 ibl = IBLContribution(materialSID, normal_inWorld, NdotV, viewDirection,\n albedo, F0, perceptualRoughness, clearcoatRoughness, clearcoatNormal_inWorld,\n clearcoat, VdotNc, geomNormal_inWorld, cameraSID, transmission, v_position_inWorld.xyz, thickness,\n sheenColor, sheenRoughness, albedoSheenScalingNdotV, ior, iridescenceFresnel, iridescenceF0, iridescence, anisotropy, anisotropicB);\n\n int occlusionTexcoordIndex = get_occlusionTexcoordIndex(materialSID, 0);\n vec2 occlusionTexcoord = getTexcoord(occlusionTexcoordIndex);\n vec4 occlusionTextureTransform = get_occlusionTextureTransform(materialSID, 0);\n float occlusionTextureRotation = get_occlusionTextureRotation(materialSID, 0);\n vec2 occlusionTexUv = uvTransform(occlusionTextureTransform.xy, occlusionTextureTransform.zw, occlusionTextureRotation, occlusionTexcoord);\n float occlusion = texture(u_occlusionTexture, occlusionTexUv).r;\n float occlusionStrength = get_occlusionStrength(materialSID, 0);\n\n // Occlution to Indirect Lights\n rt0.xyz += mix(ibl, ibl * occlusion, occlusionStrength);\n#else\n rt0 = vec4(baseColor, alpha);\n#endif // RN_IS_LIGHTING\n\n // Emissive\n vec3 emissiveFactor = get_emissiveFactor(materialSID, 0);\n int emissiveTexcoordIndex = get_emissiveTexcoordIndex(materialSID, 0);\n vec2 emissiveTexcoord = getTexcoord(emissiveTexcoordIndex);\n vec4 emissiveTextureTransform = get_emissiveTextureTransform(materialSID, 0);\n float emissiveTextureRotation = get_emissiveTextureRotation(materialSID, 0);\n vec2 emissiveTexUv = uvTransform(emissiveTextureTransform.xy, emissiveTextureTransform.zw, emissiveTextureRotation, emissiveTexcoord);\n vec3 emissive = emissiveFactor * srgbToLinear(texture(u_emissiveTexture, emissiveTexUv).xyz);\n\n#ifdef RN_USE_CLEARCOAT\n vec3 coated_emissive = emissive * mix(vec3(1.0), vec3(0.04 + (1.0 - 0.04) * pow(1.0 - NdotV, 5.0)), clearcoat);\n rt0.xyz += coated_emissive;\n#else\n rt0.xyz += emissive;\n#endif // RN_USE_CLEARCOAT\n\n bool isOutputHDR = get_isOutputHDR(materialSID, 0);\n if(isOutputHDR){\n/* shaderity: @{renderTargetEnd} */\n\n return;\n }\n\n#ifdef RN_IS_ALPHAMODE_OPAQUE\n rt0.a = 1.0;\n#elif defined(RN_IS_ALPHAMODE_MASK)\n rt0.a = 1.0;\n#endif\n\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\n // rt0.rgb = vec3(texture(u_depthTexture, v_shadowCoord.xy/v_shadowCoord.w).r);\n\n // premultiplied alpha\n // rt0.rgb /= alpha;\n\nfloat makeOutputSrgb = float(get_makeOutputSrgb(materialSID, 0));\nrt0.rgb = mix(rt0.rgb, linearToSrgb(rt0.rgb), makeOutputSrgb);\n\nrt1 = rt0;\nrt2 = rt0;\nrt3 = rt0;\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var S=n(5757),C=n(4878);const w={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nout vec2 v_texcoord_0;\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n v_texcoord_0 = a_texcoord_0;\n}\n",shaderStage:"vertex",isFragmentShader:!1},R={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/**\n * This file contains source code provided by NVIDIA Corporation.\n * FXAA antialiasing is developed by NVIDIA.\n * The codes of this file is modified from original code to work on WebGL1.\n * The modification for GLSL 100 is referred from Three.js, https://github.com/mrdoob/three.js/blob/5ba4c25bcb74577e1b1e14906f345135610a94f3/examples/js/shaders/FXAAShader.js\n * The original FXAA code is https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/80e8ba8f5e8935821513207033490735dd3279d8/samples/es3-kepler/FXAA/FXAA3_11.h\n */\n\n//----------------------------------------------------------------------------------\n// File: es3-kepler\\FXAA/FXAA3_11.h\n// SDK Version: v3.00\n// Email: gameworks@nvidia.com\n// Site: http://developer.nvidia.com/\n//\n// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// * Neither the name of NVIDIA CORPORATION nor the names of its\n// contributors may be used to endorse or promote products derived\n// from this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 'AS IS' AND ANY\n// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//----------------------------------------------------------------------------------\n/*============================================================================\n NVIDIA FXAA 3.11 by TIMOTHY LOTTES\n============================================================================*/\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord_0;\n\nuniform sampler2D u_baseColorTexture; // initialValue=(0,white)\nuniform vec2 u_screenInfo; // initialValue=(0,0)\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\n\n\n #define FXAA_PC 1\n #define FXAA_QUALITYPRESET 39\n #define FXAA_GREEN_AS_LUMA 0\n #define FXAA_GLSL_100 1\n\n /*============================================================================\n INTEGRATION KNOBS\n ============================================================================*/\n //\n // FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE).\n // FXAA_360_OPT is a prototype for the new optimized 360 version.\n //\n // 1 = Use API.\n // 0 = Don't use API.\n //\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_PS3\n #define FXAA_PS3 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_360\n #define FXAA_360 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_360_OPT\n #define FXAA_360_OPT 0\n #endif\n /*==========================================================================*/\n #ifndef FXAA_PC\n //\n // FXAA Quality\n // The high quality PC algorithm.\n //\n #define FXAA_PC 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_PC_CONSOLE\n //\n // The console algorithm for PC is included\n // for developers targeting really low spec machines.\n // Likely better to just run FXAA_PC, and use a really low preset.\n //\n #define FXAA_PC_CONSOLE 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GLSL_120\n #define FXAA_GLSL_120 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GLSL_130\n #define FXAA_GLSL_130 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_3\n #define FXAA_HLSL_3 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_4\n #define FXAA_HLSL_4 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_5\n #define FXAA_HLSL_5 0\n #endif\n /*==========================================================================*/\n #ifndef FXAA_GREEN_AS_LUMA\n //\n // For those using non-linear color,\n // and either not able to get luma in alpha, or not wanting to,\n // this enables FXAA to run using green as a proxy for luma.\n // So with this enabled, no need to pack luma in alpha.\n //\n // This will turn off AA on anything which lacks some amount of green.\n // Pure red and blue or combination of only R and B, will get no AA.\n //\n // Might want to lower the settings for both,\n // fxaaConsoleEdgeThresholdMin\n // fxaaQualityEdgeThresholdMin\n // In order to insure AA does not get turned off on colors\n // which contain a minor amount of green.\n //\n // 1 = On.\n // 0 = Off.\n //\n #define FXAA_GREEN_AS_LUMA 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_EARLY_EXIT\n //\n // Controls algorithm's early exit path.\n // On PS3 turning this ON adds 2 cycles to the shader.\n // On 360 turning this OFF adds 10ths of a millisecond to the shader.\n // Turning this off on console will result in a more blurry image.\n // So this defaults to on.\n //\n // 1 = On.\n // 0 = Off.\n //\n #define FXAA_EARLY_EXIT 1\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_DISCARD\n //\n // Only valid for PC OpenGL currently.\n // Probably will not work when FXAA_GREEN_AS_LUMA = 1.\n //\n // 1 = Use discard on pixels which don't need AA.\n // For APIs which enable concurrent TEX+ROP from same surface.\n // 0 = Return unchanged color on pixels which don't need AA.\n //\n #define FXAA_DISCARD 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_FAST_PIXEL_OFFSET\n //\n // Used for GLSL 120 only.\n //\n // 1 = GL API supports fast pixel offsets\n // 0 = do not use fast pixel offsets\n //\n #ifdef GLEXT_gpu_shader4\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifdef GLNV_gpu_shader5\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifdef GLARB_gpu_shader5\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifndef FXAA_FAST_PIXEL_OFFSET\n #define FXAA_FAST_PIXEL_OFFSET 0\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GATHER4_ALPHA\n //\n // 1 = API supports gather4 on alpha channel.\n // 0 = API does not support gather4 on alpha channel.\n //\n #if (FXAA_HLSL_5 == 1)\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifdef GLARB_gpu_shader5\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifdef GLNV_gpu_shader5\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifndef FXAA_GATHER4_ALPHA\n #define FXAA_GATHER4_ALPHA 0\n #endif\n #endif\n\n /*============================================================================\n FXAA CONSOLE PS3 - TUNING KNOBS\n ============================================================================*/\n #ifndef FXAA_CONSOLEPS3_EDGE_SHARPNESS\n //\n // Consoles the sharpness of edges on PS3 only.\n // Non-PS3 tuning is done with shader input.\n //\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 4 and 8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n //\n // 8.0 is sharper\n // 4.0 is softer\n // 2.0 is really soft (good for vector graphics inputs)\n //\n #if 1\n #define FXAA_CONSOLEPS3_EDGE_SHARPNESS 8.0\n #endif\n #if 0\n #define FXAA_CONSOLEPS3_EDGE_SHARPNESS 4.0\n #endif\n #if 0\n #define FXAA_CONSOLEPS3_EDGE_SHARPNESS 2.0\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_CONSOLEPS3_EDGE_THRESHOLD\n //\n // Only effects PS3.\n // Non-PS3 tuning is done with shader input.\n //\n // The minimum amount of local contrast required to apply algorithm.\n // The console setting has a different mapping than the quality setting.\n //\n // This only applies when FXAA_EARLY_EXIT is 1.\n //\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 0.25 and 0.125.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n //\n // 0.125 leaves less aliasing, but is softer\n // 0.25 leaves more aliasing, and is sharper\n //\n #if 1\n #define FXAA_CONSOLEPS3_EDGE_THRESHOLD 0.125\n #else\n #define FXAA_CONSOLEPS3_EDGE_THRESHOLD 0.25\n #endif\n #endif\n\n /*============================================================================\n FXAA QUALITY - TUNING KNOBS\n ------------------------------------------------------------------------------\n NOTE the other tuning knobs are now in the shader function inputs!\n ============================================================================*/\n #ifndef FXAA_QUALITYPRESET\n //\n // Choose the quality preset.\n // This needs to be compiled into the shader as it effects code.\n // Best option to include multiple presets is to\n // in each shader define the preset, then include this file.\n //\n // OPTIONS\n // -----------------------------------------------------------------------\n // 10 to 15 - default medium dither (10=fastest, 15=highest quality)\n // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)\n // 39 - no dither, very expensive\n //\n // NOTES\n // -----------------------------------------------------------------------\n // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)\n // 13 = about same speed as FXAA 3.9 and better than 12\n // 23 = closest to FXAA 3.9 visually and performance wise\n // _ = the lowest digit is directly related to performance\n // _ = the highest digit is directly related to style\n //\n #define FXAA_QUALITYPRESET 12\n #endif\n\n\n /*============================================================================\n FXAA QUALITY - PRESETS\n ============================================================================*/\n\n /*============================================================================\n FXAA QUALITY - MEDIUM DITHER PRESETS\n ============================================================================*/\n #if(FXAA_QUALITYPRESET == 10)\n#define FXAA_QUALITYPS 3\n#define FXAA_QUALITYP0 1.5\n#define FXAA_QUALITYP1 3.0\n#define FXAA_QUALITYP2 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 11)\n#define FXAA_QUALITYPS 4\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 3.0\n#define FXAA_QUALITYP3 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 12)\n#define FXAA_QUALITYPS 5\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 4.0\n#define FXAA_QUALITYP4 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 13)\n#define FXAA_QUALITYPS 6\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 4.0\n#define FXAA_QUALITYP5 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 14)\n#define FXAA_QUALITYPS 7\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 4.0\n#define FXAA_QUALITYP6 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 15)\n#define FXAA_QUALITYPS 8\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 4.0\n#define FXAA_QUALITYP7 12.0\n#endif\n\n/*============================================================================\n FXAA QUALITY - LOW DITHER PRESETS\n============================================================================*/\n#if (FXAA_QUALITYPRESET == 20)\n#define FXAA_QUALITYPS 3\n#define FXAA_QUALITYP0 1.5\n#define FXAA_QUALITYP1 2.0\n#define FXAA_QUALITYP2 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 21)\n#define FXAA_QUALITYPS 4\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 22)\n#define FXAA_QUALITYPS 5\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 23)\n#define FXAA_QUALITYPS 6\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 24)\n#define FXAA_QUALITYPS 7\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 3.0\n#define FXAA_QUALITYP6 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 25)\n#define FXAA_QUALITYPS 8\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 4.0\n#define FXAA_QUALITYP7 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 26)\n#define FXAA_QUALITYPS 9\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 4.0\n#define FXAA_QUALITYP8 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 27)\n#define FXAA_QUALITYPS 10\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 4.0\n#define FXAA_QUALITYP9 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 28)\n#define FXAA_QUALITYPS 11\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 2.0\n#define FXAA_QUALITYP9 4.0\n#define FXAA_QUALITYP10 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 29)\n#define FXAA_QUALITYPS 12\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 2.0\n#define FXAA_QUALITYP9 2.0\n#define FXAA_QUALITYP10 4.0\n#define FXAA_QUALITYP11 8.0\n#endif\n\n/*============================================================================\n FXAA QUALITY - EXTREME QUALITY\n============================================================================*/\n#if (FXAA_QUALITYPRESET == 39)\n#define FXAA_QUALITYPS 12\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.0\n#define FXAA_QUALITYP2 1.0\n#define FXAA_QUALITYP3 1.0\n#define FXAA_QUALITYP4 1.0\n#define FXAA_QUALITYP5 1.5\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 2.0\n#define FXAA_QUALITYP9 2.0\n#define FXAA_QUALITYP10 4.0\n#define FXAA_QUALITYP11 8.0\n#endif\n\n\n\n/*============================================================================\n API PORTING\n============================================================================*/\n#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)\n#define FxaaBool bool\n#define FxaaDiscard discard\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 ivec2\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTex sampler2D\n#else\n#define FxaaBool bool\n#define FxaaDiscard clip(-1)\n#define FxaaFloat float\n#define FxaaFloat2 float2\n#define FxaaFloat3 float3\n#define FxaaFloat4 float4\n#define FxaaHalf half\n#define FxaaHalf2 half2\n#define FxaaHalf3 half3\n#define FxaaHalf4 half4\n#define FxaaSat(x) saturate(x)\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_GLSL_100 == 1)\n#define FxaaTexTop(t, p) texture(t, p, 0.0)\n#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r), 0.0)\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_GLSL_120 == 1)\n// Requires,\n// #version 120\n// And at least,\n// #extension GLEXT_gpu_shader4 : enable\n// (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)\n#define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)\n#if (FXAA_FAST_PIXEL_OFFSET == 1)\n#define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)\n#else\n#define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)\n#endif\n#if (FXAA_GATHER4_ALPHA == 1)\n// use #extension GLARB_gpu_shader5 : enable\n#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n#define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n#endif\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_GLSL_130 == 1)\n// Requires \"#version 130\" or better\n#define FxaaTexTop(t, p) textureLod(t, p, 0.0)\n#define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)\n#if (FXAA_GATHER4_ALPHA == 1)\n// use #extension GLARB_gpu_shader5 : enable\n#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n#define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n#endif\n#endif\n\n\n/*============================================================================\n GREEN AS LUMA OPTION SUPPORT FUNCTION\n============================================================================*/\n#if (FXAA_GREEN_AS_LUMA == 0)\n FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return dot(rgba.rgb, vec3(0.298912, 0.586611, 0.114478)); }\n // FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }\n#else\n FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\n#endif\n\n\n\n\n\n\n\n\n\n/*============================================================================\n FXAA3 QUALITY - PC\n============================================================================*/\n#if (FXAA_PC == 1)\n /*--------------------------------------------------------------------------*/\n FxaaFloat4 FxaaPixelShader(\n //\n // Use noperspective interpolation here (turn off perspective interpolation).\n // {xy} = center of pixel\n FxaaFloat2 pos,\n //\n // Used only for FXAA Console, and not used on the 360 version.\n // Use noperspective interpolation here (turn off perspective interpolation).\n // {xy} = upper left of pixel\n // {zw} = lower right of pixel\n FxaaFloat4 fxaaConsolePosPos,\n //\n // Input color texture.\n // {rgb_} = color in linear or perceptual color space\n // if (FXAA_GREEN_AS_LUMA == 0)\n // {_a} = luma in perceptual color space (not linear)\n FxaaTex tex,\n //\n // Only used on the optimized 360 version of FXAA Console.\n // For everything but 360, just use the same input here as for \"tex\".\n // For 360, same texture, just alias with a 2nd sampler.\n // This sampler needs to have an exponent bias of -1.\n FxaaTex fxaaConsole360TexExpBiasNegOne,\n //\n // Only used on the optimized 360 version of FXAA Console.\n // For everything but 360, just use the same input here as for \"tex\".\n // For 360, same texture, just alias with a 3nd sampler.\n // This sampler needs to have an exponent bias of -2.\n FxaaTex fxaaConsole360TexExpBiasNegTwo,\n //\n // Only used on FXAA Quality.\n // This must be from a constant/uniform.\n // {x_} = 1.0/screenWidthInPixels\n // {_y} = 1.0/screenHeightInPixels\n FxaaFloat2 fxaaQualityRcpFrame,\n //\n // Only used on FXAA Console.\n // This must be from a constant/uniform.\n // This effects sub-pixel AA quality and inversely sharpness.\n // Where N ranges between,\n // N = 0.50 (default)\n // N = 0.33 (sharper)\n // {x_} = -N/screenWidthInPixels\n // {_y} = -N/screenHeightInPixels\n // {z_} = N/screenWidthInPixels\n // {_w} = N/screenHeightInPixels\n FxaaFloat4 fxaaConsoleRcpFrameOpt,\n //\n // Only used on FXAA Console.\n // Not used on 360, but used on PS3 and PC.\n // This must be from a constant/uniform.\n // {x_} = -2.0/screenWidthInPixels\n // {_y} = -2.0/screenHeightInPixels\n // {z_} = 2.0/screenWidthInPixels\n // {_w} = 2.0/screenHeightInPixels\n FxaaFloat4 fxaaConsoleRcpFrameOpt2,\n //\n // Only used on FXAA Console.\n // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.\n // This must be from a constant/uniform.\n // {x_} = 8.0/screenWidthInPixels\n // {_y} = 8.0/screenHeightInPixels\n // {z_} = -4.0/screenWidthInPixels\n // {_w} = -4.0/screenHeightInPixels\n FxaaFloat4 fxaaConsole360RcpFrameOpt2,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITYSUBPIX define.\n // It is here now to allow easier tuning.\n // Choose the amount of sub-pixel aliasing removal.\n // This can effect sharpness.\n // 1.00 - upper limit (softer)\n // 0.75 - default amount of filtering\n // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)\n // 0.25 - almost off\n // 0.00 - completely off\n FxaaFloat fxaaQualitySubpix,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITYEDGE_THRESHOLD define.\n // It is here now to allow easier tuning.\n // The minimum amount of local contrast required to apply algorithm.\n // 0.333 - too little (faster)\n // 0.250 - low quality\n // 0.166 - default\n // 0.125 - high quality\n // 0.063 - overkill (slower)\n FxaaFloat fxaaQualityEdgeThreshold,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITYEDGE_THRESHOLD_MIN define.\n // It is here now to allow easier tuning.\n // Trims the algorithm from processing darks.\n // 0.0833 - upper limit (default, the start of visible unfiltered edges)\n // 0.0625 - high quality (faster)\n // 0.0312 - visible limit (slower)\n // Special notes when using FXAA_GREEN_AS_LUMA,\n // Likely want to set this to zero.\n // As colors that are mostly not-green\n // will appear very dark in the green channel!\n // Tune by looking at mostly non-green content,\n // then start at zero and increase until aliasing is a problem.\n FxaaFloat fxaaQualityEdgeThresholdMin,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLEEDGE_SHARPNESS define.\n // It is here now to allow easier tuning.\n // This does not effect PS3, as this needs to be compiled in.\n // Use FXAA_CONSOLEPS3_EDGE_SHARPNESS for PS3.\n // Due to the PS3 being ALU bound,\n // there are only three safe values here: 2 and 4 and 8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n // For all other platforms can be a non-power of two.\n // 8.0 is sharper (default!!!)\n // 4.0 is softer\n // 2.0 is really soft (good only for vector graphics inputs)\n FxaaFloat fxaaConsoleEdgeSharpness,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLEEDGE_THRESHOLD define.\n // It is here now to allow easier tuning.\n // This does not effect PS3, as this needs to be compiled in.\n // Use FXAA_CONSOLEPS3_EDGE_THRESHOLD for PS3.\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 1/4 and 1/8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n // The console setting has a different mapping than the quality setting.\n // Other platforms can use other values.\n // 0.125 leaves less aliasing, but is softer (default!!!)\n // 0.25 leaves more aliasing, and is sharper\n FxaaFloat fxaaConsoleEdgeThreshold,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLEEDGE_THRESHOLD_MIN define.\n // It is here now to allow easier tuning.\n // Trims the algorithm from processing darks.\n // The console setting has a different mapping than the quality setting.\n // This only applies when FXAA_EARLY_EXIT is 1.\n // This does not apply to PS3,\n // PS3 was simplified to avoid more shader instructions.\n // 0.06 - faster but more aliasing in darks\n // 0.05 - default\n // 0.04 - slower and less aliasing in darks\n // Special notes when using FXAA_GREEN_AS_LUMA,\n // Likely want to set this to zero.\n // As colors that are mostly not-green\n // will appear very dark in the green channel!\n // Tune by looking at mostly non-green content,\n // then start at zero and increase until aliasing is a problem.\n FxaaFloat fxaaConsoleEdgeThresholdMin,\n //\n // Extra constants for 360 FXAA Console only.\n // Use zeros or anything else for other platforms.\n // These must be in physical constant registers and NOT immedates.\n // Immedates will result in compiler un-optimizing.\n // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)\n FxaaFloat4 fxaaConsole360ConstDir\n ) {\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posM;\n posM.x = pos.x;\n posM.y = pos.y;\n #if (FXAA_GATHER4_ALPHA == 1)\n #if (FXAA_DISCARD == 0)\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #if (FXAA_GREEN_AS_LUMA == 0)\n #define lumaM rgbyM.w\n #else\n #define lumaM rgbyM.y\n #endif\n #endif\n #if (FXAA_GREEN_AS_LUMA == 0)\n FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);\n FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));\n #else\n FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);\n FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));\n #endif\n #if (FXAA_DISCARD == 1)\n #define lumaM luma4A.w\n #endif\n #define lumaE luma4A.z\n #define lumaS luma4A.x\n #define lumaSE luma4A.y\n #define lumaNW luma4B.w\n #define lumaN luma4B.z\n #define lumaW luma4B.x\n #else\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #if (FXAA_GREEN_AS_LUMA == 0)\n #define lumaM rgbyM.w\n #else\n #define lumaM rgbyM.y\n #endif\n #if (FXAA_GLSL_100 == 1)\n FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(0.0, 1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(1.0, 0.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(0.0, -1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));\n #else\n FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(0, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, 0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(0, -1), fxaaQualityRcpFrame.xy));\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n FxaaFloat maxSM = max(lumaS, lumaM);\n FxaaFloat minSM = min(lumaS, lumaM);\n FxaaFloat maxESM = max(lumaE, maxSM);\n FxaaFloat minESM = min(lumaE, minSM);\n FxaaFloat maxWN = max(lumaN, lumaW);\n FxaaFloat minWN = min(lumaN, lumaW);\n FxaaFloat rangeMax = max(maxWN, maxESM);\n FxaaFloat rangeMin = min(minWN, minESM);\n FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\n FxaaFloat range = rangeMax - rangeMin;\n FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\n FxaaBool earlyExit = range < rangeMaxClamped;\n /*--------------------------------------------------------------------------*/\n if (earlyExit)\n #if (FXAA_DISCARD == 1)\n FxaaDiscard;\n #else\n return rgbyM;\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_GATHER4_ALPHA == 0)\n #if (FXAA_GLSL_100 == 1)\n FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, -1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(1.0, 1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(1.0, -1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));\n #else\n FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n #endif\n #else\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n #endif\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNS = lumaN + lumaS;\n FxaaFloat lumaWE = lumaW + lumaE;\n FxaaFloat subpixRcpRange = 1.0 / range;\n FxaaFloat subpixNSWE = lumaNS + lumaWE;\n FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\n FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNESE = lumaNE + lumaSE;\n FxaaFloat lumaNWNE = lumaNW + lumaNE;\n FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\n FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNWSW = lumaNW + lumaSW;\n FxaaFloat lumaSWSE = lumaSW + lumaSE;\n FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\n FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\n FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\n FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\n FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\n FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\n /*--------------------------------------------------------------------------*/\n FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\n FxaaFloat lengthSign = fxaaQualityRcpFrame.x;\n FxaaBool horzSpan = edgeHorz >= edgeVert;\n FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\n /*--------------------------------------------------------------------------*/\n if (!horzSpan) lumaN = lumaW;\n if (!horzSpan) lumaS = lumaE;\n if (horzSpan) lengthSign = fxaaQualityRcpFrame.y;\n FxaaFloat subpixB = (subpixA * (1.0 / 12.0)) - lumaM;\n /*--------------------------------------------------------------------------*/\n FxaaFloat gradientN = lumaN - lumaM;\n FxaaFloat gradientS = lumaS - lumaM;\n FxaaFloat lumaNN = lumaN + lumaM;\n FxaaFloat lumaSS = lumaS + lumaM;\n FxaaBool pairN = abs(gradientN) >= abs(gradientS);\n FxaaFloat gradient = max(abs(gradientN), abs(gradientS));\n if (pairN) lengthSign = -lengthSign;\n FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posB;\n posB.x = posM.x;\n posB.y = posM.y;\n FxaaFloat2 offNP;\n offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n offNP.y = (horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n if (!horzSpan) posB.x += lengthSign * 0.5;\n if (horzSpan) posB.y += lengthSign * 0.5;\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posN;\n posN.x = posB.x - offNP.x * FXAA_QUALITYP0;\n posN.y = posB.y - offNP.y * FXAA_QUALITYP0;\n FxaaFloat2 posP;\n posP.x = posB.x + offNP.x * FXAA_QUALITYP0;\n posP.y = posB.y + offNP.y * FXAA_QUALITYP0;\n FxaaFloat subpixD = ((-2.0) * subpixC) + 3.0;\n FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\n FxaaFloat subpixE = subpixC * subpixC;\n FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\n /*--------------------------------------------------------------------------*/\n if (!pairN) lumaNN = lumaSS;\n FxaaFloat gradientScaled = gradient * 1.0 / 4.0;\n FxaaFloat lumaMM = lumaM - lumaNN * 0.5;\n FxaaFloat subpixF = subpixD * subpixE;\n FxaaBool lumaMLTZero = lumaMM < 0.0;\n /*--------------------------------------------------------------------------*/\n lumaEndN -= lumaNN * 0.5;\n lumaEndP -= lumaNN * 0.5;\n FxaaBool doneN = abs(lumaEndN) >= gradientScaled;\n FxaaBool doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP1;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP1;\n FxaaBool doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP1;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP1;\n /*--------------------------------------------------------------------------*/\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP2;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP2;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP2;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP2;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 3)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP3;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP3;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP3;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP3;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 4)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP4;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP4;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP4;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP4;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 5)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP5;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP5;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP5;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP5;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 6)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP6;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP6;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP6;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP6;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 7)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP7;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP7;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP7;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP7;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 8)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP8;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP8;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP8;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP8;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 9)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP9;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP9;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP9;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP9;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 10)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP10;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP10;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP10;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP10;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 11)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP11;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP11;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP11;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP11;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 12)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP12;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP12;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP12;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP12;\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n /*--------------------------------------------------------------------------*/\n FxaaFloat dstN = posM.x - posN.x;\n FxaaFloat dstP = posP.x - posM.x;\n if (!horzSpan) dstN = posM.y - posN.y;\n if (!horzSpan) dstP = posP.y - posM.y;\n /*--------------------------------------------------------------------------*/\n FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\n FxaaFloat spanLength = (dstP + dstN);\n FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\n FxaaFloat spanLengthRcp = 1.0 / spanLength;\n /*--------------------------------------------------------------------------*/\n FxaaBool directionN = dstN < dstP;\n FxaaFloat dst = min(dstN, dstP);\n FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\n FxaaFloat subpixG = subpixF * subpixF;\n FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\n FxaaFloat subpixH = subpixG * fxaaQualitySubpix;\n /*--------------------------------------------------------------------------*/\n FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\n FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\n if (!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\n if (horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\n #if (FXAA_DISCARD == 1)\n return FxaaTexTop(tex, posM);\n #else\n return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n #endif\n}\n/*==========================================================================*/\n#endif\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec2 screenInfo = get_screenInfo(materialSID, 0);\n rt0 = FxaaPixelShader(\n v_texcoord_0,\n vec4(0.0),\n u_baseColorTexture,\n u_baseColorTexture,\n u_baseColorTexture,\n 1.0 / screenInfo,\n vec4(0.0),\n vec4(0.0),\n vec4(0.0),\n 0.75,\n 0.166,\n 0.0833,\n 0.0,\n 0.0,\n 0.0,\n vec4(0.0)\n );\n rt0.a = 1.0;\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},P={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nout vec2 v_texcoord_0;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\nv_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},D={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord_0;\n\nuniform sampler2D u_baseColorTexture; // initialValue=(0,white)\nuniform bool u_enableLinearToSrgb; // initialValue=true\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nvec4 baseColor = texture(u_baseColorTexture, v_texcoord_0);\n\nif (get_enableLinearToSrgb(materialSID, 0)) {\n baseColor.rgb = linearToSrgb(baseColor.rgb);\n}\n\nrt0 = baseColor;\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},M={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nout vec2 v_texcoord_0;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\nv_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},N={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord_0;\n\nuniform sampler2DRect u_baseColorTexture; // initialValue=(0,white)\nuniform float u_count; // initialValue=0.0\nuniform float u_direction; // initialValue=0.0\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nfloat i = get_count(materialSID, 0);\nfloat dir = get_direction(materialSID, 0);\n\nrt0 = texture(u_baseColorTexture, gl_FragCoord.xy);\n\nif (dir > 0.0) {\n // horizontal\n rt0 += texture(u_baseColorTexture, vec2(gl_FragCoord.x + pow(2.0, i), gl_FragCoord.y));\n} else {\n // virtical\n rt0 += texture(u_baseColorTexture, vec2(gl_FragCoord.x, gl_FragCoord.y + pow(2.0, i)));\n}\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},B={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec3 v_baryCentricCoord;\n\nuniform float u_pointSize; // initialValue=30\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0,0.1,0.01)\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n\n v_color = a_color;\n v_normal_inWorld = normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},L={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec3 v_baryCentricCoord;\n\nuniform int u_shadingModel; // initialValue=0\nuniform float u_alphaCutoff; // initialValue=0.01\nuniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)\nuniform sampler2D u_diffuseColorTexture; // initialValue=(0,white)\nuniform sampler2D u_normalTexture; // initialValue=(1,blue)\nuniform vec4 u_diffuseColorTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_diffuseColorTextureRotation; // initialValue=0\n\n/* shaderity: @{renderTargetBegin} */\n\n\n\nvec2 uvTransform(vec2 scale, vec2 offset, float rotation, vec2 uv) {\n mat3 translationMat = mat3(1,0,0, 0,1,0, offset.x, offset.y, 1);\n mat3 rotationMat = mat3(\n cos(rotation), -sin(rotation), 0,\n sin(rotation), cos(rotation), 0,\n 0, 0, 1\n );\n mat3 scaleMat = mat3(scale.x,0,0, 0,scale.y,0, 0,0,1);\n\n mat3 matrix = translationMat * rotationMat * scaleMat;\n vec2 uvTransformed = ( matrix * vec3(uv.xy, 1) ).xy;\n\n return uvTransformed;\n}\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n\n\n // diffuseColor (Considered to be premultiplied alpha)\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture (Considered to be premultiplied alpha)\n vec4 diffuseColorTextureTransform = get_diffuseColorTextureTransform(materialSID, 0);\n float diffuseColorTextureRotation = get_diffuseColorTextureRotation(materialSID, 0);\n vec2 diffuseColorTexUv = uvTransform(diffuseColorTextureTransform.xy, diffuseColorTextureTransform.zw, diffuseColorTextureRotation, v_texcoord_0);\n vec4 textureColor = texture(u_diffuseColorTexture, diffuseColorTexUv);\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n\n// #pragma shaderity: require(../common/alphaMask.glsl)\n\n // rt0 = vec4(diffuseColor * alpha, alpha);\n rt0 = vec4(1.0, 0.0, 0.0, 1.0);\n\n// #pragma shaderity: require(../common/setAlphaIfNotInAlphaBlendMode.glsl)\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n\n",shaderStage:"fragment",isFragmentShader:!0},F={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec2 a_texcoord_1;\nin vec2 a_texcoord_2;\nin vec4 a_joint;\nin vec4 a_weight;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\nuniform float u_pointSize; // initialValue=30, soloDatum=true\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0.0, 0.1, 0.01), soloDatum=true\n\n#ifdef RN_IS_MORPHING\nuniform int u_morphTargetNumber; // initialValue=0, isCustomSetting=true, soloDatum=true, needUniformInDataTextureMode=true\n#endif\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n v_color = a_color;\n\n bool isSkinning = false;\n\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n\n",shaderStage:"vertex",isFragmentShader:!1},G={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\n\nvoid main (){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float depth = gl_FragCoord.z;\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n\n rt0.x = depth; // M1\n rt0.y = sq(depth) + 0.25 * (sq(dx) + sq(dy)); // M2\n rt0.z = 0.0;\n rt0.w = 1.0;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n\n",shaderStage:"fragment",isFragmentShader:!0};var V=n(1813),z=n(903),O=n(2192);const U={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec3 a_position;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},k={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n// uniform bool isHorizontal; // initialValue=1\n// uniform int gaussianKernelSize; // initialValue=1\n// uniform float framebufferWidth; // initialValue=1\n// uniform sampler2D baseColorTexture; // initialValue=(0,white)\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n\tfloat tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n\n vec2 blurDirection;\n bool isHorizontal = get_isHorizontal(materialSID, 0);\n if(isHorizontal){\n blurDirection = vec2(1.0,0.0);\n }else{\n blurDirection = vec2(0.0,1.0);\n }\n\n vec4 color = vec4(0.0);\n int gaussianKernelSize = get_gaussianKernelSize(materialSID, 0);\n float minStrideLength = -float(gaussianKernelSize - 1) / 2.0;\n\n for(int i=0; i < 30; i++) {\n if(gaussianKernelSize == i) {\n break;\n }\n\n float strideLength = minStrideLength + float(i);\n vec2 stride = strideLength * blurDirection;\n\n float gaussianRatio = u_gaussianRatio[i];\n color += texture(u_baseColorTexture, (offset + stride) * tFrag) * gaussianRatio;\n }\n\n rt0 = color;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},Q={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec3 a_position;\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},W={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nfloat decodeRGBAToDepth(vec4 RGBA){\n const float rMask = 1.0;\n const float gMask = 1.0 / 255.0;\n const float bMask = 1.0 / (255.0 * 255.0);\n const float aMask = 1.0 / (255.0 * 255.0 * 255.0);\n float depth = dot(RGBA, vec4(rMask, gMask, bMask, aMask));\n return depth;\n}\n\nvec4 encodeDepthToRGBA(float depth){\n float r = depth;\n float g = fract(r * 255.0);\n float b = fract(g * 255.0);\n float a = fract(b * 255.0);\n float coef = 1.0 / 255.0;\n r -= g * coef;\n g -= b * coef;\n b -= a * coef;\n return vec4(r, g, b, a);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n\tfloat tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n\n vec2 blurDirection;\n bool isHorizontal = get_isHorizontal(materialSID, 0);\n if(isHorizontal){\n blurDirection = vec2(1.0,0.0);\n }else{\n blurDirection = vec2(0.0,1.0);\n }\n\n float depth = 0.0;\n int gaussianKernelSize = get_gaussianKernelSize(materialSID, 0);\n float minStrideLength = -float(gaussianKernelSize - 1) / 2.0;\n\n for(int i=0; i < 30; i++) {\n if(gaussianKernelSize == i) {\n break;\n }\n\n float strideLength = minStrideLength + float(i);\n vec2 stride = strideLength * blurDirection;\n float depthData = decodeRGBAToDepth(texture(u_baseColorTexture, (offset + stride) * tFrag));\n if(depthData > 1.0) depthData = 1.0;\n\n float gaussianRatio = u_gaussianRatio[i];\n depth += depthData * gaussianRatio;\n }\n\n rt0 = encodeDepthToRGBA(depth);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var X=n(3616);function q(e,t,n){let i=0,o=!1;do{const a=e+`__${i}`;if(o=z.r.isFullOrOverOfThisMaterialType(a),!o)return z.r.registerMaterial(a,t,n),z.r.createMaterial(a,t);i++}while(o);return z.r.isRegisteredMaterialType(e)||z.r.registerMaterial(e,t,n),z.r.createMaterial(e,t)}function H(e,t,n){return z.r.forceRegisterMaterial(e,t,n),z.r.createMaterial(e,t)}const j=Object.freeze({createMaterial:q,recreateMaterial:H,recreateCustomMaterial:function(e,t,{additionalName:n="",isSkinning:o=!0,isLighting:a=!1,isMorphing:r=!1,maxInstancesNumber:s=i.D.maxMaterialInstanceForEachType}={}){const c=`Custom_${n}_`+(r?"+morphing":"")+(o?"+skinning":"")+(a?"":"-lighting"),_=new l.f({name:c,isSkinning:o,isLighting:a,isMorphing:r,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:{code:e,shaderStage:"vertex",isFragmentShader:!1},pixelShader:{code:t,shaderStage:"fragment",isFragmentShader:!0},noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});return _.isSingleOperation=!0,H(c,_,s)},recreateShaderityMaterial:function(e,t,{additionalName:n="",maxInstancesNumber:o=i.D.maxMaterialInstanceForEachType}={}){const a=`Shaderity_${n}`,r=new p.u({name:a,vertexShaderityObj:e,pixelShaderityObj:t});return r.isSingleOperation=!0,H(a,r,o)},createEmptyMaterial:function(){const e=q("Empty",void 0,i.D.maxMaterialInstanceForEachType);return e.tryToSetUniqueName("EmptyMaterial",!0),e},createClassicUberMaterial:function({additionalName:e="",isSkinning:t=!0,isLighting:n=!1,isMorphing:o=!1,isShadow:a=!1,maxInstancesNumber:r=i.D.maxMaterialInstanceForEachType}={}){const s=`ClassicUber_${e}_`+(t?"+skinning":"")+(n?"":"-lighting"),c=new l.f({name:"ClassicUber",isSkinning:t,isLighting:n,isMorphing:o,isShadow:a,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:I,pixelShader:b,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});return c.isSingleOperation=!0,q(s,c,r)},createDepthMomentEncodeMaterial:function({additionalName:e="",isSkinning:t=!0,isMorphing:n=!1,maxInstancesNumber:o=i.D.maxMaterialInstanceForEachType}={}){const a=`DepthMomentEncode_${e}_`,r=new l.f({name:"DepthMomentEncode",isSkinning:t,isLighting:!1,isMorphing:n,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:F,pixelShader:G,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});return r.isSingleOperation=!0,q(a,r,o)},createFlatMaterial:function({additionalName:e="",isSkinning:t=!0,isMorphing:n=!1,maxInstancesNumber:o=i.D.maxMaterialInstanceForEachType}={}){const a=`Flat_${e}_`+(t?"+skinning":""),r=new l.f({name:"Flat",isSkinning:t,isLighting:!1,isMorphing:n,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:B,pixelShader:L,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});return r.isSingleOperation=!0,q(a,r,o)},createPbrUberMaterial:function({additionalName:e="",isMorphing:t=!0,isSkinning:n=!0,isLighting:o=!0,isClearCoat:a=!1,isTransmission:r=!1,isVolume:s=!1,isSheen:c=!1,isSpecular:_=!1,isIridescence:h=!1,isAnisotropy:u=!1,isShadow:d=!1,useTangentAttribute:m=!1,useNormalTexture:f=!0,maxInstancesNumber:p=i.D.maxMaterialInstanceForEachType}={}){const I=`PbrUber_${e}_`+(t?"+morphing":"")+(n?"+skinning":"")+(o?"":"-lighting")+(a?"+clearcoat":"")+(r?"+transmission":"")+(s?"+volume":"")+(c?"+sheen":"")+(_?"+specular":"")+(h?"+iridescence":"")+(u?"+anisotropy":"")+(m?"+tangentAttribute":"")+(f?"":"-normalTexture");let b=[];t&&(b=[{semantic:v.f5.DataTextureMorphOffsetPosition,componentType:A.r.Int,compositionType:y.d.ScalarArray,arrayLength:i.D.maxVertexMorphNumberInShader,stage:g.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new x.j(new Int32Array(i.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:v.f5.MorphWeights,componentType:A.r.Float,compositionType:y.d.ScalarArray,arrayLength:i.D.maxVertexMorphNumberInShader,stage:g.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new x.j(new Float32Array(i.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0}]);let S=8;a&&(b.push({semantic:v.f5.ClearCoatTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.ClearCoatRoughnessTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.ClearCoatNormalTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.$R],min:0,max:Number.MAX_VALUE})),r&&(b.push({semantic:v.f5.TransmissionTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.BackBufferTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.mg],min:0,max:Number.MAX_VALUE})),s&&b.push({semantic:v.f5.ThicknessTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.Dx],min:0,max:Number.MAX_VALUE}),c&&(b.push({semantic:v.f5.SheenColorTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,soloDatum:!1,initialValue:[S++,O.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.SheenRoughnessTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.SheenLutTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.NB],min:0,max:Number.MAX_VALUE})),_&&(b.push({semantic:v.f5.SpecularTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.SpecularColorTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.Dx],min:0,max:Number.MAX_VALUE})),h&&(b.push({semantic:v.f5.IridescenceTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.IridescenceThicknessTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.Dx],min:0,max:Number.MAX_VALUE})),u&&b.push({semantic:v.f5.AnisotropyTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!0,soloDatum:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.Lx],min:0,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0}),d&&b.push({semantic:v.f5.DepthTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:V.a.EveryTime,initialValue:[S++,O.Dx],min:0,max:Number.MAX_VALUE});const C=new l.f({name:"PbrUber",isSkinning:n,isLighting:o,isMorphing:t,isClearCoat:a,isTransmission:r,isVolume:s,isSheen:c,isSpecular:_,isIridescence:h,isAnisotropy:u,isShadow:d,useTangentAttribute:m,useNormalTexture:f,vertexShader:E,pixelShader:T,noUseCameraTransform:!1,additionalShaderSemanticInfo:b});return C.isSingleOperation=!0,q(I,C,p)},createEnvConstantMaterial:function({additionalName:e="",maxInstancesNumber:t=5,makeOutputSrgb:n=!0}={}){const i=`EnvConstant_${e}`,o=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!1,vertexShader:S.Z,pixelShader:C.Z,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});o.isSingleOperation=!0;const a=q(i,o,t);return a.setParameter(v.f5.MakeOutputSrgb,n?1:0),a},createFXAA3QualityMaterial:function({additionalName:e="",maxInstancesNumber:t=1,noUseCameraTransform:n=!1}={}){const i=`FXAA3Quality_${e}`,o=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:w,pixelShader:R,noUseCameraTransform:n,additionalShaderSemanticInfo:[]});return o.isSingleOperation=!0,q(i,o,t)},createDepthEncodeMaterial:function({additionalName:e="",isSkinning:t=!1,depthPow:n=1,maxInstancesNumber:i=10}={}){const a=`DepthEncode_${e}_`+(t?"+skinning":""),r=new o.Q(n,{isSkinning:t});return r.isSingleOperation=!0,q(a,r,i)},createShadowMapDecodeClassicSingleMaterial:function({additionalName:e="",isMorphing:t=!1,isSkinning:n=!1,isLighting:i=!0,isDebugging:o=!1,colorAttachmentsNumber:r=0,maxInstancesNumber:s=20}={},l){const c=`ShadowMapDecodeClassic_${e}_`+(n?"+skinning":"")+(i?"":"-lighting"),_=new a.R({isMorphing:t,isSkinning:n,isLighting:i,isDebugging:o,colorAttachmentsNumber:r},l);return _.isSingleOperation=!0,q(c,_,s)},createGammaCorrectionMaterial:function({additionalName:e="",maxInstancesNumber:t=1,noUseCameraTransform:n=!1}={}){const i=`GammaCorrection_${e}`,o=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:P,pixelShader:D,noUseCameraTransform:n,additionalShaderSemanticInfo:[]});return o.isSingleOperation=!0,q(i,o,t)},createSummedAreaTableMaterial:function({additionalName:e="",maxInstancesNumber:t=1,noUseCameraTransform:n=!1}={}){const i=`SummedAreaTable_${e}`,o=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:M,pixelShader:N,noUseCameraTransform:n,additionalShaderSemanticInfo:[]});return o.isSingleOperation=!0,q(i,o,t)},createVarianceShadowMapDecodeClassicSingleMaterial:function({additionalName:e="",isMorphing:t=!1,isSkinning:n=!1,isDebugging:i=!1,isLighting:o=!0,colorAttachmentsNumberDepth:a=0,colorAttachmentsNumberSquareDepth:r=0,depthCameraComponent:s,maxInstancesNumber:l=10},c){const _=`VarianceShadowMapDecodeShading_${e}_`+(t?"+morphing":"")+(n?"+skinning":"")+(o?"":"-lighting")+(i?"":"+debugging"),h=new f.Q({isMorphing:t,isSkinning:n,isLighting:o,isDebugging:i,colorAttachmentsNumberDepth:a,colorAttachmentsNumberSquareDepth:r,depthCameraComponent:s},c);return h.isSingleOperation=!0,q(_,h,l)},createEntityUIDOutputMaterial:function({additionalName:e="",maxInstancesNumber:t=10}={}){const n=`EntityUIDOutput_${e}`,i=new r.z;return i.isSingleOperation=!0,q(n,i,t)},createMToonMaterial:function({additionalName:e="",isMorphing:t=!1,isSkinning:n=!1,isLighting:o=!0,useTangentAttribute:a=!1,isOutline:r=!1,materialProperties:l,textures:c,samplers:_,debugMode:h,maxInstancesNumber:u=i.D.maxMaterialInstanceForEachType,makeOutputSrgb:d=!0}){const m=`MToon_${e}_`+(t?"+morphing":"")+(n?"+skinning":"")+(o?"":"-lighting")+(a?"+tangentAttribute":"")+(r?"-outline":""),f=new s.f(r,l,c,_,t,n,o,a,h,d);f.isSingleOperation=!0;const p=q(m,f,u);return f.setMaterialParameters(p,r),p},createFurnaceTestMaterial:function({additionalName:e="",maxInstancesNumber:t=1}={}){const n=`FurnaceTest_${e}`,i=new _.b;return i.isSingleOperation=!0,q(n,i,t)},createGaussianBlurForEncodedDepthMaterial:function({additionalName:e="",maxInstancesNumber:t=10,noUseCameraTransform:n=!1}={}){const i=`GaussianBlurForEncodedDepth_${e}`,o=[],a=new Float32Array(30);o.push({semantic:v.f5.IsHorizontal,componentType:A.r.Bool,compositionType:y.d.Scalar,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.FirstTimeOnly,soloDatum:!1,initialValue:X.Ru.fromCopyNumber(1),min:0,max:1},{semantic:v.f5.GaussianRatio,componentType:A.r.Float,compositionType:y.d.ScalarArray,arrayLength:30,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.FirstTimeOnly,soloDatum:!1,initialValue:new x.j(a),min:0,max:1,needUniformInDataTextureMode:!0},{semantic:v.f5.GaussianKernelSize,componentType:A.r.Int,compositionType:y.d.Scalar,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.FirstTimeOnly,soloDatum:!1,initialValue:X.Ru.fromCopyNumber(1),min:1,max:30},{semantic:v.f5.FramebufferWidth,componentType:A.r.Float,compositionType:y.d.Scalar,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.FirstTimeOnly,soloDatum:!1,initialValue:X.Ru.fromCopyNumber(1),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:v.f5.BaseColorTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.EveryTime,initialValue:[0,O.mg],min:0,max:Number.MAX_SAFE_INTEGER});const r=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,isClearCoat:!1,isTransmission:!1,isVolume:!1,isSheen:!1,isSpecular:!1,isIridescence:!1,isShadow:!1,useTangentAttribute:!1,useNormalTexture:!1,vertexShader:Q,pixelShader:W,noUseCameraTransform:n,additionalShaderSemanticInfo:o});return r.isSingleOperation=!0,q(i,r,t)},createDetectHighLuminanceMaterial:function({additionalName:e="",colorAttachmentsNumber:t=0,maxInstancesNumber:n=5}={},i){const o=`DetectHighLuminance_${e}_`,a=new h.t(i,t);return a.isSingleOperation=!0,q(o,a,n)},createGaussianBlurMaterial:function({additionalName:e="",maxInstancesNumber:t=10,noUseCameraTransform:n=!1}={}){const i=`GaussianBlur_${e}`,o=[],a=new Float32Array(30);o.push({semantic:v.f5.IsHorizontal,componentType:A.r.Bool,compositionType:y.d.Scalar,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.FirstTimeOnly,soloDatum:!1,initialValue:X.Ru.fromCopyNumber(1),min:0,max:1},{semantic:v.f5.GaussianRatio,componentType:A.r.Float,compositionType:y.d.ScalarArray,arrayLength:30,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.FirstTimeOnly,soloDatum:!1,initialValue:new x.j(a),min:0,max:1,needUniformInDataTextureMode:!0},{semantic:v.f5.GaussianKernelSize,componentType:A.r.Int,compositionType:y.d.Scalar,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.FirstTimeOnly,soloDatum:!1,initialValue:X.Ru.fromCopyNumber(1),min:1,max:30},{semantic:v.f5.FramebufferWidth,componentType:A.r.Float,compositionType:y.d.Scalar,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.FirstTimeOnly,soloDatum:!1,initialValue:X.Ru.fromCopyNumber(1),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:v.f5.BaseColorTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:g.H.PixelShader,isCustomSetting:!1,updateInterval:V.a.EveryTime,initialValue:[0,O.mg],min:0,max:Number.MAX_SAFE_INTEGER});const r=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,isClearCoat:!1,isTransmission:!1,isVolume:!1,isSheen:!1,isSpecular:!1,isIridescence:!1,isShadow:!1,useTangentAttribute:!1,useNormalTexture:!1,vertexShader:U,pixelShader:k,noUseCameraTransform:n,additionalShaderSemanticInfo:o});return r.isSingleOperation=!0,q(i,r,t)},createSynthesizeHDRMaterial:function({additionalName:e="",targetRegionTexture:t,maxInstancesNumber:n=1},i){const o=`SynthesizeHDR_${e}`,a=new u.d(i,t);return a.isSingleOperation=!0,q(o,a,n)},createColorGradingUsingLUTsMaterial:function({additionalName:e="",colorAttachmentsNumber:t=0,uri:n,texture:i,maxInstancesNumber:o=1},a){const r=`ColorGradingUsingLUTs_${e}`,s=new d.h(a,t,n,i);return s.isSingleOperation=!0,q(r,s,o)},createMatCapMaterial:function({additionalName:e="",isSkinning:t=!1,uri:n,texture:i,sampler:o,maxInstancesNumber:a=10}){const r=`MatCap_${e}`+(t?"+skinning":""),s=new m.S(t,n,i,o);return s.isSingleOperation=!0,q(r,s,a)},changeMaterial:function(e,t,n){const i=e.getMeshRenderer();t.material=n,i.moveStageTo(c.I.Load)}})},2749:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(3449),o=n(4252),a=n(4690),r=n(6098),s=n(3738);class l{constructor(){}static async importFromUri(e,t){var n;const o=await i.j.fetchArrayBuffer(e);return o.isErr()?new s.UG({message:"fetchArrayBuffer error",error:void 0}):await this._importGltfOrGlbFromArrayBuffers(o.unwrapForce(),null!==(n=null==t?void 0:t.files)&&void 0!==n?n:{},t,e)}static async importFromArrayBuffers(e,t){for(const n in e){const o=i.j.getExtension(n);if("gltf"===o||"glb"===o)return await this._importGltfOrGlbFromArrayBuffers(e[n],e,t)}return new s.UG({message:"no gltf or glb file found",error:void 0})}static async _importGltfOrGlbFromArrayBuffers(e,t,n,o){if(1179937895!==new DataView(e,0,20).getUint32(0,!0)){const a=i.j.arrayBufferToString(e),r=JSON.parse(a);try{const e=await this._importGltf(r,t,n,o);return new s.Ok(e)}catch(e){return new s.UG({message:"this.__importGltf error",error:void 0})}}else try{const i=await this._importGlb(e,t,n);return new s.Ok(i)}catch(e){return new s.UG({message:"this.importGlb error",error:void 0})}}static _getOptions(e,t,n){var i,o;if(null!=(null===(o=null===(i=t.asset)||void 0===i?void 0:i.extras)||void 0===o?void 0:o.rnLoaderOptions))for(const n in t.asset.extras.rnLoaderOptions)e[n]=t.asset.extras.rnLoaderOptions[n];for(const t in n)e[t]=n[t];return n&&n.loaderExtensionName&&"string"==typeof n.loaderExtensionName&&(null!=Rn[n.loaderExtensionName]?e.loaderExtension=Rn[n.loaderExtensionName].getInstance():(console.error(`${n.loaderExtensionName} not found!`),e.loaderExtension=void 0)),e}static async _importGlb(e,t,n){const o=new DataView(e,0,20);if(2!==o.getUint32(4,!0))throw new Error("invalid version field in this binary glTF file.");const a=o.getUint32(12,!0);if(1313821514!==o.getUint32(16,!0))throw new Error("invalid chunkType of chunk0 in this binary glTF file.");const r=new Uint8Array(e,20,a),s=i.j.uint8ArrayToString(r),l=JSON.parse(s),c=i.j.createDefaultGltfOptions();n=this._getOptions(c,l,n);const _=new Uint8Array(e,20+a+8);void 0===l.asset.extras&&(l.asset.extras={fileType:"glTF",version:"2"}),this._mergeExtendedJson(l,n.extendedJson),l.asset.extras.rnLoaderOptions=n;try{await this._loadInner(l,t,n,_)}catch(e){console.log("this._loadInner error in _loadAsBinaryJson",e)}return l}static async _importGltf(e,t,n,o,a){const r=(null==o?void 0:o.substring(0,null==o?void 0:o.lastIndexOf("/")))+"/";void 0===e.asset.extras&&(e.asset.extras={fileType:"glTF",version:"2"});const s=i.j.createDefaultGltfOptions();n=this._getOptions(s,e,n),this._mergeExtendedJson(e,n.extendedJson),e.asset.extras.rnLoaderOptions=n;try{await this._loadInner(e,t,n,void 0,r,a)}catch(e){console.error("this._loadInner error in _loadAsTextJson",e)}return e}static _loadInner(e,t,n,i,a,r){const s=[];return s.push(this._loadResources(i,e,t,n,a,r)),s.push(new o.n((t=>{this._loadJsonContent(e),t()}))),o.n.all(s)}static _loadJsonContent(e){this._loadDependenciesOfScenes(e),this._loadDependenciesOfNodes(e),this._loadDependenciesOfMeshes(e),this._loadDependenciesOfMaterials(e),this._loadDependenciesOfTextures(e),this._loadDependenciesOfJoints(e),this._loadDependenciesOfAnimations(e),this._loadDependenciesOfAccessors(e),this._loadDependenciesOfBufferViews(e),void 0===e.asset.extras&&(e.asset.extras={})}static _loadDependenciesOfScenes(e){for(const t of e.scenes){a.Is.undefined(t.nodesObjects)&&(t.nodesObjects=[]);for(const n of t.nodes)t.nodesObjects[n]=e.nodes[t.nodes[n]]}}static _loadDependenciesOfNodes(e){var t,n;for(const i of e.nodes){if(i.childrenObjects=null!==(t=i.childrenObjects)&&void 0!==t?t:[],i.children)for(const t of i.children)i.childrenObjects[t]=e.nodes[t];void 0!==i.mesh&&void 0!==e.meshes&&(i.meshObject=e.meshes[i.mesh]),void 0!==i.skin&&void 0!==e.skins&&(i.skinObject=e.skins[i.skin],a.Is.exist(i.skinObject)&&(a.Is.not.exist(null===(n=i.meshObject)||void 0===n?void 0:n.extras)&&(i.meshObject.extras={}),i.meshObject.extras._skin=i.skin)),void 0!==i.camera&&void 0!==e.cameras&&(i.cameraObject=e.cameras[i.camera]),void 0!==i.extensions&&void 0!==e.extensions&&void 0!==e.extensions.KHR_lights_punctual&&(i.extensions.KHR_lights_punctual.lightIndex=i.extensions.KHR_lights_punctual.light,i.extensions.KHR_lights_punctual.light=e.extensions.KHR_lights_punctual.lights[i.extensions.KHR_lights_punctual.lightIndex])}}static _loadDependenciesOfMeshes(e){var t;if(!a.Is.not.exist(e.meshes))for(const n of e.meshes)for(const i of n.primitives){if(void 0!==i.material&&(i.materialObject=e.materials[i.material]),null!=(null===(t=i.extensions)||void 0===t?void 0:t.KHR_materials_variants)){i.materialVariants=[];const t=i.extensions.KHR_materials_variants.mappings,n=e.extensions.KHR_materials_variants.variants;for(const o of t){const t=o.variants.map((e=>n[e].name)),a={materialObject:e.materials[o.material],variants:t};i.materialVariants.push(a)}}i.attributesObjects={};for(const t in i.attributes){const n=i.attributes[t],o=e.accessors[n];o.extras={toGetAsTypedArray:!0,attributeName:t},i.attributesObjects[t]=o}if(null!=i.indices&&(i.indicesObject=e.accessors[i.indices]),null!=i.targets){i.targetsObjects=[];for(const t of i.targets){const n={};for(const i in t){const o=t[i];if(o>=0){const t=e.accessors[o];t.extras={toGetAsTypedArray:!0,attributeName:i},n[i]=t}}i.targetsObjects.push(n)}}}}static _checkRnGltfLoaderOptionsExist(e){return!(!e.asset.extras||!e.asset.extras.rnLoaderOptions)}static _loadDependenciesOfMaterials(e){if(e.textures||(e.textures=[]),e.materials)for(const t of e.materials){if(t.pbrMetallicRoughness){const n=t.pbrMetallicRoughness.baseColorTexture;void 0!==n&&(n.texture=e.textures[n.index]);const i=t.pbrMetallicRoughness.metallicRoughnessTexture;void 0!==i&&(i.texture=e.textures[i.index])}const n=t.normalTexture;void 0!==n&&(n.texture=e.textures[n.index]);const i=t.occlusionTexture;void 0!==i&&(i.texture=e.textures[i.index]);const o=t.emissiveTexture;if(void 0!==o&&(o.texture=e.textures[o.index]),this._checkRnGltfLoaderOptionsExist(e)&&e.asset.extras.rnLoaderOptions.loaderExtension&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures(e,t),a.Is.exist(t.extensions)){const n=t.extensions;if(a.Is.exist(n.KHR_materials_clearcoat)){const t=n.KHR_materials_clearcoat.clearcoatTexture;void 0!==t&&(t.texture=e.textures[t.index]);const i=n.KHR_materials_clearcoat.clearcoatRoughnessTexture;void 0!==i&&(i.texture=e.textures[i.index]);const o=n.KHR_materials_clearcoat.clearcoatNormalTexture;void 0!==o&&(o.texture=e.textures[o.index])}if(a.Is.exist(n.KHR_materials_transmission)){const t=n.KHR_materials_transmission.transmissionTexture;void 0!==t&&(t.texture=e.textures[t.index])}if(a.Is.exist(n.KHR_materials_volume)){const t=n.KHR_materials_volume.thicknessTexture;void 0!==t&&(t.texture=e.textures[t.index])}if(a.Is.exist(n.KHR_materials_sheen)){const t=n.KHR_materials_sheen.sheenColorTexture;void 0!==t&&(t.texture=e.textures[t.index]);const i=n.KHR_materials_sheen.sheenRoughnessTexture;void 0!==i&&(i.texture=e.textures[i.index])}if(a.Is.exist(n.KHR_materials_specular)){const t=n.KHR_materials_specular.specularTexture;void 0!==t&&(t.texture=e.textures[t.index]);const i=n.KHR_materials_specular.specularColorTexture;void 0!==i&&(i.texture=e.textures[i.index])}if(a.Is.exist(n.KHR_materials_iridescence)){const t=n.KHR_materials_iridescence.iridescenceTexture;void 0!==t&&(t.texture=e.textures[t.index]);const i=n.KHR_materials_iridescence.iridescenceThicknessTexture;void 0!==i&&(i.texture=e.textures[i.index])}if(a.Is.exist(n.KHR_materials_anisotropy)){const t=n.KHR_materials_anisotropy.anisotropyTexture;void 0!==t&&(t.texture=e.textures[t.index])}}}}static _loadDependenciesOfTextures(e){var t,n;if(e.textures)for(const i of e.textures)(0,r.Jx)((t=>i.samplerObject=e.samplers[t]),i.sampler),null!=(null===(n=null===(t=i.extensions)||void 0===t?void 0:t.KHR_texture_basisu)||void 0===n?void 0:n.source)?(i.extensions.KHR_texture_basisu.fallbackSourceIndex=i.source,i.source=i.extensions.KHR_texture_basisu.source,i.image=e.images[i.source]):void 0!==i.source&&(i.image=e.images[i.source])}static _loadDependenciesOfJoints(e){if(e.skins)for(const t of e.skins){t.skeletonObject=e.nodes[t.skeleton],t.inverseBindMatricesObject=e.accessors[t.inverseBindMatrices],a.Is.not.exist(t.skeleton)&&(t.skeleton=t.joints[0],t.skeletonObject=e.nodes[t.skeleton]),t.jointsObjects=[];for(const n of t.joints)t.jointsObjects.push(e.nodes[n])}}static _loadDependenciesOfAnimations(e){if(e.animations)for(const t of e.animations)for(const n of t.channels)if(a.Is.exist(n.sampler)){if(n.samplerObject=t.samplers[n.sampler],n.target.nodeObject=e.nodes[n.target.node],n.samplerObject.inputObject=e.accessors[n.samplerObject.input],n.samplerObject.outputObject=e.accessors[n.samplerObject.output],a.Is.undefined(n.samplerObject.outputObject.extras)&&(n.samplerObject.outputObject.extras={}),"weights"===n.target.path){let e=n.samplerObject.outputObject.count/n.samplerObject.inputObject.count;"CUBICSPLINE"===n.samplerObject.interpolation&&(e=n.samplerObject.outputObject.count/n.samplerObject.inputObject.count/3),n.samplerObject.outputObject.extras.weightsArrayLength=e}"rotation"===n.target.path&&(n.samplerObject.outputObject.extras.quaternionIfVec4=!0)}}static _loadDependenciesOfAccessors(e){for(const t of e.accessors)if(null==t.bufferView&&(t.bufferView=0),t.bufferViewObject=e.bufferViews[t.bufferView],a.Is.exist(t.sparse)){const n=t.sparse;a.Is.exist(n)&&a.Is.exist(n.indices)&&a.Is.exist(n.values)&&(n.indices.bufferViewObject=e.bufferViews[n.indices.bufferView],n.values.bufferViewObject=e.bufferViews[n.values.bufferView])}}static _loadDependenciesOfBufferViews(e){for(const t of e.bufferViews)void 0!==t.buffer&&(t.bufferObject=e.buffers[t.buffer])}static _mergeExtendedJson(e,t){let n=null;if(t instanceof ArrayBuffer){const e=i.j.arrayBufferToString(t);n=JSON.parse(e)}else"string"==typeof t?n=JSON.parse(t):"object"==typeof t&&(n=t);Object.assign(e,n)}static _loadResources(e,t,n,r,s,l){var c;const _=[];let h;for(const a of t.buffers){let t="";if(a.uri){const e=a.uri.split("/");t=e[e.length-1]}h=void 0===a.uri?new o.n((t=>{a.buffer=e,t(e)})):a.uri.match(/^data:application\/(.*);base64,/)?new o.n((e=>{const t=i.j.dataUriToArrayBuffer(a.uri);a.buffer=new Uint8Array(t),e(t)})):n&&this.__containsFileName(n,t)?new o.n((e=>{const i=this.__getFullPathOfFileName(n,t),o=n[i];a.buffer=new Uint8Array(o),e(o)})):new o.n(i.j.loadResourceAsync(s+a.uri,!0,((e,t)=>{a.buffer=new Uint8Array(t),e(t)}),((e,t)=>{e("HTTP Error Status:"+t)}))),a.bufferPromise=h,_.push(h)}for(const r of null!==(c=t.images)&&void 0!==c?c:[])if(null==r.uri)if(a.Is.exist(e)){const o=i.j.createUint8ArrayFromBufferViewInfo(t,r.bufferView,e),a=i.j.createBlobImageUriFromUint8Array(o,r.mimeType);_.push(this.__loadImageUri(a,r,n))}else{const e=t.bufferViews[r.bufferView].bufferObject;if(a.Is.not.exist(e)){console.error("gltf2BufferView.bufferObject not found");continue}const s=e.bufferPromise,l=new o.n((e=>{s.then((o=>{const a=i.j.createUint8ArrayFromBufferViewInfo(t,r.bufferView,o),s=i.j.createBlobImageUriFromUint8Array(a,r.mimeType);this.__loadImageUri(s,r,n).then((()=>{e(o)}))}))})),c=_.indexOf(s);_[c]=l,e.bufferPromise=l}else{const e=r.uri,t=e.split("/"),o=t[t.length-1];let a;if(n&&this.__containsFileName(n,o)){const e=this.__getFullPathOfFileName(n,o),t=n[e];a=i.j.createBlobImageUriFromUint8Array(new Uint8Array(t),r.mimeType)}else a=e.match(/^data:/)?e:s+e;_.push(this.__loadImageUri(a,r,n))}if(r.defaultTextures){const e=r.defaultTextures.basePath,t=r.defaultTextures.textureInfos;for(const n of t){const t=n.fileName,o=e+t,a=i.j.getExtension(t),r=i.j.getMimeTypeFromExtension(a),s=i.j.createImageFromUri(o,r).then((e=>(e.crossOrigin="Anonymous",n.image={image:e},n.image)));_.push(s)}}return o.n.all(_,l).catch((e=>{console.log("Promise.all error",e)}))}static __containsFileName(e,t){for(const n in e){const e=n.split("/");if(e[e.length-1]===t)return!0}return!1}static __getFullPathOfFileName(e,t){for(const n in e){const e=n.split("/");if(e[e.length-1]===t)return n}}static __loadImageUri(e,t,n){var a,r;let s;return s=e.match(/basis$/)?new o.n((n=>{fetch(e,{mode:"cors"}).then((e=>{e.arrayBuffer().then((e=>{const i=new Uint8Array(e);t.basis=i,n(t)}))}))})):(null===(a=t.uri)||void 0===a?void 0:a.match(/basis$/))?new o.n((e=>{t.basis=new Uint8Array(n[t.uri]),e(t)})):e.match(/\.ktx2$/)||e.match(/^data:image\/ktx2/)||null!=t.bufferView&&"image/ktx2"===t.mimeType?new o.n((n=>{fetch(e,{mode:"cors"}).then((e=>{e.arrayBuffer().then((e=>{const i=new Uint8Array(e);t.ktx2=i,n(t)}))}))})):(null===(r=t.uri)||void 0===r?void 0:r.match(/ktx2$/))?new o.n((e=>{t.ktx2=new Uint8Array(n[t.uri]),e(t)})):i.j.createImageFromUri(e,t.mimeType).then((e=>(e.crossOrigin="Anonymous",t.image=e,t))),s}}},6694:(e,t,n)=>{"use strict";n.d(t,{e:()=>W});var i=n(1350),o=n(4097),a=n(2471),r=n(9207),s=n(5467),l=n(1845),c=n(4235),_=n(8696),h=n(810),u=n(3999),d=n(128),m=n(9646),f=n(2575),p=n(7192),v=n(1564),A=n(7305),y=n(3032),g=n(1656),x=n(5704),I=n(1469),b=n(4587),E=n(2390),T=n(9840),S=n(6214),C=n(4536),w=n(5634),R=n(3258),P=n(752),D=n(9286),M=n(3616),N=n(5981),B=n(7987),L=n(4690),F=n(3449),G=n(4350),V=n(7973),z=n(6456),O=n(6683),U=n(1220),k=n(3496),Q=n(580);class W{constructor(){}static __generateGroupEntity(e){const t=V._.createGroupEntity();return this.addTags(t,e),t}static addTags(e,t){e.tryToSetTag({tag:"SourceType",value:t.asset.extras.fileType}),e.tryToSetTag({tag:"SourceTypeVersion",value:t.asset.extras.version})}static __generateMeshEntity(e){const t=V._.createMeshEntity();return this.addTags(t,e),t}static __generateCameraEntity(e){const t=V._.createCameraEntity();return this.addTags(t,e),t}static __generateLightEntity(e){const t=V._.createLightEntity();return this.addTags(t,e),t}static convertToRhodoniteObject(e){var t;e.asset.extras.rnMeshesAtGltMeshIdx=[];const n=this.createRnBuffer(e);e.asset.extras.rnMaterials={};const{rnEntities:i,rnEntitiesByNames:o}=this.__setupObjects(e,n);e.asset.extras.rnEntities=i,this._setupTransform(e,i),this._setupAnimation(e,i,n),this._setupSkeleton(e,i,n),this._setupHierarchy(e,i),this._setupAnimation(e,i,n);const a=this.__generateGroupEntity(e);if(a.tryToSetUniqueName("FileRoot",!0),a.tryToSetTag({tag:"ObjectType",value:"top"}),e.scenes[0].nodes)for(const t of e.scenes[0].nodes){const e=i[t].getSceneGraph();a.getSceneGraph().addChild(e)}if(e.asset.extras&&e.asset.extras.rnLoaderOptions){const n=e.asset.extras.rnLoaderOptions;n&&n.loaderExtension&&(null===(t=null==n?void 0:n.loaderExtension)||void 0===t?void 0:t.loadExtensionInfoAndSetToRootGroup)&&n.loaderExtension.loadExtensionInfoAndSetToRootGroup(a,e),n&&n.expression&&n.expression.tryToSetTag({tag:"gltfModel",value:e})}return a.tryToSetTag({tag:"rnEntities",value:i}),a.tryToSetTag({tag:"rnEntitiesByNames",value:o}),a.tryToSetTag({tag:"gltfModel",value:e}),L.Is.not.exist(e.extras)&&(e.extras={}),e.extras.rnEntities=i,e.extras.rnEntitiesByNames=o,U.z.importEffect(e,a),U.z.importBillboard(e,i),L.Is.exist(e.extensionsUsed)&&e.extensionsUsed.indexOf("VRMC_vrm"),a}static createRnBuffer(e){const t=[];for(const n of e.buffers){const e=new c.l({byteLength:n.byteLength,buffer:n.buffer,name:`gltf2Buffer_0_(${n.uri})`,byteAlign:4});t.push(e)}return t}static _setupTransform(e,t){for(const n in e.nodes){const i=t[n],o=e.nodes[n],l=i.getTransform();o.translation&&(l.localPosition=a.P.fromCopyArray([o.translation[0],o.translation[1],o.translation[2]])),o.scale&&(l.localScale=a.P.fromCopyArray([o.scale[0],o.scale[1],o.scale[2]])),o.rotation&&(l.localRotation=r._.fromCopy4(o.rotation[0],o.rotation[1],o.rotation[2],o.rotation[3])),o.matrix&&(l.localMatrix=s.J.fromCopyArrayColumnMajor(o.matrix))}}static _setupHierarchy(e,t){const n=t.map((e=>e.getSceneGraph()));for(const t in e.nodes){const i=parseInt(t),o=e.nodes[i];if(L.Is.exist(o.children)){const e=n[i];for(const t of o.children){const i=n[t];e.addChild(i)}}}}static _setupAnimation(e,t,n){var o;if(e.animations)for(const t of e.animations)for(const e of t.samplers)this._readBinaryFromAccessorAndSetItToAccessorExtras(e.inputObject,n),this._readBinaryFromAccessorAndSetItToAccessorExtras(e.outputObject,n);if(L.Is.exist(e.animations)&&e.animations.length>0)for(const n of e.animations)for(const e of n.channels)if(L.Is.exist(e.samplerObject)){const a=e.samplerObject.inputObject.extras.typedDataArray,r=e.samplerObject.outputObject.extras.typedDataArray,s=null!==(o=e.samplerObject.interpolation)&&void 0!==o?o:"LINEAR";let l="undefined";l="translation"===e.target.path?"translate":"rotation"===e.target.path?"quaternion":e.target.path;const c=t[e.target.node];if(L.Is.exist(c)){let t=c.tryToGetAnimation();if(L.Is.not.exist(t)&&(t=i.g.addComponentToEntity(v.c,c).getAnimation()),L.Is.exist(t)){const i=e.samplerObject.outputObject.extras.componentN;t.setAnimation(L.Is.exist(n.name)?n.name:"Untitled_Animation",l,a,r,i,A.k.fromString(s))}}}}static _setupSkeleton(e,t,n){if(null!=e.skins)for(const o in e.nodes){const a=e.nodes[o],r=t[o].getSceneGraph();let l;if(L.Is.exist(a.skinObject)){const e=t[o];if(l=i.g.addComponentToEntity(g.Y,e).getSkeletal(),L.Is.exist(a.skinObject.bindShapeMatrix)&&(l._bindShapeMatrix=s.J.fromCopyArrayColumnMajor(a.skinObject.bindShapeMatrix)),L.Is.exist(a.skinObject.skeleton)&&(r.isRootJoint=!0,L.Is.exist(a.mesh))){const e=[];for(const n of a.skinObject.joints)e.push(t[n].getSceneGraph());l.setJoints(e),L.Is.exist(a.skinObject.skeleton)?l.topOfJointsHierarchy=t[a.skinObject.skeleton].getSceneGraph():l.topOfJointsHierarchy=e[0]}for(const e of a.skinObject.joints)t[e].getSceneGraph().jointIndex=e;const c=a.skinObject.inverseBindMatricesObject;if(L.Is.exist(c)){const e=this.__getRnBufferViewAndRnAccessor(c,n[c.bufferViewObject.buffer]);l.setInverseBindMatricesAccessor(e)}}}}static __setupObjects(e,t){var n,a,r,s,l;const c=[],_=new Map;for(const h in e.nodes){const u=e.nodes[parseInt(h)];let d;if(null!=u.mesh){const i=u.mesh,a=this.__setupMesh(u,u.meshObject,i,t,e);u.name&&a.tryToSetUniqueName(u.name,!0),(null===(n=u.meshObject)||void 0===n?void 0:n.name)&&a.getComponent(o.$).tryToSetUniqueName(u.meshObject.name,!0),d=a}else if(null!=u.cameraObject){const t=this.__setupCamera(u.cameraObject,e);u.name&&t.tryToSetUniqueName(u.name,!0),d=t}else if(null===(a=u.extensions)||void 0===a?void 0:a.KHR_lights_punctual)d=this.__setupLight(u.extensions.KHR_lights_punctual.light,e);else{const t=this.__generateGroupEntity(e);u.name&&t.tryToSetUniqueName(u.name,!0),d=t}if(this.__isMorphing(u,e)){let e=[];if(u.weights)e=u.weights;else if(null===(r=u.meshObject)||void 0===r?void 0:r.weights)e=u.meshObject.weights;else{let t=0;for(const e of u.meshObject.primitives)L.Is.exist(e.targets)&&e.targets.length>t&&(t=e.targets.length);e=new Array(t).fill(0)}d=i.g.addComponentToEntity(z.x,d);const t=d.getBlendShape();t.weights=e,(null===(l=null===(s=u.meshObject)||void 0===s?void 0:s.primitives[0].extras)||void 0===l?void 0:l.targetNames)&&(t.targetNames=u.meshObject.primitives[0].extras.targetNames)}d.tryToSetTag({tag:G.j,value:h}),c.push(d),_.set(u.name,d)}return{rnEntities:c,rnEntitiesByNames:_}}static __isMorphing(e,t){var n,i,o;const a=null===(i=null===(n=t.asset.extras)||void 0===n?void 0:n.rnLoaderOptions)||void 0===i?void 0:i.defaultMaterialHelperArgumentArray[0];return!1!==(null==a?void 0:a.isMorphing)&&null!=(null===(o=e.meshObject)||void 0===o?void 0:o.primitives[0].targets)}static __setupLight(e,t){var n,i;const o=this.__generateLightEntity(t),r=o.getComponent(O.r);if(null!=e.name){r.tryToSetUniqueName(e.name,!0),r.type=w.v.fromString(e.type);let t=a.P.fromCopyArray3([1,1,1]),o=1;null!=e.color&&(t=a.P.fromCopyArray3(e.color)),null!=e.intensity&&(o=e.intensity),r.intensity=a.P.multiply(t,o),null!=e.range&&(r.range=e.range),"spot"===e.type&&(null!=(null===(n=e.spot)||void 0===n?void 0:n.innerConeAngle)&&(r.innerConeAngle=e.spot.innerConeAngle),null!=(null===(i=e.spot)||void 0===i?void 0:i.outerConeAngle)&&(r.outerConeAngle=e.spot.outerConeAngle))}return o}static __setupCamera(e,t){const n=this.__generateCameraEntity(t),i=n.getCamera();return i.direction=a.P.fromCopyArray([0,0,-1]),t.asset&&t.asset.LastSaved_ApplicationVendor&&(i.direction=a.P.fromCopyArray([1,0,0]),i.directionInner=a.P.fromCopyArray([1,0,0])),i.up=a.P.fromCopyArray([0,1,0]),i.type=m.i.fromString(e.type),i.type===m.i.Perspective?(i.aspect=e.perspective.aspectRatio?e.perspective.aspectRatio:1,i.setFovyAndChangeFocalLength(y.k.radianToDegree(e.perspective.yfov)),i.zNear=e.perspective.znear,i.zFar=e.perspective.zfar?e.perspective.zfar:1e5,i.tryToSetTag({tag:"OriginalFovY",value:i.fovy})):i.type===m.i.Orthographic&&(i.xMag=e.orthographic.xmag,i.yMag=e.orthographic.ymag,i.zNear=e.orthographic.znear,i.zFar=e.orthographic.zfar,i.tryToSetTag({tag:"OriginalXMag",value:i.xMag}),i.tryToSetTag({tag:"OriginalYMag",value:i.yMag})),i.tryToSetTag({tag:"OriginalAspect",value:i.aspect}),n}static __setupMesh(e,t,n,i,o){var a;const r=this.__generateMeshEntity(o),s=o.asset.extras.rnMeshesAtGltMeshIdx[n];let c=_.T.Triangles;const h=r.getMesh();if(null!=s)h.setMesh(s);else{const r=new S.K,s=o.asset.extras.rnLoaderOptions;null!=(null==s?void 0:s.tangentCalculationMode)&&(r.tangentCalculationMode=s.tangentCalculationMode);const u=(t,n)=>{const i=this.__setupMaterial(t,e,o,n,n.materialObject);return!1===i.isEmptyMaterial()&&W.setDefaultTextures(i,o),i},m=(t,n)=>{const i=n.materialVariants;if(!L.Is.not.exist(i))for(const a of i){const i=this.__setupMaterial(t,e,o,n,a.materialObject);!1===i.isEmptyMaterial()&&W.setDefaultTextures(i,o);for(const e of a.variants)t.setMaterialVariant(e,i)}};for(const e in t.primitives){const n=t.primitives[e];null!=n.mode&&(c=_.T.from(n.mode));const h=new l.W,f=u(h,n);let p;m(h,n);const v=new Map;if(null===(a=n.extensions)||void 0===a?void 0:a.KHR_draco_mesh_compression){if(p=this.__decodeDraco(n,i,o,v),L.Is.not.exist(p))break}else{L.Is.exist(n.indices)&&(p=this.__getRnBufferViewAndRnAccessor(n.indicesObject,i[n.indicesObject.bufferViewObject.buffer]));const e=new Map;for(const t in n.attributesObjects){const o=n.attributesObjects[t],a=i[o.bufferViewObject.buffer];let r;L.Is.exist(o.bufferView)?(r=e.get(o.bufferView),L.Is.not.exist(r)&&(r=this.__getRnBufferView(o.bufferViewObject,a),e.set(o.bufferView,r))):r=a.takeBufferView({byteLengthToNeed:0,byteStride:0}).unwrapForce();const s=this.__getRnAccessor(o,r),l=d.T.toVertexAttributeSemanticJoinedStringAsGltfStyle(d.T.fromString(o.extras.attributeName));v.set(l,s)}}if(h.setData(v,c,f,p),null!=n.targets){let e=R.D.maxMorphTargetNumber;null!=(null==s?void 0:s.maxMorphTargetNumber)&&(e=s.maxMorphTargetNumber);const t=[];for(let o=0;o=e);o++){const e=n.targetsObjects[o],a=new Map;for(const t in e){const n=e[t],o=this.__getRnBufferViewAndRnAccessor(n,i[n.bufferViewObject.buffer]),r=this.__copyRnAccessorAndBufferView(o),s=d.T.fromString(t),l=d.T.toVertexAttributeSemanticJoinedStringAsGltfStyle(s);a.set(l,r)}t.push(a)}h.setBlendShapeTargets(t)}r.addPrimitive(h)}h.setMesh(r),o.asset.extras.rnMeshesAtGltMeshIdx[n]=r}return r}static setSparseAccessor(e,t){var n,i,o,a;const r=e.bufferViewObject.bufferObject.buffer,s=e.sparse.count,l=e.sparse.indices,c=(null!==(n=l.bufferViewObject.byteOffset)&&void 0!==n?n:0)+(null!==(i=l.byteOffset)&&void 0!==i?i:0),_=this._checkBytesPerComponent(l),h=_*s,u=new DataView(r.buffer,c+r.byteOffset,h),d=this._checkDataViewMethod(l),m=e.sparse.values,f=(null!==(o=m.bufferViewObject.byteOffset)&&void 0!==o?o:0)+(null!==(a=m.byteOffset)&&void 0!==a?a:0),p=this._checkBytesPerComponent(e),v=this._checkComponentNumber(e),A=p*v*s,y=new DataView(r.buffer,f+r.byteOffset,A),g=this._checkDataViewMethod(e),x=t.getTypedArray();for(let e=0;e=2){const e=null!==(f=null===(m=n.asset.extras)||void 0===m?void 0:m.rnLoaderOptions)&&void 0!==f?f:{},t=this.__useTangentAttribute(n,i),a=this.__useNormalTexture(n),r=I.G.createPbrUberMaterial({isMorphing:S,isSkinning:C,isLighting:w,isClearCoat:L.Is.exist(null===(p=null==o?void 0:o.extensions)||void 0===p?void 0:p.KHR_materials_clearcoat),isTransmission:L.Is.exist(null===(v=null==o?void 0:o.extensions)||void 0===v?void 0:v.KHR_materials_transmission),isVolume:L.Is.exist(null===(A=null==o?void 0:o.extensions)||void 0===A?void 0:A.KHR_materials_volume),isSheen:L.Is.exist(null===(y=null==o?void 0:o.extensions)||void 0===y?void 0:y.KHR_materials_sheen),isSpecular:L.Is.exist(null===(g=null==o?void 0:o.extensions)||void 0===g?void 0:g.KHR_materials_specular),isIridescence:L.Is.exist(null===(E=null==o?void 0:o.extensions)||void 0===E?void 0:E.KHR_materials_iridescence),isAnisotropy:L.Is.exist(null===(T=null==o?void 0:o.extensions)||void 0===T?void 0:T.KHR_materials_anisotropy),isShadow:!!e.shadow,useTangentAttribute:t,useNormalTexture:a,additionalName:D,maxInstancesNumber:M}),s=this.__makeOutputSrgb(n);return L.Is.exist(s)&&r.setParameter(b.f5.MakeOutputSrgb,s),r}return I.G.createClassicUberMaterial({isSkinning:C,isLighting:w,additionalName:D,maxInstancesNumber:M})}static __isLighting(e,t){var n,i,o,a;const r=null===(o=null===(i=null===(n=null==e?void 0:e.asset)||void 0===n?void 0:n.extras)||void 0===i?void 0:i.rnLoaderOptions)||void 0===o?void 0:o.defaultMaterialHelperArgumentArray[0];return null!=(null==r?void 0:r.isLighting)?r.isLighting:null==(null===(a=null==t?void 0:t.extensions)||void 0===a?void 0:a.KHR_materials_unlit)}static __isSkinning(e,t){var n,i,o;const a=null===(o=null===(i=null===(n=null==t?void 0:t.asset)||void 0===n?void 0:n.extras)||void 0===i?void 0:i.rnLoaderOptions)||void 0===o?void 0:o.defaultMaterialHelperArgumentArray[0];return!1!==(null==a?void 0:a.isSkinning)&&null!=e.skin}static __useTangentAttribute(e,t){var n,i,o;switch(null===(o=null===(i=null===(n=null==e?void 0:e.asset)||void 0===n?void 0:n.extras)||void 0===i?void 0:i.rnLoaderOptions)||void 0===o?void 0:o.tangentCalculationMode){case 0:case 3:return!1;case 1:break;case 2:case 4:return!0}for(const e in t.attributes)if("TANGENT"===e)return!0;return!1}static __useNormalTexture(e){var t,n,i,o,a,r;const s=null===(i=null===(n=null===(t=null==e?void 0:e.asset)||void 0===t?void 0:t.extras)||void 0===n?void 0:n.rnLoaderOptions)||void 0===i?void 0:i.defaultMaterialHelperArgumentArray[0];return!1!==(null==s?void 0:s.useNormalTexture)&&0!==(null===(r=null===(a=null===(o=null==e?void 0:e.asset)||void 0===o?void 0:o.extras)||void 0===a?void 0:a.rnLoaderOptions)||void 0===r?void 0:r.tangentCalculationMode)}static __makeOutputSrgb(e){var t,n,i;const o=null===(i=null===(n=null===(t=null==e?void 0:e.asset)||void 0===t?void 0:t.extras)||void 0===n?void 0:n.rnLoaderOptions)||void 0===i?void 0:i.defaultMaterialHelperArgumentArray[0];return null==o?void 0:o.makeOutputSrgb}static __getMaterialHash(e,t,n,i){return n.material+"_isSkinning_"+this.__isSkinning(e,t)+"_isMorphing_"+this.__isMorphing(e,t)+"_isLighting_"+this.__isLighting(t,i)+"_useTangentAttribute_"+this.__useTangentAttribute(t,n)}static __setupMaterial(e,t,n,i,o){var r,s,l,c,_,h,u,d,m,f,v,A;const y=null!=(null===(r=null==o?void 0:o.extensions)||void 0===r?void 0:r.KHR_materials_unlit),g=this.__generateAppropriateMaterial(e,t,n,i,o);if(!this.__needParameterInitialization(o,g.materialTypeName))return g;const I=n.asset.extras.rnLoaderOptions,S=null==o?void 0:o.pbrMetallicRoughness;if(null!=S)!function(e,t,n,i,o){var r;const s=null!=(null===(r=o.extensions)||void 0===r?void 0:r.KHR_materials_unlit),l=e.baseColorFactor;null!=l&&t.setParameter(b.f5.BaseColorFactor,p.Lt.fromCopyArray4(l));const c=e.baseColorTexture;if(null!=c){const e=W._createTexture(c.texture,n,{autoDetectTransparency:null==i?void 0:i.autoDetectTextureTransparency}),o=W._createSampler(c.texture);t.setTextureParameter(b.f5.BaseColorTexture,e,o),null!=c.texCoord&&t.setParameter(b.f5.BaseColorTexcoordIndex,c.texCoord)}const _=o.occlusionTexture;if(null!=_&&L.Is.falsy(s)){const e=W._createTexture(_.texture,n),i=W._createSampler(_.texture);t.setTextureParameter(b.f5.OcclusionTexture,e,i),null!=_.texCoord&&t.setParameter(b.f5.OcclusionTexcoordIndex,_.texCoord),null!=_.strength&&t.setParameter(b.f5.OcclusionStrength,_.strength),W._setupTextureTransform(_,t,b.f5.OcclusionTextureTransform,b.f5.OcclusionTextureRotation)}let h=e.metallicFactor;h=s?0:null!=h?h:1;let u=e.roughnessFactor;u=s?1:null!=u?u:1,t.setParameter(b.f5.MetallicRoughnessFactor,E.FM.fromCopyArray2([h,u]));const d=e.metallicRoughnessTexture;if(null!=d&&L.Is.falsy(s)){const e=W._createTexture(d.texture,n),i=W._createSampler(d.texture);t.setTextureParameter(b.f5.MetallicRoughnessTexture,e,i),null!=d.texCoord&&t.setParameter(b.f5.MetallicRoughnessTexcoordIndex,d.texCoord)}!function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_clearcoat;if(L.Is.exist(o)){const e=L.Is.exist(o.clearcoatFactor)?o.clearcoatFactor:0;t.setParameter(b.f5.ClearCoatFactor,e);const i=o.clearcoatTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.ClearCoatTexture,e,o),null!=i.texCoord&&t.setParameter(b.f5.ClearCoatTexcoordIndex,i.texCoord),W._setupTextureTransform(i,t,b.f5.ClearCoatTextureTransform,b.f5.ClearCoatTextureRotation)}const a=L.Is.exist(o.clearcoatRoughnessFactor)?o.clearcoatRoughnessFactor:0;t.setParameter(b.f5.ClearCoatRoughnessFactor,a);const r=o.clearcoatRoughnessTexture;if(null!=r){const e=W._createTexture(r.texture,n),i=W._createSampler(r.texture);t.setTextureParameter(b.f5.ClearCoatRoughnessTexture,e,i),null!=r.texCoord&&t.setParameter(b.f5.ClearCoatRoughnessTexcoordIndex,r.texCoord),W._setupTextureTransform(r,t,b.f5.ClearCoatRoughnessTextureTransform,b.f5.ClearCoatRoughnessTextureRotation)}const s=o.clearcoatNormalTexture;if(null!=s){const e=W._createTexture(s.texture,n),i=W._createSampler(s.texture);t.setTextureParameter(b.f5.ClearCoatNormalTexture,e,i),null!=s.texCoord&&t.setParameter(b.f5.ClearCoatNormalTexcoordIndex,s.texCoord),W._setupTextureTransform(s,t,b.f5.ClearCoatNormalTextureTransform,b.f5.ClearCoatNormalTextureRotation)}}}(o,t,n);const m=function(e,t,n){var i;const o=null===(i=e.extensions)||void 0===i?void 0:i.KHR_materials_transmission;if(L.Is.exist(o)){const e=L.Is.exist(o.transmissionFactor)?o.transmissionFactor:0;t.setParameter(b.f5.TransmissionFactor,e);const i=o.transmissionTexture;if(L.Is.exist(i)){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.TransmissionTexture,e,o)}return!0}return!1}(o,t,n);i.transmission||(i.transmission=m),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_volume;if(L.Is.exist(o)){const e=o.thicknessFactor?o.thicknessFactor:0;null!=e&&t.setParameter(b.f5.ThicknessFactor,e);const i=o.thicknessTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.ThicknessTexture,e,o)}const r=o.attenuationDistance?o.attenuationDistance:0;null!=r&&t.setParameter(b.f5.AttenuationDistance,r);const s=o.attenuationColor?a.P.fromCopyArray3(o.attenuationColor):a.P.fromCopy3(1,1,1);null!=s&&t.setParameter(b.f5.AttenuationColor,s)}}(o,t,n),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_sheen;if(L.Is.exist(o)){const e=L.Is.exist(o.sheenColorFactor)?o.sheenColorFactor:[0,0,0];t.setParameter(b.f5.SheenColorFactor,a.P.fromCopyArray3(e));const i=o.sheenColorTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.SheenColorTexture,e,o)}const r=L.Is.exist(o.sheenRoughnessFactor)?o.sheenRoughnessFactor:0;t.setParameter(b.f5.SheenRoughnessFactor,r);const s=o.sheenRoughnessTexture;if(null!=s){const e=W._createTexture(s.texture,n),i=W._createSampler(s.texture);t.setTextureParameter(b.f5.SheenRoughnessTexture,e,i)}}}(o,t,n),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_specular;if(L.Is.exist(o)){const e=L.Is.exist(o.specularFactor)?o.specularFactor:1;t.setParameter(b.f5.SpecularFactor,e);const i=o.specularTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.SpecularTexture,e,o)}const r=L.Is.exist(o.SpecularColorFactor)?o.SpecularColorFactor:[1,1,1];t.setParameter(b.f5.SpecularColorFactor,a.P.fromCopyArray3(r));const s=o.SpecularColorTexture;if(null!=s){const e=W._createTexture(s.texture,n),i=W._createSampler(s.texture);t.setTextureParameter(b.f5.SpecularColorTexture,e,i)}}}(o,t,n),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_ior;if(L.Is.exist(o)){const e=L.Is.exist(o.ior)?o.ior:1.5;t.setParameter(b.f5.Ior,e)}}(o,t),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_iridescence;if(L.Is.exist(o)){const e=L.Is.exist(o.iridescenceFactor)?o.iridescenceFactor:0;t.setParameter(b.f5.IridescenceFactor,e);const i=o.iridescenceTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.IridescenceTexture,e,o)}const a=L.Is.exist(o.iridescenceIor)?o.iridescenceIor:1.3;t.setParameter(b.f5.IridescenceIor,a);const r=L.Is.exist(o.iridescenceThicknessMinimum)?o.iridescenceThicknessMinimum:100;t.setParameter(b.f5.IridescenceThicknessMinimum,r);const s=L.Is.exist(o.iridescenceThicknessMaximum)?o.iridescenceThicknessMaximum:400;t.setParameter(b.f5.IridescenceThicknessMaximum,s);const l=o.iridescenceThicknessTexture;if(null!=l){const e=W._createTexture(l.texture,n),i=W._createSampler(l.texture);t.setTextureParameter(b.f5.IridescenceThicknessTexture,e,i)}}}(o,t,n),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_anisotropy;if(L.Is.exist(o)){const e=L.Is.exist(o.anisotropyStrength)?o.anisotropyStrength:0;t.setParameter(b.f5.AnisotropyStrength,e);const i=L.Is.exist(o.anisotropyRotation)?o.anisotropyRotation:0;t.setParameter(b.f5.AnisotropyRotation,E.FM.fromCopy2(Math.cos(i),Math.sin(i)));const a=o.anisotropyTexture;if(null!=a){const e=W._createTexture(a.texture,n),i=W._createSampler(a.texture);t.setTextureParameter(b.f5.AnisotropyTexture,e,i)}}}(o,t,n),function(e,t,n){W._setupTextureTransform(e,t,b.f5.BaseColorTextureTransform,b.f5.BaseColorTextureRotation),W._setupTextureTransform(n,t,b.f5.MetallicRoughnessTextureTransform,b.f5.MetallicRoughnessTextureRotation)}(c,t,d)}(S,g,n,I,o);else{let e=T.D.Phong.index;if(null===(s=null==o?void 0:o.extras)||void 0===s?void 0:s.technique){switch(o.extras.technique){case T.D.Constant.str:e=T.D.Constant.index;break;case T.D.Lambert.str:e=T.D.Lambert.index;break;case T.D.BlinnPhong.str:e=T.D.BlinnPhong.index;break;case T.D.Phong.str:e=T.D.Phong.index}g.setParameter(b.f5.ShadingModel,M.Ru.fromCopyNumber(e))}}const C=y?[0,0,0]:null==o?void 0:o.emissiveFactor;null!=C&&g.setParameter(b.f5.EmissiveFactor,a.P.fromCopyArray3(C));const w=null==o?void 0:o.emissiveTexture;if(null!=w&&L.Is.falsy(y)){const e=W._createTexture(w.texture,n),t=W._createSampler(w.texture);g.setTextureParameter(b.f5.EmissiveTexture,e,t),parseFloat(null===(l=n.asset)||void 0===l?void 0:l.version)>=2&&null!=w.texCoord&&g.setParameter(b.f5.EmissiveTexcoordIndex,w.texCoord),W._setupTextureTransform(w,g,b.f5.EmissiveTextureTransform,b.f5.EmissiveTextureRotation)}let R=null==o?void 0:o.alphaMode;(null==I?void 0:I.alphaMode)&&(R=I.alphaMode),null!=R&&(g.alphaMode=x.F.fromGlTFString(R),g.alphaMode!==x.F.Mask||(null===(_=null===(c=n.asset.extras)||void 0===c?void 0:c.rnLoaderOptions)||void 0===_?void 0:_.__isImportVRM0x)||g.setParameter(b.f5.AlphaCutoff,M.Ru.fromCopyNumber(null!==(h=null==o?void 0:o.alphaCutoff)&&void 0!==h?h:.5))),L.Is.exist(null===(u=null==o?void 0:o.extensions)||void 0===u?void 0:u.KHR_materials_transmission)&&(g.alphaMode=x.F.Translucent);const P=null==o?void 0:o.doubleSided;if(null!=P&&(g.cullFace=!P),L.Is.exist(o.diffuseColorTexture)){const e=o.diffuseColorTexture,t=W._createTexture(e,n,{autoDetectTransparency:null==I?void 0:I.autoDetectTextureTransparency}),i=W._createSampler(e);if(g.setTextureParameter(b.f5.DiffuseColorTexture,t,i),this._checkRnGltfLoaderOptionsExist(n)&&(null===(m=null===(d=n.asset.extras)||void 0===d?void 0:d.rnLoaderOptions)||void 0===m?void 0:m.loaderExtension)){const t=n.asset.extras.rnLoaderOptions.loaderExtension;t.setUVTransformToTexture&&t.setUVTransformToTexture(g,e.samplerObject)}}if(L.Is.exist(null==o?void 0:o.diffuseColorFactor)){const e=null==o?void 0:o.diffuseColorFactor;g.setParameter(b.f5.DiffuseColorFactor,p.Lt.fromCopyArray4(e))}const D=null==o?void 0:o.normalTexture;if(null!=D&&L.Is.falsy(y)){const e=W._createTexture(D.texture,n),t=W._createSampler(D.texture);g.setTextureParameter(b.f5.NormalTexture,e,t),parseFloat(null===(f=n.asset)||void 0===f?void 0:f.version)>=2&&(null!=D.texCoord&&g.setParameter(b.f5.NormalTexcoordIndex,D.texCoord),null!=D.scale&&g.setParameter(b.f5.NormalScale,D.scale))}if(W._setupTextureTransform(D,g,b.f5.NormalTextureTransform,b.f5.NormalTextureRotation),this._checkRnGltfLoaderOptionsExist(n)){const e=null===(A=null===(v=n.asset.extras)||void 0===v?void 0:v.rnLoaderOptions)||void 0===A?void 0:A.loaderExtension;null!=(null==e?void 0:e.setupMaterial)&&e.setupMaterial(n,o,g)}return g}static _createSampler(e){var t,n,i,o;const a=new Q.Z({magFilter:L.Is.exist(null===(t=e.samplerObject)||void 0===t?void 0:t.magFilter)?N.d.from(e.samplerObject.magFilter):N.d.Linear,minFilter:L.Is.exist(null===(n=e.samplerObject)||void 0===n?void 0:n.minFilter)?N.d.from(e.samplerObject.minFilter):N.d.Linear,wrapS:L.Is.exist(null===(i=e.samplerObject)||void 0===i?void 0:i.wrapS)?N.d.from(e.samplerObject.wrapS):N.d.Repeat,wrapT:L.Is.exist(null===(o=e.samplerObject)||void 0===o?void 0:o.wrapT)?N.d.from(e.samplerObject.wrapT):N.d.Repeat});return a.create(),a}static _createTexture(e,t,{autoDetectTransparency:n=!1}={}){var i,o,a,r,s,l,c;const _=null===(i=t.asset.extras)||void 0===i?void 0:i.rnLoaderOptions,h=new f.x;h.autoDetectTransparency=n,h.autoResize=!0===(null==_?void 0:_.autoResizeTexture);const u={magFilter:L.Is.exist(null===(o=e.samplerObject)||void 0===o?void 0:o.magFilter)?N.d.from(e.samplerObject.magFilter):N.d.Linear,minFilter:L.Is.exist(null===(a=e.samplerObject)||void 0===a?void 0:a.minFilter)?N.d.from(e.samplerObject.minFilter):N.d.Linear,wrapS:L.Is.exist(null===(r=e.samplerObject)||void 0===r?void 0:r.wrapS)?N.d.from(e.samplerObject.wrapS):N.d.Repeat,wrapT:L.Is.exist(null===(s=e.samplerObject)||void 0===s?void 0:s.wrapT)?N.d.from(e.samplerObject.wrapT):N.d.Repeat},d=e.image;if(d.image){const e=d.image;!(null===(l=B.F.getWebGLResourceRepository().currentWebGLContextWrapper)||void 0===l?void 0:l.isWebGL2)&&!this.__sizeIsPowerOfTwo(e)&&this.__needResizeToPowerOfTwoOnWebGl1(u)&&(h.autoResize=!0),h.generateTextureFromImage(e)}else d.basis?h.generateTextureFromBasis(d.basis,{}):d.ktx2&&h.generateTextureFromKTX2(d.ktx2);if(d.uri)h.name=d.uri;else{const e=null===(c=d.mimeType)||void 0===c?void 0:c.split("/")[1];h.name=d.name+`.${e}`}return h}static __needResizeToPowerOfTwoOnWebGl1(e){return e.wrapS!==N.d.ClampToEdge||e.wrapT!==N.d.ClampToEdge||e.minFilter!==N.d.Linear&&e.minFilter!==N.d.Nearest}static __sizeIsPowerOfTwo(e){const t=e.width,n=e.height;return 0==(t&t-1)&&0==(n&n-1)}static __needParameterInitialization(e,t){return null!=e&&(null!=t.match(/PbrUber/)||null!=t.match(/ClassicUber/))}static _checkRnGltfLoaderOptionsExist(e){var t;return!!(null===(t=e.asset.extras)||void 0===t?void 0:t.rnLoaderOptions)}static __rewrapWithTypedArray(e,t,n,i){return new e(t.buffer,n+t.byteOffset,i)}static _checkBytesPerComponent(e){let t=0;switch(e.componentType){case 5120:case 5121:t=1;break;case 5122:case 5123:t=2;break;case 5124:case 5125:case 5126:t=4}return t}static _checkComponentNumber(e){let t=0;switch(e.type){case"SCALAR":t=1;break;case"VEC2":t=2;break;case"VEC3":t=3;break;case"VEC4":t=4;break;case"MAT4":t=16}return t}static _checkDataViewMethod(e){let t="";switch(e.componentType){case 5120:t="getInt8";break;case 5121:t="getUint8";break;case 5122:t="getInt16";break;case 5123:t="getUint16";break;case 5124:t="getInt32";break;case 5125:t="getUint32";break;case 5126:t="getFloat32"}return t}static _isSystemLittleEndian(){return!!new Uint8Array(new Uint16Array([255]).buffer)[0]}static _readBinaryFromAccessorAndSetItToAccessorExtras(e,t){var n,i,o;const a=e.bufferViewObject;let r=(null!==(n=a.byteOffset)&&void 0!==n?n:0)+(null!==(i=e.byteOffset)&&void 0!==i?i:0),s=a.bufferObject.buffer;const l=this._checkComponentNumber(e),c=this._checkBytesPerComponent(e),_=this._checkDataViewMethod(e);L.Is.not.exist(e.extras)&&(e.extras={attributeName:"",toGetAsTypedArray:!0,typedDataArray:new Float32Array,componentN:0,componentBytes:4,dataViewMethod:""}),e.extras.componentN=L.Is.exist(null===(o=e.extras)||void 0===o?void 0:o.weightsArrayLength)?e.extras.weightsArrayLength:l,e.extras.componentBytes=c,e.extras.dataViewMethod=_;const h=c*l*e.count;if(L.Is.exist(t)){const n=t[e.bufferViewObject.buffer],i=this.__getRnBufferView(a,n);s=this.__getRnAccessor(e,i).getUint8Array(),r=0}let u=new Float32Array;const d=[];if(W._isSystemLittleEndian()){let e=new Float32Array;"getFloat32"===_?e=this.__rewrapWithTypedArray(Float32Array,s,r,h/c):"getInt8"===_?e=new Int8Array(s,r,h/c):"getUint8"===_?e=new Uint8Array(s,r,h/c):"getInt16"===_?e=this.__rewrapWithTypedArray(Int16Array,s,r,h/c):"getUint16"===_?e=this.__rewrapWithTypedArray(Uint16Array,s,r,h/c):"getInt32"===_?e=this.__rewrapWithTypedArray(Int32Array,s,r,h/c):"getUint32"===_&&(e=this.__rewrapWithTypedArray(Uint32Array,s,r,h/c)),u=this.__normalizeTypedArrayToFloat32Array(_,e)}else{const t=new DataView(s.buffer,r+s.byteOffset,h),n=c*l,i=!0;for(let o=0;o{if(L.Is.exist(t.children))for(const a of t.children){const t=n[a];L.Is.exist(t)&&(o.getSceneGraph().addChild(t.getSceneGraph()),i(e.nodes[a],t))}};for(const i of e.nodes)if(L.Is.exist(i.skinObject)){const e=i.skinObject.joints;for(const i of e){const e=t[i],o=V._.createGroupEntity();o.getTransform().localMatrix=e.getTransform().localMatrix,n[i]=o}}for(const t of e.nodes)if(L.Is.exist(t.skinObject)){const e=n[t.skinObject.joints[0]];i(t.skinObject.jointsObjects[0],e)}for(let i=0;i{"use strict";n.d(t,{z:()=>c});var i=n(7015),o=n(1409),a=n(1350),r=n(1296),s=n(3449),l=n(4690);class c{static importBillboard(e,t){if(!l.Is.not.exist(e.extensionsUsed)&&-1!==e.extensionsUsed.findIndex((e=>"RHODONITE_billboard"===e)))for(const n in e.nodes){const i=t[n],o=e.nodes[n],a=i.getSceneGraph();void 0!==o.extensions&&void 0!==o.extensions.RHODONITE_billboard&&!0===o.extensions.RHODONITE_billboard.isBillboard&&(a.isBillboard=!0)}}static importEffect(e,t){if(l.Is.not.exist(e.extensions)||l.Is.not.exist(e.extensions.RHODONITE_effekseer)||-1===e.extensionsUsed.findIndex((e=>"RHODONITE_effekseer"===e)))return;const o=t.getTagValue("rnEntities"),r=e.extensions.RHODONITE_effekseer.effects;for(const t of r){const r=o[t.node],c=a.g.addComponentToEntity(i.D,r),h=c.getEffekseer();h.playJustAfterLoaded=!0,h.isLoop=!0,l.Is.exist(t.bufferView)?e.buffers[0].bufferPromise.then((n=>{const i=s.j.createUint8ArrayFromBufferViewInfo(e,t.bufferView,n);h.arrayBuffer=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),h.type="efkpkg"})):l.Is.exist(t.uri)?(h.uri=t.uri,h.type="efk"):console.error("No real effect data."),_(c,t);const u=n(6893).Zlib.Unzip;i.D.Unzip=u}}}function _(e,t){const n=e.getComponentByComponentTID(o.zz.EffekseerComponentTID);if(l.Is.exist(n)&&(n.playJustAfterLoaded=!0,n.isLoop=!0,l.Is.exist(t.timelines))){const n=t.timelines;for(const t of n){const n=t.values,i=t.name,s=n.map((e=>({input:e.input,event:e.event})));let c,_=e.tryToGetAnimation();l.Is.not.exist(_)&&(c=a.g.addComponentToEntity(o.cw,e)),_=c.getAnimation(),_.setAnimation(l.Is.exist(i)?i:"Default","effekseer",new Float32Array(s.map((e=>e.input))),new Float32Array(s.map((e=>"play"===e.event?1:(e.event,0)))),1,r.kO.Step,!0)}}}},7864:(e,t,n)=>{"use strict";n.d(t,{mNG:()=>D.mN,qfN:()=>ge.qf,lam:()=>r.l,bCT:()=>D.bC,mC0:()=>i.m,PxB:()=>pt.P,XAY:()=>D.XA,lJH:()=>D.lJ,VI2:()=>vt,yEY:()=>On.y,OxW:()=>D.Ox,U_s:()=>bn.U,yd$:()=>St,FvO:()=>f.Fv,tVY:()=>Ue,sdx:()=>f.sd,cwg:()=>r.cw,kOi:()=>f.kO,Sy_:()=>Ct,JRY:()=>wt,RDh:()=>re,l6R:()=>f.l6,xTt:()=>r.xT,afv:()=>Pt,fgK:()=>Mt,Nh_:()=>f.Nh,lWr:()=>En.l,$HW:()=>f.$H,qP0:()=>Tn.q,FOu:()=>Se.F,CtF:()=>be.Ct,Myt:()=>r.My,SPq:()=>r.SP,MyC:()=>f.My,iM5:()=>f.iM,h_U:()=>an.h,sZ3:()=>D.sZ,tWC:()=>D.tW,et4:()=>fe,wA2:()=>s.w,C2e:()=>l.C,reR:()=>f.re,dh2:()=>f.dh,bfi:()=>f.bf,DeH:()=>c.D,SGm:()=>D.SG,zUz:()=>D.zU,igI:()=>D.ig,HOX:()=>D.HO,R1o:()=>D.R1,p8_:()=>D.p8,GYQ:()=>D.GY,cV0:()=>D.cV,n9W:()=>D.n9,GFx:()=>Bt,Xv:()=>se.X,BtG:()=>wn.B,fZl:()=>rn.f,j4H:()=>be.j4,kTl:()=>Tt.kT,Q5_:()=>sn.Q,tlJ:()=>ln.t,jLO:()=>Lt,c5O:()=>Xe,Lfs:()=>Vn.Lf,_QQ:()=>Vn._Q,lOB:()=>Vn.lO,k$j:()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z,OHV:()=>w,j37:()=>be.j3,vAU:()=>r.vA,LSm:()=>be.LS,Dhi:()=>He,jeP:()=>je,CWu:()=>be.CW,$z2:()=>be.$z,Lx$:()=>Tt.Lx,pnp:()=>Tt.pn,mge:()=>Tt.mg,$RV:()=>Tt.$R,GVY:()=>Tt.GV,Dx8:()=>Tt.Dx,OTk:()=>A,nnL:()=>D.nn,w08:()=>D.w0,GWg:()=>D.GW,t5w:()=>D.t5,vk8:()=>D.vk,PFe:()=>D.PF,Ffi:()=>D.Ff,Upt:()=>D.Up,Dq2:()=>D.Dq,VIV:()=>D.VI,hxV:()=>D.hx,JIQ:()=>D.JI,EYp:()=>Vn.EY,fKE:()=>D.fK,lxk:()=>D.lx,tSN:()=>be.tS,JxS:()=>be.WF,t0P:()=>be.t0,fK9:()=>be.fK,OBD:()=>be.OB,bhs:()=>be.bh,ZsA:()=>be.Zs,fYc:()=>be.fY,eD0:()=>be.eD,Cb2:()=>Tt.Cb,lsI:()=>Fn.l,QjB:()=>be.Qj,nsy:()=>D.ns,p8g:()=>D.eI,n5i:()=>D.n5,QUJ:()=>D.QU,XgD:()=>D.Xg,vVE:()=>be.vV,YUA:()=>be.YU,ozT:()=>be.oz,EY5:()=>be.EY,Rlh:()=>D.Rl,_7O:()=>D._7,NBV:()=>Tt.NB,wv6:()=>be.wv,kSU:()=>be.kS});var i=n(3658),o=n(6547),a=n(4478),r=n(1409),s=n(9721),l=n(2404),c=n(3258),_=n(1328),h=n(1350),u=n(7348),d=n(9286),m=n(9002),f=n(1296);const p=Symbol();class v{constructor(e){this.__raw=e}}Object.defineProperty(v.prototype,"getComponentFromEntities",{enumerable:!1,writable:!1,configurable:!0,value:function(e){const t=this.__raw,n=[];return t.forEach((t=>{const i=t.getComponentByComponentTID(e.componentTID);null!=i&&n.push(i)})),n}});const A=()=>{Object.defineProperty(Array.prototype,"Rn",{enumerable:!1,configurable:!1,get(){return new v(this)}})};var y=n(4587),g=n(4690),x=n(4350),I=n(3999),b=n(3449),E=n(7461),T=n(810),S=n(8491),C=n(4710);function w(e,t){let n=!1;const i=e.extras.bufferViewByteLengthAccumulatedArray.length-1,o=[];for(let a=0;a.5?"play":"pause"};o.push(i)}const a={name:t,values:o};i.push(a)}}}t.timelines=i}}var P=n(7192),D=n(4020);const M=n(5337).Z,N="glTF",B="glTF-Binary",L="glTF-Draco",F="glTF-Embedded",G="No-Download";class V{constructor(){}static async export(e,t={entities:void 0,type:B}){const{collectedEntities:n,topLevelEntities:i}=this.__collectEntities(t),{json:o,fileName:a}=this.__createJsonBase(e);this.__createBufferViewsAndAccessors(o,n),this.__createNodes(o,n,i),await this.__createMaterials(o,n,t),w(o,n);const r=this.__createBinary(o);this.__deleteEmptyArrays(o);const s=function(e,t){delete e.buffers[0].uri;let n=JSON.stringify(e,null,2),i=b.j.stringToBuffer(n);const o=b.j.calcPaddingBytes(i.byteLength,4);if(o>0){for(let e=0;e{if(g.Is.exist(e)&&g.Is.exist(e.excludeTags)){for(const n of e.excludeTags)if(t.matchTag(n.tag,n.value))return!1;if(t.matchTag("Being","gizmo"))return!0}return!0},n=t=>{if(g.Is.exist(e)&&g.Is.exist(e.excludeTags))for(const n of e.excludeTags)if(t.matchTag(n.tag,n.value))return[];return[t]},i=(e,t)=>{const o=e.getSceneGraph();if(o.children.length>0){const a=t?[]:n(e);for(let e=0;e0){const n=e.entities.flatMap((e=>i(e,!0)));let o=[];e.entities.forEach((e=>{-1===n.indexOf(e)&&t(e)&&o.push(e)}));let a=e.entities.concat();return Array.prototype.push.apply(a,n),a=[...new Set(a)],0===o.length&&(o=a),{collectedEntities:a,topLevelEntities:o}}let o=h.g._getEntities();o=o.filter((e=>t(e)));let a=S.a.getTopLevelComponents().flatMap((e=>e.entity));return a=a.filter((e=>t(e))),o=o.flatMap((e=>i(e,!0))),Array.prototype.push.apply(o,a),o=[...new Set(o)],{collectedEntities:o,topLevelEntities:a}}static __createJsonBase(e){const t=e||"Rhodonite_"+(new Date).getTime();return{json:{asset:{version:"2.0",generator:`Rhodonite (${M.version})`},buffers:[{uri:t+".bin",byteLength:0}],bufferViews:[],accessors:[],animations:[],meshes:[],skins:[],materials:[{pbrMetallicRoughness:{baseColorFactor:[1,1,1,1]}}],textures:[],images:[],extensionsUsed:[],extensions:{},extras:{rnSkins:[],bufferViewByteLengthAccumulatedArray:[]},cameras:[],samplers:[]},fileName:t}}static __createBufferViewsAndAccessors(e,t){const n=[],i=[],o=[];!function(e,t,n,i,o){for(let a=0;a{e.entity===t&&l.push(n)}));const c=r.getInverseBindMatricesAccessor();g.Is.exist(c)&&(te(e,n,i,c.bufferView),ne(e,e.bufferViews.length-1,o,c));const _=r.topOfJointsHierarchy,h=r._bindShapeMatrix;let u=-1;if(g.Is.exist(_)){const e=_.entity;u=t.indexOf(e)}else u=l[0];const d={joints:l,inverseBindMatrices:e.accessors.length-1,skeleton:u>=0?u:void 0,bindShapeMatrix:null==h?void 0:h.flattenAsArray()};e.skins.push(d)}}(e,t,n,i,o)}static __createNodes(e,t,n){e.nodes=[],e.scenes=[{nodes:[]}];const i=e.scenes[0];for(let e=0;e0){a.children=[];for(let e=0;e0&&(a.weights=e)}const h=i.tryToGetSkeletal();if(g.Is.exist(h)){const t=e.extras.rnSkins.indexOf(h.entity);t>=0&&(a.skin=t)}const u=i.tryToGetCamera();if(g.Is.exist(u)){let t;if(u.type===f.iM.Perspective){const e=u.getTagValue("OriginalAspect"),n=u.getTagValue("OriginalFovY");t={name:u.entity.uniqueName,type:"perspective",perspective:{aspectRatio:g.Is.exist(e)?e:u.aspect,yfov:g.Is.exist(n)?D.kj.degreeToRadian(n):D.kj.degreeToRadian(u.fovy),znear:u.zNear,zfar:u.zFar}}}else if(u.type===f.iM.Orthographic){const e=u.getTagValue("OriginalXMag"),n=u.getTagValue("OriginalYMag");t={name:u.entity.uniqueName,type:"orthographic",orthographic:{xmag:g.Is.exist(e)?e:u.xMag,ymag:g.Is.exist(n)?n:u.yMag,znear:u.zNear,zfar:u.zFar}}}e.cameras.push(t),a.camera=e.cameras.length-1}}n.forEach(((e,n)=>{const o=t.indexOf(e);o>=0&&i.nodes.push(o)}))}static async __createMaterials(e,t,n){let i=0;const o=[];e.extras.bufferViewByteLengthAccumulatedArray.push(0);const a=e.extras.bufferViewByteLengthAccumulatedArray.length-1;for(let r=0;r{if(i&&i.width>1&&i.height>1){let s=e.images.length,l=!1;for(let t=0;t(0,x.C)(t,e))),-1===c&&(e.samplers.push(t),c=e.samplers.length-1)}if(!l){const r={uri:i.name};r.rnTextureUID=i.textureUID,-1!==t.indexOf(i.name)&&(r.uri+="_"+i.textureUID),t.push(r.uri),g.Is.not.exist(r.uri.match(/\.(png)/))&&(r.uri+=".png");const s=i.htmlCanvasElement;if(s){const t=new Promise(((t,i)=>{s.toBlob((o=>{if(!g.Is.exist(o))throw Error("canvas to blob error!");J(e,a,o,n,r,t,i)}))}));o.push(t)}e.images.push(r)}const _={sampler:c,source:s};return-1===e.textures.indexOf(_)&&e.textures.push(_),e.textures.indexOf(_)}};let r,s=c.getParameter(y.f5.BaseColorTexture);if(null!=s)r=i(s[1],s[2]),null!=r&&(_.pbrMetallicRoughness.baseColorTexture={index:r});else if(s=c.getParameter(y.f5.DiffuseColorTexture),null!=s){const e=i(s[1],s[2]);null!=e&&(_.pbrMetallicRoughness.diffuseColorTexture={index:e})}s=c.getParameter(y.f5.MetallicRoughnessTexture),s&&(r=i(s[1],s[2]),null!=r&&(_.pbrMetallicRoughness.metallicRoughnessTexture={index:r})),s=c.getParameter(y.f5.NormalTexture),s&&(r=i(s[1],s[2]),null!=r&&(_.normalTexture={index:r})),s=c.getParameter(y.f5.OcclusionTexture),s&&(r=i(s[1],s[2]),null!=r&&(_.occlusionTexture={index:r})),s=c.getParameter(y.f5.EmissiveTexture),s&&(r=i(s[1],s[2]),null!=r&&(_.emissiveTexture={index:r}))}-1===e.materials.indexOf(_)&&e.materials.push(_),l.material=e.materials.indexOf(_)}}}return Promise.all(o)}static __createBinary(e){if(g.Is.undefined(e.accessors)||g.Is.undefined(e.bufferViews))return new ArrayBuffer(0);const t=e.extras.bufferViewByteLengthAccumulatedArray.reduce(((e,t)=>e+t));t>0&&(e.buffers[0].byteLength=t+b.j.calcPaddingBytes(t,4));const n=new ArrayBuffer(e.buffers[0].byteLength);let i=0;for(let t=0;te.isSame(t)))}function k(e,t){0===e.length&&e.push(t);const n=e.findIndex((e=>e.isSame(t))),i=-1===n?e.length:n;return-1===n&&e.push(t),i}function Q(e,t,n){return g.Is.exist(e[t])?e[t]+b.j.addPaddingBytes(n.byteLength,4):b.j.addPaddingBytes(n.byteLength,4)}function W(e){switch(e){case"translate":return"translation";case"quaternion":return"rotation";case"scale":return"scale";case"weights":return"weights";default:throw new Error("Invalid Path Name")}}function X(e,t,n,i){const o={sampler:t++,target:{path:W(e.target.pathName),node:i}};return n.channels.push(o),t}function q(e,t,n,i){const o={input:e,output:t,interpolation:n.sampler.interpolationMethod.GltfString};i.samplers.push(o)}function H(e,t,n,i){const o=I.r.fromTypedArray(ArrayBuffer.isView(t.sampler.input)?t.sampler.input:new Float32Array(t.sampler.input)),a=t.sampler.input.length,r=$({bufferIdx:n,bufferViewByteOffset:i,accessorByteOffset:0,accessorCount:a,bufferViewByteStride:I.r.Float.getSizeInBytes(),componentType:o,compositionType:T.d.Scalar,uint8Array:new Uint8Array(ArrayBuffer.isView(t.sampler.input)?t.sampler.input.buffer:new Float32Array(t.sampler.input).buffer)});e.bufferViews.push(r);const s=ee({bufferViewIdx:e.bufferViews.indexOf(r),accessorByteOffset:0,componentType:o,count:a,compositionType:T.d.Scalar,min:[t.sampler.input[0]],max:[t.sampler.input[t.sampler.input.length-1]]});return e.accessors.push(s),i=Y(0,r),{inputAccessorIdx:e.accessors.indexOf(s),inputBufferViewByteLengthAccumulated:i}}function j(e,t,n,i){const o=I.r.fromTypedArray(ArrayBuffer.isView(t.sampler.output)?t.sampler.output:new Float32Array(t.sampler.output)),a=t.target.pathName;let r=T.d.toGltf2AnimationAccessorCompositionType(t.sampler.outputComponentN),s=t.sampler.output.length/t.sampler.outputComponentN;"weights"===a&&(r=T.d.Scalar,s=t.sampler.output.length);const l=$({bufferIdx:n,bufferViewByteOffset:i,accessorByteOffset:0,accessorCount:s,bufferViewByteStride:o.getSizeInBytes()*t.sampler.outputComponentN,componentType:o,compositionType:r,uint8Array:new Uint8Array(ArrayBuffer.isView(t.sampler.output)?t.sampler.output.buffer:new Float32Array(t.sampler.output).buffer)});e.bufferViews.push(l);const c=ee({bufferViewIdx:e.bufferViews.indexOf(l),accessorByteOffset:0,componentType:o,count:s,compositionType:r});return e.accessors.push(c),i=Y(0,l),{outputAccessorIdx:e.accessors.indexOf(c),outputBufferViewByteLengthAccumulated:i}}function Y(e,t){return t.byteLength+b.j.calcPaddingBytes(t.byteLength,4)}function K(e){return e%4==0?e:e+(4-e%4)}async function J(e,t,n,i,o,a,r){if(i.type===N)setTimeout((()=>{const e=document.createElement("a"),t=new MouseEvent("click");e.href=URL.createObjectURL(n),e.download=o.uri,e.dispatchEvent(t),URL.revokeObjectURL(e.href)}),5e3*Math.random()),a();else{const i=new FileReader;i.addEventListener("load",(()=>{const n=i.result,r=Z(e,t,new Uint8ClampedArray(n));o.bufferView=e.bufferViews.indexOf(r),o.mimeType="image/png",delete o.uri,a()})),i.addEventListener("error",(()=>{r(i.error)})),i.readAsArrayBuffer(n)}}function Z(e,t,n){const i=e.extras.bufferViewByteLengthAccumulatedArray[t],o={buffer:t,byteLength:n.byteLength,byteOffset:i,extras:{uint8Array:n}},a=b.j.addPaddingBytes(o.byteLength,4)+i;return e.bufferViews.push(o),e.extras.bufferViewByteLengthAccumulatedArray[t]=a,o}function $({bufferIdx:e,bufferViewByteOffset:t,accessorByteOffset:n,accessorCount:i,bufferViewByteStride:o,componentType:a,compositionType:r,uint8Array:s}){const l=K(n),{fixedBufferViewByteLength:c,fixedBufferViewByteOffset:_}=function({accessorByteOffset:e,accessorCount:t,bufferViewByteStride:n,bufferViewByteOffset:i,sizeOfComponent:o,numberOfComponents:a}){const r=0===n?o*a:n;if(n%o!=0)throw Error("glTF2: When byteStride is defined, it MUST be a multiple of the size of the accessor’s component type.");const s=(_=r)%4==0?_:_+(4-_%4),l=K(e),c=o*a;var _;return{fixedBufferViewByteLength:l+s*(t-1)+o*a,fixedBufferViewByteOffset:K(i+(c-(l+i)%c))}}({accessorByteOffset:l,accessorCount:i,bufferViewByteStride:o,bufferViewByteOffset:t,sizeOfComponent:a.getSizeInBytes(),numberOfComponents:r.getNumberOfComponents()});return{buffer:e,byteLength:c,byteOffset:_,extras:{uint8Array:s}}}function ee({bufferViewIdx:e,accessorByteOffset:t,componentType:n,count:i,compositionType:o,min:a,max:r}){return{bufferView:e,byteOffset:K(t),componentType:I.r.toGltf2AccessorComponentType(n),count:i,type:o.str,min:a,max:r,extras:{}}}function te(e,t,n,i,o){const a=U(n,i);if(-1===a){const a=k(t,i.buffer),r={buffer:a,byteLength:i.byteLength,byteOffset:i.byteOffsetInBuffer,extras:{uint8Array:i.getUint8Array()}};return g.Is.exist(o)&&(r.target=o),e.extras.bufferViewByteLengthAccumulatedArray[a]=Q(e.extras.bufferViewByteLengthAccumulatedArray,a,r),n.push(i),e.bufferViews.push(r),r}return e.bufferViews[a]}function ne(e,t,n,i){const o=function(e,t){return e.findIndex((e=>e.isSame(t)))}(n,i);if(-1===o){const o={bufferView:t,byteOffset:i.byteOffsetInBufferView,componentType:I.r.toGltf2AccessorComponentType(i.componentType),count:i.elementCount,type:T.d.toGltf2AccessorCompositionTypeString(i.compositionType.getNumberOfComponents()),extras:{uint8Array:void 0}};return i.compositionType.getNumberOfComponents()<=4&&(o.max=i.max,o.min=i.min),n.push(i),e.accessors.push(o),o}return e.accessors[o]}var ie=n(128),oe=n(8696),ae=n(3713);class re extends ae.A{generate(e){var t;const n={length:null!==(t=e.length)&&void 0!==t?t:1,material:e.material},i=[new Float32Array([0,0,0,n.length,0,0,0,0,0,0,n.length,0,0,0,0,0,0,n.length]),new Float32Array([1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1])],o=[ie.T.Position.XYZ,ie.T.Color0.XYZ];this.copyVertexData({attributes:i,attributeSemantics:o,primitiveMode:oe.T.Lines,material:n.material})}}var se=n(7597);class le extends ae.A{generate(e){var t,n,i,o,a;const r={length:null!==(t=e.length)&&void 0!==t?t:1,division:null!==(n=e.division)&&void 0!==n?n:10,isXY:null===(i=e.isXY)||void 0===i||i,isXZ:null===(o=e.isXZ)||void 0===o||o,isYZ:null===(a=e.isYZ)||void 0===a||a,material:e.material},s=[];for(let e=0;e<2*r.division+3;e++){const t=-r.length,n=r.length/(r.division+1);r.isXZ&&(s.push(-r.length,0,t+n*e),s.push(r.length,0,t+n*e),s.push(t+n*e,0,-r.length),s.push(t+n*e,0,r.length)),r.isXY&&(s.push(-r.length,t+n*e,0),s.push(r.length,t+n*e,0),s.push(t+n*e,-r.length,0),s.push(t+n*e,r.length,0)),r.isYZ&&(s.push(0,-r.length,t+n*e),s.push(0,r.length,t+n*e),s.push(0,t+n*e,-r.length),s.push(0,t+n*e,r.length))}const l=[new Float32Array(s)],c=[ie.T.Position.XYZ];this.copyVertexData({attributes:l,attributeSemantics:c,primitiveMode:oe.T.Lines,material:null==r?void 0:r.material})}}var ce=n(2471);class _e extends ae.A{constructor(){super(...arguments),this.__worldPositionOfThisJoint=ce.P.fromCopyArray3([0,0,1]),this.__worldPositionOfParentJoint=ce.P.fromCopyArray3([0,0,0]),this.__width=1}generate(e){const t=ce.P.lengthBtw(this.__worldPositionOfThisJoint,this.__worldPositionOfParentJoint),n=this.__width,i=t-t/7.5,o=ce.P.subtract(this.__worldPositionOfParentJoint,this.__worldPositionOfThisJoint);let a=ce.P.fromCopyArray3([0,1,0]);o.isEqual(ce.P.zero())||(a=ce.P.normalize(ce.P.subtract(this.__worldPositionOfParentJoint,this.__worldPositionOfThisJoint)));const r=ce.P.add(this.__worldPositionOfThisJoint,ce.P.multiply(a,i));let s=ce.P.fromCopyArray3([0,1,0]),l=ce.P.fromCopyArray3([0,-1,0]);Math.abs(ce.P.dot(a,s))>.4&&(s=ce.P.fromCopyArray3([1,0,0]),l=ce.P.fromCopyArray3([-1,0,0])),Math.abs(ce.P.dot(a,s))>.4&&(s=ce.P.fromCopyArray3([0,0,1]),l=ce.P.fromCopyArray3([0,0,-1]));const c=ce.P.multiply(ce.P.normalize(ce.P.cross(a,s)),n),_=ce.P.multiply(ce.P.normalize(ce.P.cross(a,c)),n),h=ce.P.multiply(ce.P.normalize(ce.P.cross(a,l)),n),u=ce.P.multiply(ce.P.normalize(ce.P.cross(a,h)),n),d=ce.P.add(r,c),m=ce.P.add(r,_),f=ce.P.add(r,h),p=ce.P.add(r,u),v=[];v.push(this.__worldPositionOfThisJoint),v.push(d),v.push(this.__worldPositionOfThisJoint),v.push(m),v.push(this.__worldPositionOfThisJoint),v.push(f),v.push(this.__worldPositionOfThisJoint),v.push(p),v.push(d),v.push(m),v.push(m),v.push(f),v.push(f),v.push(p),v.push(p),v.push(d),v.push(this.__worldPositionOfParentJoint),v.push(d),v.push(this.__worldPositionOfParentJoint),v.push(m),v.push(this.__worldPositionOfParentJoint),v.push(f),v.push(this.__worldPositionOfParentJoint),v.push(p);const A=[];v.map((e=>{Array.prototype.push.apply(A,e.flattenAsArray())}));const y=[new Float32Array(A)],g=[ie.T.Position.XYZ];this.copyVertexData({attributes:y,attributeSemantics:g,primitiveMode:oe.T.Lines,material:null==e?void 0:e.material})}}class he extends ae.A{generate(e){var t,n,i;const o={startPos:null!==(t=e.startPos)&&void 0!==t?t:ce.P.fromCopy3(0,0,0),endPos:null!==(n=e.endPos)&&void 0!==n?n:ce.P.fromCopy3(1,0,0),hasTerminalMark:null===(i=e.hasTerminalMark)||void 0===i||i,material:e.material},a=[];if(a.push(...o.startPos.flattenAsArray()),a.push(...o.endPos.flattenAsArray()),o.hasTerminalMark){const e=.1*o.startPos.lengthTo(o.endPos);a.push(o.startPos.x-e,o.startPos.y,o.startPos.z),a.push(o.startPos.x+e,o.startPos.y,o.startPos.z),a.push(o.startPos.x,o.startPos.y,o.startPos.z-e),a.push(o.startPos.x,o.startPos.y,o.startPos.z+e),a.push(o.endPos.x-e,o.endPos.y,o.endPos.z),a.push(o.endPos.x+e,o.endPos.y,o.endPos.z),a.push(o.endPos.x,o.endPos.y,o.endPos.z-e),a.push(o.endPos.x,o.endPos.y,o.endPos.z+e)}const r=[new Float32Array(a)],s=[ie.T.Position.XYZ];this.copyVertexData({attributes:r,attributeSemantics:s,primitiveMode:oe.T.Lines,material:o.material})}}var ue=n(9561);class de extends ae.A{constructor(){super()}generate(e){var t,n,i;const o={radius:null!==(t=e.radius)&&void 0!==t?t:1,widthSegments:null!==(n=e.widthSegments)&&void 0!==n?n:10,heightSegments:null!==(i=e.heightSegments)&&void 0!==i?i:10,material:e.material},a=[],r=[],s=[];Math.abs(o.radius){const t=new ue.J;t.generate(e);const n=Ee(t);return be.Is.not.exist(e.direction)&&(e.direction="xz"),"xy"===e.direction?n.localEulerAngles=ce.P.fromCopy3(Math.PI/2,0,0):"yz"===e.direction&&(n.localEulerAngles=ce.P.fromCopy3(0,0,Math.PI/2)),n},createLine:(e={})=>{const t=new he;return t.generate(e),Ee(t)},createGrid:(e={})=>{const t=new le;return t.generate(e),Ee(t)},createCube:(e={})=>{const t=new se.X;return t.generate(e),Ee(t)},createSphere:(e={})=>{const t=new de;return t.generate(e),Ee(t)},createJoint:(e={})=>{const t=new _e;return t.generate(e),Ee(t)},createAxis:(e={})=>{const t=new re;return t.generate(e),Ee(t)},createShape:Ee});var Se=n(7987),Ce=n(8422),we=n(4392);class Re extends m.S{constructor(){super(),this.__colorAttachments=[],this.cgApiResourceUid=Se.F.InvalidCGAPIResourceUid,this.width=0,this.height=0,this.__colorAttachmentMap=new Map}get colorAttachmentsRenderBufferTargets(){return Array.from(this.__colorAttachmentMap.keys())}get colorAttachments(){return this.__colorAttachments}get depthAttachment(){return this.__depthAttachment}get stencilAttachment(){return this.__stencilAttachment}get depthStencilAttachment(){return this.__depthStencilAttachment}getColorAttachedRenderTargetTexture(e){return null!=this.__colorAttachments[e]&&this.__colorAttachments[e]instanceof we._?this.__colorAttachments[e]:void 0}getDepthAttachedRenderTargetTexture(){return this.__depthAttachment instanceof we._?this.__depthAttachment:void 0}create(e,t){this.width=e,this.height=t;const n=Se.F.getWebGLResourceRepository();return this.cgApiResourceUid=n.createFrameBufferObject(),this.cgApiResourceUid}get framebufferUID(){return this.cgApiResourceUid}setColorAttachmentAt(e,t){return t.width===this.width&&t.height===this.height&&(this.__colorAttachments[e]=t,Se.F.getWebGLResourceRepository().attachColorBufferToFrameBufferObject(this,e,t),this.__colorAttachmentMap.set(Ce.G.from(e),t),!0)}setDepthAttachment(e){return e.width===this.width&&e.height===this.height&&(this.__depthAttachment=e,Se.F.getWebGLResourceRepository().attachDepthBufferToFrameBufferObject(this,e),!0)}setStencilAttachment(e){return e.width===this.width&&e.height===this.height&&(this.__stencilAttachment=e,Se.F.getWebGLResourceRepository().attachStencilBufferToFrameBufferObject(this,e),!0)}setDepthStencilAttachment(e){return e.width===this.width&&e.height===this.height&&(this.__depthStencilAttachment=e,Se.F.getWebGLResourceRepository().attachDepthStencilBufferToFrameBufferObject(this,e),!0)}resize(e,t){Se.F.getWebGLResourceRepository().deleteFrameBufferObject(this.cgApiResourceUid),this.cgApiResourceUid=Se.F.InvalidCGAPIResourceUid,this.width=0,this.height=0,this.create(e,t),this.depthAttachment&&(this.depthAttachment.resize(e,t),this.setDepthAttachment(this.depthAttachment)),this.depthStencilAttachment&&(this.depthStencilAttachment.resize(e,t),this.setDepthStencilAttachment(this.depthStencilAttachment)),this.stencilAttachment&&(this.stencilAttachment.resize(e,t),this.setStencilAttachment(this.stencilAttachment));for(let n=0;n0)for(const n of t.animations)for(const i of n.channels){const n=this.__getCorrespondingEntityWithVrma(e,t,i.target.node);if(n){const o=h.g.addComponentToEntity(Ve.c,n).getAnimation(),a=t.extras.rnEntities[i.target.node],s=t.extensions.VRMC_vrm_animation.humanoidBoneNameMap.get(i.target.node);if(a.tryToSetUniqueName(s,!0),"0.x"===e.tryToGetVrm()._version){const e=new Oe.G(a);o.setAnimationRetarget(e)}else if("1.0"===e.tryToGetVrm()._version){const e=new r.B5(a);o.setAnimationRetarget(e)}}}return e}static getInstance(){return this.__instance||(this.__instance=new Ue),this.__instance}__getCorrespondingEntity(e,t,n,i,o,a){if(a){const n=e.getTagValue("rnEntitiesByNames"),o=t.nodes[i];return n.get(o.name)}if(g.Is.exist(n.extensions.VRM)){const t=n.extensions.VRM.humanoid.humanBones;let a;const r=new Map,s=new Map;for(const e of t)r.set(e.node,e.bone),s.set(e.name,e.bone);null!=o&&(a=s.get(o),null==a&&(a=r.get(i)));const l=e.getTagValue("humanoid_map_name_nodeId").get(a);if(null!=l)return e.getTagValue("rnEntities")[l];console.log(`humanoidBoneName: ${a}, nodeIndex: ${i}, nodeName: ${o}`)}else if(g.Is.exist(n.extensions.VRMC_vrm)){const t=n.extensions.VRMC_vrm.humanoid.humanBones;let a;const r=new Map;for(const e in t){const n=t[e];r.set(n.node,e)}null!=o&&(a=r.get(i));const s=e.getTagValue("humanoid_map_name_nodeId").get(a);if(null!=s)return e.getTagValue("rnEntities")[s];console.log(`humanoidBoneName: ${a}, nodeIndex: ${i}, nodeName: ${o}`)}}__getCorrespondingEntityWithVrma(e,t,n){const i=t.extensions.VRMC_vrm_animation.humanoidBoneNameMap.get(n),o=e.getTagValue("humanoid_map_name_nodeId").get(i);if(null!=o)return e.getTagValue("rnEntities")[o];console.log(`humanoidBoneName: ${i}, nodeIndex: ${n}`)}__isHips(e,t,n){const i=new Map;if(g.Is.exist(t.extensions.VRM)){const e=t.extensions.VRM.humanoid.humanBones;for(const t of e)i.set(t.node,t.bone)}else if(g.Is.exist(t.extensions.VRMC_vrm)){const e=t.extensions.VRMC_vrm.humanoid.humanBones;for(const t in e){const n=e[t];i.set(n.node,t)}}return e.getTagValue("humanoid_map_name_nodeId"),"hips"===i.get(n)}__setupAnimationForSameSkeleton(e,t,n,i,o){var a,s,l,c;if(t.animations)for(const e of t.animations)for(const t of e.samplers)Ge.e._readBinaryFromAccessorAndSetItToAccessorExtras(t.inputObject),Ge.e._readBinaryFromAccessorAndSetItToAccessorExtras(t.outputObject);if(t.animations&&t.animations.length>0)for(const _ of t.animations)for(const u of _.channels){const d=null===(s=null===(a=u.samplerObject)||void 0===a?void 0:a.inputObject)||void 0===s?void 0:s.extras.typedDataArray,m=null===(c=null===(l=u.samplerObject)||void 0===l?void 0:l.outputObject)||void 0===c?void 0:c.extras.typedDataArray,f=null!=u.samplerObject.interpolation?u.samplerObject.interpolation:"LINEAR",p=t.nodes[u.target.node],v=this.__getCorrespondingEntity(e,t,n,u.target.node,p.name,i);if(v){const i=h.g.addComponentToEntity(Ve.c,v).getAnimation();if("none"===o){let t="translate";t="translation"===u.target.path?"translate":"rotation"===u.target.path?"quaternion":u.target.path,"quaternion"===t?i.setAnimation(g.Is.exist(_.name)?_.name:"Untitled",t,d,m,4,ze.k.fromString(f)):"translate"===t&&this.__isHips(e,n,u.target.node)&&i.setAnimation(g.Is.exist(_.name)?_.name:"Untitled",t,d,m,3,ze.k.fromString(f))}else{const e=t.extras.rnEntities[u.target.node];let n;if("global"===o)n=new r.B5(e);else{if("absolute"!==o)throw new Error("unknown retarget mode");n=new r.l(e)}i.setAnimationRetarget(n)}}}}}var ke=n(4252),Qe=n(6098),We=n(3738);class Xe{constructor(){}async importPointCloud(e,t){const n=e.substring(0,e.lastIndexOf("/"))+"/",i=b.j.createDefaultGltfOptions();if(t&&t.files)for(const e in t.files)if("drc"===b.j.getExtension(e)){const o=await this.__decodeDraco(t.files[e],i,n,t);return new We.Ok(o)}const o=await b.j.fetchArrayBuffer(e);if(o.isErr())return new We.UG({message:"fetchArrayBuffer failed",error:o});const a=await this.__decodeDraco(o.unwrapForce(),i,n,t);return new We.Ok(a)}importArrayBuffer(e,t,n){const i=e.substring(0,e.lastIndexOf("/"))+"/",o=b.j.createDefaultGltfOptions();return this.__decodeDraco(t,o,i,n).catch((e=>{console.log("__loadFromArrayBuffer error",e)}))}async __loadFromArrayBuffer(e,t,n,i){const o=new DataView(e,0,20);let a;if(1179937895!==o.getUint32(0,!0)){const o=b.j.arrayBufferToString(e),r=JSON.parse(o);a=await this._loadAsTextJson(r,i,t,n).catch((e=>{console.log("this.__loadAsTextJson error",e)}))}else a=await this._loadAsBinaryJson(o,!0,e,i,t,n).catch((e=>{console.log("this.__loadAsBinaryJson error",e)}));return a}_getOptions(e,t,n){if(t.asset&&t.asset.extras&&t.asset.extras.rnLoaderOptions)for(const n in t.asset.extras.rnLoaderOptions)e[n]=t.asset.extras.rnLoaderOptions[n];for(const t in n)e[t]=n[t];return n&&n.loaderExtensionName&&"string"==typeof n.loaderExtensionName&&(null!=Rn[n.loaderExtensionName]?e.loaderExtension=Rn[n.loaderExtensionName].getInstance():(console.error(`${n.loaderExtensionName} not found!`),e.loaderExtension=void 0)),e}async _loadAsBinaryJson(e,t,n,i,o,a){const r=e.getUint32(12,t);if(1313821514!==e.getUint32(16,t))throw new Error("invalid chunkType of chunk0 in this binary glTF file.");const s=new Uint8Array(n,20,r),l=b.j.uint8ArrayToString(s),c=JSON.parse(l);i=this._getOptions(o,c,i);const _=new Uint8Array(n,20+r+8);void 0===c.asset.extras&&(c.asset.extras={fileType:"glTF",version:"2"}),this._mergeExtendedJson(c,i.extendedJson),c.asset.extras.rnLoaderOptions=i;try{await this._loadInner(_,a,c,i)}catch(e){console.log("this._loadInner error in _loadAsBinaryJson",e)}return c}async _loadAsTextJson(e,t,n,i){void 0===e.asset.extras&&(e.asset.extras={fileType:"glTF",version:"2"}),t=this._getOptions(n,e,t),this._mergeExtendedJson(e,t.extendedJson),e.asset.extras.rnLoaderOptions=t;try{await this._loadInner(void 0,i,e,t)}catch(e){console.log("this._loadInner error in _loadAsTextJson",e)}return e}_loadInner(e,t,n,i){const o=[];return o.push(this._loadResources(e,t,n,i,{shaders:[],buffers:[],images:[]})),o.push(new Promise(((e,t)=>{this._loadJsonContent(n,i),e()}))),Promise.all(o)}_loadJsonContent(e,t){this._loadDependenciesOfScenes(e),this._loadDependenciesOfNodes(e),this._loadDependenciesOfMeshes(e),this._loadDependenciesOfMaterials(e),this._loadDependenciesOfTextures(e),this._loadDependenciesOfJoints(e),this._loadDependenciesOfAnimations(e),this._loadDependenciesOfAccessors(e),this._loadDependenciesOfBufferViews(e),void 0===e.asset.extras&&(e.asset.extras={})}_loadDependenciesOfScenes(e){for(const t of e.scenes)for(const n in t.nodes)t.nodesObjects[n]=e.nodes[t.nodes[n]]}_loadDependenciesOfNodes(e){for(const t of e.nodes){if(t.children){g.Is.not.exist(t.childrenObjects)&&(t.childrenObjects=[]);for(const n in t.children)t.childrenObjects[n]=e.nodes[t.children[n]]}void 0!==t.mesh&&void 0!==e.meshes&&(t.meshObject=e.meshes[t.mesh]),void 0!==t.skin&&void 0!==e.skins&&(t.skinObject=e.skins[t.skin],void 0===t.meshObject.extras&&(t.meshObject.extras={}),t.meshObject.extras._skin=t.skin),void 0!==t.camera&&void 0!==e.cameras&&(t.cameraObject=e.cameras[t.camera]),void 0!==t.extensions&&void 0!==e.extensions&&void 0!==e.extensions.KHR_lights_punctual&&(t.extensions.KHR_lights_punctual.lightIndex=t.extensions.KHR_lights_punctual.light,t.extensions.KHR_lights_punctual.light=e.extensions.KHR_lights_punctual.lights[t.extensions.KHR_lights_punctual.lightIndex])}}_loadDependenciesOfMeshes(e){for(const t of e.meshes)for(const n of t.primitives){void 0!==n.material&&(n.materialObject=e.materials[n.material]);for(const t in n.attributes){const i=n.attributes[t],o=e.accessors[i];o.extras={toGetAsTypedArray:!0,attributeName:t},n.attributesObjects[t]=o}if(null!=n.indices&&(n.indicesObject=e.accessors[n.indices]),null!=n.targets){n.targetsObjects=[];for(const t of n.targets){const i={};for(const n in t){const o=t[n];if(o>=0){const t=e.accessors[o];t.extras={toGetAsTypedArray:!0,attributeName:n},i[n]=t}}n.targetsObjects.push(i)}}}}_checkRnGltfLoaderOptionsExist(e){return!(!e.asset.extras||!e.asset.extras.rnLoaderOptions)}_loadDependenciesOfMaterials(e){if(e.textures||(e.textures=[]),e.materials)for(const t of e.materials){if(t.pbrMetallicRoughness){const n=t.pbrMetallicRoughness.baseColorTexture;void 0!==n&&(n.texture=e.textures[n.index]);const i=t.pbrMetallicRoughness.metallicRoughnessTexture;void 0!==i&&(i.texture=e.textures[i.index])}const n=t.normalTexture;void 0!==n&&(n.texture=e.textures[n.index]);const i=t.occlusionTexture;void 0!==i&&(i.texture=e.textures[i.index]);const o=t.emissiveTexture;void 0!==o&&(o.texture=e.textures[o.index]),this._checkRnGltfLoaderOptionsExist(e)&&e.asset.extras.rnLoaderOptions.loaderExtension&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures(e,t)}}_loadDependenciesOfTextures(e){if(e.textures)for(const t of e.textures)(0,Qe.Jx)((n=>{t.samplerObject=e.samplers[n]}),t.sampler),void 0!==t.source&&(t.image=e.images[t.source])}_loadDependenciesOfJoints(e){if(e.skins)for(const t of e.skins)if(g.Is.exist(t.skeleton)){t.skeletonObject=e.nodes[t.skeleton],(0,Qe.Jx)((n=>t.inverseBindMatricesObject=e.accessors[n]),t.inverseBindMatrices),(0,Qe.fY)((()=>t.skeletonObject=e.nodes[t.joints[0]]),t.skeleton),t.jointsObjects=[];for(const n of t.joints)t.jointsObjects.push(e.nodes[n])}}_loadDependenciesOfAnimations(e){if(e.animations)for(const t of e.animations){for(const n of t.channels)n.samplerObject=t.samplers[n.sampler],n.target.nodeObject=e.nodes[n.target.node];for(const n of t.channels)if(g.Is.exist(n.samplerObject)&&(n.samplerObject.inputObject=e.accessors[n.samplerObject.input],n.samplerObject.outputObject=e.accessors[n.samplerObject.output],void 0===n.samplerObject.outputObject.extras&&(n.samplerObject.outputObject.extras={}),"rotation"===n.target.path&&(n.samplerObject.outputObject.extras.quaternionIfVec4=!0),"weights"===n.target.path)){const e=n.samplerObject.outputObject.count/n.samplerObject.inputObject.count;n.samplerObject.outputObject.extras.weightsArrayLength=e}}}_loadDependenciesOfAccessors(e){for(const t of e.accessors)if(null==t.bufferView&&(t.bufferView=0),t.bufferViewObject=e.bufferViews[t.bufferView],null!=t.sparse){const n=t.sparse;n.indices.bufferViewObject=e.bufferViews[n.indices.bufferView],n.values.bufferViewObject=e.bufferViews[n.values.bufferView]}}_loadDependenciesOfBufferViews(e){for(const t of e.bufferViews)void 0!==t.buffer&&(t.bufferObject=e.buffers[t.buffer])}_mergeExtendedJson(e,t){let n=null;if(t instanceof ArrayBuffer){const e=b.j.arrayBufferToString(t);n=JSON.parse(e)}else"string"==typeof t?n=JSON.parse(t):"object"==typeof t&&(n=t);Object.assign(e,n)}_loadResources(e,t,n,i,o){const a=[];let r;for(const s in n.buffers){const l=n.buffers[s];let c,_;l.uri&&(c=l.uri.split("/"),_=c[c.length-1]),r=void 0===l.uri?new ke.n(((t,n)=>{o.buffers[s]=e,l.buffer=e,t(e)})):l.uri.match(/^data:application\/(.*);base64,/)?new ke.n(((e,t)=>{const n=b.j.dataUriToArrayBuffer(l.uri);o.buffers[s]=new Uint8Array(n),l.buffer=new Uint8Array(n),e(n)})):i.files&&i.files[_]?new ke.n(((e,t)=>{const n=i.files[_];o.buffers[s]=new Uint8Array(n),l.buffer=new Uint8Array(n),e(n)})):new ke.n(b.j.loadResourceAsync(t+l.uri,!0,((e,t)=>{o.buffers[s]=new Uint8Array(t),l.buffer=new Uint8Array(t),e(t)}),((e,t)=>{}))),l.bufferPromise=r,a.push(r)}for(const r in n.images){const s=r,l=n.images[s];let c;if(void 0===l.uri){let t=e;null==e&&(t=n.bufferViews[l.bufferView].bufferObject.buffer);const i=b.j.createUint8ArrayFromBufferViewInfo(n,l.bufferView,e);c=b.j.createBlobImageUriFromUint8Array(i,l.mimeType)}else{const e=l.uri,n=e.split("/"),o=n[n.length-1];if(i.files&&i.files[o]){const e=i.files[o];c=b.j.createBlobImageUriFromUint8Array(new Uint8Array(e),l.mimeType)}else c=e.match(/^data:/)?e:t+e}const _=b.j.createImageFromUri(c,l.mimeType).then((e=>{e.crossOrigin="Anonymous",o.images[s]=e,l.image=e}));a.push(_)}if(i.defaultTextures){const e=i.defaultTextures.basePath,t=i.defaultTextures.textureInfos;for(const n of t){const t=n.fileName,i=e+t,o=b.j.getExtension(t),r=b.j.getMimeTypeFromExtension(o),s=b.j.createImageFromUri(i,r).then((e=>{e.crossOrigin="Anonymous",n.image={image:e}}));a.push(s)}}return Promise.all(a).catch((e=>{console.log("Promise.all error",e)}))}static getInstance(){return this.__instance||(this.__instance=new Xe),this.__instance}__decodeDraco(e,t,n,i){return this.__decodeBuffer(e).then((e=>{const o=JSON.stringify(e),a=JSON.parse(o);return this._loadAsTextJson(a,i,t,n).catch((e=>{console.log("this.__loadAsTextJson error",e)}))}))}__decodeBuffer(e){const t=new DracoDecoderModule,n=new t.Decoder,i=this.__getGeometryFromDracoBuffer(t,n,e);if(null==i)throw new Error("invalid dracoGeometry.");if(i.geometryType!==t.POINT_CLOUD)throw new Error("invalid geometryType of drc file.");if(-1===n.GetAttributeId(i,t.POSITION))throw t.destroy(n),t.destroy(i),new Error("Draco: No position attribute found.");const o=["POSITION","NORMAL","COLOR","TEX_COORD","GENERIC"],a=i.num_points(),r=[],s=[];let l=0;for(let e=0;e{e(o)}))}__setBuffersToJSON(e,t){return this.__convertBufferToURI(e.buffer).then((n=>{t.buffers=[{name:"input",byteLength:e.byteLength,uri:n}]})).catch((e=>{console.log("this.__convertBufferToURI error:",e)}))}__convertBufferToURI(e){return new Promise(((t,n)=>{const i=new Blob([e],{type:"application/octet-stream"}),o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=()=>{n(o.error)},o.readAsDataURL(i)}))}__setAccessorsAndBufferViewsToJSON(e,t,n,i){const o=[],a=[];let r=0;for(let i=0,s=0;i{for(let n=0;nt[e]));const s=[];for(const t in i.bones){const n=i.bones[t],o=e.asset.extras.rnEntities[n];this.__addSpringBoneRecursively(r,o,i,s)}n.push(r)}for(const e of n)this.__addPhysicsComponent(e,e.rootBone)}static __addSpringBoneRecursively(e,t,n,i){const o=t.getSceneGraph().children;if(!i.includes(t)){const o=new it(t);o.dragForce=n.dragForce,o.stiffnessForce=n.stiffiness,o.gravityPower=n.gravityPower,o.gravityDir=ce.P.fromCopyArray([n.gravityDir.x,n.gravityDir.y,n.gravityDir.z]),o.hitRadius=n.hitRadius,e.bones.push(o),i.push(t)}for(const t of o)this.__addSpringBoneRecursively(e,t.entity,n,i)}static __addPhysicsComponent(e,t){const n=t.entity;h.g.addComponentToEntity(Ze.Z,n).getPhysics().strategy.setSpring(e)}static _createTextures(e){e.textures||(e.textures=[]);const t=e.textures,n=[];for(let i=0;i({entityIdx:e.extras.rnEntities[t.node].entityUID,blendShapeIdx:t.index,weight:t.weight}))));const r={name:t,isBinary:n.isBinary,binds:i};o.push(r)}const s=h.g.addComponentToEntity(r.ZA,t);s.getVrm().setVrmExpressions(o),s.getVrm()._version="1.0"}static _readVRMHumanoidInfo(e,t){const n=e.extensions.VRMC_vrm.humanoid.humanBones,i=new Map;for(const e in n){const t=n[e];i.set(e,t.node)}null!=t&&t.tryToSetTag({tag:"humanoid_map_name_nodeId",value:i})}static _readSpringBone(e){var t,n;const i=[];if(g.Is.exist(null===(t=e.extensions.VRMC_springBone)||void 0===t?void 0:t.colliderGroups))for(const t in e.extensions.VRMC_springBone.colliderGroups){const n=e.extensions.VRMC_springBone.colliderGroups[t],o=new et;i.push(o);for(const t of n.colliders){const n=e.extensions.VRMC_springBone.colliders[t],i=e.asset.extras.rnEntities[n.node].getSceneGraph();if(g.Is.exist(n.shape.sphere)){const e=new $e;e.baseSceneGraph=i,e.position=ce.P.fromCopyArray([n.shape.sphere.offset[0],n.shape.sphere.offset[1],n.shape.sphere.offset[2]]),e.radius=n.shape.sphere.radius,o.sphereColliders.push(e)}else if(g.Is.exist(n.shape.capsule)){const e=new at;e.baseSceneGraph=i,e.position=ce.P.fromCopyArray([n.shape.capsule.offset[0],n.shape.capsule.offset[1],n.shape.capsule.offset[2]]),e.radius=n.shape.capsule.radius,e.tail=ce.P.fromCopyArray([n.shape.capsule.tail[0],n.shape.capsule.tail[1],n.shape.capsule.tail[2]]),o.capsuleColliders.push(e)}}}const o=[];if(g.Is.exist(null===(n=e.extensions.VRMC_springBone)||void 0===n?void 0:n.springs))for(const t of e.extensions.VRMC_springBone.springs){const n=t.joints[0],a=e.asset.extras.rnEntities[n.node],r=new tt(a.getSceneGraph());r.tryToSetUniqueName(t.name,!0);const s=g.Is.exist(t.colliderGroups)?t.colliderGroups:[];r.colliderGroups=s.map((e=>i[e]));const l=[];for(const n in t.joints){const i=t.joints[n],o=e.asset.extras.rnEntities[i.node],a=new it(o);a.dragForce=i.dragForce,a.stiffnessForce=i.stiffness,a.gravityPower=g.Is.exist(i.gravityPower)?i.gravityPower:1,a.gravityDir=g.Is.exist(i.gravityDir)?ce.P.fromCopyArray3([i.gravityDir[0],i.gravityDir[1],i.gravityDir[2]]):ce.P.fromCopyArray3([0,-1,0]),a.hitRadius=i.hitRadius,r.bones.push(a),l.push(o)}this.__addSpringBoneRecursively(r,a,l),o.push(r)}for(const e of o)this.__addPhysicsComponent(e,e.rootBone)}static __addSpringBoneRecursively(e,t,n){const i=t.getSceneGraph().children;if(!n.includes(t)){const i=new it(t);e.bones.push(i),n.push(t)}for(const t of i)this.__addSpringBoneRecursively(e,t.entity,n)}static __addPhysicsComponent(e,t){const n=t.entity;h.g.addComponentToEntity(Ze.Z,n).getPhysics().strategy.setSpring(e)}static _createTextures(e){e.textures||(e.textures=[]);const t=e.textures,n=[];for(let i=0;i=0?(n.__isImportVRM0x=!1,i.asset.extras.rnLoaderOptions.__isImportVRM0x=!1,n.__importedType="vrm1",await ut.__importVRM(i,t)):i.extensionsUsed.indexOf("VRM")>=0&&(n.__importedType="vrm0x",await ot.__importVRM0x(i,t)),new We.Ok}return(0,We.Z6)(e),new We.UG({message:e.getRnError().message,error:void 0})}default:return new We.UG({message:"detect invalid format",error:void 0})}}static __getFileTypeFromFilePromise(e,t,n){return null!=n?qe.T.fromString(n):He({[e]:t.files[e]})}}var mt=n(1220);class ft{static async importFromUri(e){const t=await Ye.Z.importFromUri(e,{});if(t.isErr())return new We.UG({message:"Failed to import VRM file.",error:t});(0,We.UD)(t);const n=t.get();return this.readHumanoid(n),new We.Ok(n)}static async importFromArrayBuffer(e){const t=await Ye.Z.importFromArrayBuffers({"data.glb":e},{});if(t.isErr())return new We.UG({message:"Failed to import VRM file.",error:t});(0,We.UD)(t);const n=t.get();return this.readHumanoid(n),new We.Ok(n)}static readHumanoid(e){var t;const n=null===(t=e.extensions.VRMC_vrm_animation.humanoid)||void 0===t?void 0:t.humanBones;if(g.Is.not.exist(n))return;const i=new Map;e.extensions.VRMC_vrm_animation.humanoidBoneNameMap=i;for(const e in n){const t=n[e];i.set(t.node,e)}}}var pt=n(5868);class vt extends m.S{constructor(e,t,n){super(),this.__inputs=[],this.__outputs=[],this.__inputConnections=[],this.__shaderFunctionName=e,this.__shaderCode=t,this.__shaderNodeUid=++vt.__invalidShaderNodeCount,vt._shaderNodes[vt.__invalidShaderNodeCount]=this,this.__shader=n}addInputConnection(e,t,n){this.__inputConnections.push({shaderNodeUid:e.shaderNodeUid,outputNameOfPrev:t,inputNameOfThis:n})}get shaderFunctionName(){return this.__shaderFunctionName}get shaderCode(){return this.__shaderCode}get shaderNodeUid(){return this.__shaderNodeUid}getInput(e){for(const t of this.__inputs)if(t.name===e)return t}getInputs(){return this.__inputs}getOutput(e){for(const t of this.__outputs)if(t.name===e)return t}getOutputs(){return this.__outputs}get inputConnections(){return this.__inputConnections}get shader(){return this.__shader}}vt._shaderNodes=[],vt.__invalidShaderNodeCount=-1;var At=n(7882),yt=n(903),gt=n(5324),xt=n(836);const It="const float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n";class bt{static createVertexShaderCode(e){var t;const n=e.concat(),i=this.__findBeginNode(n),o=this.__sortTopologically(i,n);let a="",r="attribute";(null===(t=Se.F.getWebGLResourceRepository().currentWebGLContextWrapper)||void 0===t?void 0:t.isWebGL2)&&(r="in"),a+=`\n#version 300 es\nprecision highp float;\nprecision highp int;\n${It}\n\n ${r} vec4 a_instanceInfo;\n`,a+=`\nuniform bool u_vertexAttributesExistenceArray[${ie.T.AttributeTypeNumber}];\n`,a+="/* shaderity: @{matricesGetters} */",a+="/* shaderity: @{getters} */";let s="";return s+=bt.getFunctionDefinition(o,gt.H.VertexShader),s+=bt.__constructShaderWithNodes(o),{shader:a+s,shaderBody:s}}static createPixelShaderCode(e){const t=e.concat(),n=this.__findBeginNode(t),i=this.__sortTopologically(n,t);let o="";o+=`\n#version 300 es\nprecision highp float;\nprecision highp int;\n${It}\n`,o+="/* shaderity: @{getters} */",o+="layout(location = 0) out vec4 rt0;";let a="";return a+=bt.getFunctionDefinition(i,gt.H.PixelShader),a+=bt.__constructShaderWithNodes(i),{shader:o+a,shaderBody:a}}static __findBeginNode(e){let t;for(let n=0;n{let i=0;for(const e of t.inputConnections)-1===n.indexOf(e.shaderNodeUid)&&i++;0===i&&(e=t)})),i.push(e),n.push(e.shaderNodeUid),t.splice(t.indexOf(e),1)}while(0!==t.length);return i}static getFunctionDefinition(e,t){let n="";const i=[];for(let o=0;o=0&&null==o[l-1]&&(o[l-1]=[]);const _=c.inputConnections;for(let e=0;e<_.length;e++){const o=_[e],r=vt._shaderNodes[o.shaderNodeUid];if(n(c.getInputs()[e]))continue;const h=r.getOutput(o.outputNameOfPrev),u=c.getInput(o.inputNameOfThis),d=`${h.name}_${o.shaderNodeUid}_to_${c.shaderNodeUid}`;-1===a.indexOf(r.shaderNodeUid)&&(t+=`${u.compositionType.getGlslStr(u.componentType)} ${d} = ${u.compositionType.getGlslInitialValue(u.componentType)};\n`);const m=s.get(r.shaderNodeUid);i[l].push(m||d),a.push(o.shaderNodeUid)}for(let t=l;t=0&&o[l-1].push(e),s.set(t.shaderNodeUid,e)}r.push(t.shaderNodeUid)}}}}}let a="";for(let n=0;n0){l+=`${s}(`;for(let t=0;t rhs;\n}\n\nvoid greater(in int lhs, in int rhs, out bool outValue) {\n outValue = lhs > rhs;\n}\n"),this.__inputs.push({compositionType:e,componentType:t,name:"lhs"}),this.__inputs.push({compositionType:e,componentType:I.r.Float,name:"rhs"}),this.__outputs.push({compositionType:T.d.Scalar,componentType:I.r.Bool,name:"outValue"})}}var Gt=n(4109);class Vt extends vt{constructor(){super("ifStatement",void 0,new Gt.p),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Bool,name:"condition"}),this.__outputs.push({compositionType:T.d.Unknown,componentType:I.r.Unknown,name:"ifStart"})}}class zt extends vt{constructor(e,t,n,i){super("multiply","\nvoid multiply(in float lfs, in float rhs, out float outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in int lfs, in int rhs, out int outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat2 lfs, in mat2 rhs, out mat2 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat3 lfs, in mat3 rhs, out mat3 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat4 lfs, in mat4 rhs, out mat4 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat3 lfs, in vec3 rhs, out vec3 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat4 lfs, in vec4 rhs, out vec4 outValue) {\n outValue = lfs * rhs;\n}\n\n");let o=T.d.Unknown;e===T.d.Mat4&&n===T.d.Mat4?o=T.d.Mat4:e===T.d.Mat4&&n===T.d.Vec4?o=T.d.Vec4:e===T.d.Scalar&&n===T.d.Scalar&&(o=T.d.Scalar),this.__inputs.push({compositionType:e,componentType:t,name:"lhs"}),this.__inputs.push({compositionType:n,componentType:i,name:"rhs"}),this.__outputs.push({compositionType:o,componentType:t,name:"outValue"})}}class Ot extends vt{constructor(){super("normalMatrix","\nvoid normalMatrix(out mat3 outValue) {\n outValue = get_normalMatrix(a_instanceInfo.x);\n}\n"),this.__outputs.push({compositionType:T.d.Mat3,componentType:I.r.Float,name:"outValue"})}}class Ut extends vt{constructor(e,t){super("normalize","\nvoid normalize(in vec2 value, out vec2 outValue) {\n outValue = normalize(value);\n}\n\nvoid normalize(in vec3 value, out vec3 outValue) {\n outValue = normalize(value);\n}\n\nvoid normalize(in vec4 value, out vec4 outValue) {\n outValue = normalize(value);\n}\n"),this.__inputs.push({compositionType:e,componentType:t,name:"value"}),this.__outputs.push({compositionType:e,componentType:t,name:"outValue"})}}var kt=n(4212);class Qt extends vt{constructor(){super("outColor",void 0,kt.x.getInstance()),this.__inputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"value"})}}class Wt extends vt{constructor(){super("outPosition",void 0,kt.x.getInstance()),this.__inputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"value"})}}class Xt extends vt{constructor(){super("projectionMatrix","\nvoid projectionMatrix(out mat4 outValue) {\n float cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID}*/];\n outValue = get_projectionMatrix(cameraSID, 0);\n}\n"),this.__outputs.push({compositionType:T.d.Mat4,componentType:I.r.Float,name:"outValue"})}}class qt extends vt{constructor(){super("scalarToVector4","\nvoid scalarToVector4(in float x, in float y, in float z, in float w, out vec4 outValue) {\n outValue.x = x;\n outValue.y = y;\n outValue.z = z;\n outValue.w = w;\n}\n"),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"x"}),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"y"}),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"z"}),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"w"}),this.__outputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"outValue"})}}var Ht=n(6796);class jt extends pt.P{constructor(){super(new Ht.S,"textureFetch"),this.generalTextureMaterialNodeUID=new y.wy({str:`generalTexture_${this.materialNodeUid}`});const e=[{semantic:this.generalTextureMaterialNodeUID,componentType:I.r.Int,compositionType:T.d.Texture2D,stage:gt.H.PixelShader,isCustomSetting:!1,soloDatum:!1,min:0,max:Number.MAX_SAFE_INTEGER}];this.setShaderSemanticsInfoArray(e),this.__vertexInputs.push({compositionType:T.d.Vec2,componentType:I.r.Float,name:"texcoord"}),this.__vertexOutputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"outColor"})}}var Yt=n(204);class Kt extends vt{constructor(e,t){super("uniformData"),this.__shaderFunctionName+="_"+this.__shaderNodeUid,this.__shader=new Yt.$(this.__shaderFunctionName,e,t),this.__outputs.push({compositionType:e,componentType:t,name:"outValue"})}setDefaultInputValue(e,t){"value"===e&&this.__shader.setDefaultValue(t)}setUniformDataName(e){this.__shader.setVariableName(e)}}var Jt=n(9071);class Zt extends vt{constructor(e,t){super("varyingInVariable"),this.__shaderFunctionName+="_"+this.__shaderNodeUid,this.__shader=new Jt.e(this.__shaderFunctionName,e,t),this.__outputs.push({compositionType:e,componentType:t,name:"outValue",isClosed:!0})}setVaryingVariableName(e){this.__shader.setVariableName(e)}}class $t extends vt{constructor(e,t){super("varyingOutVariable"),this.__shaderFunctionName+="_"+this.__shaderNodeUid,this.__shader=new Jt.e(this.__shaderFunctionName,e,t),this.__inputs.push({compositionType:e,componentType:t,name:"value"})}setVaryingVariableName(e){this.__shader.setVariableName(e)}}class en extends vt{constructor(){super("vector3AndScalarToVector4","\nvoid vector3AndScalarToVector4(in vec3 xyz, in float w, out vec4 outValue) {\n outValue.x = xyz.x;\n outValue.y = xyz.y;\n outValue.z = xyz.z;\n outValue.w = w;\n}\n"),this.__inputs.push({compositionType:T.d.Vec3,componentType:I.r.Float,name:"xyz"}),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"w"}),this.__outputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"outValue"})}}class tn extends vt{constructor(){super("viewMatrix","\nvoid viewMatrix(out mat4 outValue) {\n float cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID}*/];\n outValue = get_viewMatrix(cameraSID, 0);\n}\n"),this.__outputs.push({compositionType:T.d.Mat4,componentType:I.r.Float,name:"outValue"})}}class nn extends vt{constructor(){super("wireframe","bool wireframe(\n in vec4 existingFragColor,\n in vec4 wireframeColor,\n out vec4 outColor\n) {\n vec3 wireframeInfo = get_wireframe(a_instanceInfo.x);\n\n // Wireframe\n float threshold = 0.001;\n float wireframeWidthInner = wireframeInfo.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframeInfo.x > 0.5 && wireframeInfo.y < 0.5) {\n outColor.a = 0.0;\n }\n vec4 wireframeResult = existingFragColor;\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + existingFragColor.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(existingFragColor.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframeInfo.x > 0.5) {\n outColor = wireframeResult;\n if (wireframeInfo.y < 0.5 && existingFragColor.a == 0.0) {\n discard;\n }\n }\n}\n"),this.__inputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"existingFragColor"}),this.__inputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"wireframeColor"}),this.__outputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"outColor"})}}class on extends vt{constructor(){super("worldMatrix","\nvoid worldMatrix(out mat4 outValue) {\n outValue = get_worldMatrix(a_instanceInfo.x);\n}\n"),this.__outputs.push({compositionType:T.d.Mat4,componentType:I.r.Float,name:"outValue"})}}var an=n(6863),rn=n(2795),sn=n(621),ln=n(9604),cn=n(8774),_n=n(3616),hn=n(224),un=n(1813),dn=n(5757),mn=n(4878);class fn extends pt.P{constructor(){super(null,"envConstantShading",{},dn.Z,mn.Z);const e=[{semantic:fn.EnvHdriFormat,componentType:I.r.Int,compositionType:T.d.Scalar,stage:gt.H.PixelShader,isCustomSetting:!1,updateInterval:un.a.EveryTime,soloDatum:!1,initialValue:_n.Ru.fromCopyNumber(0),min:0,max:5},{semantic:fn.envRotation,componentType:I.r.Float,compositionType:T.d.Scalar,stage:gt.H.PixelShader,isCustomSetting:!1,updateInterval:un.a.EveryTime,soloDatum:!1,initialValue:_n.Ru.fromCopyNumber(0),min:-Math.PI,max:Math.PI},{semantic:y.f5.DiffuseColorFactor,componentType:I.r.Float,compositionType:T.d.Vec4,stage:gt.H.PixelShader,isCustomSetting:!1,updateInterval:un.a.EveryTime,soloDatum:!1,initialValue:P.Lt.fromCopyArray([1,1,1,1]),min:0,max:2},{semantic:y.f5.ColorEnvTexture,componentType:I.r.Int,compositionType:T.d.TextureCube,stage:gt.H.PixelShader,isCustomSetting:!1,updateInterval:un.a.EveryTime,initialValue:[0,Tt.pn],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:y.f5.MakeOutputSrgb,compositionType:T.d.Scalar,componentType:I.r.Bool,stage:gt.H.PixelShader,min:0,max:1,isCustomSetting:!1,updateInterval:un.a.FirstTimeOnly,initialValue:_n.Ru.fromCopyNumber(1)}];this.setShaderSemanticsInfoArray(e)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix));let o=i.renderPass.cameraComponent;null==o&&(o=l.C.getComponent(hn.M,hn.M.current)),o&&(this.setViewInfo(t,o,i.isVr,i.displayIdx),this.setProjection(t,o,i.isVr,i.displayIdx))}}fn.envRotation=new y.wy({str:"envRotation"}),fn.EnvHdriFormat=new y.wy({str:"envHdriFormat"});var pn=n(8287),vn=n(1554),An=n(9330),yn=n(8283),gn=n(9764),xn=n(7369),In=n(968),bn=n(5519),En=n(4235),Tn=n(1050),Sn=n(5800),Cn=n(6312),wn=n(2858),Pn=n(3981),Dn=n(3648),Mn=n(2251),Nn=n(580);class Bn extends m.S{constructor(){super(),this.__width=0,this.__height=0,this.__isShadow=!1,this.__shadowMapSize=1024,this.__oFrame=new Cn.Hq,this.__oFrameDepthMoment=new Cn.Hq,this.__oFrameBufferMsaa=new Cn.Hq,this.__oFrameBufferResolve=new Cn.Hq,this.__oFrameBufferResolveForReference=new Cn.Hq,this.__oInitialExpression=new Cn.Hq,this.__expressions=[],this.__depthMomentExpressions=[],this.__oMsaaResolveExpression=new Cn.Hq,this.__oGammaExpression=new Cn.Hq,this.__transparentOnlyExpressions=[],this.__oGammaBoardEntity=new Cn.Hq,this.__oWebXRSystem=new Cn.Hq,this.__oDrawFunc=new Cn.Hq,this.__oDiffuseCubeTexture=new Cn.Hq,this.__oSpecularCubeTexture=new Cn.Hq,this.__oSamplerForBackBuffer=new Cn.Hq}async setup(e,t,{isShadow:n=!1,shadowMapSize:i=1024}={}){if(this.__width=e,this.__height=t,this.__shadowMapSize=i,this.__oFrame.has())return new We.UG({message:"Already setup",error:void 0});const o=new Cn.bD(new Pn.R);this.__oFrame=o,this.__oSamplerForBackBuffer=new Cn.bD(new Nn.Z({wrapS:Pe.d.Repeat,wrapT:Pe.d.Repeat,minFilter:Pe.d.LinearMipmapLinear,magFilter:Pe.d.Linear})),this.__oSamplerForBackBuffer.unwrapForce().create();const{framebufferMsaa:a,framebufferResolve:r,framebufferResolveForReference:s}=this.__createRenderTargets(e,t);n&&(this.__isShadow=!0,this.__oFrameDepthMoment=this.__setupDepthMomentFramebuffer(i));const l=this.__setupInitialExpression(a,this.__oFrameDepthMoment);this.__oInitialExpression=new Cn.bD(l);const c=this.__setupMsaaResolveExpression(o,a,r,s);this.__oMsaaResolveExpression=new Cn.bD(c),this.__oFrameBufferMsaa=new Cn.bD(a),this.__oFrameBufferResolve=new Cn.bD(r),this.__oFrameBufferResolveForReference=new Cn.bD(s);const _=this.__setupGammaExpression(o,r,e/t);this.__oGammaExpression=new Cn.bD(_);const h=await Mn.x.getInstance().getModule("xr");return g.Is.exist(h)&&(this.__oWebXRSystem=new Cn.bD(h.WebXRSystem.getInstance())),new We.Ok}setExpressions(e,t={isTransmission:!0}){this.__setExpressionsInner(e,{isTransmission:t.isTransmission});const n=e.map((e=>e.clone()));t.isTransmission&&this.__setTransparentExpressionsForTransmission(n),this.__setDepthTextureToEntityMaterials()}__setDepthTextureToEntityMaterials(){if(g.Is.false(this.__isShadow))return;this.__depthMomentExpressions=[];for(const e of this.__expressions)this.__depthMomentExpressions.push(e.clone());const e=Ie.G.createDepthMomentEncodeMaterial();for(const t of this.__depthMomentExpressions)for(const n of t.renderPasses)n.setFramebuffer(this.__oFrameDepthMoment.unwrapForce()),n.toClearColorBuffer=!0,n.toClearDepthBuffer=!0,n.toRenderTransparentPrimitives=!1,n.setMaterial(e);for(const e of this.__expressions)for(const t of e.renderPasses){const e=t.entities;for(const t of e){const e=t.tryToGetMesh();if(g.Is.exist(e)){const t=e.mesh;if(g.Is.exist(t)){const e=t.primitives;for(const t of e)t.material.setTextureParameter(y.f5.DepthTexture,this.__oFrameDepthMoment.unwrapForce().getColorAttachedRenderTargetTexture(0))}}}}}startRenderLoop(e){return this.__oFrame.doesNotHave()?new We.UG({message:"not initialized.",error:void 0}):(this.__oDrawFunc=new Cn.bD(e),Dn.x.startRenderLoop((()=>{this.__setExpressions(),e(this.__oFrame.unwrapForce())})),new We.Ok)}draw(){this.__oDrawFunc.unwrapForce()(this.__oFrame.unwrapForce())}resize(e,t){if(this.__oFrame.doesNotHave())return new We.UG({message:"not initialized.",error:void 0});(0,Cn.Zz)(this.__oFrame),(0,Cn.Zz)(this.__oFrameBufferMsaa),(0,Cn.Zz)(this.__oFrameBufferResolve),(0,Cn.Zz)(this.__oFrameBufferResolveForReference),(0,Cn.Zz)(this.__oGammaExpression),(0,Cn.Zz)(this.__oGammaBoardEntity);const n=this.__oWebXRSystem.unwrapOrUndefined();return g.Is.exist(n)&&n.isWebXRMode&&(e=n.getCanvasWidthForVr(),t=n.getCanvasHeightForVr()),Dn.x.resizeCanvas(e,t),this.__oFrame.get().setViewport(P.Lt.fromCopy4(0,0,e,t)),this.__oFrameDepthMoment.has()&&this.__oFrameDepthMoment.get().resize(Math.floor(this.__shadowMapSize*(this.__width/this.__height)),this.__shadowMapSize),this.__oFrameBufferMsaa.get().resize(e,t),this.__oFrameBufferResolve.get().resize(e,t),this.__oFrameBufferResolveForReference.get().resize(e,t),this.__oGammaExpression.get().renderPasses[0].setViewport(P.Lt.fromCopy4(0,0,e,t)),new We.Ok}setIBL(e){const t=new wn.B;t.baseUriToLoad=e.diffuse.baseUri,t.hdriFormat=e.diffuse.hdriFormat,t.isNamePosNeg=e.diffuse.isNamePosNeg,t.mipmapLevelNumber=e.diffuse.mipmapLevelNumber,t.loadTextureImagesAsync(),this.__oDiffuseCubeTexture=new Cn.bD(t);const n=new wn.B;n.baseUriToLoad=e.specular.baseUri,n.isNamePosNeg=e.specular.isNamePosNeg,n.hdriFormat=e.specular.hdriFormat,n.mipmapLevelNumber=e.specular.mipmapLevelNumber,n.loadTextureImagesAsync(),this.__oSpecularCubeTexture=new Cn.bD(n),this.__setIblInner(),this.__setIblInnerForTransparentOnly()}setIBLTextures(e,t){this.__oDiffuseCubeTexture=new Cn.bD(e),this.__oSpecularCubeTexture=new Cn.bD(t),this.__setIblInner(),this.__setIblInnerForTransparentOnly()}getInitialExpression(){return this.__oInitialExpression.unwrapOrUndefined()}getMsaaResolveExpression(){return this.__oMsaaResolveExpression.unwrapOrUndefined()}getGammaExpression(){return this.__oGammaExpression.unwrapOrUndefined()}setDiffuseIBLContribution(e){for(const t of this.__expressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();g.Is.exist(n)&&(n.diffuseCubeMapContribution=e)}for(const t of this.__transparentOnlyExpressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();g.Is.exist(n)&&(n.diffuseCubeMapContribution=e)}}setSpecularIBLContribution(e){for(const t of this.__expressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();g.Is.exist(n)&&(n.specularCubeMapContribution=e)}for(const t of this.__transparentOnlyExpressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();g.Is.exist(n)&&(n.specularCubeMapContribution=e)}}setIBLRotation(e){for(const t of this.__expressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();g.Is.exist(n)&&(n.rotationOfCubeMap=e)}}setCameraComponentOfLight(e){if(this.__isShadow){for(const t of this.__depthMomentExpressions)for(const n of t.renderPasses)n.cameraComponent=e;for(const t of this.__expressions)for(const n of t.renderPasses)n.setPostRenderFunction((function(){const t=n.entities;for(const n of t){const t=n.tryToGetMesh();if(g.Is.exist(t)){const n=t.mesh;if(g.Is.exist(n)){const t=n.primitives;for(const n of t)n.material.setParameter(y.f5.DepthBiasPV,e.biasViewProjectionMatrix)}}}}))}}__setExpressionsInner(e,t={isTransmission:!0}){for(const n of e)for(const e of n.renderPasses)e.toRenderOpaquePrimitives=!0,t.isTransmission?e.toRenderTransparentPrimitives=!1:e.toRenderTransparentPrimitives=!0,e.toClearDepthBuffer=!1,e.setFramebuffer(this.__oFrameBufferMsaa.unwrapForce());this.__expressions=e,this.__setIblInner()}__setTransparentExpressionsForTransmission(e){for(const t of e){t.tryToSetUniqueName("modelTransparentForTransmission",!0);for(const e of t.renderPasses){e.toRenderOpaquePrimitives=!1,e.toRenderTransparentPrimitives=!0,e.toClearDepthBuffer=!1,e.setFramebuffer(this.__oFrameBufferMsaa.unwrapForce());for(const t of e.entities){const e=t.tryToGetMesh();if(g.Is.exist(e)){const t=e.mesh;if(g.Is.exist(t))for(let e=0;eo?(r=Math.min(i,t),s=r*a):(s=Math.min(o,t),r=s/a),n.width=r,n.height=s;const l=n.getContext("2d");if(l.drawImage(e,0,0,e.width,e.height,0,0,r,s),this.autoDetectTransparency){this.__imageData=l.getImageData(0,0,r,s);for(let e=0;e{const _=()=>{this.__width=h.videoWidth,this.__height=h.videoHeight;const e=Se.F.getWebGLResourceRepository().createTextureFromImageBitmapData(h,{level:t,internalFormat:n,width:this.__width,height:this.__height,border:0,format:i,type:o,generateMipmap:a});this._textureResourceUid=e,this.__isTextureReady=!0,l()};null==s||s.addEventListener("click",(()=>{_(),h.play()}),!0);const h=document.createElement("video");h.crossOrigin="anonymous",h.setAttribute("playsinline","playsinline"),r&&(h.autoplay=!0,h.muted=!0),h.preload="auto",kn(this,Ln,h,"f"),h.addEventListener("canplaythrough",(()=>{_(),h.play()}),!0),h.addEventListener("ended",(()=>{h.play()}),!0),h.src=e}))}updateTexture(){const e=Se.F.getWebGLResourceRepository();this.__isTextureReady&&Qn(this,Ln,"f")&&e.updateTexture(this._textureResourceUid,Qn(this,Ln,"f"),{level:0,xoffset:0,yoffset:0,width:this.__width,height:this.__height,format:De.V.RGBA,type:I.r.UnsignedByte})}getCurrentFramePixelData(){let e;const t=Se.F.getWebGLResourceRepository();return this.__isTextureReady&&Qn(this,Ln,"f")&&(e=t.getPixelDataFromTexture(this._textureResourceUid,0,0,this.width,this.height)),[e,this.width,this.height]}set playbackRate(e){Qn(this,Ln,"f")&&(Qn(this,Ln,"f").playbackRate=e)}get playbackRate(){var e;const t=null===(e=Qn(this,Ln,"f"))||void 0===e?void 0:e.playbackRate;return null!=t?t:1}play(){var e;null===(e=Qn(this,Ln,"f"))||void 0===e||e.play()}pause(){Qn(this,Ln,"f").pause()}}Ln=new WeakMap,Wn.__loadedBasisFunc=!1},6863:(e,t,n)=>{"use strict";n.d(t,{h:()=>A});var i=n(7290),o=n(224),a=n(810),r=n(2404),s=n(3999),l=n(4587),c=n(5324),_=n(1813),h=n(2575),u=n(5981),d=n(5868);const m={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord;\nin vec3 a_position;\n\nout vec2 v_texcoord;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n v_texcoord = a_texcoord;\n}\n",shaderStage:"vertex",isFragmentShader:!1},f={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec2 v_texcoord;\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec4 textureColor = texture(u_baseColorTexture, v_texcoord);\n\n float r = textureColor.r;\n float g = textureColor.g;\n float b = textureColor.b;\n float r16 = r * 15.0;\n float g16 = g * 15.0;\n float b16 = b * 15.0;\n float rInt = floor(r16);\n float gInt = floor(g16);\n float bInt = floor(b16);\n\n float rRate, gRate, bRate;\n float rIntAdjust, gIntAdjust, bIntAdjust;\n\n vec3 newColor = vec3(0.0);\n for(int i=0; i<8; i++){\n rRate = 1.0 - fract(r16);\n gRate = 1.0 - fract(g16);\n bRate = 1.0 - fract(b16);\n rIntAdjust = rInt;\n gIntAdjust = gInt;\n bIntAdjust = bInt;\n\n if(fract(float(i) / 2.0) != 0.0){\n rIntAdjust += 1.0;\n rRate = 1.0 - rRate;\n }\n if(fract(float(i / 2) / 2.0) != 0.0){\n gIntAdjust += 1.0;\n gRate = 1.0 - gRate;\n }\n if(fract(float(i / 4) / 2.0) != 0.0){\n bIntAdjust += 1.0;\n bRate = 1.0 - bRate;\n }\n\n if( rRate * gRate * bRate != 0.0){\n newColor += texture(u_lookupTableTexture, vec2(rIntAdjust / 256.0 + bIntAdjust / 16.0 + 1.0 / 512.0, gIntAdjust / 16.0 + 1.0 / 32.0)).rgb * rRate * gRate * bRate;\n }\n }\n\n rt0 = vec4(newColor, 1.0);\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var p=n(580),v=n(2192);class A extends d.P{constructor(e,t,n,o){let r;super(null,"colorGradingUsingLUTsShading",{},m,f);const d=e.getFramebuffer();let y;null!=d&&null!=d.colorAttachments[t]?r=d.colorAttachments[t]:(r=v.mg,null!=d?console.warn("renderPass does not have framebuffer.colorAttachments["+t+"]"):console.warn("renderPass does not have framebuffer")),"string"==typeof n?(y=new h.x,async function(e){await y.generateTextureFromUri(e,{type:s.r.UnsignedByte})}(n)):o instanceof i.y?y=o:(console.warn("no LUT texture is specified"),y=v.mg);const g=new p.Z({minFilter:u.d.Nearest,magFilter:u.d.Nearest,wrapS:u.d.ClampToEdge,wrapT:u.d.ClampToEdge,anisotropy:!1});g.create();const x=[{semantic:l.f5.BaseColorTexture,componentType:s.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:_.a.EveryTime,initialValue:[0,r],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:A.lookupTableTexture,componentType:s.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:_.a.EveryTime,initialValue:[1,y,g],min:0,max:Number.MAX_SAFE_INTEGER}];this.setShaderSemanticsInfoArray(x)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&this.setWorldMatrix(t,i.worldMatrix);let a=i.renderPass.cameraComponent;null==a&&(a=r.C.getComponent(o.M,o.M.current)),a&&(this.setViewInfo(t,a,i.isVr,i.displayIdx),this.setProjection(t,a,i.isVr,i.displayIdx))}}A.lookupTableTexture=new l.wy({str:"lookupTableTexture"})},2795:(e,t,n)=>{"use strict";n.d(t,{f:()=>u});var i=n(4587),o=n(5868),a=n(5324),r=n(2404),s=n(224),l=n(1986),c=n(6773),_=n(7348),h=n(2192);class u extends o.P{constructor({name:e,isMorphing:t,isSkinning:n,isLighting:i,isClearCoat:r,isTransmission:s,isVolume:l,isSheen:_,isSpecular:h,isIridescence:u,isAnisotropy:d,isShadow:m,useTangentAttribute:f,useNormalTexture:p,vertexShader:v,pixelShader:A,noUseCameraTransform:y,additionalShaderSemanticInfo:g}){super(null,e+(t?"+morphing":"")+(n?"+skinning":"")+(i?"":"-lighting")+(r?"+clearcoat":"")+(s?"+transmission":"")+(l?"+volume":"")+(h?"+specular":"")+(_?"+sheen":"")+(u?"+iridescence":"")+(d?"+anisotropy":"")+(f?"+tangentAttribute":""),{isMorphing:t,isSkinning:n,isLighting:i});const x=c.Q.getShaderDataReflection(v,o.P.__semanticsMap.get(this.shaderFunctionName)),I=c.Q.getShaderDataReflection(A,o.P.__semanticsMap.get(this.shaderFunctionName));this.__vertexShaderityObject=x.shaderityObject,this.__pixelShaderityObject=I.shaderityObject;const b=[];for(const e of x.shaderSemanticsInfoArray)e.stage=a.H.VertexShader,b.push(e);for(const e of I.shaderSemanticsInfoArray){const t=b.find((t=>t.semantic.str===e.semantic.str));t?t.stage=a.H.VertexAndPixelShader:(e.stage=a.H.PixelShader,b.push(e))}i&&(this.__definitions+="#define RN_IS_LIGHTING\n"),n&&(this.__definitions+="#define RN_IS_SKINNING\n"),t&&(this.__definitions+="#define RN_IS_MORPHING\n"),r&&(this.__definitions+="#define RN_USE_CLEARCOAT\n"),s&&(this.__definitions+="#define RN_USE_TRANSMISSION\n"),l&&(this.__definitions+="#define RN_USE_VOLUME\n"),_&&(this.__definitions+="#define RN_USE_SHEEN\n"),h&&(this.__definitions+="#define RN_USE_SPECULAR\n"),u&&(this.__definitions+="#define RN_USE_IRIDESCENCE\n"),d&&(this.__definitions+="#define RN_USE_ANISOTROPY\n"),m&&(this.__definitions+="#define RN_USE_SHADOW_MAPPING\n"),f&&(this.__definitions+="#define RN_USE_TANGENT_ATTRIBUTE\n"),p&&(this.__definitions+="#define RN_USE_NORMAL_TEXTURE\n"),y&&(this.__definitions+="#define RN_NO_CAMERA_TRANSFORM\n"),this.setShaderSemanticsInfoArray(b.concat(g))}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:a}){if(a.setUniform){if(this.setWorldMatrix(t,a.worldMatrix),this.setNormalMatrix(t,a.normalMatrix),this.setIsBillboard(t,a.isBillboard),n||a.isVr){let e=a.renderPass.cameraComponent;null==e&&(e=r.C.getComponent(s.M,s.M.current)),this.setViewInfo(t,e,a.isVr,a.displayIdx),this.setProjection(t,e,a.isVr,a.displayIdx)}n&&this.setLightsInfo(t,a.lightComponents,e,a.setUniform);const i=a.entity.tryToGetSkeletal();this.setSkinning(t,a.setUniform,i)}if(a.diffuseCube&&a.diffuseCube.isTextureReady?this.__webglResourceRepository.setUniformValue(t,i.f5.DiffuseEnvTexture.str,n,[5,a.diffuseCube]):this.__webglResourceRepository.setUniformValue(t,i.f5.DiffuseEnvTexture.str,n,[5,h.pn]),a.specularCube&&a.specularCube.isTextureReady?this.__webglResourceRepository.setUniformValue(t,i.f5.SpecularEnvTexture.str,n,[6,a.specularCube]):this.__webglResourceRepository.setUniformValue(t,i.f5.SpecularEnvTexture.str,n,[6,h.pn]),a.setUniform){if(n){const{mipmapLevelNumber:e,meshRenderComponent:o,diffuseHdriType:r,specularHdriType:s}=u.__setupHdriParameters(a);this.__webglResourceRepository.setUniformValue(t,i.f5.IBLParameter.str,n,{x:e,y:o.diffuseCubeMapContribution,z:o.specularCubeMapContribution,w:o.rotationOfCubeMap}),this.__webglResourceRepository.setUniformValue(t,i.f5.HDRIFormat.str,n,{x:r,y:s})}}else{const{mipmapLevelNumber:t,meshRenderComponent:n,diffuseHdriType:r,specularHdriType:s}=u.__setupHdriParameters(a),l=o.P.__tmp_vector4;l.x=t,l.y=n.diffuseCubeMapContribution,l.z=n.specularCubeMapContribution,l.w=n.rotationOfCubeMap,e.setParameter(i.f5.IBLParameter,l);const c=o.P.__tmp_vector2;c.x=r,c.y=s,e.setParameter(i.f5.HDRIFormat,c)}const l=a.entity.tryToGetBlendShape();this.setMorphInfo(t,a.entity.getMesh(),a.primitive,l);const c=a.glw.canvas.width,_=a.glw.canvas.height,d=u.__globalDataRepository.getValue(i.f5.BackBufferTextureSize,0);d._v[0]=c,d._v[1]=_,t._gl.uniform2fv(t.backBufferTextureSize,d._v);const m=u.__globalDataRepository.getValue(i.f5.VrState,0);m._v[0]=a.isVr?1:0,m._v[1]=a.displayIdx,t._gl.uniform2iv(t.vrState,m._v)}static __setupHdriParameters(e){let t=1;e.specularCube&&(t=e.specularCube.mipmapLevelNumber);const n=e.entity.getMeshRenderer();let i=l.c.LDR_SRGB.index,o=l.c.LDR_SRGB.index;return n.diffuseCubeMap&&(i=n.diffuseCubeMap.hdriFormat.index),n.specularCubeMap&&(o=n.specularCubeMap.hdriFormat.index),{mipmapLevelNumber:t,meshRenderComponent:n,diffuseHdriType:i,specularHdriType:o}}}u.__globalDataRepository=_.$.getInstance()},621:(e,t,n)=>{"use strict";n.d(t,{Q:()=>f});var i=n(5868),o=n(224),a=n(2404),r=n(3999),s=n(810),l=n(3616),c=n(4587),_=n(5324),h=n(1813),u=n(2471);const d={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec3 v_normal_inWorld;\nout vec4 v_position_inLocal;\nout vec4 v_position_inWorld;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n v_position_inLocal = gl_Position;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},m={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec4 v_position_inLocal;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvec4 encodeDepthToRGBA(float depth){\n float r = depth;\n float g = fract(r * 255.0);\n float b = fract(g * 255.0);\n float a = fract(b * 255.0);\n float coef = 1.0 / 255.0;\n r -= g * coef;\n g -= b * coef;\n b -= a * coef;\n return vec4(r, g, b, a);\n}\n\nvoid main (){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n float depth;\n bool isPointLight = get_isPointLight(materialSID, 0);\n if(isPointLight){\n float zNear = get_zNearInner(materialSID, 0);\n float zFar = get_zFarInner(materialSID, 0);\n float normalizationCoefficient = 1.0 / (zFar - zNear);\n depth = normalizationCoefficient * length(v_position_inLocal);\n }else{\n depth = gl_FragCoord.z;\n }\n\n float depthPow = get_depthPow(materialSID, 0);\n float depthData = pow(depth, depthPow);\n vec4 encodedDepth = encodeDepthToRGBA(depthData);\n\n rt0 = encodedDepth;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};class f extends i.P{constructor(e,{isSkinning:t}){super(null,"depthEncodeShading"+(t?"+skinning":""),{isMorphing:!1,isSkinning:t,isLighting:!1},d,m),this.__lastZNear=0,this.__lastZFar=0;const n=[{semantic:f.zNearInner,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:l.Ru.fromCopyNumber(.1),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:f.zFarInner,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:l.Ru.fromCopyNumber(1e4),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:f.isPointLight,componentType:r.r.Bool,compositionType:s.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:l.Ru.fromCopyNumber(1),min:0,max:1},{semantic:f.depthPow,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:l.Ru.fromCopyNumber(e),min:1,max:2},{semantic:c.f5.PointSize,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:l.Ru.fromCopyNumber(30),min:0,max:100},{semantic:c.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:s.d.Vec3,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:u.P.fromCopyArray([0,.1,.01]),min:0,max:1}];t&&(this.__definitions+="#define RN_IS_SKINNING"),this.setShaderSemanticsInfoArray(n)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){let r=i.renderPass.cameraComponent;null==r&&(r=a.C.getComponent(o.M,o.M.current)),i.setUniform?(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix),this.setViewInfo(t,r,i.isVr,i.displayIdx),this.setProjection(t,r,i.isVr,i.displayIdx),(n||this.__lastZNear!==r.zNearInner)&&(t._gl.uniform1f(t.zNearInner,r.zNearInner),this.__lastZNear=r.zNearInner),this.__lastZFar!==r.zFarInner&&(t._gl.uniform1f(t.zFarInner,r.zFarInner),this.__lastZFar=r.zFarInner)):(e.setParameter(f.zNearInner,r.zNearInner),e.setParameter(f.zFarInner,r.zFarInner));const s=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,s)}}f.zNearInner=new c.wy({str:"zNearInner"}),f.zFarInner=new c.wy({str:"zFarInner"}),f.isPointLight=new c.wy({str:"isPointLight"}),f.depthPow=new c.wy({str:"depthPow"})},9604:(e,t,n)=>{"use strict";n.d(t,{t:()=>f});var i=n(4587),o=n(810),a=n(3999),r=n(5324),s=n(1813),l=n(2404),c=n(224),_=n(3616),h=n(5868);const u={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec3 a_position;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},d={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n\tfloat tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n vec4 baseColor = texture(u_baseColorTexture, offset * tFrag);\n\n float luminance = length(baseColor);\n\n float luminanceCriterion = get_luminanceCriterion(materialSID, 0);\n if(luminance < luminanceCriterion){\n baseColor = vec4(0.0);\n }else{\n float luminanceReduce = get_luminanceReduce(materialSID, 0);\n baseColor.rgb = pow(baseColor.rgb, vec3(luminanceReduce));\n }\n\n rt0 = baseColor;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var m=n(2192);class f extends h.P{constructor(e,t){super(null,"HighLuminanceDetectShading",{},u,d);const n=[{semantic:f.LuminanceCriterion,componentType:a.r.Float,compositionType:o.d.Scalar,stage:r.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.FirstTimeOnly,soloDatum:!1,initialValue:_.Ru.fromCopyNumber(2),min:0,max:Number.MAX_VALUE},{semantic:f.LuminanceReduce,componentType:a.r.Float,compositionType:o.d.Scalar,stage:r.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.FirstTimeOnly,soloDatum:!1,initialValue:_.Ru.fromCopyNumber(.25),min:0,max:1}];let l,c;const h=e.getFramebuffer();null!=h&&null!=h.colorAttachments[t]?(l=h.colorAttachments[t],c=h.width):(l=m.mg,c=1,null!=h?console.warn("renderPass does not have framebuffer.colorAttachments["+t+"]"):console.warn("renderPass does not have framebuffer")),n.push({semantic:i.f5.FramebufferWidth,componentType:a.r.Float,compositionType:o.d.Scalar,stage:r.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.EveryTime,soloDatum:!1,initialValue:_.Ru.fromCopyNumber(c),min:0,max:Number.MAX_VALUE},{semantic:i.f5.BaseColorTexture,componentType:a.r.Int,compositionType:o.d.Texture2D,stage:r.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.EveryTime,initialValue:[0,l],min:0,max:Number.MAX_SAFE_INTEGER}),this.setShaderSemanticsInfoArray(n)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&this.setWorldMatrix(t,i.worldMatrix);let o=i.renderPass.cameraComponent;null==o&&(o=l.C.getComponent(c.M,c.M.current)),o&&(this.setViewInfo(t,o,i.isVr,i.displayIdx),this.setProjection(t,o,i.isVr,i.displayIdx))}}f.LuminanceCriterion=new i.wy({str:"luminanceCriterion"}),f.LuminanceReduce=new i.wy({str:"luminanceReduce"}),f.FramebufferWidth=new i.wy({str:"framebufferWidth"})},8774:(e,t,n)=>{"use strict";n.d(t,{z:()=>v});var i=n(4587),o=n(5868),a=n(810),r=n(3999),s=n(2471),l=n(5324),c=n(3616),_=n(1813),h=n(2404),u=n(224),d=n(3496),m=n(2566);const f={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout float v_instanceInfo;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\n\nvoid main()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n v_instanceInfo = a_instanceInfo.x;\n}\n",shaderStage:"vertex",isFragmentShader:!1},p={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin float v_instanceInfo;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nconst vec4 bitEnc = vec4(1.,255.,65025.,16581375.);\nconst vec4 bitDec = 1./bitEnc;\n\nvec4 encodeFloatRGBA(float v) {\n float val = v;\n float r = mod(val, 255.0);\n val -= r;\n float g = mod(val, 65025.0);\n val -= g;\n float b = mod(val, 16581375.0);\n return vec4(r/255.0, g/65025.0, b/16581375.0, 1.0);\n}\n\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n rt0 = encodeFloatRGBA(v_instanceInfo);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};class v extends o.P{constructor(){super(null,"entityUidOutputShading+skinning-lighting",{isMorphing:!1,isSkinning:!0,isLighting:!1},f,p);const e=[{semantic:i.f5.WorldMatrix,isComponentData:!0,compositionType:a.d.Mat4,componentType:r.r.Float,stage:l.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.EveryTime,initialValue:d.e.zero()},{semantic:i.f5.NormalMatrix,isComponentData:!0,compositionType:a.d.Mat3,componentType:r.r.Float,stage:l.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.EveryTime,initialValue:m.x.zero()},{semantic:i.f5.PointSize,componentType:r.r.Float,compositionType:a.d.Scalar,stage:l.H.VertexShader,isCustomSetting:!1,updateInterval:_.a.FirstTimeOnly,soloDatum:!0,initialValue:c.Ru.fromCopyNumber(30),min:0,max:100},{semantic:i.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:a.d.Vec3,stage:l.H.VertexShader,isCustomSetting:!1,updateInterval:_.a.FirstTimeOnly,soloDatum:!0,initialValue:s.P.fromCopyArray([0,.1,.01]),min:0,max:1}];this.__definitions+="#define RN_IS_SKINNING\n",this.setShaderSemanticsInfoArray(e)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix));let o=i.renderPass.cameraComponent;null==o&&(o=h.C.getComponent(u.M,u.M.current)),this.setViewInfo(t,o,i.isVr,i.displayIdx),this.setProjection(t,o,i.isVr,i.displayIdx);const a=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,a),this.setLightsInfo(t,i.lightComponents,e,i.setUniform)}}},8287:(e,t,n)=>{"use strict";n.d(t,{b:()=>p});var i=n(3999),o=n(810),a=n(3616),r=n(4587),s=n(5324),l=n(1813),c=n(2390),_=n(5868),h=n(2404),u=n(224);const d={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord;\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec2 v_texcoord;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n v_normal_inWorld = normalMatrix * a_normal;\n v_position_inWorld = worldMatrix * vec4(a_position, 1.0);\n v_texcoord = a_texcoord;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},m={code:'\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n\n/* shaderity: @{getters} */\n\n#define MATH_PI 3.141592\n\n// These codes are referenced from https://github.com/knarkowicz/FurnaceTest\nfloat roughnessRemap(float userRoughness) {\n return userRoughness * userRoughness;\n}\n\n// GGX NDF\nfloat d_ggx(float userRoughness, float NH) {\n float alphaRoughness = userRoughness * userRoughness;\n float roughnessSqr = alphaRoughness * alphaRoughness;\n float f = (roughnessSqr - 1.0) * NH * NH + 1.0;\n return roughnessSqr / (MATH_PI * f * f);\n}\n\n// this is from https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 envBRDFApprox( float Roughness, float NoV ) {\n const vec4 c0 = vec4(-1, -0.0275, -0.572, 0.022 );\n const vec4 c1 = vec4(1, 0.0425, 1.04, -0.04 );\n vec4 r = Roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( -9.28 * NoV ) ) * r.x + r.y;\n vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n return AB;\n}\n\nfloat specularIBL(float userRoughness, float NV, float f0) {\n /// Use specular BRDF LUT\n // vec3 brdf = texture(u_brdfLutTexture, vec2(NV, 1.0 - userRoughness)).rgb;\n // float specular = 1.0 * (f0 * brdf.x + brdf.y);\n\n /// Use specular BRDF Approx\n vec2 f_ab = envBRDFApprox(userRoughness, NV);\n vec3 specular = vec3(f0) * f_ab.x + f_ab.y;\n return specular.x;\n}\n\n// The Schlick Approximation to Fresnel\nfloat fresnel(float f0, float VH) {\n return f0 + (1.0 - f0) * pow(1.0 - VH, 5.0);\n}\n\nfloat smithG1(float roughness, float NoV)\n{\n\tfloat a = roughnessRemap( roughness );\n\tfloat a2 = a * a;\n\tfloat NoV2 = NoV * NoV;\n\tfloat lambda = (-1.0 + sqrt(1.0 + a2 * (1.0 - NoV2) / NoV2)) * 0.5;\n\treturn 1.0 / (1.0 + lambda);\n}\n\nfloat smithG(float roughness, float NoV, float NoL)\n{\n\tfloat a = roughnessRemap( roughness );\n\tfloat a2 = a * a;\n\tfloat NoV2 = NoV * NoV;\n\tfloat NoL2 = NoL * NoL;\n\tfloat lambdaV = (-1.0 + sqrt(1.0 + a2 * (1.0 - NoV2) / NoV2)) * 0.5;\n\tfloat lambdaL = (-1.0 + sqrt(1.0 + a2 * (1.0 - NoL2) / NoL2)) * 0.5;\n\treturn 1.0 / (1.0 + lambdaV + lambdaL);\n}\n\nfloat g_shieldingForWeak(float alphaRoughness, float NV, float NL) {\n float r = alphaRoughness;\n\n // Local Masking using "Schlick-Smith" Masking Function\n float localMasking = 2.0 * NV / (NV + sqrt(r * r + (1.0 - r * r) * (NV * NV)));\n\n return localMasking;\n}\n\n\nfloat g_shielding(float roughness, float NV, float NL) {\n float a = roughnessRemap( roughness );\n float r = a;\n\n // Local Shadowing using "Schlick-Smith" Masking Function\n float localShadowing = 2.0 * NL / (NL + sqrt(r * r + (1.0 - r * r) * (NL * NL)));\n\n // Local Masking using "Schlick-Smith" Masking Function\n float localMasking = 2.0 * NV / (NV + sqrt(r * r + (1.0 - r * r) * (NV * NV)));\n\n return localShadowing * localMasking;\n}\n\nfloat v_SmithGGXCorrelatedForWeak(float roughness, float NV, float NL) {\n float a = roughnessRemap( roughness );\n float a2 = a * a;\n float GGXV = NL * sqrt(NV * NV * (1.0 - a2) + a2);\n return 0.5 / (GGXV);\n}\n\nfloat v_SmithGGXCorrelated(float roughness, float NV, float NL) {\n float a = roughnessRemap( roughness );\n float a2 = a * a;\n float GGXV = NL * sqrt(NV * NV * (1.0 - a2) + a2);\n float GGXL = NV * sqrt(NL * NL * (1.0 - a2) + a2);\n return 0.5 / (GGXV + GGXL);\n}\n\n// this is from https://learnopengl.com/PBR/IBL/Specular-IBL\nfloat vanDerCorpus(int n, int base)\n{\n float invBase = 1.0 / float(base);\n float denom = 1.0;\n float result = 0.0;\n\n for(int i = 0; i < 32; ++i)\n {\n if(n > 0)\n {\n denom = mod(float(n), 2.0);\n result += denom * invBase;\n invBase = invBase / 2.0;\n n = int(float(n) / 2.0);\n }\n }\n\n return result;\n}\n\nvec2 hammersleyNoBitOps(int i, int N)\n{\n return vec2(float(i)/float(N), vanDerCorpus(i, 2));\n}\n\nfloat radicalInverse_VdC(uint bits)\n{\n bits = (bits << 16u) | (bits >> 16u);\n bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\n bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\n bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\n bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\n return float(bits) * 2.3283064365386963e-10; // / 0x100000000\n}\n// ----------------------------------------------------------------------------\nvec2 hammersley(uint i, uint N)\n{\n return vec2(float(i)/float(N), radicalInverse_VdC(i));\n}\n\nvec3 sampleHemisphereGGX(vec2 Xi, float roughness) {\n float a = roughnessRemap(roughness);\n\tfloat a2 = a * a;\n\n float phi = 2.0 * MATH_PI * Xi.x;\n float cosPhi = cos(phi);\n float sinPhi = sin(phi);\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a2 - 1.0) * Xi.y)); // GGX\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\n\n return vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\n}\n\nfloat weakWhiteFurnaceTest(float roughness, float NoV, float f0, int g_type, int disable_fresnel)\n{\n\tfloat vx = sqrt(1.0 - NoV * NoV);\n\tfloat vy = 0.0;\n\tfloat vz = NoV;\n\n\tfloat integral = 0.0;\n\tconst uint sampleNum = 2048u;\n\tfor (uint i = 0u; i < sampleNum; ++i)\n\t{\n vec2 Xi = hammersley(i, sampleNum);\n\n vec3 hvec = sampleHemisphereGGX(Xi, roughness);\n\n\t\tfloat VoHUnsat = vx * hvec.x + vy * hvec.y + vz * hvec.z;\n\n float lz = 2.0 * VoHUnsat * hvec.z - vz;\n\n float NoL = max(lz, 0.0);\n\t\tfloat NoH = max(hvec.z, 0.0);\n\t\tfloat VoH = max(VoHUnsat, 0.0);\n\n float f = fresnel(f0, VoH);\n\n float g1 = 0.0;\n if (g_type == 0) {\n g1 = smithG1(roughness, NoV);\n } else if (g_type == 1) {\n g1 = g_shieldingForWeak(roughness, NoV, NoL);\n } else if (g_type == 2) {\n g1 = v_SmithGGXCorrelatedForWeak(roughness, NoV, NoL) * 4.0 * NoV * NoL;\n }\n\n float pdf = 4.0 * VoH / NoH;\n float integralValue = (g1 * pdf) / (4.0 * NoV);\n if (disable_fresnel == 0) {\n integralValue *= f;\n }\n // integralValue *= 0.5; // Set furnace color 0.5\n\n integral += integralValue;\n\n\t}\n\tintegral /= float(sampleNum);\n\treturn clamp(integral, 0.0, 1.0);\n}\n\nfloat whiteFurnaceTest(float roughness, float NoV, float f0, int g_type, int disable_fresnel)\n{\n\tfloat vx = sqrt(1.0 - NoV * NoV);\n\tfloat vy = 0.0;\n\tfloat vz = NoV;\n\n\tfloat integral = 0.0;\n\tconst uint sampleNum = 4096u;\n\tfor (uint i = 0u; i < sampleNum; ++i)\n\t{\n\n vec2 Xi = hammersley(i, sampleNum);\n\n vec3 hvec = sampleHemisphereGGX(Xi, roughness);\n\n\t\tfloat VoHUnsat = vx * hvec.x + vy * hvec.y + vz * hvec.z;\n\t\tfloat lx = 2.0 * VoHUnsat * hvec.x - vx;\n\t\tfloat ly = 2.0 * VoHUnsat * hvec.y - vy;\n\t\tfloat lz = 2.0 * VoHUnsat * hvec.z - vz;\n\n\t\tfloat NoL = max(lz, 0.0);\n\t\tfloat NoH = max(hvec.z, 0.0);\n float VoH = max(VoHUnsat, 0.0);\n\n float f = fresnel(f0, VoH);\n\n float g = 0.0;\n if (g_type == 0) {\n g = smithG(roughness, NoV, NoL);\n } else if (g_type == 1){\n g = g_shielding(roughness, NoV, NoL);\n } else if (g_type == 2){\n g = v_SmithGGXCorrelated(roughness, NoV, NoL) * (4.0 * NoV * NoL);\n } else if (g_type == 3) {\n g = 0.0;\n }\n\n float pdf = 4.0 * VoH / NoH;\n float integralValue = (g * pdf) / (4.0 * NoV);\n if (disable_fresnel == 0 && g_type != 3) {\n integralValue *= f;\n }\n // integralValue *= 0.5; // Set furnace color 0.5\n integral += integralValue;\n\t}\n integral /= float(sampleNum);\n if (g_type == 3) {\n integral = specularIBL(roughness, NoV, f0);\n }\n\treturn clamp(integral, 0.0, 1.0);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec2 quadSizeInPixel = get_screenInfo(materialSID, 0);\n float roughness = 0.0;\n float NoV = 0.0; // normal dot view vector\n\n // 2D mode\n int mode = get_mode(materialSID, 0);\n if (mode == 0) {\n roughness = (gl_FragCoord.y) / quadSizeInPixel.y;\n NoV = (gl_FragCoord.x) / quadSizeInPixel.x;\n } else {\n // object mode\n // Roughness\n const float c_MinRoughness = 0.04;\n vec2 metallicRoughnessFactor = get_metallicRoughnessFactor(materialSID, 0);\n float userRoughness = metallicRoughnessFactor.y;\n float metallic = metallicRoughnessFactor.x;\n\n vec4 ormTexel = texture(u_metallicRoughnessTexture, v_texcoord);\n userRoughness = ormTexel.g * userRoughness;\n userRoughness = clamp(userRoughness, c_MinRoughness, 1.0);\n roughness = userRoughness;\n\n // vec3 viewVector = normalize(vec3(0.0, 0.0, 10.0) - v_position_inWorld.xyz);\n // vec3 viewVector = normalize(u_viewPosition - v_position_inWorld.xyz);\n vec3 viewVector = vec3(0.0, 0.0, 1.0);\n NoV = dot(v_normal_inWorld, viewVector);\n }\n\n int debugView = get_debugView(materialSID, 0);\n float f0 = get_f0(materialSID, 0);\n int g_type = get_g_type(materialSID, 0);\n int disable_fresnel = get_disable_fresnel(materialSID, 0);\n\n if (debugView == 0) {\n float whiteFurnaceResult = whiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n rt0 = vec4(whiteFurnaceResult, whiteFurnaceResult, whiteFurnaceResult, 1.0);\n\n } else if (debugView == 1) {\n float weakWhiteFurnaceResult = weakWhiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n rt0 = vec4(weakWhiteFurnaceResult, weakWhiteFurnaceResult, weakWhiteFurnaceResult, 1.0);\n\n } else if (debugView == 2){\n float nn = NoV*0.5+0.5;\n rt0 = vec4(nn, nn, nn, 1.0);\n\n } else if (debugView == 3){\n rt0 = vec4(v_normal_inWorld.xyz, 1.0);\n\n } else if (debugView == 4){\n float whiteFurnaceResult = whiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n float weakWhiteFurnaceResult = weakWhiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n rt0 = vec4(whiteFurnaceResult, weakWhiteFurnaceResult, 0.0, 1.0);\n\n } else if (debugView == 5){\n rt0 = vec4(roughness, NoV, 0.0, 1.0);\n\n } else {\n rt0 = vec4(1.0, 1.0, 1.0, 1.0);\n }\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n',shaderStage:"fragment",isFragmentShader:!0};var f=n(2192);class p extends _.P{constructor(){super(null,"FurnaceTestShading",{},d,m);const e=[{semantic:p.debugView,componentType:i.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(0),min:0,max:1},{semantic:p.disable_fresnel,componentType:i.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(0),min:0,max:1},{semantic:p.f0,componentType:i.r.Float,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(1),min:0,max:1},{semantic:p.g_type,componentType:i.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(0),min:0,max:3},{semantic:p.mode,componentType:i.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(0),min:0,max:1},{semantic:r.f5.ScreenInfo,componentType:i.r.Float,compositionType:o.d.Vec2,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:c.FM.fromCopyArray2([0,0]),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:r.f5.MetallicRoughnessFactor,componentType:i.r.Float,compositionType:o.d.Vec2,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:c.FM.fromCopyArray2([1,1]),min:0,max:2},{semantic:r.f5.MetallicRoughnessTexture,componentType:i.r.Int,compositionType:o.d.Texture2D,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,initialValue:[1,f.Dx],min:0,max:Number.MAX_SAFE_INTEGER}];this.setShaderSemanticsInfoArray(e)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){if(i.setUniform&&(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix),n)){let n=i.renderPass.cameraComponent;null==n&&(n=h.C.getComponent(u.M,u.M.current)),this.setViewInfo(t,n,i.isVr,i.displayIdx),this.setProjection(t,n,i.isVr,i.displayIdx),this.setLightsInfo(t,i.lightComponents,e,i.setUniform)}}}p.mode=new r.wy({str:"mode"}),p.debugView=new r.wy({str:"debugView"}),p.g_type=new r.wy({str:"g_type"}),p.disable_fresnel=new r.wy({str:"disable_fresnel"}),p.f0=new r.wy({str:"f0"})},1554:(e,t,n)=>{"use strict";n.d(t,{f:()=>I});var i=n(5868),o=n(5704),a=n(224),r=n(7987),s=n(2404),l=n(3999),c=n(810),_=n(3258),h=n(3616),u=n(4587),d=n(5324),m=n(1813),f=n(2471),p=n(7192),v=n(4255);const A={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\n// This shader is based on https://github.com/Santarh/MToon\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nin vec3 a_normal;\nin vec4 a_baryCentricCoord;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec2 v_texcoord_0;\nout vec3 v_baryCentricCoord;\nout vec3 v_normal_inView;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\nin vec4 a_tangent;\nout vec3 v_tangent_inWorld;\nout vec3 v_binormal_inWorld; // bitangent_inWorld\n#endif\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_NONE\n return;\n #endif\n #endif\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isSkinning = false;\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n\n v_normal_inView = vec3(viewMatrix * vec4(v_normal_inWorld, 0.0));\n\n #ifndef RN_MTOON_IS_OUTLINE\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n #else\n #if defined(RN_MTOON_HAS_OUTLINE_WIDTH_TEXTURE)\n float outlineTex = texture(u_outlineWidthTexture, a_texcoord_0).r;\n #else\n float outlineTex = 1.0;\n #endif\n\n #if defined(RN_MTOON_OUTLINE_WIDTH_WORLD)\n float outlineWidth = get_outlineWidth(materialSID, 0);\n vec3 outlineOffset = 0.01 * outlineWidth * outlineTex * a_normal;\n vec4 worldOutlineOffset = worldMatrix * vec4(outlineOffset, 0.0);\n gl_Position = projectionMatrix * viewMatrix * (v_position_inWorld + worldOutlineOffset);\n\n #elif defined(RN_MTOON_OUTLINE_WIDTH_SCREEN)\n vec4 vertex = projectionMatrix * viewMatrix * v_position_inWorld;\n\n vec3 clipNormal = (projectionMatrix * vec4(v_normal_inView, 1.0)).xyz;\n vec2 projectedNormal = normalize(clipNormal.xy);\n float outlineScaledMaxDistance = get_outlineScaledMaxDistance(materialSID, 0);\n projectedNormal *= min(vertex.w, outlineScaledMaxDistance);\n float aspect = abs(get_aspect(0.0, 0)); //solo datum\n projectedNormal.x *= aspect;\n\n float outlineWidth = get_outlineWidth(materialSID, 0);\n vertex.xy += 0.01 * outlineWidth * outlineTex * projectedNormal * clamp(1.0 - abs(v_normal_inView.z), 0.0, 1.0); // ignore offset when normal toward camera\n\n gl_Position = vertex;\n #else\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n #endif\n #endif\n\n #ifdef RN_USE_TANGENT_ATTRIBUTE\n v_tangent_inWorld = normalMatrix * a_tangent.xyz;\n v_binormal_inWorld = cross(v_normal_inWorld, v_tangent_inWorld) * a_tangent.w;\n #endif\n\n v_texcoord_0 = a_texcoord_0;\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n}\n",shaderStage:"vertex",isFragmentShader:!1},y={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nconst float EPS_COL = 0.00001;\n\nin vec2 v_texcoord_0;\nin vec3 v_baryCentricCoord;\nin vec3 v_normal_inView;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n in vec3 v_tangent_inWorld;\n in vec3 v_binormal_inWorld; // bitangent_inWorld\n#endif\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n mat3 getTBN(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord) {\n vec3 tangent_inWorld = normalize(v_tangent_inWorld);\n vec3 binormal_inWorld = normalize(v_binormal_inWorld);\n mat3 tbnMat_tangent_to_world = mat3(tangent_inWorld, binormal_inWorld, normal_inWorld);\n\n return tbnMat_tangent_to_world;\n }\n#else\n // This is based on http://www.thetenthplanet.de/archives/1180\n mat3 cotangent_frame(vec3 normal_inWorld, vec3 position, vec2 uv) {\n uv = gl_FrontFacing ? uv : -uv;\n\n // get edge vectors of the pixel triangle\n vec3 dp1 = dFdx(position);\n vec3 dp2 = dFdy(position);\n vec2 duv1 = dFdx(uv);\n vec2 duv2 = dFdy(uv);\n\n // solve the linear system\n vec3 dp2perp = cross(dp2, normal_inWorld);\n vec3 dp1perp = cross(normal_inWorld, dp1);\n vec3 tangent = dp2perp * duv1.x + dp1perp * duv2.x;\n vec3 bitangent = dp2perp * duv1.y + dp1perp * duv2.y;\n bitangent *= -1.0;\n\n // construct a scale-invariant frame\n float invMat = inversesqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));\n return mat3(tangent * invMat, bitangent * invMat, normal_inWorld);\n }\n\n mat3 getTBN(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord) {\n mat3 tbnMat_tangent_to_world = cotangent_frame(normal_inWorld, -viewVector, texcoord);\n\n return tbnMat_tangent_to_world;\n }\n#endif\n\n\nvoid main (){\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_NONE\n discard;\n #endif\n #endif\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n\n // TODO\n // uv transform\n\n // TODO\n // uv animation\n\n // main color\n vec4 litTextureColor = texture(u_litColorTexture, v_texcoord_0);\n vec4 litColorFactor = get_litColor(materialSID, 0);\n\n // alpha\n float alpha = 1.0;\n\n #ifdef RN_ALPHATEST_ON\n alpha = litTextureColor.a * litColorFactor.a;\n float cutoff = get_cutoff(materialSID, 0);\n if(alpha < cutoff) discard;\n #elif defined(RN_ALPHABLEND_ON)\n alpha = litTextureColor.a * litColorFactor.a;\n #endif\n\n if (alpha < 0.01) {\n discard;\n }else{\n rt0.w = alpha;\n }\n\n\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_COLOR_FIXED\n vec3 outlineColor = get_outlineColor(materialSID, 0);\n rt0.xyz = outlineColor;\n\n rt0.xyz = srgbToLinear(rt0.xyz);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n #endif\n #endif\n\n // view vector\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n vec3 viewVector = viewPosition - v_position_inWorld.xyz;\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n #ifdef RN_MTOON_HAS_BUMPMAP\n vec3 normal = texture(u_normalTexture, v_texcoord_0).xyz * 2.0 - 1.0;\n mat3 TBN = getTBN(normal_inWorld, viewVector, v_texcoord_0);\n normal_inWorld = normalize(TBN * normal);\n #endif\n\n #ifdef RN_MTOON_IS_OUTLINE\n normal_inWorld *= -1.0;\n #endif\n\n\n // Lighting, Direct Light\n\n float shadowAttenuation = 1.0;\n // TODO: shadowmap computation\n\n float receiveShadowRate = get_receiveShadowRate(materialSID, 0);\n float lightAttenuation = shadowAttenuation * mix(1.0, shadowAttenuation, receiveShadowRate * texture(u_receiveShadowTexture, v_texcoord_0).r);\n\n float shadingGradeRate = get_shadingGradeRate(materialSID, 0);\n float shadingGrade = 1.0 - shadingGradeRate * (1.0 - texture(u_shadingGradeTexture, v_texcoord_0).r);\n float lightColorAttenuation = get_lightColorAttenuation(materialSID, 0);\n\n vec3 shadeColorFactor = get_shadeColor(materialSID, 0);\n vec3 shadeColor = shadeColorFactor * texture(u_shadeColorTexture, v_texcoord_0).xyz;\n shadeColor.xyz = srgbToLinear(shadeColor.xyz);\n\n vec3 litColor = litColorFactor.xyz * litTextureColor.xyz;\n litColor.xyz = srgbToLinear(litColor.xyz);\n\n\n float shadeShift = get_shadeShift(materialSID, 0);\n float shadeToony = get_shadeToony(materialSID, 0);\n\n vec3 lightings[/* shaderity: @{Config.maxLightNumberInShader} */];\n #ifdef RN_MTOON_DEBUG_LITSHADERATE\n float lightIntensities[/* shaderity: @{Config.maxLightNumberInShader} */];\n #endif\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n // lightAttenuation *= distanceAttenuation * spotEffect;\n float dotNL = dot(light.direction, normal_inWorld);\n float lightIntensity = dotNL * 0.5 + 0.5; // from [-1, +1] to [0, 1]\n lightIntensity = lightIntensity * lightAttenuation; // TODO: receive shadow\n lightIntensity = lightIntensity * shadingGrade; // darker\n lightIntensity = lightIntensity * 2.0 - 1.0; // from [0, 1] to [-1, +1]\n\n // tooned. mapping from [minIntensityThreshold, maxIntensityThreshold] to [0, 1]\n float maxIntensityThreshold = mix(1.0, shadeShift, shadeToony);\n float minIntensityThreshold = shadeShift;\n lightIntensity = clamp((lightIntensity - minIntensityThreshold) / max(EPS_COL, (maxIntensityThreshold - minIntensityThreshold)), 0.0, 1.0);\n #ifdef RN_MTOON_DEBUG_LITSHADERATE\n lightIntensities[i] = lightIntensity;\n #endif\n\n // Albedo color\n vec3 col = mix(shadeColor, litColor, lightIntensity);\n\n // Direct Light\n vec3 lighting = light.attenuatedIntensity;\n lighting = mix(lighting, vec3(max(EPS_COL, max(lighting.x, max(lighting.y, lighting.z)))), lightColorAttenuation); // color atten\n\n\n if(i > 0){\n lighting *= 0.5; // darken if additional light.\n lighting *= min(0.0, dotNL) + 1.0; // darken dotNL < 0 area by using half lambert\n // lighting *= shadowAttenuation; // darken if receiving shadow\n #ifdef RN_ALPHABLEND_ON\n lighting *= step(0.0, dotNL); // darken if transparent. Because Unity's transparent material can't receive shadowAttenuation.\n #endif\n }\n\n col *= lighting;\n lightings[i] = lighting;\n\n rt0.xyz += col;\n\n lightAttenuation = 1.0;\n }\n\n\n // Indirect Light\n vec3 indirectLighting = get_ambientColor(materialSID, 0);\n indirectLighting = srgbToLinear(indirectLighting);\n indirectLighting = mix(indirectLighting, vec3(max(EPS_COL, max(indirectLighting.x, max(indirectLighting.y, indirectLighting.z)))), lightColorAttenuation); // color atten\n // TODO: use ShadeIrad in www.ppsloan.org/publications/StupidSH36.pdf\n\n rt0.xyz += indirectLighting * litColor;\n rt0.xyz = min(rt0.xyz, litColor); // comment out if you want to PBR absolutely.\n\n\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_COLOR_MIXED\n vec3 outlineColor = get_outlineColor(materialSID, 0);\n outlineColor = srgbToLinear(outlineColor);\n float outlineLightingMix = get_outlineLightingMix(materialSID, 0);\n rt0.xyz = outlineColor * mix(vec3(1.0), rt0.xyz, outlineLightingMix);\n #endif\n #else\n vec3 viewDirection = normalize(viewVector);\n\n float rimFresnelPower = get_rimFresnelPower(materialSID, 0);\n float rimLift = get_rimLift(materialSID, 0);\n vec3 rimColorFactor = get_rimColor(materialSID, 0);\n vec3 rimTextureColor = texture(u_rimTexture, v_texcoord_0).xyz;\n vec3 rimColor = srgbToLinear(rimColorFactor * rimTextureColor);\n vec3 rim = pow(clamp(1.0 - dot(normal_inWorld, viewDirection) + rimLift, 0.0, 1.0), rimFresnelPower) * rimColor;\n\n float staticRimLighting = 1.0;\n float rimLightingMix = get_rimLightingMix(materialSID, 0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) break;\n\n if(i > 0) staticRimLighting = 0.0;\n\n vec3 rimLighting = mix(vec3(staticRimLighting), lightings[i], vec3(rimLightingMix));\n rt0.xyz += rim * rimLighting;\n }\n\n // additive matcap\n vec3 cameraUp = get_cameraUp(0.0, 0); //solo datum\n vec3 worldViewUp = normalize(cameraUp - viewDirection * dot(viewDirection, cameraUp));\n vec3 worldViewRight = normalize(cross(viewDirection, worldViewUp));\n vec2 matcapUv = vec2(dot(worldViewRight, normal_inWorld), dot(worldViewUp, normal_inWorld)) * 0.5 + 0.5;\n vec3 matCapColor = srgbToLinear(texture(u_matCapTexture, matcapUv).xyz);\n rt0.xyz += matCapColor;\n\n\n // Emission\n vec3 emissionColor = get_emissionColor(materialSID, 0);\n vec3 emission = srgbToLinear(texture(u_emissionTexture, v_texcoord_0).xyz) * emissionColor;\n rt0.xyz += emission;\n #endif\n\n\n // debug\n #ifdef RN_MTOON_DEBUG_NORMAL\n rt0 = vec4(normal_inWorld * 0.5 + 0.5, alpha);\n\n rt0.xyz = srgbToLinear(rt0.xyz);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n #elif defined(RN_MTOON_DEBUG_LITSHADERATE)\n rt0 = vec4(0.0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) break;\n rt0 += vec4(lightIntensities[i] * lightings[i], alpha);\n }\n\n rt0.xyz = srgbToLinear(rt0.xyz);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n #endif\n\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\nfloat makeOutputSrgb = float(get_makeOutputSrgb(materialSID, 0));\nrt0.rgb = mix(rt0.rgb, linearToSrgb(rt0.rgb), makeOutputSrgb);\n\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var g=n(7009),x=n(2192);class I extends i.P{constructor(e,t,n,i,o,a,r,s,g,b){super(null,"MToonShading"+(o?"+morphing":"")+(a?"+skinning":"")+(r?"":"-lighting")+(s?"+tangentAttribute":""),{isMorphing:o,isSkinning:a,isLighting:r},A,y),this.__OutlineWidthModeIsScreen=!1,this.__floatProperties={},this.__vectorProperties={},this.__textureProperties={};const E=[];switch(null!=t?(this.__floatProperties=t.floatProperties,this.__vectorProperties=t.vectorProperties,this.__textureProperties=t.textureProperties):(this.__floatProperties._BlendMode=0,this.__floatProperties._BumpScale=1,this.__floatProperties._CullMode=2,this.__floatProperties._Cutoff=.5,this.__floatProperties._DebugMode=0,this.__floatProperties._DstBlend=0,this.__floatProperties._IndirectLightIntensity=.1,this.__floatProperties._LightColorAttenuation=0,this.__floatProperties._OutlineColorMode=0,this.__floatProperties._OutlineCullMode=1,this.__floatProperties._OutlineLightingMix=1,this.__floatProperties._OutlineScaledMaxDistance=1,this.__floatProperties._OutlineWidth=.5,this.__floatProperties._OutlineWidthMode=0,this.__floatProperties._ReceiveShadowRate=1,this.__floatProperties._RimFresnelPower=1,this.__floatProperties._RimLift=0,this.__floatProperties._RimLightingMix=0,this.__floatProperties._ShadeShift=0,this.__floatProperties._ShadeToony=.9,this.__floatProperties._ShadingGradeRate=1,this.__floatProperties._SrcBlend=1,this.__floatProperties._ZWrite=1,this.__vectorProperties._Color=[1,1,1,1],this.__vectorProperties._EmissionColor=[0,0,0],this.__vectorProperties._OutlineColor=[0,0,0,1],this.__vectorProperties._ShadeColor=[.97,.81,.86,1],this.__vectorProperties._RimColor=[0,0,0],this.__textureProperties._BumpMap=0,this.__textureProperties._EmissionMap=1,this.__textureProperties._MainTex=0,this.__textureProperties._OutlineWidthTexture=0,this.__textureProperties._ReceiveShadowTexture=0,this.__textureProperties._RimTexture=1,this.__textureProperties._ShadeTexture=0,this.__textureProperties._ShadingGradeTexture=0,this.__textureProperties._SphereAdd=1,n=[x.Dx,x.mg]),g&&(this.__floatProperties._DebugMode=g),E.push({semantic:I._Cutoff,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._Cutoff),min:0,max:1},{semantic:I._Color,componentType:l.r.Float,compositionType:c.d.Vec4,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:p.Lt.fromCopyArray(this.__vectorProperties._Color),min:0,max:1},{semantic:I._ShadeColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray(this.__vectorProperties._ShadeColor),min:0,max:1},{semantic:I._BumpScale,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._BumpScale),min:0,max:1},{semantic:I._ReceiveShadowRate,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._ReceiveShadowRate),min:0,max:1},{semantic:I._ShadingGradeRate,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._ShadingGradeRate),min:0,max:1},{semantic:I._ShadeShift,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._ShadeShift),min:0,max:1},{semantic:I._ShadeToony,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._ShadeToony),min:0,max:1},{semantic:I._LightColorAttenuation,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._LightColorAttenuation),min:0,max:1},{semantic:I._AmbientColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray([.5785,.5785,.5785]),min:0,max:1},{semantic:I._RimColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray(this.__vectorProperties._RimColor),min:0,max:1},{semantic:I._RimLightingMix,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._RimLightingMix),min:0,max:1},{semantic:I._RimFresnelPower,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._RimFresnelPower),min:0,max:1},{semantic:I._RimLift,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._RimLift),min:0,max:1},{semantic:I.CameraUp,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!0,soloDatum:!0,initialValue:f.P.fromCopyArray([0,1,0]),min:0,max:1},{semantic:I._EmissionColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray(this.__vectorProperties._EmissionColor),min:0,max:1},{semantic:u.f5.Wireframe,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray([0,0,1]),min:0,max:10},{semantic:u.f5.MakeOutputSrgb,compositionType:c.d.Scalar,componentType:l.r.Bool,stage:d.H.PixelShader,min:0,max:1,isCustomSetting:!1,updateInterval:m.a.FirstTimeOnly,initialValue:h.Ru.fromCopyNumber(b?1:0)}),this.__floatProperties._DebugMode){case 1:this.__definitions+="#define RN_MTOON_DEBUG_NORMAL\n";break;case 2:this.__definitions+="#define RN_MTOON_DEBUG_LITSHADERATE\n"}if(e){switch(this.__definitions+="#define RN_MTOON_IS_OUTLINE\n",this.__floatProperties._OutlineWidthMode){case 0:this.__definitions+="#define RN_MTOON_OUTLINE_NONE\n";break;case 1:this.__definitions+="#define RN_MTOON_OUTLINE_WIDTH_WORLD\n";break;case 2:this.__definitions+="#define RN_MTOON_OUTLINE_WIDTH_SCREEN\n",this.__OutlineWidthModeIsScreen=!0}switch(this.__floatProperties._OutlineColorMode){case 0:this.__definitions+="#define RN_MTOON_OUTLINE_COLOR_FIXED\n";break;case 1:this.__definitions+="#define RN_MTOON_OUTLINE_COLOR_MIXED\n"}E.push({semantic:I._OutlineWidth,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.VertexShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._OutlineWidth),min:0,max:1},{semantic:I._OutlineScaledMaxDistance,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.VertexShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._OutlineScaledMaxDistance),min:0,max:1},{semantic:I._OutlineColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray(this.__vectorProperties._OutlineColor),min:0,max:1},{semantic:I._OutlineLightingMix,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._OutlineLightingMix),min:0,max:1},{semantic:I.Aspect,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:h.Ru.fromCopyNumber(1),min:0,max:1})}r&&(this.__definitions+="#define RN_IS_LIGHTING\n"),a&&(this.__definitions+="#define RN_IS_SKINNING\n"),o&&(this.__definitions+="#define RN_IS_MORPHING\n",E.push({semantic:u.f5.MorphTargetNumber,componentType:l.r.Int,compositionType:c.d.Scalar,stage:d.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:h.Ru.fromCopyNumber(0),min:0,max:_.D.maxVertexMorphNumberInShader,needUniformInDataTextureMode:!0},{semantic:u.f5.DataTextureMorphOffsetPosition,componentType:l.r.Int,compositionType:c.d.ScalarArray,arrayLength:_.D.maxVertexMorphNumberInShader,stage:d.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new v.j(new Int32Array(_.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:u.f5.MorphWeights,componentType:l.r.Float,compositionType:c.d.ScalarArray,arrayLength:_.D.maxVertexMorphNumberInShader,stage:d.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new v.j(new Float32Array(_.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0})),s&&(this.__definitions+="#define RN_USE_TANGENT_ATTRIBUTE\n"),this.__setTextures(n,i,E,e),this.setShaderSemanticsInfoArray(E)}__setTextures(e,t,n,i){n.push({semantic:I._MainTex,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[0,e[this.__textureProperties._MainTex],t[this.__textureProperties._MainTex]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._ShadeTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[1,e[this.__textureProperties._ShadeTexture],t[this.__textureProperties._ShadeTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._ReceiveShadowTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[2,e[this.__textureProperties._ReceiveShadowTexture],t[this.__textureProperties._ReceiveShadowTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._ShadingGradeTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[3,e[this.__textureProperties._ShadingGradeTexture],t[this.__textureProperties._ShadingGradeTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._RimTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[4,e[this.__textureProperties._RimTexture],t[this.__textureProperties._RimTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._SphereAdd,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[5,e[this.__textureProperties._SphereAdd],t[this.__textureProperties._SphereAdd]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._EmissionMap,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[6,e[this.__textureProperties._EmissionMap],t[this.__textureProperties._EmissionMap]],min:0,max:Number.MAX_SAFE_INTEGER}),n.push({semantic:I._BumpMap,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[8,e[this.__textureProperties._BumpMap],t[this.__textureProperties._BumpMap]],min:0,max:Number.MAX_SAFE_INTEGER}),this.__textureProperties._BumpMap!==e.length-2&&(this.__definitions+="#define RN_MTOON_HAS_BUMPMAP\n"),i&&(n.push({semantic:I._OutlineWidthTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.VertexShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[9,e[this.__textureProperties._OutlineWidthTexture],t[this.__textureProperties._OutlineWidthTexture]],min:0,max:Number.MAX_SAFE_INTEGER}),this.__textureProperties._OutlineWidthTexture!==e.length-2&&(this.__definitions+="#define RN_MTOON_HAS_OUTLINE_WIDTH_TEXTURE\n"))}setMaterialParameters(e,t){if(null==I.usableBlendEquationModeAlpha&&I.__initializeUsableBlendEquationModeAlpha(),0!==this.__floatProperties._BlendMode){switch(this.__floatProperties._BlendMode){case 1:this.__definitions+="#define RN_ALPHATEST_ON\n",e.alphaMode=o.F.Mask;break;case 2:case 3:this.__definitions+="#define RN_ALPHABLEND_ON\n",e.alphaMode=o.F.Translucent}const t=32774,n=I.usableBlendEquationModeAlpha,i=I.unityBlendEnumCorrespondence(this.__floatProperties._SrcBlend),a=I.unityBlendEnumCorrespondence(this.__floatProperties._DstBlend);e.setBlendEquationMode(g.C.from(t),null!=n?g.C.from(n):void 0),e.setBlendFuncFactor(g.C.from(i),g.C.from(a))}if(t)switch(this.__floatProperties._OutlineCullMode){case 0:e.cullFace=!1;break;case 1:e.cullFace=!0,e.cullFrontFaceCCW=!1;break;case 2:e.cullFace=!0,e.cullFrontFaceCCW=!0}else switch(this.__floatProperties._CullMode){case 0:e.cullFace=!1;break;case 1:e.cullFace=!0,e.cullFrontFaceCCW=!1;break;case 2:e.cullFace=!0,e.cullFrontFaceCCW=!0}}static __initializeUsableBlendEquationModeAlpha(){const e=r.F.getWebGLResourceRepository().currentWebGLContextWrapper,t=e.getRawContextAsWebGL2();e.isWebGL2?I.usableBlendEquationModeAlpha=t.MAX:e.webgl1ExtBM?I.usableBlendEquationModeAlpha=e.webgl1ExtBM.MAX_EXT:I.usableBlendEquationModeAlpha=t.FUNC_ADD}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){let o=i.renderPass.cameraComponent;if(null==o&&(o=s.C.getComponent(a.M,a.M.current)),i.setUniform){this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix),this.setViewInfo(t,o,i.isVr,i.displayIdx),this.setProjection(t,o,i.isVr,i.displayIdx);const n=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,n),this.setLightsInfo(t,i.lightComponents,e,i.setUniform),t._gl.uniform3fv(t.cameraUp,o.upInner._v),this.__OutlineWidthModeIsScreen&&t._gl.uniform1f(t.aspect,o.aspect)}else e.setParameter(I.CameraUp,o.upInner),this.__OutlineWidthModeIsScreen&&e.setParameter(I.Aspect,o.aspect);const r=i.entity.tryToGetBlendShape();this.setMorphInfo(t,i.entity.getMesh(),i.primitive,r)}static unityBlendEnumCorrespondence(e){const t=r.F.getWebGLResourceRepository().currentWebGLContextWrapper.getRawContext();let n=t.ZERO;switch(e){case 0:n=t.ZERO;break;case 1:n=t.ONE;break;case 2:n=t.DST_COLOR;break;case 3:n=t.SRC_COLOR;break;case 4:n=t.ONE_MINUS_DST_COLOR;break;case 5:n=t.SRC_ALPHA;break;case 6:n=t.ONE_MINUS_SRC_COLOR;break;case 7:n=t.DST_ALPHA;break;case 8:n=t.ONE_MINUS_DST_ALPHA;break;case 9:n=t.SRC_ALPHA_SATURATE;break;case 10:n=t.ONE_MINUS_SRC_ALPHA}return n}}I._Cutoff=new u.wy({str:"cutoff"}),I._Color=new u.wy({str:"litColor"}),I._ShadeColor=new u.wy({str:"shadeColor"}),I._MainTex=new u.wy({str:"litColorTexture"}),I._ShadeTexture=new u.wy({str:"shadeColorTexture"}),I._BumpScale=new u.wy({str:"normalScale"}),I._BumpMap=new u.wy({str:"normalTexture"}),I._ReceiveShadowRate=new u.wy({str:"receiveShadowRate"}),I._ReceiveShadowTexture=new u.wy({str:"receiveShadowTexture"}),I._ShadingGradeRate=new u.wy({str:"shadingGradeRate"}),I._ShadingGradeTexture=new u.wy({str:"shadingGradeTexture"}),I._ShadeShift=new u.wy({str:"shadeShift"}),I._ShadeToony=new u.wy({str:"shadeToony"}),I._LightColorAttenuation=new u.wy({str:"lightColorAttenuation"}),I._AmbientColor=new u.wy({str:"ambientColor"}),I._RimTexture=new u.wy({str:"rimTexture"}),I._RimColor=new u.wy({str:"rimColor"}),I._RimLightingMix=new u.wy({str:"rimLightingMix"}),I._RimFresnelPower=new u.wy({str:"rimFresnelPower"}),I._RimLift=new u.wy({str:"rimLift"}),I._SphereAdd=new u.wy({str:"matCapTexture"}),I._EmissionColor=new u.wy({str:"emissionColor"}),I._EmissionMap=new u.wy({str:"emissionTexture"}),I._OutlineWidthTexture=new u.wy({str:"outlineWidthTexture"}),I._OutlineWidth=new u.wy({str:"outlineWidth"}),I._OutlineScaledMaxDistance=new u.wy({str:"outlineScaledMaxDistance"}),I._OutlineColor=new u.wy({str:"outlineColor"}),I._OutlineLightingMix=new u.wy({str:"outlineLightingMix"}),I.Aspect=new u.wy({str:"aspect"}),I.CameraUp=new u.wy({str:"cameraUp"})},9330:(e,t,n)=>{"use strict";n.d(t,{S:()=>A});var i=n(7290),o=n(224),a=n(2404),r=n(3999),s=n(810),l=n(3616),c=n(4587),_=n(5324),h=n(1813),u=n(2575),d=n(2471),m=n(5868);const f={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec3 a_baryCentricCoord;\nin vec3 a_position;\nin vec3 a_normal;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec3 v_baryCentricCoord;\nout vec3 v_normal_inView;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n\n bool isSkinning = false;\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n v_normal_inView = vec3(viewMatrix * vec4(normalMatrix * a_normal, 0.0));\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n v_baryCentricCoord = a_baryCentricCoord;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},p={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec3 v_baryCentricCoord;\nin vec3 v_normal_inView;\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec3 normal_inView = normalize(v_normal_inView);\n normal_inView.y *= -1.0;\n vec2 normalUVCordinate = normal_inView.xy * 0.5 + 0.5;\n vec4 matCapColor = texture(u_matCapTexture, normalUVCordinate);\n rt0 = matCapColor;\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var v=n(2192);class A extends m.P{constructor(e,t,n,o){let a;super(null,"MatCapShading"+(e?"+skinning":""),{isSkinning:e},f,p),"string"==typeof t?(a=new u.x,async function(e){await a.generateTextureFromUri(e,{type:r.r.UnsignedByte})}(t)):n instanceof i.y?a=n:(console.warn("no matcap texture"),a=v.mg);const m=[];m.push({semantic:c.f5.Wireframe,componentType:r.r.Float,compositionType:s.d.Vec3,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:d.P.fromCopyArray([0,0,1]),min:0,max:10}),m.push({semantic:c.f5.PointSize,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:l.Ru.fromCopyNumber(30),min:0,max:100},{semantic:c.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:s.d.Vec3,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:d.P.fromCopyArray([0,.1,.01]),min:0,max:1}),e&&(this.__definitions+="#define RN_IS_SKINNING\n"),m.push({semantic:A.MatCapTexture,componentType:r.r.Int,compositionType:s.d.Texture2D,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[0,a,o],min:0,max:Number.MAX_SAFE_INTEGER}),this.setShaderSemanticsInfoArray(m)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix));let r=i.renderPass.cameraComponent;null==r&&(r=a.C.getComponent(o.M,o.M.current)),this.setViewInfo(t,r,i.isVr,i.displayIdx),this.setProjection(t,r,i.isVr,i.displayIdx);const s=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,s)}}A.MatCapTexture=new c.wy({str:"matCapTexture"})},8283:(e,t,n)=>{"use strict";n.d(t,{u:()=>_});var i=n(4587),o=n(5868),a=n(6773),r=n(5324),s=n(2404),l=n(224),c=n(7348);class _ extends o.P{constructor({name:e,vertexShaderityObj:t,pixelShaderityObj:n}){super(null,e,{});const i=a.Q.getShaderDataReflection(t,o.P.__semanticsMap.get(this.shaderFunctionName)),s=a.Q.getShaderDataReflection(n,o.P.__semanticsMap.get(this.shaderFunctionName));this.__vertexShaderityObject=t,this.__pixelShaderityObject=n;const l=i.shaderSemanticsInfoArray.concat();for(const e of s.shaderSemanticsInfoArray){const t=l.find((t=>t.semantic.str===e.semantic.str));t?t.stage=r.H.VertexAndPixelShader:l.push(e)}_.__removeUselessShaderSemantics(l),this.setShaderSemanticsInfoArray(l)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){if(i.setUniform){if(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix),n||i.isVr){let e=i.renderPass.cameraComponent;null==e&&(e=s.C.getComponent(l.M,l.M.current)),this.setViewInfo(t,e,i.isVr,i.displayIdx),this.setProjection(t,e,i.isVr,i.displayIdx)}n&&this.setLightsInfo(t,i.lightComponents,e,i.setUniform);const o=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,o)}const o=i.entity.tryToGetBlendShape();this.setMorphInfo(t,i.entity.getMesh(),i.primitive,o)}static __removeUselessShaderSemantics(e){const t=c.$.getInstance().getGlobalProperties();for(const n of t){const t=n.shaderSemanticsInfo,i=e.findIndex((e=>e.semantic.str===t.semantic.str));-1!==i&&e.splice(i,1)}const n=[i.f5.VertexAttributesExistenceArray,i.f5.WorldMatrix,i.f5.NormalMatrix,i.f5.PointSize,i.f5.PointDistanceAttenuation];for(const t of n){const n=e.findIndex((e=>e.semantic.str===t.str));-1!==n&&e.splice(n,1)}}}},9764:(e,t,n)=>{"use strict";n.d(t,{R:()=>I});var i=n(4587),o=n(5868),a=n(810),r=n(3999),s=n(7192),l=n(2471),c=n(9840),_=n(5324),h=n(1813),u=n(2404),d=n(224),m=n(4255),f=n(3616),p=n(3258),v=n(7987),A=n(3496);const y={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec2 a_texcoord_1;\nin vec4 a_joint;\nin vec4 a_weight;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec4 v_texcoord_1;\nout vec4 v_projPosition_from_light;\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n // Shadow mapping\n mat4 lightViewProjectionMatrix = get_lightViewProjectionMatrix(materialSID, 0);\n v_projPosition_from_light = lightViewProjectionMatrix * v_position_inWorld;\n\n // Following tMatrix is based on https://wgld.org/d/webgl/w051.html\n mat4 tMatrix = mat4(\n 0.5, 0.0, 0.0, 0.0,\n 0.0, 0.5, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.5, 0.5, 0.0, 1.0\n );\n v_texcoord_1 = tMatrix * v_projPosition_from_light;\n\n v_color = a_color;\n v_normal_inWorld = normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},g={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec4 v_texcoord_1;\nin vec4 v_projPosition_from_light;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nfloat decodeRGBAToDepth(vec4 RGBA){\n const float rMask = 1.0;\n const float gMask = 1.0 / 255.0;\n const float bMask = 1.0 / (255.0 * 255.0);\n const float aMask = 1.0 / (255.0 * 255.0 * 255.0);\n float depth = dot(RGBA, vec4(rMask, gMask, bMask, aMask));\n return depth;\n}\n\nvoid main (){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n // diffuseColor\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture\n vec4 textureColor = texture(u_diffuseColorTexture, v_texcoord_0);\n if (textureColor.r > 0.05) {\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n }\n\n // shadow mapping\n if(v_projPosition_from_light.w > 0.0){\n float zNear = get_zNearInner(materialSID, 0);\n float zFar = get_zFarInner(materialSID, 0);\n float normalizationCoefficient = 1.0 / (zFar - zNear);\n\n vec2 shadowMapUV = v_texcoord_1.xy / v_texcoord_1.w;\n\n #ifdef RN_IS_DEBUGGING\n bool inShadowMap = (shadowMapUV.x >= 0.0 && shadowMapUV.x <= 1.0) && (shadowMapUV.y >= 0.0 && shadowMapUV.y <= 1.0);\n if(inShadowMap == false){\n rt0 = get_debugColorFactor(materialSID, 0);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n }\n #endif\n\n float measureDepth = normalizationCoefficient * length(v_projPosition_from_light);\n float textureDepth = decodeRGBAToDepth(texture(u_depthTexture, shadowMapUV));\n float allowableDepthError = get_allowableDepthError(materialSID, 0);\n\n if(measureDepth > textureDepth + allowableDepthError){\n // case of shadow\n vec4 shadowColorFactor = get_shadowColorFactor(materialSID, 0);\n diffuseColor = shadowColorFactor.rgb;\n alpha = shadowColorFactor.a;\n }\n }\n\n // Lighting\n vec3 shadingColor = vec3(0.0, 0.0, 0.0);\n int shadingModel = get_shadingModel(materialSID, 0);\n if (shadingModel > 0) {\n\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n int lightNumber = get_lightNumber(materialSID, 0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, light.direction)) * light.attenuatedIntensity;\n\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n float shininess = get_shininess(materialSID, 0);\n if (shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 halfVector = normalize(light.direction + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), shininess);\n } else if (shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 R = reflect(light.direction, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), shininess);\n }\n\n }\n\n shadingColor = diffuse + specular;\n } else {\n shadingColor = diffuseColor;\n }\n\n rt0 = vec4(shadingColor, alpha);\n //rt0 = vec4(u_lightNumber, 0.0, 0.0, 1.0);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var x=n(2192);class I extends o.P{constructor({isMorphing:e,isSkinning:t,isLighting:n,isDebugging:o,colorAttachmentsNumber:u},d){super(null,"ShadowMapDecodeClassicShading"+(t?"+skinning":"")+(n?"":"-lighting"),{isMorphing:e,isSkinning:t,isLighting:n},y,g),this.__encodedDepthRenderPass=d;const v=d.getFramebuffer();if(null==v)return void console.error("encodedDepthRenderPass does not have framebuffer");const b=v.colorAttachments[u],E=d.getViewport();E.setComponents(1,1,E.z-1,E.w-1),d.setViewport(E);const T=[{semantic:i.f5.LightViewProjectionMatrix,compositionType:a.d.Mat4,componentType:r.r.Float,stage:_.H.VertexShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:A.e.zero(),min:-Number.MAX_VALUE,max:Number.MAX_VALUE},{semantic:i.f5.ShadingModel,compositionType:a.d.Scalar,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(c.D.Constant.index),min:0,max:3},{semantic:i.f5.Shininess,compositionType:a.d.Scalar,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(5),min:0,max:Number.MAX_VALUE},{semantic:I.AllowableDepthError,compositionType:a.d.Scalar,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e-4),min:0,max:1},{semantic:I.ShadowColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([.5,.5,.5,1]),min:0,max:1},{semantic:i.f5.DiffuseColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,1,1,1]),min:0,max:2},{semantic:I.IsPointLight,componentType:r.r.Bool,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1),min:0,max:1},{semantic:i.f5.Wireframe,componentType:r.r.Float,compositionType:a.d.Vec3,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:l.P.fromCopyArray([0,0,1]),min:0,max:10},{semantic:i.f5.NormalTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[0,x.$R],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:i.f5.DepthTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[0,b],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:i.f5.DiffuseColorTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[1,x.Dx],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.zNearInner,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(.1),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:I.zFarInner,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e4),min:1e-4,max:Number.MAX_SAFE_INTEGER}];T.push({semantic:i.f5.PointSize,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(30),min:0,max:100},{semantic:i.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:a.d.Vec3,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:l.P.fromCopyArray([0,.1,.01]),min:0,max:1}),t&&(this.__definitions+="#define RN_IS_SKINNING\n"),n&&(this.__definitions+="#define RN_IS_LIGHTING\n"),e&&(this.__definitions+="#define RN_IS_MORPHING\n",T.push({semantic:i.f5.MorphTargetNumber,componentType:r.r.Int,compositionType:a.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(0),min:0,max:p.D.maxVertexMorphNumberInShader,needUniformInDataTextureMode:!0},{semantic:i.f5.DataTextureMorphOffsetPosition,componentType:r.r.Int,compositionType:a.d.ScalarArray,arrayLength:p.D.maxVertexMorphNumberInShader,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new m.j(new Int32Array(p.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:i.f5.MorphWeights,componentType:r.r.Float,compositionType:a.d.ScalarArray,arrayLength:p.D.maxVertexMorphNumberInShader,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new m.j(new Float32Array(p.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0})),o&&(this.__definitions+="#define RN_IS_DEBUGGING\n",T.push({semantic:I.DebugColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,0,0,1]),min:0,max:2})),this.setShaderSemanticsInfoArray(T)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:o}){let a=o.renderPass.cameraComponent;null==a&&(a=u.C.getComponent(d.M,d.M.current));const r=this.__encodedDepthRenderPass.cameraComponent;o.setUniform?(this.setWorldMatrix(t,o.worldMatrix),this.setNormalMatrix(t,o.normalMatrix),this.setViewInfo(t,a,o.isVr,o.displayIdx),this.setProjection(t,a,o.isVr,o.displayIdx),I.__lastZNear!==r.zNearInner&&(t._gl.uniform1f(t.zNearInner,r.zNearInner),I.__lastZNear=r.zNearInner),I.__lastZFar!==r.zFarInner&&(t._gl.uniform1f(t.zFarInner,r.zFarInner),I.__lastZFar=r.zFarInner),v.F.getWebGLResourceRepository().setUniformValue(t,i.f5.LightViewProjectionMatrix.str,!0,this.__encodedDepthRenderPass.cameraComponent.viewProjectionMatrix)):(e.setParameter(I.zNearInner,r.zNearInner),e.setParameter(I.zFarInner,r.zFarInner),e.setParameter(i.f5.LightViewProjectionMatrix,this.__encodedDepthRenderPass.cameraComponent.viewProjectionMatrix));const s=o.entity.tryToGetSkeletal();this.setSkinning(t,o.setUniform,s),this.setLightsInfo(t,o.lightComponents,e,o.setUniform);const l=o.entity.tryToGetBlendShape();this.setMorphInfo(t,o.entity.getMesh(),o.primitive,l)}}I.ShadowColorFactor=new i.wy({str:"shadowColorFactor"}),I.ShadowAlpha=new i.wy({str:"shadowAlpha"}),I.NonShadowAlpha=new i.wy({str:"nonShadowAlpha"}),I.AllowableDepthError=new i.wy({str:"allowableDepthError"}),I.zNearInner=new i.wy({str:"zNearInner"}),I.zFarInner=new i.wy({str:"zFarInner"}),I.DebugColorFactor=new i.wy({str:"debugColorFactor"}),I.DepthTexture=new i.wy({str:"depthTexture"}),I.IsPointLight=new i.wy({str:"isPointLight"}),I.__lastZNear=0,I.__lastZFar=0},7369:(e,t,n)=>{"use strict";n.d(t,{d:()=>p});var i=n(224),o=n(2404),a=n(3999),r=n(810),s=n(4587),l=n(5324),c=n(1813),_=n(5868),h=n(4255),u=n(3616);const d={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec3 a_baryCentricCoord;\nin vec3 a_position;\n\nout vec3 v_baryCentricCoord;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n v_baryCentricCoord = a_baryCentricCoord;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},m={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec3 v_baryCentricCoord;\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3 + vec3(1.0 - wireframeWidthInner) * d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n float tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n\n float synthesizeCoefficient0 = u_synthesizeCoefficient[0];\n vec3 color = synthesizeCoefficient0 * texture(u_synthesizeTexture0, offset * tFrag).rgb;\n\n vec4 targetTextureColor = texture(u_targetRegionTexture, offset * tFrag);\n if (targetTextureColor != vec4(1.0, 1.0, 1.0, 1.0)) {\n float synthesizeCoefficient1 = u_synthesizeCoefficient[1];\n float synthesizeCoefficient2 = u_synthesizeCoefficient[2];\n float synthesizeCoefficient3 = u_synthesizeCoefficient[3];\n float synthesizeCoefficient4 = u_synthesizeCoefficient[4];\n float synthesizeCoefficient5 = u_synthesizeCoefficient[5];\n\n color += synthesizeCoefficient1 * texture(u_synthesizeTexture1, offset * tFrag).rgb;\n color += synthesizeCoefficient2 * texture(u_synthesizeTexture2, offset * tFrag).rgb;\n color += synthesizeCoefficient3 * texture(u_synthesizeTexture3, offset * tFrag).rgb;\n color += synthesizeCoefficient4 * texture(u_synthesizeTexture4, offset * tFrag).rgb;\n color += synthesizeCoefficient5 * texture(u_synthesizeTexture5, offset * tFrag).rgb;\n }\n\n rt0 = vec4(color, 1.0);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n\n",shaderStage:"fragment",isFragmentShader:!0};var f=n(2192);class p extends _.P{constructor(e,t=f.mg){var n,i,o,_,v,A;super(null,"synthesizeHDRTextureShading",{},d,m),this.existTargetRegion=null!=t,this.textureNumber=e.length;const y=[{semantic:s.f5.FramebufferWidth,componentType:a.r.Float,compositionType:r.d.Scalar,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,soloDatum:!1,initialValue:u.Ru.fromCopyNumber(e[0].width),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeCoefficient,componentType:a.r.Float,compositionType:r.d.ScalarArray,arrayLength:6,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,soloDatum:!1,initialValue:new h.j(new Float32Array(6)),min:0,max:1,needUniformInDataTextureMode:!0},{semantic:p.SynthesizeTexture0,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[0,null!==(n=e[0])&&void 0!==n?n:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture1,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[1,null!==(i=e[1])&&void 0!==i?i:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture2,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[2,null!==(o=e[2])&&void 0!==o?o:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture3,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[3,null!==(_=e[3])&&void 0!==_?_:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture4,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[4,null!==(v=e[4])&&void 0!==v?v:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture5,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[5,null!==(A=e[5])&&void 0!==A?A:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.TargetRegionTexture,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[6,t],min:0,max:Number.MAX_SAFE_INTEGER}];this.setShaderSemanticsInfoArray(y)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:a}){a.setUniform?this.setWorldMatrix(t,a.worldMatrix):t._gl.uniform1fv(t.synthesizeCoefficient,e.getParameter(p.SynthesizeCoefficient)._v);let r=a.renderPass.cameraComponent;null==r&&(r=o.C.getComponent(i.M,i.M.current)),r&&(this.setViewInfo(t,r,a.isVr,a.displayIdx),this.setProjection(t,r,a.isVr,a.displayIdx))}get existTargetRegionTexture(){return this.existTargetRegion}get synthesizeTextureNumber(){return this.textureNumber}}p.SynthesizeCoefficient=new s.wy({str:"synthesizeCoefficient"}),p.TargetRegionTexture=new s.wy({str:"targetRegionTexture"}),p.SynthesizeTexture0=new s.wy({str:"synthesizeTexture0"}),p.SynthesizeTexture1=new s.wy({str:"synthesizeTexture1"}),p.SynthesizeTexture2=new s.wy({str:"synthesizeTexture2"}),p.SynthesizeTexture3=new s.wy({str:"synthesizeTexture3"}),p.SynthesizeTexture4=new s.wy({str:"synthesizeTexture4"}),p.SynthesizeTexture5=new s.wy({str:"synthesizeTexture5"})},968:(e,t,n)=>{"use strict";n.d(t,{Q:()=>I});var i=n(4587),o=n(5868),a=n(810),r=n(3999),s=n(7192),l=n(2471),c=n(9840),_=n(5324),h=n(1813),u=n(2404),d=n(224),m=n(4255),f=n(3616),p=n(3258),v=n(7987),A=n(3496);const y={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec4 v_texcoord_1;\nout vec4 v_projPosition_from_light;\nout vec3 v_baryCentricCoord;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat*uniformScaleMat;\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat44x1\n mat4 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = getSkinMatrix(skeletalComponentSID);\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n\n bool isSkinning = false;\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n v_color = a_color;\n v_texcoord_0 = a_texcoord_0;\n\n // Shadow mapping\n mat4 lightViewProjectionMatrix = get_lightViewProjectionMatrix(materialSID, 0);\n v_projPosition_from_light = lightViewProjectionMatrix * v_position_inWorld;\n\n // Following tMatrix is based on https://wgld.org/d/webgl/w051.html\n mat4 tMatrix = mat4(\n 0.5, 0.0, 0.0, 0.0,\n 0.0, 0.5, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.5, 0.5, 0.0, 1.0\n );\n v_texcoord_1 = tMatrix * v_projPosition_from_light;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},g={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec4 v_texcoord_1;\nin vec4 v_projPosition_from_light;\nin vec3 v_baryCentricCoord;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nfloat decodeRGBAToDepth(vec4 RGBA){\n const float rMask = 1.0;\n const float gMask = 1.0 / 255.0;\n const float bMask = 1.0 / (255.0 * 255.0);\n const float aMask = 1.0 / (255.0 * 255.0 * 255.0);\n float depth = dot(RGBA, vec4(rMask, gMask, bMask, aMask));\n return depth;\n}\n\nfloat linstep(float min,float max,float v){\n return clamp((v-min)/(max-min),0.0,1.0);\n}\n\nfloat reduceLightBleeding(float p_max, float parameter){\n return linstep(parameter,1.0,p_max);\n}\n\nfloat chebyshevUpperBound(float materialSID){\n float textureDepth = decodeRGBAToDepth(texture2DProj(u_depthTexture, v_texcoord_1));\n float textureSquareDepth = decodeRGBAToDepth(texture2DProj(u_squareDepthTexture, v_texcoord_1));\n if(textureDepth == 1.0 || textureSquareDepth == 1.0){\n return 1.0;\n }\n\n float nonShadowProb = 1.0;\n\n if(v_projPosition_from_light.w > 0.0){\n float measureDepth;\n bool isPointLight = get_isPointLight(materialSID, 0);\n if(isPointLight){\n float zNear = get_zNearInner(materialSID, 0);\n float zFar = get_zFarInner(materialSID, 0);\n float normalizationCoefficient = 1.0 / (zFar - zNear);\n measureDepth = normalizationCoefficient * length(v_projPosition_from_light);\n }else{\n measureDepth = (v_projPosition_from_light / v_projPosition_from_light.w).z;\n }\n\n float depthAdjustment = get_depthAdjustment(materialSID, 0);\n measureDepth += depthAdjustment;\n\n float textureDepthAdjustment = get_textureDepthAdjustment(materialSID, 0);\n textureDepth += textureDepthAdjustment;\n\n float d = measureDepth - textureDepth;\n if(d < 0.0) return 1.0;\n\n float variance = textureSquareDepth - textureDepth * textureDepth;\n float minimumVariance = get_minimumVariance(materialSID, 0);\n variance = max(variance, minimumVariance);\n\n nonShadowProb = variance / (variance + d * d);\n\n\n float lightBleedingParameter = get_lightBleedingParameter(materialSID, 0);\n nonShadowProb = reduceLightBleeding(nonShadowProb, lightBleedingParameter);\n }\n return nonShadowProb;\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n // diffuseColor\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture\n vec4 textureColor = texture(u_diffuseColorTexture, v_texcoord_0);\n if (textureColor.r > 0.05) {\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n }\n\n // shadow mapping\n vec4 shadowColor = get_shadowColor(materialSID, 0);\n\n float nonShadowProb = chebyshevUpperBound(materialSID);\n diffuseColor = nonShadowProb * diffuseColor + (1.0 - nonShadowProb) * shadowColor.rgb;\n alpha = nonShadowProb * alpha + (1.0 - nonShadowProb) * shadowColor.a;\n\n // Lighting\n vec3 shadingColor = vec3(0.0, 0.0, 0.0);\n\n int shadingModel = get_shadingModel(materialSID, 0);\n if (shadingModel > 0) {\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n int lightNumber = get_lightNumber(materialSID, 0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */ ; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, light.direction)) * light.attenuatedIntensity;\n\n vec3 viewPosition = get_viewPosition(materialSID, 0);\n float shininess = get_shininess(materialSID, 0);\n if (shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 halfVector = normalize(light.direction + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), shininess);\n } else if (shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 R = reflect(light.direction, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), shininess);\n }\n\n }\n\n shadingColor = diffuse + specular;\n } else {\n shadingColor = diffuseColor;\n }\n\n rt0 = vec4(shadingColor, alpha);\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var x=n(2192);class I extends o.P{constructor({isMorphing:e,isSkinning:t,isLighting:n,isDebugging:o,colorAttachmentsNumberDepth:u,colorAttachmentsNumberSquareDepth:d,depthCameraComponent:v},b){super(null,"varianceShadowMapDecodeShading"+(e?"+morphing":"")+(t?"+skinning":"")+(n?"":"-lighting")+(o?"":"+debugging"),{isMorphing:e,isSkinning:t,isLighting:n},y,g),2!==b.length&&console.error("invalid length of renderPasses"),null==v?console.warn("need to set depth camera component"):this.__depthCameraComponent=v;for(const e of b){const t=e.getViewport();t.setComponents(1,1,t.z-1,t.w-1),e.setViewport(t)}let E;const T=b[0].getFramebuffer();let S;T?E=T.colorAttachments[u]:(console.warn("renderPass of depth does not have framebuffer"),E=x.mg);const C=b[1].getFramebuffer();C?S=C.colorAttachments[d]:(console.warn("renderPass of square depth does not have framebuffer"),S=x.mg);const w=[{semantic:i.f5.LightViewProjectionMatrix,compositionType:a.d.Mat4,componentType:r.r.Float,stage:_.H.VertexShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:A.e.zero(),min:-Number.MAX_VALUE,max:Number.MAX_VALUE},{semantic:i.f5.ShadingModel,compositionType:a.d.Scalar,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(c.D.Constant.index),min:0,max:3},{semantic:i.f5.Shininess,compositionType:a.d.Scalar,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(5),min:0,max:Number.MAX_VALUE},{semantic:I.AllowableDepthError,compositionType:a.d.Scalar,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e-4),min:0,max:1},{semantic:I.ShadowColor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([.5,.5,.5,1]),min:0,max:1},{semantic:i.f5.DiffuseColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,1,1,1]),min:0,max:2},{semantic:I.zNearInner,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(.1),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:I.zFarInner,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e4),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:I.IsPointLight,componentType:r.r.Bool,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1),min:0,max:1},{semantic:i.f5.Wireframe,componentType:r.r.Float,compositionType:a.d.Vec3,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:l.P.fromCopyArray([0,0,1]),min:0,max:10},{semantic:I.DepthAdjustment,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(0),min:0,max:1},{semantic:I.LightBleedingParameter,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(0),min:0,max:1},{semantic:I.MinimumVariance,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e-7),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.TextureDepthAdjustment,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(0),min:0,max:1},{semantic:i.f5.NormalTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[0,x.$R],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:i.f5.DiffuseColorTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[1,x.Dx],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.DepthTexture,componentType:r.r.Int,compositionType:a.d.Texture2D,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[2,E],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.SquareDepthTexture,componentType:r.r.Int,compositionType:a.d.Texture2D,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[3,S],min:0,max:Number.MAX_SAFE_INTEGER}];w.push({semantic:i.f5.PointSize,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(30),min:0,max:100},{semantic:i.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:a.d.Vec3,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:l.P.fromCopyArray([0,.1,.01]),min:0,max:1}),t&&(this.__definitions+="#define RN_IS_SKINNING\n"),n&&(this.__definitions+="#define RN_IS_LIGHTING\n"),e&&(this.__definitions+="#define RN_IS_MORPHING\n",w.push({semantic:i.f5.MorphTargetNumber,componentType:r.r.Int,compositionType:a.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(0),min:0,max:p.D.maxVertexMorphNumberInShader,needUniformInDataTextureMode:!0},{semantic:i.f5.DataTextureMorphOffsetPosition,componentType:r.r.Int,compositionType:a.d.ScalarArray,arrayLength:p.D.maxVertexMorphNumberInShader,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new m.j(new Int32Array(p.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:i.f5.MorphWeights,componentType:r.r.Float,compositionType:a.d.ScalarArray,arrayLength:p.D.maxVertexMorphNumberInShader,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new m.j(new Float32Array(p.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0})),o&&(this.__definitions+="#define RN_IS_DEBUGGING\n",w.push({semantic:I.DebugColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,0,0,1]),min:0,max:2})),this.setShaderSemanticsInfoArray(w)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:o}){var a;let r=o.renderPass.cameraComponent;null==r&&(r=u.C.getComponent(d.M,d.M.current));const s=null!==(a=this.__depthCameraComponent)&&void 0!==a?a:o.renderPass.cameraComponent;o.setUniform?(this.setWorldMatrix(t,o.worldMatrix),this.setNormalMatrix(t,o.normalMatrix),this.setViewInfo(t,r,o.isVr,o.displayIdx),this.setProjection(t,r,o.isVr,o.displayIdx),I.__lastZNear!==s.zNearInner&&(t._gl.uniform1f(t.zNearInner,s.zNearInner),I.__lastZNear=s.zNearInner),I.__lastZFar!==s.zFarInner&&(t._gl.uniform1f(t.zFarInner,s.zFarInner),I.__lastZFar=s.zFarInner),v.F.getWebGLResourceRepository().setUniformValue(t,i.f5.LightViewProjectionMatrix.str,!0,s.viewProjectionMatrix)):(e.setParameter(I.zNearInner,s.zNearInner),e.setParameter(I.zFarInner,s.zFarInner),e.setParameter(i.f5.LightViewProjectionMatrix,s.viewProjectionMatrix));const l=o.entity.tryToGetSkeletal();this.setSkinning(t,o.setUniform,l),this.setLightsInfo(t,o.lightComponents,e,o.setUniform);const c=o.entity.tryToGetBlendShape();this.setMorphInfo(t,o.entity.getMesh(),o.primitive,c),v.F.getWebGLResourceRepository().setUniformValue(t,i.f5.LightViewProjectionMatrix.str,!0,s.viewProjectionMatrix)}set depthCameraComponent(e){this.__depthCameraComponent=e}}I.IsPointLight=new i.wy({str:"isPointLight"}),I.DepthTexture=new i.wy({str:"depthTexture"}),I.SquareDepthTexture=new i.wy({str:"squareDepthTexture"}),I.DepthAdjustment=new i.wy({str:"depthAdjustment"}),I.TextureDepthAdjustment=new i.wy({str:"textureDepthAdjustment"}),I.MinimumVariance=new i.wy({str:"minimumVariance"}),I.LightBleedingParameter=new i.wy({str:"lightBleedingParameter"}),I.ShadowColor=new i.wy({str:"shadowColor"}),I.AllowableDepthError=new i.wy({str:"allowableDepthError"}),I.zNearInner=new i.wy({str:"zNearInner"}),I.zFarInner=new i.wy({str:"zFarInner"}),I.DebugColorFactor=new i.wy({str:"debugColorFactor"}),I.__lastZNear=0,I.__lastZFar=0},5868:(e,t,n)=>{"use strict";n.d(t,{P:()=>v});var i=n(9002),o=n(7987),a=n(3258),r=n(8182),s=n(4536),l=n(2471),c=n(3496),_=n(128),h=n(7683),u=n(1226),d=n(8430),m=n(5324),f=n(2251),p=n(2404);class v extends i.S{constructor(e,t,{isMorphing:n=!1,isSkinning:i=!1,isLighting:a=!1}={},r,s){super(),this.__semantics=[],this.__vertexInputs=[],this.__pixelInputs=[],this.__vertexOutputs=[],this.__pixelOutputs=[],this.__defaultInputValues=new Map,this.__vertexInputConnections=[],this.__pixelInputConnections=[],this.isSingleOperation=!1,this.__definitions="",this.shaderType=m.H.VertexAndPixelShader,this.__shaderFunctionName=t,this.__materialNodeUid=++v.__invalidMaterialNodeCount,v.materialNodes[v.__invalidMaterialNodeCount]=this,this.__isMorphing=n,this.__isSkinning=i,this.__isLighting=a,this.__vertexShaderityObject=r,this.__pixelShaderityObject=s,this.__webglResourceRepository=o.F.getWebGLResourceRepository(),this.__definitions+=`#define RN_MATERIAL_NODE_NAME ${t}\n`}get shaderFunctionName(){return this.__shaderFunctionName}get vertexShaderityObject(){return this.__vertexShaderityObject}get pixelShaderityObject(){return this.__pixelShaderityObject}getDefinitions(e){let t=this.__definitions.concat();return t+="#define RN_IS_ALPHAMODE_"+e.alphaMode.str+"\n",t}static getMaterialNode(e){return v.materialNodes[e]}get materialNodeUid(){return this.__materialNodeUid}get _semanticsInfoArray(){return this.__semantics}get isSkinning(){return this.__isSkinning}get isMorphing(){return this.__isMorphing}get isLighting(){return this.__isLighting}setShaderSemanticsInfoArray(e){const t=[];for(const n of e)t.push(n);this.__semantics=t,v.__semanticsMap.has(this.shaderFunctionName)||v.__semanticsMap.set(this.shaderFunctionName,new Map);const n=v.__semanticsMap.get(this.shaderFunctionName);for(const e of this.__semantics)n.set(e.semantic.str,e)}getShaderSemanticInfoFromName(e){return v.__semanticsMap.get(this.shaderFunctionName).get(e)}addVertexInputConnection(e,t,n){this.__vertexInputConnections.push({materialNodeUid:e.materialNodeUid,outputNameOfPrev:t,inputNameOfThis:n})}addPixelInputConnection(e,t,n){this.__pixelInputConnections.push({materialNodeUid:e.materialNodeUid,outputNameOfPrev:t,inputNameOfThis:n})}get vertexInputConnections(){return this.__vertexInputConnections}get pixelInputConnections(){return this.__pixelInputConnections}getVertexInput(e){for(const t of this.__vertexInputs)if(t.name===e)return t}getVertexInputs(){return this.__vertexInputs}getVertexOutput(e){for(const t of this.__vertexOutputs)if(t.name===e)return t}getVertexOutputs(){return this.__vertexOutputs}getPixelInput(e){for(const t of this.__pixelInputs)if(t.name===e)return t}getPixelInputs(){return this.__pixelInputs}getPixelOutput(e){for(const t of this.__pixelOutputs)if(t.name===e)return t}getPixelOutputs(){return this.__pixelOutputs}setupBasicInfo(e,t,n,i,o){if(e.setUniform){if(this.setWorldMatrix(t,e.worldMatrix),this.setNormalMatrix(t,e.normalMatrix),this.setIsBillboard(t,e.isBillboard),n||e.isVr){let n=e.renderPass.cameraComponent;null==n&&(n=p.C.getComponent(o,o.current)),this.setViewInfo(t,n,e.isVr,e.displayIdx),this.setProjection(t,n,e.isVr,e.displayIdx)}if(n){this.setLightsInfo(t,e.lightComponents,i,e.setUniform);const n=e.entity.tryToGetSkeletal();this.setSkinning(t,e.setUniform,n)}}const a=e.entity.tryToGetBlendShape();this.setMorphInfo(t,e.entity.getMesh(),e.primitive,a)}setWorldMatrix(e,t){e._gl.uniformMatrix4fv(e.worldMatrix,!1,t._v)}setNormalMatrix(e,t){e._gl.uniformMatrix3fv(e.normalMatrix,!1,t._v)}setIsBillboard(e,t){e._gl.uniform1i(e.isBillboard,t?1:0)}setViewInfo(e,t,n,i){let o,a;if(n){const e=f.x.getInstance().getModule("xr").WebXRSystem.getInstance();e.isWebXRMode&&(o=e._getViewMatrixAt(i),a=e._getCameraWorldPositionAt(i))}else t?(a=t.worldPosition,o=t.viewMatrix):(o=c.e.identity(),a=l.P.fromCopyArray([0,0,10]));e._gl.uniformMatrix4fv(e.viewMatrix,!1,o._v),e._gl.uniform3fv(e.viewPosition,a._v)}setProjection(e,t,n,i){let o;if(n){const e=f.x.getInstance().getModule("xr").WebXRSystem.getInstance();e.isWebXRMode&&(o=e._getProjectMatrixAt(i))}else o=t?t.projectionMatrix:c.e.identity();e._gl.uniformMatrix4fv(e.projectionMatrix,!1,o._v)}setSkinning(e,t,n){if(this.__isSkinning)if(n){if(t){if(a.D.boneDataType===u.N.Mat44x1){const t=n.jointMatricesArray;e._gl.uniformMatrix4fv(e.boneMatrix,!1,t)}else if(a.D.boneDataType===u.N.Vec4x2){const t=n.jointTranslatePackedQuat,i=n.jointScalePackedQuat;e._gl.uniform4fv(e.boneTranslatePackedQuat,t),e._gl.uniform4fv(e.boneScalePackedQuat,i)}else if(a.D.boneDataType===u.N.Vec4x2Old){const t=n.jointQuaternionArray,i=n.jointTranslateScaleArray;e._gl.uniform4fv(e.boneQuaternion,t),e._gl.uniform4fv(e.boneTranslateScale,i)}else if(a.D.boneDataType===u.N.Vec4x1){const t=n.jointCompressedChunk,i=n.jointCompressedInfo;e._gl.uniform4fv(e.boneCompressedChunk,t),e._gl.uniform4fv(e.boneCompressedInfo,i._v)}e._gl.uniform1i(e.skinningMode,n.componentSID)}}else t&&e._gl.uniform1i(e.skinningMode,-1)}setLightsInfo(e,t,n,i){if(this.__isLighting&&i){const n=t.filter((e=>e.enable));e._gl.uniform1i(e.lightNumber,n.length);const i=Math.min(n.length,a.D.maxLightNumberInShader);v.__lightPositions.length!==3*i&&(v.__lightPositions=new Float32Array(3*i),v.__lightDirections=new Float32Array(3*i),v.__lightIntensities=new Float32Array(3*i),v.__lightProperties=new Float32Array(4*i));for(let t=0;t=a.D.maxLightNumberInShader)&&null!=e.lightPosition;t++){const e=n[t],i=e.entity.getSceneGraph().worldPosition,o=e.direction,a=e.intensity;v.__lightPositions[3*t+0]=i.x,v.__lightPositions[3*t+1]=i.y,v.__lightPositions[3*t+2]=i.z;const r=1/Math.max(.001,Math.cos(e.innerConeAngle)-Math.cos(e.outerConeAngle)),s=-Math.cos(e.outerConeAngle)*r;v.__lightDirections[3*t+0]=o.x,v.__lightDirections[3*t+1]=o.y,v.__lightDirections[3*t+2]=o.z,v.__lightIntensities[3*t+0]=a.x,v.__lightIntensities[3*t+1]=a.y,v.__lightIntensities[3*t+2]=a.z,v.__lightProperties[4*t+0]=e.enable?e.type.index:-1,v.__lightProperties[4*t+1]=e.range,v.__lightProperties[4*t+2]=r,v.__lightProperties[4*t+3]=s}i>0&&(e._gl.uniform3fv(e.lightPosition,v.__lightPositions),e._gl.uniform3fv(e.lightDirection,v.__lightDirections),e._gl.uniform3fv(e.lightIntensity,v.__lightIntensities),e._gl.uniform4fv(e.lightProperty,v.__lightProperties))}}setMorphInfo(e,t,n,i){if(!this.__isMorphing)return;if(0===n.targets.length)return void e._gl.uniform1i(e.morphTargetNumber,0);e._gl.uniform1i(e.morphTargetNumber,n.targets.length);const o=n.targets.map((e=>{const t=e.get(_.T.Position.XYZ);let n=0;return h.V.isDataTextureApproach(d.l.currentProcessApproach)&&(n=a.D.totalSizeOfGPUShaderDataStorageExceptMorphData),(n+t.byteOffsetInBuffer)/4/4}));let r;e._gl.uniform1iv(e.dataTextureMorphOffsetPosition,o),r=i.weights.length>0?i.weights:new Float32Array(n.targets.length),e._gl.uniform1fv(e.morphWeights,r)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){}setDefaultInputValue(e,t){this.__defaultInputValues.set(e,t)}getDefinition(){return""}}v.__semanticsMap=new Map,v.__invalidMaterialNodeUid=-1,v.__invalidMaterialNodeCount=-1,v.materialNodes=[],v.__tmp_vector4=s.xQ.zero(),v.__tmp_vector2=r.NR.zero(),v.__lightPositions=new Float32Array(0),v.__lightDirections=new Float32Array(0),v.__lightIntensities=new Float32Array(0),v.__lightProperties=new Float32Array(0)},2192:(e,t,n)=>{"use strict";n.d(t,{$R:()=>r,Cb:()=>u,Dx:()=>a,GV:()=>_,Lx:()=>h,NB:()=>c,kT:()=>d,mg:()=>s,pn:()=>l});var i=n(2858),o=n(2575);const a=new o.x,r=new o.x,s=new o.x,l=new i.B,c=new o.x,_=new o.x,h=new o.x;async function u(){a.isTextureReady||(a.tryToSetUniqueName("dummyWhiteTexture",!0),r.tryToSetUniqueName("dummyBlueTexture",!0),s.tryToSetUniqueName("dummyBlackTexture",!0),l.tryToSetUniqueName("dummyBlackCubeTexture",!0),c.tryToSetUniqueName("sheenLutTexture",!0),_.tryToSetUniqueName("dummySRGBGrayTexture",!0),h.tryToSetUniqueName("dummyAnisotropyTexture",!0),a.generate1x1TextureFrom(),r.generate1x1TextureFrom("rgba(127.5, 127.5, 255, 1)"),s.generate1x1TextureFrom("rgba(0, 0, 0, 1)"),l.load1x1Texture("rgba(0, 0, 0, 1)"),await c.generateSheenLutTextureFromDataUri(),_.generate1x1TextureFrom("rgba(186, 186, 186, 1)"),h.generate1x1TextureFrom("rgba(255, 127.5, 255, 1)"))}const d={dummyWhiteTexture:a,dummyBlueTexture:r,dummyBlackTexture:s,dummyBlackCubeTexture:l,sheenLutTexture:c,dummySRGBGrayTexture:_,dummyAnisotropyTexture:h}},7882:(e,t,n)=>{"use strict";n.d(t,{F:()=>b});var i=n(9002),o=n(5704),a=n(4587),r=n(810),s=n(8547),l=n(7987),c=n(5324),_=n(7348),h=n(1813),u=n(4690),d=n(7009),m=n(3258),f=n(1226),p=n(7683),v=n(3449),A=n(8430),y=n(6773);class g{static _createShaderProgramWithCache(e,t,n,i,o,a){const r=t+n;let s=this.__shaderStringMap.get(r);if(s)return s;const c=v.j.toCRC32(r);if(s=this.__shaderHashMap.get(c),s)return s;{const s=l.F.getWebGLResourceRepository().createShaderProgram({material:e,vertexShaderStr:t,fragmentShaderStr:n,attributeNames:i,attributeSemantics:o,onError:a});return this.__shaderStringMap.set(r,s),this.__shaderHashMap.set(c,s),s}}}function x(e){const t=y.Q.getAttributeReflection(e.vertexShaderityObject);return{attributeNames:t.names,attributeSemantics:t.semantics}}function I(e){let t="";const n=l.F.getWebGLResourceRepository().currentWebGLContextWrapper;return n.isWebGL2&&(t+="#version 300 es\n#define GLSL_ES3\n",m.D.isUboEnabled&&(t+="#define RN_IS_UBO_ENABLED\n")),t+=`#define RN_MATERIAL_TYPE_NAME ${e}\n`,p.V.isDataTextureApproach(A.l.currentProcessApproach)?t+="#define RN_IS_DATATEXTURE_MODE\n":t+="#define RN_IS_UNIFORM_MODE\n",n.is_multiview&&(t+="#define WEBGL2_MULTI_VIEW\n"),(n.isWebGL2||n.webgl1ExtDRV)&&(t+="#define RN_IS_SUPPORTING_STANDARD_DERIVATIVES\n"),m.D.boneDataType===f.N.Mat44x1?t+="#define RN_BONE_DATA_TYPE_Mat44x1\n":m.D.boneDataType===f.N.Vec4x2?t+="#define RN_BONE_DATA_TYPE_VEC4X2\n":m.D.boneDataType===f.N.Vec4x2Old?t+="#define RN_BONE_DATA_TYPE_VEC4X2_OLD\n":m.D.boneDataType===f.N.Vec4x1&&(t+="#define RN_BONE_DATA_TYPE_VEC4X1\n"),t}g.__shaderHashMap=new Map,g.__shaderStringMap=new Map;class b extends i.S{constructor(e,t,n,i,a){super(),this._allFieldVariables=new Map,this._autoFieldVariablesOnly=new Map,this._allFieldsInfo=new Map,this.__belongPrimitives=new Map,this._shaderProgramUid=l.F.InvalidCGAPIResourceUid,this.__materialUid=-1,this.__materialSid=-1,this.__alphaMode=o.F.Opaque,this.cullFace=!0,this.cullFrontFaceCCW=!0,this.__alphaToCoverage=!1,this.__blendEquationMode=d.C.EquationFuncAdd,this.__blendEquationModeAlpha=d.C.EquationFuncAdd,this.__blendFuncSrcFactor=d.C.SrcAlpha,this.__blendFuncDstFactor=d.C.OneMinusSrcAlpha,this.__blendFuncAlphaSrcFactor=d.C.One,this.__blendFuncAlphaDstFactor=d.C.One,this._materialContent=a,this.__materialTid=e,this.__materialUid=t,this.__materialSid=n,this.__materialTypeName=i}setParameter(e,t){const n=(0,a.UL)(e),i=this._allFieldsInfo.get(n);if(null!=i){let e;e=i.soloDatum?b._soloDatumFields.get(this.__materialTypeName).get(n):this._allFieldVariables.get(n),s.D._setForce(e.value,t)}}setTextureParameter(e,t,n){if(this._allFieldsInfo.has(e.index)){const i=this._allFieldVariables.get(e.index),r={value:[i.value[0],t,n],info:i.info};this._allFieldVariables.set(e.index,r),i.info.isCustomSetting||this._autoFieldVariablesOnly.set(e.index,r),e!==a.f5.DiffuseColorTexture&&e!==a.f5.BaseColorTexture||t.isTransparent&&(this.alphaMode=o.F.Translucent)}}getTextureParameter(e){if(this._allFieldsInfo.has(e.index))return this._allFieldVariables.get(e.index).value[1]}setTextureParameterAsPromise(e,t){t.then((t=>{if(this._allFieldsInfo.has(e.index)){const n=this._allFieldVariables.get(e.index),i={value:[n.value[0],t],info:n.info};this._allFieldVariables.set(e.index,i),n.info.isCustomSetting||this._autoFieldVariablesOnly.set(e.index,i),e!==a.f5.DiffuseColorTexture&&e!==a.f5.BaseColorTexture||t.isTransparent&&(this.alphaMode=o.F.Translucent)}}))}getParameter(e){var t,n;const i=this._allFieldsInfo.get(e.index);if(null!=i)return i.soloDatum?null===(t=b._soloDatumFields.get(this.__materialTypeName).get(e.index))||void 0===t?void 0:t.value:null===(n=this._allFieldVariables.get(e.index))||void 0===n?void 0:n.value}isShaderProgramReady(){return this._shaderProgramUid!==l.F.InvalidCGAPIResourceUid}_setUniformLocationsOfMaterialNodes(e){const t=l.F.getWebGLResourceRepository();let n=[];if(u.Is.exist(this._materialContent)){const e=this._materialContent._semanticsInfoArray;n=n.concat(e)}t.setupUniformLocations(this._shaderProgramUid,n,e)}_addBelongPrimitive(e){this.__belongPrimitives.set(e.primitiveUid,e)}_createProgram(e,t,n){const{vertexPropertiesStr:i,pixelPropertiesStr:o}=this._getProperties(t,n),a=function(e,t,n,i,o){const a=l.F.getWebGLResourceRepository(),r=e._materialContent,s=r.getDefinitions(e);let c=I(e.__materialTypeName);c+="#define RN_IS_VERTEX_SHADER\n";let _=I(e.__materialTypeName);_+="#define RN_IS_PIXEL_SHADER\n";const h=y.Q.fillTemplate(r.vertexShaderityObject,{getters:t,definitions:s,dataUBODefinition:a.getGlslDataUBODefinitionString(),dataUBOVec4Size:a.getGlslDataUBOVec4SizeString(),matricesGetters:i}),u=y.Q.transformWebGLVersion(h,o).code,d=y.Q.fillTemplate(r.pixelShaderityObject,{renderTargetBegin:a.getGlslRenderTargetBeginString(4),getters:n,definitions:s,dataUBODefinition:a.getGlslDataUBODefinitionString(),dataUBOVec4Size:a.getGlslDataUBOVec4SizeString(),matricesGetters:i,renderTargetEnd:a.getGlslRenderTargetEndString(4)}),m=y.Q.transformWebGLVersion(d,o).code;c+=u.replace(/#version\s+(100|300\s+es)/,""),_+=m.replace(/#version\s+(100|300\s+es)/,"");const{attributeNames:f,attributeSemantics:p}=x(r),v=function(e,t){let n="\n// Vertex Attributes Binding Info\n";for(let i=0;i{const r=this._allFieldsInfo.get(a);r.stage!==c.H.VertexShader&&r.stage!==c.H.VertexAndPixelShader||(n+=e(this.__materialTypeName,r,a,!1,t)),r.stage!==c.H.PixelShader&&r.stage!==c.H.VertexAndPixelShader||(i+=e(this.__materialTypeName,r,a,!1,t))}));const o=_.$.getInstance();return[n,i]=o._addPropertiesStr(n,i,e,t),{vertexPropertiesStr:n,pixelPropertiesStr:i}}__setAutoParametersToGpu(e,t,n){const i=l.F.getWebGLResourceRepository();e.setUniform?this._autoFieldVariablesOnly.forEach((e=>{const o=e.info;t||o.updateInterval!==h.a.FirstTimeOnly?i.setUniformValue(n,o.semantic.str,t,e.value):r.d.isTexture(o.compositionType)&&i.bindTexture(o,e.value)})):this._autoFieldVariablesOnly.forEach((e=>{const o=e.info;r.d.isTexture(o.compositionType)&&(t||o.updateInterval!==h.a.FirstTimeOnly?i.setUniformValue(n,o.semantic.str,t,e.value):i.bindTexture(o,e.value)),o.needUniformInDataTextureMode&&i.setUniformValue(n,o.semantic.str,t,e.value)}))}__setSoloDatumParametersToGpu({shaderProgram:e,firstTime:t,args:n}){const i=l.F.getWebGLResourceRepository(),o=this.__materialTypeName,a=b._soloDatumFields.get(o);null!=a&&a.forEach(((o,a)=>{const s=o.info;(n.setUniform||r.d.isTexture(s.compositionType))&&(s.isCustomSetting||(t||s.updateInterval!==h.a.FirstTimeOnly?i.setUniformValue(e,s.semantic.str,t,o.value):i.bindTexture(s,o.value)))}))}__getTargetShaderSemantics(e){const t=this.fieldsInfoArray.find((t=>(t.none_u_prefix?"":"u_")+t.semantic.str===e));if(null!=t)return t.semantic;console.error(`Material.__getTargetShaderSemantics: uniform ${e} is not found`)}setBlendEquationMode(e,t){this.__blendEquationMode=e,this.__blendEquationModeAlpha=null!=t?t:e}setBlendFuncSeparateFactor(e,t,n,i){this.__blendFuncSrcFactor=e,this.__blendFuncDstFactor=t,this.__blendFuncAlphaSrcFactor=n,this.__blendFuncAlphaDstFactor=i}setBlendFuncFactor(e,t){this.__blendFuncSrcFactor=e,this.__blendFuncDstFactor=t,this.__blendFuncAlphaSrcFactor=e,this.__blendFuncAlphaDstFactor=t}isEmptyMaterial(){return void 0===this._materialContent}isBlend(){return this.alphaMode===o.F.Translucent||this.alphaMode===o.F.Additive}set alphaToCoverage(e){e&&this.alphaMode===o.F.Translucent&&console.warn("If you set alphaToCoverage = true on a material whose AlphaMode is Translucent, you may get drawing problems."),this.__alphaToCoverage=e}get alphaToCoverage(){return this.__alphaToCoverage}get materialTID(){return this.__materialTid}get fieldsInfoArray(){return Array.from(this._allFieldsInfo.values())}get blendEquationMode(){return this.__blendEquationMode}get blendEquationModeAlpha(){return this.__blendEquationModeAlpha}get blendFuncSrcFactor(){return this.__blendFuncSrcFactor}get blendFuncDstFactor(){return this.__blendFuncDstFactor}get blendFuncAlphaSrcFactor(){return this.__blendFuncAlphaSrcFactor}get blendFuncAlphaDstFactor(){return this.__blendFuncAlphaDstFactor}get alphaMode(){return this.__alphaMode}set alphaMode(e){this.__alphaMode=e,this._shaderProgramUid=-1}get materialUID(){return this.__materialUid}get materialSID(){return this.__materialSid}get isSkinning(){return this._materialContent.isSkinning}get isMorphing(){return this._materialContent.isMorphing}get isLighting(){return this._materialContent.isLighting}get materialTypeName(){return this.__materialTypeName}}b._soloDatumFields=new Map},903:(e,t,n)=>{"use strict";n.d(t,{r:()=>u});var i=n(3258),o=n(9286),a=n(752),r=n(3999),s=n(810),l=n(1181),c=n(8547),_=n(4690),h=n(7882);class u{static registerMaterial(e,t,n=i.D.maxMaterialInstanceForEachType){return u.__materialNodes.has(e)?(console.info(`${e} is already registered.`),!1):(u.__registerInner(e,t,n),!0)}static forceRegisterMaterial(e,t,n=i.D.maxMaterialInstanceForEachType){return this.__registerInner(e,t,n),!0}static isRegisteredMaterialType(e){return u.__materialNodes.has(e)}static getMaterialByMaterialUid(e){return this.__materialMap.get(e)}static getAllMaterials(){return Array.from(u.__materialMap.values())}static createMaterial(e,t){let n=t;n||(n=u.__materialNodes.get(e));let i=u.__materialInstanceCountOfType.get(e);const o=new h.F(u.__materialTids.get(e),++u.__materialUidCount,i++,e,n);return this.__initialize(o,i),o}static isFullOrOverOfThisMaterialType(e){const t=u.__materialInstanceCountOfType.get(e);if(_.Is.not.exist(t))return!1;const n=u.__maxInstances.get(e);return!_.Is.not.exist(n)&&t>=n}static __initialize(e,t){e.tryToSetUniqueName(e.__materialTypeName,!0);{u.__materialMap.set(e.materialUID,e);let n=u.__instances.get(e.__materialTypeName);_.Is.not.exist(n)&&(n=new Map,u.__instances.set(e.materialTypeName,n)),n.set(e.materialSID,e),u.__materialInstanceCountOfType.set(e.materialTypeName,t)}if(_.Is.exist(e._materialContent)){const t=e._materialContent._semanticsInfoArray,n=u.__accessors.get(e.materialTypeName);t.forEach((t=>{const i=u._getPropertyIndex(t);if(e._allFieldsInfo.set(i,t),!t.soloDatum){const o=n.get(i).takeOne(),a={info:t,value:c.D.initWithFloat32Array(t.initialValue,t.initialValue,o,t.compositionType)};e._allFieldVariables.set(i,a),t.isCustomSetting||e._autoFieldVariablesOnly.set(i,a)}}))}}static getLocationOffsetOfMemberOfMaterial(e,t){const n=u.__instances.get(e).get(0);return n._allFieldsInfo.get(t).soloDatum?h.F._soloDatumFields.get(n.materialTypeName).get(t).value._v.byteOffset/4/4:this.__accessors.get(e).get(t).byteOffsetInBuffer/4/4}static _getPropertyIndex(e){return e.semantic.index}static __registerInner(e,t,n){const i=++u.__materialTidCount;u.__materialNodes.set(e,t),u.__materialTids.set(e,i),u.__maxInstances.set(e,n),_.Is.exist(t)&&u.__allocateBufferView(e,t),u.__materialInstanceCountOfType.set(e,0)}static __allocateBufferView(e,t){let n=0;const i=[];for(const o of t._semanticsInfoArray){const t=(0,l.K)(o);let a=1;o.soloDatum||(a=u.__maxInstances.get(e)),n+=t*a,i.push({alignedByte:t,semanticInfo:o})}this.__accessors.has(e)||this.__accessors.set(e,new Map);const _=o.B.getInstance().createOrGetBuffer(a.$.GPUInstanceData);let d;this.__bufferViews.has(e)?d=this.__bufferViews.get(e):(d=_.takeBufferView({byteLengthToNeed:n,byteStride:0}).unwrapForce(),this.__bufferViews.set(e,d));for(let t=0;t{"use strict";n.d(t,{Q:()=>I});var i=n(3034),o=n.n(i),a=n(3999),r=n(810),s=n(128),l=n(9286),c=n(4710),_=n(3258),h=n(4587),u=n(1813),d=n(8182),m=n(9190),f=n(4536),p=n(2566),v=n(3496),A=n(4267),y=n(7035),g=n(5324),x=n(2192);class I{static fillTemplate(e,t){const n=Object.assign(t,{WellKnownComponentTIDs:c.z,widthOfDataTexture:`const int widthOfDataTexture = ${l.B.bufferWidthLength};`,heightOfDataTexture:`const int heightOfDataTexture = ${l.B.bufferHeightLength};`,Config:_.D});return o().fillTemplate(e,n)}static transformWebGLVersion(e,t){return t?o().transformToGLSLES3(e):o().transformToGLSLES1(e,!0)}static getAttributeReflection(e){const t=o().createReflectionObject(e);return this.__setDefaultAttributeSemanticMap(t),t.reflect(),{names:t.attributesNames,semantics:t.attributesSemantics.map((e=>s.T.fromString(e))),compositions:t.attributesTypes.map((e=>r.d.fromGlslString(e))),components:t.attributesTypes.map((e=>a.r.fromGlslString(e)))}}static __setDefaultAttributeSemanticMap(e){const t=new Map;t.set("instanceinfo","INSTANCE"),t.set("barycentriccoord","BARY_CENTRIC_COORD"),e.addAttributeSemanticsMap(t)}static getShaderDataReflection(e,t){const n=this.__copyShaderityObject(e),i=e.code.split(/\r\n|\n/),o=[],a=[];for(const n of i){const i=/^(?![/])[\t ]*uniform[\t ]+(\w+)[\t ]+(\w+);[\t ]*(\/\/)*[\t ]*(.*)/,r=n.match(i);if(r){const i=r[1],s=r[2],l=r[4];if(this.__ignoreThisUniformDeclaration(l)){o.push(n);continue}const c=this.__createShaderSemanticsInfo(i,s,l,e.isFragmentShader,t);a.push(c)}else o.push(n)}return n.code=o.join("\n"),{shaderSemanticsInfoArray:a,shaderityObject:n}}static __copyShaderityObject(e){return{code:e.code,shaderStage:e.shaderStage,isFragmentShader:"fragment"===e.shaderStage}}static __ignoreThisUniformDeclaration(e){const t=e.match(/skipProcess[\t ]*=[\t ]*(\w+)[,\t ]*/);return"true"===(null==t?void 0:t[1])}static __createShaderSemanticsInfo(e,t,n,i,o){const s=a.r.fromGlslString(e),l=r.d.fromGlslString(e),c=i?g.H.PixelShader:g.H.VertexShader;let _=!0;const u=t.match(/u_(\w+)/);u&&(t=u[1],_=!1);let d=h.f5.fromStringCaseSensitively(t);if(null==d){const e=null==o?void 0:o.get(t);d=null!=e?e.semantic:new h.wy({str:t})}const m={semantic:d,compositionType:l,componentType:s,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!1,stage:c,none_u_prefix:_};return this.__setRhodoniteOriginalParametersTo(m,n),m}static __setRhodoniteOriginalParametersTo(e,t){var n;const i=t.match(/soloDatum[\t ]*=[\t ]*(\w+)[,\t ]*/);let o=!1;"true"===(null==i?void 0:i[1])&&(o=!0),e.soloDatum=o;const a=t.match(/isCustomSetting[\t ]*=[\t ]*(\w+)[,\t ]*/);let r=!1;"true"===(null==a?void 0:a[1])&&(r=!0),e.isCustomSetting=r;const s=t.match(/updateInterval[\t ]*=[\t ]*(\w+)[,\t ]*/);let l=u.a.FirstTimeOnly;"everytime"===(null===(n=null==s?void 0:s[1])||void 0===n?void 0:n.toLowerCase())&&(l=u.a.EveryTime),e.updateInterval=l;const c=t.match(/initialValue[\t ]*=[\t ]*(.+)[,\t ]*/);if(c){const t=c[1];e.initialValue=this.__getInitialValueFromText(e,t)}else e.initialValue=this.__getDefaultInitialValue(e);const _=t.match(/needUniformInDataTextureMode[\t ]*=[\t ]*(.+)[,\t ]*/);if(_){let t=!1;"true"===(null==_?void 0:_[1])&&(t=!0),e.needUniformInDataTextureMode=t}}static __getInitialValueFromText(e,t){const n=t.match(/\(([\d\w., ]+)\)/),i=t=>{e.compositionType!==t&&console.error("component number of initialValue is invalid:"+e.semantic.str)};let o;if(n){const t=n[1].split(",");switch(t.length){case 1:i(r.d.Scalar),o="true"===t[0]?new A.DU(new Float32Array([1])):"false"===t[0]?new A.DU(new Float32Array([0])):new A.DU(new Float32Array([parseFloat(t[0])]));break;case 2:if(e.compositionType===r.d.Texture2D||e.compositionType===r.d.Texture2DShadow){const e=t[1].charAt(0).toUpperCase()+t[1].slice(1);o=[parseInt(t[0]),x.kT[`dummy${e}Texture`]]}else if(e.compositionType===r.d.TextureCube){const e=t[1].charAt(0).toUpperCase()+t[1].slice(1);o=[parseInt(t[0]),x.kT[`dummy${e}CubeTexture`]]}else i(r.d.Vec2),o=d.NR.fromCopyArray([parseFloat(t[0]),parseFloat(t[1])]);break;case 3:i(r.d.Vec3),o=m.d6.fromCopyArray([parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]);break;case 4:i(r.d.Vec4),o=f.xQ.fromCopyArray([parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])]);break;case 9:i(r.d.Mat3),o=p.x.fromCopy9RowMajor(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]),parseFloat(t[7]),parseFloat(t[8]));break;case 16:i(r.d.Mat4),o=v.e.fromCopy16RowMajor(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]),parseFloat(t[7]),parseFloat(t[8]),parseFloat(t[9]),parseFloat(t[10]),parseFloat(t[11]),parseFloat(t[12]),parseFloat(t[13]),parseFloat(t[14]),parseFloat(t[15]));break;default:console.error("Invalid format")}}else i(r.d.Scalar),o="true"===t?new A.DU(new Float32Array([1])):"false"===t?new A.DU(new Float32Array([0])):new A.DU(new Float32Array([parseFloat(t)]));return o}static __getDefaultInitialValue(e){return e.compositionType===r.d.Scalar?new A.DU(new Float32Array([0])):e.compositionType===r.d.Vec2?d.NR.zero():e.compositionType===r.d.Vec3?m.d6.zero():e.compositionType===r.d.Vec4?f.xQ.zero():e.compositionType===r.d.Mat2?y.f.identity():e.compositionType===r.d.Mat3?p.x.identity():e.compositionType===r.d.Mat4?v.e.identity():e.compositionType===r.d.Texture2D||e.compositionType===r.d.Texture2DShadow?[0,x.Dx]:e.compositionType===r.d.TextureCube?[0,x.mg]:void console.warn("initial value is not found")}}},2477:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});var i=n(2471),o=n(9190),a=n(3032);class r{constructor(){this.__min=o.d6.fromCopyArray([Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE]),this.__max=o.d6.fromCopyArray([-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]),this.__centerPoint=o.d6.zero(),this.__lengthCenterToCorner=0,this.__isCenterPointDirty=!1,this.__isLengthCenterToCornerDirty=!1,this.__isVanilla=!0}clone(){const e=new r;return e.__max=this.__max.clone(),e.__min=this.__min.clone(),e.__centerPoint=this.__centerPoint.clone(),e.__lengthCenterToCorner=this.__lengthCenterToCorner,e.__isCenterPointDirty=this.__isCenterPointDirty,e.__isLengthCenterToCornerDirty=this.__isLengthCenterToCornerDirty,e}copyComponents(e){return this.__max.copyComponents(e.__max),this.__min.copyComponents(e.__min),this.__centerPoint.copyComponents(e.__centerPoint),this.__lengthCenterToCorner=e.__lengthCenterToCorner,this.__isCenterPointDirty=e.__isCenterPointDirty,this.__isLengthCenterToCornerDirty=e.__isLengthCenterToCornerDirty,this.__isVanilla=!1,this}initialize(){this.__min.setComponents(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.__max.setComponents(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),this.__centerPoint.zero(),this.__lengthCenterToCorner=0,this.__isCenterPointDirty=!1,this.__isLengthCenterToCornerDirty=!1,this.__isVanilla=!0}set minPoint(e){this.__min.copyComponents(e),this.__isCenterPointDirty=!0,this.__isLengthCenterToCornerDirty=!0,this.__isVanilla=!1}get minPoint(){return this.__min}set maxPoint(e){this.__max.copyComponents(e),this.__isCenterPointDirty=!0,this.__isLengthCenterToCornerDirty=!0,this.__isVanilla=!1}get maxPoint(){return this.__max}isVanilla(){return this.__isVanilla}addPosition(e){return this.__min.x=e.x{"use strict";n.d(t,{X:()=>i});class i{constructor(){this._v=new Float32Array}at(e,t){throw new Error("Method not implemented.")}toString(){throw new Error("Method not implemented.")}toStringApproximately(){throw new Error("Method not implemented.")}flattenAsArray(){throw new Error("Method not implemented.")}isDummy(){return 0===this._v.length}v(e){return this._v[e]}determinant(){throw new Error("Method not implemented.")}get className(){return this.constructor.name}get isIdentityMatrixClass(){return!1}isTheSourceSame(e){return this._v.buffer===e}}},3632:(e,t,n)=>{"use strict";n.d(t,{l:()=>i});class i{constructor(){this._v=new Float32Array}get className(){return this.constructor.name}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return this._v[3]}at(e){return this._v[e]}length(){return Math.hypot(this._v[0],this._v[1],this._v[2],this._v[3])}lengthSquared(){return this._v[0]**2+this._v[1]**2+this._v[2]**2+this._v[3]**2}toString(){throw new Error("Method not implemented.")}toStringApproximately(){throw new Error("Method not implemented.")}flattenAsArray(){throw new Error("Method not implemented.")}isDummy(){throw new Error("Method not implemented.")}isEqual(e,t){throw new Error("Method not implemented.")}isStrictEqual(e){throw new Error("Method not implemented.")}toEulerAnglesTo(e){throw new Error("Method not implemented.")}transformVector3(e){throw new Error("Method not implemented.")}transformVector3Inverse(e){throw new Error("Method not implemented.")}dot(e){return this._v[0]*e._v[0]+this._v[1]*e._v[1]+this._v[2]*e._v[2]+this._v[3]*e._v[3]}clone(){throw new Error("Method not implemented.")}}},3343:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});class i{constructor(){this._v=new Float32Array}get glslStrAsFloat(){throw new Error("Method not implemented.")}get glslStrAsInt(){throw new Error("Method not implemented.")}isEqual(e,t){throw new Error("Method not implemented.")}isStrictEqual(e){throw new Error("Method not implemented.")}length(){throw new Error("Method not implemented.")}lengthSquared(){throw new Error("Method not implemented.")}lengthTo(e){throw new Error("Method not implemented.")}dot(e){throw new Error("Method not implemented.")}at(e){return this._v[e]}toString(){throw new Error("Method not implemented.")}toStringApproximately(){throw new Error("Method not implemented.")}flattenAsArray(){throw new Error("Method not implemented.")}isDummy(){return 0===this._v.length}v(e){return this._v[e]}isTheSourceSame(e){return this._v.buffer===e}get className(){return this.constructor.name}get bytesPerComponent(){throw new Error("Method not implemented.")}}},1162:(e,t,n)=>{"use strict";n.d(t,{s:()=>o});var i=n(2471);class o extends i.P{constructor(e){super(e)}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return 1}get r(){return this._v[0]}get g(){return this._v[1]}get b(){return this._v[2]}get a(){return 1}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}static cross(e,t){return super._cross(e,t,Float32Array)}clone(){return super.clone()}}},346:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var i=n(810),o=n(8775),a=n(2471);class r extends o.X{constructor(){super(),this._v=r.__v}toString(){return"1 0 0\n0 1 0\n0 0 1\n"}toStringApproximately(){return this.toString()}flattenAsArray(){return[1,0,0,0,1,0,0,0,1]}isDummy(){return!1}isEqual(e,t=Number.EPSILON){return Math.abs(e.m00-1){"use strict";n.d(t,{a:()=>r});var i=n(810),o=n(8775),a=n(2471);class r extends o.X{constructor(){super(),this._v=r.__v}toString(){return"1 0 0 0\n0 1 0 0\n0 0 1 0\n0 0 0 1\n"}toStringApproximately(){return this.toString()}flattenAsArray(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}isDummy(){return!1}isEqual(e,t=Number.EPSILON){return Math.abs(e.m00-1){"use strict";n.d(t,{D:()=>y});var i=n(2390),o=n(2471),a=n(7192),r=n(9207),s=n(1937),l=n(5467),c=n(810),_=n(3496),h=n(2566),u=n(4536),d=n(9190),m=n(8182),f=n(3616),p=n(963),v=n(4267),A=n(4255);class y{constructor(){}static arrayToVector(e){return Array.isArray(e)?void 0!==e[3]?a.Lt.fromCopyArray([e[0],e[1],e[2],e[3]]):void 0!==e[2]?o.P.fromCopyArray([e[0],e[1],e[2]]):i.FM.fromCopyArray2([e[0],e[1]]):e}static arrayToVectorOrMatrix(e){return Array.isArray(e)?void 0!==e[15]?l.J.fromCopyArrayRowMajor(e):void 0!==e[8]?s.h.fromCopyArrayRowMajor(e):void 0!==e[3]?a.Lt.fromCopyArray([e[0],e[1],e[2],e[3]]):void 0!==e[2]?o.P.fromCopyArray([e[0],e[1],e[2]]):i.FM.fromCopyArray2([e[0],e[1]]):e}static getImmutableValueClass(e){return e===c.d.Vec2?i.FM:e===c.d.Vec3?o.P:e===c.d.Vec4?a.Lt:e===c.d.Mat3?s.h:e===c.d.Mat4?l.J:void 0}static getMutableValueClass(e){return e===c.d.Vec2?m.NR:e===c.d.Vec3?d.d6:e===c.d.Vec4?u.xQ:e===c.d.Mat3?h.x:e===c.d.Mat4?_.e:void 0}static cloneOfMathObjects(e){return e instanceof l.J||e instanceof s.h||e instanceof a.Lt||e instanceof o.P||e instanceof i.FM?e.clone():e}static isAcceptableArrayForQuaternion(e){return!(!Array.isArray(e)||void 0===e[3])}static arrayToQuaternion(e){return r._.fromCopy4(e[0],e[1],e[2],e[3])}static makeSubArray(e,t){return 4===t?[e[0],e[1],e[2],e[3]]:3===t?[e[0],e[1],e[2]]:2===t?[e[0],e[1]]:e[0]}static vectorToArray(e){return e instanceof i.FM?[e.x,e.y]:e instanceof o.P?[e.x,e.y,e.z]:e instanceof a.Lt||e instanceof r._?[e.x,e.y,e.z,e.w]:e}static componentNumberOfVector(e){return e instanceof i.FM?2:e instanceof o.P?3:e instanceof a.Lt||e instanceof r._?4:Array.isArray(e)?e.length:0}static packNormalizedVec4ToVec2(e,t,n,i,o){let a=0,r=0;return e=(e+1)/2,t=(t+1)/2,n=(n+1)/2,i=(i+1)/2,a=(Math.floor(e*(o-1))*o+Math.floor(t*(o-1)))/o,r=(Math.floor(n*(o-1))*o+Math.floor(i*(o-1)))/o,[a,r]}static unProjectTo(e,t,n,i,o,a){const r=this.__tmpVector4_0.setComponents((e-o.x)/o.z*2-1,(t-o.y)/o.w*2-1,2*n-1,1),s=i.multiplyVectorTo(r,this.__tmpVector4_1);return 0===s.w&&console.error("0 division occurred!"),d.d6.multiplyTo(s,1/s.w,a)}static add(e,t){if(isFinite(e))return e+t;if(e instanceof i.FM)return i.FM.add(e,t);if(e instanceof o.P)return o.P.add(e,t);if(e instanceof a.Lt)return a.Lt.add(e,t);if(e instanceof r._)return r._.add(e,t);if(Array.isArray(e)){const n=[];for(let i=0;i{"use strict";function i(e){return 0==(e&e-1)}n.d(t,{k:()=>o});const o=Object.freeze({radianToDegree:function(e){return 180*e/Math.PI},degreeToRadian:function(e){return e*Math.PI/180},toHalfFloat:()=>function(e){const t=new Float32Array(1),n=new Int32Array(t.buffer);t[0]=e;const i=n[0];let o=i>>16&32768,a=i>>12&2047;const r=i>>23&255;return r<103?o:r>142?(o|=31744,o|=(255==r?0:1)&&8388607&i,o):r<113?(a|=2048,o|=(a>>114-r)+(a>>113-r&1),o):(o|=r-112<<10|a>>1,o+=1&a,o)},isPowerOfTwo:i,isPowerOfTwoTexture:function(e,t){return i(e)&&i(t)},packNormalizedVec4ToVec2:function(e,t,n,i,o){return e=(e+1)/2,t=(t+1)/2,n=(n+1)/2,i=(i+1)/2,[(Math.floor(e*(o-1))*o+Math.floor(t*(o-1)))/o,(Math.floor(n*(o-1))*o+Math.floor(i*(o-1)))/o]},convertToStringAsGLSLFloat:function(e){return Number.isInteger(e)?`${e}.0`:""+e},nearZeroToZero:function(e){return Math.abs(e)<1e-5?e=0:.999994&&Math.abs(n.at(o))+l==Math.abs(n.at(o))&&Math.abs(n.at(d))+l==Math.abs(n.at(d)))e.setAt(o,d,0);else if(Math.abs(e.at(o,d))>u){c=n.at(d)-n.at(o),Math.abs(c)+l==Math.abs(c)?s=e.at(o,d)/c:(h=.5*c/e.at(o,d),s=h<0?-1/(Math.sqrt(1+h*h)-h):1/(Math.sqrt(1+h*h)+h)),r=1/Math.sqrt(1+s*s),a=s*r,_=s*e.at(o,d),e.setAt(o,d,0),n.setAt(o,n.at(o)-_),n.setAt(d,n.at(d)+_);for(let t=0;t=0?" "+t:t},lerp:function(e,t,n){return e*(1-n)+t*n}})},18:(e,t,n)=>{"use strict";n.d(t,{a:()=>s});var i=n(810),o=n(2390),a=n(3032),r=n(8775);class s extends r.X{constructor(e){super(),this._v=e}get m00(){return this._v[0]}get m10(){return this._v[1]}get m01(){return this._v[2]}get m11(){return this._v[3]}get className(){return"Matrix22"}static get compositionType(){return i.d.Mat2}static zero(){return s.fromCopy4RowMajor(0,0,0,0)}static identity(){return s.fromCopy4RowMajor(1,0,0,1)}static dummy(){return new this(new Float32Array(0))}static transpose(e){return s.fromCopy4RowMajor(e._v[0],e._v[1],e._v[2],e._v[3])}static invert(e){const t=e.determinant();0===t&&console.error("the determinant is 0!");const n=e._v[3]/t,i=e._v[2]/t*-1,o=e._v[1]/t*-1,a=e._v[0]/t;return s.fromCopy4RowMajor(n,i,o,a)}static invertTo(e,t){const n=e.determinant();0===n&&console.error("the determinant is 0!");const i=e._v[3]/n,o=e._v[2]/n*-1,a=e._v[1]/n*-1,r=e._v[0]/n;return t.setComponents(i,o,a,r)}static rotate(e){const t=Math.cos(e),n=Math.sin(e);return s.fromCopy4RowMajor(t,-n,n,t)}static scale(e){return s.fromCopy4RowMajor(e._v[0],0,0,e._v[1])}static multiply(e,t){const n=e._v[0]*t._v[0]+e._v[2]*t._v[1],i=e._v[1]*t._v[0]+e._v[3]*t._v[1],o=e._v[0]*t._v[2]+e._v[2]*t._v[3],a=e._v[1]*t._v[2]+e._v[3]*t._v[3];return s.fromCopy4RowMajor(n,o,i,a)}static multiplyTo(e,t,n){const i=e._v[0]*t._v[0]+e._v[2]*t._v[1],o=e._v[1]*t._v[0]+e._v[3]*t._v[1],a=e._v[0]*t._v[2]+e._v[2]*t._v[3],r=e._v[1]*t._v[2]+e._v[3]*t._v[3];return n.setComponents(i,a,o,r)}toString(){return this._v[0]+" "+this._v[2]+"\n"+this._v[1]+" "+this._v[3]+" \n"}toStringApproximately(){return a.k.financial(this._v[0])+" "+a.k.financial(this._v[2])+"\n"+a.k.financial(this._v[1])+" "+a.k.financial(this._v[3])+" \n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){"use strict";n.d(t,{h:()=>l});var i=n(2471),o=n(810),a=n(3032),r=n(8775),s=n(346);class l extends r.X{constructor(e){super(),this._v=e}get m00(){return this._v[0]}get m10(){return this._v[1]}get m20(){return this._v[2]}get m01(){return this._v[3]}get m11(){return this._v[4]}get m21(){return this._v[5]}get m02(){return this._v[6]}get m12(){return this._v[7]}get m22(){return this._v[8]}get className(){return"Matrix33"}static get compositionType(){return o.d.Mat3}static zero(){return l.fromCopy9RowMajor(0,0,0,0,0,0,0,0,0)}static identity(){return new s.c}static dummy(){return new this(new Float32Array(0))}static transpose(e){return e.isIdentityMatrixClass?e:l.fromCopy9RowMajor(e._v[0],e._v[1],e._v[2],e._v[3],e._v[4],e._v[5],e._v[6],e._v[7],e._v[8])}static invert(e){if(e.isIdentityMatrixClass)return e;const t=e.determinant();0===t&&console.error("the determinant is 0!");const n=(e._v[4]*e._v[8]-e._v[7]*e._v[5])/t,i=(e._v[6]*e._v[5]-e._v[3]*e._v[8])/t,o=(e._v[3]*e._v[7]-e._v[6]*e._v[4])/t,a=(e._v[7]*e._v[2]-e._v[1]*e._v[8])/t,r=(e._v[0]*e._v[8]-e._v[6]*e._v[2])/t,s=(e._v[6]*e._v[1]-e._v[0]*e._v[7])/t,c=(e._v[1]*e._v[5]-e._v[4]*e._v[2])/t,_=(e._v[3]*e._v[2]-e._v[0]*e._v[5])/t,h=(e._v[0]*e._v[4]-e._v[3]*e._v[1])/t;return l.fromCopy9RowMajor(n,i,o,a,r,s,c,_,h)}static invertTo(e,t){if(e.isIdentityMatrixClass)return t.copyComponents(e);const n=e.determinant();0===n&&console.error("the determinant is 0!");const i=(e._v[4]*e._v[8]-e._v[7]*e._v[5])/n,o=(e._v[6]*e._v[5]-e._v[3]*e._v[8])/n,a=(e._v[3]*e._v[7]-e._v[6]*e._v[4])/n,r=(e._v[7]*e._v[2]-e._v[1]*e._v[8])/n,s=(e._v[0]*e._v[8]-e._v[6]*e._v[2])/n,l=(e._v[6]*e._v[1]-e._v[0]*e._v[7])/n,c=(e._v[1]*e._v[5]-e._v[4]*e._v[2])/n,_=(e._v[3]*e._v[2]-e._v[0]*e._v[5])/n,h=(e._v[0]*e._v[4]-e._v[3]*e._v[1])/n;return t.setComponents(i,o,a,r,s,l,c,_,h)}static rotateX(e){const t=Math.cos(e),n=Math.sin(e);return l.fromCopy9RowMajor(1,0,0,0,t,-n,0,n,t)}static rotateY(e){const t=Math.cos(e),n=Math.sin(e);return l.fromCopy9RowMajor(t,0,n,0,1,0,-n,0,t)}static rotateZ(e){const t=Math.cos(e),n=Math.sin(e);return l.fromCopy9RowMajor(t,-n,0,n,t,0,0,0,1)}static rotateXYZ(e,t,n){const i=Math.cos(e),o=Math.sin(e),a=Math.cos(t),r=Math.sin(t),s=Math.cos(n),c=Math.sin(n),_=-o,h=-c,u=r*o,d=r*i,m=s*a,f=s*u+h*i,p=s*d+h*_,v=c*a,A=c*u+s*i,y=c*d+s*_,g=-r,x=a*o,I=a*i;return l.fromCopy9RowMajor(m,f,p,v,A,y,g,x,I)}static rotate(e){return this.rotateXYZ(e._v[0],e._v[1],e._v[2])}static scale(e){return l.fromCopy9RowMajor(e._v[0],0,0,0,e._v[1],0,0,0,e._v[2])}static multiply(e,t){if(e.isIdentityMatrixClass)return t;if(t.isIdentityMatrixClass)return e;const n=e._v[0]*t._v[0]+e._v[3]*t._v[1]+e._v[6]*t._v[2],i=e._v[1]*t._v[0]+e._v[4]*t._v[1]+e._v[7]*t._v[2],o=e._v[2]*t._v[0]+e._v[5]*t._v[1]+e._v[8]*t._v[2],a=e._v[0]*t._v[3]+e._v[3]*t._v[4]+e._v[6]*t._v[5],r=e._v[1]*t._v[3]+e._v[4]*t._v[4]+e._v[7]*t._v[5],s=e._v[2]*t._v[3]+e._v[5]*t._v[4]+e._v[8]*t._v[5],c=e._v[0]*t._v[6]+e._v[3]*t._v[7]+e._v[6]*t._v[8],_=e._v[1]*t._v[6]+e._v[4]*t._v[7]+e._v[7]*t._v[8],h=e._v[2]*t._v[6]+e._v[5]*t._v[7]+e._v[8]*t._v[8];return l.fromCopy9RowMajor(n,a,c,i,r,_,o,s,h)}static multiplyTo(e,t,n){if(e.isIdentityMatrixClass)return n.copyComponents(t);if(t.isIdentityMatrixClass)return n.copyComponents(e);const i=e._v[0]*t._v[0]+e._v[3]*t._v[1]+e._v[6]*t._v[2],o=e._v[1]*t._v[0]+e._v[4]*t._v[1]+e._v[7]*t._v[2],a=e._v[2]*t._v[0]+e._v[5]*t._v[1]+e._v[8]*t._v[2],r=e._v[0]*t._v[3]+e._v[3]*t._v[4]+e._v[6]*t._v[5],s=e._v[1]*t._v[3]+e._v[4]*t._v[4]+e._v[7]*t._v[5],l=e._v[2]*t._v[3]+e._v[5]*t._v[4]+e._v[8]*t._v[5],c=e._v[0]*t._v[6]+e._v[3]*t._v[7]+e._v[6]*t._v[8],_=e._v[1]*t._v[6]+e._v[4]*t._v[7]+e._v[7]*t._v[8],h=e._v[2]*t._v[6]+e._v[5]*t._v[7]+e._v[8]*t._v[8];return n.setComponents(i,r,c,o,s,_,a,l,h)}toString(){return this._v[0]+" "+this._v[3]+" "+this._v[6]+"\n"+this._v[1]+" "+this._v[4]+" "+this._v[7]+"\n"+this._v[2]+" "+this._v[5]+" "+this._v[8]+"\n"}toStringApproximately(){return a.k.financial(this._v[0])+" "+a.k.financial(this._v[3])+" "+a.k.financial(this._v[6])+"\n"+a.k.financial(this._v[1])+" "+a.k.financial(this._v[4])+" "+a.k.financial(this._v[7])+" \n"+a.k.financial(this._v[2])+" "+a.k.financial(this._v[5])+" "+a.k.financial(this._v[8])+"\n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3],this._v[4],this._v[5],this._v[6],this._v[7],this._v[8]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){"use strict";n.d(t,{J:()=>_});var i=n(2471),o=n(7192),a=n(810),r=n(3032),s=n(2086),l=n(8775),c=n(3991);Float32Array;class _ extends l.X{constructor(e){super(),this._v=e}get m00(){return this._v[0]}get m10(){return this._v[1]}get m20(){return this._v[2]}get m30(){return this._v[3]}get m01(){return this._v[4]}get m11(){return this._v[5]}get m21(){return this._v[6]}get m31(){return this._v[7]}get m02(){return this._v[8]}get m12(){return this._v[9]}get m22(){return this._v[10]}get m32(){return this._v[11]}get m03(){return this._v[12]}get m13(){return this._v[13]}get m23(){return this._v[14]}get m33(){return this._v[15]}get translateX(){return this._v[12]}get translateY(){return this._v[13]}get translateZ(){return this._v[14]}static get compositionType(){return a.d.Mat4}static zero(){return _.fromCopy16RowMajor(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}static identity(){return new s.a}static dummy(){return new this(new Float32Array(0))}static transpose(e){return e.isIdentityMatrixClass?e:_.fromCopyFloat32ArrayRowMajor(e._v)}static invert(e){if(e.isIdentityMatrixClass)return e;const t=e._v[0]*e._v[5]-e._v[4]*e._v[1],n=e._v[0]*e._v[9]-e._v[8]*e._v[1],i=e._v[0]*e._v[13]-e._v[12]*e._v[1],o=e._v[4]*e._v[9]-e._v[8]*e._v[5],a=e._v[4]*e._v[13]-e._v[12]*e._v[5],r=e._v[8]*e._v[13]-e._v[12]*e._v[9],s=e._v[2]*e._v[7]-e._v[6]*e._v[3],l=e._v[2]*e._v[11]-e._v[10]*e._v[3],c=e._v[2]*e._v[15]-e._v[14]*e._v[3],h=e._v[6]*e._v[11]-e._v[10]*e._v[7],u=e._v[6]*e._v[15]-e._v[14]*e._v[7],d=e._v[10]*e._v[15]-e._v[14]*e._v[11],m=t*d-n*u+i*h+o*c-a*l+r*s;0===m&&console.error("the determinant is 0!");const f=(e._v[5]*d-e._v[9]*u+e._v[13]*h)/m,p=(e._v[8]*u-e._v[4]*d-e._v[12]*h)/m,v=(e._v[7]*r-e._v[11]*a+e._v[15]*o)/m,A=(e._v[10]*a-e._v[6]*r-e._v[14]*o)/m,y=(e._v[9]*c-e._v[1]*d-e._v[13]*l)/m,g=(e._v[0]*d-e._v[8]*c+e._v[12]*l)/m,x=(e._v[11]*i-e._v[3]*r-e._v[15]*n)/m,I=(e._v[2]*r-e._v[10]*i+e._v[14]*n)/m,b=(e._v[1]*u-e._v[5]*c+e._v[13]*s)/m,E=(e._v[4]*c-e._v[0]*u-e._v[12]*s)/m,T=(e._v[3]*a-e._v[7]*i+e._v[15]*t)/m,S=(e._v[6]*i-e._v[2]*a-e._v[14]*t)/m,C=(e._v[5]*l-e._v[1]*h-e._v[9]*s)/m,w=(e._v[0]*h-e._v[4]*l+e._v[8]*s)/m,R=(e._v[7]*n-e._v[3]*o-e._v[11]*t)/m,P=(e._v[2]*o-e._v[6]*n+e._v[10]*t)/m;return _.fromCopy16RowMajor(f,p,v,A,y,g,x,I,b,E,T,S,C,w,R,P)}static invertTo(e,t){if(e.isIdentityMatrixClass)return t.copyComponents(e);const n=e._v[0]*e._v[5]-e._v[4]*e._v[1],i=e._v[0]*e._v[9]-e._v[8]*e._v[1],o=e._v[0]*e._v[13]-e._v[12]*e._v[1],a=e._v[4]*e._v[9]-e._v[8]*e._v[5],r=e._v[4]*e._v[13]-e._v[12]*e._v[5],s=e._v[8]*e._v[13]-e._v[12]*e._v[9],l=e._v[2]*e._v[7]-e._v[6]*e._v[3],c=e._v[2]*e._v[11]-e._v[10]*e._v[3],_=e._v[2]*e._v[15]-e._v[14]*e._v[3],h=e._v[6]*e._v[11]-e._v[10]*e._v[7],u=e._v[6]*e._v[15]-e._v[14]*e._v[7],d=e._v[10]*e._v[15]-e._v[14]*e._v[11],m=n*d-i*u+o*h+a*_-r*c+s*l;0===m&&console.error("the determinant is 0!");const f=(e._v[5]*d-e._v[9]*u+e._v[13]*h)/m,p=(e._v[8]*u-e._v[4]*d-e._v[12]*h)/m,v=(e._v[7]*s-e._v[11]*r+e._v[15]*a)/m,A=(e._v[10]*r-e._v[6]*s-e._v[14]*a)/m,y=(e._v[9]*_-e._v[1]*d-e._v[13]*c)/m,g=(e._v[0]*d-e._v[8]*_+e._v[12]*c)/m,x=(e._v[11]*o-e._v[3]*s-e._v[15]*i)/m,I=(e._v[2]*s-e._v[10]*o+e._v[14]*i)/m,b=(e._v[1]*u-e._v[5]*_+e._v[13]*l)/m,E=(e._v[4]*_-e._v[0]*u-e._v[12]*l)/m,T=(e._v[3]*r-e._v[7]*o+e._v[15]*n)/m,S=(e._v[6]*o-e._v[2]*r-e._v[14]*n)/m,C=(e._v[5]*c-e._v[1]*h-e._v[9]*l)/m,w=(e._v[0]*h-e._v[4]*c+e._v[8]*l)/m,R=(e._v[7]*i-e._v[3]*a-e._v[11]*n)/m,P=(e._v[2]*a-e._v[6]*i+e._v[10]*n)/m;return t.setComponents(f,p,v,A,y,g,x,I,b,E,T,S,C,w,R,P)}static translate(e){return _.fromCopy16RowMajor(1,0,0,e._v[0],0,1,0,e._v[1],0,0,1,e._v[2],0,0,0,1)}static rotateX(e){const t=Math.cos(e),n=Math.sin(e);return _.fromCopy16RowMajor(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1)}static rotateY(e){const t=Math.cos(e),n=Math.sin(e);return _.fromCopy16RowMajor(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1)}static rotateZ(e){const t=Math.cos(e),n=Math.sin(e);return _.fromCopy16RowMajor(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1)}static rotateXYZ(e,t,n){const i=Math.cos(e),o=Math.sin(e),a=Math.cos(t),r=Math.sin(t),s=Math.cos(n),l=Math.sin(n),c=-o,h=-l,u=r*o,d=r*i,m=s*a,f=s*u+h*i,p=s*d+h*c,v=l*a,A=l*u+s*i,y=l*d+s*c,g=-r,x=a*o,I=a*i;return _.fromCopy16RowMajor(m,f,p,0,v,A,y,0,g,x,I,0,0,0,0,1)}static rotate(e){return this.rotateXYZ(e._v[0],e._v[1],e._v[2])}static scale(e){return _.fromCopy16RowMajor(e._v[0],0,0,0,0,e._v[1],0,0,0,0,e._v[2],0,0,0,0,1)}static multiply(e,t){if(e.isIdentityMatrixClass)return t;if(t.isIdentityMatrixClass)return e;const n=e._v,i=t._v,o=n[0]*i[0]+n[4]*i[1]+n[8]*i[2]+n[12]*i[3],a=n[1]*i[0]+n[5]*i[1]+n[9]*i[2]+n[13]*i[3],r=n[2]*i[0]+n[6]*i[1]+n[10]*i[2]+n[14]*i[3],s=n[3]*i[0]+n[7]*i[1]+n[11]*i[2]+n[15]*i[3],l=n[0]*i[4]+n[4]*i[5]+n[8]*i[6]+n[12]*i[7],c=n[1]*i[4]+n[5]*i[5]+n[9]*i[6]+n[13]*i[7],h=n[2]*i[4]+n[6]*i[5]+n[10]*i[6]+n[14]*i[7],u=n[3]*i[4]+n[7]*i[5]+n[11]*i[6]+n[15]*i[7],d=n[0]*i[8]+n[4]*i[9]+n[8]*i[10]+n[12]*i[11],m=n[1]*i[8]+n[5]*i[9]+n[9]*i[10]+n[13]*i[11],f=n[2]*i[8]+n[6]*i[9]+n[10]*i[10]+n[14]*i[11],p=n[3]*i[8]+n[7]*i[9]+n[11]*i[10]+n[15]*i[11],v=n[0]*i[12]+n[4]*i[13]+n[8]*i[14]+n[12]*i[15],A=n[1]*i[12]+n[5]*i[13]+n[9]*i[14]+n[13]*i[15],y=n[2]*i[12]+n[6]*i[13]+n[10]*i[14]+n[14]*i[15],g=n[3]*i[12]+n[7]*i[13]+n[11]*i[14]+n[15]*i[15];return _.fromCopy16RowMajor(o,l,d,v,a,c,m,A,r,h,f,y,s,u,p,g)}static multiplyTo(e,t,n){if(e.isIdentityMatrixClass)return n.copyComponents(t);if(t.isIdentityMatrixClass)return n.copyComponents(e);const i=e._v,o=t._v,a=i[0]*o[0]+i[4]*o[1]+i[8]*o[2]+i[12]*o[3],r=i[1]*o[0]+i[5]*o[1]+i[9]*o[2]+i[13]*o[3],s=i[2]*o[0]+i[6]*o[1]+i[10]*o[2]+i[14]*o[3],l=i[3]*o[0]+i[7]*o[1]+i[11]*o[2]+i[15]*o[3],c=i[0]*o[4]+i[4]*o[5]+i[8]*o[6]+i[12]*o[7],_=i[1]*o[4]+i[5]*o[5]+i[9]*o[6]+i[13]*o[7],h=i[2]*o[4]+i[6]*o[5]+i[10]*o[6]+i[14]*o[7],u=i[3]*o[4]+i[7]*o[5]+i[11]*o[6]+i[15]*o[7],d=i[0]*o[8]+i[4]*o[9]+i[8]*o[10]+i[12]*o[11],m=i[1]*o[8]+i[5]*o[9]+i[9]*o[10]+i[13]*o[11],f=i[2]*o[8]+i[6]*o[9]+i[10]*o[10]+i[14]*o[11],p=i[3]*o[8]+i[7]*o[9]+i[11]*o[10]+i[15]*o[11],v=i[0]*o[12]+i[4]*o[13]+i[8]*o[14]+i[12]*o[15],A=i[1]*o[12]+i[5]*o[13]+i[9]*o[14]+i[13]*o[15],y=i[2]*o[12]+i[6]*o[13]+i[10]*o[14]+i[14]*o[15],g=i[3]*o[12]+i[7]*o[13]+i[11]*o[14]+i[15]*o[15];return n.setComponents(a,c,d,v,r,_,m,A,s,h,f,y,l,u,p,g)}static multiplyTypedArrayTo(e,t,n,i){return t[c.QU](i,e._v,0,n._v),n}static fromQuaternionTo(e,t){const n=e._v[0]*e._v[0],i=e._v[1]*e._v[1],o=e._v[2]*e._v[2],a=e._v[1]*e._v[2],r=e._v[0]*e._v[2],s=e._v[0]*e._v[1],l=e._v[3]*e._v[0],c=e._v[3]*e._v[1],_=e._v[3]*e._v[2],h=1-2*(i+o),u=2*(s-_),d=2*(r+c),m=2*(s+_),f=1-2*(n+o),p=2*(a-l),v=2*(r-c),A=2*(a+l),y=1-2*(n+i);return t.setComponents(h,u,d,0,m,f,p,0,v,A,y,0,0,0,0,1)}toString(){return this._v[0]+" "+this._v[4]+" "+this._v[8]+" "+this._v[12]+" \n"+this._v[1]+" "+this._v[5]+" "+this._v[9]+" "+this._v[13]+" \n"+this._v[2]+" "+this._v[6]+" "+this._v[10]+" "+this._v[14]+" \n"+this._v[3]+" "+this._v[7]+" "+this._v[11]+" "+this._v[15]+" \n"}toStringApproximately(){return r.k.financial(this._v[0])+" "+r.k.financial(this._v[4])+" "+r.k.financial(this._v[8])+" "+r.k.financial(this._v[12])+" \n"+r.k.financial(this._v[1])+" "+r.k.financial(this._v[5])+" "+r.k.financial(this._v[9])+" "+r.k.financial(this._v[13])+" \n"+r.k.financial(this._v[2])+" "+r.k.financial(this._v[6])+" "+r.k.financial(this._v[10])+" "+r.k.financial(this._v[14])+" \n"+r.k.financial(this._v[3])+" "+r.k.financial(this._v[7])+" "+r.k.financial(this._v[11])+" "+r.k.financial(this._v[15])+" \n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3],this._v[4],this._v[5],this._v[6],this._v[7],this._v[8],this._v[9],this._v[10],this._v[11],this._v[12],this._v[13],this._v[14],this._v[15]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){const n=e._v;return Math.abs(n[0]-this._v[0]){"use strict";n.d(t,{f:()=>o});var i=n(18);class o extends i.a{constructor(e){super(e)}set m00(e){this._v[0]=e}get m00(){return this._v[0]}set m10(e){this._v[1]=e}get m10(){return this._v[1]}set m01(e){this._v[2]=e}get m01(){return this._v[2]}set m11(e){this._v[3]=e}get m11(){return this._v[3]}get className(){return"MutableMatrix22"}static zero(){return super.zero()}static identity(){return super.identity()}static dummy(){return super.dummy()}static transpose(e){return super.transpose(e)}static invert(e){return super.invert(e)}static rotate(e){return super.rotate(e)}static scale(e){return super.scale(e)}static multiply(e,t){return super.multiply(e,t)}clone(){return super.clone()}raw(){return this._v}setAt(e,t,n){return this._v[e+2*t]=n,this}setComponents(e,t,n,i){return this._v[0]=e,this._v[2]=t,this._v[1]=n,this._v[3]=i,this}copyComponents(e){return this._v[0]=e.m00,this._v[2]=e.m01,this._v[1]=e.m10,this._v[3]=e.m11,this}zero(){return this.setComponents(0,0,0,0)}identity(){return this.setComponents(1,0,0,1)}_swap(e,t){this._v[t]=[this._v[e],this._v[e]=this._v[t]][0]}transpose(){return this._swap(1,2),this}invert(){const e=this.determinant();0===e&&console.error("the determinant is 0!");const t=this._v[3]/e,n=this._v[2]/e*-1,i=this._v[1]/e*-1,o=this._v[0]/e;return this.setComponents(t,n,i,o)}rotate(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,-n,n,t)}scale(e){return this.setComponents(e._v[0],0,0,e._v[1])}multiplyScale(e){return this._v[0]*=e._v[0],this._v[2]*=e._v[0],this._v[1]*=e._v[1],this._v[3]*=e._v[1],this}multiply(e){const t=this._v[0]*e._v[0]+this._v[2]*e._v[1],n=this._v[0]*e._v[2]+this._v[2]*e._v[3],i=this._v[1]*e._v[0]+this._v[3]*e._v[1],o=this._v[1]*e._v[2]+this._v[3]*e._v[3];return this.setComponents(t,n,i,o)}multiplyByLeft(e){const t=e._v[0]*this._v[0]+e._v[2]*this._v[1],n=e._v[0]*this._v[2]+e._v[2]*this._v[3],i=e._v[1]*this._v[0]+e._v[3]*this._v[1],o=e._v[1]*this._v[2]+e._v[3]*this._v[3];return this.setComponents(t,n,i,o)}static fromCopy4RowMajor(e,t,n,i){const a=new Float32Array(4);return a[0]=e,a[2]=t,a[1]=n,a[3]=i,new o(a)}static fromCopy4ColumnMajor(e,t,n,i){const a=new Float32Array(4);return a[0]=e,a[2]=n,a[1]=t,a[3]=i,new o(a)}static fromFloat32ArrayColumnMajor(e){return new o(e)}static fromCopyFloat32ArrayColumnMajor(e){const t=new Float32Array(4);return t.set(e),new o(t)}static fromCopyFloat32ArrayRowMajor(e){const t=new Float32Array(4);return t[0]=e[0],t[3]=e[1],t[1]=e[2],t[4]=e[3],new o(t)}static fromCopyMatrix22(e){const t=new Float32Array(4);return t[0]=e._v[0],t[3]=e._v[1],t[1]=e._v[2],t[4]=e._v[3],new o(t)}static fromCopyArray9ColumnMajor(e){const t=new Float32Array(4);return t.set(e),new o(t)}static fromCopyArrayColumnMajor(e){const t=new Float32Array(4);return t.set(e),new o(t)}static fromCopyArray9RowMajor(e){const t=new Float32Array(4);return t[0]=e[0],t[3]=e[1],t[1]=e[2],t[4]=e[3],new o(t)}static fromCopyArrayRowMajor(e){const t=new Float32Array(4);return t[0]=e[0],t[3]=e[1],t[1]=e[2],t[4]=e[3],new o(t)}}},2566:(e,t,n)=>{"use strict";n.d(t,{x:()=>o});var i=n(1937);class o extends i.h{constructor(e){super(e)}set m00(e){this._v[0]=e}get m00(){return this._v[0]}set m10(e){this._v[1]=e}get m10(){return this._v[1]}set m20(e){this._v[2]=e}get m20(){return this._v[2]}set m01(e){this._v[3]=e}get m01(){return this._v[3]}set m11(e){this._v[4]=e}get m11(){return this._v[4]}set m21(e){this._v[5]=e}get m21(){return this._v[5]}set m02(e){this._v[6]=e}get m02(){return this._v[6]}set m12(e){this._v[7]=e}get m12(){return this._v[7]}set m22(e){this._v[8]=e}get m22(){return this._v[8]}get className(){return"MutableMatrix33"}static zero(){return super.zero()}static identity(){return o.fromCopy9RowMajor(1,0,0,0,1,0,0,0,1)}static dummy(){return super.dummy()}static transpose(e){return super.transpose(e)}static invert(e){return super.invert(e)}static rotateX(e){return super.rotateX(e)}static rotateY(e){return super.rotateY(e)}static rotateZ(e){return super.rotateZ(e)}static rotateXYZ(e,t,n){return super.rotateXYZ(e,t,n)}static rotate(e){return super.rotateXYZ(e._v[0],e._v[1],e._v[2])}static scale(e){return super.scale(e)}static multiply(e,t){return super.multiply(e,t)}clone(){return super.clone()}raw(){return this._v}setAt(e,t,n){return this._v[e+3*t]=n,this}setComponents(e,t,n,i,o,a,r,s,l){return this._v[0]=e,this._v[3]=t,this._v[6]=n,this._v[1]=i,this._v[4]=o,this._v[7]=a,this._v[2]=r,this._v[5]=s,this._v[8]=l,this}copyComponents(e){return this._v[0]=e.m00,this._v[3]=e.m01,this._v[6]=e.m02,this._v[1]=e.m10,this._v[4]=e.m11,this._v[7]=e.m12,this._v[2]=e.m20,this._v[5]=e.m21,this._v[8]=e.m22,this}zero(){return this.setComponents(0,0,0,0,0,0,0,0,0)}identity(){return this.setComponents(1,0,0,0,1,0,0,0,1)}_swap(e,t){this._v[t]=[this._v[e],this._v[e]=this._v[t]][0]}transpose(){return this._swap(1,3),this._swap(2,6),this._swap(5,8),this}invert(){const e=this.determinant();0===e&&console.error("the determinant is 0!");const t=(this._v[4]*this._v[8]-this._v[7]*this._v[5])/e,n=(this._v[6]*this._v[5]-this._v[3]*this._v[8])/e,i=(this._v[3]*this._v[7]-this._v[6]*this._v[4])/e,o=(this._v[7]*this._v[2]-this._v[1]*this._v[8])/e,a=(this._v[0]*this._v[8]-this._v[6]*this._v[2])/e,r=(this._v[6]*this._v[1]-this._v[0]*this._v[7])/e,s=(this._v[1]*this._v[5]-this._v[4]*this._v[2])/e,l=(this._v[3]*this._v[2]-this._v[0]*this._v[5])/e,c=(this._v[0]*this._v[4]-this._v[3]*this._v[1])/e;return this.setComponents(t,n,i,o,a,r,s,l,c)}rotateX(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(1,0,0,0,t,-n,0,n,t)}rotateY(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,0,n,0,1,0,-n,0,t)}rotateZ(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,-n,0,n,t,0,0,0,1)}rotateXYZ(e,t,n){const i=Math.cos(e),o=Math.sin(e),a=Math.cos(t),r=Math.sin(t),s=Math.cos(n),l=Math.sin(n),c=-o,_=-l,h=r*o,u=r*i,d=s*a,m=s*h+_*i,f=s*u+_*c,p=l*a,v=l*h+s*i,A=l*u+s*c,y=-r,g=a*o,x=a*i;return this.setComponents(d,m,f,p,v,A,y,g,x)}rotate(e){return this.rotateXYZ(e._v[0],e._v[1],e._v[2])}scale(e){return this.setComponents(e._v[0],0,0,0,e._v[1],0,0,0,e._v[2])}multiplyScale(e){return this._v[0]*=e._v[0],this._v[3]*=e._v[0],this._v[6]*=e._v[0],this._v[1]*=e._v[1],this._v[4]*=e._v[1],this._v[7]*=e._v[1],this._v[2]*=e._v[2],this._v[5]*=e._v[2],this._v[8]*=e._v[2],this}multiply(e){if(e.isIdentityMatrixClass)return this;const t=this._v[0]*e._v[0]+this._v[3]*e._v[1]+this._v[6]*e._v[2],n=this._v[0]*e._v[3]+this._v[3]*e._v[4]+this._v[6]*e._v[5],i=this._v[0]*e._v[6]+this._v[3]*e._v[7]+this._v[6]*e._v[8],o=this._v[1]*e._v[0]+this._v[4]*e._v[1]+this._v[7]*e._v[2],a=this._v[1]*e._v[3]+this._v[4]*e._v[4]+this._v[7]*e._v[5],r=this._v[1]*e._v[6]+this._v[4]*e._v[7]+this._v[7]*e._v[8],s=this._v[2]*e._v[0]+this._v[5]*e._v[1]+this._v[8]*e._v[2],l=this._v[2]*e._v[3]+this._v[5]*e._v[4]+this._v[8]*e._v[5],c=this._v[2]*e._v[6]+this._v[5]*e._v[7]+this._v[8]*e._v[8];return this.setComponents(t,n,i,o,a,r,s,l,c)}multiplyByLeft(e){if(e.isIdentityMatrixClass)return this;const t=e._v[0]*this._v[0]+e._v[3]*this._v[1]+e._v[6]*this._v[2],n=e._v[0]*this._v[3]+e._v[3]*this._v[4]+e._v[6]*this._v[5],i=e._v[0]*this._v[6]+e._v[3]*this._v[7]+e._v[6]*this._v[8],o=e._v[1]*this._v[0]+e._v[4]*this._v[1]+e._v[7]*this._v[2],a=e._v[1]*this._v[3]+e._v[4]*this._v[4]+e._v[7]*this._v[5],r=e._v[1]*this._v[6]+e._v[4]*this._v[7]+e._v[7]*this._v[8],s=e._v[2]*this._v[0]+e._v[5]*this._v[1]+e._v[8]*this._v[2],l=e._v[2]*this._v[3]+e._v[5]*this._v[4]+e._v[8]*this._v[5],c=e._v[2]*this._v[6]+e._v[5]*this._v[7]+e._v[8]*this._v[8];return this.setComponents(t,n,i,o,a,r,s,l,c)}static fromCopy9RowMajor(e,t,n,i,a,r,s,l,c){const _=new Float32Array(9);return _[0]=e,_[3]=t,_[6]=n,_[1]=i,_[4]=a,_[7]=r,_[2]=s,_[5]=l,_[8]=c,new o(_)}static fromCopy9ColumnMajor(e,t,n,i,a,r,s,l,c){const _=new Float32Array(9);return _[0]=e,_[3]=i,_[6]=s,_[1]=t,_[4]=a,_[7]=l,_[2]=n,_[5]=r,_[8]=c,new o(_)}static fromCopyMatrix44(e){const t=new Float32Array(9);return t.set(e._v),new o(t)}static fromFloat32ArrayColumnMajor(e){return new o(e)}static fromCopyFloat32ArrayColumnMajor(e){const t=new Float32Array(9);return t.set(e),new o(t)}static fromCopyFloat32ArrayRowMajor(e){const t=new Float32Array(9);return t[0]=e[0],t[3]=e[1],t[6]=e[2],t[1]=e[3],t[4]=e[4],t[7]=e[5],t[2]=e[6],t[5]=e[7],t[8]=e[8],new o(t)}static fromCopyMatrix33(e){const t=new Float32Array(9);return t[0]=e._v[0],t[3]=e._v[3],t[6]=e._v[6],t[1]=e._v[1],t[4]=e._v[4],t[7]=e._v[7],t[2]=e._v[2],t[5]=e._v[5],t[8]=e._v[8],new o(t)}static fromCopyArray9ColumnMajor(e){const t=new Float32Array(9);return t.set(e),new o(t)}static fromCopyArrayColumnMajor(e){const t=new Float32Array(9);return t.set(e),new o(t)}static fromCopyArray9RowMajor(e){const t=new Float32Array(9);return t[0]=e[0],t[3]=e[1],t[6]=e[2],t[1]=e[3],t[4]=e[4],t[7]=e[5],t[2]=e[6],t[5]=e[7],t[8]=e[8],new o(t)}static fromCopyArrayRowMajor(e){const t=new Float32Array(9);return t[0]=e[0],t[3]=e[1],t[6]=e[2],t[1]=e[3],t[4]=e[4],t[7]=e[5],t[2]=e[6],t[5]=e[7],t[8]=e[8],new o(t)}static fromCopyQuaternion(e){const t=e._v[0]*e._v[0],n=e._v[1]*e._v[1],i=e._v[2]*e._v[2],a=e._v[1]*e._v[2],r=e._v[0]*e._v[2],s=e._v[0]*e._v[1],l=e._v[3]*e._v[0],c=e._v[3]*e._v[1],_=e._v[3]*e._v[2],h=new Float32Array(9);return h[0]=1-2*(n+i),h[3]=2*(s-_),h[6]=2*(r+c),h[1]=2*(s+_),h[4]=1-2*(t+i),h[7]=2*(a-l),h[2]=2*(r-c),h[5]=2*(a+l),h[8]=1-2*(t+n),new o(h)}}},3496:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var i=n(5467);Float32Array;class o extends i.J{constructor(e){super(e)}set m00(e){this._v[0]=e}get m00(){return this._v[0]}set m10(e){this._v[1]=e}get m10(){return this._v[1]}set m20(e){this._v[2]=e}get m20(){return this._v[2]}set m30(e){this._v[3]=e}get m30(){return this._v[3]}set m01(e){this._v[4]=e}get m01(){return this._v[4]}set m11(e){this._v[5]=e}get m11(){return this._v[5]}set m21(e){this._v[6]=e}get m21(){return this._v[6]}set m31(e){this._v[7]=e}get m31(){return this._v[7]}set m02(e){this._v[8]=e}get m02(){return this._v[8]}set m12(e){this._v[9]=e}get m12(){return this._v[9]}set m22(e){this._v[10]=e}get m22(){return this._v[10]}set m32(e){this._v[11]=e}get m32(){return this._v[11]}set m03(e){this._v[12]=e}get m03(){return this._v[12]}set m13(e){this._v[13]=e}get m13(){return this._v[13]}set m23(e){this._v[14]=e}get m23(){return this._v[14]}set m33(e){this._v[15]=e}get m33(){return this._v[15]}get translateX(){return this._v[12]}set translateX(e){this._v[12]=e}get translateY(){return this._v[13]}set translateY(e){this._v[13]=e}get translateZ(){return this._v[14]}set translateZ(e){this._v[14]=e}get className(){return"MutableMatrix44"}static zero(){return o.fromCopy16RowMajor(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}static identity(){return o.fromCopy16RowMajor(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}static dummy(){return super.dummy()}static transpose(e){return e.isIdentityMatrixClass?e:o.fromCopyFloat32ArrayRowMajor(e._v)}static invert(e){return super.invert(e)}static translate(e){return super.translate(e)}static rotateX(e){return super.rotateX(e)}static rotateY(e){return super.rotateY(e)}static rotateZ(e){return super.rotateZ(e)}static rotateXYZ(e,t,n){return super.rotateXYZ(e,t,n)}static rotate(e){return super.rotateXYZ(e._v[0],e._v[1],e._v[2])}static scale(e){return super.scale(e)}static multiply(e,t){return super.multiply(e,t)}clone(){return super.clone()}getRotate(){return super.getRotate()}getTranslate(){return super.getTranslate()}getScale(){return super.getScale()}raw(){return this._v}setAt(e,t,n){return this._v[e+4*t]=n,this}setComponents(e,t,n,i,o,a,r,s,l,c,_,h,u,d,m,f){return this._v[0]=e,this._v[4]=t,this._v[8]=n,this._v[12]=i,this._v[1]=o,this._v[5]=a,this._v[9]=r,this._v[13]=s,this._v[2]=l,this._v[6]=c,this._v[10]=_,this._v[14]=h,this._v[3]=u,this._v[7]=d,this._v[11]=m,this._v[15]=f,this}copyComponents(e){return this._v[0]=e._v[0],this._v[4]=e._v[4],this._v[8]=e._v[8],this._v[12]=e._v[12],this._v[1]=e._v[1],this._v[5]=e._v[5],this._v[9]=e._v[9],this._v[13]=e._v[13],this._v[2]=e._v[2],this._v[6]=e._v[6],this._v[10]=e._v[10],this._v[14]=e._v[14],this._v[3]=e._v[3],this._v[7]=e._v[7],this._v[11]=e._v[11],this._v[15]=e._v[15],this}zero(){return this.setComponents(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}identity(){return this.setComponents(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}_swap(e,t){this._v[t]=[this._v[e],this._v[e]=this._v[t]][0]}transpose(){return this._swap(1,4),this._swap(2,8),this._swap(3,12),this._swap(6,9),this._swap(7,13),this._swap(11,14),this}invert(){const e=this._v[0]*this._v[5]-this._v[4]*this._v[1],t=this._v[0]*this._v[9]-this._v[8]*this._v[1],n=this._v[0]*this._v[13]-this._v[12]*this._v[1],i=this._v[4]*this._v[9]-this._v[8]*this._v[5],o=this._v[4]*this._v[13]-this._v[12]*this._v[5],a=this._v[8]*this._v[13]-this._v[12]*this._v[9],r=this._v[2]*this._v[7]-this._v[6]*this._v[3],s=this._v[2]*this._v[11]-this._v[10]*this._v[3],l=this._v[2]*this._v[15]-this._v[14]*this._v[3],c=this._v[6]*this._v[11]-this._v[10]*this._v[7],_=this._v[6]*this._v[15]-this._v[14]*this._v[7],h=this._v[10]*this._v[15]-this._v[14]*this._v[11],u=e*h-t*_+n*c+i*l-o*s+a*r;0===u&&console.error("the determinant is 0!");const d=(this._v[5]*h-this._v[9]*_+this._v[13]*c)/u,m=(this._v[8]*_-this._v[4]*h-this._v[12]*c)/u,f=(this._v[7]*a-this._v[11]*o+this._v[15]*i)/u,p=(this._v[10]*o-this._v[6]*a-this._v[14]*i)/u,v=(this._v[9]*l-this._v[1]*h-this._v[13]*s)/u,A=(this._v[0]*h-this._v[8]*l+this._v[12]*s)/u,y=(this._v[11]*n-this._v[3]*a-this._v[15]*t)/u,g=(this._v[2]*a-this._v[10]*n+this._v[14]*t)/u,x=(this._v[1]*_-this._v[5]*l+this._v[13]*r)/u,I=(this._v[4]*l-this._v[0]*_-this._v[12]*r)/u,b=(this._v[3]*o-this._v[7]*n+this._v[15]*e)/u,E=(this._v[6]*n-this._v[2]*o-this._v[14]*e)/u,T=(this._v[5]*s-this._v[1]*c-this._v[9]*r)/u,S=(this._v[0]*c-this._v[4]*s+this._v[8]*r)/u,C=(this._v[7]*t-this._v[3]*i-this._v[11]*e)/u,w=(this._v[2]*i-this._v[6]*t+this._v[10]*e)/u;return this.setComponents(d,m,f,p,v,A,y,g,x,I,b,E,T,S,C,w)}translate(e){return this.setComponents(1,0,0,e._v[0],0,1,0,e._v[1],0,0,1,e._v[2],0,0,0,1)}putTranslate(e){return this._v[12]=e._v[0],this._v[13]=e._v[1],this._v[14]=e._v[2],this}addTranslate(e){return this._v[12]+=e._v[0],this._v[13]+=e._v[1],this._v[14]+=e._v[2],this}rotateX(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1)}rotateY(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1)}rotateZ(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1)}rotateXYZ(e,t,n){const i=Math.cos(e),o=Math.sin(e),a=Math.cos(t),r=Math.sin(t),s=Math.cos(n),l=Math.sin(n),c=-o,_=-l,h=r*o,u=r*i,d=s*a,m=s*h+_*i,f=s*u+_*c,p=l*a,v=l*h+s*i,A=l*u+s*c,y=-r,g=a*o,x=a*i;return this.setComponents(d,m,f,0,p,v,A,0,y,g,x,0,0,0,0,1)}rotate(e){return this.rotateXYZ(e._v[0],e._v[1],e._v[2])}scale(e){return this.setComponents(e._v[0],0,0,0,0,e._v[1],0,0,0,0,e._v[2],0,0,0,0,1)}multiplyScale(e){return this._v[0]*=e._v[0],this._v[4]*=e._v[0],this._v[8]*=e._v[0],this._v[12]*=e._v[0],this._v[1]*=e._v[1],this._v[5]*=e._v[1],this._v[9]*=e._v[1],this._v[13]*=e._v[1],this._v[2]*=e._v[2],this._v[6]*=e._v[2],this._v[10]*=e._v[2],this._v[14]*=e._v[2],this}multiply(e){if(e.isIdentityMatrixClass)return this;const t=this._v[0]*e._v[0]+this._v[4]*e._v[1]+this._v[8]*e._v[2]+this._v[12]*e._v[3],n=this._v[0]*e._v[4]+this._v[4]*e._v[5]+this._v[8]*e._v[6]+this._v[12]*e._v[7],i=this._v[0]*e._v[8]+this._v[4]*e._v[9]+this._v[8]*e._v[10]+this._v[12]*e._v[11],o=this._v[0]*e._v[12]+this._v[4]*e._v[13]+this._v[8]*e._v[14]+this._v[12]*e._v[15],a=this._v[1]*e._v[0]+this._v[5]*e._v[1]+this._v[9]*e._v[2]+this._v[13]*e._v[3],r=this._v[1]*e._v[4]+this._v[5]*e._v[5]+this._v[9]*e._v[6]+this._v[13]*e._v[7],s=this._v[1]*e._v[8]+this._v[5]*e._v[9]+this._v[9]*e._v[10]+this._v[13]*e._v[11],l=this._v[1]*e._v[12]+this._v[5]*e._v[13]+this._v[9]*e._v[14]+this._v[13]*e._v[15],c=this._v[2]*e._v[0]+this._v[6]*e._v[1]+this._v[10]*e._v[2]+this._v[14]*e._v[3],_=this._v[2]*e._v[4]+this._v[6]*e._v[5]+this._v[10]*e._v[6]+this._v[14]*e._v[7],h=this._v[2]*e._v[8]+this._v[6]*e._v[9]+this._v[10]*e._v[10]+this._v[14]*e._v[11],u=this._v[2]*e._v[12]+this._v[6]*e._v[13]+this._v[10]*e._v[14]+this._v[14]*e._v[15],d=this._v[3]*e._v[0]+this._v[7]*e._v[1]+this._v[11]*e._v[2]+this._v[15]*e._v[3],m=this._v[3]*e._v[4]+this._v[7]*e._v[5]+this._v[11]*e._v[6]+this._v[15]*e._v[7],f=this._v[3]*e._v[8]+this._v[7]*e._v[9]+this._v[11]*e._v[10]+this._v[15]*e._v[11],p=this._v[3]*e._v[12]+this._v[7]*e._v[13]+this._v[11]*e._v[14]+this._v[15]*e._v[15];return this.setComponents(t,n,i,o,a,r,s,l,c,_,h,u,d,m,f,p)}multiplyByLeft(e){if(e.isIdentityMatrixClass)return this;const t=e._v[0]*this._v[0]+e._v[4]*this._v[1]+e._v[8]*this._v[2]+e._v[12]*this._v[3],n=e._v[0]*this._v[4]+e._v[4]*this._v[5]+e._v[8]*this._v[6]+e._v[12]*this._v[7],i=e._v[0]*this._v[8]+e._v[4]*this._v[9]+e._v[8]*this._v[10]+e._v[12]*this._v[11],o=e._v[0]*this._v[12]+e._v[4]*this._v[13]+e._v[8]*this._v[14]+e._v[12]*this._v[15],a=e._v[1]*this._v[0]+e._v[5]*this._v[1]+e._v[9]*this._v[2]+e._v[13]*this._v[3],r=e._v[1]*this._v[4]+e._v[5]*this._v[5]+e._v[9]*this._v[6]+e._v[13]*this._v[7],s=e._v[1]*this._v[8]+e._v[5]*this._v[9]+e._v[9]*this._v[10]+e._v[13]*this._v[11],l=e._v[1]*this._v[12]+e._v[5]*this._v[13]+e._v[9]*this._v[14]+e._v[13]*this._v[15],c=e._v[2]*this._v[0]+e._v[6]*this._v[1]+e._v[10]*this._v[2]+e._v[14]*this._v[3],_=e._v[2]*this._v[4]+e._v[6]*this._v[5]+e._v[10]*this._v[6]+e._v[14]*this._v[7],h=e._v[2]*this._v[8]+e._v[6]*this._v[9]+e._v[10]*this._v[10]+e._v[14]*this._v[11],u=e._v[2]*this._v[12]+e._v[6]*this._v[13]+e._v[10]*this._v[14]+e._v[14]*this._v[15],d=e._v[3]*this._v[0]+e._v[7]*this._v[1]+e._v[11]*this._v[2]+e._v[15]*this._v[3],m=e._v[3]*this._v[4]+e._v[7]*this._v[5]+e._v[11]*this._v[6]+e._v[15]*this._v[7],f=e._v[3]*this._v[8]+e._v[7]*this._v[9]+e._v[11]*this._v[10]+e._v[15]*this._v[11],p=e._v[3]*this._v[12]+e._v[7]*this._v[13]+e._v[11]*this._v[14]+e._v[15]*this._v[15];return this.setComponents(t,n,i,o,a,r,s,l,c,_,h,u,d,m,f,p)}fromQuaternion(e){const t=e._v[0]*e._v[0],n=e._v[1]*e._v[1],i=e._v[2]*e._v[2],o=e._v[1]*e._v[2],a=e._v[0]*e._v[2],r=e._v[0]*e._v[1],s=e._v[3]*e._v[0],l=e._v[3]*e._v[1],c=e._v[3]*e._v[2],_=1-2*(n+i),h=2*(r-c),u=2*(a+l),d=2*(r+c),m=1-2*(t+i),f=2*(o-s),p=2*(a-l),v=2*(o+s),A=1-2*(t+n);return this.setComponents(_,h,u,0,d,m,f,0,p,v,A,0,0,0,0,1)}static fromCopy16RowMajor(e,t,n,i,a,r,s,l,c,_,h,u,d,m,f,p){const v=new Float32Array(16);return v[0]=e,v[4]=t,v[8]=n,v[12]=i,v[1]=a,v[5]=r,v[9]=s,v[13]=l,v[2]=c,v[6]=_,v[10]=h,v[14]=u,v[3]=d,v[7]=m,v[11]=f,v[15]=p,new o(v)}static fromCopy16ColumnMajor(e,t,n,i,a,r,s,l,c,_,h,u,d,m,f,p){const v=new Float32Array(16);return v[0]=e,v[4]=a,v[8]=c,v[12]=d,v[1]=t,v[5]=r,v[9]=_,v[13]=m,v[2]=n,v[6]=s,v[10]=h,v[14]=f,v[3]=i,v[7]=l,v[11]=u,v[15]=p,new o(v)}static fromCopyMatrix44(e){const t=new Float32Array(16);return t.set(e._v),new o(t)}static fromFloat32ArrayColumnMajor(e){return new o(e)}static fromCopyFloat32ArrayColumnMajor(e){const t=new Float32Array(16);return t.set(e),new o(t)}static fromCopyFloat32ArrayRowMajor(e){const t=new Float32Array(16);return t[0]=e[0],t[4]=e[1],t[8]=e[2],t[12]=e[3],t[1]=e[4],t[5]=e[5],t[9]=e[6],t[13]=e[7],t[2]=e[8],t[6]=e[9],t[10]=e[10],t[14]=e[11],t[3]=e[12],t[7]=e[13],t[11]=e[14],t[15]=e[15],new o(t)}static fromCopyMatrix33(e){const t=new Float32Array(16);return t[0]=e._v[0],t[4]=e._v[3],t[8]=e._v[6],t[12]=0,t[1]=e._v[1],t[5]=e._v[4],t[9]=e._v[7],t[13]=0,t[2]=e._v[2],t[6]=e._v[5],t[10]=e._v[8],t[14]=0,t[3]=0,t[7]=0,t[11]=0,t[15]=1,new o(t)}static fromCopyArray16ColumnMajor(e){const t=new Float32Array(16);return t.set(e),new o(t)}static fromCopyArrayColumnMajor(e){const t=new Float32Array(16);return t.set(e),new o(t)}static fromCopyArray16RowMajor(e){const t=new Float32Array(16);return t[0]=e[0],t[4]=e[1],t[8]=e[2],t[12]=e[3],t[1]=e[4],t[5]=e[5],t[9]=e[6],t[13]=e[7],t[2]=e[8],t[6]=e[9],t[10]=e[10],t[14]=e[11],t[3]=e[12],t[7]=e[13],t[11]=e[14],t[15]=e[15],new o(t)}static fromCopyArrayRowMajor(e){const t=new Float32Array(16);return t[0]=e[0],t[4]=e[1],t[8]=e[2],t[12]=e[3],t[1]=e[4],t[5]=e[5],t[9]=e[6],t[13]=e[7],t[2]=e[8],t[6]=e[9],t[10]=e[10],t[14]=e[11],t[3]=e[12],t[7]=e[13],t[11]=e[14],t[15]=e[15],new o(t)}static fromCopyQuaternion(e){const t=e._v[0]*e._v[0],n=e._v[1]*e._v[1],i=e._v[2]*e._v[2],a=e._v[1]*e._v[2],r=e._v[0]*e._v[2],s=e._v[0]*e._v[1],l=e._v[3]*e._v[0],c=e._v[3]*e._v[1],_=e._v[3]*e._v[2],h=new Float32Array(16);return h[0]=1-2*(n+i),h[4]=2*(s-_),h[8]=2*(r+c),h[12]=0,h[1]=2*(s+_),h[5]=1-2*(t+i),h[9]=2*(a-l),h[13]=0,h[2]=2*(r-c),h[6]=2*(a+l),h[10]=1-2*(t+n),h[14]=0,h[3]=0,h[7]=0,h[11]=0,h[15]=1,new o(h)}}},963:(e,t,n)=>{"use strict";n.d(t,{y:()=>o});var i=n(9207);class o extends i._{constructor(e){super(e)}set x(e){this._v[0]=e}get x(){return this._v[0]}set y(e){this._v[1]=e}get y(){return this._v[1]}set z(e){this._v[2]=e}get z(){return this._v[2]}set w(e){this._v[3]=e}get w(){return this._v[3]}get className(){return"MutableQuaternion"}static identity(){return o.fromCopy4(0,0,0,1)}static dummy(){return new this(new Float32Array(0))}static invert(e){return super.invert(e)}static qlerp(e,t,n){return super.qlerp(e,t,n)}static lerp(e,t,n){return super.lerp(e,t,n)}static axisAngle(e,t){return super.axisAngle(e,t)}static fromMatrix(e){return super.fromMatrix(e)}static fromPosition(e){return super.fromPosition(e)}static add(e,t){return super.add(e,t)}static subtract(e,t){return super.subtract(e,t)}static multiply(e,t){return super.multiply(e,t)}static multiplyNumber(e,t){return super.multiplyNumber(e,t)}static divideNumber(e,t){return super.divideNumber(e,t)}raw(){return this._v}setAt(e,t){return this._v[e]=t,this}setComponents(e,t,n,i){return this._v[0]=e,this._v[1]=t,this._v[2]=n,this._v[3]=i,this}copyComponents(e){return this.setComponents(e._v[0],e._v[1],e._v[2],e._v[3])}identity(){return this.setComponents(0,0,0,1)}normalize(){const e=this.length();return this.divideNumber(e)}invert(){const e=this.length();return 0===e||(this._v[0]=-this._v[0]/e,this._v[1]=-this._v[1]/e,this._v[2]=-this._v[2]/e,this._v[3]=this._v[3]/e),this}qlerp(e,t,n){let i=e._v[3]*t._v[3]+e._v[0]*t._v[0]+e._v[1]*t._v[1]+e._v[2]*t._v[2];if(0==1-i*i)return this.copyComponents(e);{i>1?i=.999:i<-1&&(i=-.999);let o,a=Math.acos(i);i<0&&a>Math.PI/2?(i=-e._v[3]*t._v[3]-e._v[0]*t._v[0]-e._v[1]*t._v[1]-e._v[2]*t._v[2],a=Math.acos(i),o=-1*Math.sin(a*n)/Math.sin(a)):o=Math.sin(a*n)/Math.sin(a);const r=Math.sin(a*(1-n))/Math.sin(a);this._v[0]=e._v[0]*r+t._v[0]*o,this._v[1]=e._v[1]*r+t._v[1]*o,this._v[2]=e._v[2]*r+t._v[2]*o,this._v[3]=e._v[3]*r+t._v[3]*o}return this}lerp(e,t,n){return this._v[0]=e._v[0]*(1-n)+t._v[0]*n,this._v[1]=e._v[1]*(1-n)+t._v[1]*n,this._v[2]=e._v[2]*(1-n)+t._v[2]*n,this._v[3]=e._v[3]*(1-n)+t._v[3]*n,this}axisAngle(e,t){const n=.5*t,i=Math.sin(n),o=e.length();return 0===o&&console.error("0 division occurred!"),this._v[3]=Math.cos(n),this._v[0]=i*e._v[0]/o,this._v[1]=i*e._v[1]/o,this._v[2]=i*e._v[2]/o,this}fromMatrix(e){const t=e.m00+e.m11+e.m22;if(t>0){const n=.5/Math.sqrt(t+1);this._v[0]=(e.m21-e.m12)*n,this._v[1]=(e.m02-e.m20)*n,this._v[2]=(e.m10-e.m01)*n,this._v[3]=.25/n}else if(e.m00>e.m11&&e.m00>e.m22){const t=2*Math.sqrt(1+e.m00-e.m11-e.m22);this._v[0]=.25*t,this._v[1]=(e.m01+e.m10)/t,this._v[2]=(e.m02+e.m20)/t,this._v[3]=(e.m21-e.m12)/t}else if(e.m11>e.m22){const t=2*Math.sqrt(1+e.m11-e.m00-e.m22);this._v[0]=(e.m01+e.m10)/t,this._v[1]=.25*t,this._v[2]=(e.m12+e.m21)/t,this._v[3]=(e.m02-e.m20)/t}else{const t=2*Math.sqrt(1+e.m22-e.m00-e.m11);this._v[0]=(e.m02+e.m20)/t,this._v[1]=(e.m12+e.m21)/t,this._v[2]=.25*t,this._v[3]=(e.m10-e.m01)/t}return this}fromPosition(e){return this.setComponents(e._v[0],e._v[1],e._v[2],0)}add(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this._v[2]+=e._v[2],this._v[3]+=e._v[3],this}subtract(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this._v[2]-=e._v[2],this._v[3]-=e._v[3],this}multiply(e){const t=e._v[3]*this._v[0]+e._v[2]*this._v[1]+e._v[1]*this._v[2]-e._v[0]*this._v[3],n=-e._v[2]*this._v[0]+e._v[3]*this._v[1]+e._v[0]*this._v[2]-e._v[1]*this._v[3],i=e._v[1]*this._v[0]+e._v[0]*this._v[1]+e._v[3]*this._v[2]-e._v[2]*this._v[3],o=-e._v[0]*this._v[0]-e._v[1]*this._v[1]-e._v[2]*this._v[2]-e._v[3]*this._v[3];return this.setComponents(t,n,i,o)}multiplyNumber(e){return this._v[0]*=e,this._v[1]*=e,this._v[2]*=e,this._v[3]*=e,this}divideNumber(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e,this._v[2]/=e,this._v[3]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0,this._v[2]=1/0,this._v[3]=1/0),this}clone(){return o.fromCopy4(this._v[0],this._v[1],this._v[2],this._v[3])}static fromFloat32Array(e){return new o(e)}static fromCopyArray4(e){return new o(new Float32Array(e))}static fromCopyArray(e){return new o(new Float32Array(e.slice(0,4)))}static fromCopy4(e,t,n,i){return new o(new Float32Array([e,t,n,i]))}static fromCopyQuaternion(e){const t=new Float32Array(4);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],t[3]=e._v[3],new o(t)}static fromCopyVector4(e){const t=new Float32Array(4);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],t[3]=e._v[3],new o(t)}static fromCopyLogQuaternion(e){const t=e._v[0]*e._v[0]+e._v[1]*e._v[1]+e._v[2]*e._v[2],n=Math.sin(t),i=new Float32Array(4);return i[0]=e._v[0]*(n/t),i[1]=e._v[1]*(n/t),i[2]=e._v[2]*(n/t),i[3]=Math.cos(t),new o(i)}}},4267:(e,t,n)=>{"use strict";n.d(t,{$_:()=>s,DU:()=>r,Et:()=>a});var i=n(3616),o=n(810);class a extends i.ap{constructor(e,{type:t}){super(e,{type:t})}copyComponents(e){this._v[0]=e._v[0]}get x(){return this._v[0]}set x(e){this._v[0]=e}get y(){return 0}get z(){return 0}get w(){return 1}toString(){return"("+this._v[0]+")"}setValue(e){return this.x=e,this}static get compositionType(){return o.d.Scalar}get bytesPerComponent(){return this._v.BYTES_PER_ELEMENT}}class r extends a{constructor(e){super(e,{type:Float32Array})}clone(){return new r(new Float32Array([this.x]))}static one(){return new r(new Float32Array([1]))}static dummy(){return new r(new Float32Array([]))}static zero(){return new r(new Float32Array([0]))}get className(){return"MutableScalar"}}class s extends a{constructor(e){super(e,{type:Float64Array})}clone(){return new s(new Float64Array([this.x]))}static one(){return new s(new Float64Array([1]))}static dummy(){return new s(new Float64Array([]))}static zero(){return new s(new Float64Array([0]))}}},8182:(e,t,n)=>{"use strict";n.d(t,{NR:()=>a,el:()=>o,th:()=>r});var i=n(2390);class o extends i.pV{constructor(e,{type:t}){super(e,{type:t})}set x(e){this._v[0]=e}get x(){return this._v[0]}set y(e){this._v[1]=e}get y(){return this._v[1]}get z(){return 0}get w(){return 1}raw(){return this._v}setAt(e,t){return this._v[e]=t,this}setComponents(e,t){return this._v[0]=e,this._v[1]=t,this}copyComponents(e){return this.setComponents(e._v[0],e._v[1])}zero(){return this.setComponents(0,0)}one(){return this.setComponents(1,1)}normalize(){const e=this.length();return this.divide(e),this}add(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this}subtract(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this}multiply(e){return this._v[0]*=e,this._v[1]*=e,this}multiplyVector(e){return this._v[0]*=e._v[0],this._v[1]*=e._v[1],this}divide(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0),this}divideVector(e){return 0!==e._v[0]&&0!==e._v[1]?(this._v[0]/=e._v[0],this._v[1]/=e._v[1]):(console.error("0 division occurred!"),this._v[0]=0===e._v[0]?1/0:this._v[0]/e._v[0],this._v[1]=0===e._v[1]?1/0:this._v[1]/e._v[1]),this}get bytesPerComponent(){return this._v.BYTES_PER_ELEMENT}}class a extends o{constructor(e){super(e,{type:Float32Array})}static fromCopyArray2(e){return new a(new Float32Array(e))}static fromCopyArray(e){return new a(new Float32Array(e.slice(0,2)))}static fromFloat32Array(e){return new a(e)}static fromCopyFloat32Array(e){return new a(new Float32Array(e.buffer.slice(0)))}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}get className(){return"MutableVector2"}clone(){return super.clone()}}class r extends o{constructor(e){super(e,{type:Float64Array})}static fromCopyArray(e){return new r(new Float64Array(e))}static zero(){return super._zero(Float64Array)}static one(){return super._one(Float64Array)}static dummy(){return super._dummy(Float64Array)}static normalize(e){return super._normalize(e,Float64Array)}static add(e,t){return super._add(e,t,Float64Array)}static subtract(e,t){return super._subtract(e,t,Float64Array)}static multiply(e,t){return super._multiply(e,t,Float64Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float64Array)}static divide(e,t){return super._divide(e,t,Float64Array)}static divideVector(e,t){return super._divideVector(e,t,Float64Array)}clone(){return super.clone()}}},9190:(e,t,n)=>{"use strict";n.d(t,{I1:()=>o,d6:()=>a,oV:()=>r});var i=n(2471);class o extends i.pg{constructor(e,{type:t}){super(e,{type:t})}set x(e){this._v[0]=e}get x(){return this._v[0]}set y(e){this._v[1]=e}get y(){return this._v[1]}set z(e){this._v[2]=e}get z(){return this._v[2]}get w(){return 1}raw(){return this._v}setAt(e,t){return this._v[e]=t,this}setComponents(e,t,n){return this._v[0]=e,this._v[1]=t,this._v[2]=n,this}copyComponents(e){return this.setComponents(e._v[0],e._v[1],e._v[2])}zero(){return this.setComponents(0,0,0)}one(){return this.setComponents(1,1,1)}normalize(){const e=this.length();return this.divide(e),this}add(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this._v[2]+=e._v[2],this}subtract(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this._v[2]-=e._v[2],this}multiply(e){return this._v[0]*=e,this._v[1]*=e,this._v[2]*=e,this}multiplyVector(e){return this._v[0]*=e._v[0],this._v[1]*=e._v[1],this._v[2]*=e._v[2],this}divide(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e,this._v[2]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0,this._v[2]=1/0),this}divideVector(e){return 0!==e._v[0]&&0!==e._v[1]&&0!==e._v[2]?(this._v[0]/=e._v[0],this._v[1]/=e._v[1],this._v[2]/=e._v[2]):(console.error("0 division occurred!"),this._v[0]=0===e._v[0]?1/0:this._v[0]/e._v[0],this._v[1]=0===e._v[1]?1/0:this._v[1]/e._v[1],this._v[2]=0===e._v[2]?1/0:this._v[2]/e._v[2]),this}cross(e){const t=this._v[1]*e._v[2]-this._v[2]*e._v[1],n=this._v[2]*e._v[0]-this._v[0]*e._v[2],i=this._v[0]*e._v[1]-this._v[1]*e._v[0];return this.setComponents(t,n,i)}multiplyQuaternion(e){const t=2*e._v[0],n=2*e._v[1],i=2*e._v[2],o=e._v[0]*t,a=e._v[1]*n,r=e._v[2]*i,s=e._v[0]*n,l=e._v[0]*i,c=e._v[1]*i,_=e._v[3]*t,h=e._v[3]*n,u=e._v[3]*i,d=(1-(a+r))*this._v[0]+(s-u)*this._v[1]+(l+h)*this._v[2],m=(s+u)*this._v[0]+(1-(o+r))*this._v[1]+(c-_)*this._v[2],f=(l-h)*this._v[0]+(c+_)*this._v[1]+(1-(o+a))*this._v[2];return this.setComponents(d,m,f)}get bytesPerComponent(){return this._v.BYTES_PER_ELEMENT}static _fromCopy3(e,t,n,i){return new this(new i([e,t,n]),{type:i})}}class a extends o{constructor(e){super(e,{type:Float32Array})}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}static cross(e,t){return super._cross(e,t,Float32Array)}static multiplyQuaternion(e,t){return super._multiplyQuaternion(e,t,Float32Array)}get className(){return"MutableVector3"}static fromCopy3(e,t,n){return super._fromCopy3(e,t,n,Float32Array)}static fromCopy1(e){return super._fromCopy3(e,e,e,Float32Array)}static fromCopyArray3(e){return new a(new Float32Array(e))}static fromCopyArray(e){return new a(new Float32Array(e.slice(0,3)))}static fromFloat32Array(e){return new a(e)}static fromCopyFloat32Array(e){return new a(new Float32Array(e.buffer.slice(0)))}static fromCopyVector3(e){return super._fromCopyVector3(e,Float32Array)}static fromCopyVector4(e){return super._fromCopyVector4(e,Float32Array)}clone(){return super.clone()}static rotateX(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.y=e.y*i-e.z*o,n.z=e.y*o+e.z*i}static rotateY(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.x=e.x*i+e.z*o,n.z=-e.x*o+e.z*i}static rotateZ(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.x=e.x*i-e.y*o,n.y=e.x*o+e.y*i}}class r extends o{constructor(e){super(e,{type:Float64Array})}static zero(){return super._zero(Float64Array)}static one(){return super._one(Float64Array)}static dummy(){return super._dummy(Float64Array)}static normalize(e){return super._normalize(e,Float64Array)}static add(e,t){return super._add(e,t,Float64Array)}static subtract(e,t){return super._subtract(e,t,Float64Array)}static multiply(e,t){return super._multiply(e,t,Float64Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float64Array)}static divide(e,t){return super._divide(e,t,Float64Array)}static divideVector(e,t){return super._divideVector(e,t,Float64Array)}static cross(e,t){return super._cross(e,t,Float64Array)}static multiplyQuaternion(e,t){return super._multiplyQuaternion(e,t,Float64Array)}static fromCopy3(e,t,n){return super._fromCopy3(e,t,n,Float64Array)}static fromCopy1(e){return super._fromCopy3(e,e,e,Float64Array)}static fromCopyArray3(e){return new r(new Float64Array(e))}static fromCopyArray(e){return new r(new Float64Array(e.slice(0,3)))}static rotateX(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.y=e.y*i-e.z*o,n.z=e.y*o+e.z*i}static rotateY(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.x=e.x*i+e.z*o,n.z=-e.x*o+e.z*i}static rotateZ(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.x=e.x*i-e.y*o,n.y=e.x*o+e.y*i}clone(){return super.clone()}}},4536:(e,t,n)=>{"use strict";n.d(t,{e2:()=>o,hn:()=>r,xQ:()=>a});var i=n(7192);class o extends i.rE{constructor(e,{type:t}){super(e,{type:t}),this.__updateCount=0}set x(e){this._v[0]=e,this.__updateCount++}get x(){return this._v[0]}set y(e){this._v[1]=e,this.__updateCount++}get y(){return this._v[1]}set z(e){this._v[2]=e,this.__updateCount++}get z(){return this._v[2]}set w(e){this._v[3]=e,this.__updateCount++}get w(){return this._v[3]}raw(){return this._v}setAt(e,t){return this._v[e]=t,this.__updateCount++,this}setComponents(e,t,n,i){return this._v[0]=e,this._v[1]=t,this._v[2]=n,this._v[3]=i,this.__updateCount++,this}copyComponents(e){return this.setComponents(e._v[0],e._v[1],e._v[2],e._v[3])}zero(){return this.setComponents(0,0,0,0)}one(){return this.setComponents(1,1,1,1)}get bytesPerComponent(){return this._v.BYTES_PER_ELEMENT}normalize(){const e=this.length();return this.divide(e),this}normalize3(){const e=Math.hypot(this._v[0],this._v[1],this._v[2]);return this.divide(e),this}add(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this._v[2]+=e._v[2],this._v[3]+=e._v[3],this}subtract(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this._v[2]-=e._v[2],this._v[3]-=e._v[3],this}multiply(e){return this._v[0]*=e,this._v[1]*=e,this._v[2]*=e,this._v[3]*=e,this}multiplyVector(e){return this._v[0]*=e._v[0],this._v[1]*=e._v[1],this._v[2]*=e._v[2],this._v[3]*=e._v[3],this}divide(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e,this._v[2]/=e,this._v[3]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0,this._v[2]=1/0,this._v[3]=1/0),this}divideVector(e){return 0!==e._v[0]&&0!==e._v[1]&&0!==e._v[2]&&0!==e._v[3]?(this._v[0]/=e._v[0],this._v[1]/=e._v[1],this._v[2]/=e._v[2],this._v[3]/=e._v[3]):(console.error("0 division occurred!"),this._v[0]=0===e._v[0]?1/0:this._v[0]/e._v[0],this._v[1]=0===e._v[1]?1/0:this._v[1]/e._v[1],this._v[2]=0===e._v[2]?1/0:this._v[2]/e._v[2],this._v[3]=0===e._v[3]?1/0:this._v[3]/e._v[3]),this}get _updateCount(){return this.__updateCount}}class a extends o{constructor(e){super(e,{type:Float32Array})}static fromCopyArray(e){return new a(new Float32Array(e).slice(0,4))}static fromCopyArray4(e){return new a(new Float32Array(e))}static fromCopy4(e,t,n,i){return new a(new Float32Array([e,t,n,i]))}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}get className(){return"MutableVector4"}clone(){return new this.constructor(new this._v.constructor([this._v[0],this._v[1],this._v[2],this._v[3]]))}}class r extends o{constructor(e){super(e,{type:Float64Array})}static zero(){return super._zero(Float64Array)}static one(){return super._one(Float64Array)}static dummy(){return super._dummy(Float64Array)}static normalize(e){return super._normalize(e,Float64Array)}static add(e,t){return super._add(e,t,Float64Array)}static subtract(e,t){return super._subtract(e,t,Float64Array)}static multiply(e,t){return super._multiply(e,t,Float64Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float64Array)}static divide(e,t){return super._divide(e,t,Float64Array)}static divideVector(e,t){return super._divideVector(e,t,Float64Array)}static fromCopyArray4(e){return new r(new Float64Array(e))}static fromCopyArray(e){return new r(new Float64Array(e.slice(0,4)))}static fromCopy4(e,t,n,i){return new r(new Float64Array([e,t,n,i]))}clone(){return super.clone()}}},9207:(e,t,n)=>{"use strict";n.d(t,{_:()=>l});var i=n(3032),o=n(810),a=n(3632),r=n(2471),s=n(9190);class l extends a.l{constructor(e){super(),this._v=e}get className(){return"Quaternion"}static get compositionType(){return o.d.Vec4}static identity(){return l.fromCopy4(0,0,0,1)}static dummy(){return new this(new Float32Array(0))}static invert(e){const t=e.length();if(0===t)return l.fromCopy4(0,0,0,0);const n=-e._v[0]/t,i=-e._v[1]/t,o=-e._v[2]/t,a=e._v[3]/t;return l.fromCopy4(n,i,o,a)}static invertTo(e,t){const n=e.length();return 0===n?t.setComponents(0,0,0,0):(t._v[0]=-e._v[0]/n,t._v[1]=-e._v[1]/n,t._v[2]=-e._v[2]/n,t._v[3]=e._v[3]/n,t)}static qlerp(e,t,n){let i=e._v[0]*t._v[0]+e._v[1]*t._v[1]+e._v[2]*t._v[2]+e._v[3]*t._v[3];if(0==1-i*i)return e.clone();{i>1?i=.999:i<-1&&(i=-.999);let o=Math.acos(i);const a=Math.sin(o);let r;i<0?(i*=-1,o=Math.acos(i),r=-1*Math.sin(o*n)/a):r=Math.sin(o*n)/a;const s=Math.sin(o*(1-n))/a;let c=e._v[0]*s+t._v[0]*r,_=e._v[1]*s+t._v[1]*r,h=e._v[2]*s+t._v[2]*r,u=e._v[3]*s+t._v[3]*r;const d=Math.hypot(c,_,h,u);return c/=d,_/=d,h/=d,u/=d,l.fromCopy4(c,_,h,u)}}static qlerpTo(e,t,n,i){let o=e._v[0]*t._v[0]+e._v[1]*t._v[1]+e._v[2]*t._v[2]+e._v[3]*t._v[3];if(0==1-o*o)return i.copyComponents(e);{o>1?o=.999:o<-1&&(o=-.999);let a=Math.acos(o);const r=Math.sin(a);let s;o<0?(o*=-1,a=Math.acos(o),s=-1*Math.sin(a*n)/r):s=Math.sin(a*n)/r;const l=Math.sin(a*(1-n))/r;i._v[0]=e._v[0]*l+t._v[0]*s,i._v[1]=e._v[1]*l+t._v[1]*s,i._v[2]=e._v[2]*l+t._v[2]*s,i._v[3]=e._v[3]*l+t._v[3]*s}return i.normalize()}static lerp(e,t,n){const i=e._v[0]*(1-n)+t._v[0]*n,o=e._v[1]*(1-n)+t._v[1]*n,a=e._v[2]*(1-n)+t._v[2]*n,r=e._v[3]*(1-n)+t._v[3]*n;return l.fromCopy4(i,o,a,r)}static lerpTo(e,t,n,i){return i._v[0]=e._v[0]*(1-n)+t._v[0]*n,i._v[1]=e._v[1]*(1-n)+t._v[1]*n,i._v[2]=e._v[2]*(1-n)+t._v[2]*n,i._v[3]=e._v[3]*(1-n)+t._v[3]*n,i}static axisAngle(e,t){const n=.5*t,i=Math.sin(n),o=e.length();return 0===o&&console.error("0 division occurred!"),l.fromCopy4(i*e._v[0]/o,i*e._v[1]/o,i*e._v[2]/o,Math.cos(n))}static fromMatrix(e){const t=l.fromCopy4(0,0,0,1),n=e.m00+e.m11+e.m22;if(n>0){const i=.5/Math.sqrt(n+1);t._v[3]=.25/i,t._v[0]=(e.m21-e.m12)*i,t._v[1]=(e.m02-e.m20)*i,t._v[2]=(e.m10-e.m01)*i}else if(e.m00>e.m11&&e.m00>e.m22){const n=2*Math.sqrt(1+e.m00-e.m11-e.m22);t._v[3]=(e.m21-e.m12)/n,t._v[0]=.25*n,t._v[1]=(e.m01+e.m10)/n,t._v[2]=(e.m02+e.m20)/n}else if(e.m11>e.m22){const n=2*Math.sqrt(1+e.m11-e.m00-e.m22);t._v[3]=(e.m02-e.m20)/n,t._v[0]=(e.m01+e.m10)/n,t._v[1]=.25*n,t._v[2]=(e.m12+e.m21)/n}else{const n=2*Math.sqrt(1+e.m22-e.m00-e.m11);t._v[3]=(e.m10-e.m01)/n,t._v[0]=(e.m02+e.m20)/n,t._v[1]=(e.m12+e.m21)/n,t._v[2]=.25*n}return t}static fromMatrixTo(e,t){const n=e.m00+e.m11+e.m22;if(n>0){const i=.5/Math.sqrt(n+1);t._v[3]=.25/i,t._v[0]=(e.m21-e.m12)*i,t._v[1]=(e.m02-e.m20)*i,t._v[2]=(e.m10-e.m01)*i}else if(e.m00>e.m11&&e.m00>e.m22){const n=2*Math.sqrt(1+e.m00-e.m11-e.m22);t._v[3]=(e.m21-e.m12)/n,t._v[0]=.25*n,t._v[1]=(e.m01+e.m10)/n,t._v[2]=(e.m02+e.m20)/n}else if(e.m11>e.m22){const n=2*Math.sqrt(1+e.m11-e.m00-e.m22);t._v[3]=(e.m02-e.m20)/n,t._v[0]=(e.m01+e.m10)/n,t._v[1]=.25*n,t._v[2]=(e.m12+e.m21)/n}else{const n=2*Math.sqrt(1+e.m22-e.m00-e.m11);t._v[3]=(e.m10-e.m01)/n,t._v[0]=(e.m02+e.m20)/n,t._v[1]=(e.m12+e.m21)/n,t._v[2]=.25*n}return t}static lookFromTo(e,t){return e.isEqual(t)?l.fromCopy4(0,0,0,1):this.qlerp(this.lookForward(e),this.lookForward(t),1)}static lookForward(e){return null==l.__tmp_upVec&&(l.__tmp_upVec=new e.constructor(0,1,0)),this.lookForwardAccordingToThisUp(e,l.__tmp_upVec)}static lookForwardAccordingToThisUp(e,t){const n=e.length();0===n&&console.error("0 division occurred!");const i=e._v[0]/n,o=e._v[1]/n,a=e._v[2]/n,r=t.length();0===r&&console.error("0 division occurred!");const s=t._v[0]/r,c=t._v[1]/r,_=t._v[2]/r;let h=t._v[1]*e._v[2]-t._v[2]*e._v[1],u=t._v[2]*e._v[0]-t._v[0]*e._v[2],d=t._v[0]*e._v[1]-t._v[1]*e._v[0];const m=Math.hypot(h,u,d);0===m&&console.error("0 division occurred!"),h/=m,u/=m,d/=m;const f=h,p=u,v=d,A=s,y=c,g=_,x=i,I=o,b=a,E=f+y+b;if(E>0){const e=Math.sqrt(E+1),t=.5/e;return l.fromCopy4((g-I)*t,(x-v)*t,(p-A)*t,.5*e)}if(f>=y&&f>=b){const e=Math.sqrt(1+f-y-b),t=.5/e;return l.fromCopy4(.5*e,(p+A)*t,(v+x)*t,(g-I)*t)}if(y>b){const e=Math.sqrt(1+y-f-b),t=.5/e;return l.fromCopy4((A+p)*t,.5*e,(I+g)*t,(x-v)*t)}{const e=Math.sqrt(1+b-f-y),t=.5/e;return l.fromCopy4((x+v)*t,(I+g)*t,.5*e,(p-A)*t)}}static fromPosition(e){return l.fromCopy4(e._v[0],e._v[1],e._v[2],0)}static add(e,t){const n=e._v[0]+t._v[0],i=e._v[1]+t._v[1],o=e._v[2]+t._v[2],a=e._v[3]+t._v[3];return l.fromCopy4(n,i,o,a)}static addTo(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n._v[2]=e._v[2]+t._v[2],n._v[3]=e._v[3]+t._v[3],n}static subtract(e,t){const n=e._v[0]-t._v[0],i=e._v[1]-t._v[1],o=e._v[2]-t._v[2],a=e._v[3]-t._v[3];return l.fromCopy4(n,i,o,a)}static subtractTo(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n._v[2]=e._v[2]-t._v[2],n._v[3]=e._v[3]-t._v[3],n}static multiply(e,t){const n=t._v[3]*e._v[0]+t._v[2]*e._v[1]-t._v[1]*e._v[2]+t._v[0]*e._v[3],i=-t._v[2]*e._v[0]+t._v[3]*e._v[1]+t._v[0]*e._v[2]+t._v[1]*e._v[3],o=t._v[1]*e._v[0]-t._v[0]*e._v[1]+t._v[3]*e._v[2]+t._v[2]*e._v[3],a=-t._v[0]*e._v[0]-t._v[1]*e._v[1]-t._v[2]*e._v[2]+t._v[3]*e._v[3];return l.fromCopy4(n,i,o,a)}static multiplyTo(e,t,n){const i=t._v[3]*e._v[0]+t._v[2]*e._v[1]-t._v[1]*e._v[2]+t._v[0]*e._v[3],o=-t._v[2]*e._v[0]+t._v[3]*e._v[1]+t._v[0]*e._v[2]+t._v[1]*e._v[3],a=t._v[1]*e._v[0]-t._v[0]*e._v[1]+t._v[3]*e._v[2]+t._v[2]*e._v[3],r=-t._v[0]*e._v[0]-t._v[1]*e._v[1]-t._v[2]*e._v[2]+t._v[3]*e._v[3];return n.setComponents(i,o,a,r)}static multiplyNumber(e,t){const n=e._v[0]*t,i=e._v[1]*t,o=e._v[2]*t,a=e._v[3]*t;return l.fromCopy4(n,i,o,a)}static multiplyNumberTo(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n._v[2]=e._v[2]*t,n._v[3]=e._v[3]*t,n}static divideNumber(e,t){0===t&&console.error("0 division occurred!");const n=e._v[0]/t,i=e._v[1]/t,o=e._v[2]/t,a=e._v[3]/t;return l.fromCopy4(n,i,o,a)}static divideNumberTo(e,t,n){return 0===t&&console.error("0 division occurred!"),n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t,n._v[2]=e._v[2]/t,n._v[3]=e._v[3]/t,n}toString(){return"("+this._v[0]+", "+this._v[1]+", "+this._v[2]+", "+this._v[3]+")"}toStringApproximately(){return i.k.financial(this._v[0])+" "+i.k.financial(this._v[1])+" "+i.k.financial(this._v[2])+" "+i.k.financial(this._v[3])+"\n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0])1?1:i,i=i<-1?-1:i,e._v[1]=Math.asin(i);const o=2*(this._v[3]*this._v[2]+this._v[0]*this._v[1]),a=1-2*(this._v[1]*this._v[1]+this._v[2]*this._v[2]);return e._v[2]=Math.atan2(o,a),e}toEulerAngles(){const e=new r.P(new Float32Array(3)),t=2*(this._v[3]*this._v[0]+this._v[1]*this._v[2]),n=1-2*(this._v[0]*this._v[0]+this._v[1]*this._v[1]);e._v[0]=Math.atan2(t,n);let i=2*(this._v[3]*this._v[1]-this._v[2]*this._v[0]);i=i>1?1:i,i=i<-1?-1:i,e._v[1]=Math.asin(i);const o=2*(this._v[3]*this._v[2]+this._v[0]*this._v[1]),a=1-2*(this._v[1]*this._v[1]+this._v[2]*this._v[2]);return e._v[2]=Math.atan2(o,a),e}static _divide(e,t){let n,i,o,a;return 0!==t?(n=e._v[0]/t,i=e._v[1]/t,o=e._v[2]/t,a=e._v[3]/t):(console.error("0 division occurred!"),n=1/0,i=1/0,o=1/0,a=1/0),l.fromCopy4(n,i,o,a)}static normalize(e){const t=e.length();return this._divide(e,t)}fromToRotation(e,t){const n=s.d6.fromCopyVector3(e),i=s.d6.fromCopyVector3(t);n.normalize(),i.normalize();const o=n.dot(i);if(o>-1+Number.EPSILON){const e=Math.sqrt(2*(1+o)),t=1/e,a=r.P.multiply(n.cross(i),t);return this._v[0]=a.x,this._v[1]=a.y,this._v[2]=a.z,this._v[3]=.5*e,l.normalize(this)}{let e=r.P.fromCopy3(0,1,0),t=n.cross(e);return t.length()-1+Number.EPSILON){const e=Math.sqrt(2*(1+o)),t=1/e,a=r.P.multiply(n.cross(i),t);return l.fromCopy4(a.x,a.y,a.z,.5*e)}{let e=r.P.fromCopy3(0,1,0),t=n.cross(e);return t.length(){"use strict";n.d(t,{Ru:()=>s,ap:()=>r,kO:()=>l});var i=n(3032),o=n(3343),a=n(810);class r extends o.O{constructor(e,{type:t}){super(),this._v=e}getValue(){return this._v[0]}getValueInArray(){return[this._v[0]]}get x(){return this._v[0]}get raw(){return this._v}isStrictEqual(e){return this.x===e.x}isEqual(e,t=Number.EPSILON){return Math.abs(e.x-this.x){"use strict";n.d(t,{EY:()=>l,FM:()=>s,HO:()=>c,ig:()=>_,pV:()=>r});var i=n(3032),o=n(810),a=n(3343);class r extends a.O{constructor(e,{type:t}){super(),this._v=e}get x(){return this._v[0]}get y(){return this._v[1]}get glslStrAsFloat(){return`vec2(${i.k.convertToStringAsGLSLFloat(this._v[0])}, ${i.k.convertToStringAsGLSLFloat(this._v[1])})`}get glslStrAsInt(){return`ivec2(${Math.floor(this._v[0])}, ${Math.floor(this._v[1])})`}static get compositionType(){return o.d.Vec2}static lengthSquared(e){return e.lengthSquared()}static lengthBtw(e,t){return e.lengthTo(t)}static angleOfVectors(e,t){const n=e.length()*t.length();0===n&&console.error("length of a vector is 0!");const i=e.dot(t)/n;return Math.acos(i)}static _zero(e){return this._fromCopyArray2([0,0],e)}static _one(e){return this._fromCopyArray2([1,1],e)}static _dummy(e){return new this(new e,{type:e})}static _normalize(e,t){const n=e.length();return this._divide(e,n,t)}static _add(e,t,n){const i=e._v[0]+t._v[0],o=e._v[1]+t._v[1];return this._fromCopyArray2([i,o],n)}static addTo(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n}static _subtract(e,t,n){const i=e._v[0]-t._v[0],o=e._v[1]-t._v[1];return this._fromCopyArray2([i,o],n)}static subtractTo(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n}static _multiply(e,t,n){const i=e._v[0]*t,o=e._v[1]*t;return this._fromCopyArray2([i,o],n)}static multiplyTo(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n}static _multiplyVector(e,t,n){const i=e._v[0]*t._v[0],o=e._v[1]*t._v[1];return this._fromCopyArray2([i,o],n)}static multiplyVectorTo(e,t,n){return n._v[0]=e._v[0]*t._v[0],n._v[1]=e._v[1]*t._v[1],n}static _divide(e,t,n){let i,o;return 0!==t?(i=e._v[0]/t,o=e._v[1]/t):(console.error("0 division occurred!"),i=1/0,o=1/0),this._fromCopyArray2([i,o],n)}static divideTo(e,t,n){return 0!==t?(n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t):(console.error("0 division occurred!"),n._v[0]=1/0,n._v[1]=1/0),n}static _divideVector(e,t,n){let i,o;return 0!==t._v[0]&&0!==t._v[1]?(i=e._v[0]/t._v[0],o=e._v[1]/t._v[1]):(console.error("0 division occurred!"),i=0===t._v[0]?1/0:e._v[0]/t._v[0],o=0===t._v[1]?1/0:e._v[1]/t._v[1]),this._fromCopyArray2([i,o],n)}static divideVectorTo(e,t,n){return 0!==t._v[0]&&0!==t._v[1]?(n._v[0]=e._v[0]/t._v[0],n._v[1]=e._v[1]/t._v[1]):(console.error("0 division occurred!"),n._v[0]=0===t._v[0]?1/0:e._v[0]/t._v[0],n._v[1]=0===t._v[1]?1/0:e._v[1]/t._v[1]),n}static dot(e,t){return e.dot(t)}toString(){return"("+this._v[0]+", "+this._v[1]+")"}toStringApproximately(){return i.k.financial(this._v[0])+" "+i.k.financial(this._v[1])+"\n"}flattenAsArray(){return[this._v[0],this._v[1]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){"use strict";n.d(t,{P:()=>s,R1:()=>_,UJ:()=>l,p8:()=>c,pg:()=>r});var i=n(3032),o=n(810),a=n(3343);class r extends a.O{constructor(e,{type:t}){super(),this._v=e}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return 1}get glslStrAsFloat(){return`vec3(${i.k.convertToStringAsGLSLFloat(this._v[0])}, ${i.k.convertToStringAsGLSLFloat(this._v[1])}, ${i.k.convertToStringAsGLSLFloat(this._v[2])})`}get glslStrAsInt(){return`ivec3(${Math.floor(this._v[0])}, ${Math.floor(this._v[1])}, ${Math.floor(this._v[2])})`}static get compositionType(){return o.d.Vec3}static lengthSquared(e){return e.lengthSquared()}static lengthBtw(e,t){return e.lengthTo(t)}static angleOfVectors(e,t){const n=e.length()*t.length();0===n&&console.error("length of a vector is 0!");const i=e.dot(t)/n;return Math.acos(i)}static _zero(e){return this._fromCopyArray([0,0,0],e)}static _one(e){return this._fromCopyArray([1,1,1],e)}static _dummy(e){return new this(new e([]),{type:e})}static _normalize(e,t){const n=e.length();return this._divide(e,n,t)}static _add(e,t,n){const i=e._v[0]+t._v[0],o=e._v[1]+t._v[1],a=e._v[2]+t._v[2];return this._fromCopyArray([i,o,a],n)}static addTo(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n._v[2]=e._v[2]+t._v[2],n}static _subtract(e,t,n){const i=e._v[0]-t._v[0],o=e._v[1]-t._v[1],a=e._v[2]-t._v[2];return this._fromCopyArray([i,o,a],n)}static subtractTo(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n._v[2]=e._v[2]-t._v[2],n}static _multiply(e,t,n){const i=e._v[0]*t,o=e._v[1]*t,a=e._v[2]*t;return this._fromCopyArray([i,o,a],n)}static multiplyTo(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n._v[2]=e._v[2]*t,n}static _multiplyVector(e,t,n){const i=e._v[0]*t._v[0],o=e._v[1]*t._v[1],a=e._v[2]*t._v[2];return this._fromCopyArray([i,o,a],n)}static multiplyVectorTo(e,t,n){return n._v[0]=e._v[0]*t._v[0],n._v[1]=e._v[1]*t._v[1],n._v[2]=e._v[2]*t._v[2],n}static _divide(e,t,n){let i,o,a;return 0!==t?(i=e._v[0]/t,o=e._v[1]/t,a=e._v[2]/t):(console.error("0 division occurred!"),i=1/0,o=1/0,a=1/0),this._fromCopyArray([i,o,a],n)}static divideTo(e,t,n){return 0!==t?(n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t,n._v[2]=e._v[2]/t):(console.error("0 division occurred!"),n._v[0]=1/0,n._v[1]=1/0,n._v[2]=1/0),n}static _divideVector(e,t,n){let i,o,a;return 0!==t._v[0]&&0!==t._v[1]&&0!==t._v[2]?(i=e._v[0]/t._v[0],o=e._v[1]/t._v[1],a=e._v[2]/t._v[2]):(console.error("0 division occurred!"),i=0===t._v[0]?1/0:e._v[0]/t._v[0],o=0===t._v[1]?1/0:e._v[1]/t._v[1],a=0===t._v[2]?1/0:e._v[2]/t._v[2]),this._fromCopyArray([i,o,a],n)}static divideVectorTo(e,t,n){return 0!==t._v[0]&&0!==t._v[1]&&0!==t._v[2]?(n._v[0]=e._v[0]/t._v[0],n._v[1]=e._v[1]/t._v[1],n._v[2]=e._v[2]/t._v[2]):(console.error("0 division occurred!"),n._v[0]=0===t._v[0]?1/0:e._v[0]/t._v[0],n._v[1]=0===t._v[1]?1/0:e._v[1]/t._v[1],n._v[2]=0===t._v[2]?1/0:e._v[2]/t._v[2]),n}static dot(e,t){return e.dot(t)}static _cross(e,t,n){const i=e._v[1]*t._v[2]-e._v[2]*t._v[1],o=e._v[2]*t._v[0]-e._v[0]*t._v[2],a=e._v[0]*t._v[1]-e._v[1]*t._v[0];return this._fromCopyArray([i,o,a],n)}static crossTo(e,t,n){const i=e._v[1]*t._v[2]-e._v[2]*t._v[1],o=e._v[2]*t._v[0]-e._v[0]*t._v[2],a=e._v[0]*t._v[1]-e._v[1]*t._v[0];return n.setComponents(i,o,a)}static _multiplyQuaternion(e,t,n){const i=2*e._v[0],o=2*e._v[1],a=2*e._v[2],r=e._v[0]*i,s=e._v[1]*o,l=e._v[2]*a,c=e._v[0]*o,_=e._v[0]*a,h=e._v[1]*a,u=e._v[3]*i,d=e._v[3]*o,m=e._v[3]*a,f=(1-(s+l))*t._v[0]+(c-m)*t._v[1]+(_+d)*t._v[2],p=(c+m)*t._v[0]+(1-(r+l))*t._v[1]+(h-u)*t._v[2],v=(_-d)*t._v[0]+(h+u)*t._v[1]+(1-(r+s))*t._v[2];return this._fromCopyArray([f,p,v],n)}static multiplyQuaternionTo(e,t,n){const i=2*e._v[0],o=2*e._v[1],a=2*e._v[2],r=e._v[0]*i,s=e._v[1]*o,l=e._v[2]*a,c=e._v[0]*o,_=e._v[0]*a,h=e._v[1]*a,u=e._v[3]*i,d=e._v[3]*o,m=e._v[3]*a,f=(1-(s+l))*t._v[0]+(c-m)*t._v[1]+(_+d)*t._v[2],p=(c+m)*t._v[0]+(1-(r+l))*t._v[1]+(h-u)*t._v[2],v=(_-d)*t._v[0]+(h+u)*t._v[1]+(1-(r+s))*t._v[2];return n.setComponents(f,p,v)}toString(){return"("+this._v[0]+", "+this._v[1]+", "+this._v[2]+")"}toStringApproximately(){return i.k.financial(this._v[0])+" "+i.k.financial(this._v[1])+" "+i.k.financial(this._v[2])+"\n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){"use strict";n.d(t,{GY:()=>h,Lt:()=>s,Tj:()=>l,cV:()=>_,n9:()=>c,rE:()=>r});var i=n(3032),o=n(810),a=n(3343);class r extends a.O{constructor(e,{type:t}){super(),this._v=e}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return this._v[3]}get glslStrAsFloat(){return`vec4(${i.k.convertToStringAsGLSLFloat(this._v[0])}, ${i.k.convertToStringAsGLSLFloat(this._v[1])}, ${i.k.convertToStringAsGLSLFloat(this._v[2])}, ${i.k.convertToStringAsGLSLFloat(this._v[3])})`}get glslStrAsInt(){return`ivec4(${Math.floor(this._v[0])}, ${Math.floor(this._v[1])}, ${Math.floor(this._v[2])}, ${Math.floor(this._v[3])})`}static _fromCopyArray4(e,t){return new this(new t(e),{type:t})}static _fromCopy4(e,t,n,i,o){return new this(new o([e,t,n,i]),{type:o})}static _fromCopyArray(e,t){return new this(new t(e.slice(0,4)),{type:t})}static _fromCopyVector4(e,t){return new this(new t([e._v[0],e._v[1],e._v[2],e._v[3]]),{type:t})}static _fromCopyVector3(e,t){return new this(new t([e._v[0],e._v[1],e._v[2],1]),{type:t})}static _fromVector2(e,t){return new this(new t([e._v[0],e._v[1],0,1]),{type:t})}static get compositionType(){return o.d.Vec4}static lengthSquared(e){return e.lengthSquared()}static lengthBtw(e,t){return e.lengthTo(t)}static _zero(e){return new this(new e([0,0,0,0]),{type:e})}static _one(e){return new this(new e([1,1,1,1]),{type:e})}static _dummy(e){return new this(new e([]),{type:e})}static _normalize(e,t){const n=e.length();return this._divide(e,n,t)}static _add(e,t,n){return new this(new n([e._v[0]+t._v[0],e._v[1]+t._v[1],e._v[2]+t._v[2],e._v[3]+t._v[3]]),{type:n})}static addTo(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n._v[2]=e._v[2]+t._v[2],n._v[3]=e._v[3]+t._v[3],n}static _subtract(e,t,n){return new this(new n([e._v[0]-t._v[0],e._v[1]-t._v[1],e._v[2]-t._v[2],e._v[3]-t._v[3]]),{type:n})}static subtractTo(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n._v[2]=e._v[2]-t._v[2],n._v[3]=e._v[3]-t._v[3],n}static _multiply(e,t,n){return new this(new n([e._v[0]*t,e._v[1]*t,e._v[2]*t,e._v[3]*t]),{type:n})}static multiplyTo(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n._v[2]=e._v[2]*t,n._v[3]=e._v[3]*t,n}static _multiplyVector(e,t,n){return new this(new n([e._v[0]*t._v[0],e._v[1]*t._v[1],e._v[2]*t._v[2],e._v[3]*t._v[3]]),{type:n})}static multiplyVectorTo(e,t,n){return n._v[0]=e._v[0]*t._v[0],n._v[1]=e._v[1]*t._v[1],n._v[2]=e._v[2]*t._v[2],n._v[3]=e._v[3]*t._v[3],n}static _divide(e,t,n){let i,o,a,r;return 0!==t?(i=e._v[0]/t,o=e._v[1]/t,a=e._v[2]/t,r=e._v[3]/t):(console.error("0 division occurred!"),i=1/0,o=1/0,a=1/0,r=1/0),new this(new n([i,o,a,r]),{type:n})}static divideTo(e,t,n){return 0!==t?(n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t,n._v[2]=e._v[2]/t,n._v[3]=e._v[3]/t):(console.error("0 division occurred!"),n._v[0]=1/0,n._v[1]=1/0,n._v[2]=1/0,n._v[3]=1/0),n}static _divideVector(e,t,n){let i,o,a,r;return 0!==t._v[0]&&0!==t._v[1]&&0!==t._v[2]&&0!==t._v[3]?(i=e._v[0]/t._v[0],o=e._v[1]/t._v[1],a=e._v[2]/t._v[2],r=e._v[3]/t._v[3]):(console.error("0 division occurred!"),i=0===t._v[0]?1/0:e._v[0]/t._v[0],o=0===t._v[1]?1/0:e._v[1]/t._v[1],a=0===t._v[2]?1/0:e._v[2]/t._v[2],r=0===t._v[3]?1/0:e._v[3]/t._v[3]),new this(new n([i,o,a,r]),{type:n})}static divideVectorTo(e,t,n){return 0!==t._v[0]&&0!==t._v[1]&&0!==t._v[2]&&0!==t._v[3]?(n._v[0]=e._v[0]/t._v[0],n._v[1]=e._v[1]/t._v[1],n._v[2]=e._v[2]/t._v[2],n._v[3]=e._v[3]/t._v[3]):(console.error("0 division occurred!"),n._v[0]=0===t._v[0]?1/0:e._v[0]/t._v[0],n._v[1]=0===t._v[1]?1/0:e._v[1]/t._v[1],n._v[2]=0===t._v[2]?1/0:e._v[2]/t._v[2],n._v[3]=0===t._v[3]?1/0:e._v[3]/t._v[3]),n}static dot(e,t){return e.dot(t)}toString(){return"("+this._v[0]+", "+this._v[1]+", "+this._v[2]+", "+this._v[3]+")"}toStringApproximately(){return i.k.financial(this._v[0])+" "+i.k.financial(this._v[1])+" "+i.k.financial(this._v[2])+" "+i.k.financial(this._v[3])+"\n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){"use strict";n.d(t,{j:()=>i});class i{constructor(e){this._v=e}}},4020:(e,t,n)=>{"use strict";n.d(t,{mN:()=>o.m,bC:()=>a,XA:()=>r.X,lJ:()=>s.l,Ox:()=>l.O,sZ:()=>c.s,tW:()=>h,SG:()=>d,zU:()=>u,ig:()=>F.ig,HO:()=>F.HO,R1:()=>B.R1,p8:()=>B.p8,GY:()=>_.GY,cV:()=>_.cV,n9:()=>_.n9,cm:()=>m.c,aq:()=>f.a,lW:()=>v,Db:()=>A.D,kj:()=>y.k,ak:()=>g.a,h:()=>x.h,Je:()=>I.J,CE:()=>E,l$:()=>S,f7:()=>C.f,xk:()=>w.x,ec:()=>R.e,yG:()=>P.y,DU:()=>D.DU,Et:()=>D.Et,$_:()=>D.$_,NR:()=>M.NR,el:()=>M.el,th:()=>M.th,d6:()=>b.d6,I1:()=>b.I1,oV:()=>b.oV,xQ:()=>T.xQ,e2:()=>T.e2,hn:()=>T.hn,_f:()=>p._,Ru:()=>N.Ru,ap:()=>N.ap,kO:()=>N.kO,WQ:()=>L,FM:()=>F.FM,pV:()=>F.pV,EY:()=>F.EY,P:()=>B.P,pg:()=>B.pg,UJ:()=>B.UJ,Lt:()=>_.Lt,rE:()=>_.rE,Tj:()=>_.Tj,j8:()=>G.j,Zz:()=>i.Zz,TL:()=>i.TL,RZ:()=>i.sZ,jI:()=>i.jI,F5:()=>i.F5,vP:()=>i.vP,to:()=>i.to,wr:()=>i.wr,nn:()=>i.nn,w0:()=>i.w0,GW:()=>i.GW,t5:()=>i.t5,vk:()=>i.vk,PF:()=>i.PF,Ff:()=>i.Ff,Up:()=>i.Up,Dq:()=>i.Dq,VI:()=>i.VI,hx:()=>i.hx,JI:()=>i.JI,fK:()=>i.fK,lx:()=>i.lx,ns:()=>i.ns,eI:()=>i.p8,n5:()=>i.n5,QU:()=>i.QU,Xg:()=>i.Xg,Rl:()=>i.Rl,_7:()=>i._7});var i=n(3991),o=n(2477);class a{constructor(){this._v=new Float32Array}isTheSourceSame(e){return this._v.buffer===e}}var r=n(8775),s=n(3632),l=n(3343),c=n(1162),_=n(7192);class h extends _.Lt{constructor(e){super(e)}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return this._v[3]}get r(){return this._v[0]}get g(){return this._v[1]}get b(){return this._v[2]}get a(){return this._v[3]}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}clone(){return super.clone()}static fromCopyArray(e){return this._fromCopyArray(e,Float32Array)}static fromCopyArray4(e){return this._fromCopyArray4(e,Float32Array)}static fromCopy4(e,t,n,i){return this._fromCopy4(e,t,n,i,Float32Array)}static fromCopyVector4(e){return this._fromCopyVector4(e,Float32Array)}}const u=new h(new Float32Array([1,1,1,1])),d=new h(new Float32Array([0,0,0,1]));var m=n(346),f=n(2086),p=n(9207);class v{constructor(e){this._v=e}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return 1}static fromFloat32Array(e){return new v(e)}static fromCopyArray3(e){return new p._(new Float32Array(e))}static fromCopyArray(e){return new p._(new Float32Array(e.slice(0,3)))}static fromCopy3(e,t,n){return new p._(new Float32Array([e,t,n]))}static fromCopyLogQuaternion(e){const t=new Float32Array(3);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],new p._(t)}static fromCopyVector4(e){const t=new Float32Array(3);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],new p._(t)}static fromCopyQuaternion(e){const t=Math.acos(e.w),n=Math.sin(t),i=new Float32Array(3);return i[0]=e.x*(t/n),i[1]=e.y*(t/n),i[2]=e.z*(t/n),new v(i)}get className(){return"LogQuaternion"}}var A=n(8547),y=n(3032),g=n(18),x=n(1937),I=n(5467),b=n(9190);class E extends b.d6{constructor(e){super(e)}get x(){return this._v[0]}set x(e){this._v[0]=e}get y(){return this._v[1]}set y(e){this._v[1]=e}get z(){return this._v[2]}set z(e){this._v[2]=e}get w(){return 1}get r(){return this._v[0]}set r(e){this._v[0]=e}get g(){return this._v[1]}set g(e){this._v[1]=e}get b(){return this._v[2]}set b(e){this._v[2]=e}get a(){return 1}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}static cross(e,t){return super._cross(e,t,Float32Array)}clone(){return super.clone()}}var T=n(4536);class S extends T.xQ{constructor(e){super(e)}get x(){return this._v[0]}set x(e){this._v[0]=e}get y(){return this._v[1]}set y(e){this._v[1]=e}get z(){return this._v[2]}set z(e){this._v[2]=e}get w(){return this._v[3]}set w(e){this._v[3]=e}get r(){return this._v[0]}set r(e){this._v[0]=e}get g(){return this._v[1]}set g(e){this._v[1]=e}get b(){return this._v[2]}set b(e){this._v[2]=e}get a(){return this._v[3]}set a(e){this._v[3]=e}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}clone(){return super.clone()}}var C=n(7035),w=n(2566),R=n(3496),P=n(963),D=n(4267),M=n(8182),N=n(3616),B=n(2471);class L{constructor(e){this.__is_position_updated=!0,this.__is_scale_updated=!0,this.__is_rotation_updated=!0,this.__is_trs_matrix_updated=!0,this.__updateCount=0,this.__position=b.d6.dummy(),this.__scale=b.d6.dummy(),this.__rotation=P.y.dummy(),this.__matrix=R.e.dummy(),void 0!==e?this.setTransform(e.positionInner,b.d6.fromCopyVector3(e.eulerAnglesInner),e.scaleInner,P.y.fromCopyQuaternion(e.rotationInner),e.matrixInner):(this.__position=b.d6.zero(),this.__scale=b.d6.one(),this.__rotation=P.y.identity(),this.__matrix=R.e.identity())}clone(){return new L(this)}set position(e){this.__position.copyComponents(e),this.__is_position_updated=!0,this.__is_trs_matrix_updated=!1,this.__updateTransform()}get position(){return this.positionInner.clone()}get positionInner(){return this.__is_position_updated||this.__is_trs_matrix_updated&&(this.__matrix.getTranslateTo(this.__position),this.__is_position_updated=!0),this.__position}set eulerAngles(e){const t=Math.sin(.5*e._v[0]),n=Math.cos(.5*e._v[0]),i=Math.sin(.5*e._v[1]),o=Math.cos(.5*e._v[1]),a=Math.sin(.5*e._v[2]),r=Math.cos(.5*e._v[2]);this.rotation=P.y.fromCopy4(t*o*r-n*i*a,n*i*r+t*o*a,n*o*a-t*i*r,n*o*r+t*i*a)}get eulerAngles(){return this.eulerAnglesInner.clone()}get eulerAnglesInner(){return this.__rotation.toEulerAngles()}set scale(e){this.__scale.copyComponents(e),this.__is_scale_updated=!0,this.__is_trs_matrix_updated=!1,this.__updateTransform()}get scale(){return this.scaleInner.clone()}get scaleInner(){return this.__is_scale_updated||this.__is_trs_matrix_updated&&(this.__matrix.getScaleTo(this.__scale),this.__is_scale_updated=!0),this.__scale}set rotation(e){this.__rotation.copyComponents(e),this.__is_rotation_updated=!0,this.__is_trs_matrix_updated=!1,this.__updateTransform()}get rotation(){return this.rotationInner.clone()}get rotationInner(){return this.__is_rotation_updated?this.__rotation:!this.__is_rotation_updated&&this.__is_trs_matrix_updated?(this.__is_rotation_updated=!0,this.__rotation.fromMatrix(this.__matrix),this.__rotation):this.__rotation}__updateTransform(){this.__updateEulerAngles(),this.__updatePosition(),this.__updateScale(),this.__needUpdate()}__updateEulerAngles(){!this.__is_rotation_updated&&this.__is_trs_matrix_updated&&(this.__rotation.fromMatrix(this.__matrix),this.__is_rotation_updated=!0)}__updatePosition(){!this.__is_position_updated&&this.__is_trs_matrix_updated&&(this.__matrix.getTranslateTo(this.__position),this.__is_position_updated=!0)}__updateScale(){!this.__is_scale_updated&&this.__is_trs_matrix_updated&&(this.__matrix.getScaleTo(this.__scale),this.__is_scale_updated=!0)}__updateMatrix(){if(!this.__is_trs_matrix_updated&&this.__is_position_updated&&this.__is_rotation_updated&&this.__is_scale_updated){const e=this.__matrix.fromQuaternion(this.__rotation),t=L.__tmpMatrix44_0.scale(this.__scale);e.multiply(t).putTranslate(this.__position),this.__is_trs_matrix_updated=!0}}set matrix(e){this.__matrix.copyComponents(e),this.__is_trs_matrix_updated=!0,this.__is_position_updated=!1,this.__is_rotation_updated=!1,this.__is_scale_updated=!1,this.__updateTransform()}get matrix(){return this.matrixInner.clone()}get matrixInner(){if(this.__is_trs_matrix_updated)return this.__matrix;const e=this.scaleInner,t=e._v[0],n=e._v[1],i=e._v[2],o=this.rotationInner,a=o._v[0]*o._v[0],r=o._v[1]*o._v[1],s=o._v[2]*o._v[2],l=o._v[1]*o._v[2],c=o._v[0]*o._v[2],_=o._v[0]*o._v[1],h=o._v[3]*o._v[0],u=o._v[3]*o._v[1],d=o._v[3]*o._v[2],m=1-2*(r+s),f=2*(_-d),p=2*(c+u),v=2*(_+d),A=1-2*(a+s),y=2*(l-h),g=2*(c-u),x=2*(l+h),I=1-2*(a+r),b=this.positionInner;return this.__matrix.m00=m*t,this.__matrix.m01=f*n,this.__matrix.m02=p*i,this.__matrix.m03=b.x,this.__matrix.m10=v*t,this.__matrix.m11=A*n,this.__matrix.m12=y*i,this.__matrix.m13=b.y,this.__matrix.m20=g*t,this.__matrix.m21=x*n,this.__matrix.m22=I*i,this.__matrix.m23=b.z,this.__matrix.m30=0,this.__matrix.m31=0,this.__matrix.m32=0,this.__matrix.m33=1,this.__is_trs_matrix_updated=!0,this.__matrix}__needUpdate(){this.__updateCount++}get updateCount(){return this.__updateCount}set rotateMatrix44(e){this.rotation=L.__tmpQuaternion_0.fromMatrix(e)}get rotateMatrix44(){return I.J.fromCopyQuaternion(this.rotation)}setPropertiesFromJson(e){let t=e;"string"==typeof e&&(t=JSON.parse(e));for(const e in t)t.hasOwnProperty(e)&&e in this&&("quaternion"===e?this.rotation=p._.fromCopyArray4(t[e]):this[e]="matrix"===e?I.J.fromCopyArray16RowMajor(t[e]):B.P.fromCopyArray(t[e]))}setRotationFromNewUpAndFront(e,t){const n=e,i=b.d6.crossTo(n,t,L.__tmpVector3_0),o=b.d6.crossTo(i,n,L.__tmpVector3_1),a=L.__tmpMatrix44_0.setComponents(i.x,n.x,o.x,0,i.y,n.y,o.y,0,i.z,n.z,o.z,0,0,0,0,1);this.rotateMatrix44=a}headToDirection(e,t){const n=L.__tmpVector3_0.copyComponents(e).normalize(),i=L.__tmpVector3_1.copyComponents(t).normalize(),o=b.d6.crossTo(n,i,L.__tmpVector3_2),a=B.P.dot(n,i),r=Math.acos(a);this.rotation=L.__tmpQuaternion_0.axisAngle(o,r)}setTransform(e,t,n,i,o){this.__is_trs_matrix_updated=!1,null!=o&&(this.__matrix=o.clone(),this.__is_trs_matrix_updated=!0,this.__is_position_updated=!1,this.__is_rotation_updated=!1,this.__is_scale_updated=!1),null!=e&&(this.__position=e.clone(),this.__is_position_updated=!0),null!=t&&null!=i?(this.__rotation=i.clone(),this.__is_rotation_updated=!0):null!=t?this.__is_rotation_updated=!1:null!=i&&(this.__rotation=i.clone(),this.__is_rotation_updated=!0),null!=n&&(this.__scale=n.clone(),this.__is_scale_updated=!0),this.__updateTransform()}}L.__tmpMatrix44_0=R.e.zero(),L.__tmpVector3_0=b.d6.zero(),L.__tmpVector3_1=b.d6.zero(),L.__tmpVector3_2=b.d6.zero(),L.__tmpQuaternion_0=P.y.identity();var F=n(2390),G=n(4255)},3991:(e,t,n)=>{"use strict";n.d(t,{Dq:()=>h,F5:()=>x,Ff:()=>c,GW:()=>a,JI:()=>m,PF:()=>l,QU:()=>T,Rl:()=>C,TL:()=>A,Up:()=>_,VI:()=>u,Xg:()=>D,Zz:()=>v,_7:()=>w,fK:()=>f,hx:()=>d,jI:()=>g,lx:()=>p,n5:()=>E,nn:()=>i,ns:()=>I,p8:()=>b,sZ:()=>y,t5:()=>r,to:()=>R,vP:()=>S,vk:()=>s,w0:()=>o,wr:()=>P});const i=Symbol("get1"),o=Symbol("get1_offset"),a=Symbol("get1_offsetAsComposition"),r=Symbol("get2"),s=Symbol("get2_offset"),l=Symbol("get2_offsetAsComposition"),c=Symbol("get3"),_=Symbol("get3_offset"),h=Symbol("get3_offsetAsComposition"),u=Symbol("get4"),d=Symbol("get4_offset"),m=Symbol("get4_offsetAsComposition"),f=Symbol("getN_offset"),p=Symbol("getN_offsetAsComposition"),v=Symbol("add2"),A=Symbol("add2_offset"),y=Symbol("add3"),g=Symbol("add3_offset"),x=Symbol("add4"),I=Symbol("mulArray3WithScalar_offset"),b=Symbol("mulArray4WithScalar_offset"),E=Symbol("mulArrayNWithScalar_offset"),T=Symbol("mulThatAndThisToOutAsMat44_offsetAsComposition"),S=Symbol("add4_offset"),C=Symbol("qlerp_offsetAsComposition"),w=Symbol("scalar_lerp_offsetAsComposition"),R=Symbol("array3_lerp_offsetAsComposition"),P=Symbol("arrayN_lerp_offsetAsComposition"),D=Symbol("normalizeArray4"),M=[Array,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array],N=[a,l,i,o,r,s,c,_,h,u,d,m,f,p,v,A,y,g,x,S,I,b,E,T,C,w,R,P,D],B=[function(e){return[this[e]]},function(e){return[this[2*e],this[2*e+1]]},function(){return[this[0]]},function(e){return[this[e]]},function(){return[this[0],this[1]]},function(e){return[this[e],this[e+1]]},function(){return[this[0],this[1],this[2]]},function(e){return[this[e],this[e+1],this[e+2]]},function(e){return[this[3*e],this[3*e+1],this[3*e+2]]},function(){return[this[0],this[1],this[2],this[3]]},function(e){return[this[e],this[e+1],this[e+2],this[e+3]]},function(e){return[this[4*e],this[4*e+1],this[4*e+2],this[4*e+3]]},function(e,t){const n=new Array(t);for(let i=0;i1?a=.999:a<-1&&(a=-.999);let r=Math.acos(a);const s=Math.sin(r);let l;a<0?(a*=-1,r=Math.acos(a),l=-1*Math.sin(r*t)/s):l=Math.sin(r*t)/s;const c=Math.sin(r*(1-t))/s;o[0]=this[0+4*n]*c+e[0+4*i]*l,o[1]=this[1+4*n]*c+e[1+4*i]*l,o[2]=this[2+4*n]*c+e[2+4*i]*l,o[3]=this[3+4*n]*c+e[3+4*i]*l}return o},function(e,t,n,i){return this[n]*(1-t)+e[i]*t},function(e,t,n,i){const o=new Array(3);for(let a=0;a<3;a++)o[a]=this[3*n+a]*(1-t)+e[3*i+a]*t;return o},function(e,t,n,i,o){const a=new Array(t);for(let r=0;r{"use strict";n.d(t,{U:()=>m});var i=n(3999),o=n(810),a=n(2390),r=n(2471),s=n(7192),l=n(8182),c=n(9190),_=n(4536),h=n(1937),u=n(3496),d=n(4690);class m{constructor({bufferView:e,byteOffsetInBufferView:t,compositionType:n,componentType:a,byteStride:r,count:s,raw:l,max:c,min:h,arrayLength:u,normalized:m}){var f,p,v,A,y,g,x,I;this.__compositionType=o.d.Unknown,this.__componentType=i.r.Unknown,this.__count=0,this.__takenCount=0,this.__byteStride=0,this.__max=_.xQ.fromCopyArray([-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]),this.__min=_.xQ.fromCopyArray([Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE]),this.__arrayLength=1,this.__normalized=!1,this.__isMinMixDirty=!0,this.__version=0,this.__bufferView=e,this.__byteOffsetInRawArrayBufferOfBuffer=e.byteOffsetInRawArrayBufferOfBuffer+t,this.__compositionType=n,this.__componentType=a,this.__count=s,this.__arrayLength=u,d.Is.exist(c)&&this.__max.setComponents(null!==(f=c[0])&&void 0!==f?f:-Number.MAX_VALUE,null!==(p=c[1])&&void 0!==p?p:-Number.MAX_VALUE,null!==(v=c[2])&&void 0!==v?v:-Number.MAX_VALUE,null!==(A=c[3])&&void 0!==A?A:-Number.MAX_VALUE),d.Is.exist(h)&&this.__min.setComponents(null!==(y=h[0])&&void 0!==y?y:Number.MAX_VALUE,null!==(g=h[1])&&void 0!==g?g:Number.MAX_VALUE,null!==(x=h[2])&&void 0!==x?x:Number.MAX_VALUE,null!==(I=h[3])&&void 0!==I?I:Number.MAX_VALUE),d.Is.exist(c)&&d.Is.exist(h)&&(this.__isMinMixDirty=!1),this.__raw=l,this.__normalized=m,this.__byteStride=r,0===this.__byteStride&&(this.__byteStride=this.__compositionType.getNumberOfComponents()*this.__componentType.getSizeInBytes()*this.__arrayLength);const b=this.getTypedArrayClass(this.__componentType);this.__typedArrayClass=b;const E=this.__byteStride-this.__compositionType.getNumberOfComponents()*this.__componentType.getSizeInBytes(),T=this.__raw.byteLength-this.__byteOffsetInRawArrayBufferOfBuffer,S=this.byteStride*this.__count-E;T=this.__count&&console.error("You are trying to allocate more than you have secured.");const t=new this.__typedArrayClass(e,this.__byteOffsetInRawArrayBufferOfBuffer+this.__byteStride*this.__takenCount,this.__compositionType.getNumberOfComponents()*this.__arrayLength);return t._accessor=this,t._idx_of_accessor=this.__takenCount,this.__takenCount+=1,t}_takeExistedOne(e){const t=this.__raw;e>=this.__count&&console.error("You are trying to allocate more than you have secured.");const n=new this.__typedArrayClass(t,this.__byteOffsetInRawArrayBufferOfBuffer+this.__byteStride*e,this.__compositionType.getNumberOfComponents()*this.__arrayLength);return n._accessor=this,n._idx_of_accessor=e,n}get takenCount(){return this.takenCount}get numberOfComponents(){return this.__compositionType.getNumberOfComponents()}get componentSizeInBytes(){return this.__componentType.getSizeInBytes()}get elementSizeInBytes(){return this.numberOfComponents*this.componentSizeInBytes}get elementCount(){return this.__count}get byteLength(){return this.__byteStride*this.__count}get componentType(){return this.__componentType}get compositionType(){return this.__compositionType}getTypedArray(){return this.__typedArray}getUint8Array(){return new Uint8Array(this.bufferView.buffer.getArrayBuffer(),this.byteOffsetInRawArrayBufferOfBuffer,this.byteLength)}get isAoS(){return!this.isSoA}get isSoA(){return this.byteStride===this.__compositionType.getNumberOfComponents()*this.__componentType.getSizeInBytes()}get byteStride(){return this.__byteStride}getScalar(e,{indicesAccessor:t,endian:n=!0}){let i=e;return t&&(i=t.getScalar(e,{})),this.__dataViewGetter(this.__byteStride*i,n)}getScalarAt(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;return n&&(o=n.getScalar(e,{})),this.__dataViewGetter(this.__byteStride*o+t,i)}getVec2AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n)]}getVec3AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n)]}getVec4AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n)]}getMat3AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n),this.__dataViewGetter(this.__byteStride*i+4*o,n),this.__dataViewGetter(this.__byteStride*i+5*o,n),this.__dataViewGetter(this.__byteStride*i+6*o,n),this.__dataViewGetter(this.__byteStride*i+7*o,n),this.__dataViewGetter(this.__byteStride*i+8*o,n)]}getMat4AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n),this.__dataViewGetter(this.__byteStride*i+4*o,n),this.__dataViewGetter(this.__byteStride*i+5*o,n),this.__dataViewGetter(this.__byteStride*i+6*o,n),this.__dataViewGetter(this.__byteStride*i+7*o,n),this.__dataViewGetter(this.__byteStride*i+8*o,n),this.__dataViewGetter(this.__byteStride*i+9*o,n),this.__dataViewGetter(this.__byteStride*i+10*o,n),this.__dataViewGetter(this.__byteStride*i+11*o,n),this.__dataViewGetter(this.__byteStride*i+12*o,n),this.__dataViewGetter(this.__byteStride*i+13*o,n),this.__dataViewGetter(this.__byteStride*i+14*o,n),this.__dataViewGetter(this.__byteStride*i+15*o,n)]}getVec2(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return a.FM.fromCopyArray2([this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n)])}getVec3(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return r.P.fromCopyArray([this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n)])}getVec4(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return s.Lt.fromCopyArray([this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n)])}getMat3(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return h.h.fromCopy9RowMajor(this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n),this.__dataViewGetter(this.__byteStride*i+4*o,n),this.__dataViewGetter(this.__byteStride*i+5*o,n),this.__dataViewGetter(this.__byteStride*i+6*o,n),this.__dataViewGetter(this.__byteStride*i+7*o,n),this.__dataViewGetter(this.__byteStride*i+8*o,n))}getMat4(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return u.e.fromCopy16RowMajor(this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n),this.__dataViewGetter(this.__byteStride*i+4*o,n),this.__dataViewGetter(this.__byteStride*i+5*o,n),this.__dataViewGetter(this.__byteStride*i+6*o,n),this.__dataViewGetter(this.__byteStride*i+7*o,n),this.__dataViewGetter(this.__byteStride*i+8*o,n),this.__dataViewGetter(this.__byteStride*i+9*o,n),this.__dataViewGetter(this.__byteStride*i+10*o,n),this.__dataViewGetter(this.__byteStride*i+11*o,n),this.__dataViewGetter(this.__byteStride*i+12*o,n),this.__dataViewGetter(this.__byteStride*i+13*o,n),this.__dataViewGetter(this.__byteStride*i+14*o,n),this.__dataViewGetter(this.__byteStride*i+15*o,n))}getVec2To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i))}getVec3To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i),this.__dataViewGetter(this.__byteStride*o+2*a,i))}getVec4To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i),this.__dataViewGetter(this.__byteStride*o+2*a,i),this.__dataViewGetter(this.__byteStride*o+3*a,i))}getMat3To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i),this.__dataViewGetter(this.__byteStride*o+2*a,i),this.__dataViewGetter(this.__byteStride*o+3*a,i),this.__dataViewGetter(this.__byteStride*o+4*a,i),this.__dataViewGetter(this.__byteStride*o+5*a,i),this.__dataViewGetter(this.__byteStride*o+6*a,i),this.__dataViewGetter(this.__byteStride*o+7*a,i),this.__dataViewGetter(this.__byteStride*o+8*a,i))}getMat4To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i),this.__dataViewGetter(this.__byteStride*o+2*a,i),this.__dataViewGetter(this.__byteStride*o+3*a,i),this.__dataViewGetter(this.__byteStride*o+4*a,i),this.__dataViewGetter(this.__byteStride*o+5*a,i),this.__dataViewGetter(this.__byteStride*o+6*a,i),this.__dataViewGetter(this.__byteStride*o+7*a,i),this.__dataViewGetter(this.__byteStride*o+8*a,i),this.__dataViewGetter(this.__byteStride*o+9*a,i),this.__dataViewGetter(this.__byteStride*o+10*a,i),this.__dataViewGetter(this.__byteStride*o+11*a,i),this.__dataViewGetter(this.__byteStride*o+12*a,i),this.__dataViewGetter(this.__byteStride*o+13*a,i),this.__dataViewGetter(this.__byteStride*o+14*a,i),this.__dataViewGetter(this.__byteStride*o+15*a,i))}setScalar(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{})),this.__dataViewSetter(this.__byteStride*o,t,i),this.__isMinMixDirty=!0,this.__version++}setVec2(e,t,n,{indicesAccessor:i,endian:o=!0}){let a=e;i&&(a=i.getScalar(e,{}));const r=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*a,t,o),this.__dataViewSetter(this.__byteStride*a+1*r,n,o),this.__isMinMixDirty=!0,this.__version++}setVec3(e,t,n,i,{indicesAccessor:o,endian:a=!0}){let r=e;o&&(r=o.getScalar(e,{}));const s=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*r,t,a),this.__dataViewSetter(this.__byteStride*r+1*s,n,a),this.__dataViewSetter(this.__byteStride*r+2*s,i,a),this.__isMinMixDirty=!0,this.__version++}setVec4(e,t,n,i,o,{indicesAccessor:a,endian:r=!0}){let s=e;a&&(s=a.getScalar(e,{}));const l=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*s,t,r),this.__dataViewSetter(this.__byteStride*s+1*l,n,r),this.__dataViewSetter(this.__byteStride*s+2*l,i,r),this.__dataViewSetter(this.__byteStride*s+3*l,o,r),this.__isMinMixDirty=!0,this.__version++}setMat4(e,t,n,i,o,a,r,s,l,c,_,h,u,d,m,f,p,{indicesAccessor:v,endian:A=!0}){let y=e;v&&(y=v.getScalar(e,{}));const g=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*y,t,A),this.__dataViewSetter(this.__byteStride*y+1*g,n,A),this.__dataViewSetter(this.__byteStride*y+2*g,i,A),this.__dataViewSetter(this.__byteStride*y+3*g,o,A),this.__dataViewSetter(this.__byteStride*y+4*g,a,A),this.__dataViewSetter(this.__byteStride*y+5*g,r,A),this.__dataViewSetter(this.__byteStride*y+6*g,s,A),this.__dataViewSetter(this.__byteStride*y+7*g,l,A),this.__dataViewSetter(this.__byteStride*y+8*g,c,A),this.__dataViewSetter(this.__byteStride*y+9*g,_,A),this.__dataViewSetter(this.__byteStride*y+10*g,h,A),this.__dataViewSetter(this.__byteStride*y+11*g,u,A),this.__dataViewSetter(this.__byteStride*y+12*g,d,A),this.__dataViewSetter(this.__byteStride*y+13*g,m,A),this.__dataViewSetter(this.__byteStride*y+14*g,f,A),this.__dataViewSetter(this.__byteStride*y+15*g,p,A),this.__isMinMixDirty=!0,this.__version++}setVec2AsVector(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*o,t.x,i),this.__dataViewSetter(this.__byteStride*o+1*a,t.y,i),this.__isMinMixDirty=!0,this.__version++}setVec3AsVector(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*o,t.x,i),this.__dataViewSetter(this.__byteStride*o+1*a,t.y,i),this.__dataViewSetter(this.__byteStride*o+2*a,t.z,i),this.__isMinMixDirty=!0,this.__version++}setVec4AsVector(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*o,t.x,i),this.__dataViewSetter(this.__byteStride*o+1*a,t.y,i),this.__dataViewSetter(this.__byteStride*o+2*a,t.z,i),this.__dataViewSetter(this.__byteStride*o+3*a,t.w,i),this.__isMinMixDirty=!0,this.__version++}setMat4AsMatrix44(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*o,t._v[0],i),this.__dataViewSetter(this.__byteStride*o+1*a,t._v[1],i),this.__dataViewSetter(this.__byteStride*o+2*a,t._v[2],i),this.__dataViewSetter(this.__byteStride*o+3*a,t._v[3],i),this.__dataViewSetter(this.__byteStride*o+4*a,t._v[4],i),this.__dataViewSetter(this.__byteStride*o+5*a,t._v[5],i),this.__dataViewSetter(this.__byteStride*o+6*a,t._v[6],i),this.__dataViewSetter(this.__byteStride*o+7*a,t._v[7],i),this.__dataViewSetter(this.__byteStride*o+8*a,t._v[8],i),this.__dataViewSetter(this.__byteStride*o+9*a,t._v[9],i),this.__dataViewSetter(this.__byteStride*o+10*a,t._v[10],i),this.__dataViewSetter(this.__byteStride*o+11*a,t._v[11],i),this.__dataViewSetter(this.__byteStride*o+12*a,t._v[12],i),this.__dataViewSetter(this.__byteStride*o+13*a,t._v[13],i),this.__dataViewSetter(this.__byteStride*o+14*a,t._v[14],i),this.__dataViewSetter(this.__byteStride*o+15*a,t._v[15],i),this.__isMinMixDirty=!0,this.__version++}copyFromTypedArray(e){const t=this.numberOfComponents;for(let n=0;n{"use strict";n.d(t,{l:()=>l});var i=n(1050),o=n(810),a=n(3999),r=n(3449),s=n(2253);class l{constructor({byteLength:e,buffer:t,name:n,byteAlign:i}){this.__byteLength=0,this.__byteOffset=0,this.__takenBytesIndex=0,this.__name="",this.__bufferViews=[],this.__name=n,this.__byteLength=e,this.__byteAlign=i,t instanceof Uint8Array?(this.__raw=t.buffer,this.__byteOffset=t.byteOffset):this.__raw=t}set name(e){this.__name=e}get name(){return this.__name}getArrayBuffer(){return this.__raw}__padding(e,t){const n=r.j.calcPaddingBytes(e,t);return n>0&&console.info("Padding bytes added to takenBytesIndex."),n}takeBufferView({byteLengthToNeed:e,byteStride:t}){const n=e;if(n+this.__takenBytesIndex>this.byteLength){const e=`The size of the BufferView you are trying to take exceeds the byte length left in the Buffer.\nBuffer.byteLength: ${this.byteLength}, Buffer.takenSizeInByte: ${this.takenSizeInByte},\nbyteSizeToTake: ${n}, the byte length left in the Buffer: ${this.__byteLength-this.__takenBytesIndex}`;return new s.UG({message:e,error:void 0})}const o=new i.q({buffer:this,byteOffsetInBuffer:this.__takenBytesIndex,defaultByteStride:t,byteLength:n,raw:this.__raw});return this.__takenBytesIndex+=n,this.__takenBytesIndex=r.j.addPaddingBytes(this.__takenBytesIndex,this.__byteAlign),this.__bufferViews.push(o),new s.Ok(o)}takeBufferViewWithByteOffset({byteLengthToNeed:e,byteStride:t,byteOffset:n}){if(e+n>this.byteLength){const t=`The size of the BufferView you are trying to take exceeds the byte length left in the Buffer.\nBuffer.byteLength: ${this.byteLength}, Buffer.takenSizeInByte: ${this.takenSizeInByte},\nbyteSizeToTake: ${e}, the byte length left in the Buffer: ${this.__byteLength-this.__takenBytesIndex}`;return new s.UG({message:t,error:void 0})}const o=new i.q({buffer:this,byteOffsetInBuffer:n,defaultByteStride:t,byteLength:e,raw:this.__raw}),a=Uint8Array.BYTES_PER_ELEMENT*e+n;return this.__takenBytesIndex{"use strict";n.d(t,{q:()=>a});var i=n(5519),o=n(2253);class a{constructor({buffer:e,byteOffsetInBuffer:t,defaultByteStride:n,byteLength:i,raw:o}){this.__defaultByteStride=0,this.__takenByte=0,this.__takenAccessorCount=0,this.__accessors=[],this.__buffer=e,this.__byteOffsetInBuffer=t,this.__byteOffsetInRawArrayBufferOfBuffer=e.byteOffsetInRawArrayBuffer+t,this.__byteLength=i,this.__defaultByteStride=n,this.__raw=o}get defaultByteStride(){return this.__defaultByteStride}get byteLength(){return this.__byteLength}get byteOffsetInBuffer(){return this.__byteOffsetInRawArrayBufferOfBuffer-this.__buffer.byteOffsetInRawArrayBuffer}get byteOffsetInRawArrayBufferOfBuffer(){return this.__byteOffsetInRawArrayBufferOfBuffer}get buffer(){return this.__buffer}get isSoA(){return!this.isAoS}get isAoS(){for(const e of this.__accessors)if(e.isAoS)return!0;return!1}getUint8Array(){return new Uint8Array(this.__raw,this.__byteOffsetInRawArrayBufferOfBuffer,this.__byteLength)}takeAccessor({compositionType:e,componentType:t,count:n,byteStride:i=this.defaultByteStride,max:o,min:a,arrayLength:r=1,normalized:s=!1}){return this.__takeAccessorInner({compositionType:e,componentType:t,count:n,byteStride:i,max:o,min:a,normalized:s,arrayLength:r})}takeAccessorWithByteOffset({compositionType:e,componentType:t,count:n,byteOffsetInBufferView:i,byteStride:o=this.defaultByteStride,max:a,min:r,normalized:s=!1}){return this.__takeAccessorInnerWithByteOffset({compositionType:e,componentType:t,count:n,byteStride:o,byteOffsetInBufferView:i,max:a,min:r,normalized:s})}__takeAccessorInner({compositionType:e,componentType:t,count:n,byteStride:a,max:r,min:s,arrayLength:l,normalized:c}){const _=this.__takenByte;let h=a;if(0===h&&(h=e.getNumberOfComponents()*t.getSizeInBytes()*l),this.__takenByte+h*(n-1)+t.getSizeInBytes()*e.getNumberOfComponents()>this.byteLength){const e=`The size of the Accessor you are trying to take exceeds the byte length left in the BufferView.\nBufferView.byteLength: ${this.byteLength}, BufferView.takenSizeInByte: ${this.__takenByte}, Accessor.byteStride: ${a}, Accessor.count: ${n};\nbyteSizeToTake: ${h*n}, the byte length left in the Buffer: ${this.byteLength-this.__takenByte}`;return new o.UG({message:e,error:void 0})}const u=new i.U({bufferView:this,byteOffsetInBufferView:_,compositionType:e,componentType:t,byteStride:a,count:n,raw:this.__raw,max:r,min:s,arrayLength:l,normalized:c});return this.__accessors.push(u),this.__takenByte+=h*n,new o.Ok(u)}__takeAccessorInnerWithByteOffset({compositionType:e,componentType:t,count:n,byteStride:a,byteOffsetInBufferView:r,max:s,min:l,normalized:c}){if(this.__takenByte+a*(n-1)+t.getSizeInBytes()*e.getNumberOfComponents()>this.byteLength){const e=`The size of the Accessor you are trying to take exceeds the byte length left in the BufferView.\nBufferView.byteLength: ${this.byteLength}, BufferView.takenSizeInByte: ${this.__takenByte}, Accessor.byteStride: ${a}, Accessor.count: ${n};\nbyteSizeToTake: ${a*n}, the byte length left in the Buffer: ${this.byteLength-this.__takenByte}`;return new o.UG({message:e,error:void 0})}const _=new i.U({bufferView:this,byteOffsetInBufferView:r,compositionType:e,componentType:t,byteStride:a,count:n,raw:this.__raw,max:s,min:l,arrayLength:1,normalized:c});return this.__accessors.push(_),new o.Ok(_)}isSame(e){return this.byteLength===e.byteLength&&this.byteOffsetInRawArrayBufferOfBuffer===e.byteOffsetInRawArrayBufferOfBuffer&&this.defaultByteStride===e.defaultByteStride&&this.buffer.getArrayBuffer()===e.buffer.getArrayBuffer()}}},3449:(e,t,n)=>{"use strict";n.d(t,{j:()=>a});var i=n(3738),o=n(4252);class a{static isNode(){return void 0===window&&"undefined"!=typeof process&&!0}static btoa(e){if(a.isNode()){let t;return t=Buffer.isBuffer(e)?e:Buffer.from(e.toString(),"binary"),t.toString("base64")}return btoa(e)}static atob(e){return a.isNode()?Buffer.from(e,"base64").toString("binary"):atob(e)}static dataUriToArrayBuffer(e){const t=e.split(","),n=a.atob(t[1]),i=n.length,o=new ArrayBuffer(i),r=new Uint8Array(o);for(let e=0;e{if(a.isNode());else{const a=new XMLHttpRequest;t?(a.onload=e=>{let i=null;i=t?a.response:a.responseText,n(o,i)},a.open("GET",e,!0),a.responseType="arraybuffer"):(a.onreadystatechange=()=>{if(4!==a.readyState||2!==Math.floor(a.status/100)&&0!==a.status)i&&i(r,a.status);else{let e=null;e=t?a.response:a.responseText,n(o,e)}},a.open("GET",e,!0)),a.send(null)}}))}static toCRC32(e){let t=0,n=0,i=0;const o=a.crc32table;t^=-1;for(let a=0,r=e.length;a>>8^n;return(-1^t)>>>0}static accessBinaryAsImage(e,t,n,i){const o=this.takeBufferViewAsUint8Array(t,e,n);return this.accessArrayBufferAsImage(o,i)}static createBlobImageUriFromUint8Array(e,t){const n=new Blob([e],{type:t});return URL.createObjectURL(n)}static takeBufferViewAsUint8Array(e,t,n){var i;const o=e.bufferViews[t];let a=null!==(i=o.byteOffset)&&void 0!==i?i:0;const r=o.byteLength;let s=n;return n instanceof Uint8Array&&(s=n.buffer,a+=n.byteOffset),new Uint8Array(s,a,r)}static accessArrayBufferAsImage(e,t){const n=this.uint8ArrayToStringInner(new Uint8Array(e));return this.getImageType(t)+a.btoa(n)}static uint8ArrayToStringInner(e){const t=new Array(e.byteLength);for(let n=0;n{const i=new Image;if(i.crossOrigin="Anonymous",e.match(/^blob:/)||e.match(/^data:/))i.onload=()=>{n(i)},i.src=e;else{const o=(e,i)=>{const o=new Uint8Array(i),r=a.createBlobImageUriFromUint8Array(o,t);e.onload=()=>{n(e),URL.revokeObjectURL(r)},e.src=r};(()=>{const t=new XMLHttpRequest;var n;t.onreadystatechange=(n=i,function(){4===t.readyState&&200===t.status&&o(n,t.response)}),t.open("GET",e),t.responseType="arraybuffer",t.send()})()}}))}static createDefaultGltfOptions(){return{files:{},loaderExtension:void 0,defaultMaterialHelperName:void 0,defaultMaterialHelperArgumentArray:[],statesOfElements:[{targets:[],states:{enable:[],functions:{}},isTransparent:!0,opacity:1,isTextureImageToLoadPreMultipliedAlpha:!1}],tangentCalculationMode:1,extendedJson:void 0,__importedType:"undefined"}}static async fetchArrayBuffer(e){try{const t=await fetch(e,{mode:"cors"}),n=await t.arrayBuffer();return new i.Ok(n)}catch(t){return new i.UG({message:`fetchArrayBuffer failed. uri: ${e}`,error:t})}}static getResizedCanvas(e,t){const n=document.createElement("canvas"),i=this.getNearestPowerOfTwo(e.width),o=this.getNearestPowerOfTwo(e.height),a=o/i;let r=0,s=0;return i>o?(r=Math.min(i,t),s=r*a):(s=Math.min(o,t),r=s/a),n.width=r,n.height=s,n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,r,s),[n,r,s]}static detectTransparentPixelExistence(e,t=1){const n=e.width,i=e.height;let o,a;e instanceof ImageData?a=e:e instanceof HTMLImageElement?(o=document.createElement("canvas").getContext("2d"),o.drawImage(e,0,0),a=o.getImageData(0,0,n,i)):(o=e.getContext("2d"),o.drawImage(e,0,0),a=o.getImageData(0,0,n,i));for(let e=0;e{"use strict";n.d(t,{Jx:()=>i,bm:()=>r,cu:()=>a,li:()=>o});class i{constructor({index:e,str:t,noCheckStrUnique:n}){if(null==i.__indices.get(this.constructor)&&i.__indices.set(this.constructor,[]),null==i.__strings.get(this.constructor)&&i.__strings.set(this.constructor,[]),-1!==i.__indices.get(this.constructor).indexOf(e))throw new Error("Dont use duplicate index.");if(!0!==n&&-1!==i.__strings.get(this.constructor).indexOf(t))throw new Error("Dont use duplicate str.");this.index=e,this.str=t,this.symbol=Symbol(t),i.__indices.get(this.constructor).push(e),i.__strings.get(this.constructor).push(t)}toString(){return this.str}toJSON(){return this.index}}function o({typeList:e,index:t}){const n=e.find((e=>e.index===t));if(n)return n}function a({typeList:e,str:t}){const n=e.find((e=>e.str.toLowerCase()===t.toLowerCase()));if(n)return n}function r({typeList:e,str:t}){const n=e.find((e=>e.str===t));if(n)return n}i.__indices=new Map,i.__strings=new Map},4690:(e,t,n)=>{"use strict";n.d(t,{Is:()=>r,V:()=>i});const i={defined:(e,...t)=>void 0!==e,undefined:(e,...t)=>void 0===e,null:(e,...t)=>null===e,exist:(e,...t)=>null!=e,function:(e,...t)=>"function"==typeof e,true:(e,...t)=>!0===e,truly:(e,...t)=>!!e,false:(e,...t)=>!1===e,falsy:(e,...t)=>!e,stringContaining:(e,t)=>-1!==e.indexOf(t)},o={not:e=>function(){return e.apply(null,[...arguments])},all:e=>function(){return Array.isArray(arguments[0])?arguments[0].every(e):[...arguments].every(e)},any:e=>function(){return Array.isArray(arguments[0])?arguments[0].some(e):[...arguments].some(e)}},a={defined:(e,...t)=>void 0===e,undefined:(e,...t)=>void 0!==e,null:(e,...t)=>null!==e,exist:(e,...t)=>null==e,function:(e,...t)=>"function"!=typeof e,true:(e,...t)=>!0!==e,truly:(e,...t)=>!e,false:(e,...t)=>!1!==e,falsy:(e,...t)=>!!e};for(const e in o)if(Object.prototype.hasOwnProperty.call(o,e)){i[e]={};for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[e][t]="not"===e?o[e](a[t]):o[e](i[t]))}const r=i},6098:(e,t,n)=>{"use strict";n.d(t,{$z:()=>T,CW:()=>E,Jx:()=>c,Kf:()=>S,LS:()=>f,OB:()=>l,Qj:()=>g,YU:()=>A,Zs:()=>m,_z:()=>x,bh:()=>d,dK:()=>I,eD:()=>u,fK:()=>s,fY:()=>h,j3:()=>b,kS:()=>r,t0:()=>_,tS:()=>y,vV:()=>v,wv:()=>p});var i=n(4690);const o=function(){const e=["iPod","iPad","iPhone","Android"];for(let t=0;t0)return!0;return a()},a=function(){return navigator.userAgent.indexOf("Macintosh")>-1&&"ontouchend"in document},r=({value:e,defaultValue:t})=>null==e?t:e,s=(e,t)=>!!i.Is.exist(t)&&(e(t),!0),l=(e,t)=>i.Is.exist(t)?e(t):t,c=(e,t)=>!!i.Is.exist(t)&&(e(t),!0),_=(e,t)=>i.Is.exist(t)?e(t):t,h=(e,t)=>!i.Is.undefined(t)||(e(),!1),u=(e,t)=>i.Is.undefined(t)?e():t,d=(e,t)=>{i.Is.undefined(t)&&e()},m=(e,t)=>i.Is.undefined(t)?e():t,f=(e,t)=>null==t?e:t,p=({value:e,compensation:t})=>null==e?t():e,v=e=>null==e?[]:e,A=e=>null==e?new Map:e,y=(e,t)=>e>t?{result:!0,greater:e,less:t}:{result:!1,greater:t,less:e},g=(e,t)=>e{const t=e.split(/\r\n|\r|\n/);let n="";for(let e=0;e=100&&(o=": "),n+=i+o+t[e]+"\n"}return n};function I(e){if(null==e)throw new Error(`Expected 'val' to be existed, but received ${e}`)}function b(e){return JSON.parse(JSON.stringify(e))}function E(e,t){const n=document.createElement("a");n.download=e;const i=new Blob([t],{type:"octet/stream"}),o=URL.createObjectURL(i);n.href=o;const a=new MouseEvent("click");n.dispatchEvent(a),URL.revokeObjectURL(o)}function T(e,t){const n=document.createElement("a");n.download=e;const i=new Blob([t],{type:"octet/stream"}),o=URL.createObjectURL(i);n.href=o;const a=new MouseEvent("click");n.dispatchEvent(a),URL.revokeObjectURL(o)}const S=Object.freeze({isMobileVr:function(){return/(Pacific Build.+OculusBrowser.+SamsungBrowser.+)|(SamsungBrowser)|(Mobile VR)/i.test(window.navigator.userAgent)},isMobile:o,isIOS:function(){const e=["iPod","iPad","iPhone"];for(let t=0;t0)return!0;return a()},isSafari:function(){return navigator.userAgent.indexOf("Safari")>0&&-1===navigator.userAgent.indexOf("Chrome")},preventDefaultForDesktopOnly:function(e){o()||e.preventDefault()},isObject:function(e){return e instanceof Object&&!(e instanceof Array)},fillTemplate:function(e,t){return new Function("return `"+e+"`;").call(t)},isNode:function(){return"undefined"!=typeof process&&!0},concatArrayBuffers:function(e,t,n,i){let o,a=0;for(let e=0;enull!=i&&s+e>i?s+e-i:0;let s=0;const l=(t,i)=>{const a=r(t);return a?(o.set(new Uint8Array(e[i],n[i],a),s),s+=a,!0):(o.set(new Uint8Array(e[i],n[i],t),s),s+=t,!1)},c=e=>{const t=r(e);return t?(o.set(new Uint8Array(t),s),s+=t,!0):(o.set(new Uint8Array(e),s),s+=e,!1)};for(let i=0;i0?a:0;if(l(t[i]-r,i))return o.buffer;if(r>0&&c(r))return o.buffer}return null!=i&&s{const o=new Uint8Array(new ArrayBuffer(e));let a=0;for(const e in t){const r=t[e],s=new Uint8Array(r,n[e],i[e]);o.set(s,a),a+=i[e]}return o.buffer},addLineNumberToCode:x,downloadArrayBuffer:E,downloadTypedArray:T})},6312:(e,t,n)=>{"use strict";n.d(t,{Hq:()=>s,W:()=>c,Wx:()=>a,Zz:()=>l,bD:()=>r});var i=n(4690);const o="The value does not exist!";class a{constructor(e){this.value=e}set(e){this.value=e}then(e){return i.Is.exist(this.value)?e(this.value):new s}unwrapOrDefault(e){return i.Is.exist(this.value)?this.value:e}unwrapOrElse(e){return i.Is.exist(this.value)?this.value:e()}unwrapForce(){if(i.Is.exist(this.value))return this.value;throw new ReferenceError(o)}unwrapOrUndefined(){return i.Is.exist(this.value)?this.value:void 0}has(){return i.Is.exist(this.value)}doesNotHave(){return!i.Is.exist(this.value)}}class r{constructor(e){this.value=e}then(e){return e(this.value)}unwrapOrDefault(e){return this.value}unwrapOrElse(e){return this.value}unwrapForce(){return this.value}unwrapOrUndefined(){return this.value}get(){return this.value}has(){return!0}doesNotHave(){return!1}}class s{then(){return this}unwrapOrDefault(e){return e}unwrapOrElse(e){return e(void 0)}unwrapForce(){throw new ReferenceError(o)}unwrapOrUndefined(){}has(){return!1}doesNotHave(){return!0}}function l(e){if(!e.has())throw new ReferenceError(o)}function c(e){if(e.has())throw new ReferenceError(o)}},3738:(e,t,n)=>{"use strict";n.d(t,{Mr:()=>c,Ok:()=>a,UD:()=>s,UG:()=>r,Z6:()=>l});var i=n(4690);class o{constructor(e){this.val=e}match(e){this instanceof a?e.Ok(this.val):this instanceof r&&e.Err(this.val),i.Is.exist(e.Finally)&&e.Finally()}name(){return this.constructor.name}}class a extends o{constructor(e){super(e)}unwrap(e){return this.val}unwrapForce(){return this.val}true(){return!0}isOk(){return!0}isErr(){return!1}get(){return this.val}}class r extends o{constructor(e){super(e),this.__rnException=new c(this.val)}unwrap(e){e(this.val)}unwrapForce(){throw this.__rnException}false(){return!1}isOk(){return!1}isErr(){return!0}getRnError(){return this.val}toString(){return this.__rnException.stack}}function s(e){if(e.isErr())throw new Error("This is Err. No Ok.")}function l(e){if(e.isOk())throw new Error("This is Ok. No Err.")}class c extends Error{constructor(e){super(`\n message: ${e.message}\n error: ${e.error instanceof r?"see below Exception ↓"+e.error:e.error}\n`),this.err=e,this.name=c._prefix}getRnError(){return this.err}}c._prefix="\nRhodonite Exception"},4252:(e,t,n)=>{"use strict";n.d(t,{n:()=>i});class i extends Promise{constructor(e){super(((e,t)=>{})),this.name="",this.__callbackObj={promiseAllNum:0,resolvedNum:0,rejectedNum:0,pendingNum:0,processedPromises:[]},this.__promise=e instanceof Promise?e:new Promise(e)}static resolve(e){if(e instanceof Promise)return new i(e);if(e instanceof i)return e;if(null!=e.then){const t=new i(((t,n)=>{t(e)}));return t.then=e.then,t}return new i(((t,n)=>{t(e)}))}static all(e,t){if(t){const n=[],o={promiseAllNum:e.length,resolvedNum:0,rejectedNum:0,pendingNum:e.length,processedPromises:[]};for(const a of e){const e=i.resolve(a);e.__callback=t,e.__callbackObj=o,n.push(e)}return new i(Promise.all(n))}return new i(Promise.all(e))}static race(e){return new i(Promise.race(e))}then(e,t){let n;return e&&(n=t=>(0!==this.__callbackObj.promiseAllNum&&-1===this.__callbackObj.processedPromises.indexOf(this)&&(this.__callbackObj.pendingNum--,this.__callbackObj.resolvedNum++,this.__callbackObj.processedPromises.push(this)),this.__callback&&this.__callback(this.__callbackObj),e(t))),this.__promise.then(n,t)}catch(e){return new i(this.__promise.catch(e))}finally(e){return this.__promise.finally(e)}static reject(e){return new i(Promise.reject(e))}}},3581:(e,t,n)=>{"use strict";n.d(t,{q:()=>i});class i{static _processBegin(){0===i.__currentProcessBeginTime&&(i.__systemStartTime=performance.now()),i.__currentProcessBeginTime=performance.now()}static _processEnd(){i.__lastProcessEndTime=performance.now(),i.__lastTickTimeInterval=i.__lastProcessEndTime-i.__currentProcessBeginTime}static get timeFromSystemStart(){return i.__systemStartTime-performance.now()/1e3}static get lastTickTimeInterval(){return i.__lastTickTimeInterval/1e3}}i.__currentProcessBeginTime=0,i.__lastProcessEndTime=0,i.__lastTickTimeInterval=0,i.__systemStartTime=0},2852:(e,t,n)=>{"use strict";n.d(t,{Bx:()=>r,Lq:()=>s,lI:()=>a});var i=n(4690);const o="The value does not exist!";class a{constructor(){this.__weakMap=new WeakMap}set(e,t){this.__weakMap.set(e,t)}unwrapOrDefault(e,t){const n=this.__weakMap.get(e);return i.Is.exist(n)?n:t}unwrapOrElse(e,t){const n=this.__weakMap.get(e);return i.Is.exist(n)?n:t()}unwrapForce(e){const t=this.__weakMap.get(e);if(i.Is.exist(t))return t;throw new ReferenceError(o)}unwrapOrUndefined(e){return this.__weakMap.get(e)}has(e){return this.__weakMap.has(e)}}class r{constructor(e,t){this.__weakMap=new WeakMap,this.__weakMap.set(e,t)}unwrapOrDefault(e,t){return this.__weakMap.get(e)}unwrapOrElse(e,t){return this.__weakMap.get(e)}unwrapForce(e){return this.__weakMap.get(e)}get(e){return this.__weakMap.get(e)}unwrapOrUndefined(e){return this.__weakMap.get(e)}has(e){return!0}}class s{then(){return this}unwrapOrDefault(e,t){return t}unwrapOrElse(e,t){return t(void 0)}unwrapForce(e){throw new ReferenceError(o)}unwrapOrUndefined(e){}has(){return!1}}},2253:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>a,j4:()=>l.j,Jx:()=>c.Jx,UG:()=>C.UG,Lk:()=>E,Is:()=>i.Is,V5:()=>i.V,Kf:()=>T.Kf,Hq:()=>S.Hq,Ok:()=>C.Ok,Wx:()=>S.Wx,Mr:()=>C.Mr,ni:()=>w.n,bD:()=>S.bD,bs:()=>o,qp:()=>R.q,Lq:()=>P.Lq,lI:()=>P.lI,Bx:()=>P.Bx,li:()=>c.li,cu:()=>c.cu,bm:()=>c.bm,_z:()=>T._z,W:()=>S.W,dK:()=>T.dK,Zz:()=>S.Zz,Z6:()=>C.Z6,UD:()=>C.UD,U2:()=>b,AB:()=>I,j3:()=>T.j3,LS:()=>T.LS,CW:()=>T.CW,$z:()=>T.$z,tS:()=>T.tS,WF:()=>T.Jx,t0:()=>T.t0,fK:()=>T.fK,OB:()=>T.OB,bh:()=>T.bh,Zs:()=>T.Zs,fY:()=>T.fY,eD:()=>T.eD,Qj:()=>T.Qj,vV:()=>T.vV,YU:()=>T.YU,oz:()=>r,EY:()=>s,wv:()=>T.wv,kS:()=>T.kS});var i=n(4690);class o{constructor(){this.__weakMap=new WeakMap}set(e,t){return!this.__weakMap.has(e)&&(this.__weakMap.set(e,t),!0)}has(e){return!!this.__weakMap.has(e)}get(e){const t=this.__weakMap.get(e);if(!i.Is.not.exist(t))return this.__weakMap.get(e)}delete(e){return!!this.__weakMap.has(e)&&(this.__weakMap.delete(e),!0)}}class a{constructor(){this.__symbolWeakMap=new o}register(e){this.__symbolWeakMap.set(Symbol(),e)}}const r=e=>{const t=new WeakMap;return n=>{if(t.has(n))return t.get(n);const i=e(n);return t.set(n,i),i}},s=e=>{const t=new Map;return n=>{if(t.has(n))return t.get(n);const i=e(n);return t.set(n,i),i}};var l=n(3449),c=n(2343),_=n(2471),h=n(2566),u=n(3032),d=n(9190),m=n(1162),f=n(8182),p=n(9849);function v(e,t,n){const i=1<e.valuet.value?1:0));for(let e=0;eet?1:0));for(let e=0;e{"use strict";n.d(t,{t:()=>c});var i=n(2471),o=n(9190),a=n(9207),r=n(3581),s=n(963),l=n(4690);class c{constructor(){}getParentRotation(e){return null!=e.parent?e.parent.rotation:a._.identity()}update(){const e=this.__spring;l.Is.exist(e)&&this.updateInner(e.bones,e)}updateInner(e,t){const n=t.colliderGroups;for(const t of e){const e=t.node.getSceneGraph(),o=e.children;if(o.length>0){const e=o[0].entity.getTransform().localPosition;e.lengthSquared(){"use strict";n.d(t,{F:()=>a});var i=n(2251),o=n(1296);class a{static getWebGLResourceRepository(){return i.x.getInstance().getModule("webgl").WebGLResourceRepository.getInstance()}static getCgApiResourceRepository(e){const t=o.V7.isWebGL2Approach(e)?"webgl":"webgpu";return i.x.getInstance().getModule(t).WebGLResourceRepository.getInstance()}}a.InvalidCGAPIResourceUid=-1},8206:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(9002);class o extends i.S{constructor(){super(),this.__renderPasses=[]}clone(){const e=new o,t=[];for(const e of this.__renderPasses)t.push(e.clone());return e.addRenderPasses(t),e}addRenderPasses(e){for(const t of e)this.__renderPasses.push(t)}clearRenderPasses(){this.__renderPasses.length=0}get renderPasses(){return this.__renderPasses}setViewport(e){for(const t of this.__renderPasses)t.setViewport(e)}}},3981:(e,t,n)=>{"use strict";n.d(t,{R:()=>a});var i=n(9002),o=n(4690);class a extends i.S{constructor(){super(),this.__expressions=[],this.__expressionQueries=[]}addExpression(e,{inputRenderPasses:t,outputs:n}={inputRenderPasses:[],outputs:[]}){if(o.Is.exist(n))for(const t of n){let n=t.renderPass.instance;o.Is.exist(t.renderPass.instance)?n=t.renderPass.instance:o.Is.exist(t.renderPass.index)?n=e.renderPasses[t.renderPass.index]:o.Is.exist(t.renderPass.uniqueName)&&(n=i.S.getRnObjectByName(t.renderPass.uniqueName)),o.Is.exist(n)&&n.setFramebuffer(t.frameBuffer)}this.__expressions.push({expression:e,inputRenderPasses:o.Is.exist(t)?t:[]})}getColorAttachmentFromInputOf(e,t={renderPass:{index:0},colorAttachmentIndex:0,framebufferType:a.FrameBuffer}){return new Promise((n=>{const i=function*(){const e=yield;return n(e),e}();this.__expressionQueries.push([e,t.renderPass,t.colorAttachmentIndex,i,t.framebufferType])}))}resolve(){for(const[e,t,n,a,r]of this.__expressionQueries)for(const s of this.__expressions)if(e===s.expression){let e,l=t.instance;if(o.Is.exist(t.instance)?l=t.instance:o.Is.exist(t.index)?l=s.inputRenderPasses[t.index]:o.Is.exist(t.uniqueName)&&(l=i.S.getRnObjectByName(t.uniqueName)),"ResolveFrameBuffer2"===r?e=l.getResolveFramebuffer2():"ResolveFrameBuffer"===r?e=l.getResolveFramebuffer():"FrameBuffer"===r&&(e=l.getFramebuffer()),o.Is.exist(e)){const t=e.getColorAttachedRenderTargetTexture(n);o.Is.exist(t)&&(a.next(t),a.next(t))}}}clearExpressions(){this.__expressions.length=0}get expressions(){return this.__expressions.map((e=>e.expression))}setViewport(e){for(const t of this.__expressions)t.expression.setViewport(e)}}a.FrameBuffer="FrameBuffer",a.ResolveFrameBuffer="ResolveFrameBuffer",a.ResolveFrameBuffer2="ResolveFrameBuffer2"},4512:(e,t,n)=>{"use strict";n.d(t,{C:()=>h});var i=n(9002),o=n(8491),a=n(7192),r=n(2251),s=n(3952),l=n(4536),c=n(4710),_=n(8430);class h extends i.S{constructor(){super(),this.__entities=[],this.__sceneGraphDirectlyAdded=[],this.__topLevelSceneGraphComponents=[],this.toClearColorBuffer=!1,this.toClearDepthBuffer=!0,this.toClearStencilBuffer=!1,this.isDepthTest=!0,this.clearColor=a.Lt.fromCopyArray([1,1,1,1]),this.clearDepth=1,this.clearStencil=0,this.cullFrontFaceCCW=!0,this.__primitiveMaterial=new Map,this.isVrRendering=!0,this.isOutputForVr=!1,this.toRenderOpaquePrimitives=!0,this.toRenderTransparentPrimitives=!0,this.toRenderEffekseerEffects=!1,this.drawCount=1}clone(){var e,t,n,i;const o=new h;return o.__entities=this.__entities.concat(),o.__sceneGraphDirectlyAdded=this.__sceneGraphDirectlyAdded.concat(),o.__topLevelSceneGraphComponents=null===(e=this.__topLevelSceneGraphComponents)||void 0===e?void 0:e.concat(),o.__meshComponents=null===(t=this.__meshComponents)||void 0===t?void 0:t.concat(),o.__frameBuffer=this.__frameBuffer,o.__resolveFrameBuffer=this.__resolveFrameBuffer,o.__resolveFrameBuffer2=this.__resolveFrameBuffer2,o.__viewport=null===(n=this.__viewport)||void 0===n?void 0:n.clone(),o.toClearColorBuffer=this.toClearColorBuffer,o.toClearDepthBuffer=this.toClearDepthBuffer,o.toClearStencilBuffer=this.toClearStencilBuffer,o.isDepthTest=this.isDepthTest,o.clearColor=this.clearColor.clone(),o.clearDepth=this.clearDepth,o.clearStencil=this.clearStencil,o.cameraComponent=this.cameraComponent,o.cullFrontFaceCCW=this.cullFrontFaceCCW,o.__material=this.__material,o.__primitiveMaterial=new Map(this.__primitiveMaterial),o.__webglRenderingStrategy=this.__webglRenderingStrategy,o.isVrRendering=this.isVrRendering,o.isOutputForVr=this.isOutputForVr,o.toRenderOpaquePrimitives=this.toRenderOpaquePrimitives,o.toRenderTransparentPrimitives=this.toRenderTransparentPrimitives,o.__preEachDrawFunc=this.__preEachDrawFunc,o.__postEachRenderFunc=this.__postEachRenderFunc,o.__renderTargetColorAttachments=null===(i=this.__renderTargetColorAttachments)||void 0===i?void 0:i.concat(),o}setPreDrawFunction(e){this.__preEachDrawFunc=e}unsetPreDrawFunction(){this.__preEachDrawFunc=void 0}doPreEachDraw(e){null!=this.__preEachDrawFunc&&this.__preEachDrawFunc(e)}setPostRenderFunction(e){this.__postEachRenderFunc=e}doPostRender(){null!=this.__postEachRenderFunc&&this.__postEachRenderFunc()}addEntities(e){for(const t of e){const e=t.getSceneGraph();this.__sceneGraphDirectlyAdded.push(e);const n=o.a.flattenHierarchy(e,!1).map((e=>e.entity)),i=this.__entities.concat(n).reduce(((e,t)=>(e.set(t.entityUID,t),e)),new Map);this.__entities=Array.from(i.values())}this.__meshComponents=void 0,this.__topLevelSceneGraphComponents=void 0,this.__collectMeshComponents(),this.__collectTopLevelSceneGraphComponents()}get entities(){return this.__entities}clearEntities(){this.__meshComponents=void 0,this.__topLevelSceneGraphComponents=void 0,this.__entities=[]}__collectTopLevelSceneGraphComponents(){if(null==this.__topLevelSceneGraphComponents){const e=t=>(t.parent&&e(t.parent),t);this.__topLevelSceneGraphComponents=this.__sceneGraphDirectlyAdded.map((t=>e(t)));const t=new Set(this.__topLevelSceneGraphComponents);this.__topLevelSceneGraphComponents=Array.from(t)}}__collectMeshComponents(){null==this.__meshComponents&&(this.__meshComponents=[],this.__entities.filter((e=>{const t=e.getComponentByComponentTID(c.z.MeshComponentTID);t&&this.__meshComponents.push(t)})))}get meshComponents(){var e;return null!==(e=this.__meshComponents)&&void 0!==e?e:[]}get sceneTopLevelGraphComponents(){return null!=this.__topLevelSceneGraphComponents?this.__topLevelSceneGraphComponents:[]}setFramebuffer(e){this.__frameBuffer=e,null!=e?this.setViewport(a.Lt.fromCopyArray([0,0,e.width,e.height])):this.__viewport=void 0}setRenderTargetColorAttachments(e){this.__renderTargetColorAttachments=e}getRenderTargetColorAttachments(){return this.__renderTargetColorAttachments}getFramebuffer(){return this.__frameBuffer}removeFramebuffer(){this.__frameBuffer=void 0}setViewport(e){null!=this.__viewport?this.__viewport.copyComponents(e):this.__viewport=l.xQ.fromCopyArray([e.x,e.y,e.z,e.w])}getViewport(){let e=this.__viewport;return null!=e&&(e=h.__tmp_Vector4_0.copyComponents(e)),e}setResolveFramebuffer(e){const t=s.x.getInstance().currentWebGLContextWrapper;t&&t.isWebGL2?this.__resolveFrameBuffer=e:console.error("resolve framebuffer is unavailable in this webgl context")}getResolveFramebuffer(){return this.__resolveFrameBuffer}setResolveFramebuffer2(e){const t=s.x.getInstance().currentWebGLContextWrapper;t&&t.isWebGL2?this.__resolveFrameBuffer2=e:console.error("resolve framebuffer is unavailable in this webgl context")}getResolveFramebuffer2(){return this.__resolveFrameBuffer2}_copyFramebufferToResolveFramebuffers(){this.__copyFramebufferToResolveFramebufferInner(this.__resolveFrameBuffer),this.__copyFramebufferToResolveFramebufferInner(this.__resolveFrameBuffer2)}__copyFramebufferToResolveFramebufferInner(e){if(null==e)return;const t=s.x.getInstance(),n=t.getWebGLResource(this.__frameBuffer.cgApiResourceUid),i=t.getWebGLResource(e.cgApiResourceUid),o=t.currentWebGLContextWrapper.getRawContextAsWebGL2();o.bindFramebuffer(o.READ_FRAMEBUFFER,n),o.bindFramebuffer(o.DRAW_FRAMEBUFFER,i),o.blitFramebuffer(0,0,this.__frameBuffer.width,this.__frameBuffer.height,0,0,e.width,e.height,o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT,o.NEAREST),o.bindFramebuffer(o.READ_FRAMEBUFFER,null),o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null)}__setupMaterial(e){e.isEmptyMaterial()||this.__setWebglRenderingStrategyIfNotYet(this.__webglRenderingStrategy).setupShaderForMaterial(e)}setMaterialForPrimitive(e,t){this.__primitiveMaterial.set(t,e),this.__setupMaterial(e)}setMaterial(e){this.__material=e,this.__setupMaterial(e)}get material(){return this.__material}__setWebglRenderingStrategyIfNotYet(e){if(null!=e)return e;const t=_.l.currentProcessApproach,n=r.x.getInstance().getModule("webgl").getRenderingStrategy(t);return this.__webglRenderingStrategy=n,n}__getMaterialOf(e){return this.__primitiveMaterial.get(e)}__hasMaterialOf(e){return this.__primitiveMaterial.has(e)}getAppropriateMaterial(e){let t;return t=this.__hasMaterialOf(e)?this.__getMaterialOf(e):null!=this.material?this.material:e.material,t}}h.__tmp_Vector4_0=l.xQ.zero()},4327:(e,t,n)=>{"use strict";function i(e){return!(!e.isEmptyMaterial()&&-1!==e._shaderProgramUid)}n.d(t,{l:()=>i})},8827:(e,t,n)=>{"use strict";n.d(t,{U:()=>a});var i=n(4690),o=n(6098);class a{constructor(){this.__subscriberMap=new Map}subscribe(e,t){let n=this.__subscriberMap.get(e);return i.Is.not.exist(n)&&(this.__subscriberMap.set(e,[]),n=this.__subscriberMap.get(e)),n.push(t)-1}unsubscribe(e,t){const n=this.__subscriberMap.get(e);null!=n&&n.splice(t,1)}unsubscribeAll(e){this.__subscriberMap.delete(e)}publishAsync(e,t){let n=0;const i=(0,o.vV)(this.__subscriberMap.get(e));for(const e of i)setTimeout(e.bind(this,t),0),n++;return n}publishSync(e,t){let n=0;const i=(0,o.vV)(this.__subscriberMap.get(e));for(const e of i)e(t),n++;return n}}},4742:(e,t,n)=>{"use strict";n.d(t,{$t:()=>j,Cf:()=>E,EY:()=>Q,K2:()=>H,KA:()=>k,KP:()=>U,KQ:()=>q,Lf:()=>h,RO:()=>y,Ry:()=>b,Rz:()=>w,SG:()=>C,Ss:()=>s,Tr:()=>W,UB:()=>T,VS:()=>V,Yw:()=>R,_6:()=>v,_Q:()=>u,ad:()=>O,ak:()=>l,cA:()=>A,cE:()=>x,cG:()=>r,cS:()=>f,fA:()=>g,hD:()=>S,hd:()=>B,jO:()=>X,jP:()=>z,jX:()=>F,k$:()=>d,k4:()=>a,lO:()=>m,lc:()=>I,lv:()=>D,n9:()=>c,oM:()=>P,p2:()=>G,pt:()=>M,q7:()=>p,us:()=>L,vE:()=>_,yy:()=>N,zU:()=>o});var i=n(4690);const o="mousedown",a="mousemove",r="mouseup",s="wheel",l="mouseenter",c="mouseleave",_="mouseover",h="click",u="keydown",d="keyup",m="keypress",f="pointerdown",p="MSPointerDown",v="pointermove",A="MSPointerMove",y="pointerup",g="MSPointerUp",x="pointercancel",I="pointerenter",b="pointerleave",E="pointerover",T="pointerout",S="resize",C="orientationchange",w="tap",R="doubletap",P="longtap",D="hold",M="drag",N="swipe",B="pinch",L="touchstart",F="touchmove",G="touchend",V="touchcancel",z="touchenter",O="touchleave",U="touchover",k="touchout";function Q(e){const t=void 0!==document.ontouchstart,n=window.navigator.pointerEnabled,i=window.navigator.msPointerEnabled;return{start:n?f:i?p:t?L:o,move:n?v:i?A:t?F:a,end:n?y:i?g:t?G:r,click:h}[e]}const W="None",X="CameraController",q="GizmoTranslation",H="GizmoScale";class j{static register(e,t){this.__inputHandlingStateMap.set(e,t),this.__activeMap.set(e,!0),this.__processEventListeners()}static unregister(e){this.__activeMap.set(e,!1),this.__inputHandlingStateMap.delete(e),this.__processEventListeners()}static setActive(e,t){this.__activeMap.set(e,t),e===q&&t?this.__activeMap.set(H,!1):e===H&&t&&this.__activeMap.set(q,!1),this.__processEventListeners()}static __addEventListeners(e){const t=j.__inputHandlingStateMap.get(e);if(i.Is.exist(t))for(const e of t)e.eventTargetDom.addEventListener(e.eventName,e.handler,e.options)}static __removeEventListeners(e){const t=j.__inputHandlingStateMap.get(e);if(i.Is.exist(t))for(const e of t)e.eventTargetDom.removeEventListener(e.eventName,e.handler,e.options)}static __processEventListeners(){const e=j.__inputHandlingStateMap.get(q),t=j.__inputHandlingStateMap.get(H);j.__inputHandlingStateMap.get(X)&&(this.__addEventListeners(X),this.__currentState=X),e&&(this.__addEventListeners(q),this.__removeEventListeners(H),this.__currentState=q),t&&(this.__addEventListeners(H),this.__removeEventListeners(q),this.__currentState=H)}static enableCameraController(){this.__addEventListeners(X),this.__activeMap.set(X,!0),this.__processEventListeners()}static disableCameraController(){this.__removeEventListeners(X),this.__activeMap.set(X,!1),this.__processEventListeners()}static getCurrentState(){return this.__currentState}}j.__inputHandlingStateMap=new Map,j.__activeMap=new Map,j.__currentState=W},2251:(e,t,n)=>{"use strict";n.d(t,{x:()=>i});class i{constructor(){this.__modules=new Map}async loadModule(e,t){let i;return"webgl"===e.toLowerCase()?i=await(await Promise.resolve().then(n.bind(n,8511))).default:"effekseer"===e.toLowerCase()?(i=await(await Promise.resolve().then(n.bind(n,3995))).Effekseer,i.EffekseerComponent.wasmModuleUri=null==t?void 0:t.wasm):"pbr"===e.toLowerCase()?i=await(await Promise.resolve().then(n.bind(n,5649))).default:"xr"===e.toLowerCase()&&(i=await(await Promise.resolve().then(n.bind(n,9131))).default),this.__modules.set(e,i),i}getModule(e){return this.__modules.get(e)}static getInstance(){return this.__instance||(this.__instance=new i),this.__instance}}},3648:(e,t,n)=>{"use strict";n.d(t,{x:()=>C});var i=n(4507),o=n(2404),a=n(7683),r=n(2251),s=n(7987),l=n(9721),c=n(8206),_=n(1350),h=n(224),u=n(9286),d=n(7348),m=n(2471),f=n(9646),p=n(3581),v=n(8430),A=n(6098),y=n(4690),g=n(7973),x=n(3258),I=n(3981),b=n(7192),E=n(4512),T=n(4710),S=n(2192);class C{constructor(){}static startRenderLoop(e,...t){this.__renderLoopFunc=e,this.__args=t;const n=this.__getAnimationFrameObject();this.__animationFrameId=n.requestAnimationFrame(((n,i)=>{const o=r.x.getInstance().getModule("xr");if(y.Is.exist(o)){const e=o.WebXRSystem.getInstance();e.isReadyForWebXR&&e._preRender(n,i);const t=o.WebARSystem.getInstance();t.isReadyForWebAR&&t._preRender(n,i)}if(e.apply(e,[n,...t]),y.Is.exist(o)){const e=o.WebXRSystem.getInstance();e.isReadyForWebXR&&e._postRender();const t=o.WebARSystem.getInstance();t.isReadyForWebAR&&t._preRender(n,i)}this.startRenderLoop(e,...t)}))}static __getAnimationFrameObject(){let e=window;const t=r.x.getInstance().getModule("xr");if(y.Is.exist(t)){const n=t.WebXRSystem.getInstance(),i=t.WebARSystem.getInstance();if(n.requestedToEnterWebXR?e=n.xrSession:i.requestedToEnterWebAR&&(e=i.arSession),y.Is.not.exist(e))return window}return e}static stopRenderLoop(){this.__getAnimationFrameObject().cancelAnimationFrame(this.__animationFrameId),this.__animationFrameId=-1}static restartRenderLoop(){null!=this.__renderLoopFunc&&this.startRenderLoop(this.__renderLoopFunc,0,this.__args)}static processAuto(e=b.Lt.fromCopy4(0,0,0,1)){if(y.Is.not.exist(C.__expressionForProcessAuto)){const t=new c.A,n=new E.C;n.toClearColorBuffer=!0,n.toClearDepthBuffer=!0,n.clearColor=e;const i=new E.C;t.addRenderPasses([n,i]),C.__expressionForProcessAuto=t,C.__renderPassForProcessAuto=i}C.__renderPassForProcessAuto.clearEntities();const t=_.g._getEntities();C.__renderPassForProcessAuto.addEntities(t),this.process([C.__expressionForProcessAuto])}static process(e){if("undefined"!=typeof spector&&spector.setMarker("Rn#"),this.__processApproach===a.V.None)throw new Error("Choose a process approach first.");p.q._processBegin();let t=e;e instanceof I.R&&(t=e.expressions),h.M.current===l.w.InvalidObjectUID&&C.createCamera();const n=s.F.getWebGLResourceRepository(),c=r.x.getInstance().getModule("xr"),_=o.C.getComponentTIDs(),u=o.C.getRenderingComponentTIDs();for(const e of l.w._processStages){const a="common_"+e.methodName;if(e===i.I.Render)for(const i of t)for(const t of u){const r=o.C.getComponentClass(t),s=i.renderPasses.length;for(let o=0;o{e.preventDefault(),this.stopRenderLoop(),console.error("WebGL context lost occurred.")}).bind(this)),e.canvas.addEventListener("webglcontextrestored",(()=>{console.error("WebGL context restored."),this.restartRenderLoop()})),await(0,S.Cb)(),n}static get processApproach(){return this.__processApproach}static resizeCanvas(e,t){s.F.getWebGLResourceRepository().resizeCanvas(e,t)}static getCanvasSize(){return s.F.getWebGLResourceRepository().getCanvasSize()}static getCurrentWebGLContextWrapper(){var e;return null===(e=this.__webglResourceRepository)||void 0===e?void 0:e.currentWebGLContextWrapper}}C.__processApproach=a.V.None,C.__renderPassTickCount=0,C.__animationFrameId=-1,C.__args=[],C.__stageMethods=new Map},8430:(e,t,n)=>{"use strict";n.d(t,{l:()=>i});const i={currentProcessApproach:n(7683).V.None}},7290:(e,t,n)=>{"use strict";n.d(t,{y:()=>_});var i=n(9002),o=n(9216),a=n(3999),r=n(5981),s=n(9849),l=n(810),c=n(4690);class _ extends i.S{constructor(){super(),this.__width=0,this.__height=0,this.__level=0,this.__internalFormat=r.d.RGBA8,this.__format=o.V.RGBA,this.__type=a.r.UnsignedByte,this.__hasTransparentPixels=!1,this.__isTextureReady=!1,this.__startedToLoad=!1,this.__name="untitled",this._textureResourceUid=-1,this._samplerResourceUid=-1,this.__textureUid=++_.__textureUidCount}get textureUID(){return this.__textureUid}get width(){return this.__width}set width(e){this.__width=e}get height(){return this.__height}set height(e){this.__height=e}get isTextureReady(){return this.__isTextureReady}get startedToLoad(){return this.__startedToLoad}get htmlImageElement(){return this.__htmlImageElement}get htmlCanvasElement(){const e=document.createElement("canvas"),t=null==e?void 0:e.getContext("2d");return this.__htmlCanvasElement=e,c.Is.exist(t)&&c.Is.exist(this.__htmlImageElement)&&(e.width=this.__htmlImageElement.width,e.height=this.__htmlImageElement.height,t.drawImage(this.__htmlImageElement,0,0,this.__htmlImageElement.width,this.__htmlImageElement.height)),this.__htmlCanvasElement}get uri(){return this.__uri}static getRhodoniteTexture(e){return this.__textureMap.get(e)}set name(e){this.__name=e}get name(){return this.__name}getImageData(e,t,n,i){return void 0===this.__canvasContext&&this.createInternalCanvasContext(),this.__canvasContext.getImageData(e,t,n,i)}getPixelAs(e,t,n){const i=this.getImageData(e,t,1,1).data;return n.compositionType===l.d.Vec4?new n(new Float32Array([i[0],i[1],i[2],i[3]])):new n(new Float32Array([i[0],i[1],i[2]]))}getPixelAsArray(e,t){return this.getImageData(e,t,1,1).data}setPixel(e,t,n){const i=this.getImageData(e,t,1,1),o=i.data,a=n.constructor.compositionType.getNumberOfComponents();for(let e=0;e{"use strict";n.d(t,{B:()=>s});var i=n(7290),o=n(1986),a=n(7987),r=n(5981);class s extends i.y{constructor(){super(),this.mipmapLevelNumber=1,this.hdriFormat=o.c.LDR_SRGB,this.isNamePosNeg=!1}async loadTextureImages(){this.__startedToLoad=!0;const e=a.F.getWebGLResourceRepository(),[t,n]=await e.createCubeTextureFromFiles(this.baseUriToLoad,this.mipmapLevelNumber,this.isNamePosNeg,this.hdriFormat);this._recommendedTextureSampler=n,this._textureResourceUid=t,this.__isTextureReady=!0}loadTextureImagesAsync(){this.__startedToLoad=!0,a.F.getWebGLResourceRepository().createCubeTextureFromFiles(this.baseUriToLoad,this.mipmapLevelNumber,this.isNamePosNeg,this.hdriFormat).then((([e,t])=>{this._textureResourceUid=e,this._recommendedTextureSampler=t})).then((()=>{this.__isTextureReady=!0}))}loadTextureImagesFromBasis(e,{magFilter:t=r.d.Linear,minFilter:n=r.d.LinearMipmapLinear,wrapS:i=r.d.Repeat,wrapT:o=r.d.Repeat}={}){this.__startedToLoad=!0,"undefined"==typeof BASIS&&console.error("Failed to call BASIS() function. Please check to import basis_transcoder.js."),BASIS().then((r=>{const{initializeBasis:s}=r;s();const l=new(0,r.BasisFile)(e);if(!l.startTranscoding())return console.error("failed to start transcoding."),l.close(),void l.delete();const c=a.F.getWebGLResourceRepository().createCubeTextureFromBasis(l,{magFilter:t,minFilter:n,wrapS:i,wrapT:o});this._textureResourceUid=c,this.__isTextureReady=!0,l.close(),l.delete()}))}load1x1Texture(e="rgba(0,0,0,1)"){const t=document.createElement("canvas");t.width=1,t.height=1;const n=t.getContext("2d");n.fillStyle=e,n.fillRect(0,0,1,1);const i=a.F.getWebGLResourceRepository(),[o,r]=i.createCubeTexture(1,[{posX:t,negX:t,posY:t,negY:t,posZ:t,negZ:t}],1,1);this._textureResourceUid=o,this.__isTextureReady=!0}generateTextureFromTypedArrays(e,t,n){const o=a.F.getWebGLResourceRepository(),[r,s]=o.createCubeTexture(e.length,e,t,n);this._recommendedTextureSampler=s,this._textureResourceUid=r,this.__isTextureReady=!0,this.__startedToLoad=!0,i.y.__textureMap.set(this._textureResourceUid,this)}importWebGLTextureDirectly(e,t=0,n=0){this.__width=t,this.__height=n;const o=a.F.getWebGLResourceRepository().setWebGLTextureDirectly(e);this._textureResourceUid=o,this.__startedToLoad=!0,this.__isTextureReady=!0,i.y.__textureMap.set(o,this)}}},4392:(e,t,n)=>{"use strict";n.d(t,{_:()=>c});var i=n(7290),o=n(5981),a=n(9216),r=n(3999),s=n(7987),l=n(7192);class c extends i.y{constructor(){super()}create({width:e,height:t,level:n=0,internalFormat:i=o.d.RGB8,format:s=a.V.RGBA,type:l=r.r.UnsignedByte}){this.__width=e,this.__height=t,this.__level=n,this.__internalFormat=i,this.__format=s,this.__type=l,this.__createRenderTargetTexture()}set _fbo(e){this.__fbo=e}get fbo(){return this.__fbo}__createRenderTargetTexture(){const e=s.F.getWebGLResourceRepository().createRenderTargetTexture({width:this.__width,height:this.__height,level:this.__level,internalFormat:this.__internalFormat,format:this.__format,type:this.__type});this._textureResourceUid=e,i.y.__textureMap.set(e,this)}resize(e,t){this.destroy3DAPIResources(),this.__width=e,this.__height=t,this.__createRenderTargetTexture()}destroy3DAPIResources(){return i.y.__textureMap.delete(this._textureResourceUid),s.F.getWebGLResourceRepository().deleteTexture(this._textureResourceUid),this._textureResourceUid=s.F.InvalidCGAPIResourceUid,!0}getTexturePixelData(){const e=s.F.getWebGLResourceRepository(),t=e.currentWebGLContextWrapper.getRawContext(),n=e.getWebGLResource(this.__fbo.framebufferUID);t.bindFramebuffer(t.FRAMEBUFFER,n);const i=new Uint8Array(this.width*this.height*4);return null!=t.readBuffer&&t.readBuffer(36064+this.__fbo.whichColorAttachment(this)),t.readPixels(0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,i),t.bindFramebuffer(t.FRAMEBUFFER,null),i}downloadTexturePixelData(){const e=this.getTexturePixelData(),t=document.createElement("canvas");t.width=this.__width,t.height=this.__height;const n=t.getContext("2d"),i=new ImageData(new Uint8ClampedArray(e.buffer),this.__width,this.__height);n.putImageData(i,this.__width,this.__height);const o=t.toDataURL("image/png"),a=document.createElement("a"),r=document.createEvent("MouseEvent");a.href=o,a.download="texture.png",r.initEvent("click",!0,!0),a.dispatchEvent(r)}getPixelValueAt(e,t,n){let i=n;return i||(i=this.getTexturePixelData()),l.Lt.fromCopyArray([i[4*(t*this.width+e)+0],i[4*(t*this.width+e)+1],i[4*(t*this.width+e)+2],i[4*(t*this.width+e)+3]])}generateMipmap(){const e=s.F.getWebGLResourceRepository(),t=e.currentWebGLContextWrapper.getRawContext(),n=e.getWebGLResource(this._textureResourceUid);t.bindTexture(t.TEXTURE_2D,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)}}},580:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(1296),o=n(7987);class a{constructor(e){var t,n;this.__samplerResourceUid=-1,this.__minFilter=e.minFilter,this.__magFilter=e.magFilter,this.__wrapS=e.wrapS,this.__wrapT=e.wrapT,this.__wrapR=null!==(t=e.wrapR)&&void 0!==t?t:i.dI.Repeat,this.__anisotropy=null===(n=e.anisotropy)||void 0===n||n}create(){const e=o.F.getWebGLResourceRepository();this.__samplerResourceUid=e.createTextureSampler({minFilter:this.__minFilter,magFilter:this.__magFilter,wrapS:this.__wrapS,wrapT:this.__wrapT,wrapR:this.__wrapR,anisotropy:this.__anisotropy})}get minFilter(){return this.__minFilter}get magFilter(){return this.__magFilter}get wrapS(){return this.__wrapS}get wrapT(){return this.__wrapT}get wrapR(){return this.__wrapR}get _samplerResourceUid(){return this.__samplerResourceUid}}},2575:(e,t,n)=>{"use strict";n.d(t,{x:()=>u});var i=n(9216),o=n(3999),a=n(5981),r=n(7290),s=n(7987),l=n(3258),c=n(3449),_=n(3667),h=n(2251);class u extends r.y{constructor(){super(),this.autoResize=!0,this.autoDetectTransparency=!1}generateTextureFromBasis(e,t){var n;this.__startedToLoad=!0,"undefined"==typeof BASIS&&console.error("Failed to call BASIS() function. Please check to import basis_transcoder.js."),u.__loadedBasisFunc?u.__BasisFile?this.__setBasisTexture(e,t):null===(n=u.__basisLoadPromise)||void 0===n||n.then((()=>{this.__setBasisTexture(e,t)})):(u.__loadedBasisFunc=!0,u.__basisLoadPromise=new Promise((n=>{BASIS().then((i=>{const{initializeBasis:o}=i;o(),u.__BasisFile=i.BasisFile,this.__setBasisTexture(e,t),n()}))})))}__setBasisTexture(e,{level:t=0,internalFormat:n=a.d.RGBA8,format:l=i.V.RGBA,type:c=o.r.UnsignedByte,generateMipmap:_=!0}={}){this.__startedToLoad=!0;const h=new u.__BasisFile(e);if(!h.startTranscoding())return console.error("failed to start transcoding."),h.close(),void h.delete();const d=s.F.getWebGLResourceRepository().createCompressedTextureFromBasis(h,{border:0,format:l,type:c});this._textureResourceUid=d,this.__isTextureReady=!0,r.y.__textureMap.set(d,this),h.close(),h.delete()}async generateTextureFromKTX2(e){this.__startedToLoad=!0;const t=await _.N.getInstance().transcode(e);this.__width=t.width,this.__height=t.height,this.generateCompressedTextureWithMipmapFromTypedArray(t.mipmapData,t.compressionTextureType)}generateTextureFromImage(e,{level:t=0,internalFormat:n=a.d.RGBA8,format:_=i.V.RGBA,type:h=o.r.UnsignedByte,generateMipmap:u=!0}={}){this.__startedToLoad=!0,this.__htmlImageElement=e;let d=e;if(this.autoResize){const[e,t,n]=c.j.getResizedCanvas(d,l.D.maxSizeLimitOfNonCompressedTexture);d=e,this.__width=t,this.__height=n,this.__htmlCanvasElement=e}this.autoDetectTransparency&&(this.__hasTransparentPixels=c.j.detectTransparentPixelExistence(d)),this.__width=d.width,this.__height=d.height;const m=s.F.getWebGLResourceRepository();let f;if(d instanceof HTMLImageElement)f=m.createTextureFromHTMLImageElement(d,{level:t,internalFormat:n,width:this.__width,height:this.__height,border:0,format:_,type:h,generateMipmap:u});else{if(!(d instanceof HTMLCanvasElement))throw new Error("Unsupported image type.");f=m.createTextureFromImageBitmapData(d,{level:t,internalFormat:n,width:this.__width,height:this.__height,border:0,format:_,type:h,generateMipmap:u})}this._textureResourceUid=f,this.__isTextureReady=!0,this.__uri=e.src,r.y.__textureMap.set(f,this)}generateTextureFromUri(e,{level:t=0,internalFormat:n=a.d.RGBA8,format:_=i.V.RGBA,type:h=o.r.UnsignedByte,generateMipmap:u=!0}={}){return this.__uri=e,this.__startedToLoad=!0,new Promise(((i,o)=>{this.__img=new Image,e.match(/^data:/)||(this.__img.crossOrigin="Anonymous"),this.__img.onload=()=>{this.__htmlImageElement=this.__img;let e=this.__img;if(this.autoResize){const[t,n,i]=c.j.getResizedCanvas(e,l.D.maxSizeLimitOfNonCompressedTexture);e=t,this.__width=n,this.__height=i,this.__htmlCanvasElement=t}this.autoDetectTransparency&&(this.__hasTransparentPixels=c.j.detectTransparentPixelExistence(e)),this.__width=e.width,this.__height=e.height;const o=s.F.getWebGLResourceRepository();let a;if(e instanceof HTMLImageElement)a=o.createTextureFromHTMLImageElement(e,{level:t,internalFormat:n,width:this.__width,height:this.__height,border:0,format:_,type:h,generateMipmap:u});else{if(!(e instanceof HTMLCanvasElement))throw new Error("Unsupported image type");a=o.createTextureFromImageBitmapData(e,{level:t,internalFormat:n,width:this.__width,height:this.__height,border:0,format:_,type:h,generateMipmap:u})}this._textureResourceUid=a,this.__isTextureReady=!0,r.y.__textureMap.set(a,this),i()},this.__img.src=e}))}generate1x1TextureFrom(e="rgba(255,255,255,1)"){const t=document.createElement("canvas");t.width=1,t.height=1,this.__width=1,this.__height=1;const n=t.getContext("2d");n.fillStyle=e,n.fillRect(0,0,1,1);const l=s.F.getWebGLResourceRepository().createTextureFromImageBitmapData(t,{level:0,internalFormat:a.d.RGBA8,width:1,height:1,border:0,format:i.V.RGBA,type:o.r.UnsignedByte,generateMipmap:!1});this._textureResourceUid=l,this.__isTextureReady=!0,r.y.__textureMap.set(l,this)}async generateSheenLutTextureFromDataUri(){const e=h.x.getInstance().getModule("pbr"),t=s.F.getWebGLResourceRepository(),n=await t.createTextureFromDataUri(e.sheen_E_and_DGTerm,{level:0,internalFormat:a.d.RGBA8,border:0,format:i.V.RGBA,type:o.r.UnsignedByte,generateMipmap:!1});this._textureResourceUid=n,this.__isTextureReady=!0,r.y.__textureMap.set(n,this)}generateTextureFromTypedArray(e,{level:t=0,internalFormat:n=a.d.RGBA8,format:l=i.V.RGBA,generateMipmap:c=!0}={}){const _=o.r.fromTypedArray(e),h=s.F.getWebGLResourceRepository().createTextureFromTypedArray(e,{level:t,internalFormat:n,width:this.__width,height:this.__height,border:0,format:l,type:_,generateMipmap:c});this._textureResourceUid=h,this.__isTextureReady=!0,r.y.__textureMap.set(h,this)}generateCompressedTextureFromTypedArray(e,t,n,i){this.__width=t,this.__height=n;const o={level:0,width:t,height:n,buffer:e},a=s.F.getWebGLResourceRepository().createCompressedTexture([o],i);this._textureResourceUid=a,this.__isTextureReady=!0,r.y.__textureMap.set(a,this)}generateCompressedTextureWithMipmapFromTypedArray(e,t){const n=e.find((e=>0===e.level));if(null==n)throw new Error("texture data with level 0 is not found");this.__width=n.width,this.__height=n.height;const i=s.F.getWebGLResourceRepository().createCompressedTexture(e,t);this._textureResourceUid=i,this.__isTextureReady=!0,r.y.__textureMap.set(i,this)}importWebGLTextureDirectly(e,t=0,n=0){this.__width=t,this.__height=n;const i=s.F.getWebGLResourceRepository().setWebGLTextureDirectly(e);this._textureResourceUid=i,this.__startedToLoad=!0,this.__isTextureReady=!0,r.y.__textureMap.set(i,this)}destroy3DAPIResources(){return r.y.__textureMap.delete(this._textureResourceUid),s.F.getWebGLResourceRepository().deleteTexture(this._textureResourceUid),this._textureResourceUid=s.F.InvalidCGAPIResourceUid,this.__isTextureReady=!1,this.__startedToLoad=!1,!0}}u.__loadedBasisFunc=!1},9849:(e,t,n)=>{"use strict";n.d(t,{h:()=>i});class i{constructor(e,t,n){this.__channels=n,this.__width=e,this.__height=t,this.__data=new Float32Array(e*t*n)}resize(e,t,n){this.__width=e,this.__height=t,this.__channels=n,this.__data=new Float32Array(i.transfer(this.__data.buffer,e*t*n*4))}setPixelAtChannel(e,t,n,i){this.__data[t*this.__width*this.__channels+e*this.__channels+n]=i}get width(){return this.__width}get height(){return this.__height}get data(){return this.__data}getPixel(e,t,n){return this.__data[t*this.__width*this.__channels+e*this.__channels+n]}getPixelAs(e,t,n,i){return 3===n?new i(new Float32Array([this.__data[t*this.__width*this.__channels+e*this.__channels+0],this.__data[t*this.__width*this.__channels+e*this.__channels+1],this.__data[t*this.__width*this.__channels+e*this.__channels+2]])):4===n?new i(new Float32Array([this.__data[t*this.__width*this.__channels+e*this.__channels+0],this.__data[t*this.__width*this.__channels+e*this.__channels+1],this.__data[t*this.__width*this.__channels+e*this.__channels+2],this.__data[t*this.__width*this.__channels+e*this.__channels+3]])):void 0}getPixelAsArray(e,t){const n=[];for(let i=0;i=e.byteLength){let t=0,i=e.byteLength;[8,4,2,1].forEach((o=>{if(i>=o){const a=function(e,t,n,i,o){let a=Uint8Array;switch(e){case 8:a=Float64Array;break;case 4:a=Float32Array;break;case 2:a=Uint16Array;break;default:a=Uint8Array}const r=new a(t,i,Math.trunc(o/e)),s=new a(n,i,Math.trunc(o/e));for(let e=0;e{"use strict";n.r(t),n.d(t,{default:()=>i});const i=Object.freeze({sheen_E_and_DGTerm:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGkmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gP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()=>Dc,sxC:()=>jl,t75:()=>ql,tFw:()=>lc,tNI:()=>Wl,tV_:()=>He,t_W:()=>cs,tef:()=>tt,tkF:()=>Gn,tps:()=>zi,tqi:()=>Bi,ttq:()=>D,tzR:()=>Ce,u$A:()=>r,u3g:()=>xt,uCq:()=>h,uER:()=>ja,uJm:()=>si,uLG:()=>Ya,uM4:()=>Ka,uU2:()=>vs,ubh:()=>kr,uik:()=>U,uri:()=>Ml,utc:()=>En,uyr:()=>xh,uyu:()=>An,uzX:()=>Jn,vC$:()=>Kn,vEJ:()=>ul,vEN:()=>Ye,vEp:()=>Ar,vHc:()=>Jl,vPW:()=>Cr,vPm:()=>ji,vTv:()=>Cn,vUb:()=>Oi,vWN:()=>al,vce:()=>Ss,vgW:()=>Ni,vnd:()=>Vt,voy:()=>zo,vpR:()=>Y_,vtI:()=>u,w4x:()=>as,w8k:()=>Qi,w97:()=>q,w9H:()=>cr,wA8:()=>fh,wER:()=>yr,wEd:()=>Fl,wGk:()=>It,wIF:()=>it,wMK:()=>Go,wSW:()=>Vi,wVD:()=>bt,wWb:()=>Tn,wXe:()=>ur,w_G:()=>$r,wce:()=>Z,wm0:()=>Zl,wpZ:()=>K_,wrZ:()=>an,x6H:()=>nl,xHF:()=>R,xIw:()=>lr,xR7:()=>oe,xUI:()=>Ol,xp:()=>ye,xug:()=>e_,xyr:()=>Di,y$A:()=>yo,y1m:()=>Ur,y3j:()=>Hs,y3r:()=>Uc,y8S:()=>_l,y9I:()=>Ft,yD3:()=>zt,yYj:()=>Pi,yZM:()=>o_,yZh:()=>Ac,ycd:()=>Cc,yd2:()=>xs,yun:()=>Al,yx3:()=>Da,z8r:()=>tc,zSL:()=>K,zSP:()=>Be,zfW:()=>Xl,zsc:()=>wa});const i=256,o=1024,a=16384,r=0,s=1,l=2,c=3,_=4,h=5,u=6,d=0,m=1,f=768,p=769,v=770,A=771,y=772,g=773,x=774,I=775,b=776,E=32769,T=32770,S=32771,C=32772,w=32774,R=32778,P=32779,D=32777,M=32777,N=34877,B=32968,L=32969,F=32970,G=32971,V=32773,z=34964,O=34965,U=2849,k=33901,Q=33902,W=2885,X=2886,q=2928,H=2930,j=2931,Y=2932,K=2961,J=2962,Z=2964,$=2965,ee=2966,te=2967,ne=2963,ie=2968,oe=34816,ae=34817,re=34818,se=34819,le=36003,ce=36004,_e=36005,he=2978,ue=3088,de=3106,me=3107,fe=3317,pe=3333,ve=3379,Ae=3386,ye=3408,ge=3410,xe=3411,Ie=3412,be=3413,Ee=3414,Te=3415,Se=10752,Ce=32824,we=32873,Re=32936,Pe=32937,De=32938,Me=32939,Ne=34467,Be=7936,Le=7937,Fe=7938,Ge=35738,Ve=35739,ze=37444,Oe=35044,Ue=35040,ke=35048,Qe=34962,We=34963,Xe=34660,qe=34661,He=34342,je=34338,Ye=34339,Ke=34340,Je=34341,Ze=34922,$e=34373,et=34975,tt=2884,nt=1028,it=1029,ot=1032,at=3042,rt=2929,st=3024,lt=32823,ct=32926,_t=32928,ht=3089,ut=2960,dt=0,mt=1280,ft=1281,pt=1282,vt=1285,At=37442,yt=2304,gt=2305,xt=4352,It=4353,bt=4354,Et=33170,Tt=5120,St=5121,Ct=5122,wt=5123,Rt=5124,Pt=5125,Dt=5126,Mt=6402,Nt=6406,Bt=6407,Lt=6408,Ft=6409,Gt=6410,Vt=5121,zt=32819,Ot=32820,Ut=33635,kt=35632,Qt=35633,Wt=35713,Xt=35712,qt=35714,Ht=35715,jt=35717,Yt=35721,Kt=35718,Jt=34921,Zt=36347,$t=36348,en=35661,tn=35660,nn=34930,on=36349,an=35663,rn=35724,sn=35725,ln=512,cn=519,_n=513,hn=514,un=515,dn=516,mn=518,fn=517,pn=7680,vn=7681,An=7682,yn=7683,gn=5386,xn=34055,In=34056,bn=9728,En=9729,Tn=9984,Sn=9985,Cn=9986,wn=9987,Rn=10240,Pn=10241,Dn=10242,Mn=10243,Nn=3553,Bn=5890,Ln=34067,Fn=34068,Gn=34069,Vn=34070,zn=34071,On=34072,Un=34073,kn=34074,Qn=34076,Wn=33984,Xn=33985,qn=33986,Hn=33987,jn=33988,Yn=33989,Kn=33990,Jn=33991,Zn=33992,$n=33993,ei=33994,ti=33995,ni=33996,ii=33997,oi=33998,ai=33999,ri=34e3,si=34001,li=34002,ci=34003,_i=34004,hi=34005,ui=34006,di=34007,mi=34008,fi=34009,pi=34010,vi=34011,Ai=34012,yi=34013,gi=34014,xi=34015,Ii=34016,bi=10497,Ei=33071,Ti=33648,Si=35664,Ci=35665,wi=35666,Ri=35667,Pi=35668,Di=35669,Mi=35670,Ni=35671,Bi=35672,Li=35673,Fi=35674,Gi=35675,Vi=35676,zi=35678,Oi=35680,Ui=36336,ki=36337,Qi=36338,Wi=36339,Xi=36340,qi=36341,Hi=36160,ji=36161,Yi=32854,Ki=32855,Ji=36194,Zi=33189,$i=6401,eo=36168,to=34041,no=36162,io=36163,oo=36164,ao=36176,ro=36177,so=36178,lo=36179,co=36180,_o=36181,ho=36048,uo=36049,mo=36050,fo=36051,po=36064,vo=36096,Ao=36128,yo=33306,go=0,xo=36053,Io=36054,bo=36055,Eo=36057,To=36061,So=36006,Co=36007,wo=34024,Ro=1286,Po=37440,Do=37441,Mo=37443,No=3074,Bo=3314,Lo=3315,Fo=3316,Go=3330,Vo=3331,zo=3332,Oo=32874,Uo=32877,ko=32878,Qo=32883,Wo=33e3,Xo=33001,qo=34045,Ho=35657,jo=35658,Yo=35071,Ko=35076,Jo=35077,Zo=35659,$o=35723,ea=35977,ta=34229,na=37154,ia=37157,oa=37137,aa=36203,ra=6403,sa=32849,la=32856,ca=32857,_a=32879,ha=32882,ua=33082,da=33083,ma=33084,fa=33085,pa=34892,va=34893,Aa=35904,ya=35905,ga=35907,xa=34894,Ia=34836,ba=34837,Ea=34842,Ta=34843,Sa=35866,Ca=35869,wa=35898,Ra=35901,Pa=36208,Da=36209,Ma=36214,Na=36215,Ba=36220,La=36221,Fa=36226,Ga=36227,Va=36232,za=36233,Oa=36238,Ua=36239,ka=36244,Qa=36248,Wa=36249,Xa=33321,qa=33323,Ha=33325,ja=33326,Ya=33327,Ka=33328,Ja=33329,Za=33330,$a=33331,er=33332,tr=33333,nr=33334,ir=33335,or=33336,ar=33337,rr=33338,sr=33339,lr=33340,cr=36756,_r=36757,hr=36758,ur=36759,dr=36975,mr=37167,fr=33503,pr=33640,vr=35899,Ar=35902,yr=36269,gr=34042,xr=5131,Ir=33319,br=33320,Er=36255,Tr=34917,Sr=34918,Cr=34919,wr=35887,Rr=36202,Pr=34852,Dr=34853,Mr=34854,Nr=34855,Br=34856,Lr=34857,Fr=34858,Gr=34859,Vr=34860,zr=34861,Or=34862,Ur=34863,kr=34864,Qr=34865,Wr=34866,Xr=34867,qr=34868,Hr=36063,jr=36065,Yr=36066,Kr=36067,Jr=36068,Zr=36069,$r=36070,es=36071,ts=36072,ns=36073,is=36074,os=36075,as=36076,rs=36077,ss=36078,ls=36079,cs=35679,_s=35682,hs=36289,us=36292,ds=36293,ms=36298,fs=36299,ps=36300,vs=36303,As=36306,ys=36307,gs=36308,xs=36311,Is=36183,bs=35097,Es=35051,Ts=35052,Ss=35053,Cs=35055,ws=36662,Rs=36663,Ps=36662,Ds=36663,Ms=35685,Ns=35686,Bs=35687,Ls=35688,Fs=35689,Gs=35690,Vs=36294,zs=36295,Os=36296,Us=35863,ks=36764,Qs=35069,Ws=35070,Xs=35967,qs=35968,Hs=35971,js=35972,Ys=35973,Ks=35976,Js=35978,Zs=35979,$s=35980,el=35981,tl=35982,nl=35983,il=36386,ol=36387,al=36388,rl=36389,sl=33296,ll=33297,cl=33298,_l=33299,hl=33300,ul=33301,dl=33302,ml=33303,fl=33304,pl=35056,vl=36006,Al=36008,yl=36009,gl=36010,xl=36011,Il=36052,bl=36182,El=35345,Tl=35368,Sl=35369,Cl=35370,wl=35371,Rl=35373,Pl=35374,Dl=35375,Ml=35376,Nl=35377,Bl=35379,Ll=35380,Fl=35382,Gl=35383,Vl=35384,zl=35386,Ol=35387,Ul=35388,kl=35389,Ql=35390,Wl=35391,Xl=35392,ql=35394,Hl=35395,jl=35396,Yl=35398,Kl=37138,Jl=37139,Zl=37140,$l=37141,ec=37142,tc=37143,nc=37144,ic=37145,oc=37146,ac=37147,rc=37148,sc=37149,lc=1,cc=6144,_c=6145,hc=6146,uc=32775,dc=32776,mc=33190,fc=35041,pc=35042,vc=35045,Ac=35046,yc=35049,gc=35050,xc=36012,Ic=36013,bc=4294967295,Ec=-1,Tc=37447,Sc=35070,Cc=37445,wc=37446,Rc=34047,Pc=34046,Dc=33776,Mc=33777,Nc=33778,Bc=33779,Lc=35916,Fc=35917,Gc=35918,Vc=35919,zc=37488,Oc=37489,Uc=37490,kc=37491,Qc=37492,Wc=37493,Xc=37494,qc=37495,Hc=37496,jc=37497,Yc=35840,Kc=35842,Jc=35841,Zc=35843,$c=36196,e_=35986,t_=35986,n_=34798,i_=37808,o_=37809,a_=37810,r_=37811,s_=37812,l_=37813,c_=37814,__=37815,h_=37816,u_=37817,d_=37818,m_=37819,f_=37820,p_=37821,v_=37840,A_=37841,y_=37842,g_=37843,x_=37844,I_=37845,b_=37846,E_=37847,T_=37848,S_=37849,C_=37850,w_=37851,R_=37852,P_=37853,D_=34042,M_=36193,N_=34836,B_=34837,L_=33297,F_=35863,G_=32775,V_=32776,z_=35904,O_=35906,U_=35907,k_=33296,Q_=35723,W_=36064,X_=36065,q_=36066,H_=36067,j_=36068,Y_=36069,K_=36070,J_=36071,Z_=36072,$_=36073,eh=36074,th=36075,nh=36076,ih=36077,oh=36078,ah=36079,rh=34853,sh=34854,lh=34855,ch=34856,_h=34857,hh=34858,uh=34859,dh=34860,mh=34861,fh=34862,ph=34863,vh=34864,Ah=34865,yh=34866,gh=34867,xh=34868,Ih=36063,bh=34852,Eh=34229,Th=34916,Sh=34917,Ch=34918,wh=34919,Rh=35007,Ph=36392,Dh=36795},4350:(e,t,n)=>{"use strict";n.d(t,{C:()=>o,j:()=>i});const i="gltf_node_index";function o(e,t){return e.magFilter===t.magFilter&&e.minFilter===t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sxC:()=>a.sxC,q__:()=>a.q__,DBb:()=>a.DBb,mMN:()=>a.mMN,rve:()=>a.rve,o7C:()=>a.o7C,HM$:()=>a.HM$,mS1:()=>a.mS1,xUI:()=>a.xUI,djG:()=>a.djG,Kn4:()=>a.Kn4,jGD:()=>a.jGD,ycd:()=>a.ycd,GM3:()=>a.GM3,XxT:()=>a.XxT,PYx:()=>a.PYx,EVZ:()=>a.EVZ,WYY:()=>a.WYY,m7j:()=>a.m7j,SK7:()=>a.SK7,YrP:()=>a.YrP,bd_:()=>a.bd_,n9O:()=>a.n9O,nQ9:()=>a.nQ9,bTv:()=>a.bTv,iyB:()=>a.iyB,LX0:()=>a.LX0,vEp:()=>a.vEp,Zx4:()=>a.Zx4,yd2:()=>a.yd2,ZtN:()=>a.ZtN,lg3:()=>a.lg3,DAo:()=>a.DAo,TAU:()=>a.TAU,Ki3:()=>a.Ki3,Dr$:()=>a.Dr$,$z8:()=>a.$z8,eQR:()=>a.eQR,zSP:()=>a.zSP,$bm:()=>a.$bm,RGR:()=>a.RGR,fsT:()=>a.fsT,HRE:()=>a.HRE,LUh:()=>a.LUh,C9t:()=>a.C9t,I4M:()=>a.I4M,XZ2:()=>a.XZ2,s7G:()=>a.s7G,bsK:()=>a.bsK,vEN:()=>a.vEN,cqm:()=>a.cqm,eFf:()=>a.eFf,lQo:()=>a.lQo,Ith:()=>a.Ith,GIj:()=>a.GIj,_sJ:()=>a._sJ,j3U:()=>r.j,bup:()=>o,CLY:()=>r.C});var i=n(810);function o(e){switch(e.className){case"Scalar":return i.d.Scalar;case"Vector2":return i.d.Vec2;case"Vector3":return i.d.Vec3;case"Vector4":return i.d.Vec4;case"Matrix22":return i.d.Mat2;case"Matrix33":return i.d.Mat3;case"Matrix44":return i.d.Mat4;default:return console.error("CompositionType.Unknown"),i.d.Unknown}}var a=n(7461),r=n(4350)},5551:(e,t,n)=>{"use strict";n.d(t,{d:()=>m});var i,o,a,r,s,l,c=n(3346),_=n(7192),h=function(e,t,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(e,n):o?o.value=n:t.set(e,n),n},u=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};const d=-1;class m{constructor(e,t,n){this.__webglVersion=1,this.width=0,this.height=0,this.__activeTextureBackup=-1,this.__activeTextures2D=[],this.__activeTexturesCube=[],this.__isDebugMode=!1,this.__viewport_left=0,this.__viewport_top=0,this.__viewport_width=0,this.__viewport_height=0,this.__default_viewport_left=0,this.__default_viewport_top=0,this.__default_viewport_width=0,this.__default_viewport_height=0,i.set(this,d),o.set(this,d),a.set(this,d),r.set(this,d),s.set(this,d),l.set(this,d),this.__maxVertexUniformVectors=d,this.__maxFragmentUniformVectors=d,this._isWebXRMode=!1,this.__extensions=new Map,this.__gl=e,this.width=t.width,this.height=t.height,this.canvas=t,this.__viewport_width=this.__default_viewport_width=this.width,this.__viewport_height=this.__default_viewport_height=this.height,this.__isDebugMode=n,this.is_multiview=!0,"WebGL2RenderingContext"===this.__gl.constructor.name&&(this.__webglVersion=2,this.webgl2ExtTFL=this.__getExtension(c.c.TextureFloatLinear),this.webgl2ExtTFA=this.__getExtension(c.c.TextureFilterAnisotropic),this.webgl2ExtCBF=this.__getExtension(c.c.ColorBufferFloatWebGL2),this.webgl2ExtCBHF=this.__getExtension(c.c.ColorBufferHalfFloatWebGL2),this.webgl2ExtCTAstc=this.__getCompressedTextureExtension(c.c.CompressedTextureAstc),this.webgl2ExtCTS3tc=this.__getCompressedTextureExtension(c.c.CompressedTextureS3tc),this.webgl2ExtCTPvrtc=this.__getCompressedTextureExtension(c.c.CompressedTexturePvrtc),this.webgl2ExtCTAtc=this.__getCompressedTextureExtension(c.c.CompressedTextureAtc),this.webgl2ExtCTEtc=this.__getCompressedTextureExtension(c.c.CompressedTextureEtc),this.webgl2ExtCTEtc1=this.__getCompressedTextureExtension(c.c.CompressedTextureEtc1),this.webgl2ExtCTBptc=this.__getCompressedTextureExtension(c.c.CompressedTextureBptc),this.webgl2ExtMLTVIEW=this.__getExtension(c.c.OculusMultiview),this.webgl2ExtMLTVIEW?this.webgl2ExtMLTVIEW.is_multisample=!0:(this.webgl2ExtMLTVIEW=this.__getExtension(c.c.OvrMultiview2),this.webgl2ExtMLTVIEW?this.webgl2ExtMLTVIEW.is_multisample=!1:(console.warn("Neither OCULUS_multiview nor OVR_multiview2 extensions are supported"),this.is_multiview=!1)),this.webgl2ExtGmanWM=this.__getCompressedTextureExtension(c.c.GMAN_WEBGL_MEMORY)),this.__getUniformBufferInfo(),this.__getMaxUniformVectors()}getRawContext(){return this.__gl}getRawContextAsWebGL1(){return this.__gl}getRawContextAsWebGL2(){return this.__gl}get viewport(){return _.Lt.fromCopyArray([this.__viewport_left,this.__viewport_top,this.__viewport_width,this.__viewport_height])}get defaultViewport(){return _.Lt.fromCopyArray([this.__default_viewport_left,this.__default_viewport_top,this.__default_viewport_width,this.__default_viewport_height])}isSupportWebGL1Extension(e){return!!this.__getExtension(e)}isNotSupportWebGL1Extension(e){return!this.isSupportWebGL1Extension(e)}get isDebugMode(){return this.__isDebugMode}getIsWebGL2(e){return this.isWebGL2}get isWebGL2(){return 2===this.__webglVersion}createVertexArray(){return this.getIsWebGL2(this.__gl)?this.__gl.createVertexArray():null!=this.webgl1ExtVAO?this.webgl1ExtVAO.createVertexArrayOES():void 0}deleteVertexArray(e){this.getIsWebGL2(this.__gl)?this.__gl.deleteVertexArray(e):null!=this.webgl1ExtVAO&&this.webgl1ExtVAO.deleteVertexArrayOES(e)}bindVertexArray(e){this.getIsWebGL2(this.__gl)?this.__gl.bindVertexArray(e):null!=this.webgl1ExtVAO&&this.webgl1ExtVAO.bindVertexArrayOES(e)}vertexAttribDivisor(e,t){this.getIsWebGL2(this.__gl)?this.__gl.vertexAttribDivisor(e,t):this.webgl1ExtIA.vertexAttribDivisorANGLE(e,t)}drawElementsInstanced(e,t,n,i,o){this.getIsWebGL2(this.__gl)?this.__gl.drawElementsInstanced(e,t,n,i,o):this.webgl1ExtIA.drawElementsInstancedANGLE(e,t,n,i,o)}drawArraysInstanced(e,t,n,i){this.getIsWebGL2(this.__gl)?this.__gl.drawArraysInstanced(e,t,n,i):this.webgl1ExtIA.drawArraysInstancedANGLE(e,t,n,i)}colorAttachment(e){return 36064+e}drawBuffers(e){const t=this.__gl;if(0===e.length)return void t.drawBuffers([t.NONE]);const n=e[0].webGLConstantValue();t.drawBuffers(e.map((e=>e.webGLConstantValue()))),n===t.NONE||0===e.length?t.colorMask(!1,!1,!1,!1):t.colorMask(!0,!0,!0,!0)}__activeTexture(e){if(this.__activeTextureBackup!==e){switch(e){case 0:this.__gl.activeTexture(this.__gl.TEXTURE0);break;case 1:this.__gl.activeTexture(this.__gl.TEXTURE1);break;case 2:this.__gl.activeTexture(this.__gl.TEXTURE2);break;case 3:this.__gl.activeTexture(this.__gl.TEXTURE3);break;case 4:this.__gl.activeTexture(this.__gl.TEXTURE4);break;case 5:this.__gl.activeTexture(this.__gl.TEXTURE5);break;case 6:this.__gl.activeTexture(this.__gl.TEXTURE6);break;case 7:this.__gl.activeTexture(this.__gl.TEXTURE7);break;case 8:this.__gl.activeTexture(this.__gl.TEXTURE8);break;case 9:this.__gl.activeTexture(this.__gl.TEXTURE9);break;case 10:this.__gl.activeTexture(this.__gl.TEXTURE10);break;case 11:this.__gl.activeTexture(this.__gl.TEXTURE11);break;case 12:this.__gl.activeTexture(this.__gl.TEXTURE12);break;case 13:this.__gl.activeTexture(this.__gl.TEXTURE13);break;case 14:this.__gl.activeTexture(this.__gl.TEXTURE14);break;case 15:this.__gl.activeTexture(this.__gl.TEXTURE15)}this.__activeTextureBackup=e}}bindTexture2D(e,t){this.__activeTexture(e),this.__gl.bindTexture(this.__gl.TEXTURE_2D,t),this.__activeTextures2D[e]=t}bindTextureSampler(e,t){this.__gl.bindSampler(e,t)}bindTextureCube(e,t){this.__activeTexture(e),this.__gl.bindTexture(this.__gl.TEXTURE_CUBE_MAP,t),this.__activeTexturesCube[e]=t}unbindTexture2D(e){this.__activeTexture(e),this.__gl.bindTexture(this.__gl.TEXTURE_2D,null),delete this.__activeTextures2D[e]}unbindTextureCube(e){this.__activeTexture(e),this.__gl.bindTexture(this.__gl.TEXTURE_CUBE_MAP,null),delete this.__activeTexturesCube[e]}unbindTextures(){for(let e=0;e{"use strict";n.d(t,{c:()=>P});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:1,str:"OES_vertex_array_object"}),r=new o({index:2,str:"OES_texture_float"}),s=new o({index:3,str:"OES_texture_half_float"}),l=new o({index:4,str:"OES_texture_float_linear"}),c=new o({index:5,str:"OES_texture_half_float_linear"}),_=new o({index:6,str:"ANGLE_instanced_arrays"}),h=new o({index:7,str:"EXT_texture_filter_anisotropic"}),u=new o({index:8,str:"OES_element_index_uint"}),d=new o({index:9,str:"EXT_shader_texture_lod"}),m=new o({index:10,str:"OES_standard_derivatives"}),f=new o({index:11,str:"WEBGL_draw_buffers"}),p=new o({index:12,str:"EXT_blend_minmax"}),v=new o({index:13,str:"WEBGL_color_buffer_float"}),A=new o({index:14,str:"WEBGL_compressed_texture_astc"}),y=new o({index:15,str:"WEBGL_compressed_texture_s3tc"}),g=new o({index:16,str:"WEBGL_compressed_texture_pvrtc"}),x=new o({index:17,str:"WEBGL_compressed_texture_atc"}),I=new o({index:18,str:"WEBGL_compressed_texture_etc"}),b=new o({index:19,str:"WEBGL_compressed_texture_etc1"}),E=new o({index:20,str:"EXT_texture_compression_bptc"}),T=new o({index:21,str:"GMAN_webgl_memory"}),S=new o({index:22,str:"EXT_color_buffer_float"}),C=new o({index:23,str:"EXT_color_buffer_half_float"}),w=new o({index:24,str:"OCULUS_multiview"}),R=new o({index:25,str:"OVR_multiview2"}),P=Object.freeze({VertexArrayObject:a,TextureFloat:r,TextureHalfFloat:s,TextureFloatLinear:l,TextureHalfFloatLinear:c,InstancedArrays:_,TextureFilterAnisotropic:h,ElementIndexUint:u,ShaderTextureLod:d,ShaderDerivatives:m,DrawBuffers:f,BlendMinmax:p,ColorBufferFloatWebGL1:v,CompressedTextureAstc:A,CompressedTextureS3tc:y,CompressedTexturePvrtc:g,CompressedTextureAtc:x,CompressedTextureEtc:I,CompressedTextureEtc1:b,CompressedTextureBptc:E,ColorBufferFloatWebGL2:S,ColorBufferHalfFloatWebGL2:C,OculusMultiview:w,OvrMultiview2:R,GMAN_WEBGL_MEMORY:T})},3952:(e,t,n)=>{"use strict";n.d(t,{x:()=>C});var i=n(7987),o=n(128),a=n(5981),r=n(9216),s=n(810),l=n(3999),c=n(5551),_=n(3032),h=n(4587),u=n(4392),d=n(1986),m=n(7192),f=n(8422),p=n(6098),v=n(3449),A=n(290),y=n(3346),g=n(4690),x=n(3648),I=n(3007),b=n(3258),E=n(7461),T=n(580);const S=n(3705);class C extends i.F{constructor(){super(),this.__webglContexts=new Map,this.__resourceCounter=i.F.InvalidCGAPIResourceUid,this.__webglResources=new Map,this.__samplerClampToEdgeLinearUid=i.F.InvalidCGAPIResourceUid,this.__samplerClampToEdgeNearestUid=i.F.InvalidCGAPIResourceUid,this.__samplerRepeatNearestUid=i.F.InvalidCGAPIResourceUid,this.__samplerRepeatLinearUid=i.F.InvalidCGAPIResourceUid,this.__samplerShadowUid=i.F.InvalidCGAPIResourceUid,this.__samplerRepeatTriLinearUid=i.F.InvalidCGAPIResourceUid,this.__samplerRepeatAnisotropyLinearUid=i.F.InvalidCGAPIResourceUid}static getInstance(){return this.__instance||(this.__instance=new C),this.__instance}addWebGLContext(e,t,n,i){const o=new c.d(e,t,i);this.__webglContexts.set("default",o),n&&(this.__glw=o)}generateWebGLContext(e,t,n,i,o,a=!0){const r=e.getContext("webgl2",o);return this.addWebGLContext(r,e,n,i),p.Kf.isSafari()&&(b.D.isUboEnabled=!1),r}get currentWebGLContextWrapper(){return this.__glw}getResourceNumber(){return++this.__resourceCounter}__registerResource(e){const t=this.getResourceNumber();return e._resourceUid=t,this.__webglResources.set(t,e),t}getWebGLResource(e){const t=this.__webglResources.get(e);return null!=t?t:null}createIndexBuffer(e){const t=this.__glw.getRawContext();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");this.__glw.bindVertexArray(null);const n=t.createBuffer(),i=this.__registerResource(n);return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.getTypedArray(),t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),i}updateIndexBuffer(e,t){const n=this.__glw,i=null==n?void 0:n.getRawContext();if(g.Is.not.exist(i))throw new Error("No WebGLRenderingContext set as Default.");const o=this.__webglResources.get(t);if(g.Is.not.exist(o))throw new Error("Not found IBO.");n.bindVertexArray(null),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,o),i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,0,e.getTypedArray()),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,null)}createVertexBuffer(e){const t=this.__glw.getRawContext();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");this.__glw.bindVertexArray(null);const n=t.createBuffer(),i=this.__registerResource(n);return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,e.bufferView.getUint8Array(),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),i}createVertexBufferFromTypedArray(e){const t=this.__glw.getRawContext();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");this.__glw.bindVertexArray(null);const n=t.createBuffer(),i=this.__registerResource(n);return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),i}updateVertexBuffer(e,t){const n=this.__glw,i=null==n?void 0:n.getRawContext();if(!g.Is.exist(i))throw new Error("No WebGLRenderingContext set as Default.");const o=this.__webglResources.get(t);if(!g.Is.exist(o))throw new Error("Not found VBO.");n.bindVertexArray(null),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferSubData(i.ARRAY_BUFFER,0,e.bufferView.getUint8Array()),i.bindBuffer(i.ARRAY_BUFFER,null)}createVertexArray(){if(null==this.__glw)throw new Error("No WebGLRenderingContext set as Default.");const e=this.__glw.createVertexArray();if(!g.Is.not.exist(e))return this.__registerResource(e)}bindTexture2D(e,t){const n=this.getWebGLResource(t);this.__glw.bindTexture2D(e,n)}bindTextureSampler(e,t){if(-1===t)this.__glw.bindTextureSampler(e,null);else{const n=this.getWebGLResource(t);this.__glw.bindTextureSampler(e,n)}}bindTextureCube(e,t){const n=this.getWebGLResource(t);this.__glw.bindTextureCube(e,n)}createVertexBufferAndIndexBuffer(e){let t;e.hasIndices()&&(t=this.createIndexBuffer(e.indicesAccessor));const n=[];for(let e=0;e{const r=this.createVertexBuffer(t),s=o.T.toAttributeSlotFromJoinedString(e.attributeSemantics[a]);n[s]=!0,i.push(r)})),{vaoHandle:-1,iboHandle:t,vboHandles:i,attributesFlags:n,setComplete:!1}}updateVertexBufferAndIndexBuffer(e,t){t.iboHandle&&this.updateIndexBuffer(e.indicesAccessor,t.iboHandle);const n=e.attributeAccessors;for(let e=0;e{s.bindAttribLocation(h,a[t].getAttributeSlot(),e)})),s.linkProgram(h),l&&!this.__checkShaderProgramLinkStatus(e.materialTypeName,h,t,n))return i.F.InvalidCGAPIResourceUid;h.__SPECTOR_rebuildProgram=this.rebuildProgramBySpector.bind(h);const u=this.__registerResource(h);return s.deleteShader(c),s.deleteShader(_),u}__checkShaderCompileStatus(e,t,n,i){const o=this.__glw.getRawContext();if(g.Is.false(o.getShaderParameter(t,o.COMPILE_STATUS))&&g.Is.false(o.isContextLost())){console.log("MaterialTypeName: "+e);const a=p.Kf.addLineNumberToCode(n);console.log(a);const r=o.getShaderInfoLog(t);return void 0===i?(console.error("An error occurred compiling the shaders:"+r),!1):(i(r),!1)}return!0}__checkShaderProgramLinkStatus(e,t,n,i){const o=this.__glw.getRawContext();if(g.Is.false(o.getProgramParameter(t,o.LINK_STATUS))&&g.Is.false(o.isContextLost())){console.log("MaterialTypeName: "+e),console.log(p.Kf.addLineNumberToCode("Vertex Shader:")),console.log(p.Kf.addLineNumberToCode(n)),console.log(p.Kf.addLineNumberToCode("Fragment Shader:")),console.log(p.Kf.addLineNumberToCode(i));const a=o.getProgramInfoLog(t);return console.error("Unable to initialize the shader program: "+a),!1}return!0}setupUniformLocations(e,t,n){const i=this.__glw,o=i.getRawContext(),a=this.getWebGLResource(e),r=t.length;for(let e=0;e{const n=this.getWebGLResource(e);if(null==n)throw new Error("Nothing Element Array Buffer at index "+t);c.bindBuffer(c.ARRAY_BUFFER,n),c.enableVertexAttribArray(o.T.toAttributeSlotFromJoinedString(a.attributeSemantics[t])),c.vertexAttribPointer(o.T.toAttributeSlotFromJoinedString(a.attributeSemantics[t]),a.attributeCompositionTypes[t].getNumberOfComponents(),a.attributeComponentTypes[t].index,a.attributeAccessors[t].normalized,a.attributeAccessors[t].byteStride,a.attributeAccessors[t].byteOffsetInBufferView)})),r!==i.F.InvalidCGAPIResourceUid){const e=this.getWebGLResource(r);if(null==e)throw new Error("Nothing Element Array Buffer at index");c.bindBuffer(c.ARRAY_BUFFER,e),c.enableVertexAttribArray(o.T.Instance.getAttributeSlot()),c.vertexAttribPointer(o.T.Instance.getAttributeSlot(),s.d.Vec4.getNumberOfComponents(),l.r.Float.index,!1,0,0),this.__glw.vertexAttribDivisor(o.T.Instance.getAttributeSlot(),1)}c.bindBuffer(c.ARRAY_BUFFER,null),this.__glw.bindVertexArray(null),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,null)}createTexStorage2D({levels:e,internalFormat:t,width:n,height:i}){const o=this.__glw.getRawContextAsWebGL2(),a=o.createTexture();this.__glw.bindTexture2D(0,a),o.texStorage2D(E.CbE,e,t.index,n,i);const r=this.__registerResource(a);return this.__glw.unbindTexture2D(0),r}createTextureSampler({magFilter:e,minFilter:t,wrapS:n,wrapT:i,wrapR:o,anisotropy:a,isPremultipliedAlpha:r}){const s=this.__glw.getRawContextAsWebGL2(),l=s.createSampler(),c=this.__registerResource(l);return s.samplerParameteri(l,s.TEXTURE_MIN_FILTER,t.index),s.samplerParameteri(l,s.TEXTURE_MAG_FILTER,e.index),s.samplerParameteri(l,s.TEXTURE_WRAP_S,n.index),s.samplerParameteri(l,s.TEXTURE_WRAP_T,i.index),s.samplerParameteri(l,s.TEXTURE_WRAP_R,o.index),a&&this.__glw.webgl2ExtTFA&&s.samplerParameteri(l,this.__glw.webgl2ExtTFA.TEXTURE_MAX_ANISOTROPY_EXT,4),c}createOrGetTextureSamplerClampToEdgeLinear(){if(this.__samplerClampToEdgeLinearUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerClampToEdgeLinearUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE)}return this.__samplerClampToEdgeLinearUid}createOrGetTextureSamplerClampToEdgeNearest(){if(this.__samplerClampToEdgeNearestUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerClampToEdgeNearestUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE)}return this.__samplerClampToEdgeNearestUid}createOrGetTextureSamplerRepeatNearest(){if(this.__samplerRepeatNearestUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerRepeatNearestUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.REPEAT)}return this.__samplerRepeatNearestUid}createOrGetTextureSamplerRepeatLinear(){if(this.__samplerRepeatLinearUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerRepeatLinearUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.REPEAT)}return this.__samplerRepeatLinearUid}createOrGetTextureSamplerRepeatTriLinear(){if(this.__samplerRepeatTriLinearUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerRepeatTriLinearUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.REPEAT)}return this.__samplerRepeatTriLinearUid}createOrGetTextureSamplerShadow(){if(this.__samplerShadowUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerShadowUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.samplerParameteri(t,e.TEXTURE_COMPARE_FUNC,e.LESS)}return this.__samplerShadowUid}createOrGetTextureSamplerRepeatAnisotropyLinear(){if(this.__samplerRepeatAnisotropyLinearUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerRepeatAnisotropyLinearUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.REPEAT),e.samplerParameteri(t,this.__glw.webgl2ExtTFA.TEXTURE_MAX_ANISOTROPY_EXT,4)}return this.__samplerRepeatAnisotropyLinearUid}createTextureFromImageBitmapData(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:l}){const c=this.__glw.getRawContextAsWebGL2(),_=c.createTexture(),h=this.__registerResource(_);this.__glw.bindTexture2D(0,_);const u=l?Math.max(Math.log2(i),Math.log2(o)):1;return c.texStorage2D(E.CbE,u,n.index,i,o),c.texSubImage2D(c.TEXTURE_2D,0,0,0,r.index,s.index,e),this.__createTextureInner(c,i,o,l),h}__createTextureInner(e,t,n,i){_.k.isPowerOfTwoTexture(t,n)&&i&&1!==n&&1!==t&&e.generateMipmap(e.TEXTURE_2D),this.__glw.unbindTexture2D(0)}createTextureFromHTMLImageElement(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:l}){const c=this.__glw.getRawContextAsWebGL2(),_=c.createTexture(),h=this.__registerResource(_);this.__glw.bindTexture2D(0,_);const u=l?Math.max(Math.log2(i),Math.log2(o)):1;return c.texStorage2D(E.CbE,u,n.index,i,o),c.texSubImage2D(c.TEXTURE_2D,0,0,0,r.index,s.index,e),this.__createTextureInner(c,i,o,l),h}createTextureFromTypedArray(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:l}){const c=this.__glw.getRawContextAsWebGL2(),_=c.createTexture(),h=this.__registerResource(_);this.__glw.bindTexture2D(0,_);const u=l?Math.max(Math.log2(i),Math.log2(o)):1;return c.texStorage2D(E.CbE,u,n.index,i,o),c.texSubImage2D(c.TEXTURE_2D,0,0,0,i,o,r.index,s.index,e),this.__createTextureInner(c,i,o,l),h}createCompressedTexture(e,t){const n=this.__glw.getRawContext(),i=n.createTexture(),o=this.__registerResource(i);this.__glw.bindTexture2D(0,i);const a=t.index;for(const t of e)n.compressedTexImage2D(n.TEXTURE_2D,t.level,a,t.width,t.height,0,t.buffer);return this.__glw.unbindTexture2D(0),o}createCompressedTextureFromBasis(e,{border:t,format:n,type:i}){let o,a;const r=this.__glw.getRawContext(),s=r.createTexture(),l=this.__registerResource(s);r.bindTexture(r.TEXTURE_2D,s);const c=r.getExtension("WEBGL_compressed_texture_s3tc");c&&(o=A.l.BC3,a=c.COMPRESSED_RGBA_S3TC_DXT5_EXT);const _=r.getExtension("WEBGL_compressed_texture_etc1");_&&(o=A.l.ETC1,a=_.COMPRESSED_RGB_ETC1_WEBGL);const h=r.getExtension("WEBGL_compressed_texture_atc");h&&(o=A.l.ATC_RGBA,a=h.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL);const u=r.getExtension("WEBGL_compressed_texture_etc");u&&(o=A.l.ETC2,a=u.COMPRESSED_RGBA8_ETC2_EAC);const d=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");d&&(o=A.l.PVRTC1_RGBA,a=d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG);const m=r.getExtension("WEBGL_compressed_texture_astc");m&&(o=A.l.ASTC,a=m.COMPRESSED_RGBA_ASTC_4x4_KHR);const f=e.getNumLevels(0);for(let n=0;n=2?a.d.NearestMipmapNearest:a.d.Nearest,h=a.d.Nearest):(_=e>=2?a.d.LinearMipmapLinear:a.d.Linear,h=a.d.Linear);const u=new T.Z({wrapS:l,wrapT:c,minFilter:_,magFilter:h});u.create();const m=(e,t,a)=>{if(e.hdriFormat===d.c.HDR_LINEAR){const n=this.__glw.getRawContextAsWebGL2();n.texImage2D(t,a,n.RGB32F,e.width,e.height,0,n.RGB,n.FLOAT,e.dataFloat)}else e instanceof HTMLImageElement||e instanceof HTMLCanvasElement?o.texImage2D(t,a,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,e):o.texImage2D(t,a,o.RGBA,n/2**a,i/2**a,0,o.RGBA,o.UNSIGNED_BYTE,e)};for(let e=0;enew Promise(((t,a)=>{let r=0;const s=[];let c=".jpg";i===d.c.HDR_LINEAR?c=".hdr":i===d.c.RGBE_PNG&&(c=".RGBE.PNG");let _="_right_",h="_left_",u="_top_",m="_bottom_",f="_front_",p="_back_";n&&(_="_posx_",h="_negx_",u="_posy_",m="_negy_",f="_posz_",p="_negz_");const v=[[e+_+l+c,o.TEXTURE_CUBE_MAP_POSITIVE_X],[e+h+l+c,o.TEXTURE_CUBE_MAP_NEGATIVE_X],[e+u+l+c,o.TEXTURE_CUBE_MAP_POSITIVE_Y],[e+m+l+c,o.TEXTURE_CUBE_MAP_NEGATIVE_Y],[e+f+l+c,o.TEXTURE_CUBE_MAP_POSITIVE_Z],[e+p+l+c,o.TEXTURE_CUBE_MAP_NEGATIVE_Z]];for(let e=0;e{r++,s.push(o),6===r&&t(s)},o.onerror=()=>{a(o.uri)},o.src=v[e][0]}}));let c;try{c=await t()}catch(e){try{c=await t()}catch(e){console.error(`failed to load ${e}`)}}const _={};for(const e of c){switch(e.side){case o.TEXTURE_CUBE_MAP_POSITIVE_X:_.posX=e;break;case o.TEXTURE_CUBE_MAP_POSITIVE_Y:_.posY=e;break;case o.TEXTURE_CUBE_MAP_POSITIVE_Z:_.posZ=e;break;case o.TEXTURE_CUBE_MAP_NEGATIVE_X:_.negX=e;break;case o.TEXTURE_CUBE_MAP_NEGATIVE_Y:_.negY=e;break;case o.TEXTURE_CUBE_MAP_NEGATIVE_Z:_.negZ=e}0===l&&(r=e.width,s=e.height)}a.push(_)}return this.createCubeTexture(t,a,r,s)}createCubeTextureFromBasis(e,{magFilter:t=a.d.Linear,minFilter:n=a.d.LinearMipmapLinear,wrapS:i=a.d.Repeat,wrapT:o=a.d.Repeat,border:r=0}){const s=this.__glw.getRawContext();let l,c;const _=s.createTexture(),h=this.__registerResource(_);this.__glw.bindTextureCube(0,_);const u=s.getExtension("WEBGL_compressed_texture_s3tc");u&&(l=A.l.BC3,c=u.COMPRESSED_RGBA_S3TC_DXT5_EXT);const d=s.getExtension("WEBGL_compressed_texture_etc1");d&&(l=A.l.ETC1,c=d.COMPRESSED_RGB_ETC1_WEBGL);const m=s.getExtension("WEBGL_compressed_texture_atc");m&&(l=A.l.ATC_RGBA,c=m.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL);const f=s.getExtension("WEBGL_compressed_texture_etc");f&&(l=A.l.ETC2,c=f.COMPRESSED_RGBA8_ETC2_EAC);const p=s.getExtension("WEBGL_compressed_texture_pvrtc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");p&&(l=A.l.PVRTC1_RGBA,c=p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG);const v=s.getExtension("WEBGL_compressed_texture_astc");v&&(l=A.l.ASTC,c=v.COMPRESSED_RGBA_ASTC_4x4_KHR);const y=e.getNumImages(),g=e.getNumLevels(0);if(s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,i.index),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,o.index),g>=2)s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,n.index),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,t.index);else{let e=n;n===a.d.LinearMipmapLinear&&(e=a.d.Linear),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,e.index),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,t.index)}for(let t=0;t{const l=new Image;e.match(/^data:/)||(l.crossOrigin="Anonymous"),l.onload=()=>{const e=l.width,c=l.height,_=this.createTextureFromHTMLImageElement(l,{level:t,internalFormat:n,width:e,height:c,border:i,format:o,type:a,generateMipmap:r});s(_)},l.src=e}))}updateLevel0TextureAndGenerateMipmap(e,t,{width:n,height:i,format:o,type:a}){const r=this.getWebGLResource(e);this.__glw.bindTexture2D(0,r);const s=this.__glw.getRawContextAsWebGL2();s.texSubImage2D(s.TEXTURE_2D,0,0,0,n,i,o.index,a.index,t),s.generateMipmap(s.TEXTURE_2D),this.__glw.unbindTexture2D(0)}updateTexture(e,t,{level:n,xoffset:i,yoffset:o,width:a,height:r,format:s,type:l}){const c=this.getWebGLResource(e);this.__glw.bindTexture2D(0,c);const _=this.__glw.getRawContextAsWebGL2();_.texSubImage2D(_.TEXTURE_2D,n,0,0,a,r,s.index,l.index,t),this.__glw.unbindTexture2D(0)}deleteFrameBufferObject(e){const t=this.getWebGLResource(e),n=this.__glw.getRawContext();null!=t&&(n.deleteFramebuffer(t),this.__webglResources.delete(e))}deleteRenderBuffer(e){const t=this.__glw.getRawContext(),n=this.getWebGLResource(e);t.deleteRenderbuffer(n),this.__webglResources.delete(e)}deleteTexture(e){const t=this.getWebGLResource(e),n=this.__glw.getRawContext();null!=t&&(n.deleteTexture(t),this.__webglResources.delete(e))}createDummyTexture(e="rgba(255,255,255,1)"){const t=document.createElement("canvas");t.width=1,t.height=1;const n=t.getContext("2d");return n.fillStyle=e,n.fillRect(0,0,1,1),this.createTextureFromImageBitmapData(t,{level:0,internalFormat:a.d.RGBA8,width:1,height:1,border:0,format:r.V.RGBA,type:l.r.UnsignedByte,generateMipmap:!1})}createDummyBlackTexture(){return this.__createDummyTextureInner("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg==")}createDummyWhiteTexture(){return this.__createDummyTextureInner("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5/hPwAIAgL/4d1j8wAAAABJRU5ErkJggg==")}createDummyNormalTexture(){return this.__createDummyTextureInner("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOsr///HwAGgAL+v1RumAAAAABJRU5ErkJggg==")}__createDummyTextureInner(e){const t=v.j.base64ToArrayBuffer(e);return this.createTextureFromTypedArray(new Uint8Array(t),{level:0,internalFormat:a.d.RGBA8,width:1,height:1,border:0,format:r.V.RGBA,type:l.r.UnsignedByte,generateMipmap:!1})}createUniformBuffer(e){const t=this.__glw.getRawContextAsWebGL2();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");const n=t.createBuffer(),i=this.__registerResource(n);return t.bindBuffer(t.UNIFORM_BUFFER,n),t.bufferData(t.UNIFORM_BUFFER,e,t.DYNAMIC_DRAW),t.bindBuffer(t.UNIFORM_BUFFER,null),i}updateUniformBuffer(e,t,n,i){const o=this.__glw.getRawContextAsWebGL2(),a=this.getWebGLResource(e);o.bindBuffer(o.UNIFORM_BUFFER,a),o.bufferSubData(o.UNIFORM_BUFFER,0,t,n,i),o.bindBuffer(o.UNIFORM_BUFFER,null)}bindUniformBlock(e,t,n){const i=this.__glw.getRawContextAsWebGL2();if(null==i)throw new Error("No WebGLRenderingContext set as Default.");const o=this.getWebGLResource(e),a=i.getUniformBlockIndex(o,t);i.uniformBlockBinding(o,a,n)}bindUniformBufferBase(e,t){const n=this.__glw.getRawContextAsWebGL2();if(null==n)throw new Error("No WebGLRenderingContext set as Default.");const i=this.getWebGLResource(t);n.bindBufferBase(n.UNIFORM_BUFFER,e,i)}deleteUniformBuffer(e){const t=this.__glw.getRawContext();null==t&&new Error("No WebGLRenderingContext set as Default.");const n=this.getWebGLResource(e);this.__webglResources.delete(e),t.deleteBuffer(n)}setupUniformBufferDataArea(e){const t=this.__glw.getRawContextAsWebGL2();null==t&&new Error("No WebGLRenderingContext set as Default.");const n=t.createBuffer(),i=this.__registerResource(n),o=this.__glw.getMaxConventionUniformBlocks(),a=this.__glw.getAlignedMaxUniformBlockSize(),r=new Float32Array(a*o/4);g.Is.exist(e)&&r.set(e.subarray(0,r.length)),t.bindBuffer(t.UNIFORM_BUFFER,n),t.bufferData(t.UNIFORM_BUFFER,r,t.DYNAMIC_DRAW,0,0);for(let e=0;eR,Z:()=>P});var i=n(5704),o=n(9974),a=n(4097),r=n(7987),s=n(4690),l=n(2251),c=n(3952),_=n(4587),h=n(810),u=n(3999),d=n(5324),m=n(3616),f=n(1813),p=n(2471);let v,A,y,g,x,I,b,E,T,S;function C(e,t,n){(A!==e||y!==t)&&(n.blendEquationSeparate(e,t),A=e,y=t)}function w(e,t,n,i,o){(g!==e||x!==t||I!==n||b!==i)&&(o.blendFuncSeparate(e,t,n,i),g=e,x=t,I=n,b=i)}function R(e,t){if(null==t.mesh)return void a.$.alertNoMeshSet(t);const n=t.mesh.getPrimitiveNumber();for(let i=0;i{"use strict";n.d(t,{X:()=>R});var i=n(3952),o=n(9286),a=n(9216),r=n(3999),s=n(5981),l=n(752),c=n(4097),_=n(1845),h=n(7987),u=n(4587),d=n(810),m=n(9721),f=n(8491),p=n(9974),v=n(2404),A=n(3258),y=n(224),g=n(7348),x=n(4710),I=n(6098),b=n(6406),E=n(2251),T=n(4690),S=n(6683),C=n(903),w=n(4327);class R{constructor(){this.__webglResourceRepository=i.x.getInstance(),this.__dataTextureUid=h.F.InvalidCGAPIResourceUid,this.__dataUBOUid=h.F.InvalidCGAPIResourceUid,this.__lastShader=h.F.InvalidCGAPIResourceUid,this.__lastRenderPassTickCount=-1,this._totalSizeOfGPUShaderDataStorageExceptMorphData=0,this.__latestPrimitivePositionAccessorVersions=[]}static dumpDataTextureBuffer(){this.__isDebugOperationToDataTextureBufferDone=!1}static getVertexShaderMethodDefinitions_dataTexture(){return`\n\n mat4 get_worldMatrix(float instanceId)\n {\n int index = ${m.w.getLocationOffsetOfMemberOfComponent(f.a,"worldMatrix")} + 4 * int(instanceId);\n mat4 matrix = fetchMat4(index);\n\n return matrix;\n }\n\n\n mat3 get_normalMatrix(float instanceId) {\n int index = ${m.w.getLocationOffsetOfMemberOfComponent(f.a,"normalMatrix")} * 4 + 9 * int(instanceId);\n mat3 matrix = fetchMat3No16BytesAligned(index);\n return matrix;\n }\n\n bool get_isVisible(float instanceId) {\n int index = ${m.w.getLocationOffsetOfMemberOfComponent(f.a,"isVisible")} * 4 + int(instanceId);\n float visibility = fetchScalarNo16BytesAligned(index);\n return (visibility > 0.5) ? true : false;\n }\n\n bool get_isBillboard(float instanceId) {\n int index = ${m.w.getLocationOffsetOfMemberOfComponent(f.a,"isBillboard")} * 4 + int(instanceId);\n float isBillboard = fetchScalarNo16BytesAligned(index);\n return (isBillboard > 0.5) ? true : false;\n }\n\n#ifdef RN_IS_VERTEX_SHADER\n #ifdef RN_IS_MORPHING\n vec3 get_position(float vertexId, vec3 basePosition) {\n vec3 position = basePosition;\n int scalar_idx = 3 * int(vertexId);\n for (int i=0; i<${A.D.maxVertexMorphNumberInShader}; i++) {\n\n int basePosIn4bytes = u_dataTextureMorphOffsetPosition[i] * 4 + scalar_idx;\n vec3 addPos = fetchVec3No16BytesAligned(basePosIn4bytes);\n\n position += addPos * u_morphWeights[i];\n if (i == u_morphTargetNumber-1) {\n break;\n }\n }\n\n return position;\n }\n #endif\n#endif\n`}setupShaderForMaterial(e){const t=i.x.getInstance().currentWebGLContextWrapper,n=e._createProgram(R.getVertexShaderMethodDefinitions_dataTexture(),R.__getShaderProperty,t.isWebGL2);return e._setupBasicUniformsLocations(),e._setUniformLocationsOfMaterialNodes(!1),e._setupAdditionalUniformLocations(b.Z.getPointSpriteShaderSemanticsInfoArray(),!1),R.__globalDataRepository._setUniformLocationsForDataTextureModeOnly(e._shaderProgramUid),n}_reSetupShaderForMaterialBySpector(e,t,n){const i=e._createProgramByUpdatedSources(t,n);return e._setupBasicUniformsLocations(),e._setUniformLocationsOfMaterialNodes(!1),e._setupAdditionalUniformLocations(b.Z.getPointSpriteShaderSemanticsInfoArray(),!1),R.__globalDataRepository._setUniformLocationsForDataTextureModeOnly(e._shaderProgramUid),i}static __getShaderProperty(e,t,n,i,o){var a,s;const l=t.compositionType.getGlslStr(t.componentType);let c;const _=d.d.isTexture(t.compositionType),h=t.semantic.str.replace(".","_");let u="";const m=t.compositionType.getGlslStr(t.componentType);let f="";t.arrayLength&&(f=`[${t.arrayLength}]`),(t.needUniformInDataTextureMode||_)&&(u=` uniform ${m} u_${h}${f};\n`);const p=t.compositionType.getVec4SizeOfProperty(),v=t.compositionType.getNumberOfComponents(),A=R.getOffsetOfPropertyInShader(i,n,e);-1===A&&console.error("Could not get the location offset of the property.");const y=p*(null!==(a=t.arrayLength)&&void 0!==a?a:1);c=`int vec4_idx = ${A} + ${y} * instanceId;\n`,d.d.isArray(t.compositionType)&&(c=`int vec4_idx = ${A} + ${y} * instanceId + ${p} * idxOfArray;\n`,c+=`int scalar_idx = ${4*A} + ${v*(null!==(s=t.arrayLength)&&void 0!==s?s:1)} * instanceId + ${v} * idxOfArray;\n`);let g="";t.componentType===r.r.Int&&t.compositionType!==d.d.Scalar&&(g="i");let x="";if(_||t.needUniformInDataTextureMode){if(!_&&t.needUniformInDataTextureMode){if(!o&&t.arrayLength)return`\n${u}\n`;{let e="";return t.arrayLength&&(e="[idxOfArray]"),`${u}\n${l} get_${h}(highp float _instanceId, const int idxOfArray) {\n return u_${h}${e};\n}\n`}}return u}{x+=`\n${l} get_${h}(highp float _instanceId, const int idxOfArray) {\n int instanceId = int(_instanceId);\n ${c}\n `;let e=`${u}\n${x}`;switch(t.compositionType){case d.d.Vec4:case d.d.Vec4Array:e+=" highp vec4 val = fetchElement(vec4_idx);\n";break;case d.d.Vec3:e+=" vec4 col0 = fetchElement(vec4_idx);\n",e+=` highp ${g}vec3 val = ${g}vec3(col0.xyz);`;break;case d.d.Vec3Array:e+=" vec3 val = fetchVec3No16BytesAligned(scalar_idx);\n";break;case d.d.Vec2:e+=" highp vec4 col0 = fetchElement(vec4_idx);\n",e+=` highp ${g}vec2 val = ${g}vec2(col0.xy);`;break;case d.d.Vec2Array:e+=" highp vec2 val = fetchVec2No16BytesAligned(scalar_idx);\n";break;case d.d.Scalar:e+=" vec4 col0 = fetchElement(vec4_idx);\n",t.componentType===r.r.Int?e+=" int val = int(col0.x);":t.componentType===r.r.Bool?e+=" bool val = bool(col0.x);":e+=" float val = col0.x;";break;case d.d.ScalarArray:e+=" float col0 = fetchScalarNo16BytesAligned(scalar_idx);\n",t.componentType===r.r.Int?e+=" int val = int(col0);":t.componentType===r.r.Bool?e+=" bool val = bool(col0);":e+=" float val = col0;";break;case d.d.Mat4:case d.d.Mat4Array:e+=" mat4 val = fetchMat4(vec4_idx);\n";break;case d.d.Mat3:e+=" mat3 val = fetchMat3(vec4_idx);\n";break;case d.d.Mat3Array:e+=" mat3 val = fetchMat3No16BytesAligned(scalar_idx);\n";break;case d.d.Mat2:e+=" mat2 val = fetchMat2(vec4_idx);\n";break;case d.d.Mat2Array:e+=" mat2 val = fetchMat2No16BytesAligned(scalar_idx);\n";break;default:e+=""}return e+="\n return val;\n}\n",e}}static getOffsetOfPropertyInShader(e,t,n){return e?g.$.getInstance().getLocationOffsetOfProperty(t):C.r.getLocationOffsetOfMemberOfMaterial(n,t)}$load(e){const t=e.mesh;if(T.Is.not.exist(t))c.$.alertNoMeshSet(e);else if(R.__currentComponentSIDs=R.__globalDataRepository.getValue(u.f5.CurrentComponentSIDs,0),b.Z.isMaterialsSetup(e)||(0,b.M)(this,e),!this.__isMeshSetup(t)){this.deleteDataTexture(),b.Z.updateVBOAndVAO(t);const e=t.getPrimitiveNumber();for(let n=0;nc&&console.warn("The buffer size exceeds the size of the data texture.");const l=new Float32Array(t.getArrayBuffer(),i,s/4);this.__webglResourceRepository.updateTexture(this.__dataTextureUid,l,{level:0,xoffset:0,yoffset:0,width:o.B.bufferWidthLength,height:n,format:a.V.RGBA,type:r.r.Float}),R.__isDebugOperationToDataTextureBufferDone||(I.Kf.downloadTypedArray("Rhodonite_dataTextureBuffer.bin",l),R.__isDebugOperationToDataTextureBufferDone=!0)}else{const n=e.getBuffer(l.$.GPUVertexData);let _,h=0,u=new ArrayBuffer(0);T.Is.exist(n)&&(h=n.takenSizeInByte,u=n.getArrayBuffer());{const n=e.getBuffer(l.$.GPUVertexData);let a=0;T.Is.exist(n)&&(a=n.takenSizeInByte);let r=new ArrayBuffer(0);T.Is.exist(n)&&(r=n.getArrayBuffer());const s=t.takenSizeInByte-i,h=4*(o.B.bufferWidthLength-s/4/4%o.B.bufferWidthLength)*4,u=I.Kf.concatArrayBuffers2({finalSize:c,srcs:[t.getArrayBuffer(),r],srcsCopySize:[s+h,a],srcsOffset:[i,0]});s+h+a>c&&console.warn("The buffer size exceeds the size of the data texture."),_=new Float32Array(u),A.D.totalSizeOfGPUShaderDataStorageExceptMorphData=t.takenSizeInByte+h}this.__dataTextureUid=this.__webglResourceRepository.createTextureFromTypedArray(_,{level:0,internalFormat:s.d.RGBA32F,width:o.B.bufferWidthLength,height:o.B.bufferHeightLength,border:0,format:a.V.RGBA,type:r.r.Float,generateMipmap:!1})}}deleteDataTexture(){null!=this.__dataTextureUid&&(this.__webglResourceRepository.deleteTexture(this.__dataTextureUid),this.__dataTextureUid=h.F.InvalidCGAPIResourceUid)}common_$prerender(){this.__createAndUpdateDataTexture(),this.__createAndUpdateUBO(),this.__lightComponents=v.C.getComponentsWithType(S.r)}__isUboUse(){return this.__webglResourceRepository.currentWebGLContextWrapper.isWebGL2&&A.D.isUboEnabled}__createAndUpdateUBO(){if(this.__isUboUse()){const e=this.__webglResourceRepository.currentWebGLContextWrapper,t=e.getAlignedMaxUniformBlockSize(),n=e.getMaxConventionUniformBlocks(),i=o.B.getInstance().getBuffer(l.$.GPUInstanceData);if(this.__dataUBOUid===h.F.InvalidCGAPIResourceUid)this.__dataUBOUid=this.__webglResourceRepository.setupUniformBufferDataArea(new Float32Array(i.getArrayBuffer()));else{const e=new Float32Array(i.getArrayBuffer());this.__webglResourceRepository.updateUniformBuffer(this.__dataUBOUid,e,0,t*n/4)}}}attachGPUData(e){}attachGPUDataInner(e,t){}attachShaderProgram(e){const t=e._shaderProgramUid;if(t!==this.__lastShader){const e=this.__webglResourceRepository.currentWebGLContextWrapper.getRawContext(),n=this.__webglResourceRepository.getWebGLResource(t);e.useProgram(n),this.__lastShader=t}}attachVertexData(e,t,n,i){}attachVertexDataInner(e,t,n,i,o){const a=t.vertexHandles,r=i.getRawContext(),s=this.__webglResourceRepository.getWebGLResource(e.getVaoUids(n));if(null!=s)i.bindVertexArray(s);else{this.__webglResourceRepository.setVertexDataToPipeline(a,t,e._variationVBOUid);const n=this.__webglResourceRepository.getWebGLResource(a.iboHandle);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,n)}}static getInstance(){return this.__instance||(this.__instance=new R),this.__instance}__setCurrentComponentSIDsForEachRenderPass(e,t,n){if(n){const e=E.x.getInstance().getModule("xr").WebXRSystem.getInstance();let n=-1;e.isWebXRMode&&(n=e.isMultiView()?e._getCameraComponentSIDAt(0):e._getCameraComponentSIDAt(t)),R.__currentComponentSIDs._v[x.z.CameraComponentTID]=n}else{let t=e.cameraComponent;null==t&&(t=v.C.getComponent(y.M,y.M.current)),R.__currentComponentSIDs._v[x.z.CameraComponentTID]=t?t.componentSID:-1}}__setCurrentComponentSIDsForEachEntity(e,t,n){const i=n.tryToGetSkeletal();if(i){let e=0;i.componentSID{"use strict";n.d(t,{I:()=>E});var i=n(3952),o=n(1845),a=n(7987),r=n(4587),s=n(2404),l=n(6683),c=n(3258),_=n(9216),h=n(3999),u=n(5981),d=n(9974),m=n(810),f=n(1813),p=n(9286),v=n(5324),A=n(752),y=n(7348),g=n(6098),x=n(6406),I=n(4690),b=n(4327);class E{constructor(){this.__webglResourceRepository=i.x.getInstance(),this.__dataTextureUid=a.F.InvalidCGAPIResourceUid,this.__lastShader=-1,this.__lastRenderPassTickCount=-1,this.__latestPrimitivePositionAccessorVersions=[]}setupShaderForMaterial(e){const t=i.x.getInstance().currentWebGLContextWrapper,n=e._createProgram(E.__vertexShaderMethodDefinitions_uniform,r.f5.getShaderProperty,t.isWebGL2);e._setupBasicUniformsLocations(),e._setUniformLocationsOfMaterialNodes(!0);const o=E.componentMatrices,a=x.Z.getPointSpriteShaderSemanticsInfoArray();return e._setupAdditionalUniformLocations(o.concat(a),!0),E.__globalDataRepository._setUniformLocationsForUniformModeOnly(e._shaderProgramUid),n}_reSetupShaderForMaterialBySpector(e,t,n){const i=e._createProgramByUpdatedSources(t,n);e._setupBasicUniformsLocations(),e._setUniformLocationsOfMaterialNodes(!0);const o=E.componentMatrices,a=x.Z.getPointSpriteShaderSemanticsInfoArray();return e._setupAdditionalUniformLocations(o.concat(a),!0),E.__globalDataRepository._setUniformLocationsForUniformModeOnly(e._shaderProgramUid),i}$load(e){const t=e.mesh;if(I.Is.exist(t)&&(x.Z.isMaterialsSetup(e)||(0,x.M)(this,e),!this.__isMeshSetup(t))){x.Z.updateVBOAndVAO(t);const e=t.getPrimitiveNumber();for(let n=0;np.B.bufferHeightLength&&console.warn("The buffer size exceeds the size of the data texture.");const t=p.B.bufferWidthLength*p.B.bufferHeightLength*4*4,n=g.Kf.concatArrayBuffers2({finalSize:t,srcs:[e.getArrayBuffer()],srcsCopySize:[e.takenSizeInByte],srcsOffset:[0]}),i=new Float32Array(n);this.__dataTextureUid=this.__webglResourceRepository.createTextureFromTypedArray(i,{level:0,internalFormat:u.d.RGBA32F,width:p.B.bufferWidthLength,height:p.B.bufferHeightLength,border:0,format:_.V.RGBA,type:h.r.Float,generateMipmap:!1})}}attachGPUData(e){}attachShaderProgram(e){}attachVertexData(e,t,n,i){}attachVertexDataInner(e,t,n,i,o){const a=t.vertexHandles,r=this.__webglResourceRepository.getWebGLResource(e.getVaoUidsByPrimitiveUid(n)),s=i.getRawContext();if(null!=r)i.bindVertexArray(r);else{this.__webglResourceRepository.setVertexDataToPipeline(a,t,o);const e=this.__webglResourceRepository.getWebGLResource(a.iboHandle);s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e)}}dettachVertexData(e){const t=e.getRawContext();e.bindVertexArray&&e.bindVertexArray(null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),t.bindBuffer(t.ARRAY_BUFFER,null)}static getInstance(){return this.__instance||(this.__instance=new E),this.__instance}common_$render(e,t,n){"undefined"!=typeof spector&&spector.setMarker("| | Uniform:$render#");const i=this.__webglResourceRepository.currentWebGLContextWrapper,o=i.getRawContext(),a=x.Z.isVrMainPass(t),r=x.Z.getDisplayNumber(a);for(let s=0;s{"use strict";n.d(t,{Z:()=>r});var i=n(7683),o=n(6042),a=n(9430);const r=function(e){return i.V.isDataTextureApproach(e)?a.X.getInstance():(i.V.isUniformApproach(e),o.I.getInstance())}},8511:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>_});var i=n(3007),o=n(836),a=n(5551),r=n(3952),s=n(6042),l=n(9430);const c=Object.freeze({getRenderingStrategy:i.Z,GLSLShader:o.m,WebGLContextWrapper:a.d,WebGLResourceRepository:r.x,WebGLStrategyUniform:s.I,WebGLStrategyDataTexture:l.X}),_=c;(0,eval)("this").RnWebGL=c},836:(e,t,n)=>{"use strict";n.d(t,{m:()=>l});var i=n(7683),o=n(4587),a=n(128),r=n(3952),s=n(8430);class l{constructor(){this.__webglResourceRepository=r.x.getInstance()}get glsl_fragColor(){const e=this.__webglResourceRepository;return null!=e.currentWebGLContextWrapper&&e.currentWebGLContextWrapper.isWebGL2?"":"gl_FragColor = rt0;\n"}get glsl_textureCube(){return this.__webglResourceRepository.currentWebGLContextWrapper.isWebGL2?"texture":"textureCube"}static get glslMainBegin(){return"\nvoid main() {\n"}static get glslMainEnd(){return"\n}\n "}getGlslVertexShaderProperies(e=""){return e}get prerequisites(){return"uniform float u_materialSID;\n"}get mainPrerequisites(){const e=s.l.currentProcessApproach;return i.V.isDataTextureApproach(e)?"\n":"\n "}static getStringFromShaderAnyDataType(e){return e instanceof o.wy?"u_"+e.str:a.T.isInstanceOfVertexAttributeClass(e)?e.shaderStr:e}}},2647:(e,t,n)=>{"use strict";n.d(t,{I:()=>o});var i=n(836);class o extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__valueInputs=t,this.__valueOutputs=n}get vertexShaderDefinitions(){let e=`void ${this.__functionName}(\nin bool context,\n `;for(let t=0;t{"use strict";n.d(t,{$:()=>o});var i=n(836);class o extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__valueInputs=t,this.__valueOutputs=n}get vertexShaderDefinitions(){let e=`void ${this.__functionName}(`;for(let t=0;t{"use strict";n.d(t,{i:()=>a});var i=n(836),o=n(3999);class a extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__compositionType=t,this.__componentType=n,this.__constantValueStr=""}setConstantValue(e){let t="";this.__componentType.isFloatingPoint()?t=e.glslStrAsFloat:this.__componentType.isInteger()?t=e.glslStrAsInt:this.__componentType===o.r.Bool&&(t=e.x?"true":"false"),this.__constantValueStr=t}get vertexShaderDefinitions(){return`\n void ${this.__functionName}(\n out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n outValue = ${this.__constantValueStr};\n }\n `}get pixelShaderDefinitions(){return`\n void ${this.__functionName}(\n out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n outValue = ${this.__constantValueStr};\n }\n `}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},4212:(e,t,n)=>{"use strict";n.d(t,{x:()=>a});var i=n(836),o=n(3591);class a extends i.m{constructor(){super()}static getInstance(){return this.__instance||(this.__instance=new a),this.__instance}get vertexShaderDefinitions(){return"\n void outPosition(in vec4 inPosition) {\n gl_Position = inPosition;\n }\n "}get vertexShaderBody(){return"\n\n "}get pixelShaderDefinitions(){const e=this.glsl_fragColor;let t="";return""!==e&&(t="vec4"),`\n void outColor(in vec4 inColor) {\n ${t} rt0 = inColor;\n ${e}\n }\n `}getPixelShaderBody(){return""}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}a.materialElement=o.Z.PBRShading},4109:(e,t,n)=>{"use strict";n.d(t,{p:()=>o});var i=n(836);class o extends i.m{constructor(){super()}get vertexShaderDefinitions(){return"\n "}get pixelShaderDefinitions(){return"\n "}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},6796:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var i=n(836);class o extends i.m{constructor(){super(),this.__materialNodeUid=0,this.vertexShaderBody="\n "}set materialNodeUid(e){this.__materialNodeUid=e}getPixelShaderBody(){return"\n "}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},204:(e,t,n)=>{"use strict";n.d(t,{$:()=>o});var i=n(836);class o extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__compositionType=t,this.__componentType=n,this.__variableName="",this.__valueStr=""}setVariableName(e){this.__variableName=e}setDefaultValue(e){this.__valueStr=e.toString()}get vertexShaderDefinitions(){return`\n uniform ${this.__compositionType.getGlslStr(this.__componentType)} u_${this.__variableName}; // initialValue=${this.__valueStr}\n void ${this.__functionName}(out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n#else\n float materialSID = u_materialSID;\n#endif\n\noutValue = get_${this.__variableName}(materialSID, 0);\n }\n `}get pixelShaderDefinitions(){return`\n uniform ${this.__compositionType.getGlslStr(this.__componentType)} u_${this.__variableName}; // initialValue=${this.__valueStr}\n void ${this.__functionName}(out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n#else\n float materialSID = u_materialSID;\n#endif\n\noutValue = get_${this.__variableName}(materialSID, 0);\n }\n `}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},9071:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var i=n(836);class o extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__compositionType=t,this.__componentType=n,this.__variableName=""}setVariableName(e){this.__variableName=e}get vertexShaderDefinitions(){return`\n out ${this.__compositionType.getGlslStr(this.__componentType)} ${this.__variableName};\n void ${this.__functionName}(\n in ${this.__compositionType.getGlslStr(this.__componentType)} value) {\n ${this.__variableName} = value;\n }\n `}get pixelShaderDefinitions(){return`\n in ${this.__compositionType.getGlslStr(this.__componentType)} ${this.__variableName};\n void ${this.__functionName}(\n out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n outValue = ${this.__variableName};\n }\n `}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},3667:(e,t,n)=>{"use strict";n.d(t,{N:()=>T}),new Uint8Array([0]);const i=[171,75,84,88,32,50,48,187,13,10,26,10];var o,a,r,s,l,c,_,h,u;(u=o||(o={}))[u.NONE=0]="NONE",u[u.BASISLZ=1]="BASISLZ",u[u.ZSTD=2]="ZSTD",u[u.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(a||(a={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(r||(r={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(s||(s={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(l||(l={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(c||(c={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(_||(_={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(h||(h={}));class d{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=o.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:a.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:r.UNSPECIFIED,colorPrimaries:s.SRGB,transferFunction:s.SRGB,flags:c.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}}class m{constructor(e,t,n,i){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=i,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==t&&ie.arrayBuffer())).then((e=>WebAssembly.instantiate(e,x))).then(this._init):WebAssembly.instantiate(Buffer.from(b,"base64"),x).then(this._init),A)}_init(e){y=e.instance,x.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!y)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,i=y.exports.malloc(n);g.set(e,i),t=t||Number(y.exports.ZSTD_findDecompressedSize(i,n));const o=y.exports.malloc(t),a=y.exports.ZSTD_decompress(o,t,i,n),r=g.slice(o,o+a);return y.exports.free(i),y.exports.free(o),r}}const b="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AI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KDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0E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gCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf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RBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIA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ALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKg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ACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCy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AAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",E="ETC1_RGB";class T{constructor(){"undefined"==typeof MSC_TRANSCODER&&console.error("Failed to call MSC_TRANSCODER() function. Please check to import msc_basis_transcoder.js."),this.__mscTranscoderPromise=this.__loadMSCTranscoder()}static getInstance(){return this.__instance||(this.__instance=new T),this.__instance}transcode(e){const t=this.__parse(e);if(t.pixelDepth>0)throw new Error("Only 2D textures are currently supported");if(t.layerCount>1)throw new Error("Array textures are not currently supported");if(t.faceCount>1)throw new Error("Cube textures are not currently supported");return t.supercompressionScheme===o.ZSTD?(null==T.__zstdDecoder&&(T.__zstdDecoder=new I),T.__zstdDecoder.init().then((()=>this.__mscTranscoderPromise.then((()=>this.__transcodeData(t)))))):this.__mscTranscoderPromise.then((()=>this.__transcodeData(t)))}__loadMSCTranscoder(){return new Promise((e=>{T.__mscTranscoderModule&&e(),MSC_TRANSCODER().then((t=>{t.initTranscoders(),T.__mscTranscoderModule=t,e()}))}))}__getDeviceDependentParameters(e){const t=p.F.getWebGLResourceRepository().currentWebGLContextWrapper,n=t.webgl2ExtCTAstc||t.webgl1ExtCTAstc,i=t.webgl2ExtCTBptc||t.webgl1ExtCTBptc,o=t.webgl2ExtCTS3tc||t.webgl1ExtCTS3tc,a=t.webgl2ExtCTPvrtc||t.webgl1ExtCTPvrtc,r=t.webgl2ExtCTEtc||t.webgl1ExtCTEtc,s=t.webgl2ExtCTEtc1||t.webgl1ExtCTEtc1;let l,c;return n?(l="ASTC_4x4_RGBA",c=v.b.ASTC_RGBA_4x4):i?(l="BC7_RGBA",c=v.b.BPTC_RGBA):o?e?(l="BC3_RGBA",c=v.b.S3TC_RGBA_DXT5):(l="BC1_RGB",c=v.b.S3TC_RGB_DXT1):a?e?(l="PVRTC1_4_RGBA",c=v.b.PVRTC_RGBA_4BPPV1):(l="PVRTC1_4_RGB",c=v.b.PVRTC_RGB_4BPPV1):r?e?(l="ETC2_RGBA",c=v.b.ETC2_RGBA8_EAC):(l=E,c=v.b.ETC2_RGB8):s?(l=E,c=v.b.ETC1_RGB):(l="RGBA32",c=v.b.RGBA8_EXT),{transcodeTargetStr:l,compressionTextureType:c}}__parse(e){return function(e){const t=new Uint8Array(e.buffer,e.byteOffset,i.length);if(t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||t[4]!==i[4]||t[5]!==i[5]||t[6]!==i[6]||t[7]!==i[7]||t[8]!==i[8]||t[9]!==i[9]||t[10]!==i[10]||t[11]!==i[11])throw new Error("Missing KTX 2.0 identifier.");const n=new d,o=17*Uint32Array.BYTES_PER_ELEMENT,a=new m(e,i.length,o,!0);n.vkFormat=a._nextUint32(),n.typeSize=a._nextUint32(),n.pixelWidth=a._nextUint32(),n.pixelHeight=a._nextUint32(),n.pixelDepth=a._nextUint32(),n.layerCount=a._nextUint32(),n.faceCount=a._nextUint32();const r=a._nextUint32();n.supercompressionScheme=a._nextUint32();const s=a._nextUint32(),l=a._nextUint32(),c=a._nextUint32(),_=a._nextUint32(),h=a._nextUint64(),u=a._nextUint64(),p=new m(e,i.length+o,3*r*8,!0);for(let t=0;t>t),l=Math.max(1,i>>t),f=new u.ImageInfo(m,r,l,t);let p=e.levels[t].levelData;const y=e.levels[t].uncompressedByteLength,g=f.numBlocksX*f.numBlocksY*c.bytesPlane[0];e.supercompressionScheme===o.ZSTD&&(p=T.__zstdDecoder.decode(p,y));let x=0;const I=t*Math.max(e.layerCount,1)*a*Math.max(e.pixelDepth,1);for(let n=0;n0?c.rgbSliceByteLength:0,f.alphaByteLength=c.alphaSliceByteLength,a=n.transcodeImage(v,i,f,0,!1)}if(null!=(null==a?void 0:a.transcodedImage)){const e=a.transcodedImage.get_typed_memory_view().slice();a.transcodedImage.delete();const n={level:t,width:r,height:l,buffer:e};A.push(n)}}}return y}__hasAlpha(e,t){return 1===t?e.samples[0].channelID===h.RGBA:2===e.samples.length&&(e.samples[0].channelID===_.AAA||e.samples[1].channelID===_.AAA)}}},5514:(e,t,n)=>{"use strict";n.d(t,{RQ:()=>g,sz:()=>T,KA:()=>x,_0:()=>E});const i={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})},o={xAxis:0,yAxis:0,button:0,state:i.ComponentState.DEFAULT};class a{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===i.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(o)}updateFromComponent({xAxis:e,yAxis:t,button:n,state:o}){const{normalizedXAxis:a,normalizedYAxis:r}=function(e=0,t=0){let n=e,i=t;if(Math.sqrt(e*e+t*t)>1){const o=Math.atan2(t,e);n=Math.cos(o),i=Math.sin(o)}return{normalizedXAxis:.5*n+.5,normalizedYAxis:.5*i+.5}}(e,t);switch(this.componentProperty){case i.ComponentProperty.X_AXIS:this.value=this.states.includes(o)?a:.5;break;case i.ComponentProperty.Y_AXIS:this.value=this.states.includes(o)?r:.5;break;case i.ComponentProperty.BUTTON:this.value=this.states.includes(o)?n:0;break;case i.ComponentProperty.STATE:this.valueNodeProperty===i.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(o):this.value=this.states.includes(o)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class r{constructor(e,t){if(!(e&&t&&t.visualResponses&&t.gamepadIndices&&0!==Object.keys(t.gamepadIndices).length))throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach((e=>{const n=new a(t.visualResponses[e]);this.visualResponses[e]=n})),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:i.ComponentState.DEFAULT,button:void 0!==this.gamepadIndices.button?0:void 0,xAxis:void 0!==this.gamepadIndices.xAxis?0:void 0,yAxis:void 0!==this.gamepadIndices.yAxis?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=i.ComponentState.DEFAULT,void 0!==this.gamepadIndices.button&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||1===this.values.button?this.values.state=i.ComponentState.PRESSED:(t.touched||this.values.button>i.ButtonTouchThreshold)&&(this.values.state=i.ComponentState.TOUCHED)}void 0!==this.gamepadIndices.xAxis&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===i.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>i.AxisTouchThreshold&&(this.values.state=i.ComponentState.TOUCHED)),void 0!==this.gamepadIndices.yAxis&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===i.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>i.AxisTouchThreshold&&(this.values.state=i.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach((e=>{e.updateFromComponent(this.values)}))}}class s{constructor(e,t,n){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=n,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach((e=>{const t=this.layoutDescription.components[e];this.components[e]=new r(e,t)})),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach((t=>{e.push(t.data)})),e}updateFromGamepad(){Object.values(this.components).forEach((e=>{e.updateFromGamepad(this.xrInputSource.gamepad)}))}}async function l(e){const t=await fetch(e);if(t.ok)return t.json();throw new Error(t.statusText)}var c=n(2749),_=n(6694),h=n(4690),u=n(9207),d=n(2471),m=n(6098),f=n(9190),p=n(2566);const v=new Map,A=Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON_1:"button_1",BUTTON_2:"button_2",BUTTON_3:"button_3",BUTTON_SPECIAL:"button_special"}),y=new Map;async function g(e,t,n){const{profile:i,assetPath:o}=await async function(e,t,n=null,i=!0){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const o=await async function(e){if(!e)throw new Error("No basePath supplied");return await l(`${e}/profilesList.json`)}(t);let a;if(e.profiles.some((e=>{const n=o[e];return n&&(a={profileId:e,profilePath:`${t}/${n.path}`,deprecated:!!n.deprecated}),!!a})),!a){if(!n)throw new Error("No matching profile name found");const e=o[n];if(!e)throw new Error(`No matching profile name found and default profile "${n}" missing.`);a={profileId:n,profilePath:`${t}/${e.path}`,deprecated:!!e.deprecated}}const r=await l(a.profilePath);let s;if(i){let t;if(t="any"===e.handedness?r.layouts[Object.keys(r.layouts)[0]]:r.layouts[e.handedness],!t)throw new Error(`No matching handedness, ${e.handedness}, in profile ${a.profileId}`);t.assetPath&&(s=a.profilePath.replace("profile.json",t.assetPath))}return{profile:r,assetPath:s}}(e,t),a=new s(e,i,o);v.set(e,a);const r=await async function(e){const t=await c.Z.importFromUri(e.assetUrl);return function(e,t){Object.values(e.components).forEach((e=>{e.touchPointNodeName&&t.getChildByName(e.touchPointNodeName,!0)}))}(e,t),t}(a);if(r.isOk())return _.e.convertToRhodoniteObject(r.get())}function x(e,t,n){Array.from(v.values()).forEach((t=>{t.updateFromGamepad(),Object.keys(t.components).forEach((i=>{!function(e,t,n,i){const o=y.get(e.rootNodeName);if(h.Is.not.exist(o))return;if(0===I)return void(I=i);const a=1e-6*(i-I);switch(o){case A.TRIGGER:!function(e,t,n,i){let o=0;const a=y.get(e.rootNodeName);("pressed"===e.values.state||"touched"===e.values.state)&&(console.log(a,e.values.button,t),o=(0,m.kS)({value:e.values.button,defaultValue:0})*i),"right"===t&&(o*=-1),b.x-=.1*o,b.y-=.1*o,b.z-=.1*o,b.x=Math.max(b.x,.05),b.y=Math.max(b.y,.05),b.z=Math.max(b.z,.05),b.x=Math.min(b.x,3),b.y=Math.min(b.y,3),b.z=Math.min(b.z,3),n.viewerScale.copyComponents(b)}(e,t,n,a);break;case A.THUMBSTICK:!function(e,t,n,i){const o=y.get(e.rootNodeName);let a=0,r=0;"pressed"===e.values.state?(console.log(o,e.values.button,e.values.state,t),a=(0,m.kS)({value:e.values.xAxis,defaultValue:0})*i,r=(0,m.kS)({value:e.values.yAxis,defaultValue:0})*i):"touched"===e.values.state&&(a=(0,m.kS)({value:e.values.xAxis,defaultValue:0})*i,r=(0,m.kS)({value:e.values.yAxis,defaultValue:0})*i),a=Math.min(a,1),r=Math.min(r,1);const s=f.d6.zero();"right"===t?(n.viewerAzimuthAngle.x-=.15*a,s.y-=.1*r*n.viewerScale.x):(s.x+=.25*a*n.viewerScale.x,s.z+=.25*r*n.viewerScale.x);p.x.fromCopyQuaternion(n.viewerOrientation).multiply(p.x.rotateY(n.viewerAzimuthAngle.x)).multiplyVectorTo(s,s),n.viewerTranslate.add(s)}(e,t,n,a);break;case A.SQUEEZE:!function(e,t,n,i){const o=y.get(e.rootNodeName);("pressed"===e.values.state||"touched"===e.values.state)&&console.log(o,e.values.button,t)}(e,t);break;case A.BUTTON_1:case A.BUTTON_2:case A.BUTTON_3:case A.BUTTON_SPECIAL:!function(e,t,n,i){const o=y.get(e.rootNodeName);("pressed"===e.values.state||"touched"===e.values.state)&&console.log(o,e.values.button,e.values.state,t)}(e,t);break;case A.TOUCHPAD:"pressed"===(r=e).values.state||"touched"===r.values.state&&0!==r.values.yAxis&&r.values.yAxis}var r}(t.components[i],t.xrInputSource.handedness,n,e)}))}))}y.set("a_button",A.BUTTON_1),y.set("b_button",A.BUTTON_2),y.set("x_button",A.BUTTON_1),y.set("y_button",A.BUTTON_2),y.set("thumbrest",A.BUTTON_3),y.set("menu",A.BUTTON_SPECIAL),y.set("xr_standard_trigger",A.TRIGGER),y.set("xr_standard_squeeze",A.SQUEEZE),y.set("xr_standard_thumbstick",A.THUMBSTICK),y.set("xr_standard_touchpad",A.TOUCHPAD),y.set("trigger",A.TRIGGER),y.set("squeeze",A.SQUEEZE),y.set("thumbstick",A.THUMBSTICK),y.set("touchpad",A.TOUCHPAD);let I=0;const b=f.d6.one();function E(e,t){const n=e.getTagValue("rnEntitiesByNames");Object.values(t.components).forEach((e=>{for(const t in e.visualResponses){const i=e.visualResponses[t],o=n.get(i.valueNodeName);if(h.Is.not.exist(o))console.warn("The entity of the controller doesn't exist");else if("visibility"===i.valueNodeProperty)o.getSceneGraph().isVisible=!!i.value;else if("transform"===i.valueNodeProperty){const e=n.get(i.minNodeName),t=n.get(i.maxNodeName);if(h.Is.not.exist(e)||h.Is.not.exist(t)){console.warn("The min/max Node of the component of the controller doesn't exist");continue}const a=e.getTransform(),r=t.getTransform();o.getTransform().quaternion=u._.qlerp(a.localRotationInner,r.localRotationInner,i.value),o.getTransform().localPosition=d.P.lerp(a.localPositionInner,r.localPositionInner,i.value)}}}))}function T(e){return v.get(e)}},2102:(e,t,n)=>{"use strict";n.d(t,{X:()=>v});var i=n(7987),o=n(2471),a=n(3496),r=n(7192),s=n(3648),l=n(2251),c=n(5514),_=n(4690),h=n(9190),u=n(963),d=n(4267),m=n(7973),f=n(7864);const p=o.P.fromCopyArray([0,1.1,0]);class v{constructor(){this.__isWebXRMode=!1,this.__spaceType="local",this.__requestedToEnterWebXR=!1,this.__isReadyForWebXR=!1,this.__defaultPositionInLocalSpaceMode=p,this.__canvasWidthForVR=0,this.__canvasHeightForVR=0,this.__controllerEntities=[],this.__xrInputSources=[],this.__viewerTranslate=h.d6.zero(),this.__viewerAzimuthAngle=d.DU.zero(),this.__viewerOrientation=u.y.identity(),this.__viewerScale=h.d6.one(),this.__multiviewFramebufferHandle=-1,this.__multiviewColorTextureHandle=-1,this.__viewerEntity=m._.createGroupEntity(),this.__viewerEntity.tryToSetUniqueName("WebXR Viewer",!0),this.__viewerEntity.tryToSetTag({tag:"type",value:"background-assets"}),this.__leftCameraEntity=m._.createCameraEntity(),this.__leftCameraEntity.tryToSetUniqueName("WebXR Left Camera",!0),this.__leftCameraEntity.tryToSetTag({tag:"type",value:"background-assets"}),this.__leftCameraEntity.getCamera()._xrLeft=!0,this.__rightCameraEntity=m._.createCameraEntity(),this.__rightCameraEntity.tryToSetUniqueName("WebXR Right Camera",!0),this.__rightCameraEntity.tryToSetTag({tag:"type",value:"background-assets"}),this.__rightCameraEntity.getCamera()._xrRight=!0,this.__viewerEntity.getSceneGraph().addChild(this.__leftCameraEntity.getSceneGraph()),this.__viewerEntity.getSceneGraph().addChild(this.__rightCameraEntity.getSceneGraph())}async readyForWebXR(e,t){this.__basePath=t,await l.x.getInstance().loadModule("xr");const n=i.F.getWebGLResourceRepository().currentWebGLContextWrapper;if(null==n)return console.error("WebGL Context is not ready yet."),[];if(this.__glw=n,!await navigator.xr.isSessionSupported("immersive-vr"))throw new Error("WebXR is not supported in this environment.");if(e)e.style.display="block";else{const e=document.createElement("p"),t=document.createElement("a");t.setAttribute("id","enter-vr");const i=document.createTextNode("Enter VR");t.appendChild(i),e.appendChild(t);const o=n.canvas;o.parentNode.insertBefore(e,o),window.addEventListener("click",this.enterWebXR.bind(this))}return this.__isReadyForWebXR=!0,[]}async enterWebXR({initialUserPosition:e,callbackOnXrSessionStart:t=(()=>{}),callbackOnXrSessionEnd:n=(()=>{}),profilePriorities:o=[]}){const a=i.F.getWebGLResourceRepository().currentWebGLContextWrapper;if(null!=a&&this.__isReadyForWebXR){let i;const r=await navigator.xr.requestSession("immersive-vr");this.__xrSession=r,r.addEventListener("end",(()=>{a.__gl.bindFramebuffer(a.__gl.FRAMEBUFFER,null),this.__xrSession=void 0,this.__webglLayer=void 0,this.__xrViewerPose=void 0,this.__xrReferenceSpace=void 0,this.__spaceType="local",this.__isReadyForWebXR=!1,this.__requestedToEnterWebXR=!1,this.__setWebXRMode(!1),f.rFg._makeShaderInvalidateToAllMaterials(),this.__defaultPositionInLocalSpaceMode=p,console.log("XRSession ends."),s.x.stopRenderLoop(),s.x.restartRenderLoop(),n()}));const l=new Promise((e=>{r.addEventListener("inputsourceschange",(t=>{this.__onInputSourcesChange(t,e,o)}))}));return i=await r.requestReferenceSpace("local"),this.__spaceType="local",this.__defaultPositionInLocalSpaceMode=null!=e?e:p,this.__xrReferenceSpace=i,s.x.stopRenderLoop(),await this.__setupWebGLLayer(r,t),this.__requestedToEnterWebXR=!0,s.x.restartRenderLoop(),console.warn("End of enterWebXR."),l}console.error("WebGL context or WebXRSession is not ready yet.")}async exitWebXR(){null!=this.__xrSession&&await this.__xrSession.end()}getCanvasWidthForVr(){return this.__canvasWidthForVR}getCanvasHeightForVr(){return this.__canvasHeightForVR}getControllerEntities(){return this.__controllerEntities}get leftViewMatrix(){return this.__leftCameraEntity.getCamera().viewMatrix}get rightViewMatrix(){return this.__rightCameraEntity.getCamera().viewMatrix}get leftProjectionMatrix(){var e;const t=null===(e=this.__xrViewerPose)||void 0===e?void 0:e.views[0];return a.e.fromCopyFloat32ArrayColumnMajor(_.Is.exist(t)?t.projectionMatrix:a.e.identity()._v)}get rightProjectionMatrix(){var e;const t=null===(e=this.__xrViewerPose)||void 0===e?void 0:e.views[1];return a.e.fromCopyFloat32ArrayColumnMajor(_.Is.exist(t)?t.projectionMatrix:a.e.identity()._v)}get framebuffer(){var e,t;return this.__multiviewFramebufferHandle>0?i.F.getWebGLResourceRepository().getWebGLResource(this.__multiviewFramebufferHandle):null===(t=null===(e=this.__xrSession)||void 0===e?void 0:e.renderState.baseLayer)||void 0===t?void 0:t.framebuffer}isMultiView(){return this.__multiviewFramebufferHandle>0}get requestedToEnterWebXR(){return this.__requestedToEnterWebXR}get xrSession(){return this.__xrSession}get requestedToEnterWebVR(){return this.__requestedToEnterWebXR}get isWebXRMode(){return this.__isWebXRMode}__setWebXRMode(e){this.__isWebXRMode=e,this.__glw._isWebXRMode=e}get isReadyForWebXR(){return this.__isReadyForWebXR}static getInstance(){return this.__instance||(this.__instance=new v),this.__instance}_getViewMatrixAt(e){return 0===e?this.leftViewMatrix:this.rightViewMatrix}_getProjectMatrixAt(e){return 0===e?this.leftProjectionMatrix:this.rightProjectionMatrix}_getViewportAt(e){return 0===e?this._getLeftViewport():this._getRightViewport()}_getLeftViewport(){return r.Lt.fromCopyArray([0,0,this.__canvasWidthForVR/2,this.__canvasHeightForVR])}_getRightViewport(){return this.__multiviewFramebufferHandle>0?r.Lt.fromCopyArray([0,0,this.__canvasWidthForVR/2,this.__canvasHeightForVR]):r.Lt.fromCopyArray([this.__canvasWidthForVR/2,0,this.__canvasWidthForVR/2,this.__canvasHeightForVR])}_setValuesToGlobalDataRepository(){this.__leftCameraEntity.getCamera().projectionMatrix=this.leftProjectionMatrix,this.__rightCameraEntity.getCamera().projectionMatrix=this.rightProjectionMatrix,this.__leftCameraEntity.getCamera().setValuesToGlobalDataRepository(),this.__rightCameraEntity.getCamera().setValuesToGlobalDataRepository()}_getCameraWorldPositionAt(e){var t;const n=null===(t=this.__xrViewerPose)||void 0===t?void 0:t.views[e];if(_.Is.exist(n)){const e=n.transform.position,t=this.__defaultPositionInLocalSpaceMode,i=this.__viewerTranslate,a=o.P.add(o.P.fromCopyArray([e.x,e.y,e.z]),t);return o.P.fromCopyArray([(a.x+i.x)*this.__viewerScale.x,(a.y+i.y)*this.__viewerScale.y,(a.z+i.z)*this.__viewerScale.z])}return this.__defaultPositionInLocalSpaceMode}_getCameraComponentSIDAt(e){return 0===e?this.__leftCameraEntity.getCamera().componentSID:this.__rightCameraEntity.getCamera().componentSID}_preRender(e,t){this.isWebXRMode&&this.__requestedToEnterWebXR&&null!=t&&(this.__updateView(t),this.__updateInputSources(t),(0,c.KA)(e,t,{viewerTranslate:this.__viewerTranslate,viewerScale:this.__viewerScale,viewerOrientation:this.__viewerOrientation,viewerAzimuthAngle:this.__viewerAzimuthAngle}))}_postRender(){if(this.__isWebXRMode){const e=this.__glw.getRawContextAsWebGL2();if(this.__multiviewFramebufferHandle>0){const t=i.F.getWebGLResourceRepository();e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[e.DEPTH_STENCIL_ATTACHMENT]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.__xrSession.renderState.baseLayer.framebuffer);const n=t.getWebGLResource(this.__multiviewColorTextureHandle);this.__webglStereoUtil.blit(n,0,0,1,1,this.__canvasWidthForVR,this.__canvasHeightForVR)}}this.requestedToEnterWebVR}async __onInputSourcesChange(e,t,n){this.__xrInputSources.length=0;for(const t of e.added){this.__xrInputSources.push(t);const e=await(0,c.RQ)(t,this.__basePath,n);_.Is.exist(e)&&(this.__controllerEntities.push(e),this.__viewerEntity.getSceneGraph().addChild(e.getSceneGraph()))}t(this.__controllerEntities)}__setCameraInfoFromXRViews(e){if(_.Is.not.exist(e))return void console.warn("xrViewerPose not exist");const t=e.views[0],n=e.views[1];if(_.Is.not.exist(t)||_.Is.not.exist(n))return;const i=e.transform.orientation;this.__viewerOrientation.x=i.x,this.__viewerOrientation.y=i.y,this.__viewerOrientation.z=i.z,this.__viewerOrientation.w=i.w;const r=a.e.fromCopyFloat32ArrayColumnMajor(null==t?void 0:t.transform.matrix),s=a.e.fromCopyFloat32ArrayColumnMajor(null==n?void 0:n.transform.matrix),l=this.__viewerScale.x,c=t.transform.position,u=h.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate),d=h.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate),m=o.P.fromCopyArray([c.x,c.y,c.z]),f=o.P.fromCopyArray([c.x,c.y,c.z]),p=h.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate).add(m),v=h.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate).add(f),A=(u.x+d.x)/2,y=(u.z+d.z)/2,g=(p.x+v.x)/2,x=(p.z+v.z)/2,I=this.__viewerEntity.getTransform();I.localPosition=o.P.fromCopyArray([A,0,y]),I.localScale=o.P.fromCopyArray([l,l,l]),I.localEulerAngles=o.P.fromCopyArray([0,this.__viewerAzimuthAngle.x,0]),r.translateY=p.y,r.translateX=p.x-g,r.translateZ=p.z-x,r.translateY+=m.y,r.translateX+=m.x,r.translateZ+=m.z,s.translateY=v.y,s.translateX=v.x-g,s.translateZ=v.z-x,s.translateY+=f.y,s.translateX+=f.x,s.translateZ+=f.z,this.__leftCameraEntity.getTransform().localMatrix=r,this.__rightCameraEntity.getTransform().localMatrix=s}async __setupWebGLLayer(e,t){var n;const o=null===(n=this.__glw)||void 0===n?void 0:n.getRawContextAsWebGL2();if(null!=o){await o.makeXRCompatible(),this.__webglLayer=new window.XRWebGLLayer(e,o);const n=this.__webglLayer;e.updateRenderState({baseLayer:n,depthNear:.01,depthFar:1e3});const a=i.F.getWebGLResourceRepository();this.__canvasWidthForVR=n.framebufferWidth,this.__canvasHeightForVR=n.framebufferHeight,console.log(this.__canvasWidthForVR),console.log(this.__canvasHeightForVR),this.__multiviewFramebufferHandle,f.rFg._makeShaderInvalidateToAllMaterials(),a.resizeCanvas(this.__canvasWidthForVR,this.__canvasHeightForVR),this.__setWebXRMode(!0),t()}else console.error("WebGL context is not ready for WebXR.")}__updateView(e){this.__xrViewerPose=e.getViewerPose(this.__xrReferenceSpace),this.__setCameraInfoFromXRViews(this.__xrViewerPose)}__updateInputSources(e){this.__xrInputSources.forEach(((t,n)=>{if(_.Is.exist(t.gripSpace)){const i=e.getPose(t.gripSpace,this.__xrReferenceSpace);if(_.Is.exist(i)){const e=this.__controllerEntities[n];if(_.Is.exist(e)){const n=a.e.fromCopyFloat32ArrayColumnMajor(i.transform.matrix),o=a.e.fromCopyMatrix44(n);o.translateY+=this.__defaultPositionInLocalSpaceMode.y,o.translateY+=this.__viewerTranslate.y,e.getTransform().localMatrix=o;const r=(0,c.sz)(t);_.Is.exist(r)?(0,c._0)(e,r):console.warn("motionController not found")}}}}))}}},9131:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>A});var i=n(2102),o=n(7973),a=n(3496),r=n(963),s=n(4267),l=n(9190),c=n(2471),_=n(4690),h=n(6312),u=n(7987),d=n(2251),m=n(3648);const f=c.P.fromCopyArray([0,1.1,0]);class p{constructor(){this.__oGlw=new h.Hq,this.__isReadyForWebAR=!1,this.__oArSession=new h.Hq,this.__oWebglLayer=new h.Hq,this.__spaceType="local",this.__isWebARMode=!1,this.__requestedToEnterWebAR=!1,this.__oArViewerPose=new h.Hq,this.__oArReferenceSpace=new h.Hq,this.__defaultPositionInLocalSpaceMode=f,this.__canvasWidthForAR=0,this.__canvasHeightForAR=0,this._cameraEntity=o._.createCameraEntity(),this.__viewerTranslate=l.d6.zero(),this.__viewerAzimuthAngle=s.DU.zero(),this.__viewerOrientation=r.y.identity(),this.__viewerScale=l.d6.one(),this._cameraEntity.tryToSetUniqueName("WebAR Viewer",!0),this._cameraEntity.tryToSetTag({tag:"type",value:"background-assets"})}static getInstance(){return this.__instance||(this.__instance=new p),this.__instance}async readyForWebAR(e){await d.x.getInstance().loadModule("xr");const t=u.F.getWebGLResourceRepository().currentWebGLContextWrapper;if(null==t)throw new Error("WebGL Context is not ready yet.");if(this.__oGlw=new h.bD(t),!await navigator.xr.isSessionSupported("immersive-ar"))throw new Error("WebAR is not supported in this environment.");if(console.log("WebAR is supported."),e)e.style.display="block";else{const e=document.createElement("p"),n=document.createElement("a");n.setAttribute("id","enter-ar");const i=document.createTextNode("Enter AR");n.appendChild(i),e.appendChild(n);const o=t.canvas;o.parentNode.insertBefore(e,o),window.addEventListener("click",this.enterWebAR.bind(this))}return this.__isReadyForWebAR=!0,[]}async enterWebAR({initialUserPosition:e,callbackOnXrSessionStart:t=(()=>{}),callbackOnXrSessionEnd:n=(()=>{})}){const i=u.F.getWebGLResourceRepository().currentWebGLContextWrapper;if(null!=i&&this.__isReadyForWebAR){const o=await navigator.xr.requestSession("immersive-vr");this.__oArSession=new h.bD(o),o.addEventListener("end",(()=>{i.__gl.bindFramebuffer(i.__gl.FRAMEBUFFER,null),this.__oArSession=new h.Hq,this.__oWebglLayer=new h.Hq,this.__oArViewerPose=new h.Hq,this.__oArReferenceSpace=new h.Hq,this.__spaceType="local",this.__isReadyForWebAR=!1,this.__requestedToEnterWebAR=!1,this.__isWebARMode=!1,this.__defaultPositionInLocalSpaceMode=f,console.log("XRSession ends."),m.x.stopRenderLoop(),m.x.restartRenderLoop(),n()}));const a=await o.requestReferenceSpace("local");return this.__spaceType="local",this.__defaultPositionInLocalSpaceMode=null!=e?e:f,this.__oArReferenceSpace=new h.bD(a),m.x.stopRenderLoop(),await this.__setupWebGLLayer(o,t),this.__requestedToEnterWebAR=!0,m.x.restartRenderLoop(),void console.warn("End of enterWebXR.")}console.error("WebGL context or WebXRSession is not ready yet.")}async __setupWebGLLayer(e,t){const n=this.__oGlw.unwrapForce().getRawContext();if(null!=n){await n.makeXRCompatible(),this.__oWebglLayer=new h.bD(window.XRWebGLLayer(e,n));const i=this.__oWebglLayer.unwrapForce();e.updateRenderState({baseLayer:i,depthNear:.1,depthFar:1e4});const o=u.F.getWebGLResourceRepository();this.__canvasWidthForAR=i.framebufferWidth,this.__canvasHeightForAR=i.framebufferHeight,console.log(this.__canvasWidthForAR),console.log(this.__canvasHeightForAR),o.resizeCanvas(this.__canvasWidthForAR,this.__canvasHeightForAR),this.__isWebARMode=!0,t()}else console.error("WebGL context is not ready for WebXR.")}async exitWebAR(){this.__oArSession.has()&&await this.__oArSession.get().end()}getCanvasWidthForVr(){return this.__canvasWidthForAR}getCanvasHeightForVr(){return this.__canvasHeightForAR}get viewMatrix(){return this._cameraEntity.getCamera().viewMatrix}__updateView(e){this.__oArViewerPose=new h.bD(e.getViewerPose(this.__oArReferenceSpace.unwrapForce())),this.__setCameraInfoFromXRViews(this.__oArViewerPose.unwrapForce())}__setCameraInfoFromXRViews(e){if(_.Is.not.exist(e))return void console.warn("xrViewerPose not exist");const t=e.views[0];if(_.Is.not.exist(t))return;const n=e.transform.orientation;this.__viewerOrientation.x=n.x,this.__viewerOrientation.y=n.y,this.__viewerOrientation.z=n.z,this.__viewerOrientation.w=n.w;const i=a.e.fromCopyFloat32ArrayColumnMajor(null==t?void 0:t.transform.matrix),o=this.__viewerScale.x,r=t.transform.position,s=l.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate),h=c.P.fromCopyArray([r.x,r.y,r.z]),u=l.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate).add(h),d=s.x,m=s.z,f=u.x,p=u.z,v=this._cameraEntity.getTransform();v.localPosition=c.P.fromCopyArray([d,0,m]),v.localScale=c.P.fromCopyArray([o,o,o]),v.localEulerAngles=c.P.fromCopyArray([0,this.__viewerAzimuthAngle.x,0]),i.translateY=u.y,i.translateX=u.x-f,i.translateZ=u.z-p,i.translateY+=h.y,i.translateX+=h.x,i.translateZ+=h.z,this._cameraEntity.getTransform().localMatrix=i}get projectionMatrix(){const e=this.__oArViewerPose.unwrapForce().views[0];return a.e.fromCopyFloat32ArrayColumnMajor(_.Is.exist(e)?e.projectionMatrix:a.e.identity()._v)}_preRender(e,t){this.isWebARMode&&this.__requestedToEnterWebAR&&null!=t&&this.__updateView(t)}_postRender(){this.isWebARMode&&this.__oGlw.unwrapForce().getRawContext(),this.requestedToEnterWebAR}get isWebARMode(){return this.__isWebARMode}get isReadyForWebAR(){return this.__isReadyForWebAR}get requestedToEnterWebAR(){return this.__requestedToEnterWebAR}get arSession(){return this.__oArSession.unwrapOrUndefined()}get framebuffer(){var e,t;return null===(t=null===(e=this.__oArSession.unwrapOrUndefined())||void 0===e?void 0:e.renderState.baseLayer)||void 0===t?void 0:t.framebuffer}}const v=Object.freeze({WebXRSystem:i.X,WebARSystem:p}),A=v;(0,eval)("this").RnXR=v},5337:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i={version:"9236908-dirty",branch:"main"}},6893:function(){(function(){"use strict";function l(e){throw e}var r=void 0,t,aa=this;function v(e,t){var n,i=e.split("."),o=aa;!(i[0]in o)&&o.execScript&&o.execScript("var "+i[0]);for(;i.length&&(n=i.shift());)i.length||t===r?o=o[n]?o[n]:o[n]={}:o[n]=t}var y="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView,z;for(new(y?Uint8Array:Array)(256),z=0;256>z;++z)for(var B=z,ba=7,B=B>>>1;B;B>>>=1)--ba;var ca=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],C=y?new Uint32Array(ca):ca,a;if(aa.Uint8Array!==r)try{eval("String.fromCharCode.apply(null, new Uint8Array([0]));")}catch(e){String.fromCharCode.apply=(a=String.fromCharCode.apply,function(e,t){return a.call(String.fromCharCode,e,Array.prototype.slice.call(t))})}function D(e){var t,n,i,o,a,r,s,l,c,_,h=e.length,u=0,d=Number.POSITIVE_INFINITY;for(l=0;lu&&(u=e[l]),e[l]>=1;for(_=i<<16|l,c=r;cG;G++)switch(!0){case 143>=G:F.push([G+48,8]);break;case 255>=G:F.push([G-144+400,9]);break;case 279>=G:F.push([G-256+0,7]);break;case 287>=G:F.push([G-280+192,8]);break;default:l("invalid literal: "+G)}var fa=function(){function e(e){switch(!0){case 3===e:return[257,e-3,0];case 4===e:return[258,e-4,0];case 5===e:return[259,e-5,0];case 6===e:return[260,e-6,0];case 7===e:return[261,e-7,0];case 8===e:return[262,e-8,0];case 9===e:return[263,e-9,0];case 10===e:return[264,e-10,0];case 12>=e:return[265,e-11,1];case 14>=e:return[266,e-13,1];case 16>=e:return[267,e-15,1];case 18>=e:return[268,e-17,1];case 22>=e:return[269,e-19,2];case 26>=e:return[270,e-23,2];case 30>=e:return[271,e-27,2];case 34>=e:return[272,e-31,2];case 42>=e:return[273,e-35,3];case 50>=e:return[274,e-43,3];case 58>=e:return[275,e-51,3];case 66>=e:return[276,e-59,3];case 82>=e:return[277,e-67,4];case 98>=e:return[278,e-83,4];case 114>=e:return[279,e-99,4];case 130>=e:return[280,e-115,4];case 162>=e:return[281,e-131,5];case 194>=e:return[282,e-163,5];case 226>=e:return[283,e-195,5];case 257>=e:return[284,e-227,5];case 258===e:return[285,e-258,0];default:l("invalid length: "+e)}}var t,n,i=[];for(t=3;258>=t;t++)n=e(t),i[t]=n[2]<<24|n[1]<<16|n[0];return i}();function I(e,t){switch(this.l=[],this.m=32768,this.d=this.f=this.c=this.t=0,this.input=y?new Uint8Array(e):e,this.u=!1,this.n=J,this.K=!1,!t&&(t={})||(t.index&&(this.c=t.index),t.bufferSize&&(this.m=t.bufferSize),t.bufferType&&(this.n=t.bufferType),t.resize&&(this.K=t.resize)),this.n){case ga:this.a=32768,this.b=new(y?Uint8Array:Array)(32768+this.m+258);break;case J:this.a=0,this.b=new(y?Uint8Array:Array)(this.m),this.e=this.W,this.B=this.R,this.q=this.V;break;default:l(Error("invalid inflate mode"))}}y&&new Uint32Array(fa);var ga=0,J=1;I.prototype.r=function(){for(;!this.u;){var e=K(this,3);switch(1&e&&(this.u=!0),e>>>=1){case 0:var t=this.input,n=this.c,i=this.b,o=this.a,a=t.length,s=r,c=i.length,_=r;switch(this.d=this.f=0,n+1>=a&&l(Error("invalid uncompressed block header: LEN")),s=t[n++]|t[n++]<<8,n+1>=a&&l(Error("invalid uncompressed block header: NLEN")),s===~(t[n++]|t[n++]<<8)&&l(Error("invalid uncompressed block header: length verify")),n+s>t.length&&l(Error("input buffer is broken")),this.n){case ga:for(;o+s>i.length;){if(s-=_=c-o,y)i.set(t.subarray(n,n+_),o),o+=_,n+=_;else for(;_--;)i[o++]=t[n++];this.a=o,i=this.e(),o=this.a}break;case J:for(;o+s>i.length;)i=this.e({H:2});break;default:l(Error("invalid inflate mode"))}if(y)i.set(t.subarray(n,n+s),o),o+=s,n+=s;else for(;s--;)i[o++]=t[n++];this.c=n,this.a=o,this.b=i;break;case 1:this.q(ha,ia);break;case 2:var h,u,d,m,f=K(this,5)+257,p=K(this,5)+1,v=K(this,4)+4,A=new(y?Uint8Array:Array)(L.length),g=r,x=r,I=r,b=r,E=r;for(E=0;E=R?8:255>=R?9:279>=R?7:8;var ha=D(Q),S=new(y?Uint8Array:Array)(30),T,ra;for(T=0,ra=S.length;T=s&&l(Error("input buffer is broken")),i|=a[r++]<>>t,e.d=o-t,e.c=r,n}function M(e,t){for(var n,i,o=e.f,a=e.d,r=e.input,s=e.c,c=r.length,_=t[0],h=t[1];a=c);)o|=r[s++]<>>16)>a&&l(Error("invalid code length: "+i)),e.f=o>>i,e.d=a-i,e.c=s,65535&n}function U(e){e=e||{},this.files=[],this.v=e.comment}function V(e,t){t=t||{},this.input=y&&e instanceof Array?new Uint8Array(e):e,this.c=0,this.ba=t.verify||!1,this.j=t.password}t=I.prototype,t.q=function(e,t){var n=this.b,i=this.a;this.C=e;for(var o,a,r,s,l=n.length-258;256!==(o=M(this,e));)if(256>o)i>=l&&(this.a=i,n=this.e(),i=this.a),n[i++]=o;else for(s=la[a=o-257],0=l&&(this.a=i,n=this.e(),i=this.a);s--;)n[i]=n[i++-r];for(;8<=this.d;)this.d-=8,this.c--;this.a=i},t.V=function(e,t){var n=this.b,i=this.a;this.C=e;for(var o,a,r,s,l=n.length;256!==(o=M(this,e));)if(256>o)i>=l&&(l=(n=this.e()).length),n[i++]=o;else for(s=la[a=o-257],0l&&(l=(n=this.e()).length);s--;)n[i]=n[i++-r];for(;8<=this.d;)this.d-=8,this.c--;this.a=i},t.e=function(){var e,t,n=new(y?Uint8Array:Array)(this.a-32768),i=this.a-32768,o=this.b;if(y)n.set(o.subarray(32768,n.length));else for(e=0,t=n.length;ee;++e)o[e]=o[i+e];return this.a=32768,o},t.W=function(e){var t,n,i,o=this.input.length/this.c+1|0,a=this.input,r=this.b;return e&&("number"==typeof e.H&&(o=e.H),"number"==typeof e.P&&(o+=e.P)),n=2>o?(i=(a.length-this.c)/this.C[2]/2*258|0)t&&(this.b.length=t),e=this.b),this.buffer=e},U.prototype.L=function(e){this.j=e},U.prototype.s=function(e){var t=65535&e[2]|2;return t*(1^t)>>8&255},U.prototype.k=function(e,t){e[0]=(C[255&(e[0]^t)]^e[0]>>>8)>>>0,e[1]=1+(6681*(20173*(e[1]+(255&e[0]))>>>0)>>>0)>>>0,e[2]=(C[255&(e[2]^e[1]>>>24)]^e[2]>>>8)>>>0},U.prototype.T=function(e){var t,n,i=[305419896,591751049,878082192];for(y&&(i=new Uint32Array(i)),t=0,n=e.length;t>>0,this.z=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.J=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.h=e[t++]|e[t++]<<8,this.g=e[t++]|e[t++]<<8,this.F=e[t++]|e[t++]<<8,this.ea=e[t++]|e[t++]<<8,this.ga=e[t++]|e[t++]<<8,this.fa=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,this.$=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.filename=String.fromCharCode.apply(null,y?e.subarray(t,t+=this.h):e.slice(t,t+=this.h)),this.X=y?e.subarray(t,t+=this.g):e.slice(t,t+=this.g),this.v=y?e.subarray(t,t+this.F):e.slice(t,t+this.F),this.length=t-this.offset};var va={N:1,ca:8,da:2048};function $(e){var t,n,i,o,a=[],s={};if(!e.i){if(e.o===r){var c,_=e.input;if(!e.D)e:{var h,u=e.input;for(h=u.length-12;0>>0,e.o=(_[c++]|_[c++]<<8|_[c++]<<16|_[c++]<<24)>>>0,e.w=_[c++]|_[c++]<<8,e.v=y?_.subarray(c,c+e.w):_.slice(c,c+e.w)}for(t=e.o,i=0,o=e.aa;i>>0,this.z=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.J=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.h=e[t++]|e[t++]<<8,this.g=e[t++]|e[t++]<<8,this.filename=String.fromCharCode.apply(null,y?e.subarray(t,t+=this.h):e.slice(t,t+=this.h)),this.X=y?e.subarray(t,t+=this.g):e.slice(t,t+=this.g),this.length=t-this.offset},t=V.prototype,t.Y=function(){var e,t,n,i=[];for(this.i||$(this),e=0,t=(n=this.i).length;e>>8^C[255&(p^c[v])];for(A=g>>3;A--;v+=8)p=(p=(p=(p=(p=(p=(p=(p=p>>>8^C[255&(p^c[v])])>>>8^C[255&(p^c[v+1])])>>>8^C[255&(p^c[v+2])])>>>8^C[255&(p^c[v+3])])>>>8^C[255&(p^c[v+4])])>>>8^C[255&(p^c[v+5])])>>>8^C[255&(p^c[v+6])])>>>8^C[255&(p^c[v+7])];_=(4294967295^p)>>>0,o.p!==_&&l(Error("wrong crc: file=0x"+o.p.toString(16)+", data=0x"+_.toString(16)))}return c},t.L=function(e){this.j=e},t.k=U.prototype.k,t.S=U.prototype.T,t.s=U.prototype.s,v("Zlib.Unzip",V),v("Zlib.Unzip.prototype.decompress",V.prototype.r),v("Zlib.Unzip.prototype.getFilenames",V.prototype.Y),v("Zlib.Unzip.prototype.setPassword",V.prototype.L)}).call(this)},3705:function(t,n,i){var o;o=function(){function t(){var e,t,s=document.createElement("canvas"),l="t",c=1,_=2.2,h=null;return s.__defineGetter__("exposure",(function(){return c})),s.__defineSetter__("exposure",(function(n){c=n,h&&(r(h,c,_,t.data),e.putImageData(t,0,0))})),s.__defineGetter__("gamma",(function(){return _})),s.__defineSetter__("gamma",(function(n){_=n,h&&(r(h,c,_,t.data),e.putImageData(t,0,0))})),s.__defineGetter__("dataFloat",(function(){return a(h)})),s.__defineGetter__("dataRGBE",(function(){return h})),s.toHDRBlob=function(e,t,i){function o(e,t,n){var i=e.createShader(n);return e.shaderSource(i,t),e.compileShader(i),i}var r=t&&t.match(/rgb9_e5/i)?new Uint8Array(n(a(h)).buffer):new Uint8Array(h.buffer),s=this.width,l=this.height;if(s*l*4=400)return this.onerror();for(var e,t="",n=0,i=new Uint8Array(this.response);!t.match(/\n\n[^\n]+\n/g);)t+=String.fromCharCode(i[n++]);if("32-bit_rle_rgbe"!=(e=t.match(/FORMAT=(.*)$/m)[1]))return console.warn("unknown format : "+e),this.onerror();for(var o=t.split(/\n/).reverse()[1].split(" "),a=1*o[3],r=1*o[1],s=new Uint8Array(a*r*4),l=0,c=0;c0;)if(s.set(i.slice(n,n+=4),l),1==s[l]&&1==s[l+1]&&1==s[l+2])for(s[l+3];m>0;m--)s.set(s.slice(l-4,l),l),l+=4,u--;else u--,l+=4}else{if((_[2]<<8)+_[3]!=a)return console.warn("HDR line mismatch .."),this.onerror();for(var m=0;m<4;m++)for(var f,p,v=m*a,A=(m+1)*a;v128)for(p=f[0]-128;p-- >0;)h[v++]=f[1];else for(p=f[0]-1,h[v++]=f[1];p-- >0;)h[v++]=i[n++];for(m=0;m>2,a=(t=t||new Float32Array(3*o),0);a>>23)*i,t[3*a+1]=(n>>>14&511)*i,t[3*a+2]=(n>>>5&511)*i;return t}function o(t,n){for(var i,o,a,r,s,l=t.byteLength/12|0,c=(n=n||new Uint8Array(4*l),0);c>2,o=(t=t||new Float32Array(3*i),0);o>2,s=(i=i||new Uint8ClampedArray(4*r),0);s{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AABB:()=>e.mNG,AABBGizmo:()=>e.qfN,AbsoluteAnimation:()=>e.lam,AbstractArrayBufferBaseMathNumber:()=>e.bCT,AbstractCameraController:()=>e.mC0,AbstractMaterialContent:()=>e.PxB,AbstractMatrix:()=>e.XAY,AbstractQuaternion:()=>e.lJH,AbstractShaderNode:()=>e.VI2,AbstractTexture:()=>e.yEY,AbstractVector:()=>e.OxW,Accessor:()=>e.U_s,AddShaderNode:()=>e.yd$,AlphaMode:()=>e.FvO,AnimationAssigner:()=>e.tVY,AnimationAttribute:()=>e.sdx,AnimationComponent:()=>e.cwg,AnimationInterpolation:()=>e.kOi,AttributeNormalShaderNode:()=>e.Sy_,AttributePositionShaderNode:()=>e.JRY,Axis:()=>e.RDh,BasisCompressionType:()=>e.l6R,BlendShapeComponent:()=>e.xTt,BlockBeginShader:()=>l.I,BlockBeginShaderNode:()=>e.afv,BlockEndShader:()=>c.$,BlockEndShaderNode:()=>e.fgK,BoneDataType:()=>e.Nh_,Buffer:()=>e.lWr,BufferUse:()=>e.$HW,BufferView:()=>e.qP0,CGAPIResourceRepository:()=>e.FOu,Cache:()=>e.CtF,CameraComponent:()=>e.Myt,CameraControllerComponent:()=>e.SPq,CameraControllerType:()=>e.MyC,CameraType:()=>e.iM5,ClassicShadingShader:()=>u,ColorGradingUsingLUTsMaterialContent:()=>e.h_U,ColorRgb:()=>e.sZ3,ColorRgba:()=>e.tWC,ComplexVertexAttribute:()=>e.et4,Component:()=>e.wA2,ComponentRepository:()=>e.C2e,ComponentType:()=>e.reR,CompositionType:()=>e.dh2,CompressionTextureType:()=>e.bfi,Config:()=>e.DeH,ConstRgbaBlack:()=>e.SGm,ConstRgbaWhite:()=>e.zUz,ConstVector2_0_0:()=>e.igI,ConstVector2_1_1:()=>e.HOX,ConstVector3_0_0_0:()=>e.R1o,ConstVector3_1_1_1:()=>e.p8_,ConstVector4_0_0_0_0:()=>e.GYQ,ConstVector4_0_0_0_1:()=>e.cV0,ConstVector4_1_1_1_1:()=>e.n9W,ConstantVariableShader:()=>d.i,ConstantVariableShaderNode:()=>e.GFx,Cube:()=>e.Xv,CubeTexture:()=>e.BtG,CustomMaterialContent:()=>e.fZl,DataUtil:()=>e.j4H,DefaultTextures:()=>e.kTl,DepthEncodeMaterialContent:()=>e.Q5_,DetectHighLuminanceMaterialContent:()=>e.tlJ,DotProductShaderNode:()=>e.jLO,DrcPointCloudImporter:()=>e.c5O,EVENT_CLICK:()=>e.Lfs,EVENT_KEY_DOWN:()=>e._QQ,EVENT_KEY_PRESS:()=>e.lOB,EVENT_KEY_UP:()=>e.k$j,EVENT_MOUSE_DOWN:()=>e.zUJ,EVENT_MOUSE_ENTER:()=>e.ak0,EVENT_MOUSE_LEAVE:()=>e.n9,EVENT_MOUSE_MOVE:()=>e.k4,EVENT_MOUSE_OVER:()=>e.vE_,EVENT_MOUSE_UP:()=>e.cG$,EVENT_MOUSE_WHEEL:()=>e.Sss,EVENT_MSPOINTER_DOWN:()=>e.q7F,EVENT_MSPOINTER_MOVE:()=>e.cAE,EVENT_MSPOINTER_UP:()=>e.fAB,EVENT_ORIENTATION_CHANGE:()=>e.SGU,EVENT_POINTER_CANCEL:()=>e.cEP,EVENT_POINTER_DOWN:()=>e.cSB,EVENT_POINTER_ENTER:()=>e.lcf,EVENT_POINTER_LEAVE:()=>e.RyN,EVENT_POINTER_MOVE:()=>e._6o,EVENT_POINTER_OUT:()=>e.UB9,EVENT_POINTER_OVER:()=>e.Cfj,EVENT_POINTER_UP:()=>e.ROv,EVENT_RESIZE:()=>e.hDl,EVENT_TOUCH_CANCEL:()=>e.VS3,EVENT_TOUCH_DOUBLE_TAP:()=>e.Ywc,EVENT_TOUCH_DRAG:()=>e.pt8,EVENT_TOUCH_END:()=>e.p22,EVENT_TOUCH_ENTER:()=>e.jPE,EVENT_TOUCH_HOLD:()=>e.lv,EVENT_TOUCH_LEAVE:()=>e.adG,EVENT_TOUCH_LONG_TAP:()=>e.oM$,EVENT_TOUCH_MOVE:()=>e.jXG,EVENT_TOUCH_OUT:()=>e.fAN,EVENT_TOUCH_OVER:()=>e.KP1,EVENT_TOUCH_PINCH:()=>e.hdu,EVENT_TOUCH_START:()=>e.uso,EVENT_TOUCH_SWIPE:()=>e.yyZ,EVENT_TOUCH_TAP:()=>e.Rz4,Effekseer:()=>S.A,EffekseerComponent:()=>S.D,EndShader:()=>m.x,Entity:()=>e.JHW,EntityHelper:()=>e._nU,EntityRepository:()=>e.gIQ,EntityUIDOutputMaterialContent:()=>e.zFq,EnumClass:()=>e.Jxr,EnvConstantMaterialContent:()=>e.Zfh,Err:()=>e.UGl,EventPubSub:()=>e.U7Y,Expression:()=>e.A2z,FileType:()=>e.Tv5,ForwardRenderPipeline:()=>e.n8g,Frame:()=>e.RQC,FrameBuffer:()=>e.uLm,Frustum:()=>e.iWj,FurnaceTestMaterialContent:()=>e.bLY,GLSLShader:()=>s.m,GLTF2_EXPORT_DRACO:()=>e.Dy6,GLTF2_EXPORT_EMBEDDED:()=>e.jll,GLTF2_EXPORT_GLB:()=>e.Dbu,GLTF2_EXPORT_GLTF:()=>e.ESz,GLTF2_EXPORT_NO_DOWNLOAD:()=>e.S5k,GL_ACTIVE_ATTRIBUTES:()=>T._$8,GL_ACTIVE_TEXTURE:()=>T.lkt,GL_ACTIVE_UNIFORMS:()=>T.Td9,GL_ACTIVE_UNIFORM_BLOCKS:()=>T.wEd,GL_ALIASED_LINE_WIDTH_RANGE:()=>T.ogk,GL_ALIASED_POINT_SIZE_RANGE:()=>T.AY1,GL_ALPHA:()=>T.fNk,GL_ALPHA_BITS:()=>T.Y0n,GL_ALREADY_SIGNALED:()=>T.WPj,GL_ALWAYS:()=>T.gOo,GL_ANY_SAMPLES_PASSED:()=>T.$LR,GL_ANY_SAMPLES_PASSED_CONSERVATIVE:()=>T.faJ,GL_ARRAY_BUFFER:()=>T.TdU,GL_ARRAY_BUFFER_BINDING:()=>T.UAv,GL_ATTACHED_SHADERS:()=>T.Q$l,GL_BACK:()=>T.wIF,GL_BLEND:()=>T.ZXb,GL_BLEND_COLOR:()=>T.hzX,GL_BLEND_DST_ALPHA:()=>T.r9F,GL_BLEND_DST_RGB:()=>T.Kzo,GL_BLEND_EQUATION:()=>T.ttq,GL_BLEND_EQUATION_ALPHA:()=>T.XG_,GL_BLEND_EQUATION_RGB:()=>T.HPC,GL_BLEND_SRC_ALPHA:()=>T.QH$,GL_BLEND_SRC_RGB:()=>T._1o,GL_BLUE_BITS:()=>T.EZ0,GL_BOOL:()=>T.N9T,GL_BOOL_VEC2:()=>T.vgW,GL_BOOL_VEC3:()=>T.tqi,GL_BOOL_VEC4:()=>T.iU2,GL_BROWSER_DEFAULT_WEBGL:()=>T.BWL,GL_BUFFER_SIZE:()=>T.F_m,GL_BUFFER_USAGE:()=>T.$et,GL_CCW:()=>T.gx8,GL_CLAMP_TO_EDGE:()=>T.Y8m,GL_COLOR:()=>T.Wlc,GL_COLOR_ATTACHMENT0:()=>T.krQ,GL_COLOR_ATTACHMENT0_WEBGL:()=>T.YCV,GL_COLOR_ATTACHMENT1:()=>T.p7w,GL_COLOR_ATTACHMENT10:()=>T.Axb,GL_COLOR_ATTACHMENT10_WEBGL:()=>T.eqO,GL_COLOR_ATTACHMENT11:()=>T.gwn,GL_COLOR_ATTACHMENT11_WEBGL:()=>T.BM1,GL_COLOR_ATTACHMENT12:()=>T.w4x,GL_COLOR_ATTACHMENT12_WEBGL:()=>T.CCZ,GL_COLOR_ATTACHMENT13:()=>T.FQh,GL_COLOR_ATTACHMENT13_WEBGL:()=>T.AOk,GL_COLOR_ATTACHMENT14:()=>T.rjz,GL_COLOR_ATTACHMENT14_WEBGL:()=>T.LwI,GL_COLOR_ATTACHMENT15:()=>T._8G,GL_COLOR_ATTACHMENT15_WEBGL:()=>T.ZC4,GL_COLOR_ATTACHMENT1_WEBGL:()=>T.$9l,GL_COLOR_ATTACHMENT2:()=>T.Bky,GL_COLOR_ATTACHMENT2_WEBGL:()=>T.qNf,GL_COLOR_ATTACHMENT3:()=>T.I2u,GL_COLOR_ATTACHMENT3_WEBGL:()=>T.oC9,GL_COLOR_ATTACHMENT4:()=>T.ip$,GL_COLOR_ATTACHMENT4_WEBGL:()=>T.HBF,GL_COLOR_ATTACHMENT5:()=>T._Mr,GL_COLOR_ATTACHMENT5_WEBGL:()=>T.vpR,GL_COLOR_ATTACHMENT6:()=>T.w_G,GL_COLOR_ATTACHMENT6_WEBGL:()=>T.wpZ,GL_COLOR_ATTACHMENT7:()=>T.UBE,GL_COLOR_ATTACHMENT7_WEBGL:()=>T.L8z,GL_COLOR_ATTACHMENT8:()=>T.egt,GL_COLOR_ATTACHMENT8_WEBGL:()=>T.J6F,GL_COLOR_ATTACHMENT9:()=>T.O27,GL_COLOR_ATTACHMENT9_WEBGL:()=>T.L4c,GL_COLOR_BUFFER_BIT:()=>T.$FK,GL_COLOR_CLEAR_VALUE:()=>T.FEv,GL_COLOR_WRITEMASK:()=>T.Ut4,GL_COMPARE_REF_TO_TEXTURE:()=>T.M_A,GL_COMPILE_STATUS:()=>T.MKG,GL_COMPRESSED_R11_EAC:()=>T.d6W,GL_COMPRESSED_RG11_EAC:()=>T.y3r,GL_COMPRESSED_RGB8_ETC2:()=>T.L3p,GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:()=>T.aLt,GL_COMPRESSED_RGBA8_ETC2_EAC:()=>T.DM,GL_COMPRESSED_RGBA_ASTC_10X10_KHR:()=>T.Hfs,GL_COMPRESSED_RGBA_ASTC_10X5_KHR:()=>T.ObQ,GL_COMPRESSED_RGBA_ASTC_10X6_KHR:()=>T.Q2$,GL_COMPRESSED_RGBA_ASTC_10X8_KHR:()=>T.kvX,GL_COMPRESSED_RGBA_ASTC_12X10_KHR:()=>T.U05,GL_COMPRESSED_RGBA_ASTC_12X12_KHR:()=>T.nsH,GL_COMPRESSED_RGBA_ASTC_4X4_KHR:()=>T.mrS,GL_COMPRESSED_RGBA_ASTC_5X4_KHR:()=>T.yZM,GL_COMPRESSED_RGBA_ASTC_5X5_KHR:()=>T.ij3,GL_COMPRESSED_RGBA_ASTC_6X5_KHR:()=>T.qSO,GL_COMPRESSED_RGBA_ASTC_6X6_KHR:()=>T.Fh_,GL_COMPRESSED_RGBA_ASTC_8X5_KHR:()=>T._zC,GL_COMPRESSED_RGBA_ASTC_8X6_KHR:()=>T.$9u,GL_COMPRESSED_RGBA_ASTC_8X8_KHR:()=>T.Gow,GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:()=>T.$1s,GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:()=>T.$PT,GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:()=>T.fYk,GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:()=>T.DcX,GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:()=>T.bTO,GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:()=>T.TsK,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:()=>T.G00,GL_COMPRESSED_RGB_ATC_WEBGL:()=>T.xug,GL_COMPRESSED_RGB_ETC1_WEBGL:()=>T.mhR,GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG:()=>T.Awc,GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG:()=>T.EW4,GL_COMPRESSED_RGB_S3TC_DXT1_EXT:()=>T.suj,GL_COMPRESSED_SIGNED_R11_EAC:()=>T.SzQ,GL_COMPRESSED_SIGNED_RG11_EAC:()=>T.Y_Y,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:()=>T.dN8,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:()=>T.TY8,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:()=>T.EMZ,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:()=>T.DnL,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:()=>T.dpg,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:()=>T.kW3,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:()=>T.dcZ,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:()=>T.qfx,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:()=>T.a2d,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:()=>T.hRd,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:()=>T.Tkf,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:()=>T.EiH,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:()=>T.Ham,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:()=>T.kUS,GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:()=>T.iLk,GL_COMPRESSED_SRGB8_ETC2:()=>T.rZr,GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:()=>T.eyW,GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:()=>T.XY4,GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:()=>T.FyP,GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:()=>T.QrU,GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:()=>T.F8G,GL_COMPRESSED_TEXTURE_FORMATS:()=>T.r4j,GL_CONDITION_SATISFIED:()=>T.oRF,GL_CONSTANT_ALPHA:()=>T.HN$,GL_CONSTANT_COLOR:()=>T.obT,GL_CONTEXT_LOST_WEBGL:()=>T.Ahs,GL_COPY_READ_BUFFER:()=>T.jIl,GL_COPY_READ_BUFFER_BINDING:()=>T.F0I,GL_COPY_WRITE_BUFFER:()=>T.Pa5,GL_COPY_WRITE_BUFFER_BINDING:()=>T.$XJ,GL_CULL_FACE:()=>T.tef,GL_CULL_FACE_MODE:()=>T.lkd,GL_CURRENT_PROGRAM:()=>T.Gi2,GL_CURRENT_QUERY:()=>T.pcv,GL_CURRENT_QUERY_EXT:()=>T.bye,GL_CURRENT_VERTEX_ATTRIB:()=>T.tV_,GL_CW:()=>T.PU5,GL_DATA_BYTE:()=>T.q7Q,GL_DATA_FLOAT:()=>T.OT$,GL_DATA_INT:()=>T.Nq4,GL_DATA_SHORT:()=>T._TP,GL_DATA_UNSIGNED_BYTE:()=>T.Ywg,GL_DATA_UNSIGNED_INT:()=>T.M_8,GL_DATA_UNSIGNED_SHORT:()=>T.rkl,GL_DECR:()=>T.nTe,GL_DECR_WRAP:()=>T.k4y,GL_DELETE_STATUS:()=>T.Pw6,GL_DEPTH:()=>T.gLP,GL_DEPTH24_STENCIL8:()=>T.pmD,GL_DEPTH32F_STENCIL8:()=>T.WB9,GL_DEPTH_ATTACHMENT:()=>T.ksX,GL_DEPTH_BITS:()=>T.Ro9,GL_DEPTH_BUFFER_BIT:()=>T.GuG,GL_DEPTH_CLEAR_VALUE:()=>T.WRC,GL_DEPTH_COMPONENT:()=>T.pEo,GL_DEPTH_COMPONENT16:()=>T.r7P,GL_DEPTH_COMPONENT24:()=>T.LjI,GL_DEPTH_COMPONENT32F:()=>T.FcV,GL_DEPTH_FUNC:()=>T.hvl,GL_DEPTH_RANGE:()=>T.w97,GL_DEPTH_STENCIL:()=>T.Bwm,GL_DEPTH_STENCIL_ATTACHMENT:()=>T.y$A,GL_DEPTH_TEST:()=>T.oHv,GL_DEPTH_WRITEMASK:()=>T.b0C,GL_DITHER:()=>T.Rad,GL_DONT_CARE:()=>T.u3g,GL_DRAW_BUFFER0:()=>T.a36,GL_DRAW_BUFFER0_WEBGL:()=>T.Jql,GL_DRAW_BUFFER1:()=>T.lsi,GL_DRAW_BUFFER10:()=>T.y1m,GL_DRAW_BUFFER10_WEBGL:()=>T.L42,GL_DRAW_BUFFER11:()=>T.ubh,GL_DRAW_BUFFER11_WEBGL:()=>T.LcQ,GL_DRAW_BUFFER12:()=>T.j7V,GL_DRAW_BUFFER12_WEBGL:()=>T.Sp2,GL_DRAW_BUFFER13:()=>T.dk8,GL_DRAW_BUFFER13_WEBGL:()=>T.oLV,GL_DRAW_BUFFER14:()=>T.AV8,GL_DRAW_BUFFER14_WEBGL:()=>T.k5c,GL_DRAW_BUFFER15:()=>T.so$,GL_DRAW_BUFFER15_WEBGL:()=>T.uyr,GL_DRAW_BUFFER1_WEBGL:()=>T.mRc,GL_DRAW_BUFFER2:()=>T.E$e,GL_DRAW_BUFFER2_W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GMENT_SHADER_DERIVATIVE_HINT:()=>T.AQL,GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:()=>T.Qh0,GL_FRAMEBUFFER:()=>T.Iqe,GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:()=>T.vEJ,GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:()=>T.BSP,GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:()=>T.Yhe,GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:()=>T.U4r,GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:()=>T.MLp,GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:()=>T.$ri,GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:()=>T.hCR,GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:()=>T.y8S,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:()=>T.UlJ,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:()=>T.KY4,GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:()=>T.HHs,GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:()=>T.HGq,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:()=>T.jD8,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:()=>T.dIe,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:()=>T.$TT,GL_FRAMEBUFFER_BINDING:()=>T.F06,GL_FRAMEBUFFER_COMPLETE:()=>T.Erj,GL_FRAMEBUFFER_DEFAULT:()=>T.AjE,GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:()=>T.Qlq,GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:()=>T.URo,GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:()=>T.lmp,GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:()=>T.rfC,GL_FRAMEBUFFER_UNSUPPORTED:()=>T.JZg,GL_FRONT:()=>T.dte,GL_FRONT_AND_BACK:()=>T.cN,GL_FRONT_FACE:()=>T.gI2,GL_FUNC_ADD:()=>T.gNb,GL_FUNC_REVERSE_SUBTRACT:()=>T.lJZ,GL_FUNC_SUBSTRACT:()=>T.xHF,GL_GENERATE_MIPMAP_HINT:()=>T.NyC,GL_GEQUAL:()=>T.qbs,GL_GPU_DISJOINT_EXT:()=>T.FpK,GL_GREATER:()=>T.hys,GL_GREEN_BITS:()=>T.jtX,GL_HALF_FLOAT:()=>T.XpU,GL_HALF_FLOAT_OES:()=>T.fb9,GL_HIGH_FLOAT:()=>T.w8k,GL_HIGH_INT:()=>T.F8$,GL_IMPLEMENTATION_COLOR_READ_FORMAT:()=>T.az3,GL_IMPLEMENTATION_COLOR_READ_TYPE:()=>T.AKO,GL_INCR:()=>T.uyu,GL_INCR_WRAP:()=>T.It5,GL_INTERLEAVED_ATTRIBS:()=>T.MNF,GL_INT_2_10_10_10_REV:()=>T.Seb,GL_INT_SAMPLER_2D:()=>T.qiu,GL_INT_SAMPLER_2D_ARRAY:()=>T.uU2,GL_INT_SAMPLER_3D:()=>T.PnX,GL_INT_SAMPLER_CUBE:()=>T.WfD,GL_INT_VEC2:()=>T.RS3,GL_INT_VEC3:()=>T.yYj,GL_INT_VEC4:()=>T.xyr,GL_INVALID_ENUM:()=>T.JC7,GL_INVALID_FRAMEBUFFER_OPERATION:()=>T.aXw,GL_INVALID_INDEX:()=>T.h2K,GL_INVALID_OPERATION:()=>T.lZq,GL_INVALID_VALUE:()=>T.Qpw,GL_INVERT:()=>T.SUn,GL_KEEP:()=>T.Rk$,GL_LEQUAL:()=>T.Vfd,GL_LESS:()=>T.hyR,GL_LINEAR:()=>T.utc,GL_LINEAR_MIPMAP_LINEAR:()=>T.Onn,GL_LINEAR_MIPMAP_NEAREST:()=>T.D68,GL_LINES:()=>T.CB7,GL_LINE_LOOP:()=>T.Jxz,GL_LINE_STRIP:()=>T.M0t,GL_LINE_WIDTH:()=>T.uik,GL_LINK_STATUS:()=>T.WNe,GL_LOW_FLOAT:()=>T.B2j,GL_LOW_INT:()=>T.OJ6,GL_LUMINANCE:()=>T.y9I,GL_LUMINANCE_ALPHA:()=>T.VPl,GL_MAX:()=>T.bQw,GL_MAX_3D_TEXTURE_SIZE:()=>T.TSE,GL_MAX_ARRAY_TEXTURE_LAYERS:()=>T.Dn,GL_MAX_CLIENT_WAIT_TIMEOUT_WEBGL:()=>T.Tr4,GL_MAX_COLOR_ATTACHMENTS:()=>T.DM2,GL_MAX_COLOR_ATTACHMENTS_WEBGL:()=>T.AA5,GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:()=>T.lPV,GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:()=>T.QZz,GL_MAX_COMBINED_UNIFORM_BLOCKS:()=>T.PKw,GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:()=>T.Dgg,GL_MAX_CUBE_MAP_TEXTURE_SIZE:()=>T.ly5,GL_MAX_DRAW_BUFFERS:()=>T.TQ9,GL_MAX_DRAW_BUFFERS_WEBGL:()=>T.GuK,GL_MAX_ELEMENTS_INDICES:()=>T.iIj,GL_MAX_ELEMENTS_VERTICES:()=>T.$OY,GL_MAX_ELEMENT_INDEX:()=>T.SKn,GL_MAX_EXT:()=>T.VdM,GL_MAX_FRAGMENT_INPUT_COMPONENTS:()=>T.YNJ,GL_MAX_FRAGMENT_UNIFORM_BLOCKS:()=>T.PUO,GL_MAX_FRAGMENT_UNIFORM_COMPONENTS:()=>T.Jvo,GL_MAX_FRAGMENT_UNIFORM_VECTORS:()=>T.JJY,GL_MAX_PROGRAM_TEXEL_OFFSET:()=>T._b_,GL_MAX_RENDERBUFFER_SIZE:()=>T.ml9,GL_MAX_SAMPLES:()=>T.WBe,GL_MAX_SERVER_WAIT_TIMEOUT:()=>T.epv,GL_MAX_TEXTURE_IMAGE_UNITS:()=>T.D8i,GL_MAX_TEXTURE_LOD_BIAS:()=>T.kky,GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:()=>T.oR$,GL_MAX_TEXTURE_SIZE:()=>T.S1v,GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:()=>T.QkI,GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:()=>T._YZ,GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:()=>T.Mlt,GL_MAX_UNIFORM_BLOCK_SIZE:()=>T.uri,GL_MAX_UNIFORM_BUFFER_BINDINGS:()=>T.E6I,GL_MAX_VARYING_COMPONENTS:()=>T.Cj5,GL_MAX_VARYING_VECTORS:()=>T.jHY,GL_MAX_VERTEX_ATTRIBS:()=>T.hfp,GL_MAX_VERTEX_OUTPUT_COMPONENTS:()=>T.ksA,GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:()=>T.Rw3,GL_MAX_VERTEX_UNIFORM_BLOCKS:()=>T.SH3,GL_MAX_VERTEX_UNIFORM_COMPONENTS:()=>T.Ft1,GL_MAX_VERTEX_UNIFORM_VECTORS:()=>T.N8N,GL_MAX_VIEWPORT_DIMS:()=>T.oDL,GL_MEDIUM_FLOAT:()=>T.fL$,GL_MEDIUM_INT:()=>T.XEX,GL_MIN:()=>T.Awz,GL_MIN_EXT:()=>T.fxg,GL_MIN_PROGRAM_TEXEL_OFFSET:()=>T.pc5,GL_MIRRORED_REPEAT:()=>T.GjS,GL_NEAREST:()=>T.R1c,GL_NEAREST_MIPMAP_LINEAR:()=>T.vTv,GL_NEAREST_MIPMAP_NEAREST:()=>T.wWb,GL_NEVER:()=>T.shP,GL_NICEST:()=>T.wVD,GL_NONE:()=>T.Hh0,GL_NOTEQUAL:()=>T.UnN,GL_NO_ERROR:()=>T.Wen,GL_OBJECT_TYPE:()=>T.BHy,GL_ONE:()=>T.Qak,GL_ONE_MINUS_CONSTANT_ALPHA:()=>T.D__,GL_ONE_MINUS_CONSTANT_COLOR:()=>T.$rK,GL_ONE_MINUS_DST_ALPHA:()=>T.X5J,GL_ONE_MINUS_DST_COLOR:()=>T.hOW,GL_ONE_MINUS_SRC_ALPHA:()=>T.GR4,GL_ONE_MINUS_SRC_COLOR:()=>T.IDP,GL_OUT_OF_MEMORY:()=>T.gcz,GL_PACK_ALIGNMENT:()=>T.XPs,GL_PACK_ROW_LENGTH:()=>T.wMK,GL_PACK_SKIP_PIXELS:()=>T.voy,GL_PACK_SKIP_ROWS:()=>T.VNU,GL_PIXEL_PACK_BUFFER:()=>T.OAM,GL_PIXEL_PACK_BUFFER_BINDING:()=>T.vce,GL_PIXEL_UNPACK_BUFFER:()=>T.fsJ,GL_PIXEL_UNPACK_BUFFER_BINDING:()=>T.mED,GL_PIXEL_UNSIGNED_BYTE:()=>T.vnd,GL_PIXEL_UNSIGNED_SHORT_4_4_4_4:()=>T.yD3,GL_PIXEL_UNSIGNED_SHORT_5_5_5_1:()=>T.kyN,GL_PIXEL_UNSIGNED_SHORT_5_6_5:()=>T.nJx,GL_POINTS:()=>T.u$A,GL_POLYGON_OFFSET_FACTOR:()=>T.tzR,GL_POLYGON_OFFSET_FILL:()=>T.Lbl,GL_POLYGON_OFFSET_UNITS:()=>T.DEk,GL_QUERY_COUNTER_BITS_EXT:()=>T.HPM,GL_QUERY_RESULT:()=>T.dbf,GL_QUERY_RESULT_AVAILABLE:()=>T.vPW,GL_QUERY_RESULT_AVAILABLE_EXT:()=>T.KAt,GL_QUERY_RESULT_EXT:()=>T._UX,GL_R11F_G11F_B10F:()=>T.zsc,GL_R16F:()=>T.oY_,GL_R16I:()=>T.gj3,GL_R16UI:()=>T.oqe,GL_R32F:()=>T.uER,GL_R32I:()=>T._TF,GL_R32UI:()=>T.YlY,GL_R8:()=>T.cYm,GL_R8I:()=>T._EH,GL_R8UI:()=>T.S00,GL_R8_SNORM:()=>T.w9H,GL_RASTERIZER_DISCARD:()=>T.ZXo,GL_READ_BUFFER:()=>T._Ir,GL_READ_FRAMEBUFFER:()=>T.yun,GL_READ_FRAMEBUFFER_BINDING:()=>T.bXZ,GL_RED:()=>T.ZhV,GL_RED_BITS:()=>T.jZr,GL_RED_INTEGER:()=>T.iKz,GL_RENDERBUFFER:()=>T.vPm,GL_RENDERBUFFER_ALPHA_SIZE:()=>T.Ysb,GL_RENDERBUFFER_BINDING:()=>T.qk$,GL_RENDERBUFFER_BLUE_SIZE:()=>T.pBm,GL_RENDERBUFFER_DEPTH_SIZE:()=>T.lbA,GL_RENDERBUFFER_GREEN_SIZE:()=>T.OSM,GL_RENDERBUFFER_HEIGHT:()=>T.Bxb,GL_RENDERBUFFER_INTERNAL_FORMAT:()=>T.TpV,GL_RENDERBUFFER_RED_SIZE:()=>T.eco,GL_RENDERBUFFER_SAMPLES:()=>T.CW9,GL_RENDERBUFFER_STENCIL_SIZE:()=>T.Dm9,GL_RENDERBUFFER_WIDTH:()=>T._ZX,GL_RENDERER:()=>T.mfM,GL_REPEAT:()=>T.$7R,GL_REPLACE:()=>T.Snx,GL_RG:()=>T.SJU,GL_RG16F:()=>T.uLG,GL_RG16I:()=>T.XE4,GL_RG16UI:()=>T.r0$,GL_RG32F:()=>T.uM4,GL_RG32I:()=>T.dH_,GL_RG32UI:()=>T.xIw,GL_RG8:()=>T.OAe,GL_RG8I:()=>T.plb,GL_RG8UI:()=>T.lR$,GL_RG8_SNORM:()=>T.sOz,GL_RGB:()=>T.Zkt,GL_RGB10_A2:()=>T.Zvf,GL_RGB10_A2UI:()=>T.sC0,GL_RGB16F:()=>T.eok,GL_RGB16I:()=>T.j7s,GL_RGB16UI:()=>T.WHG,GL_RGB32F:()=>T.GV0,GL_RGB32F_EXT:()=>T.Aoj,GL_RGB32I:()=>T.P7o,GL_RGB32UI:()=>T.yx3,GL_RGB565:()=>T.Hft,GL_RGB5_A1:()=>T.PB9,GL_RGB8:()=>T.Evp,GL_RGB8I:()=>T.kWN,GL_RGB8UI:()=>T.ZB$,GL_RGB8_SNORM:()=>T.aig,GL_RGB9_E5:()=>T.SaD,GL_RGBA:()=>T.gAT,GL_RGBA16F:()=>T.kcF,GL_RGBA16I:()=>T.Spt,GL_RGBA16UI:()=>T.k26,GL_RGBA32F:()=>T.qNt,GL_RGBA32F_EXT:()=>T.ps6,GL_RGBA32I:()=>T.Zsj,GL_RGBA32UI:()=>T.mae,GL_RGBA4:()=>T.EYP,GL_RGBA8:()=>T.ebJ,GL_RGBA8I:()=>T.KkT,GL_RGBA8UI:()=>T.KdC,GL_RGBA8_SNORM:()=>T.wXe,GL_RGBA_INTEGER:()=>T.jH6,GL_RGB_INTEGER:()=>T.PUt,GL_RG_INTEGER:()=>T.qH5,GL_SAMPLER_2D:()=>T.tps,GL_SAMPLER_2D_ARRAY:()=>T.pXP,GL_SAMPLER_2D_ARRAY_SHADOW:()=>T.P8N,GL_SAMPLER_2D_SHADOW:()=>T.oEd,GL_SAMPLER_3D:()=>T.t_W,GL_SAMPLER_BINDING:()=>T.FSc,GL_SAMPLER_CUBE:()=>T.vUb,GL_SAMPLER_CUBE_SHADOW:()=>T.rWQ,GL_SAMPLES:()=>T.L_4,GL_SAMPLE_ALPHA_TO_COVERAGE:()=>T.oIP,GL_SAMPLE_BUFFERS:()=>T.Od7,GL_SAMPLE_COVERAGE:()=>T.Nu1,GL_SAMPLE_COVERAGE_INVERT:()=>T.JGk,GL_SAMPLE_COVERAGE_VALUE:()=>T.VJW,GL_SCISSOR_BOX:()=>T.LCZ,GL_SCISSOR_TEST:()=>T.iku,GL_SEPARATE_ATTRIBS:()=>T.ixi,GL_SHADER_TYPE:()=>T.wrZ,GL_SHADING_LANGUAGE_VERSION:()=>T.SFW,GL_SIGNALED:()=>T._M2,GL_SIGNED_NORMALIZED:()=>T.oiY,GL_SRC_ALPHA:()=>T.B3l,GL_SRC_ALPHA_SATURATE:()=>T.JRp,GL_SRC_COLOR:()=>T.o9e,GL_SRGB:()=>T.GTV,GL_SRGB8:()=>T.LQI,GL_SRGB8_ALPHA8:()=>T.TsT,GL_SRGB8_ALPHA8_EXT:()=>T.SNQ,GL_SRGB_ALPHA_EXT:()=>T.VFW,GL_SRGB_EXT:()=>T.Hjq,GL_STATIC_COPY:()=>T.yZh,GL_STATIC_DRAW:()=>T.o4I,GL_STATIC_READ:()=>T.Spp,GL_STENCIL:()=>T.EH4,GL_STENCIL_ATTACHMENT:()=>T.m88,GL_STENCIL_BACK_FAIL:()=>T._5_,GL_STENCIL_BACK_FUNC:()=>T.xR7,GL_STENCIL_BACK_PASS_DEPTH_FAIL:()=>T.WK5,GL_STENCIL_BACK_PASS_DEPTH_PASS:()=>T.PNz,GL_STENCIL_BACK_REF:()=>T.hoP,GL_STENCIL_BACK_VALUE_MASK:()=>T.n0B,GL_STENCIL_BACK_WRITEMASK:()=>T.Z$r,GL_STENCIL_BITS:()=>T.ad4,GL_STENCIL_BUFFER_BIT:()=>T.BbZ,GL_STENCIL_CLEAR_VALUE:()=>T.zSL,GL_STENCIL_FAIL:()=>T.wce,GL_STENCIL_FUNC:()=>T.Qbd,GL_STENCIL_INDEX:()=>T.OBi,GL_STENCIL_INDEX8:()=>T.VX_,GL_STENCIL_PASS_DEPTH_FAIL:()=>T.O5p,GL_STENCIL_PASS_DEPTH_PASS:()=>T.OiW,GL_STENCIL_REF:()=>T.nVM,GL_STENCIL_TEST:()=>T.lxv,GL_STENCIL_VALUE_MASK:()=>T.b6i,GL_STENCIL_WRITEMASK:()=>T.Q$q,GL_STREAM_COPY:()=>T.kMJ,GL_STREAM_DRAW:()=>T.RIC,GL_STREAM_READ:()=>T.BTT,GL_SUBPIXEL_BITS:()=>T.xp,GL_SYNC_CONDITION:()=>T.vHc,GL_SYNC_FENCE:()=>T.YoK,GL_SYNC_FLAGS:()=>T.lF1,GL_SYNC_FLUSH_COMMANDS_BIT:()=>T.tFw,GL_SYNC_GPU_COMMANDS_COMPLETE:()=>T.z8r,GL_SYNC_STATUS:()=>T.wm0,GL_TEXTURE:()=>T.p8j,GL_TEXTURE0:()=>T.Lmx,GL_TEXTURE1:()=>T.ZrN,GL_TEXTURE10:()=>T.M1Q,GL_TEXTURE11:()=>T.nPy,GL_TEXTURE12:()=>T.SX1,GL_TEXTURE13:()=>T.pYl,GL_TEXTURE14:()=>T.EPR,GL_TEXTURE15:()=>T.kpL,GL_TEXTURE16:()=>T.RjA,GL_TEXTURE17:()=>T.uJm,GL_TEXTURE18:()=>T.Wtd,GL_TEXTURE19:()=>T.emu,GL_TEXTURE2:()=>T.Ehj,GL_TEXTURE20:()=>T.iVc,GL_TEXTURE21:()=>T.Bvy,GL_TEXTURE22:()=>T.pJJ,GL_TEXTURE23:()=>T.WQq,GL_TEXTURE24:()=>T.AC$,GL_TEXTURE25:()=>T.jol,GL_TEXTURE26:()=>T.kOB,GL_TEXTURE27:()=>T.RO1,GL_TEXTURE28:()=>T.Uu$,GL_TEXTURE29:()=>T.Kwr,GL_TEXTURE3:()=>T._mt,GL_TEXTURE30:()=>T.SEn,GL_TEXTURE31:()=>T.Guy,GL_TEXTURE4:()=>T.OG0,GL_TEXTURE5:()=>T.PHR,GL_TEXTURE6:()=>T.vC$,GL_TEXTURE7:()=>T.uzX,GL_TEXTURE8:()=>T.Ac_,GL_TEXTURE9:()=>T.Rtt,GL_TEXTURE_2D:()=>T.CbE,GL_TEXTURE_2D_ARRAY:()=>T.k0l,GL_TEXTURE_3D:()=>T.FU3,GL_TEXTURE_BASE_LEVEL:()=>T.qz_,GL_TEXTURE_BINDING_2D:()=>T.Fp$,GL_TEXTURE_BINDING_2D_ARRAY:()=>T.alV,GL_TEXTURE_BINDING_3D:()=>T.M0H,GL_TEXTURE_BINDING_CUBE_MAP:()=>T.YZ8,GL_TEXTURE_COMPARE_FUNC:()=>T.n3r,GL_TEXTURE_COMPARE_MODE:()=>T.dUx,GL_TEXTURE_CUBE_MAP:()=>T.oHN,GL_TEXTURE_CUBE_MAP_NEGATIVE_X:()=>T.KZB,GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:()=>T.Q4l,GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:()=>T.QJs,GL_TEXTURE_CUBE_MAP_POSITIVE_X:()=>T.tkF,GL_TEXTURE_CUBE_MAP_POSITIVE_Y:()=>T.AE4,GL_TEXTURE_CUBE_MAP_POSITIVE_Z:()=>T.UP3,GL_TEXTURE_IMMUTABLE_FORMAT:()=>T.YCj,GL_TEXTURE_IMMUTABLE_LEVELS:()=>T.cds,GL_TEXTURE_MAG_FILTER:()=>T.c6V,GL_TEXTURE_MAX_ANISOTROPY_EXT:()=>T.bmu,GL_TEXTURE_MAX_LEVEL:()=>T.JqA,GL_TEXTURE_MAX_LOD:()=>T.Yz$,GL_TEXTURE_MIN_FILTER:()=>T.Bc6,GL_TEXTURE_MIN_LOD:()=>T.RDW,GL_TEXTURE_WRAP_R:()=>T.gbE,GL_TEXTURE_WRAP_S:()=>T.OoY,GL_TEXTURE_WRAP_T:()=>T.heo,GL_TIMEOUT_EXPIRED:()=>T.aK$,GL_TIMEOUT_IGNORED:()=>T.eke,GL_TIMESTAMP_EXT:()=>T.Qt8,GL_TIME_ELAPSED_EXT:()=>T.sr4,GL_TRANSFORM_FEEDBACK:()=>T.Sa0,GL_TRANSFORM_FEEDBACK_ACTIVE:()=>T.vWN,GL_TRANSFORM_FEEDBACK_BINDING:()=>T.C6I,GL_TRANSFORM_FEEDBACK_BUFFER:()=>T.AQZ,GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:()=>T.x6H,GL_TRANSFORM_FEEDBACK_BUFFER_MODE:()=>T.H2K,GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:()=>T.f5L,GL_TRANSFORM_FEEDBACK_BUFFER_START:()=>T.ILt,GL_TRANSFORM_FEEDBACK_PAUSED:()=>T.ccF,GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:()=>T.VYu,GL_TRANSFORM_FEEDBACK_VARYINGS:()=>T.y3j,GL_TRIANGLES:()=>T.FgH,GL_TRIANGLE_FAN:()=>T.vtI,GL_TRIANGLE_STRIP:()=>T.uCq,GL_UNIFORM_ARRAY_STRIDE:()=>T.qWZ,GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS:()=>T.t75,GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:()=>T.Kzi,GL_UNIFORM_BLOCK_BINDING:()=>T.tNI,GL_UNIFORM_BLOCK_DATA_SIZE:()=>T.zfW,GL_UNIFORM_BLOCK_INDEX:()=>T.mcF,GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:()=>T.Nyi,GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:()=>T.sxC,GL_UNIFORM_BUFFER:()=>T.q__,GL_UNIFORM_BUFFER_BINDING:()=>T.DBb,GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:()=>T.mMN,GL_UNIFORM_BUFFER_SIZE:()=>T.rve,GL_UNIFORM_BUFFER_START:()=>T.o7C,GL_UNIFORM_IS_ROW_MAJOR:()=>T.HM$,GL_UNIFORM_MATRIX_STRIDE:()=>T.mS1,GL_UNIFORM_OFFSET:()=>T.xUI,GL_UNIFORM_SIZE:()=>T.djG,GL_UNIFORM_TYPE:()=>T.Kn4,GL_UNMASKED_RENDERER_WEBGL:()=>T.jGD,GL_UNMASKED_VENDOR_WEBGL:()=>T.ycd,GL_UNPACK_ALIGNMENT:()=>T.GM3,GL_UNPACK_COLORSPACE_CONVERSION_WEBGL:()=>T.XxT,GL_UNPACK_FLIP_Y_WEBGL:()=>T.PYx,GL_UNPACK_IMAGE_HEIGHT:()=>T.EVZ,GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL:()=>T.WYY,GL_UNPACK_ROW_LENGTH:()=>T.m7j,GL_UNPACK_SKIP_IMAGES:()=>T.SK7,GL_UNPACK_SKIP_PIXELS:()=>T.YrP,GL_UNPACK_SKIP_ROWS:()=>T.bd_,GL_UNSIGNALED:()=>T.n9O,GL_UNSIGNED_INT_10F_11F_11F_REV:()=>T.nQ9,GL_UNSIGNED_INT_24_8:()=>T.bTv,GL_UNSIGNED_INT_24_8_WEBGL:()=>T.iyB,GL_UNSIGNED_INT_2_10_10_10_REV:()=>T.LX0,GL_UNSIGNED_INT_5_9_9_9_REV:()=>T.vEp,GL_UNSIGNED_INT_SAMPLER_2D:()=>T.Zx4,GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:()=>T.yd2,GL_UNSIGNED_INT_SAMPLER_3D:()=>T.ZtN,GL_UNSIGNED_INT_SAMPLER_CUBE:()=>T.lg3,GL_UNSIGNED_INT_VEC2:()=>T.DAo,GL_UNSIGNED_INT_VEC3:()=>T.TAU,GL_UNSIGNED_INT_VEC4:()=>T.Ki3,GL_UNSIGNED_NORMALIZED:()=>T.Dr$,GL_UNSIGNED_NORMALIZED_EXT:()=>T.$z8,GL_VALIDATE_STATUS:()=>T.eQR,GL_VENDOR:()=>T.zSP,GL_VERSION:()=>T.$bm,GL_VERTEX_ARRAY_BINDING:()=>T.RGR,GL_VERTEX_ARRAY_BINDING_OES:()=>T.fsT,GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:()=>T.HRE,GL_VERTEX_ATTRIB_ARRAY_DIVISOR:()=>T.LUh,GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:()=>T.C9t,GL_VERTEX_ATTRIB_ARRAY_ENABLED:()=>T.I4M,GL_VERTEX_ATTRIB_ARRAY_INTEGER:()=>T.XZ2,GL_VERTEX_ATTRIB_ARRAY_NORMALIZED:()=>T.s7G,GL_VERTEX_ATTRIB_ARRAY_POINTER:()=>T.bsK,GL_VERTEX_ATTRIB_ARRAY_SIZE:()=>T.vEN,GL_VERTEX_ATTRIB_ARRAY_STRIDE:()=>T.cqm,GL_VERTEX_ATTRIB_ARRAY_TYPE:()=>T.eFf,GL_VERTEX_SHADER:()=>T.lQo,GL_VIEWPORT:()=>T.Ith,GL_WAIT_FAILED:()=>T.GIj,GL_ZERO:()=>T._sJ,GetComponentFromEntities:()=>e.swI,Gizmo:()=>e.tb4,GlobalDataRepository:()=>e.$jt,GlobalRetarget:()=>e.B5B,GlobalRetargetReverse:()=>e.GZk,Gltf2Exporter:()=>e.ObQ,Gltf2Importer:()=>e.Zb6,GltfImporter:()=>e.j6Y,GreaterShaderNode:()=>e.imh,Grid:()=>e.rjZ,HdriFormat:()=>e.czt,INPUT_HANDLING_STATE_CAMERA_CONTROLLER:()=>e.jOP,INPUT_HANDLING_STATE_GIZMO_SCALE:()=>e.K2G,INPUT_HANDLING_STATE_GIZMO_TRANSLATION:()=>e.KQz,INPUT_HANDLING_STATE_NONE:()=>e.Tr1,IShape:()=>e.ALp,IdentityMatrix33:()=>e.cmF,IdentityMatrix44:()=>e.aqQ,IfStatementShader:()=>f.p,IfStatementShaderNode:()=>e.uP$,ImageUtil:()=>e.LkB,InputManager:()=>e.$tz,Is:()=>e.Is,IsObj:()=>e.V5,Joint:()=>e.d90,KTX2TextureLoader:()=>y.N,LightComponent:()=>e.r0A,LightGizmo:()=>e.SUW,LightType:()=>e.vBC,Line:()=>e.x12,LocatorGizmo:()=>e.klP,LogQuaternion:()=>e.lW,MToonMaterialContent:()=>e.fQ$,MatCapMaterialContent:()=>e.Svh,Material:()=>e.F5T,MaterialHelper:()=>e.G$p,MaterialRepository:()=>e.rFg,MathClassUtil:()=>e.Db6,MathUtil:()=>e.kj,Matrix22:()=>e.ak,Matrix33:()=>e.haE,Matrix44:()=>e.Jeh,MemoryManager:()=>e.B_3,Mesh:()=>e.Kj0,MeshComponent:()=>e.$tA,MeshHelper:()=>e.tVI,MeshRendererComponent:()=>e.YZ_,MiscUtil:()=>e.KfE,ModelConverter:()=>e.eDb,ModuleManager:()=>e.xJl,MultiplyShaderNode:()=>e.P4J,MutableColorRgb:()=>e.CEM,MutableColorRgba:()=>e.l$X,MutableMatrix22:()=>e.f7L,MutableMatrix33:()=>e.xkj,MutableMatrix44:()=>e.ecr,MutableQuaternion:()=>e.yGy,MutableScalar:()=>e.DUM,MutableScalar_:()=>e.EtM,MutableScalard:()=>e.$_9,MutableVector2:()=>e.NRp,MutableVector2_:()=>e.elw,MutableVector2d:()=>e.th1,MutableVector3:()=>e.d6n,MutableVector3_:()=>e.I18,MutableVector3d:()=>e.oVE,MutableVector4:()=>e.xQg,MutableVector4_:()=>e.e2p,MutableVector4d:()=>e.hnX,None:()=>e.Hq9,NormalMatrixShaderNode:()=>e.fbG,NormalizeShaderNode:()=>e.dHi,Ok:()=>e.Ok,Option:()=>e.Wxm,OrbitCameraController:()=>e.jfW,OutColorShaderNode:()=>e.y8Z,OutPositionShaderNode:()=>e.Nus,PhysicsComponent:()=>e.ZeV,PixelFormat:()=>e.VIj,Plane:()=>e.JOQ,Primitive:()=>e.WV0,PrimitiveMode:()=>e.TcR,PrimitiveSortKey_BitLength_Depth:()=>e.Qob,PrimitiveSortKey_BitLength_Material:()=>e.xzx,PrimitiveSortKey_BitLength_PrimitiveType:()=>e.aKP,PrimitiveSortKey_BitLength_TranslucencyType:()=>e.IMH,PrimitiveSortKey_BitOffset_Material:()=>e.V_R,PrimitiveSortKey_BitOffset_PrimitiveType:()=>e.Y1P,PrimitiveSortKey_BitOffset_TranslucencyType:()=>e.Yxr,PrimitiveSortKey_BitOffset_ViewportLayer:()=>e.BHz,ProcessApproach:()=>e.V7o,ProcessApproachClass:()=>e.yvy,ProcessStage:()=>e.Iqz,ProjectionMatrixShaderNode:()=>e.DEK,Quaternion:()=>e._fP,RenderBuffer:()=>e.NiD,RenderBufferTarget:()=>e.G22,RenderPass:()=>e.CDd,RenderPassHelper:()=>e.$Og,RenderTargetTexture:()=>e._iX,RenderableHelper:()=>e.L0o,RhodoniteImportExtension:()=>e.zYy,RnException:()=>e.MrI,RnObject:()=>e.S7_,RnPromise:()=>e.niV,Sampler:()=>e.Z46,Scalar:()=>e.Rus,ScalarToVector4ShaderNode:()=>e.udm,Scalar_:()=>e.apw,Scalard:()=>e.kOh,ScaleGizmo:()=>e.que,SceneGraphComponent:()=>e.aj7,ShaderGraphResolver:()=>e.dBk,ShaderNode:()=>e.Zp7,ShaderSemantics:()=>e.f5e,ShaderSemanticsClass:()=>e.wyA,ShaderType:()=>e.HoG,ShaderVariableType:()=>e.LvG,ShaderVariableUpdateInterval:()=>e.axw,ShaderityMaterialContent:()=>e.unQ,ShaderityUtility:()=>e.QIo,ShadingModel:()=>e.DAE,ShadowMap:()=>e.l6Z,ShadowMapDecodeClassicMaterialContent:()=>e.RKA,SimpleVertexAttribute:()=>e.OCV,SkeletalComponent:()=>e.YbW,Some:()=>e.bDM,Sphere:()=>e.aLr,SphereCollider:()=>e.BMK,SymbolWeakMap:()=>e.bsk,SynthesizeHdrMaterialContent:()=>e.dob,System:()=>e.xP7,SystemState:()=>e.lBd,TagGltf2NodeIndex:()=>T.j3U,Texture:()=>e.xEZ,TextureDataFloat:()=>e.h36,TextureFetchMaterialNode:()=>e.IW4,TextureFetchShader:()=>p.S,TextureParameter:()=>e.dIQ,Time:()=>e.qpU,Transform3D:()=>e.WQ0,TransformComponent:()=>e.Uvn,TranslationGizmo:()=>e.ug2,UniformDataShader:()=>v.$,UniformDataShaderNode:()=>e.X1h,VERSION:()=>D,VRMColliderGroup:()=>e.Dit,VRMSpring:()=>e.U4t,VRMSpringBonePhysicsStrategy:()=>e.tM2,VarianceShadowMapDecodeClassicMaterialContent:()=>e.Q_Q,VaryingInVariableShaderNode:()=>e.hLT,VaryingOutVariableShaderNode:()=>e.H9W,VaryingVariableShader:()=>A.e,Vector2:()=>e.FM8,Vector2_:()=>e.pV,Vector2d:()=>e.EYs,Vector3:()=>e.Pa4,Vector3AndScalarToVector4ShaderNode:()=>e.TaZ,Vector3_:()=>e.pg_,Vector3d:()=>e.UJ,Vector4:()=>e.Ltg,Vector4_:()=>e.rEL,Vector4d:()=>e.Tjf,VectorN:()=>e.j8u,VertexAttribute:()=>e.TaT,VertexAttributeClass:()=>e.x$u,VideoTexture:()=>e.fO1,ViewMatrixShaderNode:()=>e.UaW,Visibility:()=>e.EEb,Vrm0xImporter:()=>e.ao$,VrmComponent:()=>e.ZAV,VrmImporter:()=>e.pbL,VrmaImporter:()=>e.vTZ,WalkThroughCameraController:()=>e.IsZ,WeakNone:()=>e.Lq7,WeakOption:()=>e.lIh,WeakSome:()=>e.Bxs,WebGLContextWrapper:()=>t.d,WebGLExtension:()=>n.c,WebGLResourceRepository:()=>i.x,WebGLStrategyDataTexture:()=>a.X,WebGLStrategyUniform:()=>r.I,WebGpuDeviceWrapper:()=>g,WebGpuResourceRepository:()=>E,WebXRSystem:()=>w.X,WellKnownComponentTIDs:()=>e.zzN,WireframeMaterialNode:()=>e.sqk,WorldMatrixShaderNode:()=>e.KRN,_from:()=>e.lim,_fromString:()=>e.cuJ,_fromStringCaseSensitively:()=>e.bmc,_getPropertyIndex:()=>e.VlM,_getPropertyIndex2:()=>e.ULo,add2:()=>e.Zzs,add2_offset:()=>e.TLr,add3:()=>e.sZE,add3_offset:()=>e.jIe,add4:()=>e.F5f,add4_offset:()=>e.vPp,addLineNumberToCode:()=>e._zI,applyMixins:()=>e.efS,array3_lerp_offsetAsComposition:()=>e.to5,arrayN_lerp_offsetAsComposition:()=>e.wrt,assertDoesNotHave:()=>e.Waq,assertExist:()=>e.dKe,assertHas:()=>e.ZzZ,assertIsErr:()=>e.Z65,assertIsOk:()=>e.UDi,calcAlignedByteLength:()=>e.Kyk,combineImages:()=>e.U28,convertHTMLImageElementToCanvas:()=>e.ABp,createAndAddGltf2BufferView:()=>e.CTh,createEffekseer:()=>e.OHV,createMotionController:()=>C.RQ,deepCopyUsingJsonStringify:()=>e.j37,defaultAnimationTrackName:()=>e.vAU,defaultValue:()=>e.LSm,detectFormatByArrayBuffers:()=>e.Dhi,detectFormatByUri:()=>e.jeP,downloadArrayBuffer:()=>e.CWu,downloadTypedArray:()=>e.$z2,dummyAnisotropyTexture:()=>e.Lx$,dummyBlackCubeTexture:()=>e.pnp,dummyBlackTexture:()=>e.mge,dummyBlueTexture:()=>e.$RV,dummySRGBGrayTexture:()=>e.GVY,dummyWhiteTexture:()=>e.Dx8,enhanceArray:()=>e.OTk,fromTensorToCompositionType:()=>T.bup,get1:()=>e.nnL,get1_offset:()=>e.w08,get1_offsetAsComposition:()=>e.GWg,get2:()=>e.t5w,get2_offset:()=>e.vk8,get2_offsetAsComposition:()=>e.PFe,get3:()=>e.Ffi,get3_offset:()=>e.Upt,get3_offsetAsComposition:()=>e.Dq2,get4:()=>e.VIV,get4_offset:()=>e.hxV,get4_offsetAsComposition:()=>e.JIQ,getEvent:()=>e.EYp,getMotionController:()=>C.sz,getN_offset:()=>e.fKE,getN_offsetAsComposition:()=>e.lxk,getWebXRSystem:()=>P,greaterThan:()=>e.tSN,ifDefinedThen:()=>e.JxS,ifDefinedThenWithReturn:()=>e.t0P,ifExistsThen:()=>e.fK9,ifExistsThenWithReturn:()=>e.OBD,ifNotExistsThen:()=>e.bhs,ifNotExistsThenWithReturn:()=>e.ZsA,ifUndefinedThen:()=>e.fYc,ifUndefinedThenWithReturn:()=>e.eD0,initDefaultTextures:()=>e.Cb2,isSameGlTF2TextureSampler:()=>T.CLY,isSkipDrawing:()=>e.lsI,lessThan:()=>e.QjB,mulArray3WithScalar_offset:()=>e.nsy,mulArray4WithScalar_offset:()=>e.p8g,mulArrayNWithScalar_offset:()=>e.n5i,mulThatAndThisToOutAsMat44_offsetAsComposition:()=>e.QUJ,normalizeArray4:()=>e.XgD,nullishToEmptyArray:()=>e.vVE,nullishToEmptyMap:()=>e.YUA,objectCachify:()=>e.ozT,primitiveCachify1:()=>e.EY5,qlerp_offsetAsComposition:()=>e.Rlh,scalar_lerp_offsetAsComposition:()=>e._7O,setupShaderProgramForMeshComponent:()=>o.M,sheenLutTexture:()=>e.NBV,updateGamePad:()=>C.KA,updateMotionControllerModel:()=>C._0,valueWithCompensation:()=>e.wv6,valueWithDefault:()=>e.kSU});var e=__webpack_require__(7864),t=__webpack_require__(5551),n=__webpack_require__(3346),i=__webpack_require__(3952),o=__webpack_require__(6406),a=__webpack_require__(9430),r=__webpack_require__(6042),s=(__webpack_require__(3007),__webpack_require__(836)),l=__webpack_require__(2647),c=__webpack_require__(5211),_=__webpack_require__(3258),h=__webpack_require__(3591);class u extends s.m{constructor(){super(),this.vertexShaderBody="\n\n\n "}static getInstance(){return this.__instance||(this.__instance=new u),this.__instance}get vertexShaderDefinitions(){return"\n\n"}get pixelShaderDefinitions(){return`\nuniform int u_shadingModel;\nuniform float u_shininess;\n\nstruct Light {\n vec4 lightPosition;\n vec4 lightDirection;\n vec4 lightIntensity;\n};\nuniform Light u_lights[${_.D.maxLightNumberInShader}];\nuniform int u_lightNumber;\nuniform vec3 u_viewPosition;\n\n\nbool classicShading(\n in vec3 diffuseColor,\n in vec3 position_inWorld,\n in vec3 normal_inWorld,\n out vec3 outColor\n )\n{\n // Lighting\n outColor = vec3(0.0, 0.0, 0.0);\n if (u_shadingModel > 0) {\n\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n for (int i = 0; i < ${_.D.maxLightNumberInShader}; i++) {\n if (i >= u_lightNumber) {\n break;\n }\n\n vec3 lightDirection = u_lights[i].lightDirection.xyz;\n float lightType = u_lights[i].lightPosition.w;\n float spotCosCutoff = u_lights[i].lightDirection.w;\n float spotExponent = u_lights[i].lightIntensity.w;\n\n if (0.75 < lightType) { // is pointlight or spotlight\n lightDirection = normalize(u_lights[i].lightPosition.xyz - position_inWorld.xyz);\n }\n float spotEffect = 1.0;\n if (lightType > 1.75) { // is spotlight\n spotEffect = dot(u_lights[i].lightDirection.xyz, lightDirection);\n if (spotEffect > spotCosCutoff) {\n spotEffect = pow(spotEffect, spotExponent);\n } else {\n spotEffect = 0.0;\n }\n }\n\n vec3 incidentLight = spotEffect * u_lights[i].lightIntensity.xyz;\n// incidentLight *= M_PI;\n\n normal_inWorld = normalize(normal_inWorld);\n\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, lightDirection)) * incidentLight;\n\n if (u_shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(u_viewPosition - position_inWorld.xyz);\n vec3 halfVector = normalize(lightDirection + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), u_shininess);\n } else if (u_shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(u_viewPosition - position_inWorld.xyz);\n vec3 R = reflect(lightDirection, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), u_shininess);\n }\n\n }\n\n outColor = diffuse + specular;\n } else {\n outColor = diffuseColor;\n }\n}\n\n `}get pixelShaderBody(){return""}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}u.materialElement=h.Z.PBRShading;var d=__webpack_require__(9214),m=__webpack_require__(4212),f=__webpack_require__(4109),p=__webpack_require__(6796),v=__webpack_require__(204),A=__webpack_require__(9071),y=__webpack_require__(3667);class g{constructor(e,t,n){this.__canvas=e,this.__gpuAdapter=t,this.__gpuDevice=n}get canvas(){return this.__canvas}get gpuAdapter(){return this.__gpuAdapter}get gpuDevice(){return this.__gpuDevice}}var x=__webpack_require__(128),I=__webpack_require__(4690),b=__webpack_require__(7987);class E extends b.F{constructor(e){super(),this.__webGpuResources=new Map,this.__resourceCounter=b.F.InvalidCGAPIResourceUid,this.__webGpuDeviceWrapper=e}getResourceNumber(){return++this.__resourceCounter}__registerResource(e){const t=this.getResourceNumber();return e._resourceUid=t,this.__webGpuResources.set(t,e),t}createTextureFromImageBitmapData(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:l}){const c=this.__webGpuDeviceWrapper.gpuDevice,_=c.createTexture({size:[i,o,1],format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT});return c.queue.copyExternalImageToTexture({source:e},{texture:_},[i,o]),this.__registerResource(_)}createVertexBuffer(e){const t=this.__webGpuDeviceWrapper.gpuDevice.createBuffer({size:e.byteLength,usage:GPUBufferUsage.VERTEX,mappedAtCreation:!0});return new Uint8Array(t.getMappedRange()).set(e.bufferView.getUint8Array()),t.unmap(),this.__registerResource(t)}createVertexBufferFromTypedArray(e){const t=this.__webGpuDeviceWrapper.gpuDevice.createBuffer({size:e.byteLength,usage:GPUBufferUsage.VERTEX,mappedAtCreation:!0});return new Uint8Array(t.getMappedRange()).set(new Uint8Array(e.buffer)),t.unmap(),this.__registerResource(t)}createIndexBuffer(e){const t=this.__webGpuDeviceWrapper.gpuDevice.createBuffer({size:e.byteLength,usage:GPUBufferUsage.INDEX,mappedAtCreation:!0});return new Uint8Array(t.getMappedRange()).set(e.bufferView.getUint8Array()),t.unmap(),this.__registerResource(t)}updateVertexBuffer(e,t){const n=this.__webGpuResources.get(t);if(I.Is.not.exist(n))throw new Error("Not found VBO.");n.mapAsync(GPUMapMode.WRITE).then((()=>{new Uint8Array(n.getMappedRange()).set(e.bufferView.getUint8Array()),n.unmap()}))}updateIndexBuffer(e,t){const n=this.__webGpuResources.get(t);if(I.Is.not.exist(n))throw new Error("Not found IBO.");n.mapAsync(GPUMapMode.WRITE).then((()=>{new Uint8Array(n.getMappedRange()).set(e.bufferView.getUint8Array()),n.unmap()}))}deleteVertexBuffer(e){const t=this.__webGpuResources.get(e);if(I.Is.not.exist(t))throw new Error("Not found VBO.");t.destroy(),this.__webGpuResources.delete(e)}createVertexBufferAndIndexBuffer(e){let t;e.hasIndices()&&(t=this.createIndexBuffer(e.indicesAccessor));const n=[];for(let e=0;e{const a=this.createVertexBuffer(t),r=x.T.toAttributeSlotFromJoinedString(e.attributeSemantics[o]);n[r]=!0,i.push(a)})),{vaoHandle:-1,iboHandle:t,vboHandles:i,attributesFlags:n,setComplete:!1}}updateVertexBufferAndIndexBuffer(e,t){t.iboHandle&&this.updateIndexBuffer(e.indicesAccessor,t.iboHandle);const n=e.attributeAccessors;for(let e=0;e{var __webpack_modules__={4878:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord_0;\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec3 v_position_inWorld;\n\nuniform int u_envHdriFormat; // initialValue=0\nuniform float u_envRotation; // initialValue=0\nuniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)\nuniform samplerCube u_colorEnvTexture; // initialValue=(0,black)\nuniform bool u_makeOutputSrgb; // initialValue=true\nuniform bool u_inverseEnvironment; // initialValue=true\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\nvoid main() {\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // diffuseColor\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture\n\n // adapt OpenGL (RenderMan) CubeMap convention\n float envRotation = get_envRotation(materialSID, 0);\n float rot = envRotation + 3.1415;\n mat3 rotEnvMatrix = mat3(cos(rot), 0.0, -sin(rot), 0.0, 1.0, 0.0, sin(rot), 0.0, cos(rot));\n vec3 envNormal = normalize(rotEnvMatrix * v_position_inWorld);\n\n if (get_inverseEnvironment(materialSID, 0)) {\n envNormal.x *= -1.0;\n }\n\n vec4 diffuseTexel = texture(u_colorEnvTexture, envNormal);\n vec3 textureColor;\n int EnvHdriFormat = get_envHdriFormat(materialSID, 0);\n if (EnvHdriFormat == 0) { // LDR_SRGB\n textureColor = srgbToLinear(diffuseTexel.rgb);\n } else if (EnvHdriFormat == 3) { // RGBE\n textureColor = diffuseTexel.rgb * pow(2.0, diffuseTexel.a*255.0-128.0);\n } else {\n textureColor = diffuseTexel.rgb;\n }\n diffuseColor *= textureColor;\n\n rt0 = vec4(diffuseColor, alpha);\n\nfloat makeOutputSrgb = float(get_makeOutputSrgb(materialSID, 0));\nrt0.rgb = mix(rt0.rgb, linearToSrgb(rt0.rgb), makeOutputSrgb);\n\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0}},5757:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\n\nout vec2 v_texcoord_0;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec3 v_position_inWorld;\n\nuniform bool u_enableViewMatrix; // initialValue=true\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n\n if (get_enableViewMatrix(materialSID, 0)) {\n mat4 rotateMatrix = viewMatrix;\n rotateMatrix[3][0] = 0.0;\n rotateMatrix[3][1] = 0.0;\n rotateMatrix[3][2] = 0.0;\n gl_Position = projectionMatrix * rotateMatrix * worldMatrix * vec4(a_position, 1.0);\n } else {\n gl_Position = projectionMatrix * worldMatrix * vec4(a_position, 1.0);\n }\n\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n v_normal_inWorld = normalMatrix * a_normal;\n\n v_color = a_color;\n v_position_inWorld = (worldMatrix * vec4(a_position, 1.0)).xyz;\n v_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1}},3034:e=>{e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="./../../dist/",n(n.s="./src/index.ts")}({"./src/index.ts":function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("./src/main/Shaderity.ts"));t.default=o.default},"./src/main/PreProcessor.ts":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static process(e){const t=/#define[\t ]+(\w+)/,n=/#ifdef[\t ]+(\w+)/,i=/#elif[\t ]+defined\((\w+)\)/,o=/#else/,a=/#endif/,r=[];let s=!0;const l=[],c=[],_=[];for(const h of e){let e=!1;{const n=h.match(t);null!=n&&(l.push(n[1]),e=!0)}if(-1===r.indexOf(!1)){const t=h.match(n);if(null!=t){r.push(s);const n=t[1];c.push([n]),-1===l.indexOf(n)&&(s=!1),e=!0}}if(-1===r.indexOf(!1)){const t=h.match(i);if(null!=t){const n=t[1],i=c[c.length-1];let o=!0;for(const e of i)-1!==l.indexOf(e)&&(o=!1);s=!(!o||-1===l.indexOf(n)),i.push(n),e=!0}}if(-1===r.indexOf(!1)&&null!=h.match(o)){const t=c[c.length-1];let n=!0;for(const e of t)-1!==l.indexOf(e)&&(n=!1);s=n,e=!0}null!=h.match(a)&&(-1===r.indexOf(!1)&&(s=!0),e=!0,c.pop(),r.pop()),s&&!e&&_.push(h)}return _}}},"./src/main/Reflection.ts":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class i{constructor(e,t){this.__attributeSemanticsMap=new Map,this.__uniformSemanticsMap=new Map,this.__attributes=[],this.__varyings=[],this.__uniforms=[],this.__splittedShaderCode=e,this.__shaderStage=t,this.__setDefaultAttributeAndUniformSemanticsMap()}get attributes(){return this.__attributes}get varyings(){return this.__varyings}get uniforms(){return this.__uniforms}get attributesNames(){return this.__attributes.map((e=>e.name))}get attributesSemantics(){return this.__attributes.map((e=>e.semantic))}get attributesTypes(){return this.__attributes.map((e=>e.type))}addAttributeSemanticsMap(e){this.__attributeSemanticsMap=new Map([...this.__attributeSemanticsMap,...e])}addUniformSemanticsMap(e){this.__uniformSemanticsMap=new Map([...this.__uniformSemanticsMap,...e])}addAttributeSemantics(e,t){this.__attributeSemanticsMap.set(e,t)}addUniformSemantics(e,t){this.__uniformSemanticsMap.set(e,t)}resetAttributeSemantics(){this.__attributeSemanticsMap=new Map}resetUniformSemantics(){this.__uniformSemanticsMap=new Map}reflect(){const e=this.__splittedShaderCode,t=this.__shaderStage;for(const n of e)this.__matchAttribute(n,t)?this.__addAttribute(n):this.__matchVarying(n,t)?this.__addVarying(n,t):n.match(/^(?![\/])[\t ]*uniform[\t ]+/)&&this.__addUniform(n)}__setDefaultAttributeAndUniformSemanticsMap(){this.__attributeSemanticsMap.set("position","POSITION"),this.__attributeSemanticsMap.set("color$","COLOR_0"),this.__attributeSemanticsMap.set("color_?0","COLOR_0"),this.__attributeSemanticsMap.set("texcoord$","TEXCOORD_0"),this.__attributeSemanticsMap.set("texcoord_?0","TEXCOORD_0"),this.__attributeSemanticsMap.set("texcoord_?1","TEXCOORD_1"),this.__attributeSemanticsMap.set("texcoord_?2","TEXCOORD_2"),this.__attributeSemanticsMap.set("normal","NORMAL"),this.__attributeSemanticsMap.set("tangent","TANGENT"),this.__attributeSemanticsMap.set("joint$","JOINTS_0"),this.__attributeSemanticsMap.set("bone$","JOINTS_0"),this.__attributeSemanticsMap.set("joint_?0","JOINTS_0"),this.__attributeSemanticsMap.set("bone_?0","JOINTS_0"),this.__attributeSemanticsMap.set("weight$","WEIGHTS_0"),this.__attributeSemanticsMap.set("weight_?0","WEIGHTS_0"),this.__uniformSemanticsMap.set("worldmatrix","WorldMatrix"),this.__uniformSemanticsMap.set("normalmatrix","NormalMatrix"),this.__uniformSemanticsMap.set("viewmatrix","ViewMatrix"),this.__uniformSemanticsMap.set("projectionmatrix","ProjectionMatrix"),this.__uniformSemanticsMap.set("modelviewmatrix","ModelViewMatrix")}__matchAttribute(e,t){return"vertex"===t&&e.match(/^(?![\/])[\t ]*(attribute|in)[\t ]+.+;/)}__addAttribute(e){const t={name:"",type:"float",semantic:"UNKNOWN"},n=e.match(i.attributeAndVaryingTypeRegExp);if(n){const o=n[1];t.type=o;const a=n[2];t.name=a;const r=e.match(i.semanticRegExp);if(r)t.semantic=r[1];else for(let[e,n]of this.__attributeSemanticsMap)a.match(new RegExp(e,"i"))&&(t.semantic=n)}this.__attributes.push(t)}__matchVarying(e,t){return"vertex"===t?e.match(/^(?![\/])[\t ]*(varying|out)[\t ]+.+;/):e.match(/^(?![\/])[\t ]*(varying|in)[\t ]+.+;/)}__addVarying(e,t){const n={name:"",type:"float",inout:"in"},o=e.match(i.attributeAndVaryingTypeRegExp);if(o){const e=o[1];n.type=e;const i=o[2];n.name=i,n.inout="vertex"===t?"out":"in"}this.__varyings.push(n)}__addUniform(e){const t={name:"",type:"float",semantic:"UNKNOWN"},n=e.match(i.uniformTypeRegExp);if(n){const o=n[1];t.type=o;const a=n[2];t.name=a;const r=e.match(i.semanticRegExp);if(r)t.semantic=r[1];else for(let[e,n]of this.__uniformSemanticsMap)a.match(new RegExp(e,"i"))&&(t.semantic=n)}this.__uniforms.push(t)}}t.default=i,i.attributeAndVaryingTypeRegExp=/[\t ]+(float|int|vec2|vec3|vec4|mat2|mat3|mat4|ivec2|ivec3|ivec4)[\t ]+(\w+);/,i.uniformTypeRegExp=/[\t ]+(float|int|vec2|vec3|vec4|mat2|mat3|mat4|ivec2|ivec3|ivec4|sampler2D|samplerCube|sampler3D)[\t ]+(\w+);/,i.semanticRegExp=/<.*semantic[\t ]*=[\t ]*(\w+).*>/},"./src/main/ShaderEditor.ts":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static _insertDefinition(e,t){const n=t.replace(/#define[\t ]+/,"");e.unshift(`#define ${n}`)}static _fillTemplate(e,t){const n=e.replace(/\/\*[\t ]*shaderity:[\t ]*(@{[\t ]*)(\S+)([\t ]*})[\t ]*\*\//g,"${this.$2}");return new Function("return `"+n+"`;").call(t)}}},"./src/main/ShaderTransformer.ts":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{static _transformToGLSLES1(e,t,n){return this.__convertOrInsertVersionGLSLES1(e),this.__removeES3Qualifier(e,n),this.__convertIn(e,t),this.__convertOut(e,t,n),this.__removePrecisionForES3(e),this.__convertTextureFunctionToES1(e,t,n),e}static _transformToGLSLES3(e,t){return this.__convertOrInsertVersionGLSLES3(e),this.__convertAttribute(e,t),this.__convertVarying(e,t),this.__convertTextureCube(e),this.__convertTexture2D(e),this.__convertTexture2DProd(e),this.__convertTexture3D(e),this.__convertTexture3DProd(e),e}static _transformTo(e,t,n,i){return e.match(/webgl2|es3/i)?this._transformToGLSLES3(t,n):e.match(/webgl1|es1/i)?this._transformToGLSLES1(t,n,i):(console.error("Invalid Version"),t)}static __convertOrInsertVersionGLSLES1(e){this.__removeFirstMatchingLine(e,/^(?![\/])[\t ]*#[\t ]*version[\t ]+.*/),e.unshift("#version 100")}static __convertOrInsertVersionGLSLES3(e){this.__removeFirstMatchingLine(e,/^(?![\/])[\t ]*#[\t ]*version[\t ]+.*/),e.unshift("#define GLSL_ES3"),e.unshift("#version 300 es")}static __convertIn(e,t){let n;n=t?function(e,t){return"varying "+t}:function(e,t){return"attribute "+t},this.__replaceLine(e,/^(?![\/])[\t ]*in[\t ]+((highp|mediump|lowp|)[\t ]*\w+[\t ]*\w+[\t ]*;)/,n)}static __convertOut(e,t,n){if(t){const t=this.__removeOutQualifier(e,n);if(null==t)return;this.__addGLFragColor(t,e,n)}else{const t=/^(?![\/])[\t ]*out[\t ]+((highp|mediump|lowp|)[\t ]*\w+[\t ]*\w+[\t ]*;)/,n=function(e,t){return"varying "+t};this.__replaceLine(e,t,n)}}static __removeOutQualifier(e,t){const n=/^(?![\/])[\t ]*out[\t ]+((highp|mediump|lowp|)[\t ]*\w+[\t ]*(\w+)[\t ]*;)/;let i;for(let t=0;t=0;e--){const n=t[e];if(!s&&n.match(i)&&(t[e]=n.replace(i,`$1\n${r}\n}\n`),s=!0),n.match(o)&&t.splice(e,0,r),n.match(a))break}if(!s){const e="__removeOutQualifier: Not found the closing brackets for the main function";this.__outError(t,t.length,e,n)}}static __removeES3Qualifier(e,t){this.__removeVaryingQualifier(e,t),this.__removeLayout(e)}static __removeVaryingQualifier(e,t){const n=/^(?![\/])[\t ]*(flat|smooth)[\t ]*((in|out)[\t ]+.*)/;for(let i=0;i"flat"===o?(this.__outError(e,i+1,"__removeVaryingQualifier: glsl es1 does not support flat qualifier",t),n):a))}static __removeLayout(e){this.__replaceLine(e,/^(?![\/])[\t ]*layout[\t ]*\([\t ]*location[\t ]*\=[\t ]*\d[\t ]*\)[\t ]+/g,"")}static __removePrecisionForES3(e){const t=/^(?![\/])[\t ]*precision[\t ]+(highp|mediump|lowp)[\t ]+(\w+)[\t ]*;/;for(let n=0;n=0;r--){if(!e[r].match(/\{/))continue;const t=null===(i=this.__getBracketSection(e,r).match(/.*\((.*)\)/))||void 0===i?void 0:i[1];if(null==t)return;const s=t.split(","),l=/[\n\t ]*(highp|mediump|lowp|)[\n\t ]*(sampler\w+)[\n\t ]*(\w+)[\n\t ]*/;if(null!==(o=s[0].match(l))&&void 0!==o?o:s[0].match(/^[\n\t ]*$/)){for(const t of s){const i=t.match(l);if(null==i)continue;const o=i[2],s=i[3];if(a.get(s)){const t="__createArgumentSamplerMap: duplicate variable name";this.__outError(e,r,t,n)}a.set(s,o)}break}}return a}static __getBracketSection(e,t){let n=0;for(let i=t;i>=0;i--)if(e[i].match(/\(/)){n=i;break}let i="";for(let o=n;o<=t;o++)i+=e[o];return i}static __convertAttribute(e,t){t||this.__replaceLine(e,/^(?![\/])[\t ]*attribute[\t ]+/g,"in ")}static __convertVarying(e,t){const n=t?"in ":"out ";this.__replaceLine(e,/^(?![\/])[\t ]*varying[\t ]+/g,n)}static __convertTextureCube(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(textureCube)(${t}+)`,"g");this.__replaceLine(e,n,"$1texture$3")}static __convertTexture2D(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture2D)(${t}+)`,"g");this.__replaceLine(e,n,"$1texture$3")}static __convertTexture2DProd(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture2DProj)(${t}+)`,"g");this.__replaceLine(e,n,"$1textureProj$3")}static __convertTexture3D(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture3D)(${t}+)`,"g");this.__replaceLine(e,n,"$1texture$3")}static __convertTexture3DProd(e){const t=this.__regSymbols(),n=new RegExp(`(${t}+)(texture3DProj)(${t}+)`,"g");this.__replaceLine(e,n,"$1textureProj$3")}static __regSymbols(){return"[!\"#$%&'()*+-.,/:;<=>?@[\\]^`{|}~\t\n ]"}static __replaceLine(e,t,n){for(let i=0;i=0&&!e[t].match(o);t--)if(e[t]===i)return;console.error(n),e.push(i)}}}},"./src/main/Shaderity.ts":function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("./src/main/Reflection.ts")),a=i(n("./src/main/ShaderTransformer.ts")),r=i(n("./src/main/ShaderEditor.ts")),s=i(n("./src/main/Utility.ts")),l=i(n("./src/main/ShaderityObjectCreator.ts")),c=i(n("./src/main/PreProcessor.ts"));t.default=class{static transformToGLSLES1(e,t=!1){const n=s.default._splitByLineFeedCode(e.code),i=a.default._transformToGLSLES1(n,e.isFragmentShader,t);return{code:s.default._joinSplittedLine(i),shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}static transformToGLSLES3(e){const t=s.default._splitByLineFeedCode(e.code),n=a.default._transformToGLSLES3(t,e.isFragmentShader);return{code:s.default._joinSplittedLine(n),shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}static transformTo(e,t,n=!1){const i=s.default._splitByLineFeedCode(t.code),o=a.default._transformTo(e,i,t.isFragmentShader,n);return{code:s.default._joinSplittedLine(o),shaderStage:t.shaderStage,isFragmentShader:t.isFragmentShader}}static processPragma(e){const t=s.default._splitByLineFeedCode(e.code),n=c.default.process(t);return{code:s.default._joinSplittedLine(n),shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}static createShaderityObjectCreator(e){return new l.default(e)}static fillTemplate(e,t){const n=this.__copyShaderityObject(e);return n.code=r.default._fillTemplate(n.code,t),n}static insertDefinition(e,t){const n=this.__copyShaderityObject(e),i=s.default._splitByLineFeedCode(e.code);return r.default._insertDefinition(i,t),n.code=s.default._joinSplittedLine(i),n}static createReflectionObject(e){const t=s.default._splitByLineFeedCode(e.code);return new o.default(t,e.shaderStage)}static __copyShaderityObject(e){return{code:e.code,shaderStage:e.shaderStage,isFragmentShader:e.isFragmentShader}}}},"./src/main/ShaderityObjectCreator.ts":function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(n("./src/main/Utility.ts"));class a{constructor(e){this.__functionIdCount=0,this.__defineDirectiveNames=[],this.__extensions=[],this.__globalPrecision={int:"highp",float:"highp",sampler2D:"highp",samplerCube:"highp",sampler3D:"highp",sampler2DArray:"highp",isampler2D:"highp",isamplerCube:"highp",isampler3D:"highp",isampler2DArray:"highp",usampler2D:"highp",usamplerCube:"highp",usampler3D:"highp",usampler2DArray:"highp",sampler2DShadow:"highp",samplerCubeShadow:"highp",sampler2DArrayShadow:"highp"},this.__structDefinitions=[],this.__globalConstantValues=[],this.__globalConstantStructValues=[],this.__attributes=[],this.__varyings=[],this.__uniforms=[],this.__uniformStructs=[],this.__uniformBufferObjects=[],this.__functions=[],this.__mainFunctionCode="void main() {}",this.__outputColorVariableName="renderTarget0",this.__shaderStage=e}addDefineDirective(e){this.__defineDirectiveNames.some((t=>t===e))?console.warn("addDefineDirective: this define directive is already set"):this.__defineDirectiveNames.push(e)}addExtension(e,t="enable"){this.__extensions.some((t=>t.extensionName===e))?console.warn("addExtension: this extension is already set"):this.__extensions.push({extensionName:e,behavior:t})}addStructDefinition(e,t){this.__structDefinitions.some((t=>t.structName===e))?console.error(`addStructDefinition: duplicate struct type name ${e}`):this.__structDefinitions.push({structName:e,memberObjects:t})}addGlobalConstantValue(e,t,n){this.__globalConstantValues.some((t=>t.variableName===e))?console.error(`addGlobalConstantValue: duplicate variable name ${e}`):o.default._isValidComponentCount(t,n)?(o.default._isIntType(t)&&a.__existNonIntegerValue(n)&&console.warn(`addGlobalConstantValue: non-integer value is set to ${e}`),this.__globalConstantValues.push({variableName:e,type:t,values:n})):console.error(`addGlobalConstantValue: the component count of ${e} is invalid`)}addGlobalConstantStructValue(e,t,n){this.__globalConstantStructValues.some((e=>e.variableName===t))?console.error(`addGlobalConstantStructValue: duplicate variable name ${t}`):this.__globalConstantStructValues.push({variableName:t,structName:e,values:n})}addAttributeDeclaration(e,t,n){"vertex"===this.__shaderStage?this.__attributes.some((t=>t.variableName===e))?console.error(`addAttribute: duplicate variable name ${e}`):this.__attributes.push({variableName:e,type:t,precision:null==n?void 0:n.precision,location:null==n?void 0:n.location}):console.error("addAttribute: this method is for vertex shader only")}addVaryingDeclaration(e,t,n){if(this.__varyings.some((t=>t.variableName===e)))return void console.error(`addVarying: duplicate variable name ${e}`);const i=o.default._isIntType(t);let a=null==n?void 0:n.interpolationType;if(i&&"flat"!==a){if(null!=a)return void console.error("addVarying: the interpolationType must be flat for integer types");console.warn("addVarying: set the interpolationType of integer types to flat to avoid compilation error"),a="flat"}this.__varyings.push({variableName:e,type:t,precision:null==n?void 0:n.precision,interpolationType:a})}addUniformDeclaration(e,t,n){this.__uniforms.some((t=>t.variableName===e))?console.error(`addUniform: duplicate variable name ${e}`):("bool"===t&&null!=(null==n?void 0:n.precision)&&(console.warn("addUniform: remove the specification of precision for bool type to avoid compilation error"),n.precision=void 0),this.__uniforms.push({variableName:e,type:t,precision:null==n?void 0:n.precision}))}addUniformStructDeclaration(e,t){this.__uniformStructs.some((e=>e.variableName===t))?console.error(`addUniformStructDeclaration: duplicate variable name ${t}`):this.__uniformStructs.push({variableName:t,structName:e})}addUniformBufferObjectDeclaration(e,t,n){if(this.__uniformBufferObjects.some((t=>t.blockName===e)))console.error(`addUniformBufferObjectDeclaration: duplicate block name ${e}`);else{for(const e of this.__uniformBufferObjects)for(const n of e.variableObjects)for(const e of t)if(n.variableName===e.variableName)return void console.error(`addUniformBufferObjectDeclaration: duplicate variable name ${e.variableName}`);this.__uniformBufferObjects.push({blockName:e,variableObjects:t,instanceName:null==n?void 0:n.instanceName})}}addFunctionDefinition(e,t){var n,i;const o=this.__functionIdCount++,a=null!==(n=null==t?void 0:t.dependencyLevel)&&void 0!==n?n:0;return this.__functions[a]=null!==(i=this.__functions[a])&&void 0!==i?i:[],this.__functions[a].push({functionCode:e,functionId:o}),o}updateGlobalPrecision(e){Object.assign(this.__globalPrecision,e)}updateStructDefinition(e,t){const n=this.__structDefinitions.findIndex((t=>t.structName===e));-1!==n?this.__structDefinitions[n].memberObjects=t:console.error(`updateStructDefinition: the struct type name ${e} is not exist`)}updateGlobalConstantValue(e,t){const n=this.__globalConstantValues.findIndex((t=>t.variableName===e));if(-1===n)return void console.warn(`updateGlobalConstantValue: the variable name ${e} is not exist`);const i=this.__globalConstantValues[n].type;o.default._isValidComponentCount(i,t)?(o.default._isIntType(i)&&a.__existNonIntegerValue(t)&&console.warn(`updateGlobalConstantValue: the ${e} has a non-integer value.`),this.__globalConstantValues[n].values=t):console.error("updateGlobalConstantValue: the component count is invalid")}updateGlobalConstantStructValue(e,t){const n=this.__globalConstantStructValues.findIndex((t=>t.variableName===e));-1!==n?this.__globalConstantStructValues[n].values=t:console.error(`updateGlobalConstantStructValue: the variable name ${e} is not exist`)}updateMainFunction(e){this.__mainFunctionCode=e}updateOutputColorVariableName(e){"fragment"===this.__shaderStage?0!==e.length?this.__outputColorVariableName=e:console.error("updateOutputColorVariableName: invalid outColorVariableName"):console.error("updateOutputColorVariableName: this method is for fragment shader only")}removeDefineDirective(e){const t=this.__defineDirectiveNames.indexOf(e);-1!==t?this.__defineDirectiveNames.splice(t,1):console.warn("removedDefineDirective: this define directive is not exist")}removeExtension(e){const t=this.__extensions.findIndex((t=>t.extensionName===e));-1!==t?this.__extensions.splice(t,1):console.warn("removeExtension: this extension is not exist")}removeStructDefinition(e){const t=this.__structDefinitions.findIndex((t=>t.structName===e));-1!==t?this.__structDefinitions.splice(t,1):console.error(`removeStructDefinition: the struct type name ${e} is not exist`)}removeGlobalConstantValue(e){const t=this.__globalConstantValues.findIndex((t=>t.variableName===e));-1!==t?this.__globalConstantValues.splice(t,1):console.warn(`removeGlobalConstantValue: the variable name ${e} is not exist`)}removeGlobalConstantStructValue(e){const t=this.__globalConstantStructValues.findIndex((t=>t.variableName===e));-1!==t?this.__globalConstantStructValues.splice(t,1):console.error(`updateGlobalConstantStructValue: the variable name ${e} is not exist`)}removeAttributeDeclaration(e){const t=this.__attributes.findIndex((t=>t.variableName===e));-1!==t?this.__attributes.splice(t,1):console.warn(`removeAttribute: the variable name ${e} is not exist`)}removeVaryingDeclaration(e){const t=this.__varyings.findIndex((t=>t.variableName===e));-1!==t?this.__varyings.splice(t,1):console.warn(`removeVarying: the variable name ${e} is not exist`)}removeUniformDeclaration(e){const t=this.__uniforms.findIndex((t=>t.variableName===e));-1!==t?this.__uniforms.splice(t,1):console.warn(`removeUniform: the variable name ${e} is not exist`)}removeUniformStructDeclaration(e){const t=this.__uniformStructs.findIndex((t=>t.variableName===e));-1!==t?this.__uniformStructs.splice(t,1):console.warn(`removeUniformStructDeclaration: the variable name ${e} is not exist`)}removeUniformBufferObjectDeclaration(e){const t=this.__uniformBufferObjects.findIndex((t=>t.blockName===e));-1!==t?this.__uniformBufferObjects.splice(t,1):console.warn(`removeUniformStructDeclaration: the variable name ${e} is not exist`)}removeFunctionDefinition(e){this.__fillEmptyFunctions(),(e<0||e>=this.__functionIdCount)&&console.warn("removeFunctionDefinition: invalid function id");for(const t of this.__functions){const n=t.findIndex((t=>t.functionId===e));if(-1!==n)return void t.splice(n,1)}console.warn(`removeFunctionDefinition: not found the function of functionId ${e}`)}createShaderityObject(){return{code:this.__createShaderCode(),shaderStage:this.__shaderStage,isFragmentShader:"fragment"===this.__shaderStage}}static __existNonIntegerValue(e){for(const t of e)if(!Number.isInteger(t))return!0;return!1}__createShaderCode(){return this.__fillEmptyFunctions(),"#version 300 es\n\n"+this.__createDefineDirectiveShaderCode()+this.__createExtensionShaderCode()+this.__createGlobalPrecisionShaderCode()+this.__createStructDefinitionShaderCode()+this.__createGlobalConstantValueShaderCode()+this.__createGlobalConstantStructValueShaderCode()+this.__createAttributeDeclarationShaderCode()+this.__createVaryingDeclarationShaderCode()+this.__createOutputColorDeclarationShaderCode()+this.__createUniformDeclarationShaderCode()+this.__createUniformStructDeclarationShaderCode()+this.__createUniformBufferObjectShaderCode()+this.__createFunctionDefinitionShaderCode()+this.__createMainFunctionDefinitionShaderCode()}__fillEmptyFunctions(){var e;for(let t=0;te.structName===t.structName));if(-1===n){console.error(`__createGlobalConstantStructValueShaderCode: the struct type ${t.structName} is not defined`);continue}e+=`const ${t.structName} ${t.variableName} = ${t.structName} (\n`;const i=this.__structDefinitions[n];if(i.memberObjects.length===Object.keys(t.values).length)if(i.memberObjects.some((e=>o.default._isSamplerType(e.type))))console.error(`__createGlobalConstantStructValueShaderCode: ConstantStructValue (${t.variableName}) cannot have sampler type parameter`);else{for(let n=0;ne.structName===n))?e+=`uniform ${n} ${t.variableName};\n`:console.error(`__createUniformStructDeclarationShaderCode: the struct type ${n} is not defined`)}return o.default._addLineFeedCodeIfNotNullString(e)}__createUniformBufferObjectShaderCode(){let e="";for(const t of this.__uniformBufferObjects){e+=`layout (std140) uniform ${t.blockName} {\n`;for(let n=0;n{"use strict";n.d(t,{D:()=>f});var i=n(9721),o=n(1350),a=n(8491),r=n(4507),s=n(6692),l=n(224),c=n(2404),_=n(4710),h=n(7987),u=n(3258),d=n(3496),m=n(4690);class f extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.type="efk",this.playJustAfterLoaded=!1,this.isLoop=!1,this.isPause=!1,this.randomSeed=-1,this.isImageLoadWithCredential=!1,this.__speed=1,this.__isInitialized=!1,this.isLoadEffect=!1,u.D.noWebGLTex2DStateCache=!0}static get componentTID(){return _.z.EffekseerComponentTID}cancelLoop(){clearInterval(this.__timer)}isPlay(){return!!m.Is.exist(this.__handle)&&!!this.__handle.exists&&!this.isPause}play(){return m.Is.not.exist(this.__context)?(console.warn("No Effekseer context yet"),!1):m.Is.not.exist(this.__effect)?(console.warn("No Effekseer effect yet"),!1):(this.stop(),this.isPause=!1,this.__handle=this.__context.play(this.__effect,0,0,0),m.Is.exist(this.__handle)&&m.Is.exist(this.__handle.setRandomSeed)&&this.randomSeed>0&&this.__handle.setRandomSeed(this.randomSeed),!0)}continue(){this.isPause=!1}pause(){m.Is.exist(this.__handle)&&(this.isPause=!0,clearInterval(this.__timer))}stop(){m.Is.exist(this.__handle)&&(this.__handle.stop(),this.isPause=!0,clearInterval(this.__timer))}set playSpeed(e){this.__handle&&this.__handle.setSpeed(e),this.__speed=e}get playSpeed(){return this.__speed}setTime(e){if(!this.play())return!1;if(m.Is.not.exist(this.__context))return!1;let t=0;const n=.0166;for(t=n;t<=e;)if(this.__context.update(t/n),t+=n,e{this.playJustAfterLoaded&&(this.play(),this.moveStageTo(r.I.Logic))},o=(e,t)=>{console.error(e,t)};if("efkpkg"===this.type){if(m.Is.not.exist(f.Unzip))return console.error("Please Set an Unzip object to EffekseerComponent.Unzip"),!1;this.__effect=this.__context.loadEffectPackage(n,f.Unzip,1,i.bind(this),o.bind(this))}else this.__effect=this.__context.loadEffect(n,1,i.bind(this),o.bind(this));return!0}$load(){!this.__isInitialized&&m.Is.not.exist(this.__context)&&m.Is.not.exist(this.__effect)&&(m.Is.exist(f.wasmModuleUri)?effekseer.initRuntime(f.wasmModuleUri,(()=>{this.__createEffekseerContext()&&this.moveStageTo(r.I.Logic)}),(()=>{console.error("Failed to initialize Effekseer")})):this.__createEffekseerContext()&&this.moveStageTo(r.I.Logic))}$logic(){if(this.isPause||m.Is.exist(this.__context)&&m.Is.false(this.isPause)&&this.__context.update(),null!=this.__handle){const e=f.__tmp_identityMatrix_0.copyComponents(this.__sceneGraphComponent.matrixInner);this.__handle.setMatrix(e._v),this.__handle.setSpeed(this.__speed)}this.isPause||this.isLoop&&(this.isPlay()||this.play()),this.moveStageTo(r.I.Render)}_destroy(){m.Is.exist(this.__context)&&(this.__context.releaseEffect(!this.__effect),effekseer.releaseContext(this.__context),this.__context=void 0),m.Is.exist(this.__handle)&&(this.__handle=void 0),this.__effect=void 0}$render(){if(m.Is.not.exist(this.__effect))return void this.moveStageTo(r.I.Load);const e=c.C.getComponent(l.M,l.M.current),t=f.__tmp_identityMatrix_0,n=f.__tmp_identityMatrix_1;e?(t.copyComponents(e.viewMatrix),n.copyComponents(e.projectionMatrix)):(t.identity(),n.identity()),m.Is.exist(this.__context)&&(this.__context.setProjectionMatrix(n._v),this.__context.setCameraMatrix(t._v),this.__context.draw()),this.moveStageTo(r.I.Logic)}static sort_$render(e){return m.Is.false(e.toRenderEffekseerEffects)?[]:c.C.getComponentsWithType(f).map((e=>e.componentSID))}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getEffekseer(){return this.getComponentByComponentTID(f.componentTID)}}return(0,o.e)(e,n),e}}f.ANIMATION_EVENT_PLAY=0,f.ANIMATION_EVENT_PAUSE=1,f.ANIMATION_EVENT_END=2,f.wasmModuleUri=void 0,f.__tmp_identityMatrix_0=d.e.identity(),f.__tmp_identityMatrix_1=d.e.identity(),c.C.registerComponentClass(f)},8107:(e,t,n)=>{"use strict";n.d(t,{A:()=>i.Effekseer,D:()=>o.D});var i=n(3995),o=n(7015)},3995:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Effekseer:()=>s});var i=n(7015),o=n(1350),a=n(6692),r=n(8491);const s=Object.freeze({EffekseerComponent:i.D,createEffekseerEntity:function(){const e=o.g.createEntity(),t=o.g.addComponentToEntity(a.U,e),n=o.g.addComponentToEntity(r.a,t);return o.g.addComponentToEntity(i.D,n)}})},3658:(e,t,n)=>{"use strict";n.d(t,{m:()=>a});var i=n(2471),o=n(4690);class a{constructor(){this.zNearMax=.1,this.zFarScalingFactor=1e5,this.autoCalculateZNearAndZFar=!0}_calcZNearInner(e,t,n){if(this.autoCalculateZNearAndZFar&&o.Is.exist(this.__targetEntity)){const o=this.__targetEntity.getSceneGraph().worldAABB,a=i.P.lengthBtw(t,o.centerPoint),r=o.centerPoint.x-t.x,s=o.centerPoint.y-t.y,l=o.centerPoint.z-t.z,c=(r*n.x+s*n.y+l*n.z)/(Math.hypot(r,s,l)*n.length());e.zNearInner=Math.max(Math.min(a*c-o.lengthCenterToCorner,this.zNearMax),.01)}else e.zNearInner=e.zNear}_calcZFarInner(e){this.autoCalculateZNearAndZFar?e.zFarInner=e.zNearInner*this.zFarScalingFactor:e.zNearInner=e.zFar}}},6547:(e,t,n)=>{"use strict";n.d(t,{j:()=>d});var i=n(2471),o=n(9190),a=n(3032),r=n(2566),s=n(5467),l=n(3496),c=n(3658),_=n(4690),h=n(4742),u=n(3258);class d extends c.m{constructor(){super(),this.dollyScale=2,this.scaleOfLengthCenterToCamera=1,this.moveSpeed=1,this.followTargetAABB=!1,this.autoUpdate=!0,this.__updated=!1,this.__fixedDolly=!1,this.__fixedLengthOfCenterToEye=1,this.__isMouseDown=!1,this.__lastMouseDownTimeStamp=0,this.__lastMouseUpTimeStamp=0,this.__originalY=-1,this.__originalX=-1,this.__buttonNumber=0,this.__mouse_translate_y=0,this.__mouse_translate_x=0,this.__efficiency=1,this.__lengthOfCenterToEye=1,this.__fovyBias=1,this.__scaleOfTranslation=2.8,this.__mouseTranslateVec=o.d6.zero(),this.__newEyeVec=o.d6.zero(),this.__newCenterVec=o.d6.zero(),this.__newUpVec=o.d6.zero(),this.__newTangentVec=o.d6.zero(),this.__isSymmetryMode=!0,this.__rot_bgn_x=0,this.__rot_bgn_y=0,this.__rot_x=0,this.__rot_y=0,this.__dolly=.5,this.__eyeVec=o.d6.zero(),this.__centerVec=o.d6.zero(),this.__upVec=o.d6.zero(),this.__scaleOfZNearAndZFar=5e3,this.__doPreventDefault=!1,this.__isPressingShift=!1,this.__isPressingCtrl=!1,this.__pinchInOutControl=!1,this.__pinchInOutOriginalDistance=null,this.__resetDollyTouchTime=0,this.__mouseDownFunc=this.__mouseDown.bind(this),this.__mouseUpFunc=this.__mouseUp.bind(this),this.__mouseMoveFunc=this.__mouseMove.bind(this),this.__touchDownFunc=this.__touchDown.bind(this),this.__touchUpFunc=this.__touchUp.bind(this),this.__touchMoveFunc=this.__touchMove.bind(this),this.__pinchInOutFunc=this.__pinchInOut.bind(this),this.__pinchInOutEndFunc=this.__pinchInOutEnd.bind(this),this.__mouseWheelFunc=this.__mouseWheel.bind(this),this.__mouseDblClickFunc=this.__mouseDblClick.bind(this),this.__contextMenuFunc=this.__contextMenu.bind(this),this.__pressShiftFunc=this.__pressShift.bind(this),this.__releaseShiftFunc=this.__releaseShift.bind(this),this.__pressCtrlFunc=this.__pressCtrl.bind(this),this.__releaseCtrlFunc=this.__releaseCtrl.bind(this),this.__resetDollyAndPositionFunc=this.__resetDollyAndPosition.bind(this),this.registerEventListeners()}resetDollyAndTranslation(){this.__dolly=.5,this.__mouse_translate_x=0,this.__mouse_translate_y=0,this.__mouseTranslateVec=o.d6.zero()}setTarget(e){this.__targetEntity=e,this.__originalTargetAABB=void 0,this.__updated=!1}getTarget(){return this.__targetEntity}set doPreventDefault(e){this.__doPreventDefault=e}get doPreventDefault(){return this.__doPreventDefault}__mouseDown(e){this.__tryToPreventDefault(e),this.__isPressingCtrl||(this.__originalX=e.clientX,this.__originalY=e.clientY,this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y,this.__isMouseDown=!0,this.__lastMouseDownTimeStamp=e.timeStamp,console.log("original",this.__originalX,this.__originalY),this.__updated=!1)}__mouseMove(e){if(this.__tryToPreventDefault(e),_.Is.false(this.isMouseDown))return;if(this.__isPressingCtrl)return;0===this.__buttonNumber&&(this.__buttonNumber=e.buttons);const t=e.clientX,n=e.clientY;switch(this.__buttonNumber){case 1:this.__isPressingShift?this.__parallelTranslateControl(this.__originalX,this.__originalY,t,n):(this.__rotateControl(this.__originalX,this.__originalY,t,n),this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y);break;case 2:this.__zoomControl(this.__originalX,t);break;case 4:this.__parallelTranslateControl(this.__originalX,this.__originalY,t,n);break;default:return}this.__originalX=t,this.__originalY=n,this.__updated=!1}__mouseUp(e){this.__buttonNumber=0,this.__originalX=-1,this.__originalY=-1,this.__isMouseDown=!1,this.__lastMouseUpTimeStamp=e.timeStamp,this.__updated=!1}__touchDown(e){this.__tryToPreventDefault(e),1===e.touches.length?(this.__originalX=e.touches[0].clientX,this.__originalY=e.touches[0].clientY,this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y):(this.__originalX=.5*(e.touches[0].clientX+e.touches[1].clientX),this.__originalY=.5*(e.touches[0].clientY+e.touches[1].clientY)),this.__isMouseDown=!0,this.__lastMouseDownTimeStamp=e.timeStamp}__touchMove(e){if(this.__tryToPreventDefault(e),_.Is.false(this.isMouseDown))return;let t=e.touches[0].clientX,n=e.touches[0].clientY;1===e.touches.length?(t=e.touches[0].clientX,n=e.touches[0].clientY,this.__rotateControl(this.__originalX,this.__originalY,t,n),this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y):(t=.5*(e.touches[0].clientX+e.touches[1].clientX),n=.5*(e.touches[0].clientY+e.touches[1].clientY),this.__parallelTranslateControl(this.__originalX,this.__originalY,t,n)),this.__originalX=t,this.__originalY=n}__touchUp(e){const t=e.touches.length;0===t?(this.__originalX=-1,this.__originalY=-1):1===t?(this.__originalX=e.touches[0].clientX,this.__originalY=e.touches[0].clientY,this.__rot_bgn_x=this.__rot_x,this.__rot_bgn_y=this.__rot_y):(this.__originalX=.5*(e.touches[0].clientX+e.touches[1].clientX),this.__originalY=.5*(e.touches[0].clientY+e.touches[1].clientY)),this.__isMouseDown=!1,this.__lastMouseUpTimeStamp=e.timeStamp}set rotX(e){this.__rot_x=e}get rotX(){return this.__rot_x}set rotY(e){this.__rot_y=e}get rotY(){return this.__rot_y}set maximumY(e){this.__maximum_y=e}set minimumY(e){this.__minimum_y=e}__rotateControl(e,t,n,i){const o=(n-e)*this.__efficiency*.3,a=(i-t)*this.__efficiency*.3;this.__rot_x=this.__rot_bgn_x-o,this.__rot_y=this.__rot_bgn_y-a,null!=this.__maximum_y&&this.__rot_y>this.__maximum_y&&(this.__rot_y=this.__maximum_y),null!=this.__minimum_y&&this.__rot_y35&&(this.__pinchInOutOriginalDistance=t,this.__pinchInOutControl=!0));const i=n/t;this.dolly*=Math.pow(i*this.__efficiency,2.2/15),this.__pinchInOutOriginalDistance=t}__pinchInOutEnd(e){e.touches.length<2&&(this.__pinchInOutControl=!1,this.__pinchInOutOriginalDistance=null)}__tryToPreventDefault(e){this.__doPreventDefault&&e.preventDefault()}__mouseWheel(e){this.__tryToPreventDefault(e),this.dolly+=Math.sign(e.deltaY)/200}__contextMenu(e){this.__tryToPreventDefault(e)}set dolly(e){e=Math.min(e,1),e=Math.max(e,1e-4);let t=Math.pow(e,5);t=Math.max(t,1e-4),this.__dolly=t}get dolly(){return Math.pow(this.__dolly,.2)}__mouseDblClick(e){e.shiftKey?this.__mouseTranslateVec.zero():e.ctrlKey&&(this.__rot_y=0,this.__rot_x=0,this.__rot_bgn_y=0,this.__rot_bgn_x=0)}__resetDollyAndPosition(e){if(e.touches.length>1)return;const t=(new Date).getTime();t-this.__resetDollyTouchTime<300?(this.dolly=Math.pow(.5,1/2.2),this.__mouseTranslateVec.zero(),this.__rot_x=0,this.__rot_y=0):this.__resetDollyTouchTime=t}__pressShift(e){!0===e.shiftKey&&(this.__isPressingShift=!0)}__releaseShift(e){!1===e.shiftKey&&(this.__isPressingShift=!1)}__pressCtrl(e){!0===e.ctrlKey&&(this.__isPressingCtrl=!0)}__releaseCtrl(e){!1===e.ctrlKey&&(this.__isPressingCtrl=!1)}registerEventListeners(){let e=window;_.Is.exist(u.D.eventTargetDom)&&(e=u.D.eventTargetDom),"ontouchend"in document?h.$t.register(h.jO,[{eventName:"touchstart",handler:this.__touchDownFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchmove",handler:this.__touchMoveFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchend",handler:this.__touchUpFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchmove",handler:this.__pinchInOutFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchend",handler:this.__pinchInOutEndFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchstart",handler:this.__resetDollyAndPositionFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"contextmenu",handler:this.__contextMenuFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"dblclick",handler:this.__mouseDblClickFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}]):h.$t.register(h.jO,[{eventName:"mousedown",handler:this.__mouseDownFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseup",handler:this.__mouseUpFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseleave",handler:this.__mouseUpFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mousemove",handler:this.__mouseMoveFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keydown",handler:this.__pressShiftFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keyup",handler:this.__releaseShiftFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keydown",handler:this.__pressCtrlFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keyup",handler:this.__releaseCtrlFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"contextmenu",handler:this.__contextMenuFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"wheel",handler:this.__mouseWheelFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"dblclick",handler:this.__mouseDblClickFunc,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}])}unregisterEventListeners(){h.$t.unregister(h.jO)}__getFovyFromCamera(e){return e.fovy?e.fovy:a.k.radianToDegree(2*Math.atan(Math.abs(e.top-e.bottom)/(2*e.zNear)))}logic(e){this.__updated&&!this.autoUpdate||(this.__updateTargeting(e),this.__calculateInfluenceOfController(),this.__updateCameraComponent(e),this.__updated=!0)}__updateTargeting(e){const t=e.eye,n=e._direction,i=e._up,r=this.__eyeVec,l=this.__centerVec,c=this.__upVec.copyComponents(i);if(null==this.__targetEntity)r.copyComponents(t),l.copyComponents(n);else{if(null==this.__originalTargetAABB){const e=this.__targetEntity.tryToGetSceneGraph().worldAABB;this.__originalTargetAABB=e.clone()}if(this.followTargetAABB){const e=this.__targetEntity.tryToGetSceneGraph().worldAABB;l.copyComponents(e.centerPoint)}else l.copyComponents(this.__originalTargetAABB.centerPoint);const i=o.d6.subtractTo(t,n,r).normalize();let _=this.__fixedDolly?this.__fixedLengthOfCenterToEye:this.__originalTargetAABB.lengthCenterToCorner*(1+1/Math.tan(a.k.degreeToRadian(e.fovy/2)))*this.scaleOfLengthCenterToCamera;Math.abs(_)<1e-5&&(_=1),i.multiply(_).add(l);const h=e.entity.tryToGetSceneGraph();if(null!=h){const e=s.J.invertTo(h.matrixInner,d.__tmpMat44_0);e.multiplyVector3To(l,l),e.multiplyVector3To(r,r),e.multiplyVector3To(c,c)}}}__calculateInfluenceOfController(){const e=o.d6.subtractTo(this.__eyeVec,this.__centerVec,d.__tmpVec3_0);this.__fixedDolly?this.__lengthOfCenterToEye=this.__fixedLengthOfCenterToEye:(e.multiply(this.__dolly*this.dollyScale),this.__lengthOfCenterToEye=e.length());const t=this.__newUpVec,n=this.__newEyeVec,s=this.__newCenterVec,l=this.__newTangentVec;if(this.__isSymmetryMode){const c=d.__tmpVec3_1;c.setComponents(e.x,0,e.z);let _=i.P.angleOfVectors(c,d.__tmp_up);_*=Math.sign(c.cross(d.__tmp_up).y);const h=d.__tmp_rotateM_X,u=d.__tmp_rotateM_Y,m=d.__tmp_rotateM_Reset,f=d.__tmp_rotateM_Revert;h.rotateX(a.k.degreeToRadian(this.__rot_y)),u.rotateY(a.k.degreeToRadian(this.__rot_x)),m.rotateY(a.k.degreeToRadian(_)),f.rotateY(a.k.degreeToRadian(-_));const p=d.__tmp_rotateM;r.x.multiplyTo(h,m,p),p.multiplyByLeft(u),p.multiplyByLeft(f),p.multiplyVectorTo(this.__upVec,t),p.multiplyVectorTo(e,n).add(this.__centerVec),s.copyComponents(this.__centerVec);const v=d.__tmpVec3_2;o.d6.subtractTo(s,n,v),o.d6.crossTo(t,v,l),n.add(this.__mouseTranslateVec),s.add(this.__mouseTranslateVec)}else{const i=d.__tmp_rotateM_X,c=d.__tmp_rotateM_Y;i.rotateX(a.k.degreeToRadian(this.__rot_y)),c.rotateY(a.k.degreeToRadian(this.__rot_x));const _=r.x.multiplyTo(c,i,d.__tmp_rotateM);_.multiplyVectorTo(this.__upVec,t),_.multiplyVectorTo(e,n).add(this.__centerVec),s.copyComponents(this.__centerVec);const h=d.__tmpVec3_1;o.d6.subtractTo(s,n,h),o.d6.crossTo(t,h,l),n.add(this.__mouseTranslateVec),s.add(this.__mouseTranslateVec)}}__updateCameraComponent(e){const t=d.__tmpVec3_0.copyComponents(this.__newCenterVec);t.subtract(this.__newEyeVec).normalize(),this._calcZNearInner(e,this.__newEyeVec,t),this._calcZFarInner(e);const n=e.zFar/e.zNear/this.__scaleOfZNearAndZFar,i=e.left+n,o=e.right+n,r=e.top+n,s=e.bottom+n,l=this.__getFovyFromCamera(e);this.__fovyBias=Math.tan(a.k.degreeToRadian(l/2)),e.eyeInner=this.__newEyeVec,e.directionInner=this.__newCenterVec,e.upInner=this.__newUpVec,e.leftInner=i,e.rightInner=o,e.topInner=r,e.bottomInner=s,e.fovyInner=l}set scaleOfZNearAndZFar(e){this.__scaleOfZNearAndZFar=e}get scaleOfZNearAndZFar(){return this.__scaleOfZNearAndZFar}get isMouseDown(){return this.__isMouseDown}get lastMouseDownTimeStamp(){return this.__lastMouseDownTimeStamp}get lastMouseUpTimeStamp(){return this.__lastMouseUpTimeStamp}setFixedDollyTrue(e){this.__fixedLengthOfCenterToEye=e,this.__fixedDolly=!0}unsetFixedDolly(){this.__fixedDolly=!1}}d.__tmp_up=i.P.fromCopyArray([0,0,1]),d.__tmpVec3_0=o.d6.zero(),d.__tmpVec3_1=o.d6.zero(),d.__tmpVec3_2=o.d6.zero(),d.__tmp_rotateM_X=r.x.identity(),d.__tmp_rotateM_Y=r.x.identity(),d.__tmp_rotateM=r.x.identity(),d.__tmp_rotateM_Reset=r.x.identity(),d.__tmp_rotateM_Revert=r.x.identity(),d.__tmpMat44_0=l.e.identity()},4478:(e,t,n)=>{"use strict";n.d(t,{I:()=>u});var i=n(5467),o=n(8547),a=n(9190),r=n(2566),s=n(3496),l=n(3658),c=n(3032),_=n(4690),h=n(4742);class u extends l.m{constructor(e={eventTargetDom:document,verticalSpeed:1,horizontalSpeed:1,turnSpeed:.25,mouseWheelSpeedScale:1,inverseVerticalRotating:!1,inverseHorizontalRotating:!1}){super(),this._isKeyDown=!1,this._isMouseDrag=!1,this._lastKeyCode=-1,this._currentDir=a.d6.fromCopyArray([0,0,-1]),this._currentPos=a.d6.fromCopyArray([0,0,0]),this._currentCenter=a.d6.fromCopyArray([0,0,-1]),this._currentHorizontalDir=a.d6.fromCopyArray([0,0,-1]),this._newDir=a.d6.fromCopyArray([0,0,-1]),this._isMouseDown=!1,this._clickedMouseXOnCanvas=-1,this._clickedMouseYOnCanvas=-1,this._draggedMouseXOnCanvas=-1,this._draggedMouseYOnCanvas=-1,this._deltaMouseXOnCanvas=-1,this._deltaMouseYOnCanvas=-1,this._mouseXAdjustScale=1,this._mouseYAdjustScale=1,this._deltaY=-1,this._deltaX=-1,this._mouseUpBind=this._mouseUp.bind(this),this._mouseDownBind=this._mouseDown.bind(this),this._mouseMoveBind=this._mouseMove.bind(this),this._mouseWheelBind=this._mouseWheel.bind(this),this.__doPreventDefault=!1,this._needInitialize=!0,this._horizontalSpeed=e.horizontalSpeed,this._verticalSpeed=e.verticalSpeed,this._turnSpeed=e.turnSpeed,this._mouseXAdjustScale=this._turnSpeed,this._mouseYAdjustScale=this._turnSpeed,this._mouseWheelSpeedScale=e.mouseWheelSpeedScale,this._inverseVerticalRotating=e.inverseVerticalRotating,this._inverseHorizontalRotating=e.inverseHorizontalRotating,this.reset(),this._onKeydown=e=>{this._isKeyDown=!0,this._lastKeyCode=e.keyCode},this._onKeyup=e=>{this._isKeyDown=!1,this._lastKeyCode=-1};const t=e.eventTargetDom;this.registerEventListeners(t)}registerEventListeners(e=document){this._eventTargetDom=e;const t=[{eventName:"keydown",handler:this._onKeydown,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"keyup",handler:this._onKeyup,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}];"ontouchend"in document&&t.push({eventName:"touchstart",handler:this._mouseDownBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchend",handler:this._mouseUpBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"touchmove",handler:this._mouseMoveBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}),"onmouseup"in document&&t.push({eventName:"mousedown",handler:this._mouseDownBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseup",handler:this._mouseUpBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mouseleave",handler:this._mouseUpBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e},{eventName:"mousemove",handler:this._mouseMoveBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}),"onwheel"in document&&t.push({eventName:"wheel",handler:this._mouseWheelBind,options:{passive:!this.__doPreventDefault},classInstance:this,eventTargetDom:e}),h.$t.register(h.jO,t)}unregisterEventListeners(){h.$t.unregister(h.jO)}__tryToPreventDefault(e){this.__doPreventDefault&&e.preventDefault()}_mouseWheel(e){if(null===this._currentDir)return;const t=-1*Math.sign(e.deltaY)*this._mouseWheelSpeedScale*this._horizontalSpeed,n=u.__tmp_Vec3_0;n.setComponents(this._currentDir.x,0,this._currentDir.z).normalize();const i=a.d6.multiplyTo(n,t,u.__tmp_Vec3_1);this._currentPos.add(i),this._currentCenter.add(i)}_mouseDown(e){this.__tryToPreventDefault(e),this._isMouseDown=!0;const t=e.target.getBoundingClientRect();return this._clickedMouseXOnCanvas=e.clientX-t.left,this._clickedMouseYOnCanvas=e.clientY-t.top,!1}_mouseMove(e){if(this.__tryToPreventDefault(e),!this._isMouseDown)return;const t=e.target.getBoundingClientRect();this._draggedMouseXOnCanvas=e.clientX-t.left,this._draggedMouseYOnCanvas=e.clientY-t.top,this._deltaMouseXOnCanvas=this._draggedMouseXOnCanvas-this._clickedMouseXOnCanvas,this._deltaMouseYOnCanvas=this._draggedMouseYOnCanvas-this._clickedMouseYOnCanvas,this._isMouseDrag=!0}_mouseUp(e){this._isMouseDown=!1,this._isMouseDrag=!1;const t=e.target;if(null==(null==t?void 0:t.getBoundingClientRect))return;const n=t.getBoundingClientRect();this._clickedMouseXOnCanvas=e.clientX-n.left,this._clickedMouseYOnCanvas=e.clientY-n.top}tryReset(){}reset(){this._isKeyDown=!1,this._lastKeyCode=-1,this._currentPos.zero(),this._currentCenter.setComponents(0,0,-1),this._currentDir.setComponents(0,0,-1),this._currentHorizontalDir.setComponents(0,0,-1),this._isMouseDown=!1,this._isMouseDrag=!1,this._draggedMouseXOnCanvas=-1,this._draggedMouseYOnCanvas=-1,this._deltaMouseXOnCanvas=-1,this._deltaMouseYOnCanvas=-1,this._mouseXAdjustScale=this._turnSpeed,this._mouseYAdjustScale=this._turnSpeed,this._deltaY=0,this._deltaX=0,this._newDir.setComponents(0,0,-1)}logic(e){this.__updateCameraComponent(e)}__updateCameraComponent(e){const t=this.__targetEntity.getSceneGraph().worldAABB;if(this._needInitialize&&null!=t){const n=t.lengthCenterToCorner*(1+1/Math.tan(c.k.degreeToRadian(e.fovy/2)));this._currentPos.copyComponents(t.centerPoint),this._currentPos.z+=n,this._currentCenter.copyComponents(t.centerPoint),this._currentDir.setComponents(0,0,-1);const o=e.entity.tryToGetSceneGraph();if(_.Is.exist(o)){const e=i.J.invertTo(o.matrixInner,u.__tmpInvMat);e.multiplyVector3To(this._currentPos,this._currentPos),e.multiplyVector3To(this._currentCenter,this._currentCenter)}this._needInitialize=!1}const n=this._deltaY/90;this._newDir.x=this._currentDir.x*(1-n),this._newDir.y=n,this._newDir.z=this._currentDir.z*(1-n),this._newDir.normalize(),this._currentHorizontalDir.x=this._currentDir.x,this._currentHorizontalDir.y=0,this._currentHorizontalDir.z=this._currentDir.z,this._currentHorizontalDir.normalize();const o=u.__tmp_Vec3_0.zero();switch(this._lastKeyCode){case 87:case 38:o.x=this._currentHorizontalDir.x*this._horizontalSpeed,o.z=this._currentHorizontalDir.z*this._horizontalSpeed;break;case 65:case 37:o.x=this._currentHorizontalDir.z*this._horizontalSpeed,o.z=-this._currentHorizontalDir.x*this._horizontalSpeed;break;case 83:case 40:o.x=-this._currentHorizontalDir.x*this._horizontalSpeed,o.z=-this._currentHorizontalDir.z*this._horizontalSpeed;break;case 68:case 39:o.x=-this._currentHorizontalDir.z*this._horizontalSpeed,o.z=this._currentHorizontalDir.x*this._horizontalSpeed;break;case 81:o.x=-this._newDir.x*this._horizontalSpeed,o.y=-this._newDir.y*this._horizontalSpeed,o.z=-this._newDir.z*this._horizontalSpeed;break;case 69:o.x=this._newDir.x*this._horizontalSpeed,o.y=this._newDir.y*this._horizontalSpeed,o.z=this._newDir.z*this._horizontalSpeed;break;case 82:o.y=this._verticalSpeed;break;case 70:o.y=-this._verticalSpeed}if(this._currentPos.add(o),this._currentCenter.add(o),this._isMouseDrag){this._inverseHorizontalRotating?this._deltaX=this._deltaMouseXOnCanvas*this._mouseXAdjustScale:this._deltaX=-this._deltaMouseXOnCanvas*this._mouseXAdjustScale,this._inverseVerticalRotating?this._deltaY+=this._deltaMouseYOnCanvas*this._mouseYAdjustScale:this._deltaY+=-this._deltaMouseYOnCanvas*this._mouseYAdjustScale,this._deltaY=Math.max(-120,Math.min(50,this._deltaY));const e=u.__tmpRotateMat.rotateY(c.k.degreeToRadian(this._deltaX));e.multiplyVectorTo(this._currentDir,this._currentDir);const t=a.d6.subtractTo(this._currentCenter,this._currentPos,u.__tmp_Vec3_1);e.multiplyVectorTo(t,t),t.x=t.x*(1-n),t.y=n,t.z=t.z*(1-n),t.normalize(),this._currentCenter.copyComponents(this._currentPos),this._currentCenter.add(t),this._clickedMouseXOnCanvas=this._draggedMouseXOnCanvas,this._clickedMouseYOnCanvas=this._draggedMouseYOnCanvas,this._deltaMouseXOnCanvas=0,this._deltaMouseYOnCanvas=0}e.eyeInner=this._currentPos,e.directionInner=this._currentCenter,e.upInner=e._up,e.leftInner=e.left,e.rightInner=e.right,e.topInner=e.top,e.bottomInner=e.bottom,e.fovyInner=e.fovy,this._calcZNearInner(e,this._currentPos,this._newDir),this._calcZFarInner(e)}getDirection(){return null!==this._currentCenter?this._newDir.clone():null}set horizontalSpeed(e){this._horizontalSpeed=e}get horizontalSpeed(){return this._horizontalSpeed}set verticalSpeed(e){this._verticalSpeed=e}get verticalSpeed(){return this._verticalSpeed}set mouseWheelSpeed(e){this._mouseWheelSpeedScale=e}get mouseWheelSpeed(){return this._mouseWheelSpeedScale}setTarget(e){const t=e.tryToGetSceneGraph().worldAABB.lengthCenterToCorner/10;this.verticalSpeed=t,this.horizontalSpeed=t,this.__targetEntity=e,this._needInitialize=!0}getTarget(){return this.__targetEntity}get allInfo(){const e={};return e.verticalSpeed=this.verticalSpeed,e.horizontalSpeed=this.horizontalSpeed,e._turnSpeed=this._turnSpeed,this._currentPos&&(e._currentPos=this._currentPos.clone()),this._currentCenter&&(e._currentCenter=this._currentCenter.clone()),this._currentDir&&(e._currentDir=this._currentDir.clone()),e._deltaY=this._deltaY,e._newDir=this._newDir.clone(),e}set allInfo(e){let t=e;"string"==typeof e&&(t=JSON.parse(e));for(const e in t)t.hasOwnProperty(e)&&e in this&&(this[e]="quaternion"===e?o.D.cloneOfMathObjects(o.D.arrayToQuaternion(t[e])):o.D.cloneOfMathObjects(o.D.arrayToVectorOrMatrix(t[e])))}}u.__tmpInvMat=s.e.identity(),u.__tmpRotateMat=r.x.identity(),u.__tmp_Vec3_0=a.d6.zero(),u.__tmp_Vec3_1=a.d6.zero()},1564:(e,t,n)=>{"use strict";n.d(t,{c:()=>S});var i=n(9721),o=n(2404),a=n(1350),r=n(4710),s=n(3498),l=n(6692),c=n(4507),_=n(6098),h=n(8827),u=n(9207),d=n(2471),m=n(4690),f=n(8107),p=n(6456),v=n(7305),A=n(3991);function y(e,t,n){const i=n;return t.sampler.interpolationMethod===v.k.CubicSpline?4===t.sampler.outputComponentN?i[A.hx](3*t.sampler.outputComponentN*e+t.sampler.outputComponentN):3===t.sampler.outputComponentN?i[A.Up](3*t.sampler.outputComponentN*e+t.sampler.outputComponentN):1===t.sampler.outputComponentN?i[A.w0](3*t.sampler.outputComponentN*e+t.sampler.outputComponentN):i[A.fK](3*t.sampler.outputComponentN*e+t.sampler.outputComponentN,t.sampler.outputComponentN):4===t.sampler.outputComponentN?i[A.JI](e):3===t.sampler.outputComponentN?i[A.Dq](e):1===t.sampler.outputComponentN?i[A.GW](e):i[A.lx](e,t.sampler.outputComponentN)}function x(e,t){let n=0,i=0,o=e.length-1,a=0;for(;i<=o&&t>=e[i]&&t<=e[o];)if(n=Math.floor(i+(t-e[i])*(o-i)/(e[o]-e[i])),e[n].5?0===this.__isEffekseerState&&(null===(e=this.__effekseerComponent)||void 0===e||e.play()):1===this.__isEffekseerState&&(null===(t=this.__effekseerComponent)||void 0===t||t.pause()),this.__isEffekseerState=r[0])}}if(m.Is.exist(this.__secondActiveAnimationTrackName)&&this.__interpolationRatioBtwFirstAndSecond>0){const e=this.__animationTracks.get(this.__secondActiveAnimationTrackName);if(void 0!==e)for(const[t,i]of e){const e=s.s.fromString(t).index,o=g(i,n,e);if(e===s.s.Quaternion.index){const e=u._.fromCopyArray4(o);this.__transformComponent.localRotation=u._.qlerp(this.__transformComponent.localRotationInner,e,this.__interpolationRatioBtwFirstAndSecond)}else if(e===s.s.Translate.index){const e=d.P.fromCopyArray3(o);this.__transformComponent.localPosition=d.P.lerp(this.__transformComponent.localPositionInner,e,this.__interpolationRatioBtwFirstAndSecond)}else if(e===s.s.Scale.index){const e=d.P.fromCopyArray3(o);this.__transformComponent.localScale=d.P.lerp(this.__transformComponent.localScaleInner,e,this.__interpolationRatioBtwFirstAndSecond)}else if(e===s.s.Weights.index){const e=o;for(let t=0;t{const t=new Map;return this.__animationTracks.set(e,t),t}}),l={sampler:{input:n,output:i,outputComponentN:o,interpolationMethod:a},target:{pathName:t,entity:this.entity},belongTrackName:e};s.set(t,l);const c=n[0],h=n[n.length-1],u={name:e,minStartInputTime:c,maxEndInputTime:h};S.__animationGlobalInfo.set(e,u),S.__pubsub.publishAsync(S.Event.ChangeAnimationInfo,{infoMap:new Map(S.__animationGlobalInfo)}),this.entity.getTransform()._backupTransformAsRest()}getStartInputValueOfAnimation(e){const t=null!=e?e:this.__firstActiveAnimationTrackName;if(void 0===t){const e=Array.from(S.__animationGlobalInfo.values());return 0===e.length?0:e[0].maxEndInputTime}return(0,_.kS)({value:S.__animationGlobalInfo.get(t),defaultValue:b}).minStartInputTime}getEndInputValueOfAnimation(e){const t=null!=e?e:this.__firstActiveAnimationTrackName;if(void 0===t){const e=Array.from(S.__animationGlobalInfo.values());return 0===e.length?0:e[0].maxEndInputTime}return(0,_.kS)({value:S.__animationGlobalInfo.get(t),defaultValue:b}).maxEndInputTime}static getAnimationList(){return Array.from(this.__animationGlobalInfo.keys())}static getAnimationInfo(){return new Map(this.__animationGlobalInfo)}getAnimationTrackNames(){return Array.from(this.__animationTracks.keys())}getAnimationChannelsOfTrack(e){return this.__animationTracks.get(e)}get isAnimating(){return this.__isAnimating}static get startInputValue(){if(0===o.C.getComponentsWithType(S).length)return 0;{const e=Array.from(this.__animationGlobalInfo.values());return e[e.length-1].minStartInputTime}}static get endInputValue(){if(0===o.C.getComponentsWithType(S).length)return 0;{const e=Array.from(this.__animationGlobalInfo.values());return e[e.length-1].maxEndInputTime}}static get componentTID(){return r.z.AnimationComponentTID}get componentTID(){return r.z.AnimationComponentTID}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getAnimation(){return this.getComponentByComponentTID(r.z.AnimationComponentTID)}}return(0,a.e)(e,n),e}addKeyFrame(e,t,n,i){const o=n/i,a=o,r=(n+1)/i,l=this.__animationTracks.get(e);if(m.Is.not.exist(l))return!1;const c=l.get(t);if(m.Is.not.exist(c))return!1;ArrayBuffer.isView(c.sampler.input)&&(c.sampler.input=Array.from(c.sampler.input)),ArrayBuffer.isView(c.sampler.output)&&(c.sampler.output=Array.from(c.sampler.output));const _=s.s.fromString(t).index,h=g(c,S.globalTime,_);if(0===c.sampler.input.length)c.sampler.input.push(a),c.sampler.output.push(...h);else if(1===c.sampler.input.length){const e=c.sampler.input[0];r{"use strict";n.d(t,{x:()=>l});var i=n(9721),o=n(2404),a=n(1350),r=n(4710),s=n(4507);class l extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__weights=[],this.__targetNames=[],this.moveStageTo(s.I.Logic)}static get componentTID(){return r.z.BlendShapeComponentTID}get componentTID(){return r.z.BlendShapeComponentTID}set weights(e){this.__weights=e}get weights(){return this.__weights}set targetNames(e){this.__targetNames=e}get targetNames(){return this.__targetNames}setWeightByIndex(e,t){this.__weights[e]=t}$logic(){}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getBlendShape(){return this.getComponentByComponentTID(r.z.BlendShapeComponentTID)}}return(0,a.e)(e,n),e}}o.C.registerComponentClass(l)},224:(e,t,n)=>{"use strict";n.d(t,{M:()=>w});var i=n(2404),o=n(9721),a=n(1350),r=n(4710),s=n(2471),l=n(7192),c=n(9646),_=n(5467),h=n(8491),u=n(752),d=n(3999),m=n(3496),f=n(4507),p=n(4536),v=n(9190),A=n(6477),y=n(3258),x=n(7348),g=n(4587),I=n(3032),b=n(2251),E=n(4690),T=n(5634),S=n(8430),C=n(7683);class w extends o.w{constructor(e,t,n,i){if(super(e,t,n,i),this._eyeInner=v.d6.dummy(),this._direction=v.d6.dummy(),this._directionInner=v.d6.dummy(),this._up=v.d6.dummy(),this._upInner=v.d6.dummy(),this._filmWidth=36,this._filmHeight=24,this._focalLength=20,this.primitiveMode=!1,this._corner=p.xQ.dummy(),this._cornerInner=p.xQ.dummy(),this._parameters=p.xQ.dummy(),this._parametersInner=p.xQ.dummy(),this.__type=c.i.Perspective,this._projectionMatrix=m.e.dummy(),this.__isProjectionMatrixUpToDate=!1,this._viewMatrix=m.e.dummy(),this.__isViewMatrixUpToDate=!1,this._xrLeft=!1,this._xrRight=!1,this.isSyncToLight=!1,this.__frustum=new A.i,this._setMaxNumberOfComponent(Math.max(10,Math.floor(y.D.maxEntityNumber/100))),this.setFovyAndChangeFocalLength(90),-1===w.current&&(w.current=t),this.registerMember(u.$.CPUGeneric,"eyeInner",v.d6,d.r.Float,[0,0,0]),this.registerMember(u.$.CPUGeneric,"direction",v.d6,d.r.Float,[0,0,-1]),this.registerMember(u.$.CPUGeneric,"up",v.d6,d.r.Float,[0,1,0]),this.registerMember(u.$.CPUGeneric,"directionInner",v.d6,d.r.Float,[0,0,-1]),this.registerMember(u.$.CPUGeneric,"upInner",v.d6,d.r.Float,[0,1,0]),this.registerMember(u.$.CPUGeneric,"corner",p.xQ,d.r.Float,[-1,1,1,-1]),this.registerMember(u.$.CPUGeneric,"cornerInner",p.xQ,d.r.Float,[-1,1,1,-1]),this.registerMember(u.$.CPUGeneric,"parameters",p.xQ,d.r.Float,[.1,1e4,90,1]),this.registerMember(u.$.CPUGeneric,"parametersInner",p.xQ,d.r.Float,[.1,1e4,90,1]),this.registerMember(u.$.CPUGeneric,"projectionMatrix",m.e,d.r.Float,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.registerMember(u.$.CPUGeneric,"viewMatrix",m.e,d.r.Float,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.submitToAllocation(y.D.maxCameraNumber,i),i)return;const o=x.$.getInstance();o.takeOne(g.f5.ViewMatrix),o.takeOne(g.f5.ProjectionMatrix),o.takeOne(g.f5.ViewPosition)}static set current(e){this.__current=e}static get current(){return this.__current}set type(e){this.__type=e,e===c.i.Orthographic?(this._parameters.z=1,this._parameters.w=1,this._parametersInner.z=1,this._parametersInner.w=1):(this.setFovyAndChangeFocalLength(90),this._parameters.w=1,this._parametersInner.z=90,this._parametersInner.w=1)}get type(){return this.__type}get eye(){return w._eye}set eye(e){throw Error("In Rhodonite, eye is always (0,0,0). Use TransformComponent for Camera positioning.")}get eyeInner(){return this._eyeInner}set eyeInner(e){this._eyeInner.copyComponents(e)}set upInner(e){this._upInner.copyComponents(e)}set up(e){this._up.copyComponents(e)}get up(){return this._up.clone()}get upInner(){return this._upInner}set direction(e){const t=this._direction,n=e,i=this._up;let o;if(0===v.d6.crossTo(n,i,w.__tmpVector3_0).length()){const e=v.d6.crossTo(t,i,w.__tmpVector3_1);o=v.d6.crossTo(e,n,w.__tmpVector3_2)}else{const e=v.d6.multiplyTo(n,n.dot(i),w.__tmpVector3_1);o=v.d6.subtractTo(i,e,w.__tmpVector3_2)}this._up.copyComponents(o).normalize(),this._direction.copyComponents(n)}set directionInner(e){this._directionInner.copyComponents(e)}get direction(){return this._direction.clone()}get directionInner(){return this._directionInner}set corner(e){this._corner.copyComponents(e)}get corner(){return this._corner.clone()}set left(e){this._corner.x=e}set leftInner(e){this._cornerInner.x=e}get left(){return this._corner.x}set right(e){this._corner.y=e}set rightInner(e){this._cornerInner.y=e}get right(){return this._corner.y}set top(e){this._corner.z=e}set topInner(e){this._cornerInner.z=e}get top(){return this._corner.z}set bottom(e){this._corner.w=e}set bottomInner(e){this._cornerInner.w=e}get bottom(){return this._corner.w}set cornerInner(e){this._cornerInner.copyComponents(e)}get cornerInner(){return this._cornerInner}set parametersInner(e){this._parametersInner.copyComponents(e)}get parametersInner(){return this._parametersInner}get parameters(){return this._parameters.clone()}set zNear(e){this._parameters.x=e}set zNearInner(e){this._parametersInner.x=e}get zNearInner(){return this._parametersInner.x}get zNear(){return this._parameters.x}set focalLength(e){this._focalLength=e,this._parameters.z=2*I.k.radianToDegree(Math.atan(this._filmHeight/(2*e)))}get focalLength(){return this._focalLength}set zFar(e){this._parameters.y=e}set zFarInner(e){this._parametersInner.y=e}get zFarInner(){return this._parametersInner.y}get zFar(){return this._parameters.y}setFovyAndChangeFilmSize(e){this._parameters.z=e,this._filmHeight=2*this.focalLength*Math.tan(I.k.degreeToRadian(e)/2),this._filmWidth=this._filmHeight*this.aspect}setFovyAndChangeFocalLength(e){this._parameters.z=e,this._focalLength=this._filmHeight/2/Math.tan(I.k.degreeToRadian(e)/2)}get fovy(){return this._parameters.z}set fovyInner(e){this._parametersInner.z=e}set aspect(e){this._parameters.w=e,this._filmWidth=this._filmHeight*e}set aspectInner(e){this._parametersInner.w=e}get aspectInner(){return this._parametersInner.w}get aspect(){return this._parameters.w}set xMag(e){this._parameters.z=e}get xMag(){return this._parameters.z}set yMag(e){this._parameters.w=e}get yMag(){return this._parameters.w}static get componentTID(){return r.z.CameraComponentTID}get componentTID(){return r.z.CameraComponentTID}calcProjectionMatrix(){const e=this._parametersInner.x,t=this._parametersInner.y;if(S.l.currentProcessApproach===C.V.WebGPU)if(this.type===c.i.Perspective){const n=this._parametersInner.z,i=this._parametersInner.w,o=1/Math.tan(.5*n*Math.PI/180),a=o/i;if(this._projectionMatrix.m00=a,this._projectionMatrix.m01=0,this._projectionMatrix.m02=0,this._projectionMatrix.m03=0,this._projectionMatrix.m10=0,this._projectionMatrix.m11=o,this._projectionMatrix.m12=0,this._projectionMatrix.m13=0,this._projectionMatrix.m20=0,this._projectionMatrix.m21=0,t===1/0){const n=1/(e-t);this._projectionMatrix.m22=t*n,this._projectionMatrix.m23=t*e*n}else this._projectionMatrix.m22=-1,this._projectionMatrix.m23=-e;this._projectionMatrix.m30=0,this._projectionMatrix.m31=0,this._projectionMatrix.m32=-1,this._projectionMatrix.m33=0}else if(this.type===c.i.Orthographic){const n=this._parametersInner.z,i=this._parametersInner.w;this._projectionMatrix.setComponents(1/n,0,0,0,0,1/i,0,0,0,0,-1/(t-e),-e/(t-e),0,0,0,1)}else{const n=this._cornerInner.x,i=this._cornerInner.y,o=this._cornerInner.z,a=this._cornerInner.w,r=1/(e-t);this._projectionMatrix.setComponents(2*e/(i-n),0,(i+n)/(i-n),0,0,2*e/(o-a),(o+a)/(o-a),0,0,0,t*r,t*e*r,0,0,-1,0)}else if(this.type===c.i.Perspective){const n=this._parametersInner.z,i=this._parametersInner.w,o=1/Math.tan(.5*n*Math.PI/180),a=o/i;if(this._projectionMatrix.m00=a,this._projectionMatrix.m01=0,this._projectionMatrix.m02=0,this._projectionMatrix.m03=0,this._projectionMatrix.m10=0,this._projectionMatrix.m11=o,this._projectionMatrix.m12=0,this._projectionMatrix.m13=0,this._projectionMatrix.m20=0,this._projectionMatrix.m21=0,t===1/0){const n=1/(e-t);this._projectionMatrix.m22=(t+e)*n,this._projectionMatrix.m23=2*t*e*n}else this._projectionMatrix.m22=-1,this._projectionMatrix.m23=-2*e;this._projectionMatrix.m30=0,this._projectionMatrix.m31=0,this._projectionMatrix.m32=-1,this._projectionMatrix.m33=0}else if(this.type===c.i.Orthographic){const n=this._parametersInner.z,i=this._parametersInner.w;this._projectionMatrix.setComponents(1/n,0,0,0,0,1/i,0,0,0,0,-2/(t-e),-(t+e)/(t-e),0,0,0,1)}else{const n=this._cornerInner.x,i=this._cornerInner.y,o=this._cornerInner.z,a=this._cornerInner.w,r=1/(e-t);this._projectionMatrix.setComponents(2*e/(i-n),0,(i+n)/(i-n),0,0,2*e/(o-a),(o+a)/(o-a),0,0,0,(t+e)*r,2*t*e*r,0,0,-1,0)}return this._projectionMatrix}calcViewMatrix(){const e=this.eyeInner,t=v.d6.subtractTo(this._directionInner,e,w.__tmpVector3_0).normalize(),n=v.d6.crossTo(t,this._upInner,w.__tmpVector3_1).normalize(),i=v.d6.crossTo(n,t,w.__tmpVector3_2);if(this._viewMatrix.setComponents(n.x,n.y,n.z,-s.P.dot(n,e),i.x,i.y,i.z,-s.P.dot(i,e),-t.x,-t.y,-t.z,s.P.dot(t,e),0,0,0,1),!this.primitiveMode){const e=m.e.invertTo(this.__sceneGraphComponent.matrixInner,w.__tmpMatrix44_0);this._viewMatrix.multiply(e)}return this._viewMatrix}get viewMatrix(){return this._viewMatrix}set viewMatrix(e){this._viewMatrix.copyComponents(e)}get projectionMatrix(){if(this._xrLeft||this._xrRight){const e=b.x.getInstance().getModule("xr");if(null==e?void 0:e.WebXRSystem.getInstance().isWebXRMode){const t=e.WebXRSystem.getInstance();if(this._xrLeft)return t.leftProjectionMatrix;if(this._xrRight)return t.rightProjectionMatrix}}return this._projectionMatrix}set projectionMatrix(e){this._projectionMatrix.copyComponents(e)}get viewProjectionMatrix(){return m.e.multiplyTo(this._projectionMatrix,this._viewMatrix,w.__tmpMatrix44_0)}get biasViewProjectionMatrix(){return m.e.multiplyTo(this._projectionMatrix,this._viewMatrix,w.__tmpMatrix44_0),m.e.multiplyTo(w.__biasMatrix,w.__tmpMatrix44_0,w.__tmpMatrix44_1)}setValuesToGlobalDataRepositoryOnlyMatrices(){w.__globalDataRepository.setValue(g.f5.ViewMatrix,this.componentSID,this.viewMatrix),w.__globalDataRepository.setValue(g.f5.ProjectionMatrix,this.componentSID,this.projectionMatrix)}setValuesToGlobalDataRepository(){w.__globalDataRepository.setValue(g.f5.ViewMatrix,this.componentSID,this.viewMatrix),w.__globalDataRepository.setValue(g.f5.ProjectionMatrix,this.componentSID,this.projectionMatrix),w.__globalDataRepository.setValue(g.f5.ViewPosition,this.componentSID,this.worldPosition)}get worldPosition(){var e;return null===(e=this.__sceneGraphComponent)||void 0===e||e.matrixInner.multiplyVector3To(this.eyeInner,w.returnVector3),w.returnVector3}updateFrustum(){this.__frustum.update(this.viewMatrix,this.projectionMatrix)}get frustum(){return this.__frustum}$create(){this.__sceneGraphComponent=a.g.getComponentOfEntity(this.__entityUid,h.a),this.moveStageTo(f.I.Logic)}$logic({renderPass:e}){const t=this.entity.tryToGetLight();if(this.isSyncToLight&&E.Is.exist(t)){if(this._eyeInner.copyComponents(w._eye),this._directionInner.copyComponents(this._direction),this._upInner.copyComponents(this._up),t.type===T.v.Spot)this.type=c.i.Perspective,this.setFovyAndChangeFilmSize(I.k.radianToDegree(t.outerConeAngle)),this._cornerInner.copyComponents(this._corner),this.aspect=1,this.zNear=.1,this.zFar=-1!==t.range?t.range:1e4,this._parametersInner.copyComponents(this._parameters);else if(t.type===T.v.Directional){this.type=c.i.Orthographic;const e=t.shadowAreaSizeForDirectionalLight;this._cornerInner.copyComponents(l.Lt.fromCopy4(-e,e,e,-e)),this.aspect=1,this.zNear=.1,this.zFar=-1!==t.range?t.range:100,this._parametersInner.copyComponents(this._parameters)}}else{const e=this.entity.tryToGetCameraController();E.Is.exist(e)?this._parametersInner.w=this._parameters.w:this.primitiveMode||(this._eyeInner.copyComponents(w._eye),this._directionInner.copyComponents(this._direction),this._upInner.copyComponents(this._up),this._cornerInner.copyComponents(this._corner),this._parametersInner.copyComponents(this._parameters))}this.calcViewMatrix(),this._xrLeft||this._xrRight||this.calcProjectionMatrix(),this.setValuesToGlobalDataRepository()}static getCurrentCameraEntity(){return i.C.getComponent(this,this.current).entity}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getCamera(){return this.getComponentByComponentTID(r.z.CameraComponentTID)}}return(0,a.e)(e,n),e}}w._eye=s.P.zero(),w.__current=-1,w.returnVector3=v.d6.zero(),w.__globalDataRepository=x.$.getInstance(),w.__tmpVector3_0=v.d6.zero(),w.__tmpVector3_1=v.d6.zero(),w.__tmpVector3_2=v.d6.zero(),w.__tmpMatrix44_0=m.e.zero(),w.__tmpMatrix44_1=m.e.zero(),w.__biasMatrix=_.J.fromCopy16ColumnMajor(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1),i.C.registerComponentClass(w)},5496:(e,t,n)=>{"use strict";n.d(t,{S:()=>u});var i=n(9721),o=n(1350),a=n(224),r=n(4507),s=n(2404),l=n(4710),c=n(6547),_=n(4478),h=n(8914);class u extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__cameraController=new c.j}set type(e){this.__cameraController.unregisterEventListeners(),e===h.M.Orbit?this.__cameraController=new c.j:e===h.M.WalkThrough?this.__cameraController=new _.I:console.warn("Not support type!")}get type(){return this.__cameraController instanceof c.j?h.M.Orbit:h.M.WalkThrough}get controller(){return this.__cameraController}static get componentTID(){return l.z.CameraControllerComponentTID}get componentTID(){return l.z.CameraControllerComponentTID}$create(){this.__cameraComponent=o.g.getComponentOfEntity(this.__entityUid,a.M),this.moveStageTo(r.I.Logic)}$logic(){this.__cameraController&&this.__cameraController.logic(this.__cameraComponent)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getCameraController(){return this.getComponentByComponentTID(l.z.CameraControllerComponentTID)}}return(0,o.e)(e,n),e}}s.C.registerComponentClass(u)},6683:(e,t,n)=>{"use strict";n.d(t,{r:()=>A});var i=n(2404),o=n(9721),a=n(1350),r=n(4710),s=n(5634),l=n(2471),c=n(8491),_=n(4507),h=n(3258),u=n(7348),d=n(4587),m=n(4536),f=n(4255),p=n(6128),v=n(4690);class A extends o.w{constructor(e,t,n,i){super(e,t,n,i),this.type=s.v.Point,this.__intensity=l.P.fromCopyArray([1,1,1]),this.__initialDirection=l.P.fromCopyArray([0,0,-1]),this.__direction=l.P.fromCopyArray([0,0,-1]),this.innerConeAngle=0,this.outerConeAngle=Math.PI/4,this.range=-1,this.enable=!0,this.shadowAreaSizeForDirectionalLight=10,this._setMaxNumberOfComponent(Math.max(10,Math.floor(h.D.maxEntityNumber/100)))}static get componentTID(){return r.z.LightComponentTID}get componentTID(){return r.z.LightComponentTID}get direction(){return this.__direction}set intensity(e){this.__intensity=e}get intensity(){return this.__intensity}get _up(){return l.P.fromCopy3(0,1,0)}set isLightGizmoVisible(e){e?(v.Is.not.defined(this.__lightGizmo)&&(this.__lightGizmo=new p.SU(this.entity),this.__lightGizmo._setup()),this.__lightGizmo.isVisible=!0):v.Is.defined(this.__lightGizmo)&&(this.__lightGizmo.isVisible=!1)}get isLightGizmoVisible(){return!!v.Is.defined(this.__lightGizmo)&&this.__lightGizmo.isVisible}$create(){this.__sceneGraphComponent=a.g.getComponentOfEntity(this.__entityUid,c.a),this.moveStageTo(_.I.Load)}$load(){const e=i.C.getComponentsWithType(A);A.__globalDataRepository.getValue(d.f5.CurrentComponentSIDs,0)._v[r.z.LightComponentTID]=e.length,A.__lightPositions=A.__globalDataRepository.getValue(d.f5.LightPosition,0),A.__lightDirections=A.__globalDataRepository.getValue(d.f5.LightDirection,0),A.__lightIntensities=A.__globalDataRepository.getValue(d.f5.LightIntensity,0),A.__lightProperties=A.__globalDataRepository.getValue(d.f5.LightProperty,0),this.moveStageTo(_.I.Logic)}__updateGizmo(){v.Is.defined(this.__lightGizmo)&&this.__lightGizmo.isSetup&&this.isLightGizmoVisible&&this.__lightGizmo._update()}$logic(){this.__direction=this.__sceneGraphComponent.normalMatrixInner.multiplyVector(this.__initialDirection);const e=1/Math.max(.001,Math.cos(this.innerConeAngle)-Math.cos(this.outerConeAngle)),t=-Math.cos(this.outerConeAngle)*e;A.__lightDirections._v[3*this.componentSID+0]=this.__direction.x,A.__lightDirections._v[3*this.componentSID+1]=this.__direction.y,A.__lightDirections._v[3*this.componentSID+2]=this.__direction.z;const n=this.__sceneGraphComponent.worldPosition;A.__lightPositions._v[3*this.componentSID+0]=n.x,A.__lightPositions._v[3*this.componentSID+1]=n.y,A.__lightPositions._v[3*this.componentSID+2]=n.z,A.__lightIntensities._v[3*this.componentSID+0]=this.__intensity.x,A.__lightIntensities._v[3*this.componentSID+1]=this.__intensity.y,A.__lightIntensities._v[3*this.componentSID+2]=this.__intensity.z,A.__lightProperties._v[4*this.componentSID+0]=this.enable?this.type.index:-1,A.__lightProperties._v[4*this.componentSID+1]=this.range,A.__lightProperties._v[4*this.componentSID+2]=e,A.__lightProperties._v[4*this.componentSID+3]=t,this.__updateGizmo()}_destroy(){super._destroy(),A.__lightIntensities._v[3*this.componentSID+0]=0,A.__lightIntensities._v[3*this.componentSID+1]=0,A.__lightIntensities._v[3*this.componentSID+2]=0}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getLight(){return this.getComponentByComponentTID(r.z.LightComponentTID)}}return(0,a.e)(e,n),e}}A.__globalDataRepository=u.$.getInstance(),A.__tmp_vec4=m.xQ.zero(),A.__lightPositions=new f.j(new Float32Array(0)),A.__lightDirections=new f.j(new Float32Array(0)),A.__lightIntensities=new f.j(new Float32Array(0)),A.__lightProperties=new f.j(new Float32Array(0)),i.C.registerComponentClass(A)},4097:(e,t,n)=>{"use strict";n.d(t,{$:()=>A});var i=n(2404),o=n(9721),a=n(1350),r=n(4710),s=n(4507),l=n(2471),c=n(7192),_=n(8491),h=n(5467),u=n(3496),d=n(8547),m=n(9190),f=n(4690),p=n(6456),v=n(6098);class A extends o.w{constructor(e,t,n,i){super(e,t,n,i),this.__viewDepth=-Number.MAX_VALUE,this.isPickable=!0,this.moveStageTo(s.I.Create)}static get componentTID(){return r.z.MeshComponentTID}get componentTID(){return r.z.MeshComponentTID}setMesh(e){this.__mesh=e,e._belongToMeshComponent(this)}unsetMesh(){return null!=this.__mesh&&(this.__mesh=void 0,!0)}get mesh(){return this.__mesh}calcViewDepth(e){if(f.Is.not.exist(this.__mesh))return Number.MAX_VALUE;const t=this.__mesh.AABB.centerPoint,n=this.entity.tryToGetSkeletal();f.Is.exist(n)&&f.Is.exist(n._bindShapeMatrix)&&n._bindShapeMatrix.multiplyVector3To(this.__mesh.AABB.centerPoint,t);const i=this.entity.getSceneGraph().matrixInner.multiplyVector3To(t,A.__tmpVector3_0),o=e.viewMatrix.multiplyVector3To(i,A.__tmpVector3_1);return this.__viewDepth=o.z,this.__viewDepth}get viewDepth(){return this.__viewDepth}static alertNoMeshSet(e){console.debug("No mesh is set on this MeshComponent:"+e.componentSID)}castRay(e,t,n=0){if(this.__mesh){let i=e,o=t;if(this.__sceneGraphComponent){const a=h.J.invert(this.__sceneGraphComponent.matrixInner);i=l.P.fromCopyVector4(a.multiplyVector(c.Lt.fromCopyVector3(e)));const r=l.P.add(e,t),s=l.P.fromCopyVector4(a.multiplyVector(c.Lt.fromCopyVector3(r)));o=l.P.normalize(l.P.subtract(s,i));const _=this.__mesh.castRay(i,o,n);let u=null;if(f.Is.defined(_.data)&&_.data.t>=0)return u=l.P.fromCopyVector4(this.__sceneGraphComponent.matrixInner.multiplyVector(c.Lt.fromCopyVector3(_.data.position))),{result:!0,data:{t:_.data.t,u:_.data.u,v:_.data.v,position:u}}}}return{result:!1}}castRayFromScreenInLocal(e,t,n,i,o=0){if(this.__mesh&&this.__sceneGraphComponent){const a=u.e.multiplyTo(n.projectionMatrix,n.viewMatrix,A.__tmpMatrix44_0).multiply(this.__sceneGraphComponent.matrixInner).invert(),r=d.D.unProjectTo(e,t,0,a,i,A.__tmpVector3_0),s=d.D.unProjectTo(e,t,1,a,i,A.__tmpVector3_1),l=m.d6.subtractTo(s,r,A.__tmpVector3_2).normalize(),c=this.__mesh.castRay(r,l,o);if(f.Is.defined(c.data)&&c.data.t>=0)return{result:!0,data:{t:c.data.t,u:c.data.u,v:c.data.v,position:c.data.position}}}return{result:!1}}castRayFromScreenInWorld(e,t,n,i,o=0){const a=this.castRayFromScreenInLocal(e,t,n,i,o);if(this.__mesh&&this.__sceneGraphComponent&&a.result){(0,v.dK)(a.data);const e=this.__sceneGraphComponent.matrixInner.multiplyVector3To(a.data.position,A.__returnVector3);return{result:!0,data:{t:a.data.t,u:a.data.u,v:a.data.v,position:e}}}return a}$create(){this.__blendShapeComponent=a.g.getComponentOfEntity(this.__entityUid,p.x),this.__sceneGraphComponent=a.g.getComponentOfEntity(this.__entityUid,_.a),this.moveStageTo(s.I.Load)}static common_$load({processApproach:e}){const t=i.C.getComponentsWithType(A);for(const e of t){const t=e.mesh;if(!f.Is.exist(t))continue;const n=t.getPrimitiveNumber();for(let i=0;i0&&this.__mesh._calcBaryCentricCoord(),this.moveStageTo(s.I.Logic))}$logic(){}_shallowCopyFrom(e){const t=e;this.__viewDepth=t.__viewDepth,f.Is.exist(t.__mesh)&&this.setMesh(t.__mesh),this.isPickable=t.isPickable}_destroy(){this.__mesh&&(this.__mesh=void 0)}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getMesh(){return this.getComponentByComponentTID(r.z.MeshComponentTID)}}return(0,a.e)(e,n),e}}A.__tmpVector3_0=m.d6.zero(),A.__tmpVector3_1=m.d6.zero(),A.__tmpVector3_2=m.d6.zero(),A.__returnVector3=m.d6.zero(),A.__tmpMatrix44_0=u.e.zero(),A.__latestPrimitivePositionAccessorVersion=0,i.C.registerComponentClass(A)},9974:(e,t,n)=>{"use strict";n.d(t,{Y:()=>m});var i=n(2404),o=n(9721),a=n(4097),r=n(7683),s=n(4507),l=n(1350),c=n(4710),_=n(224),h=n(2251),u=n(4339),d=n(4327);class m extends o.w{constructor(e,t,n,i){super(e,t,n,i),this.diffuseCubeMapContribution=1,this.specularCubeMapContribution=1,this.rotationOfCubeMap=0,this._readyForRendering=!1}static get componentTID(){return c.z.MeshRendererComponentTID}get componentTID(){return c.z.MeshRendererComponentTID}$create(){this.__meshComponent=l.g.getComponentOfEntity(this.__entityUid,a.$),this.moveStageTo(s.I.Load)}static common_$load({processApproach:e}){const t=h.x.getInstance();if(e===r.V.WebGPU){const e="webgpu",n=t.getModule(e);m.__webglRenderingStrategy=n.WebGpuStrategyBasic.getInstance()}else{const n="webgl",i=t.getModule(n);m.__webglRenderingStrategy=i.getRenderingStrategy(e)}}$load(){m.__webglRenderingStrategy.$load(this.__meshComponent),this.diffuseCubeMap&&!this.diffuseCubeMap.startedToLoad&&this.diffuseCubeMap.loadTextureImagesAsync(),this.specularCubeMap&&!this.specularCubeMap.startedToLoad&&this.specularCubeMap.loadTextureImagesAsync()}static common_$prerender(){m.__webglRenderingStrategy.common_$prerender()}static sort_$render(e){return m.sort_$render_inner(e)}static sort_$render_inner(e){let t=e.cameraComponent;null==t&&(t=i.C.getComponent(_.M,_.M.current));let n=[];const o=e.meshComponents;n=m.__cullingWithViewFrustum(t,o,e),n=Array.from(new Set(n)),n.sort(((e,t)=>{const n=e._sortkey-t._sortkey;return 0===n?e._viewDepth-t._viewDepth:n}));const a=n.map((e=>e.primitiveUid));a.push(-1),m._lastOpaqueIndex=n.length-1,m._lastTransparentIndex=-1,m._firstTransparentSortKey=-1,m._lastTransparentSortKey=-1;for(let e=0;e>i&1){m._lastOpaqueIndex=e-1,m._firstTransparentSortKey=t._sortkey;break}}return n.length>0&&(m._lastTransparentIndex=n.length-1,m._lastTransparentSortKey=n[n.length-1]._sortkey),a}static __cullingWithViewFrustum(e,t,n){let i=[];if(e&&m.isViewFrustumCullingEnabled){e.updateFrustum();const n=e.frustum,o=(e,t)=>{if("background-assets"===e.entity.getTagValue("type")||n.culling(e)){t.push(e),e.entity.getSceneGraph()._isCulled=!1;const n=e.entity.tryToGetSkeletal();void 0!==n&&(n._isCulled=!1)}else{e.entity.getSceneGraph()._isCulled=!0;const t=e.entity.tryToGetSkeletal();void 0!==t&&(t._isCulled=!0)}};for(const e of t)o(e,i)}else i=n.meshComponents;const o=[];for(let t=0;t{"use strict";n.d(t,{Z:()=>c});var i=n(9721),o=n(2404),a=n(1350),r=n(4710),s=n(4507),l=n(7431);class c extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.moveStageTo(s.I.Logic)}static get componentTID(){return r.z.PhysicsComponentTID}get componentTID(){return r.z.PhysicsComponentTID}setStrategy(e){this.__strategy=e}get strategy(){return this.__strategy}static common_$logic(){l.q.update()}$logic(){var e;null===(e=this.__strategy)||void 0===e||e.update()}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getPhysics(){return this.getComponentByComponentTID(r.z.PhysicsComponentTID)}}return(0,a.e)(e,n),e}}o.C.registerComponentClass(c)},8491:(e,t,n)=>{"use strict";n.d(t,{a:()=>b});var i=n(2404),o=n(9721),a=n(5467),r=n(1350),s=n(3999),l=n(4710),c=n(752),_=n(4507),h=n(3496),u=n(2566),d=n(2471),m=n(2477),f=n(9190),p=n(817),v=n(7326),A=n(4690),y=n(9244),x=n(7859),g=n(4020),I=n(7431);class b extends o.w{constructor(e,t,n,i){super(e,t,n,i),this.__children=[],this.__gizmoChildren=[],this._worldMatrix=h.e.dummy(),this._worldMatrixRest=h.e.dummy(),this._normalMatrix=u.x.dummy(),this.__isWorldMatrixUpToDate=!1,this.__isWorldMatrixRestUpToDate=!1,this.__isNormalMatrixUpToDate=!1,this.__tmpMatrix=h.e.identity(),this.__worldAABB=new m.m,this.__isWorldAABBDirty=!0,this._isVisible=g.DU.dummy(),this._isBillboard=g.DU.dummy(),this.__transformGizmoSpace="world",this.__latestPrimitivePositionAccessorVersion=0,this.toMakeWorldMatrixTheSameAsLocalMatrix=!1,this.isRootJoint=!1,this.jointIndex=-1,this._isCulled=!1,b.__sceneGraphs.push(this),this.registerMember(c.$.GPUInstanceData,"worldMatrix",h.e,s.r.Float,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.registerMember(c.$.GPUInstanceData,"normalMatrix",u.x,s.r.Float,[1,0,0,0,1,0,0,0,1]),this.registerMember(c.$.GPUInstanceData,"isVisible",g.DU,s.r.Float,[1]),this.registerMember(c.$.GPUInstanceData,"isBillboard",g.DU,s.r.Float,[0]),this.submitToAllocation(this.maxNumberOfComponent,i)}set isVisible(e){this._isVisible.setValue(e?1:0)}get isVisible(){return 1===this._isVisible.getValue()}setVisibilityRecursively(e){this.isVisible=e;for(const t of this.__children)t.setVisibilityRecursively(e)}set isBillboard(e){this._isBillboard.setValue(e?1:0)}get isBillboard(){return 1===this._isBillboard.getValue()}setIsBillboardRecursively(e){this._isBillboard.setValue(e?1:0);for(const t of this.__children)t.isBillboard=e}set isAABBGizmoVisible(e){e?(A.Is.not.defined(this.__aabbGizmo)&&(this.__aabbGizmo=new p.q(this.entity),this.__aabbGizmo._setup()),this.__aabbGizmo.isVisible=!0):A.Is.exist(this.__aabbGizmo)&&(this.__aabbGizmo.isVisible=!1)}get isAABBGizmoVisible(){return!!A.Is.exist(this.__aabbGizmo)&&this.__aabbGizmo.isVisible}set isLocatorGizmoVisible(e){e?(A.Is.not.defined(this.__locatorGizmo)&&(this.__locatorGizmo=new v.k(this.entity),this.__locatorGizmo._setup()),this.__locatorGizmo.isVisible=!0):A.Is.exist(this.__locatorGizmo)&&(this.__locatorGizmo.isVisible=!1)}get isLocatorGizmoVisible(){return!!A.Is.exist(this.__locatorGizmo)&&this.__locatorGizmo.isVisible}set isTranslationGizmoVisible(e){e?(A.Is.not.defined(this.__translationGizmo)&&(this.__translationGizmo=new y.u(this.entity),this.__translationGizmo._setup()),this.__translationGizmo.isVisible=!0):A.Is.exist(this.__translationGizmo)&&(this.__translationGizmo.isVisible=!1)}get isTranslationGizmoVisible(){return!!A.Is.exist(this.__translationGizmo)&&this.__translationGizmo.isVisible}set isScaleGizmoVisible(e){e?(A.Is.not.defined(this.__scaleGizmo)&&(this.__scaleGizmo=new x.q(this.entity),this.__scaleGizmo._setup()),this.__scaleGizmo.isVisible=!0):A.Is.exist(this.__scaleGizmo)&&(this.__scaleGizmo.isVisible=!1)}get isScaleGizmoVisible(){return!!A.Is.exist(this.__scaleGizmo)&&this.__scaleGizmo.isVisible}static getTopLevelComponents(){return b.__sceneGraphs.filter((e=>e.isTopLevel))}isJoint(){return this.jointIndex>=0}static get componentTID(){return l.z.SceneGraphComponentTID}get componentTID(){return l.z.SceneGraphComponentTID}setWorldMatrixRestDirty(){this.matrixRestInner,this.setWorldMatrixRestDirtyRecursively()}setWorldMatrixRestDirtyRecursively(){this.__isWorldMatrixRestUpToDate=!1,this.children.forEach((e=>{e.setWorldMatrixRestDirtyRecursively()}))}setWorldMatrixDirty(){var e;this.setWorldMatrixDirtyRecursively(),null===(e=this.parent)||void 0===e||e.setWorldAABBDirtyParentRecursively()}setWorldMatrixDirtyRecursively(){this.__isWorldMatrixUpToDate=!1,this.__isNormalMatrixUpToDate=!1,this.__isWorldAABBDirty=!0,this.children.forEach((e=>{e.setWorldMatrixDirtyRecursively()}))}setWorldAABBDirtyParentRecursively(){var e;this.__isWorldAABBDirty=!0,null===(e=this.parent)||void 0===e||e.setWorldAABBDirtyParentRecursively()}addChild(e){A.Is.exist(e.__parent)&&e.__parent.removeChild(e),e.__parent=this,this.__children.push(e)}removeChild(e){const t=this.__children.indexOf(e);t>=0&&this.__children.splice(t,1),e.__parent=void 0}_addGizmoChild(e){e.__parent=this,this.__gizmoChildren.push(e)}get isTopLevel(){return null==this.__parent}get children(){return this.__children}get parent(){return this.__parent}get matrixInner(){return this.__isWorldMatrixUpToDate||(this._worldMatrix.copyComponents(this.__calcWorldMatrixRecursively()),this.__isWorldMatrixUpToDate=!0),this._worldMatrix}get matrix(){return this.matrixInner.clone()}get matrixRestInner(){return this.__isWorldMatrixRestUpToDate||(this._worldMatrixRest.copyComponents(this.__calcWorldMatrixRestRecursively()),this.__isWorldMatrixRestUpToDate=!0),this._worldMatrix}get matrixRest(){return this.matrixRestInner.clone()}get normalMatrixInner(){return this.__isNormalMatrixUpToDate||(a.J.invertTo(this.matrixInner,b.invertedMatrix44),this._normalMatrix.copyComponents(b.invertedMatrix44.transpose()),this.__isNormalMatrixUpToDate=!0),this._normalMatrix}get entityWorldMatrix(){return this.entityWorldMatrixInner.clone()}get entityWorldMatrixInner(){const e=this.entity.tryToGetSkeletal();return A.Is.exist(e)&&e.isWorldMatrixUpdated?e.worldMatrixInner:this.entity.getSceneGraph().matrixInner}get normalMatrix(){return this.normalMatrixInner.clone()}isWorldMatrixUpToDateRecursively(){return!!this.__isWorldMatrixUpToDate&&(!this.__parent||this.__parent.isWorldMatrixUpToDateRecursively())}__calcWorldMatrixRecursively(){if(this.__isWorldMatrixUpToDate)return this._worldMatrix;const e=r.g.getEntity(this.__entityUid).getTransform();if(null==this.__parent||this.toMakeWorldMatrixTheSameAsLocalMatrix)return e.localMatrixInner;const t=this.__parent.__calcWorldMatrixRecursively();return h.e.multiplyTo(t,e.localMatrixInner,this.__tmpMatrix)}__calcWorldMatrixRestRecursively(){if(this.__isWorldMatrixRestUpToDate)return this._worldMatrixRest;const e=r.g.getEntity(this.__entityUid).getTransform();if(null==this.__parent||this.toMakeWorldMatrixTheSameAsLocalMatrix)return e.localMatrixRestInner;const t=this.__parent.__calcWorldMatrixRestRecursively();return h.e.multiplyTo(t,e.localMatrixRestInner,this.__tmpMatrix)}getQuaternionRecursively(){if(A.Is.not.exist(this.parent))return this.entity.getTransform().localRotation;const e=this.parent.getQuaternionRecursively();return g._f.multiply(e,this.entity.getTransform().localRotation)}static flattenHierarchy(e,t){const n=[];t&&!e.isJoint()||n.push(e);const i=e.children;for(let e=0;e{var t;return null===(t=e.parent)||void 0===t?void 0:t.removeChild(e)}))}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getSceneGraph(){return void 0===this.__sceneGraphComponent&&(this.__sceneGraphComponent=this.getComponentByComponentTID(l.z.SceneGraphComponentTID)),this.__sceneGraphComponent}get parent(){return this.getSceneGraph().parent}get matrix(){return this.getSceneGraph().matrix}get matrixInner(){return this.getSceneGraph().matrixInner}get position(){return this.getSceneGraph().position}set position(e){this.getSceneGraph().position=e}get positionRest(){return this.getSceneGraph().positionRest}get scale(){return this.getSceneGraph().scale}set scale(e){this.getSceneGraph().scale=e}get eulerAngles(){return this.getSceneGraph().eulerAngles}set eulerAngles(e){this.getSceneGraph().eulerAngles=e}get rotation(){return this.getSceneGraph().rotation}set rotation(e){this.getSceneGraph().rotation=e}get rotationRest(){return this.getSceneGraph().rotationRest}addChild(e){this.getSceneGraph().addChild(e)}get children(){return this.getSceneGraph().children}removeChild(e){this.getSceneGraph().removeChild(e)}}return(0,r.e)(e,n),e}}b.__originVector3=d.P.zero(),b.returnVector3=f.d6.zero(),b.__sceneGraphs=[],b.isJointAABBShouldBeCalculated=!1,b.invertedMatrix44=h.e.fromCopyArray16ColumnMajor([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),b.__tmpAABB=new m.m,i.C.registerComponentClass(b)},5684:(e,t,n)=>{"use strict";n.d(t,{G:()=>a});var i=n(4020),o=n(4690);class a{constructor(e){this.__srcEntity=e}getSrcPGRestQ(e){let t;const n=e.getSceneGraph().parent;return t=o.Is.exist(n)?n.getRotationRest((e=>{const t=e.parent;if(o.Is.exist(t)){const e=t.entity.tryToGetVrm();return o.Is.exist(e)}return!0})):i._f.identity(),t}getDstPGRestQ(e){let t;const n=e.getSceneGraph().parent;return t=o.Is.exist(n)?n.getRotationRest((e=>{const t=e.parent;if(o.Is.exist(t)){const e=t.entity.tryToGetVrm();return o.Is.exist(e)}return!0})):i._f.identity(),t}retargetQuaternion(e){const t=this.__srcEntity,n=t.getTransform().localRotationInner,o=t.getTransform().localRotationRestInner,r=this.getSrcPGRestQ(t),s=i._f.multiply(r,i._f.multiply(n,i._f.multiply(i._f.invert(o),i._f.invert(r)))),l=e.getTransform().localRotationRestInner,c=this.getDstPGRestQ(e),_=i._f.multiply(i._f.invert(c),i._f.multiply(s,i._f.multiply(c,l)));return i._f.multiply(i._f.multiply(a.__rev,_),i._f.invert(a.__rev))}retargetTranslate(e){const t=this.__srcEntity,n=t.getTransform().localPositionInner,o=t.getTransform().localPositionRestInner,r=this.getSrcPGRestQ(t),s=i.P.subtract(n,o),l=r.transformVector3(s),c=e.getTransform().localPositionRestInner,_=this.getDstPGRestQ(e),h=i.P.add(_.transformVector3Inverse(l),c);if(t.uniqueName.indexOf("hips")>=0){const e=i.P.multiply(h,t.parent.scale.x);return a.__rev.transformVector3(e)}return h}retargetScale(e){return this.__srcEntity.getTransform().localScaleInner}}a.__rev=i._f.fromAxisAngle(i.P.fromCopy3(0,1,0),Math.PI)},1656:(e,t,n)=>{"use strict";n.d(t,{Y:()=>y});var i=n(2404),o=n(9721),a=n(1350),r=n(4710),s=n(5467),l=n(4507),c=n(9190),_=n(963),h=n(3032),u=n(4536),d=n(3496),m=n(4587),f=n(7348),p=n(3258),v=n(1226),A=n(2253);class y extends o.w{constructor(e,t,n,i){super(e,t,n,i),this._jointIndices=[],this.__joints=[],this.isSkinning=!0,this.__qArray=new Float32Array(0),this.__tsArray=new Float32Array(0),this.__tqArray=new Float32Array(0),this.__sqArray=new Float32Array(0),this.__qtsArray=new Float32Array(0),this.__qtsInfo=u.xQ.dummy(),this.__matArray=new Float32Array(0),this.__worldMatrix=d.e.identity(),this.__isWorldMatrixVanilla=!0,this._isCulled=!1,this.moveStageTo(l.I.Logic),i||(y.__tookGlobalDataNumMath.abs(t.y)?Math.abs(t.x)>Math.abs(t.z)?t.x:t.z:Math.abs(t.y)>Math.abs(t.z)?t.y:t.z,this.__tsArray[4*e+3]=n}if(p.D.boneDataType===v.N.Vec4x2){const o=h.k.packNormalizedVec4ToVec2(i.x,i.y,i.z,i.w,Math.pow(2,12));this.__tqArray[4*e+0]=n.m03,this.__tqArray[4*e+1]=n.m13,this.__tqArray[4*e+2]=n.m23,this.__sqArray[4*e+0]=t.x,this.__sqArray[4*e+1]=t.y,this.__sqArray[4*e+2]=t.z,this.__tqArray[4*e+3]=o[0],this.__sqArray[4*e+3]=o[1]}else p.D.boneDataType===v.N.Vec4x2Old&&(this.__tsArray[4*e+0]=n.m03,this.__tsArray[4*e+1]=n.m13,this.__tsArray[4*e+2]=n.m23,this.__qArray[4*e+0]=i.x,this.__qArray[4*e+1]=i.y,this.__qArray[4*e+2]=i.z,this.__qArray[4*e+3]=i.w);if(p.D.boneDataType===v.N.Vec4x1){this.__tsArray[4*e+0]=n.m03,this.__tsArray[4*e+1]=n.m13,this.__tsArray[4*e+2]=n.m23;const t=h.k.packNormalizedVec4ToVec2(i.x,i.y,i.z,i.w,Math.pow(2,12));this.__qtsArray[4*e+0]=t[0],this.__qtsArray[4*e+1]=t[1]}}}if(p.D.boneDataType===v.N.Vec4x1){let e=1,t=1,n=1;for(let i=0;ie&&(e=o);const a=Math.abs(this.__tsArray[4*i+1]);a>t&&(t=a);const r=Math.abs(this.__tsArray[4*i+2]);r>n&&(n=r)}this.__qtsInfo.x=e,this.__qtsInfo.y=t,this.__qtsInfo.z=n,this.__qtsInfo.w=1;for(let i=0;i{"use strict";n.d(t,{U:()=>h});var i=n(9721),o=n(2404),a=n(1350),r=n(4710),s=n(4507),l=n(9190),c=n(4020),_=n(2253);class h extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__pose=new c.WQ,this.__updateCountAtLastLogic=0,this.moveStageTo(s.I.Create)}$create(){this.__sceneGraphComponent=this.entity.tryToGetSceneGraph(),this.moveStageTo(s.I.Logic)}static get renderedPropertyCount(){return null}static get componentTID(){return r.z.TransformComponentTID}get componentTID(){return r.z.TransformComponentTID}get restOrPose(){return void 0!==this.__rest?this.__rest:this.__pose}_backupTransformAsRest(){void 0===this.__rest&&(this.__rest=this.__pose.clone(),this.entity.tryToGetSceneGraph().setWorldMatrixRestDirty())}_restoreTransformFromRest(){void 0!==this.__rest&&this.__pose.setTransform(this.__rest.positionInner,l.d6.fromCopyVector3(this.__rest.eulerAnglesInner),this.__rest.scaleInner,c.yG.fromCopyQuaternion(this.__rest.rotationInner),this.__rest.matrixInner)}get localTransform(){return this.__pose}set localTransform(e){this.__pose.setTransform(e.positionInner,l.d6.fromCopyVector3(e.eulerAnglesInner),e.scaleInner,c.yG.fromCopyQuaternion(e.rotationInner),e.matrixInner)}get localTransformRest(){return this.restOrPose}set localTransformRest(e){_.Is.undefined(this.__rest)&&(this.__rest=new c.WQ),this.__rest.setTransform(e.positionInner,l.d6.fromCopyVector3(e.eulerAnglesInner),e.scaleInner,c.yG.fromCopyQuaternion(e.rotationInner),e.matrixInner)}set localPosition(e){this.__pose.position=e}get localPosition(){return this.__pose.position}get localPositionInner(){return this.__pose.positionInner}set localPositionRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.position=e}get localPositionRest(){return this.restOrPose.position}get localPositionRestInner(){return this.restOrPose.positionInner}set localEulerAngles(e){this.__pose.eulerAngles=e}get localEulerAngles(){return this.__pose.eulerAngles}get localEulerAnglesInner(){return this.__pose.eulerAnglesInner}set localEulerAnglesRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.eulerAngles=e}get localEulerAnglesRest(){return this.restOrPose.eulerAngles}get localEulerAnglesRestInner(){return this.restOrPose.eulerAnglesInner}set localScale(e){this.__pose.scale=e}get localScale(){return this.__pose.scale}get localScaleInner(){return this.__pose.scaleInner}set localScaleRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.scale=e}get localScaleRest(){return this.restOrPose.scale}get localScaleRestInner(){return this.restOrPose.scaleInner}set localRotation(e){this.__pose.rotation=e}get localRotation(){return this.__pose.rotation}get localRotationInner(){return this.__pose.rotationInner}set localRotationRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.rotation=e}get localRotationRest(){return this.restOrPose.rotation}get localRotationRestInner(){return this.restOrPose.rotationInner}set localMatrix(e){this.__pose.matrix=e}get localMatrix(){return this.__pose.matrix}get localMatrixInner(){return this.__pose.matrixInner}set localMatrixRest(e){_.Is.undefined(this.__rest)&&(this.__rest=this.__pose.clone()),this.__rest.matrix=e}get localMatrixRest(){return this.restOrPose.matrix}get localMatrixRestInner(){return this.restOrPose.matrixInner}$logic(){this.__updateCountAtLastLogic!==this.__pose.updateCount&&(this.__sceneGraphComponent.setWorldMatrixDirty(),this.__updateCountAtLastLogic=this.__pose.updateCount)}_shallowCopyFrom(e){const t=e;this.__pose=t.__pose.clone(),null!=t.__rest&&(this.__rest=t.__rest.clone()),this.__updateCountAtLastLogic=t.__updateCountAtLastLogic}get entity(){return a.g.getEntity(this.__entityUid)}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getTransform(){return void 0===this.__transformComponent&&(this.__transformComponent=this.getComponentByComponentTID(r.z.TransformComponentTID)),this.__transformComponent}set localPosition(e){this.getTransform().localPosition=e}get localPosition(){return this.localPositionInner.clone()}get localPositionInner(){return this.getTransform().localPositionInner}set localPositionRest(e){this.getTransform().localPositionRest=e}get localPositionRest(){return this.getTransform().localPositionRest}get localPositionRestInner(){return this.getTransform().localPositionRestInner}set localScale(e){this.getTransform().localScale=e}get localScale(){return this.localScaleInner.clone()}get localScaleInner(){return this.getTransform().localScaleInner}set localScaleRest(e){this.getTransform().localScaleRest=e}get localScaleRest(){return this.getTransform().localScaleRest}get localScaleRestInner(){return this.getTransform().localScaleRestInner}set localEulerAngles(e){this.getTransform().localEulerAngles=e}get localEulerAngles(){return this.localEulerAnglesInner.clone()}get localEulerAnglesInner(){return this.getTransform().localEulerAnglesInner}set localEulerAnglesRest(e){this.getTransform().localEulerAnglesRest=e}get localEulerAnglesRest(){return this.localEulerAnglesRestInner.clone()}get localEulerAnglesRestInner(){return this.getTransform().localEulerAnglesRestInner}set localRotation(e){this.getTransform().localRotation=e}get localRotation(){return this.localRotationInner.clone()}get localRotationInner(){return this.getTransform().localRotationInner}set localRotationRest(e){this.getTransform().localRotationRest=e}get localRotationRest(){return this.localQuaternionRestInner.clone()}get localRotationRestInner(){return this.getTransform().localRotationRestInner}set localMatrix(e){this.getTransform().localMatrix=e}get localMatrix(){return this.localMatrixInner.clone()}get localMatrixInner(){return this.getTransform().localMatrixInner}set localMatrixRest(e){this.getTransform().localMatrixRest=e}get localMatrixRest(){return this.localMatrixRestInner.clone()}get localMatrixRestInner(){return this.getTransform().localMatrixRestInner}}return(0,a.e)(e,n),e}}o.C.registerComponentClass(h)},605:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var i=n(9721),o=n(2404),a=n(1350),r=n(4507),s=n(2253),l=n(4710);class c extends i.w{constructor(e,t,n,i){super(e,t,n,i),this.__expressions=new Map,this.__weights=new Map,this._version="",this.moveStageTo(r.I.Logic)}static get componentTID(){return l.z.VrmComponentTID}get componentTID(){return l.z.VrmComponentTID}setVrmExpressions(e){for(const t of e)this.__expressions.set(t.name,t),this.__weights.set(t.name,0)}setExpressionWeight(e,t){const n=this.__expressions.get(e);if(!s.Is.not.exist(n)){this.__weights.set(e,t);for(const e of n.binds){const n=a.g.getEntity(e.entityIdx).tryToGetBlendShape();s.Is.exist(n)&&n.setWeightByIndex(e.blendShapeIdx,t)}}}getExpressionWeight(e){return this.__weights.get(e)}getExpressionNames(){return Array.from(this.__expressions.keys())}addThisComponentToEntity(e,t){class n extends e.constructor{constructor(e,t,n){super(e,t,n)}getVrm(){return void 0===this.__vrmComponent&&(this.__vrmComponent=this.getComponentByComponentTID(l.z.VrmComponentTID)),this.__vrmComponent}}return(0,a.e)(e,n),e}}o.C.registerComponentClass(c)},4710:(e,t,n)=>{"use strict";n.d(t,{z:()=>i});const i=Object.freeze({AnimationComponentTID:1,TransformComponentTID:2,SceneGraphComponentTID:3,MeshComponentTID:4,MeshRendererComponentTID:5,LightComponentTID:6,CameraControllerComponentTID:7,CameraComponentTID:8,SkeletalComponentTID:9,BlendShapeComponentTID:10,PhysicsComponentTID:11,EffekseerComponentTID:12,VrmComponentTID:13,ConstraintComponentTID:14,maxWellKnownTidNumber:14})},1409:(e,t,n)=>{"use strict";n.d(t,{l:()=>v,cw:()=>i.c,xT:()=>a.x,My:()=>r.M,SP:()=>s.S,B5:()=>f,GZ:()=>p.G,r0:()=>l.r,$t:()=>c.$,YZ:()=>_.Y,Ze:()=>h.Z,aj:()=>u.a,Yb:()=>A.Y,Uv:()=>y.U,ZA:()=>x.Z,zz:()=>g.z,vA:()=>o});var i=n(1564);const o="Default";var a=n(6456),r=n(224),s=n(5496),l=n(6683),c=n(4097),_=n(9974),h=n(3826),u=n(8491),d=n(4020),m=n(4690);class f{constructor(e){this.__srcEntity=e}getSrcPGRestQ(e){let t;const n=e.getSceneGraph().parent;return t=m.Is.exist(n)?n.getRotationRest((e=>{const t=e.parent;if(m.Is.exist(t)){const e=t.entity.tryToGetVrm();return m.Is.exist(e)}return!0})):d._f.identity(),t}getDstPGRestQ(e){let t;const n=e.getSceneGraph().parent;return t=m.Is.exist(n)?n.getRotationRest((e=>{const t=e.parent;if(m.Is.exist(t)){const e=t.entity.tryToGetVrm();return m.Is.exist(e)}return!0})):d._f.identity(),t}retargetQuaternion(e){const t=this.__srcEntity,n=t.getTransform().localRotationInner,i=t.getTransform().localRotationRestInner,o=this.getSrcPGRestQ(t),a=d._f.multiply(o,d._f.multiply(n,d._f.multiply(d._f.invert(i),d._f.invert(o)))),r=e.getTransform().localRotationRestInner,s=this.getDstPGRestQ(e);return d._f.multiply(d._f.invert(s),d._f.multiply(a,d._f.multiply(s,r)))}retargetTranslate(e){const t=this.__srcEntity,n=t.getTransform().localPositionInner,i=t.getTransform().localPositionRestInner,o=this.getSrcPGRestQ(t),a=d.P.subtract(n,i),r=o.transformVector3(a),s=e.getTransform().localPositionRestInner,l=this.getDstPGRestQ(e),c=d.P.add(l.transformVector3Inverse(r),s);return t.uniqueName.indexOf("hips")>=0?d.P.multiply(c,t.parent.scale.x):c}retargetScale(e){return this.__srcEntity.getTransform().localScaleInner}}var p=n(5684);class v{constructor(e){this.__srcEntity=e}retargetQuaternion(e){return this.__srcEntity.getTransform().localRotationInner}retargetTranslate(e){return this.__srcEntity.getTransform().localPositionInner}retargetScale(e){return this.__srcEntity.getTransform().localScaleInner}}var A=n(1656),y=n(6692),x=n(605),g=n(4710)},9721:(e,t,n)=>{"use strict";n.d(t,{w:()=>c});var i=n(9286),o=n(1350),a=n(4507),r=n(2404),s=n(3258),l=n(9002);class c extends l.S{constructor(e,t,n,o){super(),this._isAlive=!0,this.__currentProcessStage=a.I.Create,this.__byteOffsetOfThisComponent=-1,this.__maxComponentNumber=s.D.maxEntityNumber,this.__entityUid=e,this._component_sid=t,c._processStages.forEach((e=>{this.isExistProcessStageMethod(e)&&null==c.__componentsOfProcessStages.get(e)&&(c.__componentsOfProcessStages.set(e,new Int32Array(s.D.maxEntityNumber)),c.__lengthOfArrayOfProcessStages.set(e,0))})),this.__memoryManager=i.B.getInstance(),this.__entityRepository=n}moveStageTo(e){this.__currentProcessStage=e}_setMaxNumberOfComponent(e){this.__maxComponentNumber=e}get maxNumberOfComponent(){return this.__maxComponentNumber}static get componentTID(){return 0}get componentTID(){return 0}get componentSID(){return this._component_sid}get entityUID(){return this.__entityUid}get currentProcessStage(){return this.__currentProcessStage}static doesTheProcessStageMethodExist(e,t){return null!=e.prototype[t.methodName]}isExistProcessStageMethod(e){return null!=this[e.methodName]}static process({componentType:e,processStage:t,processApproach:n,strategy:i,renderPass:o,renderPassTickCount:a}){if(!c.doesTheProcessStageMethodExist(e,t))return;const s=t.methodName,l=this.__componentsOfProcessStages.get(t),_=r.C._getComponentsIncludingDead(e);for(let e=0;e{o.set(e.bufferUse,[])})),i.forEach((e=>{o.get(e.bufferUse).push(e)}));for(const e of o.keys()){const t=o.get(e);c.__byteLengthSumOfMembers.has(n)||c.__byteLengthSumOfMembers.set(n,new Map);const i=c.__byteLengthSumOfMembers.get(n);i.has(e)||i.set(e,0),t.forEach((t=>{i.set(e,i.get(e)+t.compositionType.getNumberOfComponents()*t.componentType.getSizeInBytes())})),t.length}for(const i of o.keys())o.get(i).forEach((i=>{const o=c.takeAccessor(i.bufferUse,i.memberName,n,i.compositionType,i.componentType,e);t["_byteOffsetOfAccessorInBuffer_"+i.memberName]=o.byteOffsetInBuffer,t["_byteOffsetOfAccessorInComponent_"+i.memberName]=o.byteOffsetInBufferView}))}(this);const o=c.__members.get(n);for(const e of o.keys())o.get(e).forEach((e=>{this.takeOne(e.memberName,e.dataClassType,e.initValues,t,this._component_sid)}))}get entity(){return o.g.getEntity(this.__entityUid)}static getDataByteInfoInner(e,t){const n=e["_"+t]._v,i=n.byteOffset,o=n.byteLength,a=n.length,r=i/4/4;return{byteLength:o,byteOffsetInBuffer:i,byteOffsetInThisComponent:this["_byteOffsetOfAccessorInComponent_"+t]+e.componentSID*a*4,locationOffsetInBuffer:r,locationOffsetInThisComponent:this["_byteOffsetOfAccessorInComponent_"+t]+e.componentSID*a,thisComponentByteOffsetInBuffer:e.__byteOffsetOfThisComponent,thisComponentLocationOffsetInBuffer:e.__byteOffsetOfThisComponent/4/4,componentNumber:a}}getDataByteInfo(e){return c.getDataByteInfoInner(this,e)}static getDataByteInfoByComponentSID(e,t,n){const i=r.C.getComponent(e,t);if(i)return c.getDataByteInfoInner(i,n)}static getDataByteInfoByEntityUID(e,t,n){const i=o.g.getComponentOfEntity(t,e);if(i)return c.getDataByteInfoInner(i,n)}static getLocationOffsetOfMemberOfComponent(e,t){return r.C.getComponent(e,0)["_byteOffsetOfAccessorInBuffer_"+t]/4/4}addThisComponentToEntity(e,t){throw"Invalid Calling"}static getCompositionTypeOfMember(e,t){const n=this.__memberInfo.get(t).find((t=>t.memberName===e));return null!=n?n.compositionType:void 0}static getComponentTypeOfMember(e,t){const n=this.__memberInfo.get(t).find((t=>t.memberName===e));return null!=n?n.componentType:void 0}_destroy(){this._isAlive=!1}_shallowCopyFrom(e){}}c.invalidComponentSID=-1,c.__componentsOfProcessStages=new Map,c.__lengthOfArrayOfProcessStages=new Map,c.__bufferViews=new Map,c.__accessors=new Map,c.__byteLengthSumOfMembers=new Map,c.__memberInfo=new Map,c.__members=new Map,c._processStages=[a.I.Create,a.I.Load,a.I.Logic,a.I.PreRender,a.I.Render]},2404:(e,t,n)=>{"use strict";n.d(t,{C:()=>s});var i=n(9721),o=n(4690),a=n(3258),r=n(4710);class s{constructor(){}static registerComponentClass(e){s.__componentClasses.set(e.componentTID,e)}static deregisterComponentClass(e){s.__componentClasses.delete(e)}static getComponentClass(e){return this.__componentClasses.get(e)}static createComponent(e,t,n){const a=s.__componentClasses.get(e);if(o.Is.exist(a)){let r=this.__component_sid_count_map.get(e);o.Is.not.exist(r)&&(this.__component_sid_count_map.set(e,0),r=i.w.invalidComponentSID);const s=this.__components.get(e);let l=-1;if(o.Is.exist(s))for(let e=0;ee._isAlive))}static _getComponentsIncludingDead(e){return this.__components.get(e.componentTID)}static getMemoryBeginIndex(e){let t=0;for(let n=0;ne._isAlive))}static getComponentTIDs(){const e=Array.from(this.__components.keys());return e.sort(((e,t)=>e-t)),e}static getRenderingComponentTIDs(){const e=[];return this.__components.has(r.z.MeshRendererComponentTID)&&e.push(r.z.MeshRendererComponentTID),this.__components.has(r.z.EffekseerComponentTID)&&e.push(r.z.EffekseerComponentTID),e}}s.__component_sid_count_map=new Map,s.__components=new Map,s.__componentClasses=new Map},3258:(e,t,n)=>{"use strict";n.d(t,{D:()=>_});var i=n(1226),o=n(2253);let a=41,r=33,s=Math.pow(2,12),l=Math.pow(2,12),c=i.N.Mat43x1;"undefined"!=typeof navigator&&(o.Kf.isMobile()||o.Kf.isMobileVr())&&(a=4,r=32,s=512,l=512);const _={maxEntityNumber:5e3,maxLightNumberInShader:4,maxVertexMorphNumberInShader:a,maxMaterialInstanceForEachType:10,boneDataType:c,maxSkeletonNumber:r,maxCameraNumber:20,maxSizeLimitOfNonCompressedTexture:512,maxSkeletalBoneNumber:300,maxSkeletalBoneNumberForUniformMode:50,dataTextureWidth:s,dataTextureHeight:l,noWebGLTex2DStateCache:!1,maxMorphTargetNumber:4,totalSizeOfGPUShaderDataStorageExceptMorphData:0,isUboEnabled:!1,eventTargetDom:void 0}},1328:(e,t,n)=>{"use strict";n.d(t,{J:()=>r});var i=n(9002),o=n(4690),a=n(4710);class r extends i.S{constructor(e,t,n){super(),this._myLatestCopyEntityUID=r.invalidEntityUID,this.___entity_uid=e,this._isAlive=t,this.__components=o.Is.exist(n)?n:new Map}get entityUID(){return this.___entity_uid}_setComponent(e,t){this.__components.set(e.componentTID,t)}hasComponent(e){return this.__components.has(e.componentTID)}getComponent(e){return this.__components.get(e.componentTID)}getComponentByComponentTID(e){return this.__components.get(e)}_removeComponent(e){this.__components.delete(e)}tryToGetAnimation(){return this.getComponentByComponentTID(a.z.AnimationComponentTID)}tryToGetBlendShape(){return this.getComponentByComponentTID(a.z.BlendShapeComponentTID)}tryToGetCamera(){return this.getComponentByComponentTID(a.z.CameraComponentTID)}tryToGetCameraController(){return this.getComponentByComponentTID(a.z.CameraControllerComponentTID)}tryToGetLight(){return this.getComponentByComponentTID(a.z.LightComponentTID)}tryToGetMesh(){return this.getComponentByComponentTID(a.z.MeshComponentTID)}tryToGetMeshRenderer(){return this.getComponentByComponentTID(a.z.MeshRendererComponentTID)}tryToGetPhysics(){return this.getComponentByComponentTID(a.z.PhysicsComponentTID)}tryToGetSceneGraph(){return this.getComponentByComponentTID(a.z.SceneGraphComponentTID)}tryToGetSkeletal(){return this.getComponentByComponentTID(a.z.SkeletalComponentTID)}tryToGetTransform(){return this.getComponentByComponentTID(a.z.TransformComponentTID)}tryToGetVrm(){return this.getComponentByComponentTID(a.z.VrmComponentTID)}tryToGetConstraint(){return this.getComponentByComponentTID(a.z.ConstraintComponentTID)}_destroy(){this.__components.forEach((e=>{e._destroy()})),this._isAlive=!1}}r.invalidEntityUID=-1},1350:(e,t,n)=>{"use strict";n.d(t,{e:()=>c,g:()=>l});var i=n(1328),o=n(2404),a=n(6098),r=n(4690),s=n(4710);class l{constructor(){}static createEntity(){let e=-1;for(let t=0;tl.getEntity(e.entity._myLatestCopyEntityUID).tryToGetSceneGraph()));t.setJoints(e)}const i=e.tryToGetSceneGraph();r.Is.exist(i)&&i.children.forEach((e=>{l.__setJoints(e.entity)}))}static _shallowCopyEntityInner(e){const t=this.createEntity();t._tags=Object.assign({},e._tags),e._myLatestCopyEntityUID=t.entityUID;for(let n=1;n<=s.z.maxWellKnownTidNumber;n++){const i=e.getComponentByComponentTID(n);if(r.Is.exist(i)){this.tryToAddComponentToEntityByTID(n,t);const e=t.getComponentByComponentTID(n);r.Is.exist(e)&&e._shallowCopyFrom(i)}}return t}static __handleTagData(e){const t=e._tags;if(r.Is.exist(t)){const n=Object.keys(t);for(const t of n){if("rnEntities"===t){const t=e.getTagValue("rnEntities").map((e=>l.getEntity(e._myLatestCopyEntityUID)));e.tryToSetTag({tag:"rnEntities",value:t})}if("rnEntitiesByNames"===t){const t=e.getTagValue("rnEntitiesByNames");for(const e of Object.keys(t)){const n=t.get(e);t.set(e,l.getEntity(n._myLatestCopyEntityUID))}e.tryToSetTag({tag:"rnEntitiesByNames",value:t})}}}const n=e.tryToGetSceneGraph();r.Is.exist(n)&&n.children.forEach((e=>{l.__handleTagData(e.entity)}))}static tryToAddComponentToEntityByTID(e,t){const n=o.C.getComponentClass(e);return r.Is.not.exist(n)?t:this.addComponentToEntity(n,t)}static addComponentToEntity(e,t){if(t.hasComponent(e))return console.log("This entity already has the Component."),t;const n=o.C.createComponent(e.componentTID,t.entityUID,this);return(0,a.wv)({value:this._components[t.entityUID],compensation:()=>{const e=new Map;return this._components[t.entityUID]=e,e}}).set(e.componentTID,n),n.addThisComponentToEntity(t,e),t._setComponent(e,n),t}static removeComponentFromEntity(e,t){let n=this._components[t.entityUID];null==n&&(n=new Map,this._components[t.entityUID]=n);const i=n.get(e.componentTID);return r.Is.exist(i)&&(i._destroy(),n.delete(e.componentTID),t._removeComponent(e.componentTID)),t}static getEntity(e){return this.__entities[e]}static getComponentOfEntity(e,t){const n=this._components[e];let i=null;return null!=n?(i=n.get(t.componentTID),null!=i?i:null):i}static searchByTags(e){const t=[];for(const n of this.__entities)n.matchTags(e)&&t.push(n);return t}static getEntityByUniqueName(e){for(const t of this.__entities)if(t.uniqueName===e)return t}static _getEntities(){return this.__entities.filter((e=>e._isAlive))}static getEntitiesNumber(){return this.__entities.filter((e=>e._isAlive)).length}}function c(e,t){Object.getOwnPropertyNames(t.prototype).forEach((n=>{Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t.prototype,n)||Object.create(null))}))}l.__entity_uid_count=i.J.invalidEntityUID,l.__entities=[],l._components=[]},7348:(e,t,n)=>{"use strict";n.d(t,{$:()=>b});var i=n(4587),o=n(752),a=n(9286),r=n(810),s=n(3999),l=n(8547),c=n(7987),_=n(5324),h=n(4255),u=n(1813),d=n(3258),m=n(3616),f=n(7192),p=n(2471),v=n(3496),A=n(4710),y=n(1226),x=n(7683),g=n(1181),I=n(4020);class b{constructor(){this.__fields=new Map}initialize(e){const t={semantic:i.f5.CurrentComponentSIDs,compositionType:r.d.ScalarArray,componentType:s.r.Float,arrayLength:A.z.maxWellKnownTidNumber,stage:_.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,needUniformInDataTextureMode:!0,initialValue:new h.j(new Float32Array(A.z.maxWellKnownTidNumber))};this.__registerProperty(t,1),this.takeOne(i.f5.CurrentComponentSIDs);const n={semantic:i.f5.ViewMatrix,compositionType:r.d.Mat4,componentType:s.r.Float,stage:_.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,initialValue:v.e.identity()},o={semantic:i.f5.ProjectionMatrix,compositionType:r.d.Mat4,componentType:s.r.Float,stage:_.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,initialValue:v.e.identity()},a={semantic:i.f5.ViewPosition,compositionType:r.d.Vec3,componentType:s.r.Float,stage:_.H.VertexAndPixelShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:p.P.fromCopyArray([0,0,1])};this.__registerProperty(n,d.D.maxCameraNumber),this.__registerProperty(o,d.D.maxCameraNumber),this.__registerProperty(a,d.D.maxCameraNumber);const l=x.V.isUniformApproach(e)?d.D.maxSkeletalBoneNumberForUniformMode:d.D.maxSkeletalBoneNumber,c={semantic:i.f5.BoneMatrix,compositionType:r.d.Mat4x3Array,arrayLength:l,componentType:s.r.Float,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,soloDatum:!0,initialValue:new h.j(new Float32Array(0))},g={semantic:i.f5.BoneQuaternion,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,soloDatum:!0,initialValue:new h.j(new Float32Array(0))},b={semantic:i.f5.BoneTranslateScale,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,soloDatum:!0,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:new h.j(new Float32Array(0))},E={semantic:i.f5.BoneTranslatePackedQuat,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,soloDatum:!0,initialValue:new h.j(new Float32Array(0))},T={semantic:i.f5.BoneScalePackedQuat,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,soloDatum:!0,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:new h.j(new Float32Array(0))},S={semantic:i.f5.BoneCompressedChunk,compositionType:r.d.Vec4Array,arrayLength:l,componentType:s.r.Float,soloDatum:!0,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:new h.j(new Float32Array(0))},C={semantic:i.f5.BoneCompressedInfo,compositionType:r.d.Vec4,componentType:s.r.Float,soloDatum:!0,stage:_.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:f.Lt.zero()},w={semantic:i.f5.SkinningMode,compositionType:r.d.Scalar,componentType:s.r.Int,stage:_.H.VertexAndPixelShader,min:0,max:1,isCustomSetting:!0,updateInterval:u.a.EveryTime,initialValue:m.Ru.fromCopyNumber(-1)};d.D.boneDataType===y.N.Mat43x1?this.__registerProperty(c,d.D.maxSkeletonNumber):d.D.boneDataType===y.N.Vec4x2?(this.__registerProperty(E,d.D.maxSkeletonNumber),this.__registerProperty(T,d.D.maxSkeletonNumber)):d.D.boneDataType===y.N.Vec4x2Old?(this.__registerProperty(g,d.D.maxSkeletonNumber),this.__registerProperty(b,d.D.maxSkeletonNumber)):d.D.boneDataType===y.N.Vec4x1&&(this.__registerProperty(b,d.D.maxSkeletonNumber),this.__registerProperty(S,d.D.maxSkeletonNumber),this.__registerProperty(C,1),this.takeOne(i.f5.BoneCompressedInfo)),this.__registerProperty(w,1),this.takeOne(i.f5.SkinningMode);const R={semantic:i.f5.LightPosition,compositionType:r.d.Vec3Array,componentType:s.r.Float,stage:_.H.PixelShader,arrayLength:d.D.maxLightNumberInShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:u.a.EveryTime,initialValue:new h.j(new Float32Array(d.D.maxLightNumberInShader))},P={semantic:i.f5.LightDirection,compositionType:r.d.Vec3Array,componentType:s.r.Float,stage:_.H.PixelShader,arrayLength:d.D.maxLightNumberInShader,min:-1,max:1,isCustomSetting:!0,initialValue:new h.j(new Float32Array(d.D.maxLightNumberInShader)),updateInterval:u.a.EveryTime},M={semantic:i.f5.LightIntensity,compositionType:r.d.Vec3Array,componentType:s.r.Float,stage:_.H.PixelShader,arrayLength:d.D.maxLightNumberInShader,min:0,max:10,isCustomSetting:!0,initialValue:new h.j(new Float32Array(d.D.maxLightNumberInShader)),updateInterval:u.a.EveryTime},D={semantic:i.f5.LightProperty,compositionType:r.d.Vec4Array,componentType:s.r.Float,stage:_.H.PixelShader,arrayLength:d.D.maxLightNumberInShader,min:0,max:10,isCustomSetting:!0,initialValue:new h.j(new Float32Array(d.D.maxLightNumberInShader)),updateInterval:u.a.EveryTime};this.__registerProperty(R,1),this.__registerProperty(P,1),this.__registerProperty(M,1),this.__registerProperty(D,1),this.takeOne(i.f5.LightDirection),this.takeOne(i.f5.LightIntensity),this.takeOne(i.f5.LightPosition),this.takeOne(i.f5.LightProperty);const N={semantic:i.f5.LightNumber,compositionType:r.d.Scalar,componentType:s.r.Int,stage:_.H.VertexAndPixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isCustomSetting:!0,updateInterval:u.a.FirstTimeOnly,initialValue:m.Ru.fromCopyNumber(0)};this.__registerProperty(N,1),this.takeOne(i.f5.LightNumber);const B={semantic:i.f5.BackBufferTextureSize,compositionType:r.d.Vec2,componentType:s.r.Float,stage:_.H.PixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isCustomSetting:!0,needUniformInDataTextureMode:!0,updateInterval:u.a.EveryTime,initialValue:I.FM.fromCopy2(0,0)};this.__registerProperty(B,1),this.takeOne(i.f5.BackBufferTextureSize);const L={semantic:i.f5.VrState,compositionType:r.d.Vec2,componentType:s.r.Int,stage:_.H.PixelShader,min:0,max:Number.MAX_SAFE_INTEGER,isCustomSetting:!0,needUniformInDataTextureMode:!0,updateInterval:u.a.EveryTime,initialValue:I.FM.fromCopy2(0,0)};this.__registerProperty(L,1),this.takeOne(i.f5.VrState)}static getInstance(){return this.__instance||(this.__instance=new b),this.__instance}__registerProperty(e,t){const n=(0,g.V)(e),i=a.B.getInstance().createOrGetBuffer(o.$.GPUInstanceData),l=(0,g.K)(e),c=i.takeBufferView({byteLengthToNeed:l*t,byteStride:0}).unwrapForce();let _=e.arrayLength;r.d.isArray(e.compositionType)&&null==_&&(_=100);const h={shaderSemanticsInfo:e,values:[],maxCount:t,accessor:c.takeAccessor({compositionType:e.compositionType,componentType:s.r.Float,count:t,byteStride:l,arrayLength:_}).unwrapForce()};this.__fields.set(n,h)}takeOne(e){const t=(0,i.UL)(e),n=this.__fields.get(t);if(n){const e=n.shaderSemanticsInfo,t=n.accessor.takeOne(),i=n.values.length,o=l.D.initWithFloat32Array(e.initialValue,e.initialValue,t,e.compositionType);return n.values[i]=o,o}}setValue(e,t,n){const o=(0,i.UL)(e),a=this.__fields.get(o);if(a){const e=a.values[t];l.D._setForce(e,n)}}getValue(e,t){const n=(0,i.UL)(e),o=this.__fields.get(n);if(o)return o.values[t]}getGlobalPropertyStruct(e){return this.__fields.get(e)}getGlobalProperties(){return Array.from(this.__fields.values())}_setUniformLocationsForUniformModeOnly(e){const t=c.F.getWebGLResourceRepository(),n=[];this.__fields.forEach(((e,t)=>{const i=e.shaderSemanticsInfo;n.push(i)})),t.setupUniformLocations(e,n,!0)}_setUniformLocationsForDataTextureModeOnly(e){const t=c.F.getWebGLResourceRepository(),n=[];this.__fields.forEach(((e,t)=>{const i=e.shaderSemanticsInfo;i.needUniformInDataTextureMode&&n.push(i)})),t.setupUniformLocations(e,n,!0)}setUniformValues(e){const t=c.F.getWebGLResourceRepository();this.__fields.forEach(((n,i)=>{const o=n.shaderSemanticsInfo,a=n.values;for(let n=0;n{const r=o.shaderSemanticsInfo;r.stage!==_.H.VertexShader&&r.stage!==_.H.VertexAndPixelShader||(e+=n("",r,a,!0,i)),r.stage!==_.H.PixelShader&&r.stage!==_.H.VertexAndPixelShader||(t+=n("",r,a,!0,i))})),[e,t]}}},9286:(e,t,n)=>{"use strict";n.d(t,{B:()=>s});var i=n(4235),o=n(752),a=n(3258),r=n(6098);class s{constructor(e,t,n){this.__buffers={},this.__buffersOnDemand=new Map,this.__memorySizeRatios={},this.__memorySizeRatios[o.$.CPUGeneric.str]=e,this.__memorySizeRatios[o.$.GPUInstanceData.str]=t,this.__memorySizeRatios[o.$.GPUVertexData.str]=n}static createInstanceIfNotCreated({cpuGeneric:e,gpuInstanceData:t,gpuVertexData:n}){return this.__instance||(this.__instance=new s(e,t,n)),this.__instance}__makeMultipleOf4byteSize(e){return e+(e%4==0?0:4-e%4)}static getInstance(){return this.__instance}__createBuffer(e){const t=s.bufferWidthLength*s.bufferHeightLength*4*4*this.__memorySizeRatios[e.str],n=new ArrayBuffer(this.__makeMultipleOf4byteSize(t));let a=4;e!==o.$.GPUInstanceData&&e!==o.$.GPUVertexData||(a=16);const r=new i.l({byteLength:n.byteLength,buffer:n,name:e.str,byteAlign:a});return this.__buffers[r.name]=r,r}getBuffer(e){return this.__buffers[e.toString()]}createOrGetBuffer(e){let t=this.__buffers[e.toString()];return null==t&&(t=this.__createBuffer(e)),t}createBufferOnDemand(e,t,n){const a=new ArrayBuffer(e),r=new i.l({byteLength:a.byteLength,buffer:a,name:o.$.UBOGeneric.toString(),byteAlign:n});return this.__buffersOnDemand.set(t.objectUID,r),r}getBufferOnDemand(e){return this.__buffersOnDemand.get(e.objectUID)}static get bufferWidthLength(){return a.D.dataTextureWidth}static get bufferHeightLength(){return a.D.dataTextureHeight}printMemoryUsage(){const e=this.__buffers[o.$.CPUGeneric.toString()],t=this.__buffers[o.$.GPUInstanceData.toString()],n=this.__buffers[o.$.GPUVertexData.toString()];console.log("Memory Usage in Memory Manager:"),console.log(`CPUGeneric: ${e.takenSizeInByte} byte of ${e.byteLength} bytes. (${e.takenSizeInByte/e.byteLength*100} %) `),console.log(`GPUInstanceData: ${t.takenSizeInByte} byte of ${t.byteLength} bytes. (${t.takenSizeInByte/t.byteLength*100} %) `),null!=n&&console.log(`GPUVertexData: ${n.takenSizeInByte} byte of ${n.byteLength} bytes. (${n.takenSizeInByte/n.byteLength*100} %) `)}dumpBuffer(e){const t=this.__buffers[e.toString()];return r.Kf.downloadArrayBuffer(e.toString(),t.getArrayBuffer()),t}}},9002:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var i=n(6098);class o{constructor(){this.__objectUid=o.currentMaxObjectCount++,this._tags={},this.__combinedTagString="",this.__uniqueName=`${this.constructor.name}__uid_${this.__objectUid}`,this.__updateInfo(this.__uniqueName)}__updateInfo(e){o.__objects[this.__objectUid]=this,o.__uniqueNames[this.__objectUid]=e,o.__objectsByNameMap.set(this.__uniqueName,this)}static searchByTag(e,t){for(const n of o.__objects)if(n.getTagValue(e)===t)return n}get objectUID(){return this.__objectUid}static getRnObject(e){return o.__objects[e]}static getRnObjectByName(e){return o.__objectsByNameMap.get(e)}tryToSetUniqueName(e,t){if(-1!==o.__uniqueNames.indexOf(e)){if(t){const t=e+"_("+this.__objectUid+")";if(-1===o.__uniqueNames.indexOf(t))return this.__uniqueName=t,o.__uniqueNames[this.__objectUid]=this.__uniqueName,o.__objectsByNameMap.set(this.__uniqueName,this),!0}return!1}return this.__uniqueName=e,o.__uniqueNames[this.__objectUid]=this.__uniqueName,o.__objectsByNameMap.set(this.__uniqueName,this),!0}validateTagString(e){return!new RegExp(/[!"#$%&'()\*\+\-\s\.,\/:;<=>?@\[\\\]^`{|}~]/g).test(e)}tryToSetTag(e){return!!this.validateTagString(e.tag)&&(this.hasTag(e.tag)&&this.removeTag(e.tag),this._tags[e.tag]=e.value,this.__combinedTagString+=`${e.tag}:${e.value} `,!0)}getTagValue(e){return this._tags[e]}getTag(e){return{tag:e,value:this._tags[e]}}hasTag(e){return null!=this._tags[e]}removeTag(e){this._tags[e],this.__combinedTagString.replace(this.__combinedTagString,""),delete this._tags[e]}matchTag(e,t){return this._tags[e]===t}matchTagsAsFreeStrings(e){let t="^";for(let n=0;n{"use strict";n.d(t,{F:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}toGltfString(){return"TRANSLUCENT"===this.str?"BLEND":this.str}}const a=new o({index:0,str:"OPAQUE"}),r=new o({index:1,str:"MASK"}),s=new o({index:2,str:"TRANSLUCENT"}),l=new o({index:3,str:"ADDITIVE"}),c=[a,r,s,l],_=Object.freeze({Opaque:a,Mask:r,Translucent:s,Additive:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})},fromGlTFString:function(e){return"BLEND"===e?s:(0,i.cu)({typeList:c,str:e})}})},3498:(e,t,n)=>{"use strict";n.d(t,{s:()=>h});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Quaternion"}),r=new o({index:1,str:"Translate"}),s=new o({index:2,str:"Scale"}),l=new o({index:3,str:"Weights"}),c=new o({index:4,str:"Effekseer"}),_=[a,r,s,l,c],h=Object.freeze({Quaternion:a,Translate:r,Scale:s,Weights:l,Effekseer:c,from:function(e){return(0,i.li)({typeList:_,index:e})},fromString:function(e){return(0,i.cu)({typeList:_,str:e})}})},7305:(e,t,n)=>{"use strict";n.d(t,{k:()=>c});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}get GltfString(){return this.str.toUpperCase()}}const a=new o({index:0,str:"Linear"}),r=new o({index:1,str:"Step"}),s=new o({index:2,str:"CubicSpline"}),l=[a,r,s],c=Object.freeze({Linear:a,Step:r,CubicSpline:s,from:function(e){return(0,i.li)({typeList:l,index:e})},fromString:function(e){return(0,i.cu)({typeList:l,str:e})}})},290:(e,t,n)=>{"use strict";n.d(t,{l:()=>b});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"ETC1"}),r=new o({index:1,str:"ETC2"}),s=new o({index:2,str:"BC1"}),l=new o({index:3,str:"BC3"}),c=new o({index:4,str:"BC4"}),_=new o({index:5,str:"BC5"}),h=new o({index:6,str:"BC7_M6_OPAQUE"}),u=new o({index:7,str:"BC7_M5"}),d=new o({index:8,str:"PVRTC1_RGB"}),m=new o({index:9,str:"PVRTC1_RGBA"}),f=new o({index:10,str:"ASTC"}),p=new o({index:11,str:"ATC_RGB"}),v=new o({index:12,str:"ATC_RGBA"}),A=new o({index:13,str:"RGBA32"}),y=new o({index:14,str:"RGB565"}),x=new o({index:15,str:"BGR565"}),g=new o({index:16,str:"RGBA4444"}),I=[a,r,s,l,c,_,u,h,d,m,f,p,v,A,y,x,g],b=Object.freeze({ETC1:a,ETC2:r,BC1:s,BC3:l,BC4:c,BC5:_,BC7_M5:u,BC7_M6_OPAQUE:h,PVRTC1_RGB:d,PVRTC1_RGBA:m,ASTC:f,ATC_RGB:p,ATC_RGBA:v,RGBA32:A,RGB565:y,BGR565:x,RGBA4444:g,from:function(e){return(0,i.li)({typeList:I,index:e})},fromString:function(e){return(0,i.cu)({typeList:I,str:e})}})},7009:(e,t,n)=>{"use strict";n.d(t,{C:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:32774,str:"Equation_FUNC_ADD"}),r=new o({index:1,str:"ONE"}),s=new o({index:770,str:"ONE_ALPHA"}),l=new o({index:771,str:"ONE_MINUS_SRC_ALPHA"}),c=[a,r,s,l],_=Object.freeze({EquationFuncAdd:a,One:r,SrcAlpha:s,OneMinusSrcAlpha:l,from:function(e){return(0,i.li)({typeList:c,index:e})}})},1226:(e,t,n)=>{"use strict";n.d(t,{N:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Mat43x1"}),r=new o({index:1,str:"Vec4x2"}),s=new o({index:2,str:"Vec4x2Old"}),l=new o({index:3,str:"Vec4x1"}),c=[a,r,l],_=Object.freeze({Mat43x1:a,Vec4x2:r,Vec4x2Old:s,Vec4x1:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})}})},752:(e,t,n)=>{"use strict";n.d(t,{$:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"GPUInstanceData"}),r=new o({index:1,str:"GPUVertexData"}),s=new o({index:2,str:"UBOGeneric"}),l=new o({index:3,str:"CPUGeneric"}),c=[a,r,s,l],_=Object.freeze({GPUInstanceData:a,GPUVertexData:r,UBOGeneric:s,CPUGeneric:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})}})},8914:(e,t,n)=>{"use strict";n.d(t,{M:()=>l});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Orbit"}),r=new o({index:1,str:"WalkThrough"}),s=[a,r],l=Object.freeze({Orbit:a,WalkThrough:r,from:function(e){return(0,i.li)({typeList:s,index:e})},fromString:function(e){return(0,i.cu)({typeList:s,str:e})}})},9646:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Perspective"}),r=new o({index:1,str:"Orthographic"}),s=new o({index:2,str:"Frustum"}),l=[a,r,s],c=Object.freeze({Perspective:a,Orthographic:r,Frustum:s,from:function(e){return(0,i.li)({typeList:l,index:e})},fromString:function(e){return(0,i.cu)({typeList:l,str:e})}})},3999:(e,t,n)=>{"use strict";n.d(t,{r:()=>v});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t,sizeInBytes:n,wgsl:i,webgpu:o}){super({index:e,str:t}),this.__sizeInBytes=n,this.__webgpu=o,this.__wgsl=i}get wgsl(){return this.__wgsl}get webgpu(){return this.__webgpu}getSizeInBytes(){return this.__sizeInBytes}isFloatingPoint(){return 5126===this.index||5127===this.index||36193===this.index}isInteger(){return 5120===this.index||5121===this.index||5122===this.index||5123===this.index||5124===this.index||5125===this.index}}const a=new o({index:5119,str:"UNKNOWN",sizeInBytes:0,wgsl:"unknown",webgpu:"unknown"}),r=new o({index:5120,str:"BYTE",sizeInBytes:1,wgsl:"i32",webgpu:"sint8"}),s=new o({index:5121,str:"UNSIGNED_BYTE",sizeInBytes:1,wgsl:"u32",webgpu:"uint8"}),l=new o({index:5122,str:"SHORT",sizeInBytes:2,wgsl:"i32",webgpu:"sint16"}),c=new o({index:5123,str:"UNSIGNED_SHORT",sizeInBytes:2,wgsl:"u32",webgpu:"uint16"}),_=new o({index:5124,str:"INT",sizeInBytes:4,wgsl:"i32",webgpu:"sint32"}),h=new o({index:5125,str:"UNSIGNED_INT",sizeInBytes:4,wgsl:"u32",webgpu:"uint32"}),u=new o({index:5126,str:"FLOAT",sizeInBytes:4,wgsl:"f32",webgpu:"float32"}),d=new o({index:5127,str:"DOUBLE",sizeInBytes:8,wgsl:"f32",webgpu:"float64"}),m=new o({index:35670,str:"BOOL",sizeInBytes:1,wgsl:"bool",webgpu:"bool"}),f=new o({index:5131,str:"HALF_FLOAT",sizeInBytes:2,wgsl:"f16",webgpu:"float16"}),p=[a,r,s,l,c,_,h,u,d,f,m],v=Object.freeze({Unknown:a,Byte:r,UnsignedByte:s,Short:l,UnsignedShort:c,Int:_,UnsignedInt:h,Float:u,Double:d,Bool:m,HalfFloat:f,from:function(e){return(0,i.li)({typeList:p,index:e})},fromTypedArray:function(e){return e instanceof Int8Array?r:e instanceof Uint8Array||e instanceof Uint8ClampedArray?s:e instanceof Int16Array?l:e instanceof Uint16Array?c:e instanceof Int32Array?_:e instanceof Uint32Array?h:e instanceof Float32Array?u:e instanceof Float64Array?d:a},toTypedArray:function(e){return e===r?Int8Array:e===s?Uint8Array:e===l?Int16Array:e===c?Uint16Array:e===_?Int32Array:e===h?Uint32Array:e===u?Float32Array:e===d?Float64Array:void 0},toGltf2AccessorComponentType:function(e){return e.index},fromString:function(e){return(0,i.cu)({typeList:p,str:e})},fromGlslString:function(e){let t=e;switch(e){case"bool":t="BOOL";break;case"int":case"ivec2":case"ivec3":case"ivec4":case"sampler2D":case"sampler2DShadow":case"sampler2DRect":case"sampler3D":case"samplerCube":t="INT";break;case"float":case"vec2":case"vec3":case"vec4":case"mat2":case"mat3":case"mat4":t="FLOAT"}return(0,i.cu)({typeList:p,str:t})},fromWgslString:function(e){let t=e;switch(e){case"bool":t="BOOL";break;case"i32":case"vec2":case"vec3":case"vec4":case"sampler_2d":case"sampler_2d_shadow":case"sampler_3d":case"sampler_cube":t="INT";break;case"u32":t="UNSIGNED_INT";break;case"f32":case"vec2":case"vec3":case"vec4":case"mat2x2":case"mat3x3":case"mat4x4":t="FLOAT"}return(0,i.cu)({typeList:p,str:t})}})},810:(e,t,n)=>{"use strict";n.d(t,{d:()=>S});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t,glslStr:n,hlslStr:i,wgsl:o,webgpu:a,numberOfComponents:r,vec4SizeOfProperty:s,isArray:l=!1}){super({index:e,str:t}),this.__numberOfComponents=r,this.__glslStr=n,this.__hlslStr=i,this.__vec4SizeOfProperty=s,this.__isArray=l,this.__webgpuStr=a,this.__wgslStr=o}get webgpu(){return this.__webgpuStr}get wgsl(){return this.__wgslStr}getNumberOfComponents(){return this.__numberOfComponents}getGlslStr(e){return 5126===e.index||5127===e.index||this===S.Texture2D||this===S.Texture2DShadow||this===S.Texture2DRect||this===S.TextureCube?this.__glslStr:5120===e.index||5122===e.index||5124===e.index?this===S.Scalar||this===S.ScalarArray?"int":"i"+this.__glslStr:35670===e.index?"bool":"unknown"}getGlslInitialValue(e){if(5126===e.index||5127===e.index){if(this===S.Scalar)return"0.0";if(2===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0)";if(3===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0)";if(4===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0, 0.0)";if(9===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)";if(16===this.__numberOfComponents)return this.__glslStr+"(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)"}else if(5120===e.index||5122===e.index||5124===e.index){if(this===S.Scalar)return"0";if(2===this.__numberOfComponents)return this.__glslStr+"(0, 0)";if(3===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0)";if(4===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0, 0)";if(9===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0, 0, 0, 0, 0, 0, 0)";if(16===this.__numberOfComponents)return this.__glslStr+"(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)"}else if(35670===e.index){if(this===S.Scalar)return"false";if(2===this.__numberOfComponents)return this.__glslStr+"(false, false)";if(3===this.__numberOfComponents)return this.__glslStr+"(false, false, false)";if(4===this.__numberOfComponents)return this.__glslStr+"(false, false, false, false)"}return"unknown"}toWGSLType(e){return this.__wgslStr.replace("#",e.wgsl)}getVec4SizeOfProperty(){return this.__vec4SizeOfProperty}}const a=new o({index:-1,str:"UNKNOWN",glslStr:"unknown",hlslStr:"unknown",wgsl:"unknown",webgpu:"unknown",numberOfComponents:0,vec4SizeOfProperty:0}),r=new o({index:0,str:"SCALAR",glslStr:"float",hlslStr:"float",wgsl:"#",webgpu:"",numberOfComponents:1,vec4SizeOfProperty:1}),s=new o({index:1,str:"VEC2",glslStr:"vec2",hlslStr:"float2",wgsl:"vec2<#>",webgpu:"x2",numberOfComponents:2,vec4SizeOfProperty:1}),l=new o({index:2,str:"VEC3",glslStr:"vec3",hlslStr:"float3",wgsl:"vec3<#>",webgpu:"x3",numberOfComponents:3,vec4SizeOfProperty:1}),c=new o({index:3,str:"VEC4",glslStr:"vec4",hlslStr:"float4",wgsl:"vec4<#>",webgpu:"x4",numberOfComponents:4,vec4SizeOfProperty:1}),_=new o({index:4,str:"MAT2",glslStr:"mat2",hlslStr:"float2x2",wgsl:"mat2x2<#>",webgpu:"unknown",numberOfComponents:4,vec4SizeOfProperty:2}),h=new o({index:5,str:"MAT3",glslStr:"mat3",hlslStr:"float3x3",wgsl:"mat3x3<#>",webgpu:"unknown",numberOfComponents:9,vec4SizeOfProperty:3}),u=new o({index:6,str:"MAT4",glslStr:"mat4",hlslStr:"float4x4",wgsl:"mat4x4<#>",webgpu:"unknown",numberOfComponents:16,vec4SizeOfProperty:4}),d=new o({index:7,str:"TEXTURE_2D",glslStr:"sampler2D",hlslStr:"Texture2D",wgsl:"texture_2d",webgpu:"texture_2d",numberOfComponents:1,vec4SizeOfProperty:1}),m=new o({index:8,str:"TEXTURE_CUBE_MAP",glslStr:"samplerCube",hlslStr:"TextureCube",wgsl:"texture_cube",webgpu:"texture_cube",numberOfComponents:1,vec4SizeOfProperty:1}),f=new o({index:9,str:"SCALAR_ARRAY",glslStr:"float",hlslStr:"float",wgsl:"#",webgpu:"unknown",numberOfComponents:1,vec4SizeOfProperty:1,isArray:!0}),p=new o({index:10,str:"VEC2_ARRAY",glslStr:"vec2",hlslStr:"float2",wgsl:"vec2<#>",webgpu:"unknown",numberOfComponents:2,vec4SizeOfProperty:1,isArray:!0}),v=new o({index:11,str:"VEC3_ARRAY",glslStr:"vec3",hlslStr:"float3",wgsl:"vec3<#>",webgpu:"unknown",numberOfComponents:3,vec4SizeOfProperty:1,isArray:!0}),A=new o({index:12,str:"VEC4_ARRAY",glslStr:"vec4",hlslStr:"float4",wgsl:"vec4<#>",webgpu:"unknown",numberOfComponents:4,vec4SizeOfProperty:1,isArray:!0}),y=new o({index:13,str:"MAT4_ARRAY",glslStr:"mat4",hlslStr:"float4x4",wgsl:"mat4x4<#>",webgpu:"unknown",numberOfComponents:16,vec4SizeOfProperty:4,isArray:!0}),x=new o({index:14,str:"MAT3_ARRAY",glslStr:"mat3",hlslStr:"float3x3",wgsl:"mat3x3<#>",webgpu:"unknown",numberOfComponents:9,vec4SizeOfProperty:3,isArray:!0}),g=new o({index:15,str:"MAT2_ARRAY",glslStr:"mat2",hlslStr:"float2x2",wgsl:"mat2x2<#>",webgpu:"unknown",numberOfComponents:4,vec4SizeOfProperty:2,isArray:!0}),I=new o({index:16,str:"TEXTURE_2D_SHADOW",glslStr:"highp sampler2DShadow",hlslStr:"Texture2D",wgsl:"texture_2d",webgpu:"texture_2d",numberOfComponents:1,vec4SizeOfProperty:1}),b=new o({index:17,str:"TEXTURE_2D_RECT",glslStr:"sampler2DRect",hlslStr:"Texture2D",wgsl:"texture_2d",webgpu:"texture_2d",numberOfComponents:1,vec4SizeOfProperty:1}),E=new o({index:18,str:"MAT4x3_ARRAY",glslStr:"mat4x3",hlslStr:"float4x3",wgsl:"mat4x3<#>",webgpu:"unknown",numberOfComponents:12,vec4SizeOfProperty:3,isArray:!0}),T=[a,r,s,l,c,_,h,u,p,v,A,f,g,x,y,d,I,b,m,E],S=Object.freeze({Unknown:a,Scalar:r,Vec2:s,Vec3:l,Vec4:c,Mat2:_,Mat3:h,Mat4:u,ScalarArray:f,Vec2Array:p,Vec3Array:v,Vec4Array:A,Mat2Array:g,Mat3Array:x,Mat4Array:y,Texture2D:d,Texture2DShadow:I,TextureCube:m,Texture2DRect:b,Mat4x3Array:E,from:function(e){return(0,i.li)({typeList:T,index:e})},fromString:function(e){return(0,i.cu)({typeList:T,str:e})},vectorFrom:function(e){let t="";switch(e){case 1:t="scalar";break;case 2:t="vec2";break;case 3:t="vec3";break;case 4:t="vec4";break;default:console.error("not found appropriate Vectors")}return(0,i.cu)({typeList:T,str:t})},fromGlslString:function(e){let t=e;switch(e){case"bool":case"int":case"float":t="scalar";break;case"ivec2":t="vec2";break;case"ivec3":t="vec3";break;case"ivec4":t="vec4";break;case"sampler2D":t="TEXTURE_2D";break;case"sampler2DShadow":t="TEXTURE_2D_SHADOW";break;case"sampler2DRect":t="TEXTURE_2D_RECT";break;case"samplerCube":t="TEXTURE_CUBE_MAP"}return(0,i.cu)({typeList:T,str:t})},fromWgslString:function(e){let t=e;switch(e){case"bool":case"i32":case"u32":case"f32":t="scalar";break;case"vec2":case"vec2":t="vec2";break;case"vec3":case"vec3":t="vec3";break;case"vec4":case"vec4":t="vec4";break;case"sampler_2d":t="TEXTURE_2D";break;case"sampler_2d_shadow":t="TEXTURE_2D_SHADOW";break;case"sampler_cube":t="TEXTURE_CUBE_MAP"}return(0,i.cu)({typeList:T,str:t})},isArray:function(e){return e===f||e===p||e===v||e===A||e===E||e===y||e===x||e===g},isTexture:function(e){return e===d||e===m||e===I||e===b},toGltf2AnimationAccessorCompositionType:function(e){switch(e){case 1:return r;case 2:return s;case 3:return l;case 4:return c;default:throw new Error("Invalid componentN")}},toGltf2AccessorCompositionTypeString:function(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";case 9:return"MAT3";case 16:return"MAT4";default:throw new Error("Invalid componentN")}},toGltf2AnimationAccessorCompositionTypeString:function(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";default:throw new Error("Invalid componentN")}},toGltf2SquareMatrixAccessorCompositionTypeString:function(e){switch(e){case 4:return"VEC4";case 9:return"MAT3";case 16:return"MAT4";default:throw new Error("Invalid componentN")}}})},1715:(e,t,n)=>{"use strict";n.d(t,{b:()=>X});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:37808,str:"COMPRESSED_RGBA_ASTC_4x4_KHR"}),r=new o({index:37809,str:"COMPRESSED_RGBA_ASTC_5x4_KHR"}),s=new o({index:37810,str:"COMPRESSED_RGBA_ASTC_5x5_KHR"}),l=new o({index:37811,str:"COMPRESSED_RGBA_ASTC_6x5_KHR"}),c=new o({index:37812,str:"COMPRESSED_RGBA_ASTC_6x6_KHR"}),_=new o({index:37813,str:"COMPRESSED_RGBA_ASTC_8x5_KHR"}),h=new o({index:37814,str:"COMPRESSED_RGBA_ASTC_8x6_KHR"}),u=new o({index:37815,str:"COMPRESSED_RGBA_ASTC_8x8_KHR"}),d=new o({index:37816,str:"COMPRESSED_RGBA_ASTC_10x5_KHR"}),m=new o({index:37817,str:"COMPRESSED_RGBA_ASTC_10x6_KHR"}),f=new o({index:37818,str:"COMPRESSED_RGBA_ASTC_10x8_KHR"}),p=new o({index:37819,str:"COMPRESSED_RGBA_ASTC_10x10_KHR"}),v=new o({index:37820,str:"COMPRESSED_RGBA_ASTC_12x10_KHR"}),A=new o({index:37821,str:"COMPRESSED_RGBA_ASTC_12x12_KHR"}),y=new o({index:37840,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR"}),x=new o({index:37841,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR"}),g=new o({index:37842,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR"}),I=new o({index:37843,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR"}),b=new o({index:37844,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR"}),E=new o({index:37845,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR"}),T=new o({index:37846,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR"}),S=new o({index:37847,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR"}),C=new o({index:37848,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR"}),w=new o({index:37849,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR"}),R=new o({index:37850,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR"}),P=new o({index:37851,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR"}),M=new o({index:37852,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR"}),D=new o({index:37853,str:"COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR"}),N=new o({index:33776,str:"COMPRESSED_RGB_S3TC_DXT1_EXT"}),B=new o({index:33777,str:"COMPRESSED_RGBA_S3TC_DXT1_EXT"}),L=new o({index:33778,str:"COMPRESSED_RGBA_S3TC_DXT3_EXT"}),F=new o({index:33779,str:"COMPRESSED_RGBA_S3TC_DXT5_EXT"}),G=new o({index:36492,str:"COMPRESSED_RGBA_BPTC_UNORM_EXT"}),z=new o({index:35842,str:"COMPRESSED_RGBA_PVRTC_4BPPV1_IMG"}),V=new o({index:35840,str:"COMPRESSED_RGB_PVRTC_4BPPV1_IMG"}),O=new o({index:37496,str:"COMPRESSED_RGBA8_ETC2_EAC"}),U=new o({index:37492,str:"COMPRESSED_RGB8_ETC2"}),k=new o({index:36196,str:"COMPRESSED_RGB_ETC1_WEBGL"}),Q=new o({index:32856,str:"RGBA8_EXT"}),W=[a,r,s,l,c,_,h,u,d,m,f,p,v,A,y,x,g,I,b,E,T,S,C,w,R,P,M,D,N,B,L,F,G,z,V,O,U,k,Q],X=Object.freeze({ASTC_RGBA_4x4:a,ASTC_RGBA_5x4:r,ASTC_RGBA_5x5:s,ASTC_RGBA_6x5:l,ASTC_RGBA_6x6:c,ASTC_RGBA_8x5:_,ASTC_RGBA_8x6:h,ASTC_RGBA_8x8:u,ASTC_RGBA_10x5:d,ASTC_RGBA_10x6:m,ASTC_RGBA_10x8:f,ASTC_RGBA_10x10:p,ASTC_RGBA_12x10:v,ASTC_RGBA_12x12:A,ASTC_SRGB_4x4:y,ASTC_SRGB_5x4:x,ASTC_SRGB_5x5:g,ASTC_SRGB_6x5:I,ASTC_SRGB_6x6:b,ASTC_SRGB_8x5:E,ASTC_SRGB_8x6:T,ASTC_SRGB_8x8:S,ASTC_SRGB_10x5:C,ASTC_SRGB_10x6:w,ASTC_SRGB_10x8:R,ASTC_SRGB_10x10:P,ASTC_SRGB_12x10:M,ASTC_SRGB_12x12:D,S3TC_RGB_DXT1:N,S3TC_RGBA_DXT1:B,S3TC_RGBA_DXT3:L,S3TC_RGBA_DXT5:F,BPTC_RGBA:G,PVRTC_RGBA_4BPPV1:z,PVRTC_RGB_4BPPV1:V,ETC2_RGBA8_EAC:O,ETC2_RGB8:U,ETC1_RGB:k,RGBA8_EXT:Q,from:function(e){return(0,i.li)({typeList:W,index:e})},fromString:function(e){return(0,i.cu)({typeList:W,str:e})}})},7338:(e,t,n)=>{"use strict";n.d(t,{T:()=>u});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t,ext:n,brand:i}){super({index:e,str:t}),this.extension=n,this.brand=i}}const a=new o({index:-1,str:"unknown",ext:"unknown",brand:"UnKnown"}),r=new o({index:0,str:"gltf",ext:"gltf",brand:"glTF"}),s=new o({index:1,str:"glb",ext:"glb",brand:"glTF"}),l=new o({index:2,str:"vrm",ext:"vrm",brand:"VRM"}),c=new o({index:3,str:"drc",ext:"drc",brand:"Draco"}),_=new o({index:4,str:"efk",ext:"efk",brand:"EffekseerEffect"}),h=[a,r,s,l,c,_],u=Object.freeze({Unknown:a,Gltf:r,GltfBinary:s,VRM:l,Draco:c,EffekseerEffect:_,from:function(e){return(0,i.li)({typeList:h,index:e})},fromString:function(e){const t=(0,i.cu)({typeList:h,str:e});return null!=t?t:a},isGltfOrGlb:function(e){return e===r||e===s}})},1986:(e,t,n)=>{"use strict";n.d(t,{c:()=>u});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:".ldr_srgb"}),r=new o({index:1,str:".ldr_linear"}),s=new o({index:2,str:".hdr"}),l=new o({index:3,str:".rgbe.png"}),c=new o({index:4,str:".rgb9_e5.png"}),_=new o({index:5,str:".exr"}),h=[a,r,s,l,c,_],u=Object.freeze({LDR_SRGB:a,LDR_LINEAR:r,HDR_LINEAR:s,RGBE_PNG:l,RGB9_E5_PNG:c,OpenEXR:_,from:function(e){return(0,i.li)({typeList:h,index:e})},fromString:function(e){return(0,i.cu)({typeList:h,str:e})}})},5634:(e,t,n)=>{"use strict";n.d(t,{v:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"Directional"}),r=new o({index:1,str:"Point"}),s=new o({index:2,str:"Spot"}),l=new o({index:3,str:"Ambient"}),c=[r,a,s,l],_=Object.freeze({Point:r,Directional:a,Spot:s,Ambient:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})}})},9216:(e,t,n)=>{"use strict";n.d(t,{V:()=>d});var i=n(10),o=n(2343);class a extends o.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const r=new a({index:6402,str:"DEPTH_COMPONENT"}),s=new a({index:6406,str:"ALPHA"}),l=new a({index:i.SJU,str:"RG"}),c=new a({index:6407,str:"RGB"}),_=new a({index:6408,str:"RGBA"}),h=new a({index:6409,str:"LUMINANCE"}),u=new a({index:6410,str:"LUMINANCE_ALPHA"}),d=Object.freeze({DepthComponent:r,Alpha:s,RG:l,RGB:c,RGBA:_,Luminance:h,LuminanceAlpha:u})},8696:(e,t,n)=>{"use strict";n.d(t,{T:()=>m});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}getWebGPUTypeStr(){switch(this.index){case 0:return"point-list";case 1:return"line-list";case 2:case 6:default:throw new Error("Not Supported in WebGPU");case 3:return"line-strip";case 4:return"triangle-list";case 5:return"triangle-strip"}}}const a=new o({index:-1,str:"UNKNOWN"}),r=new o({index:0,str:"POINTS"}),s=new o({index:1,str:"LINES"}),l=new o({index:2,str:"LINE_LOOP"}),c=new o({index:3,str:"LINE_STRIP"}),_=new o({index:4,str:"TRIANGLES"}),h=new o({index:5,str:"TRIANGLE_STRIP"}),u=new o({index:6,str:"TRIANGLE_FAN"}),d=[a,r,s,l,c,_,h,u],m=Object.freeze({Unknown:a,Points:r,Lines:s,LineLoop:l,LineStrip:c,Triangles:_,TriangleStrip:h,TriangleFan:u,from:function(e){return(0,i.li)({typeList:d,index:e})}})},7683:(e,t,n)=>{"use strict";n.d(t,{V:()=>c,y:()=>o});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}get webGLVersion(){switch(this){case r:case s:return 2;default:return 0}}}const a=new o({index:0,str:"NONE"}),r=new o({index:1,str:"UNIFORM"}),s=new o({index:2,str:"DataTexture"}),l=new o({index:3,str:"WebGPU"}),c=Object.freeze({isDataTextureApproach:e=>e===s,isUniformApproach:e=>e===r,isWebGpuApproach:e=>e===l,None:a,Uniform:r,DataTexture:s,WebGPU:l,isWebGL2Approach:e=>{switch(e){case r:case s:return!0;default:return!1}}})},4507:(e,t,n)=>{"use strict";n.d(t,{I:()=>f});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t,methodName:n}){super({index:e,str:t}),this.methodName=n}}const a=new o({index:-1,str:"UNKNOWN",methodName:"$unknown"}),r=new o({index:0,str:"CREATE",methodName:"$create"}),s=new o({index:1,str:"LOAD",methodName:"$load"}),l=new o({index:2,str:"MOUNT",methodName:"$mount"}),c=new o({index:3,str:"LOGIC",methodName:"$logic"}),_=new o({index:4,str:"PRE_RENDER",methodName:"$prerender"}),h=new o({index:5,str:"RENDER",methodName:"$render"}),u=new o({index:6,str:"UNMOUNT",methodName:"$unmount"}),d=new o({index:7,str:"DISCARD",methodName:"$discard"}),m=[a,r,s,l,c,_,h,u,d],f=Object.freeze({Unknown:a,Create:r,Load:s,Mount:l,Logic:c,PreRender:_,Render:h,Unmount:u,Discard:d,from:function(e){return(0,i.li)({typeList:m,index:e})}})},8422:(e,t,n)=>{"use strict";n.d(t,{G:()=>E});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}webGLConstantValue(){return-2===this.index?0:-1===this.index?1029:36064+this.index}}const a=new o({index:-2,str:"NONE"}),r=new o({index:-1,str:"BACK"}),s=new o({index:0,str:"COLOR_ATTACHMENT0"}),l=new o({index:1,str:"COLOR_ATTACHMENT1"}),c=new o({index:2,str:"COLOR_ATTACHMENT2"}),_=new o({index:3,str:"COLOR_ATTACHMENT3"}),h=new o({index:4,str:"COLOR_ATTACHMENT4"}),u=new o({index:5,str:"COLOR_ATTACHMENT5"}),d=new o({index:6,str:"COLOR_ATTACHMENT6"}),m=new o({index:7,str:"COLOR_ATTACHMENT7"}),f=new o({index:8,str:"COLOR_ATTACHMENT8"}),p=new o({index:9,str:"COLOR_ATTACHMENT9"}),v=new o({index:10,str:"COLOR_ATTACHMENT10"}),A=new o({index:11,str:"COLOR_ATTACHMENT11"}),y=new o({index:12,str:"COLOR_ATTACHMENT12"}),x=new o({index:13,str:"COLOR_ATTACHMENT13"}),g=new o({index:14,str:"COLOR_ATTACHMENT14"}),I=new o({index:15,str:"COLOR_ATTACHMENT15"}),b=[a,r,s,l,c,_,h,u,d,m,f,p,v,A,y,x,g,I],E=Object.freeze({None:a,Back:r,ColorAttachment0:s,ColorAttachment1:l,ColorAttachment2:c,ColorAttachment3:_,ColorAttachment4:h,ColorAttachment5:u,ColorAttachment6:d,ColorAttachment7:m,ColorAttachment8:f,ColorAttachment9:p,ColorAttachment10:v,ColorAttachment11:A,ColorAttachment12:y,ColorAttachment13:x,ColorAttachment14:g,ColorAttachment15:I,from:function(e){return(0,i.li)({typeList:b,index:e})}})},3591:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"ClassicShading"}),r=new o({index:1,str:"PBRShading"}),s=(new o({index:2,str:"Lerp"}),new o({index:3,str:"Add"}),[a,r]),l=Object.freeze({ClassicShading:a,PBRShading:r,from:function(e){return(0,i.li)({typeList:s,index:e})},fromString:function(e){return(0,i.cu)({typeList:s,str:e})}})},4587:(e,t,n)=>{"use strict";n.d(t,{UL:()=>St,f5:()=>Ct,wy:()=>a});var i=n(2343),o=n(810);class a extends i.Jx{constructor({str:e}){super({index:++a.__indexCount*a._scale,str:e,noCheckStrUnique:!0}),a.__classes[this.index]=this}static getShaderSemanticByIndex(e){return this.__classes[Math.abs(e)-Math.abs(e)%this._scale]}static isNonArrayShaderSemanticIndex(e){return e>=this._scale}static isArrayAndZeroIndexShaderSemanticIndex(e){return e<0&&Math.abs(e)%a._scale==0}static isArrayAndNonZeroIndexShaderSemanticIndex(e){return e<0&&Math.abs(e)%a._scale!=0}static getIndexCount(){return a.__indexCount}}a.__indexCount=-1,a._scale=1e4,a.__classes=[];const r=new a({str:"worldMatrix"}),s=new a({str:"viewMatrix"}),l=new a({str:"isBillboard"}),c=new a({str:"enableViewMatrix"}),_=new a({str:"projectionMatrix"}),h=new a({str:"normalMatrix"}),u=new a({str:"boneMatrix"}),d=new a({str:"baseColorFactor"}),m=new a({str:"baseColorTexture"}),f=new a({str:"normalTexture"}),p=new a({str:"metallicRoughnessTexture"}),v=new a({str:"occlusionTexture"}),A=new a({str:"emissiveFactor"}),y=new a({str:"emissiveTexture"}),x=new a({str:"lightNumber"}),g=new a({str:"lightPosition"}),I=new a({str:"lightDirection"}),b=new a({str:"lightIntensity"}),E=new a({str:"lightProperty"}),T=new a({str:"metallicRoughnessFactor"}),S=new a({str:"brdfLutTexture"}),C=new a({str:"diffuseEnvTexture"}),w=new a({str:"specularEnvTexture"}),R=new a({str:"inverseEnvironment"}),P=new a({str:"iblParameter"}),M=new a({str:"viewPosition"}),D=new a({str:"wireframe"}),N=new a({str:"diffuseColorFactor"}),B=new a({str:"diffuseColorTexture"}),L=new a({str:"shininess"}),F=new a({str:"shadingModel"}),G=new a({str:"skinningMode"}),z=new a({str:"generalTexture"}),V=new a({str:"vertexAttributesExistenceArray"}),O=new a({str:"boneQuaternion"}),U=new a({str:"boneTranslateScale"}),k=new a({str:"boneTranslatePackedQuat"}),Q=new a({str:"boneScalePackedQuat"}),W=new a({str:"boneCompressedChunk"}),X=new a({str:"boneCompressedInfo"}),q=new a({str:"pointSize"}),H=new a({str:"colorEnvTexture"}),j=new a({str:"pointDistanceAttenuation"}),Y=new a({str:"hdriFormat"}),K=new a({str:"screenInfo"}),J=new a({str:"depthTexture"}),Z=new a({str:"lightViewProjectionMatrix"}),$=new a({str:"anisotropy"}),ee=new a({str:"clearcoatParameter"}),te=new a({str:"sheenColorFactor"}),ne=new a({str:"sheenColorTexture"}),ie=new a({str:"sheenRoughnessFactor"}),oe=new a({str:"sheenRoughnessTexture"}),ae=new a({str:"sheenLutTexture"}),re=new a({str:"specularGlossinessFactor"}),se=new a({str:"specularGlossinessTexture"}),le=new a({str:"entityUID"}),ce=new a({str:"morphTargetNumber"}),_e=new a({str:"dataTextureMorphOffsetPosition"}),he=new a({str:"morphWeights"}),ue=new a({str:"currentComponentSIDs"}),de=new a({str:"alphaCutoff"}),me=new a({str:"alphaTexture"}),fe=new a({str:"makeOutputSrgb"}),pe=new a({str:"framebufferWidth"}),ve=new a({str:"clearCoatFactor"}),Ae=new a({str:"clearCoatTexture"}),ye=new a({str:"clearCoatRoughnessFactor"}),xe=new a({str:"clearCoatRoughnessTexture"}),ge=new a({str:"clearCoatNormalTexture"}),Ie=new a({str:"transmissionFactor"}),be=new a({str:"transmissionTexture"}),Ee=new a({str:"backBufferTexture"}),Te=new a({str:"backBufferTextureSize"}),Se=new a({str:"thicknessFactor"}),Ce=new a({str:"thicknessTexture"}),we=new a({str:"attenuationDistance"}),Re=new a({str:"attenuationColor"}),Pe=new a({str:"isOutputHDR"}),Me=new a({str:"baseColorTextureTransform"}),De=new a({str:"baseColorTextureRotation"}),Ne=new a({str:"normalTextureTransform"}),Be=new a({str:"normalTextureRotation"}),Le=new a({str:"metallicRoughnessTextureTransform"}),Fe=new a({str:"metallicRoughnessTextureRotation"}),Ge=new a({str:"normalTexcoordIndex"}),ze=new a({str:"baseColorTexcoordIndex"}),Ve=new a({str:"metallicRoughnessTexcoordIndex"}),Oe=new a({str:"occlusionTexcoordIndex"}),Ue=new a({str:"occlusionTextureTransform"}),ke=new a({str:"occlusionTextureRotation"}),Qe=new a({str:"emissiveTexcoordIndex"}),We=new a({str:"emissiveTextureTransform"}),Xe=new a({str:"emissiveTextureRotation"}),qe=new a({str:"normalScale"}),He=new a({str:"occlusionStrength"}),je=new a({str:"envRotation"}),Ye=new a({str:"envHdriFormat"}),Ke=new a({str:"vrState"}),Je=new a({str:"enableLinearToSrgb"}),Ze=new a({str:"specularFactor"}),$e=new a({str:"specularTexture"}),et=new a({str:"specularColorFactor"}),tt=new a({str:"specularColorTexture"}),nt=new a({str:"ior"}),it=new a({str:"depthBiasPV"}),ot=new a({str:"clearCoatTextureTransform"}),at=new a({str:"clearCoatTextureRotation"}),rt=new a({str:"clearCoatRoughnessTextureTransform"}),st=new a({str:"clearCoatRoughnessTextureRotation"}),lt=new a({str:"clearCoatNormalTextureTransform"}),ct=new a({str:"clearCoatNormalTextureRotation"}),_t=new a({str:"clearCoatTexcoordIndex"}),ht=new a({str:"clearCoatRoughnessTexcoordIndex"}),ut=new a({str:"clearCoatNormalTexcoordIndex"}),dt=new a({str:"iridescenceFactor"}),mt=new a({str:"iridescenceTexture"}),ft=new a({str:"iridescenceIor"}),pt=new a({str:"iridescenceThicknessMinimum"}),vt=new a({str:"iridescenceThicknessMaximum"}),At=new a({str:"iridescenceThicknessTexture"}),yt=new a({str:"gaussianKernelSize"}),xt=new a({str:"anisotropyStrength"}),gt=new a({str:"anisotropyRotation"}),It=new a({str:"anisotropyTexture"}),bt=new a({str:"gaussianRatio"}),Et=new a({str:"isHorizontal"}),Tt=[r,s,l,c,_,h,u,d,m,f,p,v,A,y,x,g,I,b,E,T,S,C,w,R,P,M,D,N,B,L,F,G,z,V,O,U,k,Q,W,X,q,H,j,Y,K,J,Z,$,ee,te,ne,ie,oe,ae,re,se,le,ce,_e,he,ue,de,me,fe,pe,ve,Ae,ye,xe,ge,Ie,be,Ee,Te,Se,Ce,we,Re,Pe,Me,De,Ne,Be,Le,Fe,Ge,ze,Ve,Oe,Ue,ke,Qe,We,Xe,qe,He,je,Ye,Ke,Je,Ze,$e,et,tt,nt,it,ot,at,rt,st,lt,ct,_t,ht,ut,dt,mt,ft,pt,vt,At,yt,bt,Et,xt,gt,It];function St(e){return e.index}const Ct=Object.freeze({from:function(e){return(0,i.li)({typeList:Tt,index:e})},fromString:function(e){return(0,i.cu)({typeList:Tt,str:e})},fromStringCaseSensitively:function(e){return(0,i.bm)({typeList:Tt,str:e})},WorldMatrix:r,ViewMatrix:s,IsBillboard:l,EnableViewMatrix:c,ProjectionMatrix:_,NormalMatrix:h,BoneMatrix:u,BaseColorFactor:d,BaseColorTexture:m,NormalTexture:f,MetallicRoughnessTexture:p,OcclusionTexture:v,EmissiveFactor:A,EmissiveTexture:y,LightNumber:x,LightPosition:g,LightDirection:I,LightIntensity:b,LightProperty:E,MetallicRoughnessFactor:T,BrdfLutTexture:S,DiffuseEnvTexture:C,SpecularEnvTexture:w,InverseEnvironment:R,IBLParameter:P,ViewPosition:M,Wireframe:D,DiffuseColorFactor:N,DiffuseColorTexture:B,Shininess:L,ShadingModel:F,SkinningMode:G,GeneralTexture:z,VertexAttributesExistenceArray:V,BoneQuaternion:O,BoneTranslateScale:U,BoneTranslatePackedQuat:k,BoneScalePackedQuat:Q,BoneCompressedChunk:W,BoneCompressedInfo:X,PointSize:q,ColorEnvTexture:H,PointDistanceAttenuation:j,HDRIFormat:Y,ScreenInfo:K,DepthTexture:J,LightViewProjectionMatrix:Z,Anisotropy:$,ClearCoatParameter:ee,SheenColorFactor:te,SheenColorTexture:ne,SheenRoughnessFactor:ie,SheenRoughnessTexture:oe,SheenLutTexture:ae,SpecularGlossinessFactor:re,SpecularGlossinessTexture:se,ClearCoatFactor:ve,ClearCoatTexture:Ae,ClearCoatRoughnessFactor:ye,ClearCoatRoughnessTexture:xe,ClearCoatNormalTexture:ge,TransmissionFactor:Ie,TransmissionTexture:be,BackBufferTexture:Ee,BackBufferTextureSize:Te,ThicknessFactor:Se,ThicknessTexture:Ce,AttenuationDistance:we,AttenuationColor:Re,fullSemanticStr:function(e){let t="";return null!=e.prefix&&(t=e.prefix),t+e.semantic.str},getShaderProperty:(e,t,n,i,r)=>{if(t.isComponentData)return"";const s=t.compositionType.getGlslStr(t.componentType);let l=Ct.fullSemanticStr(t);const c=t.compositionType.getGlslStr(t.componentType);let _="";t.arrayLength&&(_=`[${t.arrayLength}]`);const h=` uniform ${c} u_${l}${_};\n`;let u="";if(n<0||o.d.isArray(t.compositionType)){if(Math.abs(n)%a._scale!=0&&!o.d.isArray(t.compositionType))return"";l.match(/\[.+?\]/)?l=l.replace(/\[.+?\]/g,"[i]"):l+="[i]",u+=r?`\n ${s} val;\n int i = index;\n return u_${l};\n `:`\n ${s} val;\n for (int i=0; i<${t.arrayLength}; i++) {\n if (i == index) {\n val = u_${l};\n break;\n }\n }\n return val;\n `}else u+=`return u_${l};`;let d="";return o.d.isTexture(t.compositionType)||(d=`\n ${s} get_${t.semantic.str}(float instanceId, int index) {\n ${u}\n }\n`),`${h}${d}`},EntityUID:le,MorphTargetNumber:ce,DataTextureMorphOffsetPosition:_e,MorphWeights:he,CurrentComponentSIDs:ue,AlphaCutoff:de,AlphaTexture:me,MakeOutputSrgb:fe,FramebufferWidth:pe,IsOutputHDR:Pe,BaseColorTextureTransform:Me,BaseColorTextureRotation:De,NormalTextureTransform:Ne,NormalTextureRotation:Be,MetallicRoughnessTextureTransform:Le,MetallicRoughnessTextureRotation:Fe,NormalTexcoordIndex:Ge,BaseColorTexcoordIndex:ze,MetallicRoughnessTexcoordIndex:Ve,OcclusionTexcoordIndex:Oe,OcclusionTextureTransform:Ue,OcclusionTextureRotation:ke,EmissiveTexcoordIndex:Qe,EmissiveTextureTransform:We,EmissiveTextureRotation:Xe,NormalScale:qe,OcclusionStrength:He,envRotation:je,EnvHdriFormat:Ye,VrState:Ke,EnableLinearToSrgb:Je,SpecularFactor:Ze,SpecularTexture:$e,SpecularColorFactor:et,SpecularColorTexture:tt,Ior:nt,DepthBiasPV:it,ClearCoatTextureTransform:ot,ClearCoatTextureRotation:at,ClearCoatRoughnessTextureTransform:rt,ClearCoatRoughnessTextureRotation:st,ClearCoatNormalTextureTransform:lt,ClearCoatNormalTextureRotation:ct,ClearCoatTexcoordIndex:_t,ClearCoatRoughnessTexcoordIndex:ht,ClearCoatNormalTexcoordIndex:ut,IridescenceFactor:dt,IridescenceTexture:mt,IridescenceIor:ft,IridescenceThicknessMinimum:pt,IridescenceThicknessMaximum:vt,IridescenceThicknessTexture:At,GaussianKernelSize:yt,GaussianRatio:bt,IsHorizontal:Et,AnisotropyStrength:xt,AnisotropyRotation:gt,AnisotropyTexture:It})},1181:(e,t,n)=>{"use strict";n.d(t,{K:()=>o,V:()=>a});var i=n(810);function o(e){const t=e.compositionType.getNumberOfComponents()*e.componentType.getSizeInBytes();let n=t;if(n%16!=0&&(n=t+16-t%16),i.d.isArray(e.compositionType)){const t=e.arrayLength;null!=t?n*=t:(console.error("semanticInfo has invalid maxIndex!"),n*=100)}return n}function a(e){return e.semantic.index}},5324:(e,t,n)=>{"use strict";n.d(t,{H:()=>_});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:1,str:"VertexShader"}),r=new o({index:2,str:"PixelShader"}),s=new o({index:3,str:"VertexAndPixelShader"}),l=new o({index:4,str:"ComputeShader"}),c=[a,r,s,l],_=Object.freeze({VertexShader:a,PixelShader:r,VertexAndPixelShader:s,ComputeShader:l,from:function(e){return(0,i.li)({typeList:c,index:e})},fromString:function(e){return(0,i.cu)({typeList:c,str:e})}})},1813:(e,t,n)=>{"use strict";n.d(t,{a:()=>c});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:0,str:"FirstTimeOnly"}),r=new o({index:1,str:"EveryTime"}),s=new o({index:2,str:"RenderPass"}),l=[a,r,s],c=Object.freeze({FirstTimeOnly:a,EveryTime:r,RenderPass:s,from:function(e){return(0,i.li)({typeList:l,index:e})},fromString:function(e){return(0,i.cu)({typeList:l,str:e})}})},9840:(e,t,n)=>{"use strict";n.d(t,{D:()=>h});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:-1,str:"UNKNOWN"}),r=new o({index:0,str:"CONSTANT"}),s=new o({index:1,str:"LAMBERT"}),l=new o({index:2,str:"BLINN"}),c=new o({index:3,str:"PHONG"}),_=[a,r,s,l,c],h=Object.freeze({Unknown:a,Constant:r,Lambert:s,BlinnPhong:l,Phong:c,from:function(e){return(0,i.li)({typeList:_,index:e})}})},5981:(e,t,n)=>{"use strict";n.d(t,{d:()=>O});var i=n(10),o=n(2343),a=n(9216);class r extends o.Jx{constructor({index:e,str:t,webgpu:n}){super({index:e,str:t}),this.__webgpu=n}get webgpu(){if(void 0===this.__webgpu)throw new Error(`does not support ${this.str}`);return this.__webgpu}}const s=new r({index:9728,str:"NEAREST",webgpu:"nearest"}),l=new r({index:9729,str:"LINEAR",webgpu:"linear"}),c=new r({index:9984,str:"NEAREST_MIPMAP_NEAREST",webgpu:"nearest"}),_=new r({index:9985,str:"LINEAR_MIPMAP_NEAREST",webgpu:"linear"}),h=new r({index:9986,str:"NEAREST_MIPMAP_LINEAR",webgpu:"nearest"}),u=new r({index:9987,str:"LINEAR_MIPMAP_LINEAR",webgpu:"linear"}),d=new r({index:10240,str:"TEXTURE_MAG_FILTER"}),m=new r({index:10241,str:"TEXTURE_MIN_FILTER"}),f=new r({index:10242,str:"TEXTURE_WRAP_S"}),p=new r({index:10243,str:"TEXTURE_WRAP_T"}),v=new r({index:3553,str:"TEXTURE_2D"}),A=new r({index:5890,str:"TEXTURE"}),y=new r({index:33984,str:"TEXTURE0"}),x=new r({index:33985,str:"TEXTURE1"}),g=new r({index:34016,str:"ACTIVE_TEXTURE"}),I=new r({index:10497,str:"REPEAT",webgpu:"repeat"}),b=new r({index:33071,str:"CLAMP_TO_EDGE",webgpu:"clamp-to-edge"}),E=new r({index:33648,str:"MIRRORED_REPEAT",webgpu:"mirror-repeat"}),T=new r({index:32849,str:"RGB8"}),S=new r({index:32856,str:"RGBA8",webgpu:"rgba8unorm"}),C=new r({index:32857,str:"RGB10_A2"}),w=new r({index:i.uLG,str:"RG16F"}),R=new r({index:i.uM4,str:"RG32F"}),P=new r({index:34843,str:"RGB16F"}),M=new r({index:34837,str:"RGB32F"}),D=new r({index:34842,str:"RGBA16F"}),N=new r({index:34836,str:"RGBA32F"}),B=new r({index:33189,str:"DEPTH_COMPONENT16"}),L=new r({index:33190,str:"DEPTH_COMPONENT24"}),F=new r({index:36012,str:"DEPTH_COMPONENT32F"}),G=new r({index:35056,str:"DEPTH24_STENCIL8"}),z=new r({index:36013,str:"DEPTH32F_STENCIL8"}),V=[s,l,c,_,h,u,d,m,f,p,v,A,y,x,g,I,b,E,T,S,C,w,R,P,M,D,N,B,L,F,G,z],O=Object.freeze({Nearest:s,Linear:l,NearestMipmapNearest:c,LinearMipmapNearest:_,NearestMipmapLinear:h,LinearMipmapLinear:u,TextureMagFilter:d,TextureMinFilter:m,TextureWrapS:f,TextureWrapT:p,Texture2D:v,Texture:A,Texture0:y,Texture1:x,ActiveTexture:g,Repeat:I,ClampToEdge:b,MirroredRepeat:E,RGB8:T,RGBA8:S,RGB10_A2:C,RG16F:w,RG32F:R,RGB16F:P,RGB32F:M,RGBA16F:D,RGBA32F:N,Depth16:B,Depth24:L,Depth32F:F,Depth24Stencil8:G,Depth32FStencil8:z,from:function(e){return(0,o.li)({typeList:V,index:e})},migrateToWebGL1InternalFormat:function(e){if(e.index===S.index)return a.V.RGBA;if(e.index===T.index)return a.V.RGB;throw new Error("Unsupported texture parameter")}})},128:(e,t,n)=>{"use strict";n.d(t,{T:()=>g,x:()=>a});var i=n(2343),o=n(3738);class a extends i.Jx{constructor({str:e,shaderStr:t,attributeSlot:n,gltfComponentN:i}){super({index:a.__indexCount++,str:e}),this.__attributeSlot=n,this.__shaderStr=t,this.__gltfComponentN=i}getAttributeSlot(){return this.__attributeSlot}get shaderStr(){return this.__shaderStr}get attributeTypeName(){return this.str}_setShaderStr(e){this.__shaderStr=this.__shaderStr+e}get X(){return`${this.attributeTypeName}.X`}get Y(){return`${this.attributeTypeName}.Y`}get Z(){return`${this.attributeTypeName}.Z`}get W(){return`${this.attributeTypeName}.W`}get XY(){return`${this.attributeTypeName}.X,${this.attributeTypeName}.Y`}get XYZ(){return`${this.attributeTypeName}.X,${this.attributeTypeName}.Y,${this.attributeTypeName}.Z`}get XYZW(){return`${this.attributeTypeName}.X,${this.attributeTypeName}.Y,${this.attributeTypeName}.Z,${this.attributeTypeName}.W`}getVertexAttributeComponentsAsGltf(){if(1===this.__gltfComponentN)return this.X;if(2===this.__gltfComponentN)return this.XY;if(3===this.__gltfComponentN)return this.XYZ;if(4===this.__gltfComponentN)return this.XYZW;throw new o.Mr({message:"Invalid gltf component number",error:this.__gltfComponentN})}static __createVertexAttributeClass(e){return new a(e)}}a.__indexCount=-1;const r=a.__createVertexAttributeClass({str:"UNKNOWN",shaderStr:"a_unknown",attributeSlot:-1,gltfComponentN:0}),s=a.__createVertexAttributeClass({str:"POSITION",shaderStr:"a_position",attributeSlot:0,gltfComponentN:3}),l=a.__createVertexAttributeClass({str:"NORMAL",shaderStr:"a_normal",attributeSlot:1,gltfComponentN:3}),c=a.__createVertexAttributeClass({str:"TANGENT",shaderStr:"a_tangent",attributeSlot:2,gltfComponentN:3}),_=a.__createVertexAttributeClass({str:"TEXCOORD_0",shaderStr:"a_texcoord_0",attributeSlot:3,gltfComponentN:2}),h=a.__createVertexAttributeClass({str:"TEXCOORD_1",shaderStr:"a_texcoord_1",attributeSlot:4,gltfComponentN:2}),u=a.__createVertexAttributeClass({str:"COLOR_0",shaderStr:"a_color_0",attributeSlot:5,gltfComponentN:4}),d=a.__createVertexAttributeClass({str:"JOINTS_0",shaderStr:"a_joints_0",attributeSlot:6,gltfComponentN:4}),m=a.__createVertexAttributeClass({str:"WEIGHTS_0",shaderStr:"a_weights_0",attributeSlot:7,gltfComponentN:4}),f=a.__createVertexAttributeClass({str:"INSTANCE",shaderStr:"a_instanceInfo",attributeSlot:8,gltfComponentN:4}),p=a.__createVertexAttributeClass({str:"FACE_NORMAL",shaderStr:"a_faceNormal",attributeSlot:9,gltfComponentN:3}),v=a.__createVertexAttributeClass({str:"BARY_CENTRIC_COORD",shaderStr:"a_baryCentricCoord",attributeSlot:10,gltfComponentN:3}),A=a.__createVertexAttributeClass({str:"TEXCOORD_2",shaderStr:"a_texcoord_2",attributeSlot:11,gltfComponentN:2}),y=[r,s,l,c,_,h,u,d,m,f,p,v,A],x=y.length-1,g=Object.freeze({Unknown:r,Position:s,Normal:l,Tangent:c,Texcoord0:_,Texcoord1:h,Color0:u,Joints0:d,Weights0:m,Instance:f,FaceNormal:p,BaryCentricCoord:v,AttributeTypeNumber:x,isInstanceOfVertexAttributeClass:function(e){return e instanceof a},toVertexAttributeSemanticJoinedStringAsGltfStyle:function(e){switch(e){case s:case u:case l:case c:return e.XYZ;case _:case h:case A:return e.XY;case d:case m:case f:case p:case v:return e.XYZW;default:throw new Error("Invalied glTF VertexAttributeEnum")}},toAttributeSlotFromJoinedString:function(e){switch(e){case s.XYZ:return s.getAttributeSlot();case u.XYZ:return u.getAttributeSlot();case l.XYZ:return l.getAttributeSlot();case c.XYZ:return c.getAttributeSlot();case _.XY:return _.getAttributeSlot();case h.XY:return h.getAttributeSlot();case A.XY:return A.getAttributeSlot();case d.XYZW:return d.getAttributeSlot();case m.XYZW:return m.getAttributeSlot();case f.XYZW:return f.getAttributeSlot();case p.XYZ:return p.getAttributeSlot();case v.XYZ:return v.getAttributeSlot();default:throw new Error("Invalied glTF VertexAttributeEnum")}},toVectorComponentN:function(e){return e.split(",").length},from:function(e){return(0,i.li)({typeList:y,index:e})},fromString:function(e){let t=e;return"COLOR"===e?t="COLOR_0":"TEXCOORD"===e?t="TEXCOORD_0":"JOINTS"===e?t="JOINTS_0":"WEIGHTS"===e&&(t="WEIGHTS_0"),(0,i.cu)({typeList:y,str:t})}})},1296:(e,t,n)=>{"use strict";n.d(t,{Fv:()=>i.F,sd:()=>o.s,kO:()=>a.k,l6:()=>r.l,Nh:()=>s.N,$H:()=>l.$,My:()=>c.M,iM:()=>_.i,re:()=>h.r,dh:()=>u.d,bf:()=>d.b,Tv:()=>m.T,cz:()=>f.c,vB:()=>p.v,VI:()=>v.V,Tc:()=>A.T,V7:()=>y.V,yv:()=>y.y,Iq:()=>x.I,G2:()=>g.G,Zp:()=>I.Z,f5:()=>b.f5,wy:()=>b.wy,Ho:()=>T.H,Lv:()=>M,ax:()=>D.a,DA:()=>N.D,J1:()=>z,dI:()=>V.d,T:()=>O.T,x$:()=>O.x,EE:()=>q,Vl:()=>E.V,UL:()=>b.UL,Ky:()=>E.K});var i=n(5704),o=n(3498),a=n(7305),r=n(290),s=n(1226),l=n(752),c=n(8914),_=n(9646),h=n(3999),u=n(810),d=n(1715),m=n(7338),f=n(1986),p=n(5634),v=n(9216),A=n(8696),y=n(7683),x=n(4507),g=n(8422),I=n(3591),b=n(4587),E=n(1181),T=n(5324),S=n(2343);class C extends S.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const w=new C({index:1,str:"Varying"}),R=new C({index:2,str:"ReadOnlyData"}),P=[w,R],M=Object.freeze({Varying:w,ReadOnlyData:R,from:function(e){return(0,S.li)({typeList:P,index:e})},fromString:function(e){return(0,S.cu)({typeList:P,str:e})}});var D=n(1813),N=n(9840);class B extends S.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const L=new B({index:0,str:"Standard"}),F=new B({index:1,str:"Variance"}),G=[L,F],z=Object.freeze({Standard:L,Variance:F,from:function(e){return(0,S.li)({typeList:G,index:e})},fromString:function(e){return(0,S.cu)({typeList:G,str:e})}});var V=n(5981),O=n(128);class U extends S.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const k=new U({index:0,str:"Neutral"}),Q=new U({index:1,str:"Visible"}),W=new U({index:-1,str:"Invisible"}),X=[Q,W,k],q=Object.freeze({Visible:Q,Invisible:W,Neutral:k,from:function(e){return(0,S.li)({typeList:X,index:e})},fromString:function(e){return(0,S.cu)({typeList:X,str:e})}})},6477:(e,t,n)=>{"use strict";n.d(t,{i:()=>s});var i=n(7192),o=n(5467),a=n(3496),r=n(4536);class s{constructor(){this.top=r.xQ.zero(),this.bottom=r.xQ.zero(),this.right=r.xQ.zero(),this.left=r.xQ.zero(),this.zNear=r.xQ.zero(),this.zFar=r.xQ.zero(),this.__updated=!1,this.__vp=a.e.zero(),this.__invProjMat=a.e.zero(),this.__invViewMat=a.e.zero(),this.corners=[]}update(e,t){o.J.multiplyTo(t,e,this.__vp),this.zNear.x=this.__vp.m20+this.__vp.m30,this.zNear.y=this.__vp.m21+this.__vp.m31,this.zNear.z=this.__vp.m22+this.__vp.m32,this.zNear.w=this.__vp.m23+this.__vp.m33,this.zFar.x=-this.__vp.m20+this.__vp.m30,this.zFar.y=-this.__vp.m21+this.__vp.m31,this.zFar.z=-this.__vp.m22+this.__vp.m32,this.zFar.w=-this.__vp.m23+this.__vp.m33,this.bottom.x=this.__vp.m10+this.__vp.m30,this.bottom.y=this.__vp.m11+this.__vp.m31,this.bottom.z=this.__vp.m12+this.__vp.m32,this.bottom.w=this.__vp.m13+this.__vp.m33,this.top.x=-this.__vp.m10+this.__vp.m30,this.top.y=-this.__vp.m11+this.__vp.m31,this.top.z=-this.__vp.m12+this.__vp.m32,this.top.w=-this.__vp.m13+this.__vp.m33,this.left.x=this.__vp.m00+this.__vp.m30,this.left.y=this.__vp.m01+this.__vp.m31,this.left.z=this.__vp.m02+this.__vp.m32,this.left.w=this.__vp.m03+this.__vp.m33,this.right.x=-this.__vp.m00+this.__vp.m30,this.right.y=-this.__vp.m01+this.__vp.m31,this.right.z=-this.__vp.m02+this.__vp.m32,this.right.w=-this.__vp.m03+this.__vp.m33;const n=[i.Lt.fromCopy4(-1,1,1,1),i.Lt.fromCopy4(1,1,1,1),i.Lt.fromCopy4(1,-1,1,1),i.Lt.fromCopy4(-1,-1,1,1),i.Lt.fromCopy4(-1,1,-1,1),i.Lt.fromCopy4(1,1,-1,1),i.Lt.fromCopy4(1,-1,-1,1),i.Lt.fromCopy4(-1,-1,-1,1)];o.J.invertTo(t,this.__invProjMat),o.J.invertTo(e,this.__invViewMat);for(let e=0;e<8;e++)n[e]=this.__invProjMat.multiplyVector(n[e]),n[e]=i.Lt.fromCopy4(n[e].x/n[e].w,n[e].y/n[e].w,n[e].z/n[e].w,1),this.corners[e]=this.__invViewMat.multiplyVector(n[e])}culling(e){const t=e.entity.getSceneGraph().worldAABB;for(let e=0;e<6;e++){let n=0;const i=this.getPlane(e);if(n+=i.x*t.minPoint.x+i.y*t.minPoint.y+i.z*t.minPoint.z+i.w<0?1:0,n+=i.x*t.maxPoint.x+i.y*t.minPoint.y+i.z*t.minPoint.z+i.w<0?1:0,n+=i.x*t.minPoint.x+i.y*t.maxPoint.y+i.z*t.minPoint.z+i.w<0?1:0,n+=i.x*t.maxPoint.x+i.y*t.maxPoint.y+i.z*t.minPoint.z+i.w<0?1:0,n+=i.x*t.minPoint.x+i.y*t.minPoint.y+i.z*t.maxPoint.z+i.w<0?1:0,n+=i.x*t.maxPoint.x+i.y*t.minPoint.y+i.z*t.maxPoint.z+i.w<0?1:0,n+=i.x*t.minPoint.x+i.y*t.maxPoint.y+i.z*t.maxPoint.z+i.w<0?1:0,n+=i.x*t.maxPoint.x+i.y*t.maxPoint.y+i.z*t.maxPoint.z+i.w<0?1:0,8===n)return!1}let n=0;n=0;for(let e=0;e<8;e++)n+=this.corners[e].x>t.maxPoint.x?1:0;if(8===n)return!1;n=0;for(let e=0;e<8;e++)n+=this.corners[e].xt.maxPoint.y?1:0;if(8===n)return!1;n=0;for(let e=0;e<8;e++)n+=this.corners[e].yt.maxPoint.z?1:0;if(8===n)return!1;n=0;for(let e=0;e<8;e++)n+=this.corners[e].z{"use strict";n.d(t,{K:()=>m});var i=n(128),o=n(8696),a=n(9286),r=n(752),s=n(3999),l=n(810),c=n(2471),_=n(2477),h=n(7987),u=n(9190),d=n(4690);class m{constructor(){this.__primitives=[],this.__opaquePrimitives=[],this.__transparentPrimitives=[],this.__morphPrimitives=[],this.__localAABB=new _.m,this.__vaoUids=[],this.__variationVBOUid=h.F.InvalidCGAPIResourceUid,this.__latestPrimitivePositionAccessorVersion=0,this.__belongToEntities=[],this.tangentCalculationMode=1,this.__hasFaceNormal=!1,this.__meshUID=++m.__mesh_uid_count}getVaoUids(e){return this.__vaoUids[e]}getVaoUidsByPrimitiveUid(e){const t=this.__primitives.findIndex((t=>t.primitiveUid===e));return this.__vaoUids[t]}get meshEntitiesInner(){return this.__belongToEntities}_belongToMeshComponent(e){this.__belongToEntities.push(e.entity)}addPrimitive(e){e._belongToMesh(this),null!=e.material&&e.material.isBlend()?this.__transparentPrimitives.push(e):this.__opaquePrimitives.push(e),this.__setPrimitives(this.__opaquePrimitives.concat(this.__transparentPrimitives))}__setPrimitives(e){this.__primitives=e}isAllBlend(){return this.__transparentPrimitives.length>0&&0===this.__opaquePrimitives.length}isBlendPartially(){return this.__transparentPrimitives.length>0&&this.__opaquePrimitives.length>0}isOpaque(){return 0===this.__transparentPrimitives.length&&this.__opaquePrimitives.length>0}getPrimitiveAt(e){return this.__primitives[e]}getPrimitiveNumber(){return this.__primitives.length}updateVariationVBO(){const e=h.F.getCgApiResourceRepository();this.__variationVBOUid!==h.F.InvalidCGAPIResourceUid&&e.deleteVertexBuffer(this.__variationVBOUid);const t=this.__belongToEntities.length,n=new Float32Array(4*t);for(let e=0;e{const o=t.getAttribute(i),a=o.elementCount;for(let e=0;e{"use strict";n.d(t,{W:()=>y});var i=n(8696),o=n(128),a=n(9002),r=n(3999),s=n(9286),l=n(810),c=n(2477),_=n(3913),h=n(7987),u=n(2471),d=n(9190),m=n(4690),f=n(4339),p=n(2852),v=n(6312),A=n(3449);class y extends a.S{constructor(){super(),this.__mode=i.T.Unknown,this.__material=_.G.createEmptyMaterial(),this.__materialVariants=new Map,this.__currentVariantName=void 0,this._prevMaterial=_.G.createEmptyMaterial(),this.__attributes=new Map,this.__oIndices=new v.Hq,this.__primitiveUid=-1,this.__aabb=new c.m,this.__targets=[],this.__latestPositionAccessorVersion=0,this.__woMesh=new p.Lq,this._sortkey=0,this._viewDepth=0}getIndexBitSize(){const e=this.__oIndices.unwrapOrUndefined();if(null==e)throw new Error("indexAccessor is null");if(e.componentType===r.r.UnsignedShort)return"uint16";if(e.componentType===r.r.UnsignedInt)return"uint32";throw new Error("unknown indexAccessor.componentType")}get _vertexHandles(){return this.__vertexHandles}setMaterialVariant(e,t){this.__materialVariants.set(e,t)}applyMaterialVariant(e){const t=this.__materialVariants.get(e);t&&(this.material=t,this.__currentVariantName=e)}getVariantNames(){return Array.from(this.__materialVariants.keys())}getVariantMaterial(e){return this.__materialVariants.get(e)}set material(e){this.__material=e,this.setSortKey(f.Yx,e.alphaMode.index),e._addBelongPrimitive(this)}get material(){return this.__material}setSortKey(e,t){const n=t<{c+=e.byteLength}));let _=c;null!=i&&(_+=A.j.addPaddingBytes(i.byteLength,4));const h=s.B.getInstance().createBufferOnDemand(_,this,4);let u,d,m;if(null!=i){u=r.r.fromTypedArray(i),d=h.takeBufferView({byteLengthToNeed:i.byteLength,byteStride:0}).unwrapForce(),m=d.takeAccessor({compositionType:l.d.Scalar,componentType:u,count:i.byteLength/u.getSizeInBytes()}).unwrapForce();for(let e=0;e{const a=l.d.vectorFrom(o.T.toVectorComponentN(t[i]));v[i]=r.r.fromTypedArray(e[i]);const s=f.takeAccessor({compositionType:a,componentType:r.r.fromTypedArray(e[i]),count:n.byteLength/a.getNumberOfComponents()/v[i].getSizeInBytes()}).unwrapForce();s.copyFromTypedArray(n),p.push(s)}));const y=new Map;for(let e=0;e{e.push(t)})),e}getAttribute(e){return this.__attributes.get(e)}get attributeSemantics(){const e=[];return this.__attributes.forEach(((t,n)=>{e.push(n)})),e}get attributeEntries(){return this.__attributes.entries()}get attributeCompositionTypes(){const e=[];return this.__attributes.forEach(((t,n)=>{e.push(t.compositionType)})),e}get attributeComponentTypes(){const e=[];return this.__attributes.forEach(((t,n)=>{e.push(t.componentType)})),e}get primitiveMode(){return this.__mode}get primitiveUid(){return this.__primitiveUid}get positionAccessorVersion(){if(null!=this.__cachePositionAccessor)return this.__cachePositionAccessor.version;{const e=this.__attributes.get(o.T.Position.XYZ);return null!=e?(this.__cachePositionAccessor=e,e.version):void 0}}get AABB(){if(this.__aabb.isVanilla()||this.positionAccessorVersion!==this.__latestPositionAccessorVersion){const e=this.__attributes.get(o.T.Position.XYZ),t=e.min;this.__aabb.minPoint=y.__tmpVec3_0.setComponents(t[0],t[1],t[2]);const n=e.max;this.__aabb.maxPoint=y.__tmpVec3_0.setComponents(n[0],n[1],n[2]),this.__latestPositionAccessorVersion=e.version}return this.__aabb}setVertexAttribute(e,t){this.__attributes.set(t,e)}removeIndices(){this.__oIndices=new v.Hq}setIndices(e){this.__oIndices=new v.bD(e)}setBlendShapeTargets(e){this.__targets=e}getBlendShapeTargets(){return this.__targets.concat()}get targets(){return this.__targets}isBlend(){return!(null==this.material||!this.material.isBlend())}isOpaque(){return!this.isBlend()}create3DAPIVertexData(){if(null!=this.__vertexHandles)return!1;const e=h.F.getCgApiResourceRepository();return this.__vertexHandles=e.createVertexBufferAndIndexBuffer(this),!0}update3DAPIVertexData(){const e=this.__vertexHandles;return!m.Is.not.exist(this.__vertexHandles)&&(h.F.getCgApiResourceRepository().updateVertexBufferAndIndexBuffer(this,e),!0)}delete3DAPIVertexData(){return null!=this.__vertexHandles&&(h.F.getWebGLResourceRepository().deleteVertexDataResources(this.__vertexHandles),this.__vertexHandles=void 0,!0)}get vertexHandles(){return this.__vertexHandles}castRay(e,t,n,o,a,r){let s=Number.MAX_VALUE,l=3;if(this.__mode===i.T.TriangleStrip)l=1;else if(this.__mode===i.T.Points)return{result:!1};let c=0,_=0,h=0,d=0;if(this.hasIndices()){const i=this.__oIndices.unwrapForce();for(let u=0;ui.elementCount-1)break;const p=i.getScalar(f,{}),v=i.getScalar(f+1,{}),A=i.getScalar(f+2,{}),y=this.__castRayInnerTomasMoller(e,t,u,p,v,A,n,o,a,r);m.Is.false(y)||m.Is.not.exist(y.data)||y.data.t-c&&!l)return{result:!1}}}const h=this.__attributes.get(o.T.Position.XYZ),m=h.getVec3(i,{}),f=h.getVec3(a,{}),p=h.getVec3(r,{}),v=d.d6.zero(),A=d.d6.zero(),y=d.d6.zero(),x=d.d6.zero(),g=d.d6.zero();let I=0,b=0;d.d6.subtractTo(f,m,v),d.d6.subtractTo(p,m,A),d.d6.crossTo(t,A,y);const E=u.P.dot(v,y);if(E>1e-4){if(d.d6.subtractTo(e,m,x),I=u.P.dot(x,y),I<0||I>E)return{result:!1};if(d.d6.crossTo(x,v,g),b=u.P.dot(t,g),b<0||I+b>E)return{result:!1}}else{if(!(E<-1e-4))return{result:!1};if(d.d6.subtractTo(e,m,x),I=u.P.dot(x,y),I>0||I0||I+b{"use strict";n.d(t,{X:()=>l});var i=n(8696),o=n(128),a=n(2471),r=n(4690),s=n(3713);class l extends s.A{generate(e){var t;const n={widthVector:null!==(t=e.widthVector)&&void 0!==t?t:a.P.fromCopy3(1,1,1),color:e.color,material:e.material},s=[-n.widthVector.x/2,n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,-n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,-n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,-n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,-n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,-n.widthVector.y/2,n.widthVector.z/2,n.widthVector.x/2,-n.widthVector.y/2,n.widthVector.z/2,n.widthVector.x/2,n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,-n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,-n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,n.widthVector.y/2,-n.widthVector.z/2,-n.widthVector.x/2,n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,-n.widthVector.y/2,-n.widthVector.z/2,n.widthVector.x/2,-n.widthVector.y/2,n.widthVector.z/2,n.widthVector.x/2,n.widthVector.y/2,n.widthVector.z/2,n.widthVector.x/2,n.widthVector.y/2,-n.widthVector.z/2,-n.widthVector.x/2,-n.widthVector.y/2,-n.widthVector.z/2,-n.widthVector.x/2,-n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,n.widthVector.y/2,n.widthVector.z/2,-n.widthVector.x/2,n.widthVector.y/2,-n.widthVector.z/2],l=r.Is.not.exist(n.color)?[]:[n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a,n.color.r,n.color.g,n.color.b,n.color.a],c=[o.T.Position.XYZ,o.T.Normal.XYZ,o.T.Texcoord0.XY],_=[new Float32Array(s),new Float32Array([0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),new Float32Array([0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,1])];r.Is.exist(n.color)&&(c.push(o.T.Color0.XYZ),_.push(new Float32Array(l)));const h=i.T.Triangles;this.copyVertexData({attributes:_,attributeSemantics:c,primitiveMode:h,indices:new Uint16Array([3,1,0,2,1,3,4,5,7,7,5,6,8,9,11,11,9,10,15,13,12,14,13,15,19,17,16,18,17,19,20,21,23,23,21,22]),material:n.material})}}},3713:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(1845);class o extends i.W{}},9561:(e,t,n)=>{"use strict";n.d(t,{J:()=>r});var i=n(128),o=n(8696),a=n(3713);class r extends a.A{generate(e){var t,n,a,r,s,l;const c={width:null!==(t=e.width)&&void 0!==t?t:1,height:null!==(n=e.height)&&void 0!==n?n:1,uSpan:null!==(a=e.uSpan)&&void 0!==a?a:1,vSpan:null!==(r=e.vSpan)&&void 0!==r?r:1,isUVRepeat:null!==(s=e.isUVRepeat)&&void 0!==s&&s,flipTextureCoordinateY:null!==(l=e.flipTextureCoordinateY)&&void 0!==l&&l,material:e.material},_=[];for(let e=0;e<=c.vSpan;e++)for(let t=0;t<=c.uSpan;t++)_.push((t/c.uSpan-.5)*c.width),_.push(0),_.push((e/c.vSpan-.5)*c.height);const h=[];for(let e=0;e{"use strict";n.d(t,{BH:()=>c,IM:()=>a,Qo:()=>_,V_:()=>s,Y1:()=>r,Yx:()=>l,aK:()=>i,xz:()=>o});const i=3,o=10,a=2,r=0,s=i,l=i+o,c=i+o+a,_=32},817:(e,t,n)=>{"use strict";n.d(t,{q:()=>h});var i=n(8082),o=n(8696),a=n(128),r=n(1845),s=n(2471),l=n(6214),c=n(7973),_=n(4690);class h extends i.t{constructor(e){super(e)}get isSetup(){return null!=this.__topEntity}_setup(){if(this.__toSkipSetup())return;this.__topEntity=c._.createMeshEntity(),this.__topEntity.tryToSetUniqueName(`AABBGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph());const e=this.__topEntity.tryToGetMesh();h.__mesh=new l.K,h.__mesh.addPrimitive(h.generatePrimitive()),e.setMesh(h.__mesh),this.setGizmoTag()}static generatePrimitive(){const e=new Uint32Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,3,3,7,7,4,4,0,1,2,2,6,6,5,5,1,0,1,1,5,5,4,4,0,3,2,2,6,6,7,7,3]),t=new Float32Array([-1,-1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,1,1]);return r.W.createPrimitive({indices:e,attributeSemantics:[a.T.Position.XYZ],attributes:[t],primitiveMode:o.T.Lines})}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph().worldAABB;this.__topEntity.getTransform().localPosition=e.centerPoint,this.__topEntity.getTransform().localScale=s.P.fromCopyArray([e.sizeX/2,e.sizeY/2,e.sizeZ/2])}_destroy(){_.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}}},8082:(e,t,n)=>{"use strict";n.d(t,{t:()=>a});var i=n(9002),o=n(8491);class a extends i.S{constructor(e){super(),this.__isVisible=!1,this.__target=e,this.setGizmoTag()}set isVisible(e){this.__setVisible(e)}get isVisible(){return this.__isVisible}__setVisible(e){this.__isVisible=e,this.__topEntity&&this.__topEntity.getSceneGraph().setVisibilityRecursively(e)}__toSkipSetup(){return!!this.isSetup||!!this.__target.matchTag("Being","gizmo")}setGizmoTag(){if(this.__topEntity){this.__topEntity.tryToSetTag({tag:"Being",value:"gizmo"}),this.__topEntity.tryToSetTag({tag:"Gizmo",value:"top"});const e=o.a.flattenHierarchy(this.__topEntity.getSceneGraph(),!1);for(const t of e)t.entity.tryToSetTag({tag:"Being",value:"gizmo"});this.__topEntity.tryToSetTag({tag:"type",value:"background-assets"})}}}},7326:(e,t,n)=>{"use strict";n.d(t,{k:()=>h});var i=n(8696),o=n(128),a=n(6214),r=n(1845),s=n(7973),l=n(2471),c=n(4690),_=n(8082);class h extends _.t{constructor(e){super(e)}get isSetup(){return null!=this.__topEntity}set length(e){h.__length=e}get length(){return h.__length}_setup(){if(this.__toSkipSetup())return;this.__topEntity=s._.createMeshEntity(),this.__topEntity.tryToSetUniqueName(`LocatorGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph());const e=this.__topEntity.tryToGetMesh();h.__mesh=new a.K,h.__mesh.addPrimitive(h.__generatePrimitive()),e.setMesh(h.__mesh),this.setGizmoTag()}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph(),t=e.worldAABB;t.isVanilla()?this.__topEntity.getTransform().localPosition=e.position:this.__topEntity.getTransform().localPosition=t.centerPoint,this.__topEntity.getTransform().localScale=l.P.fromCopyArray([Math.max(1,t.isVanilla()?1:t.sizeX/2),Math.max(1,t.isVanilla()?1:t.sizeY/2),Math.max(1,t.isVanilla()?1:t.sizeZ/2)])}static __generatePrimitive(){const e=new Float32Array([0,0,0,this.__length,0,0,0,0,0,0,this.__length,0,0,0,0,0,0,this.__length]),t=new Float32Array([1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1]);return r.W.createPrimitive({attributeSemantics:[o.T.Position.XYZ,o.T.Color0.XYZ],attributes:[e,t],primitiveMode:i.T.Lines})}_destroy(){c.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}}h.__length=1},7859:(e,t,n)=>{"use strict";n.d(t,{q:()=>C});var i=n(224),o=n(2404),a=n(3258),r=n(5704),s=n(8696),l=n(4587),c=n(128),_=n(6214),h=n(1845),u=n(7597),d=n(9561),m=n(7973),f=n(3913),p=n(3032),v=n(1937),A=n(5467),y=n(2566),x=n(9207),g=n(2471),I=n(7192),b=n(4690),E=n(6098),T=n(4742),S=n(8082);class C extends S.t{constructor(e){super(e),this.__pickStatedPoint=g.P.zero(),this.__deltaPoint=g.P.one(),this.__targetScaleBackup=g.P.one(),this.__isPointerDown=!1,this.__onPointerDownFunc=this.__onPointerDown.bind(this),this.__onPointerMoveFunc=this.__onPointerMove.bind(this),this.__onPointerUpFunc=this.__onPointerUp.bind(this)}get isSetup(){return null!=this.__topEntity}set length(e){C.__length=e}get length(){return C.__length}set isVisible(e){if(!1===this.__isVisible&&!0===e){let e=window;if(b.Is.exist(a.D.eventTargetDom)&&(e=a.D.eventTargetDom),T.$t.register(T.K2,[{eventName:(0,T.EY)("start"),handler:this.__onPointerDownFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:(0,T.EY)("move"),handler:this.__onPointerMoveFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:(0,T.EY)("end"),handler:this.__onPointerUpFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:"pointerleave",handler:this.__onPointerUpFunc,options:{},classInstance:this,eventTargetDom:e}]),this.__topEntity.getSceneGraph().addChild(C.__groupEntity.getSceneGraph()),C.__latestTargetEntity=this.__target,"local"===C.__space){const e=this.__target.getSceneGraph();let t=x._.identity();b.Is.exist(e)&&(t=e.getQuaternionRecursively()),C.__groupEntity.getTransform().localRotation=t}else"world"===C.__space&&(C.__groupEntity.getTransform().localRotation=x._.fromCopy4(0,0,0,1))}!0===this.__isVisible&&!1===e&&(T.$t.unregister(T.K2),this.__deltaPoint=this.__target.getTransform().localScale,this.__pickStatedPoint=g.P.zero(),this.__isPointerDown=!1,this.__targetScaleBackup=this.__target.getTransform().localScale,C.__activeAxis="none"),T.$t.setActive(T.K2,e),this.__setVisible(e),C.__xyPlaneEntity.getSceneGraph().isVisible=!1,C.__yzPlaneEntity.getSceneGraph().isVisible=!1,C.__zxPlaneEntity.getSceneGraph().isVisible=!1}setSpace(e){C.__space=e,this.__isVisible&&(this.isVisible=!1,this.isVisible=!0)}get isVisible(){return this.__isVisible}_setup(){this.__toSkipSetup()||(this.__topEntity=m._.createGroupEntity(),this.__topEntity.tryToSetUniqueName(`ScaleGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph()),b.Is.not.exist(C.__xCubeEntity)&&(this.xMesh(),this.xEdgeMesh()),b.Is.not.exist(C.__yCubeEntity)&&(this.yMesh(),this.yEdgeMesh()),b.Is.not.exist(C.__zCubeEntity)&&(this.zMesh(),this.zEdgeMesh()),b.Is.not.exist(C.__xyPlaneEntity)&&this.xyPlane(),b.Is.not.exist(C.__yzPlaneEntity)&&this.yzPlane(),b.Is.not.exist(C.__zxPlaneEntity)&&this.zxPlane(),b.Is.not.exist(C.__groupEntity)&&(C.__groupEntity=m._.createGroupEntity()),this.__topEntity.getSceneGraph().addChild(C.__groupEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__xCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__yCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__zCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__xyPlaneEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__yzPlaneEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__zxPlaneEntity.getSceneGraph()),C.__latestTargetEntity=this.__target,this.setGizmoTag())}zxPlane(){C.__zxPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_zxPlane",!0),C.__zxPlaneEntity.getSceneGraph().isVisible=!1,C.__zxPlaneMaterial=f.G.createClassicUberMaterial(),C.__zxPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,.5,0,0])),C.__zxPlaneMaterial.alphaMode=r.F.Translucent,C.__zxPlaneMesh=new _.K,C.__zxPlanePrimitive=new d.J,C.__zxPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__zxPlaneMaterial}),C.__zxPlaneMesh.addPrimitive(C.__zxPlanePrimitive),C.__zxPlaneEntity.getMesh().setMesh(C.__zxPlaneMesh)}yzPlane(){C.__yzPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_yzPlane",!0),C.__yzPlaneEntity.getSceneGraph().isVisible=!1,C.__yzPlaneEntity.getTransform().localEulerAngles=g.P.fromCopy3(0,0,p.k.degreeToRadian(90)),C.__yzPlaneMaterial=f.G.createClassicUberMaterial(),C.__yzPlaneMaterial.alphaMode=r.F.Translucent,C.__yzPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([.5,0,0,0])),C.__yzPlaneMesh=new _.K,C.__yzPlanePrimitive=new d.J,C.__yzPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__yzPlaneMaterial}),C.__yzPlaneMesh.addPrimitive(C.__yzPlanePrimitive),C.__yzPlaneEntity.getMesh().setMesh(C.__yzPlaneMesh)}xyPlane(){C.__xyPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_xyPlane",!0),C.__xyPlaneEntity.getSceneGraph().isVisible=!1,C.__xyPlaneEntity.getTransform().localEulerAngles=g.P.fromCopy3(p.k.degreeToRadian(90),0,0),C.__xyPlaneMaterial=f.G.createClassicUberMaterial(),C.__xyPlaneMaterial.alphaMode=r.F.Translucent,C.__xyPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,0,.5,0])),C.__xyPlaneMesh=new _.K,C.__xyPlanePrimitive=new d.J,C.__xyPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__xyPlaneMaterial}),C.__xyPlaneMesh.addPrimitive(C.__xyPlanePrimitive),C.__xyPlaneEntity.getMesh().setMesh(C.__xyPlaneMesh)}zMesh(){C.__zCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_zCube",!0),C.__zCubeEntity.getTransform().localPosition=g.P.fromCopy3(0,0,1),C.__zCubeMesh=new _.K,C.__zCubeMaterial=f.G.createClassicUberMaterial(),C.__zCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,0,1,1])),C.__zCubePrimitive=new u.X,C.__zCubePrimitive.generate({widthVector:g.P.fromCopy3(.05,.05,1),material:C.__zCubeMaterial}),C.__zCubeMesh.addPrimitive(C.__zCubePrimitive),C.__zCubeEntity.getMesh().setMesh(C.__zCubeMesh)}yMesh(){C.__yCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_yCube",!0),C.__yCubeEntity.getTransform().localPosition=g.P.fromCopy3(0,1,0),C.__yCubeMesh=new _.K,C.__yCubeMaterial=f.G.createClassicUberMaterial(),C.__yCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,1,0,1])),C.__yCubePrimitive=new u.X,C.__yCubePrimitive.generate({widthVector:g.P.fromCopy3(.05,1,.05),material:C.__yCubeMaterial}),C.__yCubeMesh.addPrimitive(C.__yCubePrimitive),C.__yCubeEntity.getMesh().setMesh(C.__yCubeMesh)}xMesh(){C.__xCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("ScaleGizmo_xCube",!0),C.__xCubeEntity.getTransform().localPosition=g.P.fromCopy3(1,0,0),C.__xCubeMesh=new _.K,C.__xCubeMaterial=f.G.createClassicUberMaterial(),C.__xCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([1,0,0,1])),C.__xCubePrimitive=new u.X,C.__xCubePrimitive.generate({widthVector:g.P.fromCopy3(1,.05,.05),material:C.__xCubeMaterial}),C.__xCubeMesh.addPrimitive(C.__xCubePrimitive),C.__xCubeEntity.getMesh().setMesh(C.__xCubeMesh)}xEdgeMesh(){C.__xEdgeCubeEntity=m._.createMeshEntity(),C.__xEdgeCubeEntity.tryToSetUniqueName("ScaleGizmo_xEdgeCube",!0),C.__xEdgeCubeEntity.getTransform().localPosition=g.P.fromCopy3(1,0,0),C.__xEdgeCubeMesh=new _.K,C.__xEdgeCubePrimitive=new u.X,C.__xEdgeCubePrimitive.generate({widthVector:g.P.fromCopy3(.1,.1,.1),material:C.__xCubeMaterial}),C.__xEdgeCubeMesh.addPrimitive(C.__xEdgeCubePrimitive),C.__xEdgeCubeEntity.getMesh().setMesh(C.__xEdgeCubeMesh),C.__xCubeEntity.addChild(C.__xEdgeCubeEntity.getSceneGraph())}yEdgeMesh(){C.__yEdgeCubeEntity=m._.createMeshEntity(),C.__yEdgeCubeEntity.tryToSetUniqueName("ScaleGizmo_yEdgeCube",!0),C.__yEdgeCubeEntity.getTransform().localPosition=g.P.fromCopy3(0,1,0),C.__yEdgeCubeMesh=new _.K,C.__yEdgeCubePrimitive=new u.X,C.__yEdgeCubePrimitive.generate({widthVector:g.P.fromCopy3(.1,.1,.1),material:C.__yCubeMaterial}),C.__yEdgeCubeMesh.addPrimitive(C.__yEdgeCubePrimitive),C.__yEdgeCubeEntity.getMesh().setMesh(C.__yEdgeCubeMesh),C.__yCubeEntity.addChild(C.__yEdgeCubeEntity.getSceneGraph())}zEdgeMesh(){C.__zEdgeCubeEntity=m._.createMeshEntity(),C.__zEdgeCubeEntity.tryToSetUniqueName("ScaleGizmo_zEdgeCube",!0),C.__zEdgeCubeEntity.getTransform().localPosition=g.P.fromCopy3(0,0,1),C.__zEdgeCubeMesh=new _.K,C.__zEdgeCubePrimitive=new u.X,C.__zEdgeCubePrimitive.generate({widthVector:g.P.fromCopy3(.1,.1,.1),material:C.__zCubeMaterial}),C.__zEdgeCubeMesh.addPrimitive(C.__zEdgeCubePrimitive),C.__zEdgeCubeEntity.getMesh().setMesh(C.__zEdgeCubeMesh),C.__zCubeEntity.addChild(C.__zEdgeCubeEntity.getSceneGraph())}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph(),t=e.worldAABB;t.isVanilla()?this.__topEntity.getTransform().localPosition=e.position:this.__topEntity.getTransform().localPosition=t.centerPoint;const n=Math.max(t.sizeX,t.sizeY,t.sizeZ);this.__topEntity.getTransform().localScale=g.P.fromCopyArray([Math.min(1,t.isVanilla()?1:n/2),Math.min(1,t.isVanilla()?1:n/2),Math.min(1,t.isVanilla()?1:n/2)]),this.__isPointerDown&&C.__latestTargetEntity===this.__target&&(this.__target.getTransform().localScale=this.__deltaPoint.clone())}static __generatePrimitive(){const e=new Float32Array([0,0,0,this.__length,0,0,0,0,0,0,this.__length,0,0,0,0,0,0,this.__length]),t=new Float32Array([1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1]);return h.W.createPrimitive({attributeSemantics:[c.T.Position.XYZ,c.T.Color0.XYZ],attributes:[e,t],primitiveMode:s.T.Lines})}__onPointerDown(e){e.preventDefault(),this.__isPointerDown=!0,C.__originalX=e.clientX,C.__originalY=e.clientY;const t=this.__target.getSceneGraph().matrix.getRotate(),n=g.P.one();let i=v.h.fromCopy9RowMajor(n.x*t.m00,n.x*t.m01,n.x*t.m02,n.y*t.m10,n.y*t.m11,n.y*t.m12,n.z*t.m20,n.z*t.m21,n.z*t.m22);"local"===C.__space?i=v.h.transpose(i):"world"===C.__space&&(i=y.x.identity());const{xResult:o,yResult:a,zResult:r}=C.castRay(e);o.result&&((0,E.dK)(o.data),this.__pickStatedPoint=i.multiplyVector(o.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="x"),a.result&&((0,E.dK)(a.data),this.__pickStatedPoint=i.multiplyVector(a.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="y"),r.result&&((0,E.dK)(r.data),this.__pickStatedPoint=i.multiplyVector(r.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="z"),C.__latestTargetEntity===this.__target&&(this.__targetScaleBackup=this.__target.getTransform().localScale)}__onPointerMove(e){if(e.preventDefault(),b.Is.false(this.__isPointerDown))return;const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current),_=this.__target.getSceneGraph().matrix.getRotate(),h=g.P.one();let u=v.h.fromCopy9RowMajor(h.x*_.m00,h.x*_.m01,h.x*_.m02,h.y*_.m10,h.y*_.m11,h.y*_.m12,h.z*_.m20,h.z*_.m21,h.z*_.m22);"local"===C.__space?u=v.h.transpose(u):"world"===C.__space&&(u=y.x.identity());let d=this.__pickStatedPoint.clone();if("x"===C.__activeAxis){const e=C.__xyPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=u.multiplyVector(e.data.position);d=g.P.fromCopy3(t.x,d.y,d.z),console.log("Move:"+e.data.position.toStringApproximately())}T.$t.disableCameraController()}if("y"===C.__activeAxis){const e=C.__xyPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=u.multiplyVector(e.data.position);d=g.P.fromCopy3(d.x,t.y,d.z),console.log("Move:"+e.data.position.toStringApproximately())}T.$t.disableCameraController()}if("z"===C.__activeAxis){const e=C.__yzPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=u.multiplyVector(e.data.position);d=g.P.fromCopy3(d.x,d.y,t.z),console.log("Move:"+e.data.position.toStringApproximately())}T.$t.disableCameraController()}const m=this.__target.getSceneGraph().worldAABB,f=g.P.multiply(g.P.subtract(d,this.__pickStatedPoint),1/m.lengthCenterToCorner);if(console.log(`${this.__target.uniqueName}: `+f.toStringApproximately()),"local"===C.__space)this.__deltaPoint=g.P.add(this.__targetScaleBackup,f),this.__deltaPoint=g.P.fromCopy3(Math.max(this.__deltaPoint.x,.01),Math.max(this.__deltaPoint.y,.01),Math.max(this.__deltaPoint.z,.01));else if("world"===C.__space){const e=A.J.fromCopyQuaternion(this.__target.getSceneGraph().getQuaternionRecursively()),t=A.J.multiply(e,A.J.scale(this.__targetScaleBackup)).getScale();let n=I.Lt.add(f,t);n=I.Lt.fromCopy4(Math.max(n.x,.01),Math.max(n.y,.01),Math.max(n.z,.01),Math.max(n.w,.01)),this.__deltaPoint=A.J.multiply(A.J.invert(e),A.J.scale(n)).getScale(),this.__deltaPoint=g.P.fromCopy3(Math.max(this.__deltaPoint.x,.01),Math.max(this.__deltaPoint.y,.01),Math.max(this.__deltaPoint.z,.01))}}__onPointerUp(e){e.preventDefault(),this.__isPointerDown=!1,C.__activeAxis="none",T.$t.enableCameraController(),C.__latestTargetEntity===this.__target&&(this.__targetScaleBackup=this.__target.getTransform().localScale)}static castRay2(e){const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current);return C.__groupEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0,[])}static castRay(e){const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current);return{xResult:C.__xCubeEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0),yResult:C.__yCubeEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0),zResult:C.__zCubeEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0)}}_destroy(){b.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}}C.__originalX=0,C.__originalY=0,C.__activeAxis="none",C.__space="world",C.__length=1},9244:(e,t,n)=>{"use strict";n.d(t,{u:()=>C});var i=n(224),o=n(2404),a=n(3258),r=n(5704),s=n(8696),l=n(4587),c=n(128),_=n(6214),h=n(1845),u=n(7597),d=n(9561),m=n(7973),f=n(3913),p=n(5467),v=n(3032),A=n(1937),y=n(2566),x=n(9207),g=n(2471),I=n(7192),b=n(4690),E=n(6098),T=n(4742),S=n(8082);class C extends S.t{constructor(e){super(e),this.__pickStatedPoint=g.P.zero(),this.__deltaPoint=g.P.zero(),this.__targetPointBackup=g.P.zero(),this.__isPointerDown=!1,this.__onPointerDownFunc=this.__onPointerDown.bind(this),this.__onPointerMoveFunc=this.__onPointerMove.bind(this),this.__onPointerUpFunc=this.__onPointerUp.bind(this)}get isSetup(){return null!=this.__topEntity}set length(e){C.__length=e}get length(){return C.__length}set isVisible(e){if(!1===this.__isVisible&&!0===e){let e=window;if(b.Is.exist(a.D.eventTargetDom)&&(e=a.D.eventTargetDom),T.$t.register(T.KQ,[{eventName:(0,T.EY)("start"),handler:this.__onPointerDownFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:(0,T.EY)("move"),handler:this.__onPointerMoveFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:(0,T.EY)("end"),handler:this.__onPointerUpFunc,options:{},classInstance:this,eventTargetDom:e},{eventName:"pointerleave",handler:this.__onPointerUpFunc,options:{},classInstance:this,eventTargetDom:e}]),this.__topEntity.getSceneGraph().addChild(C.__groupEntity.getSceneGraph()),this.__latestTargetEntity=this.__target,"local"===C.__space){const e=this.__target.getSceneGraph().parent;let t=x._.identity();b.Is.exist(e)&&(t=e.getQuaternionRecursively()),C.__groupEntity.getTransform().localRotation=t}else"world"===C.__space&&(C.__groupEntity.getTransform().localRotation=x._.fromCopy4(0,0,0,1))}!0===this.__isVisible&&!1===e&&(T.$t.unregister(T.KQ),this.__deltaPoint=this.__target.getTransform().localPosition,this.__pickStatedPoint=g.P.zero(),this.__isPointerDown=!1,this.__targetPointBackup=this.__target.getTransform().localPosition,C.__activeAxis="none"),T.$t.setActive(T.KQ,e),this.__setVisible(e),C.__xyPlaneEntity.getSceneGraph().isVisible=!1,C.__yzPlaneEntity.getSceneGraph().isVisible=!1,C.__zxPlaneEntity.getSceneGraph().isVisible=!1}setSpace(e){C.__space=e,this.__isVisible&&(this.isVisible=!1,this.isVisible=!0)}get isVisible(){return this.__isVisible}_setup(){this.__toSkipSetup()||(this.__topEntity=m._.createGroupEntity(),this.__topEntity.tryToSetUniqueName(`TranslationGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph()),b.Is.not.exist(C.__xCubeEntity)&&(C.__xCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_xCube",!0),C.__xCubeEntity.getTransform().localPosition=g.P.fromCopy3(1,0,0),C.__xCubeMesh=new _.K,C.__xCubeMaterial=f.G.createClassicUberMaterial(),C.__xCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([1,0,0,1])),C.__xCubePrimitive=new u.X,C.__xCubePrimitive.generate({widthVector:g.P.fromCopy3(1,.05,.05),material:C.__xCubeMaterial}),C.__xCubeMesh.addPrimitive(C.__xCubePrimitive),C.__xCubeEntity.getMesh().setMesh(C.__xCubeMesh)),b.Is.not.exist(C.__yCubeEntity)&&(C.__yCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_yCube",!0),C.__yCubeEntity.getTransform().localPosition=g.P.fromCopy3(0,1,0),C.__yCubeMesh=new _.K,C.__yCubeMaterial=f.G.createClassicUberMaterial(),C.__yCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,1,0,1])),C.__yCubePrimitive=new u.X,C.__yCubePrimitive.generate({widthVector:g.P.fromCopy3(.05,1,.05),material:C.__yCubeMaterial}),C.__yCubeMesh.addPrimitive(C.__yCubePrimitive),C.__yCubeEntity.getMesh().setMesh(C.__yCubeMesh)),b.Is.not.exist(C.__zCubeEntity)&&(C.__zCubeEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_zCube",!0),C.__zCubeEntity.getTransform().localPosition=g.P.fromCopy3(0,0,1),C.__zCubeMesh=new _.K,C.__zCubeMaterial=f.G.createClassicUberMaterial(),C.__zCubeMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,0,1,1])),C.__zCubePrimitive=new u.X,C.__zCubePrimitive.generate({widthVector:g.P.fromCopy3(.05,.05,1),material:C.__zCubeMaterial}),C.__zCubeMesh.addPrimitive(C.__zCubePrimitive),C.__zCubeEntity.getMesh().setMesh(C.__zCubeMesh)),b.Is.not.exist(C.__xyPlaneEntity)&&(C.__xyPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_xyPlane",!0),C.__xyPlaneEntity.getSceneGraph().isVisible=!1,C.__xyPlaneEntity.getTransform().localEulerAngles=g.P.fromCopy3(v.k.degreeToRadian(90),0,0),C.__xyPlaneMaterial=f.G.createClassicUberMaterial(),C.__xyPlaneMaterial.alphaMode=r.F.Translucent,C.__xyPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,0,.5,0])),C.__xyPlaneMesh=new _.K,C.__xyPlanePrimitive=new d.J,C.__xyPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__xyPlaneMaterial}),C.__xyPlaneMesh.addPrimitive(C.__xyPlanePrimitive),C.__xyPlaneEntity.getMesh().setMesh(C.__xyPlaneMesh)),b.Is.not.exist(C.__yzPlaneEntity)&&(C.__yzPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_yzPlane",!0),C.__yzPlaneEntity.getSceneGraph().isVisible=!1,C.__yzPlaneEntity.getTransform().localEulerAngles=g.P.fromCopy3(0,0,v.k.degreeToRadian(90)),C.__yzPlaneMaterial=f.G.createClassicUberMaterial(),C.__yzPlaneMaterial.alphaMode=r.F.Translucent,C.__yzPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([.5,0,0,0])),C.__yzPlaneMesh=new _.K,C.__yzPlanePrimitive=new d.J,C.__yzPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__yzPlaneMaterial}),C.__yzPlaneMesh.addPrimitive(C.__yzPlanePrimitive),C.__yzPlaneEntity.getMesh().setMesh(C.__yzPlaneMesh)),b.Is.not.exist(C.__zxPlaneEntity)&&(C.__zxPlaneEntity=m._.createMeshEntity(),C.__xCubeEntity.tryToSetUniqueName("TranslationGizmo_zxPlane",!0),C.__zxPlaneEntity.getSceneGraph().isVisible=!1,C.__zxPlaneMaterial=f.G.createClassicUberMaterial(),C.__zxPlaneMaterial.setParameter(l.f5.DiffuseColorFactor,I.Lt.fromCopyArray4([0,.5,0,0])),C.__zxPlaneMaterial.alphaMode=r.F.Translucent,C.__zxPlaneMesh=new _.K,C.__zxPlanePrimitive=new d.J,C.__zxPlanePrimitive.generate({width:1e5,height:1e5,uSpan:1,vSpan:1,isUVRepeat:!0,flipTextureCoordinateY:!1,material:C.__zxPlaneMaterial}),C.__zxPlaneMesh.addPrimitive(C.__zxPlanePrimitive),C.__zxPlaneEntity.getMesh().setMesh(C.__zxPlaneMesh)),b.Is.not.exist(C.__groupEntity)&&(C.__groupEntity=m._.createGroupEntity()),this.__topEntity.getSceneGraph().addChild(C.__groupEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__xCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__yCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__zCubeEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__xyPlaneEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__yzPlaneEntity.getSceneGraph()),C.__groupEntity.getSceneGraph().addChild(C.__zxPlaneEntity.getSceneGraph()),this.__latestTargetEntity=this.__target,this.setGizmoTag())}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph(),t=e.worldAABB;t.isVanilla()?this.__topEntity.getTransform().localPosition=e.position:this.__topEntity.getTransform().localPosition=t.centerPoint;const n=Math.max(t.sizeX,t.sizeY,t.sizeZ);this.__topEntity.getTransform().localScale=g.P.fromCopyArray([Math.min(1,t.isVanilla()?1:n/2),Math.min(1,t.isVanilla()?1:n/2),Math.min(1,t.isVanilla()?1:n/2)]),this.__isPointerDown&&this.__latestTargetEntity===this.__target&&(this.__target.getTransform().localPosition=this.__deltaPoint.clone())}static __generatePrimitive(){const e=new Float32Array([0,0,0,this.__length,0,0,0,0,0,0,this.__length,0,0,0,0,0,0,this.__length]),t=new Float32Array([1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1]);return h.W.createPrimitive({attributeSemantics:[c.T.Position.XYZ,c.T.Color0.XYZ],attributes:[e,t],primitiveMode:s.T.Lines})}__onPointerDown(e){e.preventDefault(),this.__isPointerDown=!0,C.__originalX=e.clientX,C.__originalY=e.clientY;const t=this.__target.getSceneGraph().parent;let n=p.J.identity();b.Is.exist(t)&&(n=t.matrixInner.getRotate());const i=g.P.one();let o=A.h.fromCopy9RowMajor(i.x*n.m00,i.x*n.m01,i.x*n.m02,i.y*n.m10,i.y*n.m11,i.y*n.m12,i.z*n.m20,i.z*n.m21,i.z*n.m22);"local"===C.__space?o=A.h.transpose(o):"world"===C.__space&&(o=y.x.identity());const{xResult:a,yResult:r,zResult:s}=C.castRay(e);a.result&&((0,E.dK)(a.data),this.__pickStatedPoint=o.multiplyVector(a.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="x"),r.result&&((0,E.dK)(r.data),this.__pickStatedPoint=o.multiplyVector(r.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="y"),s.result&&((0,E.dK)(s.data),this.__pickStatedPoint=o.multiplyVector(s.data.position.clone()),console.log("Down:"+this.__pickStatedPoint.toStringApproximately()),C.__activeAxis="z"),this.__latestTargetEntity===this.__target&&(this.__targetPointBackup=this.__target.getTransform().localPosition)}__onPointerMove(e){if(e.preventDefault(),b.Is.false(this.__isPointerDown))return;const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current),_=this.__target.getSceneGraph().parent;let h=p.J.identity();b.Is.exist(_)&&(h=_.matrixInner.getRotate());const u=g.P.one();let d=A.h.fromCopy9RowMajor(u.x*h.m00,u.x*h.m01,u.x*h.m02,u.y*h.m10,u.y*h.m11,u.y*h.m12,u.z*h.m20,u.z*h.m21,u.z*h.m22);"local"===C.__space?d=A.h.transpose(d):"world"===C.__space&&(d=y.x.identity());let m=this.__pickStatedPoint.clone();if("x"===C.__activeAxis){const e=C.__xyPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=d.multiplyVector(e.data.position);m=g.P.fromCopy3(t.x,m.y,m.z)}T.$t.disableCameraController()}if("y"===C.__activeAxis){const e=C.__xyPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=d.multiplyVector(e.data.position);m=g.P.fromCopy3(m.x,t.y,m.z)}T.$t.disableCameraController()}if("z"===C.__activeAxis){const e=C.__yzPlaneEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0);if(e.result){(0,E.dK)(e.data);const t=d.multiplyVector(e.data.position);m=g.P.fromCopy3(m.x,m.y,t.z)}T.$t.disableCameraController()}const f=g.P.subtract(m,this.__pickStatedPoint);if(0!==f.length())if(console.log(`${this.__target.uniqueName}: `+f.toStringApproximately()),"local"===C.__space)this.__deltaPoint=g.P.add(f,this.__targetPointBackup);else if("world"===C.__space){const e=this.__target.getSceneGraph().parent;let t=p.J.identity();b.Is.exist(e)&&(t=e.matrix.getRotate());const n=g.P.one();let i=A.h.fromCopy9RowMajor(n.x*t.m00,n.x*t.m01,n.x*t.m02,n.y*t.m10,n.y*t.m11,n.y*t.m12,n.z*t.m20,n.z*t.m21,n.z*t.m22);i=A.h.transpose(i);const o=g.P.add(this.__targetPointBackup,i.multiplyVector(f));this.__deltaPoint=o}}__onPointerUp(e){e.preventDefault(),this.__isPointerDown=!1,C.__activeAxis="none",T.$t.enableCameraController(),this.__latestTargetEntity===this.__target&&(this.__targetPointBackup=this.__target.getTransform().localPosition)}static castRay2(e){const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current);return C.__groupEntity.getSceneGraph().castRayFromScreen(r,s,c,l,0,[])}static castRay(e){const t=e.target.getBoundingClientRect(),n=e.target.clientWidth,a=e.target.clientHeight,r=e.clientX-t.left,s=t.height-(e.clientY-t.top),l=I.Lt.fromCopy4(0,0,n,a),c=o.C.getComponent(i.M,i.M.current);return{xResult:C.__xCubeEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0),yResult:C.__yCubeEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0),zResult:C.__zCubeEntity.getMesh().castRayFromScreenInWorld(r,s,c,l,0)}}_destroy(){b.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}}C.__originalX=0,C.__originalY=0,C.__activeAxis="none",C.__space="world",C.__length=1},6128:(e,t,n)=>{"use strict";n.d(t,{qf:()=>i.q,tb:()=>o.t,SU:()=>d,kl:()=>a.k,qu:()=>m.q,ug:()=>f.u});var i=n(817),o=n(8082),a=n(7326),r=n(8696),s=n(128),l=n(6214),c=n(1845),_=n(7973),h=n(2471),u=n(4690);class d extends o.t{constructor(e){super(e)}get isSetup(){return null!=this.__topEntity}_setup(){if(this.__toSkipSetup())return;this.__topEntity=_._.createMeshEntity(),this.__topEntity.tryToSetUniqueName(`LightGizmo_of_${this.__target.uniqueName}`,!0),this.__topEntity.getSceneGraph().toMakeWorldMatrixTheSameAsLocalMatrix=!0,this.__target.getSceneGraph()._addGizmoChild(this.__topEntity.getSceneGraph());const e=this.__topEntity.tryToGetMesh();d.__mesh=new l.K,d.__mesh.addPrimitive(d.__generatePrimitive()),e.setMesh(d.__mesh),this.setGizmoTag()}_update(){if(null==this.__topEntity)return;const e=this.__target.getSceneGraph(),t=e.worldAABB;t.isVanilla()?this.__topEntity.getTransform().localPosition=e.position:this.__topEntity.getTransform().localPosition=t.centerPoint,this.__topEntity.getTransform().localRotation=e.rotation,this.__topEntity.getTransform().localScale=h.P.fromCopyArray([Math.max(1,t.isVanilla()?1:t.sizeX/2),Math.max(1,t.isVanilla()?1:t.sizeY/2),Math.max(1,t.isVanilla()?1:t.sizeZ/2)])}_destroy(){u.Is.exist(this.__topEntity)&&this.__topEntity._destroy()}static __generatePrimitive(){const e=new Float32Array([0,0,0,0,0,-this.__length,0,0,-this.__length,-.1,0,.2-this.__length,-.1,0,.2-this.__length,0,0,.2-this.__length]);return c.W.createPrimitive({attributeSemantics:[s.T.Position.XYZ],attributes:[e],primitiveMode:r.T.Lines})}}d.__length=1;var m=n(7859),f=n(9244)},7973:(e,t,n)=>{"use strict";n.d(t,{_:()=>p});var i=n(1350),o=n(6692),a=n(8491),r=n(4097),s=n(9974),l=n(5496),c=n(1656),_=n(3826),h=n(224),u=n(6683);function d(){const e=i.g.createEntity();return i.g.addComponentToEntity(o.U,e)}function m(){const e=d();return i.g.addComponentToEntity(a.a,e)}function f(){const e=m();return i.g.addComponentToEntity(h.M,e)}const p=Object.freeze({createEntity:function(){return i.g.createEntity()},createTransformEntity:d,createGroupEntity:m,createMeshEntity:function(){const e=m(),t=i.g.addComponentToEntity(r.$,e);return i.g.addComponentToEntity(s.Y,t)},createCameraEntity:f,createCameraControllerEntity:function(){const e=f();return i.g.addComponentToEntity(l.S,e)},createSkeletalEntity:function(){const e=m();return i.g.addComponentToEntity(c.Y,e)},createLightEntity:function(){const e=m();return i.g.addComponentToEntity(u.r,e)},createLightWithCameraEntity:function(){const e=m(),t=i.g.addComponentToEntity(u.r,e),n=i.g.addComponentToEntity(h.M,t);return n.getCamera().isSyncToLight=!0,n},createPhysicsEntity:function(){const e=m();return i.g.addComponentToEntity(_.Z,e)}})},3913:(e,t,n)=>{"use strict";n.d(t,{G:()=>Z});var i=n(3258),o=n(621),a=n(9764),r=n(8774),s=n(1554),l=n(1995),c=n(4507),_=n(8287),h=n(9604),u=n(7369),d=n(6863),m=n(9330),f=n(968),p=n(8283),v=n(4587),A=n(3999),y=n(810),x=n(5324),g=n(4255);const I={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec3 v_baryCentricCoord;\nout vec4 v_shadowCoord;\n\nuniform float u_pointSize; // initialValue=30\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0,0.1,0.01)\n\n// BiasMatrix * LightProjectionMatrix * LightViewMatrix, See: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/#basic-shader\nuniform mat4 u_depthBiasPV; // initialValue=(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n\n v_color = a_color;\n v_normal_inWorld = normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n v_shadowCoord = get_depthBiasPV(materialSID, 0) * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},b={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec3 v_baryCentricCoord;\nin vec4 v_shadowCoord;\n\nuniform int u_shadingModel; // initialValue=0\nuniform float u_alphaCutoff; // initialValue=0.01\nuniform float u_shininess; // initialValue=5\nuniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)\nuniform sampler2D u_diffuseColorTexture; // initialValue=(0,white)\nuniform sampler2D u_normalTexture; // initialValue=(1,blue)\nuniform vec4 u_diffuseColorTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_diffuseColorTextureRotation; // initialValue=0\nuniform sampler2DShadow u_depthTexture; // initialValue=(2,white)\n\n/* shaderity: @{renderTargetBegin} */\n\n// #pragma shaderity: require(../common/deliot2019SeamlessTexture.glsl)\n// uniform sampler2D u_tInvTexture; // initialValue=(1,white)\n// uniform vec3 u_colorSpaceOrigin;\n// uniform vec3 u_colorSpaceVector1;\n// uniform vec3 u_colorSpaceVector2;\n// uniform vec3 u_colorSpaceVector3;\n// uniform vec4 u_scaleTranslate;\n\n\nvec2 uvTransform(vec2 scale, vec2 offset, float rotation, vec2 uv) {\n mat3 translationMat = mat3(1,0,0, 0,1,0, offset.x, offset.y, 1);\n mat3 rotationMat = mat3(\n cos(rotation), -sin(rotation), 0,\n sin(rotation), cos(rotation), 0,\n 0, 0, 1\n );\n mat3 scaleMat = mat3(scale.x,0,0, 0,scale.y,0, 0,0,1);\n\n mat3 matrix = translationMat * rotationMat * scaleMat;\n vec2 uvTransformed = ( matrix * vec3(uv.xy, 1) ).xy;\n\n return uvTransformed;\n}\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n\n\n // diffuseColor (Considered to be premultiplied alpha)\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture (Considered to be premultiplied alpha)\n vec4 diffuseColorTextureTransform = get_diffuseColorTextureTransform(materialSID, 0);\n float diffuseColorTextureRotation = get_diffuseColorTextureRotation(materialSID, 0);\n vec2 diffuseColorTexUv = uvTransform(diffuseColorTextureTransform.xy, diffuseColorTextureTransform.zw, diffuseColorTextureRotation, v_texcoord_0);\n vec4 textureColor = texture(u_diffuseColorTexture, diffuseColorTexUv);\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n\n#ifdef RN_IS_ALPHAMODE_MASK\n float alphaCutoff = get_alphaCutoff(materialSID, 0);\n if (alpha < alphaCutoff) {\n discard;\n }\n#endif\n\n\n // Lighting\n vec3 shadingColor = vec3(0.0, 0.0, 0.0);\n#ifdef RN_IS_LIGHTING\n int shadingModel = get_shadingModel(materialSID, 0);\n if (shadingModel > 0) {\n\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */ ; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n // Diffuse\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, light.direction)) * light.attenuatedIntensity;\n\n float shininess = get_shininess(materialSID, 0);\n int shadingModel = get_shadingModel(materialSID, 0);\n\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n\n // Specular\n if (shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 halfVector = normalize(light.direction + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), shininess);\n } else if (shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 R = reflect(light.direction, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), shininess);\n }\n\n }\n\n shadingColor = diffuse + specular;\n } else {\n shadingColor = diffuseColor;\n }\n#else\n shadingColor = diffuseColor;\n#endif\n\n // Shadow\n#ifdef RN_USE_SHADOW_MAPPING\n float visibility = 1.0;\n float bias = 0.001;\n\n // Non PCF\n // if ( textureProj( u_depthTexture, v_shadowCoord ).r < (v_shadowCoord.z - bias) / v_shadowCoord.w ) {\n // visibility = 0.5;\n // }\n // shadingColor *= visibility;\n\n // Hardware PCF\n vec4 shadowCoord = v_shadowCoord;\n shadowCoord.z -= bias;\n shadingColor *= textureProj( u_depthTexture, shadowCoord ) * 0.5 + 0.5;\n\n // shadingColor.rgb = texture( u_depthTexture, v_shadowCoord.xy ).rrr;\n // shadingColor.rgb = vec3(v_shadowCoord.xy, 0.0);\n // shadingColor.rgb = vec3(diffuseColorTexUv, 0.0);\n // shadingColor.rgb = vec3(texture( u_depthTexture, diffuseColorTexUv).rrr);\n // shadingColor.rgb = texture( u_depthTexture, diffuseColorTexUv).rgb;\n // shadingColor.rgb = vec3(textureProj( u_depthTexture, v_shadowCoord ).z, 0.0, 0.0);\n alpha = 1.0;\n#endif\n\n rt0 = vec4(shadingColor * alpha, alpha);\n // rt0 = vec4(u_lightNumber, 0.0, 0.0, 1.0);\n // rt0 = vec4(1.0, 0.0, 0.0, 1.0);\n // rt0 = vec4(normal_inWorld*0.5+0.5, 1.0);\n\n#ifdef RN_IS_ALPHAMODE_OPAQUE\n rt0.a = 1.0;\n#elif defined(RN_IS_ALPHAMODE_MASK)\n rt0.a = 1.0;\n#endif\n\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},E={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec2 a_texcoord_1;\nin vec2 a_texcoord_2;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec2 v_texcoord_1;\nout vec2 v_texcoord_2;\nout vec3 v_baryCentricCoord;\nout float v_instanceInfo;\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n in vec4 a_tangent;\n out vec3 v_tangent_inWorld;\n out vec3 v_binormal_inWorld;\n#endif\n#ifdef RN_USE_SHADOW_MAPPING\n out vec4 v_shadowCoord;\n#endif\n\nuniform float u_pointSize; // initialValue=30, soloDatum=true\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0.0, 0.1, 0.01), soloDatum=true\n\n#ifdef RN_IS_MORPHING\nuniform int u_morphTargetNumber; // initialValue=0, isCustomSetting=true, soloDatum=true, needUniformInDataTextureMode=true\n// uniform int u_dataTextureMorphOffsetPosition[];\n// uniform int u_morphWeights[]; //\n#endif\n\n// BiasMatrix * LightProjectionMatrix * LightViewMatrix, See: http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/#basic-shader\nuniform mat4 u_depthBiasPV; // initialValue=(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n v_color = a_color;\n\n bool isSkinning = false;\n\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n v_texcoord_0 = a_texcoord_0;\n v_texcoord_1 = a_texcoord_1;\n v_texcoord_2 = a_texcoord_2;\n\n #ifdef RN_USE_TANGENT_ATTRIBUTE\n v_tangent_inWorld = normalMatrix * a_tangent.xyz;\n v_binormal_inWorld = cross(v_tangent_inWorld, v_normal_inWorld) * a_tangent.w;\n #endif\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n\n v_instanceInfo = a_instanceInfo.x;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n#ifdef RN_USE_SHADOW_MAPPING\n v_shadowCoord = get_depthBiasPV(materialSID, 0) * v_position_inWorld;\n#endif\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},T={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec2 v_texcoord_1;\nin vec2 v_texcoord_2;\nin vec3 v_baryCentricCoord;\nin float v_instanceInfo;\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n in vec3 v_tangent_inWorld;\n in vec3 v_binormal_inWorld;\n#endif\n\n#ifdef RN_USE_SHADOW_MAPPING\nin vec4 v_shadowCoord;\n#endif\n\nuniform vec4 u_baseColorFactor; // initialValue=(1,1,1,1)\nuniform sampler2D u_baseColorTexture; // initialValue=(0,white)\nuniform vec2 u_metallicRoughnessFactor; // initialValue=(1,1)\nuniform sampler2D u_metallicRoughnessTexture; // initialValue=(1,white)\nuniform sampler2D u_occlusionTexture; // initialValue=(3,white)\nuniform vec3 u_emissiveFactor; // initialValue=(0,0,0)\nuniform sampler2D u_emissiveTexture; // initialValue=(4,white)\nuniform vec3 u_wireframe; // initialValue=(0,0,1)\nuniform bool u_isOutputHDR; // initialValue=0\nuniform bool u_makeOutputSrgb; // initialValue=1\nuniform vec4 u_iblParameter; // initialValue=(1,1,1,1), isCustomSetting=true\nuniform ivec2 u_hdriFormat; // initialValue=(0,0), isCustomSetting=true\nuniform samplerCube u_diffuseEnvTexture; // initialValue=(5,white), isCustomSetting=true\nuniform samplerCube u_specularEnvTexture; // initialValue=(6,white), isCustomSetting=true\nuniform vec4 u_baseColorTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_baseColorTextureRotation; // initialValue=0\nuniform vec4 u_metallicRoughnessTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_metallicRoughnessTextureRotation; // initialValue=0\nuniform int u_baseColorTexcoordIndex; // initialValue=0\nuniform int u_metallicRoughnessTexcoordIndex; // initialValue=0\nuniform int u_occlusionTexcoordIndex; // initialValue=0\nuniform vec4 u_occlusionTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_occlusionTextureRotation; // initialValue=0\nuniform int u_emissiveTexcoordIndex; // initialValue=0\nuniform vec4 u_emissiveTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_emissiveTextureRotation; // initialValue=0\nuniform float u_occlusionStrength; // initialValue=1\nuniform bool u_inverseEnvironment; // initialValue=true\nuniform float u_ior; // initialValue=1.5\n\n#ifdef RN_USE_NORMAL_TEXTURE\n uniform sampler2D u_normalTexture; // initialValue=(2,black)\n uniform vec4 u_normalTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_normalTextureRotation; // initialValue=(0)\n uniform int u_normalTexcoordIndex; // initialValue=(0)\n uniform float u_normalScale; // initialValue=(1)\n#endif\n\n#ifdef RN_USE_CLEARCOAT\n uniform float u_clearCoatFactor; // initialValue=0\n uniform float u_clearCoatRoughnessFactor; // initialValue=0\n uniform vec4 u_clearCoatTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_clearCoatTextureRotation; // initialValue=0\n uniform vec4 u_clearCoatRoughnessTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_clearCoatRoughnessTextureRotation; // initialValue=0\n uniform vec4 u_clearCoatNormalTextureTransform; // initialValue=(1,1,0,0)\n uniform float u_clearCoatNormalTextureRotation; // initialValue=0\n uniform int u_clearCoatTexcoordIndex; // initialValue=(0)\n uniform int u_clearCoatRoughnessTexcoordIndex; // initialValue=(0)\n uniform int u_clearCoatNormalTexcoordIndex; // initialValue=(0)\n#endif\n\n#ifdef RN_USE_TRANSMISSION\n uniform float u_transmissionFactor; // initialValue=(0)\n#endif\n\n#ifdef RN_USE_VOLUME\n uniform float u_thicknessFactor; // initialValue=(0)\n uniform float u_attenuationDistance; // initialValue=(0.000001)\n uniform vec3 u_attenuationColor; // initialValue=(1,1,1)\n#endif\n\n#ifdef RN_USE_SHEEN\n uniform vec3 u_sheenColorFactor; // initialValue=(0,0,0)\n uniform float u_sheenRoughnessFactor; // initialValue=(0)\n#endif\n\n#ifdef RN_USE_SPECULAR\n uniform float u_specularFactor; // initialValue=1.0\n uniform vec3 u_specularColorFactor; // initialValue=(1,1,1)\n#endif\n\n#ifdef RN_USE_IRIDESCENCE\n uniform float u_iridescenceFactor; // initialValue=0\n uniform float u_iridescenceIor; // initialValue=1.3\n uniform float u_iridescenceThicknessMinimum; // initialValue=100\n uniform float u_iridescenceThicknessMaximum; // initialValue=400\n#endif\n\n#ifdef RN_USE_ANISOTROPY\n uniform float u_anisotropyStrength; // initialValue=0\n uniform vec2 u_anisotropyRotation; // initialValue=(1,0)\n#endif\n\nuniform float u_alphaCutoff; // initialValue=(0.01)\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\nconst float M_PI = 3.141592653589793;\nconst float RECIPROCAL_PI = 0.3183098861837907;\nconst float c_MinRoughness = 0.04;\n\nfloat angular_n_h(float NH) {\n return acos(NH);\n}\n\nfloat d_phong(float NH, float c1) {\n return pow(\n cos(acos(NH))\n , c1\n );\n}\n\n// this is from https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 envBRDFApprox( float Roughness, float NoV ) {\n const vec4 c0 = vec4(-1, -0.0275, -0.572, 0.022 );\n const vec4 c1 = vec4(1, 0.0425, 1.04, -0.04 );\n vec4 r = Roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( -9.28 * NoV ) ) * r.x + r.y;\n vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n return AB;\n}\n\n// GGX NDF\nfloat d_ggx(float NH, float alphaRoughness) {\n float roughnessSqr = alphaRoughness * alphaRoughness;\n float f = (roughnessSqr - 1.0) * NH * NH + 1.0;\n return roughnessSqr / (M_PI * f * f);\n}\n\nfloat d_torrance_reiz(float NH, float c3) {\n float CosSquared = NH*NH;\n float TanSquared = (1.0 - CosSquared)/CosSquared;\n //return (1.0/M_PI) * sq(c3/(CosSquared * (c3*c3 + TanSquared))); // gamma = 2, aka GGX\n return (1.0/sqrt(M_PI)) * (sq(c3)/(CosSquared * (c3*c3 + TanSquared))); // gamma = 1, D_Berry\n}\n\nfloat d_beckmann(float NH, float m) {\n float co = 1.0 / (4.0 * m * m * NH * NH * NH * NH);\n float expx = exp((NH * NH - 1.0) / (m * m * NH * NH));\n return co * expx;\n}\n\n// the same as glTF WebGL sample\n// https://github.com/KhronosGroup/glTF-WebGL-PBR/blob/88eda8c5358efe03128b72b6c5f5f6e5b6d023e1/shaders/pbr-frag.glsl#L188\n// That is, Unreal Engine based approach, but modified to use alphaRoughness (squared artist's roughness parameter),\n// and based on 'Separable Masking and Shadowing' approximation (propesed by Christophe Schlick)\n// https://www.cs.virginia.edu/~jdl/bib/appearance/analytic%20models/schlick94b.pdf\nfloat g_shielding(float NL, float NV, float alphaRoughness) {\n float r = alphaRoughness;\n\n // Local Shadowing using \"Schlick-Smith\" Masking Function\n float localShadowing = 2.0 * NL / (NL + sqrt(r * r + (1.0 - r * r) * (NL * NL)));\n\n // Local Masking using \"Schlick-Smith\" Masking Function\n float localMasking = 2.0 * NV / (NV + sqrt(r * r + (1.0 - r * r) * (NV * NV)));\n\n return localShadowing * localMasking;\n}\n\n// The code from https://google.github.io/filament/Filament.html#listing_approximatedspecularv\n// The idea is from [Heitz14] Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs.\nfloat v_SmithGGXCorrelated(float NL, float NV, float alphaRoughness) {\n float a2 = alphaRoughness * alphaRoughness;\n float GGXV = NL * sqrt(NV * NV * (1.0 - a2) + a2);\n float GGXL = NV * sqrt(NL * NL * (1.0 - a2) + a2);\n return 0.5 / (GGXV + GGXL);\n}\n\nfloat v_SmithGGXCorrelatedFast(float NL, float NV, float alphaRoughness) {\n float a = alphaRoughness;\n float GGXV = NL * (NV * (1.0 - a) + a);\n float GGXL = NV * (NL * (1.0 - a) + a);\n return 0.5 / (GGXV + GGXL);\n}\n\n// The Schlick Approximation to Fresnel\nfloat fresnel(float f0, float f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = x * x2 * x2;\n return f0 + (f90 - f0) * x5;\n}\n\nvec3 fresnel(vec3 f0, vec3 f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = x * x2 * x2;\n return f0 + (f90 - f0) * x5;\n}\n\nvec3 fresnel(vec3 f0, float f90, float VdotH)\n{\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = x * x2 * x2;\n return f0 + (f90 - f0) * x5;\n}\n\nfloat fresnel(float f0, float VdotH)\n{\n float f90 = 1.0; //clamp(50.0 * f0, 0.0, 1.0);\n return fresnel(f0, f90, VdotH);\n}\nvec3 fresnel(vec3 f0, float VdotH)\n{\n float f90 = 1.0; //clamp(50.0 * f0, 0.0, 1.0);\n return fresnel(f0, f90, VdotH);\n}\n\nvec3 cook_torrance_specular_brdf(float NH, float NL, float NV, vec3 F, float alphaRoughness) {\n float D = d_ggx(NH, alphaRoughness);\n float V = v_SmithGGXCorrelated(NL, NV, alphaRoughness);\n return vec3(D)*vec3(V)*F;\n// float G = g_shielding(NL, NV, alphaRoughness);\n// return vec3(D)*vec3(G)*F/vec3(4.0*NL*NV);\n\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#diffuse-brdf\nvec3 diffuse_brdf(vec3 albedo)\n{\n // (1/pi) * diffuseAlbedo\n return RECIPROCAL_PI * albedo;\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#specular-brdf\nfloat specular_brdf(float alphaRoughness, float NdotL, float NdotV, float NdotH) {\n float V = v_SmithGGXCorrelated(NdotL, NdotV, alphaRoughness);\n float D = d_ggx(NdotH, alphaRoughness);\n return V * D;\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_transmission#implementation-notes\nfloat specular_btdf(float alphaRoughness, float NdotL, float NdotV, float NdotHt) {\n float V = v_SmithGGXCorrelated(NdotL, NdotV, alphaRoughness);\n float D = d_ggx(NdotHt, alphaRoughness);\n return V * D;\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#fresnel\nvec3 conductor_fresnel(vec3 f0, float brdf, float alphaRoughness, float VdotH) {\n return vec3(brdf) * (f0.rgb + (vec3(1.0) - f0.rgb) * vec3(pow(1.0 - abs(VdotH), 5.0)));\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#fresnel\nvec3 fresnel_mix(float ior, vec3 base, vec3 layer, float VdotH) {\n float f0 = pow((1.0 - ior)/(1.0 + ior), 2.0);\n float fr = f0 + (1.0 - f0) * pow(1.0 - abs(VdotH), 5.0);\n return mix(base, layer, fr);\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#metal-brdf-and-dielectric-brdf\nvec3 metal_brdf(float perceptualRoughness, vec3 baseColor, float NdotL, float NdotV, float NdotH, float VdotH) {\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n return conductor_fresnel(\n baseColor,\n specular_brdf(alphaRoughness, NdotL, NdotV, NdotH),\n alphaRoughness,\n VdotH\n );\n}\n\n// https://www.khronos.org/registry/glTF/specs/2.0/glTF-2.0.html#metal-brdf-and-dielectric-brdf\nvec3 dielectric_brdf(float ior, vec3 baseColor, float perceptualRoughness, float NdotL, float NdotV, float NdotH, float VdotH) {\n vec3 base = diffuse_brdf(baseColor);\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n vec3 layer = vec3(specular_brdf(alphaRoughness, NdotL, NdotV, NdotH));\n return fresnel_mix(ior, base, layer, VdotH);\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat#layering\nvec3 coated_material_s(vec3 base, float perceptualRoughness, float clearcoatRoughness, float clearcoat, float VdotNc, float LdotNc, float NdotHc) {\n float clearcoatFresnel = 0.04 + (1.0 - 0.04) * pow(1.0 - abs(VdotNc), 5.0);\n float clearcoatAlpha = clearcoatRoughness * clearcoatRoughness;\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n float D = d_ggx(NdotHc, clearcoatAlpha);\n float V = v_SmithGGXCorrelated(LdotNc, VdotNc, clearcoatAlpha);\n float f_clearcoat = clearcoatFresnel * D * V;\n\n // base = (f_diffuse + f_specular) in https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_clearcoat#layering\n return base * vec3(1.0 - clearcoat * clearcoatFresnel) + vec3(f_clearcoat * clearcoat);\n}\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\nfloat srgbToLinear(float value) {\n return pow(value, 2.2);\n}\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nfloat linearToSrgb(float value) {\n return pow(value, 1.0/2.2);\n}\n\n// Roughness Dependent Fresnel\n// https://www.jcgt.org/published/0008/01/03/paper.pdf\nvec3 fresnelSchlickRoughness(vec3 F0, float cosTheta, float roughness)\n{\n vec3 Fr = max(vec3(1.0 - roughness), F0) - F0;\n vec3 k_S = F0 + Fr * pow(1.0 - cosTheta, 5.0);\n return k_S;\n}\n\nvec3 fresnelSchlickRoughnessWithIridescence(\n vec3 F0, float cosTheta, float roughness,\n vec3 iridescenceFresnel, float iridescence\n )\n{\n vec3 Fr = max(vec3(1.0 - roughness), F0) - F0;\n vec3 k_S = mix(F0 + Fr * pow(1.0 - cosTheta, 5.0), iridescenceFresnel, iridescence);\n return k_S;\n}\n\n// From: https://github.com/KhronosGroup/glTF-Sample-Viewer/blob/e2c7b8c8bd12916c1a387cd41f9ef061edc718df/source/Renderer/shaders/brdf.glsl#L44-L66\nvec3 Schlick_to_F0(vec3 f, vec3 f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = clamp(x * x2 * x2, 0.0, 0.9999);\n\n return (f - f90 * x5) / (1.0 - x5);\n}\n\nfloat Schlick_to_F0(float f, float f90, float VdotH) {\n float x = clamp(1.0 - VdotH, 0.0, 1.0);\n float x2 = x * x;\n float x5 = clamp(x * x2 * x2, 0.0, 0.9999);\n\n return (f - f90 * x5) / (1.0 - x5);\n}\n\nvec3 Schlick_to_F0(vec3 f, float VdotH) {\n return Schlick_to_F0(f, vec3(1.0), VdotH);\n}\n\nfloat Schlick_to_F0(float f, float VdotH) {\n return Schlick_to_F0(f, 1.0, VdotH);\n}\n\nvec3 normalBlendingUDN(sampler2D baseMap, sampler2D detailMap, vec2 baseUv, vec2 detailUv) {\n vec3 t = texture(baseMap, baseUv).xyz * 2.0 - 1.0;\n vec3 u = texture(detailMap, detailUv).xyz * 2.0 - 1.0;\n vec3 r = normalize(vec3(t.xy + u.xy, t.z));\n return r;\n}\n\nvec2 uvTransform(vec2 scale, vec2 offset, float rotation, vec2 uv) {\n mat3 translationMat = mat3(1,0,0, 0,1,0, offset.x, offset.y, 1);\n mat3 rotationMat = mat3(\n cos(rotation), -sin(rotation), 0,\n sin(rotation), cos(rotation), 0,\n 0, 0, 1\n );\n mat3 scaleMat = mat3(scale.x,0,0, 0,scale.y,0, 0,0,1);\n\n mat3 matrix = translationMat * rotationMat * scaleMat;\n vec2 uvTransformed = ( matrix * vec3(uv.xy, 1) ).xy;\n\n return uvTransformed;\n}\n\nfloat IsotropicNDFFiltering(vec3 normal, float roughness2) {\n float SIGMA2 = 0.15915494;\n float KAPPA = 0.18;\n vec3 dndu = dFdx(normal);\n vec3 dndv = dFdy(normal);\n float kernelRoughness2 = SIGMA2 * (dot(dndu, dndu) + dot(dndv, dndv));\n float clampedKernelRoughness2 = min(kernelRoughness2, KAPPA);\n float filteredRoughness2 = saturate(roughness2 + clampedKernelRoughness2);\n return filteredRoughness2;\n}\n\n\n////////////////////////////////////////\n// glTF KHR_materials_volume\n////////////////////////////////////////\n\n#ifdef RN_USE_VOLUME\n// https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_volume/README.md#attenuation\nvec3 volumeAttenuation(vec3 attenuationColor, float attenuationDistance, vec3 intensity, float transmissionDistance)\n{\n if (attenuationDistance == 0.0) { // means Infinite distance\n return intensity; // No attenuation\n } else {\n vec3 attenuationCo = -log(attenuationColor) / attenuationDistance;\n vec3 attenuatedTransmittance = exp(-attenuationCo * transmissionDistance);\n return intensity * attenuatedTransmittance;\n }\n}\n#endif\n\n\n\n\n\n\n////////////////////////////////////////\n// glTF KHR_materials_anisotropy\n////////////////////////////////////////\n#ifdef RN_USE_ANISOTROPY\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_anisotropy\nfloat D_GGX_anisotropic(float NdotH, float TdotH, float BdotH, float at, float ab)\n{\n float a2 = at * ab;\n vec3 f = vec3(ab * TdotH, at * BdotH, a2 * NdotH);\n float w2 = a2 / dot(f, f);\n return a2 * w2 * w2 / M_PI;\n}\n\nfloat V_GGX_anisotropic(float NdotL, float NdotV, float BdotV, float TdotV, float TdotL, float BdotL,\n float at, float ab)\n{\n float GGXV = NdotL * length(vec3(at * TdotV, ab * BdotV, NdotV));\n float GGXL = NdotV * length(vec3(at * TdotL, ab * BdotL, NdotL));\n float v = 0.5 / (GGXV + GGXL);\n return clamp(v, 0.0, 1.0);\n}\n\nvec3 BRDF_specularAnisotropicGGX(vec3 F, float alphaRoughness,\n float VdotH, float NdotL, float NdotV, float NdotH, float BdotV, float TdotV,\n float TdotL, float BdotL, float TdotH, float BdotH, float anisotropy)\n{\n float at = mix(alphaRoughness, 1.0, anisotropy * anisotropy);\n float ab = alphaRoughness;\n\n float V = V_GGX_anisotropic(NdotL, NdotV, BdotV, TdotV, TdotL, BdotL, at, ab);\n float D = D_GGX_anisotropic(NdotH, TdotH, BdotH, at, ab);\n\n return F * V * D;\n}\n#endif\n\n\n\n////////////////////////////////////////\n// glTF KHR_materials_sheen\n////////////////////////////////////////\n\n#ifdef RN_USE_SHEEN\nfloat d_Charlie(float sheenPerceptualRoughness, float NoH) {\n // Estevez and Kulla 2017, \"Production Friendly Microfacet Sheen BRDF\"\n float alphaG = sheenPerceptualRoughness * sheenPerceptualRoughness;\n float invAlpha = 1.0 / alphaG;\n float cos2h = NoH * NoH;\n float sin2h = 1.0 - cos2h;\n return (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen#sheen-visibility\nfloat sheenSimpleVisibility(float NdotL, float NdotV) {\n return 1.0 / (4.0 * (NdotL + NdotV - NdotL * NdotV));\n}\n\n// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_sheen#sheen-visibility\nfloat charlieL(float x, float alphaG) {\n float oneMinusAlphaSq = (1.0 - alphaG) * (1.0 - alphaG);\n float a = mix(21.5473, 25.3245, oneMinusAlphaSq);\n float b = mix(3.82987, 3.32435, oneMinusAlphaSq);\n float c = mix(0.19823, 0.16801, oneMinusAlphaSq);\n float d = mix(-1.97760, -1.27393, oneMinusAlphaSq);\n float e = mix(-4.32054, -4.85967, oneMinusAlphaSq);\n return a / (1.0 + b * pow(x, c)) + d * x + e;\n}\n\nfloat lambdaSheen(float cosTheta, float alphaG)\n{\n return abs(cosTheta) < 0.5 ? exp(charlieL(cosTheta, alphaG)) : exp(2.0 * charlieL(0.5, alphaG) - charlieL(1.0 - cosTheta, alphaG));\n}\n\nfloat sheenCharlieVisibility(float NdotL, float NdotV, float sheenPerceptualRoughness) {\n float alphaG = sheenPerceptualRoughness * sheenPerceptualRoughness;\n float sheenVisibility = 1.0 / ((1.0 + lambdaSheen(NdotV, alphaG) + lambdaSheen(NdotL, alphaG)) * (4.0 * NdotV * NdotL));\n return sheenVisibility;\n}\n\nvec3 sheen_brdf(vec3 sheenColor, float sheenPerceptualRoughness, float NdotL, float NdotV, float NdotH) {\n float sheenDistribution = d_Charlie(sheenPerceptualRoughness, NdotH);\n float sheenVisibility = sheenCharlieVisibility(NdotL, NdotV, sheenPerceptualRoughness);\n return sheenColor * sheenDistribution * sheenVisibility;\n}\n#endif\n\n\n\n\n\n\n\n\n\n////////////////////////////////////////\n// glTF KHR_materials_irirdescence\n////////////////////////////////////////\n\n#ifdef RN_USE_IRIDESCENCE\n// XYZ to REC709(sRGB) conversion matrix\nconst mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n);\n\n// Assume air interface for top\nvec3 Fresnel0ToIor(vec3 F0) {\n vec3 sqrtF0 = sqrt(F0);\n return (vec3(1.0) + sqrtF0) / (vec3(1.0) - sqrtF0);\n}\n\n// Conversion from IOR to F0\n// ior is a value between 1.0 and 3.0. 1.0 is air interface\nvec3 IorToFresnel0(vec3 transmittedIor, float incidentIor) {\n return sq((transmittedIor - vec3(incidentIor)) / (transmittedIor + vec3(incidentIor)));\n}\nfloat IorToFresnel0(float transmittedIor, float incidentIor) {\n return sq((transmittedIor - incidentIor) / (transmittedIor + incidentIor));\n}\n\n/**\n * From: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_iridescence#analytic-spectral-integration\n */\nvec3 evalSensitivity(float OPD, vec3 shift) {\n float phase = 2.0 * M_PI * OPD * 1.0e-9;\n vec3 val = vec3(5.4856e-13, 4.4201e-13, 5.2481e-13);\n vec3 pos = vec3(1.6810e+06, 1.7953e+06, 2.2084e+06);\n vec3 var = vec3(4.3278e+09, 9.3046e+09, 6.6121e+09);\n\n vec3 xyz = val * sqrt(2.0 * M_PI * var) * cos(pos * phase + shift) * exp(-(phase * phase) * var);\n xyz.x += 9.7470e-14 * sqrt(2.0 * M_PI * 4.5282e+09) * cos(2.2399e+06 * phase + shift[0]) * exp(-4.5282e+09 * (phase * phase));\n xyz /= 1.0685e-7;\n\n vec3 rgb = XYZ_TO_REC709 * xyz;\n return rgb;\n}\n\n/**\n * From: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_iridescence#iridescence-fresnel\n */\nvec3 calcIridescence(float outsideIor, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0) {\n\n\n // iridescenceIor is the index of refraction of the thin-film layer\n // Force iridescenceIor -> outsideIOR when thinFilmThickness -> 0.0\n float iridescenceIor = mix(outsideIor, eta2, smoothstep(0.0, 0.03, thinFilmThickness));\n\n // To calculate the reflectances R12 and R23 at the viewing angles (angle hitting the thin-film layer)\n // and (angle after refraction in the thin-film) Schlick Fresnel is again used.\n // This approximation allows to eliminate the split into S and P polarization for the exact Fresnel equations.\n // can be calculated using Snell's law (with being outsideIor and being iridescenceIor):\n float sinTheta2Sq = sq(outsideIor / iridescenceIor) * (1.0 - sq(cosTheta1));\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n\n // Handle total internal reflection\n if (cosTheta2Sq < 0.0) {\n return vec3(1.0);\n }\n\n float cosTheta2 = sqrt(cosTheta2Sq);\n\n /// Material Interfaces\n // The iridescence model defined by Belcour/Barla models two material interfaces\n // - one from the outside to the thin-film layer\n // and another one from the thin-film to the base material. These two interfaces are defined as follows:\n\n // First interface (from the outside to the thin-film layer)\n float R0 = IorToFresnel0(iridescenceIor, outsideIor);\n float R12 = fresnel(R0, cosTheta1);\n float R21 = R12;\n float T121 = 1.0 - R12;\n\n // Second interface (from the thin-film to the base material)\n vec3 baseIor = Fresnel0ToIor(baseF0 + 0.0001); // guard against 1.0\n vec3 R1 = IorToFresnel0(baseIor, iridescenceIor);\n vec3 R23 = fresnel(R1, cosTheta2);\n\n // phi12 and phi23 define the base phases per interface and are approximated with 0.0\n // if the IOR of the hit material (iridescenceIor or baseIor) is higher\n // than the IOR of the previous material (outsideIor or iridescenceIor) and π otherwise.\n // Also here, polarization is ignored. float phi12 = 0.0;\n\n // First interface (from the outside to the thin-film layer)\n float phi12 = 0.0;\n if (iridescenceIor < outsideIor) phi12 = M_PI;\n float phi21 = M_PI - phi12;\n\n // Second interface (from the thin-film to the base material)\n vec3 phi23 = vec3(0.0);\n if (baseIor[0] < iridescenceIor) phi23[0] = M_PI;\n if (baseIor[1] < iridescenceIor) phi23[1] = M_PI;\n if (baseIor[2] < iridescenceIor) phi23[2] = M_PI;\n\n // OPD (optical path difference)\n float OPD = 2.0 * iridescenceIor * thinFilmThickness * cosTheta2;\n // Phase shift\n vec3 phi = vec3(phi21) + phi23;\n\n // Compound terms\n vec3 R123 = clamp(R12 * R23, 1e-5, 0.9999);\n vec3 r123 = sqrt(R123);\n vec3 Rs = (T121 * T121) * R23 / (vec3(1.0) - R123);\n\n // Reflectance term for m = 0 (DC term amplitude)\n vec3 C0 = R12 + Rs;\n vec3 I = C0;\n\n // Reflectance term for m > 0 (pairs of diracs)\n vec3 Cm = Rs - T121;\n for (int m = 1; m <= 2; ++m)\n {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity(float(m) * OPD, float(m) * phi);\n I += Cm * Sm;\n }\n\n vec3 F_iridescence = max(I, vec3(0.0));\n\n return F_iridescence;\n}\n#endif\n\n\n\n\n\n////////////////////////////////////////\n// glTF BRDF for punctual lights\n////////////////////////////////////////\nvec3 gltfBRDF(\n Light light,\n vec3 normal_inWorld,\n vec3 viewDirection,\n float NdotV,\n vec3 albedo,\n float perceptualRoughness,\n float metallic,\n vec3 F0,\n vec3 F90,\n float ior,\n float transmission,\n float clearcoat,\n float clearcoatRoughness,\n vec3 clearcoatNormal_inWorld,\n float VdotNc,\n vec3 attenuationColor,\n float attenuationDistance,\n float anisotropy,\n vec3 anisotropicT,\n vec3 anisotropicB,\n float BdotV,\n float TdotV,\n vec3 sheenColor,\n float sheenRoughness,\n float albedoSheenScalingNdotV\n )\n{\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n // Fresnel\n vec3 halfVector = normalize(light.direction + viewDirection);\n float VdotH = dot(viewDirection, halfVector);\n vec3 F = fresnel(F0, F90, VdotH);\n\n float NdotL = saturateEpsilonToOne(dot(normal_inWorld, light.direction));\n\n // Diffuse\n vec3 diffuseBrdf = diffuse_brdf(albedo);\n vec3 pureDiffuse = (vec3(1.0) - F) * diffuseBrdf * vec3(NdotL) * light.attenuatedIntensity;\n\n#ifdef RN_USE_TRANSMISSION\n vec3 refractionVector = refract(-viewDirection, normal_inWorld, 1.0 / ior);\n Light transmittedLightFromUnderSurface = light;\n transmittedLightFromUnderSurface.pointToLight -= refractionVector;\n vec3 transmittedLightDirectionFromUnderSurface = normalize(transmittedLightFromUnderSurface.pointToLight);\n transmittedLightFromUnderSurface.direction = transmittedLightDirectionFromUnderSurface;\n\n vec3 Ht = normalize(viewDirection + transmittedLightFromUnderSurface.direction);\n float NdotHt = saturateEpsilonToOne(dot(normal_inWorld, Ht));\n float NdotLt = saturateEpsilonToOne(dot(normal_inWorld, transmittedLightFromUnderSurface.direction));\n\n vec3 transmittedContrib = (vec3(1.0) - F) * specular_btdf(alphaRoughness, NdotLt, NdotV, NdotHt) * albedo * transmittedLightFromUnderSurface.attenuatedIntensity;\n\n#ifdef RN_USE_VOLUME\n transmittedContrib = volumeAttenuation(attenuationColor, attenuationDistance, transmittedContrib, length(transmittedLightFromUnderSurface.pointToLight));\n#endif // RN_USE_VOLUME\n\n vec3 diffuseContrib = mix(pureDiffuse, vec3(transmittedContrib), transmission);\n#else\n vec3 diffuseContrib = pureDiffuse;\n#endif // RN_USE_TRANSMISSION\n\n // Specular\n float NdotH = saturateEpsilonToOne(dot(normal_inWorld, halfVector));\n#ifdef RN_USE_ANISOTROPY\n float TdotL = dot(anisotropicT, light.direction);\n float BdotL = dot(anisotropicB, light.direction);\n float TdotH = dot(anisotropicT, halfVector);\n float BdotH = dot(anisotropicB, halfVector);\n vec3 specularContrib = BRDF_specularAnisotropicGGX(F, alphaRoughness, VdotH, NdotL, NdotV, NdotH, BdotV, TdotV, TdotL, BdotL, TdotH, BdotH, anisotropy) * vec3(NdotL) * light.attenuatedIntensity;\n#else\n vec3 specularContrib = cook_torrance_specular_brdf(NdotH, NdotL, NdotV, F, alphaRoughness) * vec3(NdotL) * light.attenuatedIntensity;\n#endif // RN_USE_ANISOTROPY\n // Base Layer\n vec3 baseLayer = diffuseContrib + specularContrib;\n\n#ifdef RN_USE_SHEEN\n // Sheen\n vec3 sheenContrib = sheen_brdf(sheenColor, sheenRoughness, NdotL, NdotV, NdotH) * NdotL * light.attenuatedIntensity;\n float albedoSheenScaling = min(\n albedoSheenScalingNdotV,\n 1.0 - max3(sheenColor) * texture(u_sheenLutTexture, vec2(NdotL, sheenRoughness)).r);\n vec3 color = sheenContrib + baseLayer * albedoSheenScaling;\n#else\n vec3 color = baseLayer;\n float albedoSheenScaling = 1.0;\n#endif // RN_USE_SHEEN\n\n#ifdef RN_USE_CLEARCOAT\n // Clear Coat Layer\n float NdotHc = saturateEpsilonToOne(dot(clearcoatNormal_inWorld, halfVector));\n float LdotNc = saturateEpsilonToOne(dot(light.direction, clearcoatNormal_inWorld));\n vec3 coated = coated_material_s(color, perceptualRoughness,\n clearcoatRoughness, clearcoat, VdotNc, LdotNc, NdotHc);\n vec3 finalColor = coated;\n#else\n vec3 finalColor = color;\n#endif // RN_USE_CLEARCOAT\n\n return finalColor;\n}\n\n\n/* shaderity: @{matricesGetters} */\n\n#ifdef RN_USE_SHADOW_MAPPING\n\nconst float g_minVariance = 0.00001;\n\nfloat chebyshevUpperBound(vec2 moments, float t) {\n float p = (t <= moments.x) ? 1.0 : 0.0;\n\n float variance = moments.y - sq(moments.x);\n variance = max(variance, g_minVariance);\n\n float d = t - moments.x;\n float p_max = variance / (variance + sq(d));\n\n return max(p, p_max);\n}\n\nfloat varianceShadowContribution(vec2 lightTexCoord, float distanceToLight) {\n vec2 moments = texture(u_depthTexture, lightTexCoord).xy;\n\n return chebyshevUpperBound(moments, distanceToLight);\n}\n\n#endif\n\n\nvec3 get_irradiance(vec3 normal_forEnv, float materialSID, ivec2 hdriFormat) {\n vec4 diffuseTexel = texture(u_diffuseEnvTexture, normal_forEnv);\n\n vec3 irradiance;\n if (hdriFormat.x == 0) {\n // LDR_SRGB\n irradiance = srgbToLinear(diffuseTexel.rgb);\n }\n else if (hdriFormat.x == 3) {\n // RGBE\n irradiance = diffuseTexel.rgb * pow(2.0, diffuseTexel.a*255.0-128.0);\n }\n else {\n irradiance = diffuseTexel.rgb;\n }\n\n return irradiance;\n}\n\nfloat scaleForLod(float perceptualRoughness, float ior)\n{\n // Scale roughness to the range [0, 1],\n // ior=1.0 will be scale 0,\n // ior=1.5 will be scale 1.0,\n // ior=2 will be scale 1.0 (clamped)\n //\n\n float scale = clamp(ior * 2.0 - 2.0, 0.0, 1.0);\n return perceptualRoughness * scale;\n}\n\n#ifdef RN_USE_TRANSMISSION\nvec3 get_sample_from_backbuffer(float materialSID, vec2 sampleCoord, float perceptualRoughness, float ior) {\n ivec2 vrState = get_vrState(0.0, 0);\n vec2 backBufferTextureSize = get_backBufferTextureSize(materialSID, 0);\n float backBufferTextureLength = max(backBufferTextureSize.x, backBufferTextureSize.y);\n if (vrState.x == 1) { // For VR\n backBufferTextureLength = max(backBufferTextureSize.x / 2.0, backBufferTextureSize.y);\n sampleCoord.x = sampleCoord.x * 0.5;\n if (vrState.y == 1) { // For right eye\n sampleCoord.x += 0.5;\n }\n }\n float framebufferLod = log2(backBufferTextureLength) * scaleForLod(perceptualRoughness, ior);\n\n #ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n vec3 transmittedLight = texture2DLodEXT(u_backBufferTexture, sampleCoord, framebufferLod).rgb;\n #elif defined(GLSL_ES3)\n vec3 transmittedLight = textureLod(u_backBufferTexture, sampleCoord, framebufferLod).rgb;\n #else\n vec3 transmittedLight = texture(u_backBufferTexture, sampleCoord).rgb;\n #endif\n\n return transmittedLight;\n}\n#endif\n\nvec3 get_radiance(vec3 reflection, float lod, ivec2 hdriFormat) {\n #ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n vec4 specularTexel = textureCubeLodEXT(u_specularEnvTexture, reflection, lod);\n #elif defined(GLSL_ES3)\n vec4 specularTexel = textureLod(u_specularEnvTexture, reflection, lod);\n #else\n vec4 specularTexel = texture(u_specularEnvTexture, reflection);\n #endif\n\n// #pragma shaderity: require(./../common/fetchCubeTexture.glsl)\n\n vec3 radiance;\n if (hdriFormat.y == 0) {\n // LDR_SRGB\n radiance = srgbToLinear(specularTexel.rgb);\n }\n else if (hdriFormat.y == 3) {\n // RGBE\n radiance = specularTexel.rgb * pow(2.0, specularTexel.a*255.0-128.0);\n }\n else {\n radiance = specularTexel.rgb;\n }\n\n return radiance;\n}\n\n// from glTF Sample Viewer: https://github.com/KhronosGroup/glTF-Sample-Viewer\nvec3 getVolumeTransmissionRay(vec3 n, vec3 v, float thickness, float ior)\n{\n vec3 refractionVector = refract(-v, normalize(n), 1.0 / ior);\n mat4 worldMatrix = get_worldMatrix(v_instanceInfo);\n\n vec3 modelScale;\n modelScale.x = length(vec3(worldMatrix[0].xyz));\n modelScale.y = length(vec3(worldMatrix[1].xyz));\n modelScale.z = length(vec3(worldMatrix[2].xyz));\n\n return normalize(refractionVector) * thickness * modelScale;\n}\n\nstruct IblResult\n{\n vec3 specular;\n vec3 diffuse;\n vec3 FssEss;\n};\n\nIblResult getIBLRadianceGGX(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection)\n{\n // get radiance\n float mipCount = iblParameter.x;\n float lod = (perceptualRoughness * (mipCount - 1.0));\n vec3 radiance = get_radiance(reflection, lod, hdriFormat);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughness(F0, NdotV, perceptualRoughness);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Specular IBL\n vec3 specular = FssEss * radiance;\n\n // scale with user parameters\n float IBLSpecularContribution = iblParameter.z;\n specular *= IBLSpecularContribution;\n\n result.specular = specular;\n\n return result;\n}\n\nIblResult getIBLRadianceGGXWithIridescence(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection, vec3 iridescenceFresnel, float iridescence)\n{\n // get radiance\n float mipCount = iblParameter.x;\n float lod = (perceptualRoughness * (mipCount - 1.0));\n vec3 radiance = get_radiance(reflection, lod, hdriFormat);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughnessWithIridescence(F0, NdotV, perceptualRoughness, iridescenceFresnel, iridescence);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Specular IBL\n vec3 specular = FssEss * radiance;\n\n // scale with user parameters\n float IBLSpecularContribution = iblParameter.z;\n specular *= IBLSpecularContribution;\n\n result.specular = specular;\n\n return result;\n}\n\nIblResult getIBLRadianceLambertian(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection)\n{\n // get irradiance\n vec3 irradiance = get_irradiance(normal_forEnv, materialSID, hdriFormat);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughness(F0, NdotV, perceptualRoughness);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Multiple scattering, Fdez-Aguera's approach\n float Ems = (1.0 - (f_ab.x + f_ab.y));\n vec3 F_avg = F0 + (1.0 - F0) / 21.0;\n vec3 FmsEms = Ems * FssEss * F_avg / (1.0 - F_avg * Ems);\n vec3 k_D = albedo * (1.0 - FssEss - FmsEms);\n\n // Diffuse IBL\n vec3 diffuse = (FmsEms + k_D) * irradiance;\n\n // scale with user parameters\n float IBLDiffuseContribution = iblParameter.y;\n diffuse *= IBLDiffuseContribution;\n\n result.diffuse = diffuse;\n\n return result;\n}\n\nIblResult getIBLRadianceLambertianWithIridescence(float materialSID, float NdotV, vec3 viewDirection, vec3 albedo, vec3 F0,\n float perceptualRoughness, vec4 iblParameter, ivec2 hdriFormat, mat3 rotEnvMatrix,\n vec3 normal_forEnv, vec3 reflection, vec3 iridescenceF0, float iridescence)\n{\n // get irradiance\n vec3 irradiance = get_irradiance(normal_forEnv, materialSID, hdriFormat);\n\n // Use the maximum component of the iridescence Fresnel color\n // Maximum is used instead of the RGB value to not get inverse colors for the diffuse BRDF\n vec3 iridescenceF0Max = vec3(max(max(iridescenceF0.r, iridescenceF0.g), iridescenceF0.b));\n\n // Blend between base F0 and iridescence F0\n vec3 mixedF0 = mix(F0, iridescenceF0Max, iridescence);\n\n // Roughness dependent fresnel\n vec3 kS = fresnelSchlickRoughness(mixedF0, NdotV, perceptualRoughness);\n vec2 f_ab = envBRDFApprox(perceptualRoughness, NdotV);\n vec3 FssEss = kS * f_ab.x + f_ab.y;\n IblResult result;\n result.FssEss = FssEss;\n\n // Multiple scattering, Fdez-Aguera's approach\n float Ems = (1.0 - (f_ab.x + f_ab.y));\n vec3 F_avg = mixedF0 + (1.0 - mixedF0) / 21.0;\n vec3 FmsEms = Ems * FssEss * F_avg / (1.0 - F_avg * Ems);\n vec3 k_D = albedo * (1.0 - FssEss - FmsEms);\n\n // Diffuse IBL\n vec3 diffuse = (FmsEms + k_D) * irradiance;\n\n // scale with user parameters\n float IBLDiffuseContribution = iblParameter.y;\n diffuse *= IBLDiffuseContribution;\n\n result.diffuse = diffuse;\n\n return result;\n}\n\n#ifdef RN_USE_SHEEN\nvec3 sheenIBL(float NdotV, float sheenPerceptualRoughness, vec3 sheenColor, vec4 iblParameter, vec3 reflection, ivec2 hdriFormat)\n{\n float mipCount = iblParameter.x;\n float lod = (sheenPerceptualRoughness * (mipCount - 1.0));\n\n vec2 sheenLutUV = vec2(NdotV, sheenPerceptualRoughness);\n float brdf = texture(u_sheenLutTexture, sheenLutUV).b;\n vec3 sheenLight = get_radiance(reflection, lod, hdriFormat);\n float IBLSpecularContribution = iblParameter.z;\n sheenLight *= IBLSpecularContribution;\n\n return sheenLight * sheenColor * brdf;\n}\n#endif\n\nvec3 getNormalForEnv(mat3 rotEnvMatrix, vec3 normal_inWorld, float materialSID) {\n vec3 normal_forEnv = rotEnvMatrix * normal_inWorld;\n if (get_inverseEnvironment(materialSID, 0)) {\n normal_forEnv.x *= -1.0;\n }\n return normal_forEnv;\n}\n\nvec3 getReflection(mat3 rotEnvMatrix, vec3 viewDirection, vec3 normal_inWorld, float materialSID, float perceptualRoughness, float anisotropy, vec3 anisotropyDirection) {\n#ifdef RN_USE_ANISOTROPY\n\n float tangentRoughness = mix(perceptualRoughness, 1.0, anisotropy * anisotropy);\n vec3 anisotropicTangent = cross(anisotropyDirection, viewDirection);\n vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);\n float bendFactor = 1.0 - anisotropy * (1.0 - perceptualRoughness);\n float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor;\n vec3 bentNormal = normalize(mix(anisotropicNormal, normal_inWorld, bendFactorPow4));\n vec3 reflection = rotEnvMatrix * reflect(-viewDirection, bentNormal);\n#else\n vec3 reflection = rotEnvMatrix * reflect(-viewDirection, normal_inWorld);\n#endif\n if (get_inverseEnvironment(materialSID, 0)) {\n reflection.x *= -1.0;\n }\n return reflection;\n}\n\nvec3 IBLContribution(float materialSID, vec3 normal_inWorld, float NdotV, vec3 viewDirection,\n vec3 albedo, vec3 F0, float perceptualRoughness, float clearcoatRoughness, vec3 clearcoatNormal_inWorld,\n float clearcoat, float VdotNc, vec3 geomNormal_inWorld, float cameraSID, float transmission, vec3 v_position_inWorld,\n float thickness, vec3 sheenColor, float sheenRoughness, float albedoSheenScalingNdotV, float ior,\n vec3 iridescenceFresnel, vec3 iridescenceF0, float iridescence, float anisotropy, vec3 anisotropyDirection)\n{\n vec4 iblParameter = get_iblParameter(materialSID, 0);\n float rot = iblParameter.w + 3.1415;\n mat3 rotEnvMatrix = mat3(cos(rot), 0.0, -sin(rot), 0.0, 1.0, 0.0, sin(rot), 0.0, cos(rot));\n ivec2 hdriFormat = get_hdriFormat(materialSID, 0);\n\n vec3 normal_forEnv = getNormalForEnv(rotEnvMatrix, normal_inWorld, materialSID);\n vec3 reflection = getReflection(rotEnvMatrix, viewDirection, normal_inWorld, materialSID, perceptualRoughness, anisotropy, anisotropyDirection);\n\n // IBL\n #ifdef RN_USE_IRIDESCENCE\n IblResult baseRadianceResult = getIBLRadianceGGXWithIridescence(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection, iridescenceFresnel, iridescence);\n IblResult baseLambertianResult = getIBLRadianceLambertianWithIridescence(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection, iridescenceF0, iridescence);\n #else\n IblResult baseRadianceResult = getIBLRadianceGGX(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection);\n IblResult baseLambertianResult = getIBLRadianceLambertian(materialSID, NdotV, viewDirection, albedo, F0,\n perceptualRoughness, iblParameter, hdriFormat, rotEnvMatrix, normal_forEnv, reflection);\n #endif\n\n#ifdef RN_USE_TRANSMISSION\n vec3 refractedRay = getVolumeTransmissionRay(geomNormal_inWorld, viewDirection, thickness, ior);\n vec3 refractedRayFromVPosition = v_position_inWorld + refractedRay;\n vec4 ndcPoint = get_projectionMatrix(cameraSID, 0) * get_viewMatrix(cameraSID, 0) * vec4(refractedRayFromVPosition, 1.0);\n vec2 refractionCoords = ndcPoint.xy / ndcPoint.w;\n refractionCoords += 1.0;\n refractionCoords /= 2.0;\n vec3 transmittedLight = get_sample_from_backbuffer(materialSID, refractionCoords, perceptualRoughness, ior);\n\n#ifdef RN_USE_VOLUME\n vec3 attenuationColor = get_attenuationColor(materialSID, 0);\n float attenuationDistance = get_attenuationDistance(materialSID, 0);\n transmittedLight = volumeAttenuation(attenuationColor, attenuationDistance, transmittedLight, length(refractedRay));\n#endif\n\n vec3 transmissionComp = (vec3(1.0) - baseRadianceResult.FssEss) * transmittedLight * albedo;\n vec3 diffuse = mix(baseLambertianResult.diffuse, transmissionComp, transmission);\n vec3 base = diffuse + baseRadianceResult.specular;\n#else\n vec3 base = baseLambertianResult.diffuse + baseRadianceResult.specular;\n#endif\n\n#ifdef RN_USE_SHEEN\n vec3 sheen = sheenIBL(NdotV, sheenRoughness, sheenColor, iblParameter, reflection, hdriFormat);\n vec3 color = sheen + base * albedoSheenScalingNdotV;\n#else\n vec3 color = base;\n#endif\n\n#ifdef RN_USE_CLEARCOAT\n float VdotNg = dot(geomNormal_inWorld, viewDirection);\n vec3 clearcoatNormal_forEnv = getNormalForEnv(rotEnvMatrix, normal_inWorld, materialSID);\n IblResult coatResult = getIBLRadianceGGX(materialSID, VdotNc, viewDirection, vec3(0.0), F0,\n clearcoatRoughness, iblParameter, hdriFormat, rotEnvMatrix, clearcoatNormal_forEnv, reflection);\n vec3 coatLayer = coatResult.specular;\n\n float clearcoatFresnel = 0.04 + (1.0 - 0.04) * pow(1.0 - abs(VdotNc), 5.0);\n vec3 coated = color * vec3(1.0 - clearcoat * clearcoatFresnel) + vec3(coatLayer * clearcoat);\n return coated;\n#else\n return color;\n#endif\n\n}\n\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvec2 getTexcoord(int texcoordIndex) {\n vec2 texcoord;\n if(texcoordIndex == 2){\n texcoord = v_texcoord_2;\n } else if(texcoordIndex == 1){\n texcoord = v_texcoord_1;\n }else{\n texcoord = v_texcoord_0;\n }\n return texcoord;\n}\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n mat3 getTBN(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord) {\n vec3 tangent_inWorld = normalize(v_tangent_inWorld);\n vec3 binormal_inWorld = normalize(v_binormal_inWorld);\n mat3 tbnMat_tangent_to_world = mat3(tangent_inWorld, binormal_inWorld, normal_inWorld);\n\n return tbnMat_tangent_to_world;\n }\n#else\n // This is based on http://www.thetenthplanet.de/archives/1180\n mat3 cotangent_frame(vec3 normal_inWorld, vec3 position, vec2 uv) {\n uv = gl_FrontFacing ? uv : -uv;\n\n // get edge vectors of the pixel triangle\n vec3 dp1 = dFdx(position);\n vec3 dp2 = dFdy(position);\n vec2 duv1 = dFdx(uv);\n vec2 duv2 = dFdy(uv);\n\n // solve the linear system\n vec3 dp2perp = cross(dp2, normal_inWorld);\n vec3 dp1perp = cross(normal_inWorld, dp1);\n vec3 tangent = dp2perp * duv1.x + dp1perp * duv2.x;\n vec3 bitangent = dp2perp * duv1.y + dp1perp * duv2.y;\n bitangent *= -1.0;\n\n // construct a scale-invariant frame\n float invMat = inversesqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));\n return mat3(tangent * invMat, bitangent * invMat, normal_inWorld);\n }\n\n mat3 getTBN(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord) {\n mat3 tbnMat_tangent_to_world = cotangent_frame(normal_inWorld, -viewVector, texcoord);\n\n return tbnMat_tangent_to_world;\n }\n#endif\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // View direction\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n vec3 viewVector = viewPosition - v_position_inWorld.xyz;\n vec3 viewDirection = normalize(viewVector);\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n vec3 geomNormal_inWorld = normal_inWorld;\n vec4 normalTextureTransform = get_normalTextureTransform(materialSID, 0);\n float normalTextureRotation = get_normalTextureRotation(materialSID, 0);\n int normalTexcoordIndex = get_normalTexcoordIndex(materialSID, 0);\n vec2 normalTexcoord = getTexcoord(normalTexcoordIndex);\n vec2 normalTexUv = uvTransform(normalTextureTransform.xy, normalTextureTransform.zw, normalTextureRotation, normalTexcoord);\n mat3 TBN = getTBN(normal_inWorld, viewVector, normalTexUv);\n #ifdef RN_USE_NORMAL_TEXTURE\n vec3 normalTexValue = texture(u_normalTexture, normalTexUv).xyz;\n if(normalTexValue.b >= 128.0 / 255.0) {\n // normal texture is existence\n vec3 normalTex = normalTexValue * 2.0 - 1.0;\n float normalScale = get_normalScale(materialSID, 0);\n vec3 scaledNormal = normalize(normalTex * vec3(normalScale, normalScale, 1.0));\n normal_inWorld = normalize(TBN * scaledNormal);\n }\n #endif\n\n // BaseColorFactor\n vec3 baseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n vec4 baseColorFactor = get_baseColorFactor(materialSID, 0);\n if (v_color != baseColor && baseColorFactor.rgb != baseColor) {\n baseColor = v_color * baseColorFactor.rgb;\n alpha = baseColorFactor.a;\n } else if (v_color == baseColor) {\n baseColor = baseColorFactor.rgb;\n alpha = baseColorFactor.a;\n } else if (baseColorFactor.rgb == baseColor) {\n baseColor = v_color;\n } else {\n baseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // BaseColor (take account for BaseColorTexture)\n vec4 baseColorTextureTransform = get_baseColorTextureTransform(materialSID, 0);\n float baseColorTextureRotation = get_baseColorTextureRotation(materialSID, 0);\n int baseColorTexcoordIndex = get_baseColorTexcoordIndex(materialSID, 0);\n vec2 baseColorTexcoord = getTexcoord(baseColorTexcoordIndex);\n vec2 baseColorTexUv = uvTransform(baseColorTextureTransform.xy, baseColorTextureTransform.zw, baseColorTextureRotation, baseColorTexcoord);\n vec4 textureColor = texture(u_baseColorTexture, baseColorTexUv);\n baseColor *= srgbToLinear(textureColor.rgb);\n alpha *= textureColor.a;\n\n#ifdef RN_IS_ALPHAMODE_MASK\n float alphaCutoff = get_alphaCutoff(materialSID, 0);\n if (alpha < alphaCutoff) {\n discard;\n }\n#endif\n\n\n\n#ifdef RN_IS_LIGHTING\n // Metallic & Roughness\n vec2 metallicRoughnessFactor = get_metallicRoughnessFactor(materialSID, 0);\n float metallic = metallicRoughnessFactor.x;\n vec4 metallicRoughnessTextureTransform = get_metallicRoughnessTextureTransform(materialSID, 0);\n float metallicRoughnessTextureRotation = get_metallicRoughnessTextureRotation(materialSID, 0);\n int metallicRoughnessTexcoordIndex = get_metallicRoughnessTexcoordIndex(materialSID, 0);\n vec2 metallicRoughnessTexcoord = getTexcoord(metallicRoughnessTexcoordIndex);\n vec2 metallicRoughnessTexUv = uvTransform(metallicRoughnessTextureTransform.xy, metallicRoughnessTextureTransform.zw, metallicRoughnessTextureRotation, metallicRoughnessTexcoord);\n vec4 ormTexel = texture(u_metallicRoughnessTexture, metallicRoughnessTexUv);\n float perceptualRoughness = ormTexel.g * metallicRoughnessFactor.y;\n metallic = ormTexel.b * metallic;\n metallic = clamp(metallic, 0.0, 1.0);\n perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n float alphaRoughness = perceptualRoughness * perceptualRoughness;\n // filter NDF for specular AA --- https://jcgt.org/published/0010/02/02/\n float alphaRoughness2 = alphaRoughness * alphaRoughness;\n float filteredRoughness2 = IsotropicNDFFiltering(normal_inWorld, alphaRoughness2);\n perceptualRoughness = sqrt(sqrt(filteredRoughness2));\n\n // Albedo\n vec3 black = vec3(0.0);\n vec3 albedo = mix(baseColor.rgb, black, metallic);\n\n // NdotV\n float NdotV = saturateEpsilonToOne(dot(normal_inWorld, viewDirection));\n\n #ifdef RN_USE_ANISOTROPY\n float anisotropy = get_anisotropyStrength(materialSID, 0);\n vec2 anisotropyRotation = get_anisotropyRotation(materialSID, 0);\n vec2 direction = anisotropyRotation;\n vec3 anisotropyTex = texture(u_anisotropyTexture, baseColorTexUv).rgb;\n direction = anisotropyTex.rg * 2.0 - vec2(1.0);\n direction = mat2(anisotropyRotation.x, anisotropyRotation.y, -anisotropyRotation.y, anisotropyRotation.x) * normalize(direction);\n anisotropy *= anisotropyTex.b;\n vec3 anisotropicT = normalize(TBN * vec3(direction, 0.0));\n vec3 anisotropicB = normalize(cross(geomNormal_inWorld, anisotropicT));\n float BdotV = dot(anisotropicB, viewDirection);\n float TdotV = dot(anisotropicT, viewDirection);\n #else\n float anisotropy = 0.0;\n vec3 anisotropicT = vec3(0.0, 0.0, 0.0);\n vec3 anisotropicB = vec3(0.0, 0.0, 0.0);\n float BdotV = 0.0;\n float TdotV = 0.0;\n #endif\n\n // Clearcoat\n #ifdef RN_USE_CLEARCOAT\n float clearcoatFactor = get_clearCoatFactor(materialSID, 0);\n vec4 clearcoatTextureTransform = get_clearCoatTextureTransform(materialSID, 0);\n float clearcoatTextureRotation = get_clearCoatTextureRotation(materialSID, 0);\n int clearCoatTexcoordIndex = get_clearCoatTexcoordIndex(materialSID, 0);\n vec2 clearCoatTexcoord = getTexcoord(clearCoatTexcoordIndex);\n vec2 clearcoatTexUv = uvTransform(clearcoatTextureTransform.xy, clearcoatTextureTransform.zw, clearcoatTextureRotation, clearCoatTexcoord);\n float clearcoatTexture = texture(u_clearCoatTexture, clearcoatTexUv).r;\n float clearcoat = clearcoatFactor * clearcoatTexture;\n #else\n float clearcoat = 0.0;\n #endif // RN_USE_CLEARCOAT\n\n // Transmission\n #ifdef RN_USE_TRANSMISSION\n float transmissionFactor = get_transmissionFactor(materialSID, 0);\n float transmissionTexture = texture(u_transmissionTexture, baseColorTexUv).r;\n float transmission = transmissionFactor * transmissionTexture;\n // alpha *= transmission;\n #else\n float transmission = 0.0;\n #endif // RN_USE_TRANSMISSION\n\n #ifdef RN_USE_SPECULAR\n float specularTexture = texture(u_specularTexture, baseColorTexUv).a;\n float specular = get_specularFactor(materialSID, 0) * specularTexture;\n vec3 specularColorTexture = srgbToLinear(texture(u_specularTexture, baseColorTexUv).rgb);\n vec3 specularColor = get_specularColorFactor(materialSID, 0) * specularColorTexture;\n #else\n float specular = 1.0;\n vec3 specularColor = vec3(1.0, 1.0, 1.0);\n #endif // RN_USE_SPECULAR\n\n // F0, F90\n float ior = get_ior(materialSID, 0);\n float outsideIor = 1.0;\n vec3 dielectricSpecularF0 = min(\n ((ior - outsideIor) / (ior + outsideIor)) * ((ior - outsideIor) / (ior + outsideIor)) * specularColor,\n vec3(1.0)\n ) * specular;\n vec3 dielectricSpecularF90 = vec3(specular);\n vec3 F0 = mix(dielectricSpecularF0, baseColor.rgb, metallic);\n vec3 F90 = mix(dielectricSpecularF90, vec3(1.0), metallic);\n\n // Iridescence\n #ifdef RN_USE_IRIDESCENCE\n float iridescenceFactor = get_iridescenceFactor(materialSID, 0);\n float iridescenceTexture = texture(u_iridescenceTexture, baseColorTexUv).r;\n float iridescence = iridescenceFactor * iridescenceTexture;\n float iridescenceIor = get_iridescenceIor(materialSID, 0);\n float thicknessRatio = texture(u_iridescenceThicknessTexture, baseColorTexUv).r;\n float iridescenceThicknessMinimum = get_iridescenceThicknessMinimum(materialSID, 0);\n float iridescenceThicknessMaximum = get_iridescenceThicknessMaximum(materialSID, 0);\n float iridescenceThickness = mix(iridescenceThicknessMinimum, iridescenceThicknessMaximum, thicknessRatio);\n\n vec3 iridescenceFresnel = calcIridescence(1.0, iridescenceIor, NdotV, iridescenceThickness, F0);\n vec3 iridescenceF0 = Schlick_to_F0(iridescenceFresnel, NdotV);\n\n #else\n float iridescence = 0.0;\n vec3 iridescenceFresnel = vec3(0.0);\n vec3 iridescenceF0 = F0;\n #endif // RN_USE_IRIDESCENCE\n\n #ifdef RN_USE_CLEARCOAT\n // Clearcoat\n float clearcoatRoughnessFactor = get_clearCoatRoughnessFactor(materialSID, 0);\n int clearCoatRoughnessTexcoordIndex = get_clearCoatRoughnessTexcoordIndex(materialSID, 0);\n vec2 clearCoatRoughnessTexcoord = getTexcoord(clearCoatRoughnessTexcoordIndex);\n vec4 clearcoatRoughnessTextureTransform = get_clearCoatRoughnessTextureTransform(materialSID, 0);\n float clearcoatRoughnessTextureRotation = get_clearCoatRoughnessTextureRotation(materialSID, 0);\n vec2 clearcoatRoughnessTexUv = uvTransform(clearcoatRoughnessTextureTransform.xy, clearcoatRoughnessTextureTransform.zw, clearcoatRoughnessTextureRotation, clearCoatRoughnessTexcoord);\n float textureRoughnessTexture = texture(u_clearCoatRoughnessTexture, clearcoatRoughnessTexUv).g;\n float clearcoatRoughness = clearcoatRoughnessFactor * textureRoughnessTexture;\n\n int clearCoatNormalTexcoordIndex = get_clearCoatNormalTexcoordIndex(materialSID, 0);\n vec2 clearCoatNormalTexcoord = getTexcoord(clearCoatNormalTexcoordIndex);\n vec4 clearcoatNormalTextureTransform = get_clearCoatNormalTextureTransform(materialSID, 0);\n float clearcoatNormalTextureRotation = get_clearCoatNormalTextureRotation(materialSID, 0);\n vec2 clearcoatNormalTexUv = uvTransform(clearcoatNormalTextureTransform.xy, clearcoatNormalTextureTransform.zw, clearcoatNormalTextureRotation, clearCoatNormalTexcoord);\n vec3 textureNormal_tangent = texture(u_clearCoatNormalTexture, clearcoatNormalTexUv).xyz * vec3(2.0) - vec3(1.0);\n vec3 clearcoatNormal_inWorld = normalize(TBN * textureNormal_tangent);\n float VdotNc = saturateEpsilonToOne(dot(viewDirection, clearcoatNormal_inWorld));\n #else\n float clearcoatRoughness = 0.0;\n vec3 clearcoatNormal_inWorld = vec3(0.0);\n float VdotNc = 0.0;\n #endif // RN_USE_CLEARCOAT\n\n #ifdef RN_USE_VOLUME\n // Volume\n float thicknessFactor = get_thicknessFactor(materialSID, 0);\n float thicknessTexture = texture(u_thicknessTexture, baseColorTexUv).g;\n float attenuationDistance = get_attenuationDistance(materialSID, 0);\n vec3 attenuationColor = get_attenuationColor(materialSID, 0);\n float thickness = thicknessFactor * thicknessTexture;\n #else\n float thickness = 0.0;\n vec3 attenuationColor = vec3(0.0);\n float attenuationDistance = 0.000001;\n #endif // RN_USE_VOLUME\n\n #ifdef RN_USE_SHEEN\n // Sheen\n vec3 sheenColorFactor = get_sheenColorFactor(materialSID, 0);\n vec3 sheenColorTexture = texture(u_sheenColorTexture, baseColorTexUv).rgb;\n float sheenRoughnessFactor = get_sheenRoughnessFactor(materialSID, 0);\n float sheenRoughnessTexture = texture(u_sheenRoughnessTexture, baseColorTexUv).a;\n vec3 sheenColor = sheenColorFactor * sheenColorTexture;\n float sheenRoughness = clamp(sheenRoughnessFactor * sheenRoughnessTexture, 0.000001, 1.0);\n float albedoSheenScalingNdotV = 1.0 - max3(sheenColor) * texture(u_sheenLutTexture, vec2(NdotV, sheenRoughness)).r;\n #else\n vec3 sheenColor = vec3(0.0);\n float sheenRoughness = 0.000001;\n float albedoSheenScalingNdotV = 1.0;\n #endif // RN_USE_SHEEN\n\n rt0 = vec4(0.0, 0.0, 0.0, alpha);\n\n // Lighting\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n rt0.xyz += gltfBRDF(light, normal_inWorld, viewDirection, NdotV, albedo,\n perceptualRoughness, metallic, F0, F90, ior, transmission,\n clearcoat, clearcoatRoughness, clearcoatNormal_inWorld, VdotNc,\n attenuationColor, attenuationDistance,\n anisotropy, anisotropicT, anisotropicB, BdotV, TdotV,\n sheenColor, sheenRoughness, albedoSheenScalingNdotV);\n }\n\n #ifdef RN_USE_SHADOW_MAPPING\n float bias = 0.001;\n vec2 shadowCoord = v_shadowCoord.xy / v_shadowCoord.w;\n float shadowContribusion = 1.0;\n if (shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0) {\n shadowContribusion = varianceShadowContribution(shadowCoord, (v_shadowCoord.z - bias)/v_shadowCoord.w);\n }\n // rt0.rgb = rt0.rgb * (0.5 + shadowContribusion * 0.5);\n rt0.rgb = rt0.rgb * shadowContribusion;\n #endif\n\n vec3 ibl = IBLContribution(materialSID, normal_inWorld, NdotV, viewDirection,\n albedo, F0, perceptualRoughness, clearcoatRoughness, clearcoatNormal_inWorld,\n clearcoat, VdotNc, geomNormal_inWorld, cameraSID, transmission, v_position_inWorld.xyz, thickness,\n sheenColor, sheenRoughness, albedoSheenScalingNdotV, ior, iridescenceFresnel, iridescenceF0, iridescence, anisotropy, anisotropicB);\n\n int occlusionTexcoordIndex = get_occlusionTexcoordIndex(materialSID, 0);\n vec2 occlusionTexcoord = getTexcoord(occlusionTexcoordIndex);\n vec4 occlusionTextureTransform = get_occlusionTextureTransform(materialSID, 0);\n float occlusionTextureRotation = get_occlusionTextureRotation(materialSID, 0);\n vec2 occlusionTexUv = uvTransform(occlusionTextureTransform.xy, occlusionTextureTransform.zw, occlusionTextureRotation, occlusionTexcoord);\n float occlusion = texture(u_occlusionTexture, occlusionTexUv).r;\n float occlusionStrength = get_occlusionStrength(materialSID, 0);\n\n // Occlution to Indirect Lights\n rt0.xyz += mix(ibl, ibl * occlusion, occlusionStrength);\n#else\n rt0 = vec4(baseColor, alpha);\n#endif // RN_IS_LIGHTING\n\n // Emissive\n vec3 emissiveFactor = get_emissiveFactor(materialSID, 0);\n int emissiveTexcoordIndex = get_emissiveTexcoordIndex(materialSID, 0);\n vec2 emissiveTexcoord = getTexcoord(emissiveTexcoordIndex);\n vec4 emissiveTextureTransform = get_emissiveTextureTransform(materialSID, 0);\n float emissiveTextureRotation = get_emissiveTextureRotation(materialSID, 0);\n vec2 emissiveTexUv = uvTransform(emissiveTextureTransform.xy, emissiveTextureTransform.zw, emissiveTextureRotation, emissiveTexcoord);\n vec3 emissive = emissiveFactor * srgbToLinear(texture(u_emissiveTexture, emissiveTexUv).xyz);\n\n#ifdef RN_USE_CLEARCOAT\n vec3 coated_emissive = emissive * mix(vec3(1.0), vec3(0.04 + (1.0 - 0.04) * pow(1.0 - NdotV, 5.0)), clearcoat);\n rt0.xyz += coated_emissive;\n#else\n rt0.xyz += emissive;\n#endif // RN_USE_CLEARCOAT\n\n bool isOutputHDR = get_isOutputHDR(materialSID, 0);\n if(isOutputHDR){\n/* shaderity: @{renderTargetEnd} */\n\n return;\n }\n\n#ifdef RN_IS_ALPHAMODE_OPAQUE\n rt0.a = 1.0;\n#elif defined(RN_IS_ALPHAMODE_MASK)\n rt0.a = 1.0;\n#endif\n\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\n // rt0.rgb = vec3(texture(u_depthTexture, v_shadowCoord.xy/v_shadowCoord.w).r);\n\n // premultiplied alpha\n // rt0.rgb /= alpha;\n\nfloat makeOutputSrgb = float(get_makeOutputSrgb(materialSID, 0));\nrt0.rgb = mix(rt0.rgb, linearToSrgb(rt0.rgb), makeOutputSrgb);\n\nrt1 = rt0;\nrt2 = rt0;\nrt3 = rt0;\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},S={code:"/* shaderity: @{definitions} */\nstruct VertexOutput {\n @builtin(position) position : vec4,\n @location(0) normal : vec3,\n @location(1) texcoord_0 : vec2,\n @location(2) color_0 : vec2,\n}\n\nstruct StorageData {\n data: array>,\n}\n@binding(0) @group(0) var storageData : StorageData;\n\noverride _materialSID: u32;\n\nfn fetchElement(vec4_idx: u32) -> vec4\n{\n return storageData.data[vec4_idx];\n}\n\nfn fetchVec3No16BytesAligned(scalar_idx: u32) -> vec3 {\n let posIn4bytes = scalar_idx % 4u;\n\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n if (posIn4bytes == 0u) {\n let val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1u) {\n let val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2u) {\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.w, val1.xy);\n }\n}\n\nfn fetchVec4(vec4_idx: u32) -> vec4 {\n return fetchElement(vec4_idx);\n}\n\nfn fetchScalarNo16BytesAligned(scalar_idx: u32) -> f32 {\n let posIn4bytes = scalar_idx % 4u;\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n let val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0u) {\n return val.x;\n } else if (posIn4bytes == 1u) {\n return val.y;\n } else if (posIn4bytes == 2u) {\n return val.z;\n } else { // posIn4bytes == 3u\n return val.w;\n }\n}\n\n\n\n\nfn fetchMat4(vec4_idx: u32) -> mat4x4\n{\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n let col3 = fetchElement(vec4_idx + 3u);\n\n let val = mat4x4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\n\nfn fetchMat4x3(vec4_idx: u32) -> mat4x3 {\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n\n let val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n\n return val;\n}\n\n\n/* shaderity: @{getters} */\n/* shaderity: @{matricesGetters} */\n\n\n#ifdef RN_IS_SKINNING\n\nfn createMatrixFromQuaternionTranslationScale( quaternion: vec4, translation: vec3, scale: vec3 ) -> mat4x3 {\n let q = quaternion;\n let t = translation;\n\n let sx = q.x * q.x;\n let sy = q.y * q.y;\n let sz = q.z * q.z;\n let cx = q.y * q.z;\n let cy = q.x * q.z;\n let cz = q.x * q.y;\n let wx = q.w * q.x;\n let wy = q.w * q.y;\n let wz = q.w * q.z;\n\n let mat = mat4x4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n let uniformScaleMat = mat4x4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n let mat44 = mat*uniformScaleMat;\n return mat4x3(\n vec3(mat44[0].x, mat44[0].y, mat44[0].z),\n vec3(mat44[1].x, mat44[1].y, mat44[1].z),\n vec3(mat44[2].x, mat44[2].y, mat44[2].z),\n vec3(mat44[3].x, mat44[3].y, mat44[3].z)\n );\n\n}\n\nfn unpackedVec2ToNormalizedVec4(vec_xy: vec2, criteria: f32) -> vec4 {\n\n var r: f32;\n var g: f32;\n var b: f32;\n var a: f32;\n\n let ix = floor(vec_xy.x * criteria);\n let v1x = ix / criteria;\n let v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n let iy = floor( vec_xy.y * criteria);\n let v2x = iy / criteria;\n let v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nfn getSkinMatrix(skeletalComponentSID: u32, joint: vec4, weight: vec4) -> mat4x3 {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n var skinMat: mat4x3 = weight.x * get_boneMatrix(skeletalComponentSID, joint.x);\n skinMat += weight.y * get_boneMatrix(skeletalComponentSID, joint.y);\n skinMat += weight.z * get_boneMatrix(skeletalComponentSID, joint.z);\n skinMat += weight.w * get_boneMatrix(skeletalComponentSID, joint.w);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n let criteria = vec2(4096.0, 4096.0);\n\n let tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, joint.x);\n let sq_x = get_boneScalePackedQuat(skeletalComponentSID, joint.x);\n var quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n var skinMat: mat4x3 = weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n let tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, joint.y);\n let sq_y = get_boneScalePackedQuat(skeletalComponentSID, joint.y);\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n let tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, joint.z);\n let sq_z = get_boneScalePackedQuat(skeletalComponentSID, joint.z);\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n let tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, joint.w);\n let sq_w = get_boneScalePackedQuat(skeletalComponentSID, joint.w);\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n let ts_x = get_boneTranslateScale(skeletalComponentSID, joint.x);\n var skinMat: mat4x3 = weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, joint.x), ts_x.xyz, vec3(ts_x.w));\n let ts_y = get_boneTranslateScale(skeletalComponentSID, joint.y);\n skinMat += weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, joint.y), ts_y.xyz, vec3(ts_y.w));\n let ts_z = get_boneTranslateScale(skeletalComponentSID, joint.z);\n skinMat += weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, joint.z), ts_z.xyz, vec3(ts_z.w));\n let ts_w = get_boneTranslateScale(skeletalComponentSID, joint.w);\n skinMat += weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, joint.w), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n let boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, joint.x);\n let boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, joint.y);\n let boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, joint.z);\n let boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, joint.w);\n\n let criteria = vec2(4096.0, 4096.0);\n let boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n let ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n var skinMat: mat4x3 = weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n let ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n let ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n let ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n@vertex\nfn main(\n#ifdef RN_USE_INSTANCE\n @location(8) instance_ids: vec4,\n#endif\n#ifdef RN_USE_POSITION\n @location(0) position: vec3,\n#endif\n#ifdef RN_USE_NORMAL\n @location(1) normal: vec3,\n#endif\n#ifdef RN_USE_TANGENT\n @location(2) tangent: vec3,\n#endif\n#ifdef RN_USE_TEXCOORD_0\n @location(3) texcoord_0: vec2,\n#endif\n#ifdef RN_USE_COLOR_0\n @location(3) color_0: vec2,\n#endif\n) -> VertexOutput {\nlet materialSID = _materialSID;\n\n\n var output : VertexOutput;\n\n let cameraSID = u32(get_currentComponentSIDs(0, /* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */));\n let worldMatrix = get_worldMatrix(u32(instance_ids.x));\n let viewMatrix = get_viewMatrix(cameraSID, 0);\n let projectionMatrix = get_projectionMatrix(cameraSID, 0);\n\n output.position = projectionMatrix * viewMatrix * worldMatrix * vec4(position, 1.0);\n#ifdef RN_USE_NORMAL\n output.normal = normalize((worldMatrix * vec4(normal, 0.0)).xyz);\n#endif\n\n#ifdef RN_USE_TEXCOORD_0\n output.texcoord_0 = texcoord_0;\n#endif\n\n#ifdef RN_USE_COLOR_0\n output.color_0 = color_0;\n#endif\n\n // output.Position = vec4(position, 1.0);\n\n return output;\n}\n",shaderStage:"vertex",isFragmentShader:!1},C={code:"/* shaderity: @{definitions} */\nstruct VertexOutput {\n @builtin(position) position : vec4,\n @location(0) normal : vec3,\n @location(1) texcoord_0 : vec2,\n @location(2) color_0 : vec2,\n}\n\nstruct StorageData {\n data: array>,\n}\n@binding(0) @group(0) var storageData : StorageData;\n\noverride _materialSID: u32;\n\nfn fetchElement(vec4_idx: u32) -> vec4\n{\n return storageData.data[vec4_idx];\n}\n\nfn fetchVec3No16BytesAligned(scalar_idx: u32) -> vec3 {\n let posIn4bytes = scalar_idx % 4u;\n\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n if (posIn4bytes == 0u) {\n let val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1u) {\n let val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2u) {\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.w, val1.xy);\n }\n}\n\nfn fetchVec4(vec4_idx: u32) -> vec4 {\n return fetchElement(vec4_idx);\n}\n\nfn fetchScalarNo16BytesAligned(scalar_idx: u32) -> f32 {\n let posIn4bytes = scalar_idx % 4u;\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n let val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0u) {\n return val.x;\n } else if (posIn4bytes == 1u) {\n return val.y;\n } else if (posIn4bytes == 2u) {\n return val.z;\n } else { // posIn4bytes == 3u\n return val.w;\n }\n}\n\n\n\n\nfn fetchMat4(vec4_idx: u32) -> mat4x4\n{\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n let col3 = fetchElement(vec4_idx + 3u);\n\n let val = mat4x4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\n\nfn fetchMat4x3(vec4_idx: u32) -> mat4x3 {\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n\n let val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n\n return val;\n}\n\n\n/* shaderity: @{getters} */\n\n// #param baseColorFactor: vec4; // initialValue=(1,1,1,1)\n\n@group(1) @binding(0) var baseColorTexture: texture_2d; // initialValue=white\n@group(2) @binding(0) var baseColorSampler: sampler;\n\n@fragment\nfn main(\n input: VertexOutput\n) -> @location(0) vec4 {\nlet materialSID = _materialSID;\n\n\n var Normal = input.normal * 0.5 + 0.5;\n\n var baseColor = vec4(1, 1, 1, 1);\n var baseColorFactor = get_baseColorFactor(materialSID, 0u);\n\n#ifdef RN_USE_COLOR_0\n baseColor = input.color_0;\n#endif\n\n baseColor *= baseColorFactor;\n\n#ifdef RN_USE_TEXCOORD_0\n baseColor *= textureSample(baseColorTexture, baseColorSampler, input.texcoord_0);\n#endif\n return baseColor;\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var w=n(5757),R=n(4878);const P={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nout vec2 v_texcoord_0;\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n v_texcoord_0 = a_texcoord_0;\n}\n",shaderStage:"vertex",isFragmentShader:!1},M={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/**\n * This file contains source code provided by NVIDIA Corporation.\n * FXAA antialiasing is developed by NVIDIA.\n * The codes of this file is modified from original code to work on WebGL1.\n * The modification for GLSL 100 is referred from Three.js, https://github.com/mrdoob/three.js/blob/5ba4c25bcb74577e1b1e14906f345135610a94f3/examples/js/shaders/FXAAShader.js\n * The original FXAA code is https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/80e8ba8f5e8935821513207033490735dd3279d8/samples/es3-kepler/FXAA/FXAA3_11.h\n */\n\n//----------------------------------------------------------------------------------\n// File: es3-kepler\\FXAA/FXAA3_11.h\n// SDK Version: v3.00\n// Email: gameworks@nvidia.com\n// Site: http://developer.nvidia.com/\n//\n// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// * Neither the name of NVIDIA CORPORATION nor the names of its\n// contributors may be used to endorse or promote products derived\n// from this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 'AS IS' AND ANY\n// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//----------------------------------------------------------------------------------\n/*============================================================================\n NVIDIA FXAA 3.11 by TIMOTHY LOTTES\n============================================================================*/\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord_0;\n\nuniform sampler2D u_baseColorTexture; // initialValue=(0,white)\nuniform vec2 u_screenInfo; // initialValue=(0,0)\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\n\n\n #define FXAA_PC 1\n #define FXAA_QUALITYPRESET 39\n #define FXAA_GREEN_AS_LUMA 0\n #define FXAA_GLSL_100 1\n\n /*============================================================================\n INTEGRATION KNOBS\n ============================================================================*/\n //\n // FXAA_PS3 and FXAA_360 choose the console algorithm (FXAA3 CONSOLE).\n // FXAA_360_OPT is a prototype for the new optimized 360 version.\n //\n // 1 = Use API.\n // 0 = Don't use API.\n //\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_PS3\n #define FXAA_PS3 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_360\n #define FXAA_360 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_360_OPT\n #define FXAA_360_OPT 0\n #endif\n /*==========================================================================*/\n #ifndef FXAA_PC\n //\n // FXAA Quality\n // The high quality PC algorithm.\n //\n #define FXAA_PC 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_PC_CONSOLE\n //\n // The console algorithm for PC is included\n // for developers targeting really low spec machines.\n // Likely better to just run FXAA_PC, and use a really low preset.\n //\n #define FXAA_PC_CONSOLE 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GLSL_120\n #define FXAA_GLSL_120 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GLSL_130\n #define FXAA_GLSL_130 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_3\n #define FXAA_HLSL_3 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_4\n #define FXAA_HLSL_4 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_HLSL_5\n #define FXAA_HLSL_5 0\n #endif\n /*==========================================================================*/\n #ifndef FXAA_GREEN_AS_LUMA\n //\n // For those using non-linear color,\n // and either not able to get luma in alpha, or not wanting to,\n // this enables FXAA to run using green as a proxy for luma.\n // So with this enabled, no need to pack luma in alpha.\n //\n // This will turn off AA on anything which lacks some amount of green.\n // Pure red and blue or combination of only R and B, will get no AA.\n //\n // Might want to lower the settings for both,\n // fxaaConsoleEdgeThresholdMin\n // fxaaQualityEdgeThresholdMin\n // In order to insure AA does not get turned off on colors\n // which contain a minor amount of green.\n //\n // 1 = On.\n // 0 = Off.\n //\n #define FXAA_GREEN_AS_LUMA 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_EARLY_EXIT\n //\n // Controls algorithm's early exit path.\n // On PS3 turning this ON adds 2 cycles to the shader.\n // On 360 turning this OFF adds 10ths of a millisecond to the shader.\n // Turning this off on console will result in a more blurry image.\n // So this defaults to on.\n //\n // 1 = On.\n // 0 = Off.\n //\n #define FXAA_EARLY_EXIT 1\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_DISCARD\n //\n // Only valid for PC OpenGL currently.\n // Probably will not work when FXAA_GREEN_AS_LUMA = 1.\n //\n // 1 = Use discard on pixels which don't need AA.\n // For APIs which enable concurrent TEX+ROP from same surface.\n // 0 = Return unchanged color on pixels which don't need AA.\n //\n #define FXAA_DISCARD 0\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_FAST_PIXEL_OFFSET\n //\n // Used for GLSL 120 only.\n //\n // 1 = GL API supports fast pixel offsets\n // 0 = do not use fast pixel offsets\n //\n #ifdef GLEXT_gpu_shader4\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifdef GLNV_gpu_shader5\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifdef GLARB_gpu_shader5\n #define FXAA_FAST_PIXEL_OFFSET 1\n #endif\n #ifndef FXAA_FAST_PIXEL_OFFSET\n #define FXAA_FAST_PIXEL_OFFSET 0\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_GATHER4_ALPHA\n //\n // 1 = API supports gather4 on alpha channel.\n // 0 = API does not support gather4 on alpha channel.\n //\n #if (FXAA_HLSL_5 == 1)\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifdef GLARB_gpu_shader5\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifdef GLNV_gpu_shader5\n #define FXAA_GATHER4_ALPHA 1\n #endif\n #ifndef FXAA_GATHER4_ALPHA\n #define FXAA_GATHER4_ALPHA 0\n #endif\n #endif\n\n /*============================================================================\n FXAA CONSOLE PS3 - TUNING KNOBS\n ============================================================================*/\n #ifndef FXAA_CONSOLEPS3_EDGE_SHARPNESS\n //\n // Consoles the sharpness of edges on PS3 only.\n // Non-PS3 tuning is done with shader input.\n //\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 4 and 8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n //\n // 8.0 is sharper\n // 4.0 is softer\n // 2.0 is really soft (good for vector graphics inputs)\n //\n #if 1\n #define FXAA_CONSOLEPS3_EDGE_SHARPNESS 8.0\n #endif\n #if 0\n #define FXAA_CONSOLEPS3_EDGE_SHARPNESS 4.0\n #endif\n #if 0\n #define FXAA_CONSOLEPS3_EDGE_SHARPNESS 2.0\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n #ifndef FXAA_CONSOLEPS3_EDGE_THRESHOLD\n //\n // Only effects PS3.\n // Non-PS3 tuning is done with shader input.\n //\n // The minimum amount of local contrast required to apply algorithm.\n // The console setting has a different mapping than the quality setting.\n //\n // This only applies when FXAA_EARLY_EXIT is 1.\n //\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 0.25 and 0.125.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n //\n // 0.125 leaves less aliasing, but is softer\n // 0.25 leaves more aliasing, and is sharper\n //\n #if 1\n #define FXAA_CONSOLEPS3_EDGE_THRESHOLD 0.125\n #else\n #define FXAA_CONSOLEPS3_EDGE_THRESHOLD 0.25\n #endif\n #endif\n\n /*============================================================================\n FXAA QUALITY - TUNING KNOBS\n ------------------------------------------------------------------------------\n NOTE the other tuning knobs are now in the shader function inputs!\n ============================================================================*/\n #ifndef FXAA_QUALITYPRESET\n //\n // Choose the quality preset.\n // This needs to be compiled into the shader as it effects code.\n // Best option to include multiple presets is to\n // in each shader define the preset, then include this file.\n //\n // OPTIONS\n // -----------------------------------------------------------------------\n // 10 to 15 - default medium dither (10=fastest, 15=highest quality)\n // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)\n // 39 - no dither, very expensive\n //\n // NOTES\n // -----------------------------------------------------------------------\n // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)\n // 13 = about same speed as FXAA 3.9 and better than 12\n // 23 = closest to FXAA 3.9 visually and performance wise\n // _ = the lowest digit is directly related to performance\n // _ = the highest digit is directly related to style\n //\n #define FXAA_QUALITYPRESET 12\n #endif\n\n\n /*============================================================================\n FXAA QUALITY - PRESETS\n ============================================================================*/\n\n /*============================================================================\n FXAA QUALITY - MEDIUM DITHER PRESETS\n ============================================================================*/\n #if(FXAA_QUALITYPRESET == 10)\n#define FXAA_QUALITYPS 3\n#define FXAA_QUALITYP0 1.5\n#define FXAA_QUALITYP1 3.0\n#define FXAA_QUALITYP2 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 11)\n#define FXAA_QUALITYPS 4\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 3.0\n#define FXAA_QUALITYP3 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 12)\n#define FXAA_QUALITYPS 5\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 4.0\n#define FXAA_QUALITYP4 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 13)\n#define FXAA_QUALITYPS 6\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 4.0\n#define FXAA_QUALITYP5 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 14)\n#define FXAA_QUALITYPS 7\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 4.0\n#define FXAA_QUALITYP6 12.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 15)\n#define FXAA_QUALITYPS 8\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 4.0\n#define FXAA_QUALITYP7 12.0\n#endif\n\n/*============================================================================\n FXAA QUALITY - LOW DITHER PRESETS\n============================================================================*/\n#if (FXAA_QUALITYPRESET == 20)\n#define FXAA_QUALITYPS 3\n#define FXAA_QUALITYP0 1.5\n#define FXAA_QUALITYP1 2.0\n#define FXAA_QUALITYP2 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 21)\n#define FXAA_QUALITYPS 4\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 22)\n#define FXAA_QUALITYPS 5\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 23)\n#define FXAA_QUALITYPS 6\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 24)\n#define FXAA_QUALITYPS 7\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 3.0\n#define FXAA_QUALITYP6 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 25)\n#define FXAA_QUALITYPS 8\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 4.0\n#define FXAA_QUALITYP7 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 26)\n#define FXAA_QUALITYPS 9\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 4.0\n#define FXAA_QUALITYP8 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 27)\n#define FXAA_QUALITYPS 10\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 4.0\n#define FXAA_QUALITYP9 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 28)\n#define FXAA_QUALITYPS 11\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 2.0\n#define FXAA_QUALITYP9 4.0\n#define FXAA_QUALITYP10 8.0\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_QUALITYPRESET == 29)\n#define FXAA_QUALITYPS 12\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.5\n#define FXAA_QUALITYP2 2.0\n#define FXAA_QUALITYP3 2.0\n#define FXAA_QUALITYP4 2.0\n#define FXAA_QUALITYP5 2.0\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 2.0\n#define FXAA_QUALITYP9 2.0\n#define FXAA_QUALITYP10 4.0\n#define FXAA_QUALITYP11 8.0\n#endif\n\n/*============================================================================\n FXAA QUALITY - EXTREME QUALITY\n============================================================================*/\n#if (FXAA_QUALITYPRESET == 39)\n#define FXAA_QUALITYPS 12\n#define FXAA_QUALITYP0 1.0\n#define FXAA_QUALITYP1 1.0\n#define FXAA_QUALITYP2 1.0\n#define FXAA_QUALITYP3 1.0\n#define FXAA_QUALITYP4 1.0\n#define FXAA_QUALITYP5 1.5\n#define FXAA_QUALITYP6 2.0\n#define FXAA_QUALITYP7 2.0\n#define FXAA_QUALITYP8 2.0\n#define FXAA_QUALITYP9 2.0\n#define FXAA_QUALITYP10 4.0\n#define FXAA_QUALITYP11 8.0\n#endif\n\n\n\n/*============================================================================\n API PORTING\n============================================================================*/\n#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)\n#define FxaaBool bool\n#define FxaaDiscard discard\n#define FxaaFloat float\n#define FxaaFloat2 vec2\n#define FxaaFloat3 vec3\n#define FxaaFloat4 vec4\n#define FxaaHalf float\n#define FxaaHalf2 vec2\n#define FxaaHalf3 vec3\n#define FxaaHalf4 vec4\n#define FxaaInt2 ivec2\n#define FxaaSat(x) clamp(x, 0.0, 1.0)\n#define FxaaTex sampler2D\n#else\n#define FxaaBool bool\n#define FxaaDiscard clip(-1)\n#define FxaaFloat float\n#define FxaaFloat2 float2\n#define FxaaFloat3 float3\n#define FxaaFloat4 float4\n#define FxaaHalf half\n#define FxaaHalf2 half2\n#define FxaaHalf3 half3\n#define FxaaHalf4 half4\n#define FxaaSat(x) saturate(x)\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_GLSL_100 == 1)\n#define FxaaTexTop(t, p) texture(t, p, 0.0)\n#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r), 0.0)\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_GLSL_120 == 1)\n// Requires,\n// #version 120\n// And at least,\n// #extension GLEXT_gpu_shader4 : enable\n// (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)\n#define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)\n#if (FXAA_FAST_PIXEL_OFFSET == 1)\n#define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)\n#else\n#define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)\n#endif\n#if (FXAA_GATHER4_ALPHA == 1)\n// use #extension GLARB_gpu_shader5 : enable\n#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n#define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n#endif\n#endif\n/*--------------------------------------------------------------------------*/\n#if (FXAA_GLSL_130 == 1)\n// Requires \"#version 130\" or better\n#define FxaaTexTop(t, p) textureLod(t, p, 0.0)\n#define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)\n#if (FXAA_GATHER4_ALPHA == 1)\n// use #extension GLARB_gpu_shader5 : enable\n#define FxaaTexAlpha4(t, p) textureGather(t, p, 3)\n#define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)\n#define FxaaTexGreen4(t, p) textureGather(t, p, 1)\n#define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)\n#endif\n#endif\n\n\n/*============================================================================\n GREEN AS LUMA OPTION SUPPORT FUNCTION\n============================================================================*/\n#if (FXAA_GREEN_AS_LUMA == 0)\n FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return dot(rgba.rgb, vec3(0.298912, 0.586611, 0.114478)); }\n // FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }\n#else\n FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }\n#endif\n\n\n\n\n\n\n\n\n\n/*============================================================================\n FXAA3 QUALITY - PC\n============================================================================*/\n#if (FXAA_PC == 1)\n /*--------------------------------------------------------------------------*/\n FxaaFloat4 FxaaPixelShader(\n //\n // Use noperspective interpolation here (turn off perspective interpolation).\n // {xy} = center of pixel\n FxaaFloat2 pos,\n //\n // Used only for FXAA Console, and not used on the 360 version.\n // Use noperspective interpolation here (turn off perspective interpolation).\n // {xy} = upper left of pixel\n // {zw} = lower right of pixel\n FxaaFloat4 fxaaConsolePosPos,\n //\n // Input color texture.\n // {rgb_} = color in linear or perceptual color space\n // if (FXAA_GREEN_AS_LUMA == 0)\n // {_a} = luma in perceptual color space (not linear)\n FxaaTex tex,\n //\n // Only used on the optimized 360 version of FXAA Console.\n // For everything but 360, just use the same input here as for \"tex\".\n // For 360, same texture, just alias with a 2nd sampler.\n // This sampler needs to have an exponent bias of -1.\n FxaaTex fxaaConsole360TexExpBiasNegOne,\n //\n // Only used on the optimized 360 version of FXAA Console.\n // For everything but 360, just use the same input here as for \"tex\".\n // For 360, same texture, just alias with a 3nd sampler.\n // This sampler needs to have an exponent bias of -2.\n FxaaTex fxaaConsole360TexExpBiasNegTwo,\n //\n // Only used on FXAA Quality.\n // This must be from a constant/uniform.\n // {x_} = 1.0/screenWidthInPixels\n // {_y} = 1.0/screenHeightInPixels\n FxaaFloat2 fxaaQualityRcpFrame,\n //\n // Only used on FXAA Console.\n // This must be from a constant/uniform.\n // This effects sub-pixel AA quality and inversely sharpness.\n // Where N ranges between,\n // N = 0.50 (default)\n // N = 0.33 (sharper)\n // {x_} = -N/screenWidthInPixels\n // {_y} = -N/screenHeightInPixels\n // {z_} = N/screenWidthInPixels\n // {_w} = N/screenHeightInPixels\n FxaaFloat4 fxaaConsoleRcpFrameOpt,\n //\n // Only used on FXAA Console.\n // Not used on 360, but used on PS3 and PC.\n // This must be from a constant/uniform.\n // {x_} = -2.0/screenWidthInPixels\n // {_y} = -2.0/screenHeightInPixels\n // {z_} = 2.0/screenWidthInPixels\n // {_w} = 2.0/screenHeightInPixels\n FxaaFloat4 fxaaConsoleRcpFrameOpt2,\n //\n // Only used on FXAA Console.\n // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.\n // This must be from a constant/uniform.\n // {x_} = 8.0/screenWidthInPixels\n // {_y} = 8.0/screenHeightInPixels\n // {z_} = -4.0/screenWidthInPixels\n // {_w} = -4.0/screenHeightInPixels\n FxaaFloat4 fxaaConsole360RcpFrameOpt2,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITYSUBPIX define.\n // It is here now to allow easier tuning.\n // Choose the amount of sub-pixel aliasing removal.\n // This can effect sharpness.\n // 1.00 - upper limit (softer)\n // 0.75 - default amount of filtering\n // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)\n // 0.25 - almost off\n // 0.00 - completely off\n FxaaFloat fxaaQualitySubpix,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITYEDGE_THRESHOLD define.\n // It is here now to allow easier tuning.\n // The minimum amount of local contrast required to apply algorithm.\n // 0.333 - too little (faster)\n // 0.250 - low quality\n // 0.166 - default\n // 0.125 - high quality\n // 0.063 - overkill (slower)\n FxaaFloat fxaaQualityEdgeThreshold,\n //\n // Only used on FXAA Quality.\n // This used to be the FXAA_QUALITYEDGE_THRESHOLD_MIN define.\n // It is here now to allow easier tuning.\n // Trims the algorithm from processing darks.\n // 0.0833 - upper limit (default, the start of visible unfiltered edges)\n // 0.0625 - high quality (faster)\n // 0.0312 - visible limit (slower)\n // Special notes when using FXAA_GREEN_AS_LUMA,\n // Likely want to set this to zero.\n // As colors that are mostly not-green\n // will appear very dark in the green channel!\n // Tune by looking at mostly non-green content,\n // then start at zero and increase until aliasing is a problem.\n FxaaFloat fxaaQualityEdgeThresholdMin,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLEEDGE_SHARPNESS define.\n // It is here now to allow easier tuning.\n // This does not effect PS3, as this needs to be compiled in.\n // Use FXAA_CONSOLEPS3_EDGE_SHARPNESS for PS3.\n // Due to the PS3 being ALU bound,\n // there are only three safe values here: 2 and 4 and 8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n // For all other platforms can be a non-power of two.\n // 8.0 is sharper (default!!!)\n // 4.0 is softer\n // 2.0 is really soft (good only for vector graphics inputs)\n FxaaFloat fxaaConsoleEdgeSharpness,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLEEDGE_THRESHOLD define.\n // It is here now to allow easier tuning.\n // This does not effect PS3, as this needs to be compiled in.\n // Use FXAA_CONSOLEPS3_EDGE_THRESHOLD for PS3.\n // Due to the PS3 being ALU bound,\n // there are only two safe values here: 1/4 and 1/8.\n // These options use the shaders ability to a free *|/ by 2|4|8.\n // The console setting has a different mapping than the quality setting.\n // Other platforms can use other values.\n // 0.125 leaves less aliasing, but is softer (default!!!)\n // 0.25 leaves more aliasing, and is sharper\n FxaaFloat fxaaConsoleEdgeThreshold,\n //\n // Only used on FXAA Console.\n // This used to be the FXAA_CONSOLEEDGE_THRESHOLD_MIN define.\n // It is here now to allow easier tuning.\n // Trims the algorithm from processing darks.\n // The console setting has a different mapping than the quality setting.\n // This only applies when FXAA_EARLY_EXIT is 1.\n // This does not apply to PS3,\n // PS3 was simplified to avoid more shader instructions.\n // 0.06 - faster but more aliasing in darks\n // 0.05 - default\n // 0.04 - slower and less aliasing in darks\n // Special notes when using FXAA_GREEN_AS_LUMA,\n // Likely want to set this to zero.\n // As colors that are mostly not-green\n // will appear very dark in the green channel!\n // Tune by looking at mostly non-green content,\n // then start at zero and increase until aliasing is a problem.\n FxaaFloat fxaaConsoleEdgeThresholdMin,\n //\n // Extra constants for 360 FXAA Console only.\n // Use zeros or anything else for other platforms.\n // These must be in physical constant registers and NOT immedates.\n // Immedates will result in compiler un-optimizing.\n // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)\n FxaaFloat4 fxaaConsole360ConstDir\n ) {\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posM;\n posM.x = pos.x;\n posM.y = pos.y;\n #if (FXAA_GATHER4_ALPHA == 1)\n #if (FXAA_DISCARD == 0)\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #if (FXAA_GREEN_AS_LUMA == 0)\n #define lumaM rgbyM.w\n #else\n #define lumaM rgbyM.y\n #endif\n #endif\n #if (FXAA_GREEN_AS_LUMA == 0)\n FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);\n FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));\n #else\n FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);\n FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));\n #endif\n #if (FXAA_DISCARD == 1)\n #define lumaM luma4A.w\n #endif\n #define lumaE luma4A.z\n #define lumaS luma4A.x\n #define lumaSE luma4A.y\n #define lumaNW luma4B.w\n #define lumaN luma4B.z\n #define lumaW luma4B.x\n #else\n FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);\n #if (FXAA_GREEN_AS_LUMA == 0)\n #define lumaM rgbyM.w\n #else\n #define lumaM rgbyM.y\n #endif\n #if (FXAA_GLSL_100 == 1)\n FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(0.0, 1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(1.0, 0.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(0.0, -1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));\n #else\n FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(0, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, 0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(0, -1), fxaaQualityRcpFrame.xy));\n #endif\n #endif\n /*--------------------------------------------------------------------------*/\n FxaaFloat maxSM = max(lumaS, lumaM);\n FxaaFloat minSM = min(lumaS, lumaM);\n FxaaFloat maxESM = max(lumaE, maxSM);\n FxaaFloat minESM = min(lumaE, minSM);\n FxaaFloat maxWN = max(lumaN, lumaW);\n FxaaFloat minWN = min(lumaN, lumaW);\n FxaaFloat rangeMax = max(maxWN, maxESM);\n FxaaFloat rangeMin = min(minWN, minESM);\n FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;\n FxaaFloat range = rangeMax - rangeMin;\n FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);\n FxaaBool earlyExit = range < rangeMaxClamped;\n /*--------------------------------------------------------------------------*/\n if (earlyExit)\n #if (FXAA_DISCARD == 1)\n FxaaDiscard;\n #else\n return rgbyM;\n #endif\n /*--------------------------------------------------------------------------*/\n #if (FXAA_GATHER4_ALPHA == 0)\n #if (FXAA_GLSL_100 == 1)\n FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, -1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(1.0, 1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(1.0, -1.0), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));\n #else\n FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, 1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n #endif\n #else\n FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));\n FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));\n #endif\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNS = lumaN + lumaS;\n FxaaFloat lumaWE = lumaW + lumaE;\n FxaaFloat subpixRcpRange = 1.0 / range;\n FxaaFloat subpixNSWE = lumaNS + lumaWE;\n FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;\n FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNESE = lumaNE + lumaSE;\n FxaaFloat lumaNWNE = lumaNW + lumaNE;\n FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;\n FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;\n /*--------------------------------------------------------------------------*/\n FxaaFloat lumaNWSW = lumaNW + lumaSW;\n FxaaFloat lumaSWSE = lumaSW + lumaSE;\n FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);\n FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);\n FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;\n FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;\n FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;\n FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;\n /*--------------------------------------------------------------------------*/\n FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;\n FxaaFloat lengthSign = fxaaQualityRcpFrame.x;\n FxaaBool horzSpan = edgeHorz >= edgeVert;\n FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;\n /*--------------------------------------------------------------------------*/\n if (!horzSpan) lumaN = lumaW;\n if (!horzSpan) lumaS = lumaE;\n if (horzSpan) lengthSign = fxaaQualityRcpFrame.y;\n FxaaFloat subpixB = (subpixA * (1.0 / 12.0)) - lumaM;\n /*--------------------------------------------------------------------------*/\n FxaaFloat gradientN = lumaN - lumaM;\n FxaaFloat gradientS = lumaS - lumaM;\n FxaaFloat lumaNN = lumaN + lumaM;\n FxaaFloat lumaSS = lumaS + lumaM;\n FxaaBool pairN = abs(gradientN) >= abs(gradientS);\n FxaaFloat gradient = max(abs(gradientN), abs(gradientS));\n if (pairN) lengthSign = -lengthSign;\n FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posB;\n posB.x = posM.x;\n posB.y = posM.y;\n FxaaFloat2 offNP;\n offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n offNP.y = (horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n if (!horzSpan) posB.x += lengthSign * 0.5;\n if (horzSpan) posB.y += lengthSign * 0.5;\n /*--------------------------------------------------------------------------*/\n FxaaFloat2 posN;\n posN.x = posB.x - offNP.x * FXAA_QUALITYP0;\n posN.y = posB.y - offNP.y * FXAA_QUALITYP0;\n FxaaFloat2 posP;\n posP.x = posB.x + offNP.x * FXAA_QUALITYP0;\n posP.y = posB.y + offNP.y * FXAA_QUALITYP0;\n FxaaFloat subpixD = ((-2.0) * subpixC) + 3.0;\n FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));\n FxaaFloat subpixE = subpixC * subpixC;\n FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));\n /*--------------------------------------------------------------------------*/\n if (!pairN) lumaNN = lumaSS;\n FxaaFloat gradientScaled = gradient * 1.0 / 4.0;\n FxaaFloat lumaMM = lumaM - lumaNN * 0.5;\n FxaaFloat subpixF = subpixD * subpixE;\n FxaaBool lumaMLTZero = lumaMM < 0.0;\n /*--------------------------------------------------------------------------*/\n lumaEndN -= lumaNN * 0.5;\n lumaEndP -= lumaNN * 0.5;\n FxaaBool doneN = abs(lumaEndN) >= gradientScaled;\n FxaaBool doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP1;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP1;\n FxaaBool doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP1;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP1;\n /*--------------------------------------------------------------------------*/\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP2;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP2;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP2;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP2;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 3)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP3;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP3;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP3;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP3;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 4)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP4;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP4;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP4;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP4;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 5)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP5;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP5;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP5;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP5;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 6)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP6;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP6;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP6;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP6;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 7)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP7;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP7;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP7;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP7;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 8)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP8;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP8;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP8;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP8;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 9)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP9;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP9;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP9;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP9;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 10)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP10;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP10;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP10;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP10;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 11)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP11;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP11;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP11;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP11;\n /*--------------------------------------------------------------------------*/\n #if (FXAA_QUALITYPS > 12)\n if (doneNP) {\n if (!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));\n if (!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));\n if (!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;\n if (!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;\n doneN = abs(lumaEndN) >= gradientScaled;\n doneP = abs(lumaEndP) >= gradientScaled;\n if (!doneN) posN.x -= offNP.x * FXAA_QUALITYP12;\n if (!doneN) posN.y -= offNP.y * FXAA_QUALITYP12;\n doneNP = (!doneN) || (!doneP);\n if (!doneP) posP.x += offNP.x * FXAA_QUALITYP12;\n if (!doneP) posP.y += offNP.y * FXAA_QUALITYP12;\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n #endif\n /*--------------------------------------------------------------------------*/\n }\n /*--------------------------------------------------------------------------*/\n FxaaFloat dstN = posM.x - posN.x;\n FxaaFloat dstP = posP.x - posM.x;\n if (!horzSpan) dstN = posM.y - posN.y;\n if (!horzSpan) dstP = posP.y - posM.y;\n /*--------------------------------------------------------------------------*/\n FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;\n FxaaFloat spanLength = (dstP + dstN);\n FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;\n FxaaFloat spanLengthRcp = 1.0 / spanLength;\n /*--------------------------------------------------------------------------*/\n FxaaBool directionN = dstN < dstP;\n FxaaFloat dst = min(dstN, dstP);\n FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;\n FxaaFloat subpixG = subpixF * subpixF;\n FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;\n FxaaFloat subpixH = subpixG * fxaaQualitySubpix;\n /*--------------------------------------------------------------------------*/\n FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;\n FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);\n if (!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;\n if (horzSpan) posM.y += pixelOffsetSubpix * lengthSign;\n #if (FXAA_DISCARD == 1)\n return FxaaTexTop(tex, posM);\n #else\n return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);\n #endif\n}\n/*==========================================================================*/\n#endif\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec2 screenInfo = get_screenInfo(materialSID, 0);\n rt0 = FxaaPixelShader(\n v_texcoord_0,\n vec4(0.0),\n u_baseColorTexture,\n u_baseColorTexture,\n u_baseColorTexture,\n 1.0 / screenInfo,\n vec4(0.0),\n vec4(0.0),\n vec4(0.0),\n 0.75,\n 0.166,\n 0.0833,\n 0.0,\n 0.0,\n 0.0,\n vec4(0.0)\n );\n rt0.a = 1.0;\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},D={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nout vec2 v_texcoord_0;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\nv_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},N={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord_0;\n\nuniform sampler2D u_baseColorTexture; // initialValue=(0,white)\nuniform bool u_enableLinearToSrgb; // initialValue=true\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nvec4 baseColor = texture(u_baseColorTexture, v_texcoord_0);\n\nif (get_enableLinearToSrgb(materialSID, 0)) {\n baseColor.rgb = linearToSrgb(baseColor.rgb);\n}\n\nrt0 = baseColor;\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},B={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nout vec2 v_texcoord_0;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\nv_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},L={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord_0;\n\nuniform sampler2DRect u_baseColorTexture; // initialValue=(0,white)\nuniform float u_count; // initialValue=0.0\nuniform float u_direction; // initialValue=0.0\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nfloat i = get_count(materialSID, 0);\nfloat dir = get_direction(materialSID, 0);\n\nrt0 = texture(u_baseColorTexture, gl_FragCoord.xy);\n\nif (dir > 0.0) {\n // horizontal\n rt0 += texture(u_baseColorTexture, vec2(gl_FragCoord.x + pow(2.0, i), gl_FragCoord.y));\n} else {\n // virtical\n rt0 += texture(u_baseColorTexture, vec2(gl_FragCoord.x, gl_FragCoord.y + pow(2.0, i)));\n}\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},F={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec3 v_baryCentricCoord;\n\nuniform float u_pointSize; // initialValue=30\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0,0.1,0.01)\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n\n v_color = a_color;\n v_normal_inWorld = normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},G={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec3 v_baryCentricCoord;\n\nuniform int u_shadingModel; // initialValue=0\nuniform float u_alphaCutoff; // initialValue=0.01\nuniform vec4 u_diffuseColorFactor; // initialValue=(1,1,1,1)\nuniform sampler2D u_diffuseColorTexture; // initialValue=(0,white)\nuniform sampler2D u_normalTexture; // initialValue=(1,blue)\nuniform vec4 u_diffuseColorTextureTransform; // initialValue=(1,1,0,0)\nuniform float u_diffuseColorTextureRotation; // initialValue=0\n\n/* shaderity: @{renderTargetBegin} */\n\n\n\nvec2 uvTransform(vec2 scale, vec2 offset, float rotation, vec2 uv) {\n mat3 translationMat = mat3(1,0,0, 0,1,0, offset.x, offset.y, 1);\n mat3 rotationMat = mat3(\n cos(rotation), -sin(rotation), 0,\n sin(rotation), cos(rotation), 0,\n 0, 0, 1\n );\n mat3 scaleMat = mat3(scale.x,0,0, 0,scale.y,0, 0,0,1);\n\n mat3 matrix = translationMat * rotationMat * scaleMat;\n vec2 uvTransformed = ( matrix * vec3(uv.xy, 1) ).xy;\n\n return uvTransformed;\n}\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nvoid main ()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n\n\n // diffuseColor (Considered to be premultiplied alpha)\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture (Considered to be premultiplied alpha)\n vec4 diffuseColorTextureTransform = get_diffuseColorTextureTransform(materialSID, 0);\n float diffuseColorTextureRotation = get_diffuseColorTextureRotation(materialSID, 0);\n vec2 diffuseColorTexUv = uvTransform(diffuseColorTextureTransform.xy, diffuseColorTextureTransform.zw, diffuseColorTextureRotation, v_texcoord_0);\n vec4 textureColor = texture(u_diffuseColorTexture, diffuseColorTexUv);\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n\n// #pragma shaderity: require(../common/alphaMask.glsl)\n\n rt0 = vec4(diffuseColor * alpha, alpha);\n // rt0 = vec4(1.0, 0.0, 0.0, 1.0);\n\n// #pragma shaderity: require(../common/setAlphaIfNotInAlphaBlendMode.glsl)\n\n/* shaderity: @{renderTargetEnd} */\n\n\n}\n\n",shaderStage:"fragment",isFragmentShader:!0},z={code:"/* shaderity: @{definitions} */\nstruct VertexOutput {\n @builtin(position) position : vec4,\n @location(0) normal : vec3,\n @location(1) texcoord_0 : vec2,\n}\n\nstruct StorageData {\n data: array>,\n}\n@binding(0) @group(0) var storageData : StorageData;\n\noverride _materialSID: u32;\n\nfn fetchElement(vec4_idx: u32) -> vec4\n{\n return storageData.data[vec4_idx];\n}\n\nfn fetchVec3No16BytesAligned(scalar_idx: u32) -> vec3 {\n let posIn4bytes = scalar_idx % 4u;\n\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n if (posIn4bytes == 0u) {\n let val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1u) {\n let val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2u) {\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.w, val1.xy);\n }\n}\n\nfn fetchVec4(vec4_idx: u32) -> vec4 {\n return fetchElement(vec4_idx);\n}\n\nfn fetchScalarNo16BytesAligned(scalar_idx: u32) -> f32 {\n let posIn4bytes = scalar_idx % 4u;\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n let val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0u) {\n return val.x;\n } else if (posIn4bytes == 1u) {\n return val.y;\n } else if (posIn4bytes == 2u) {\n return val.z;\n } else { // posIn4bytes == 3u\n return val.w;\n }\n}\n\n\n\n\nfn fetchMat4(vec4_idx: u32) -> mat4x4\n{\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n let col3 = fetchElement(vec4_idx + 3u);\n\n let val = mat4x4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\n\nfn fetchMat4x3(vec4_idx: u32) -> mat4x3 {\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n\n let val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n\n return val;\n}\n\n\n/* shaderity: @{getters} */\n/* shaderity: @{matricesGetters} */\n\n@vertex\nfn main(\n#ifdef RN_USE_INSTANCE\n @location(8) instance_ids: vec4,\n#endif\n#ifdef RN_USE_POSITION\n @location(0) position: vec3,\n#endif\n#ifdef RN_USE_NORMAL\n @location(1) normal: vec3,\n#endif\n#ifdef RN_USE_TANGENT\n @location(2) tangent: vec3,\n#endif\n#ifdef RN_USE_TEXCOORD_0\n @location(3) texcoord_0: vec2,\n#endif\n) -> VertexOutput {\nlet materialSID = _materialSID;\n\n\n var output : VertexOutput;\n\n let cameraSID = u32(get_currentComponentSIDs(0u, /* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */u));\n let worldMatrix = get_worldMatrix(u32(instance_ids.x));\n let viewMatrix = get_viewMatrix(cameraSID, 0u);\n let projectionMatrix = get_projectionMatrix(cameraSID, 0u);\n\n output.position = projectionMatrix * viewMatrix * worldMatrix * vec4(position, 1.0);\n\n#ifdef RN_USE_NORMAL\n output.normal = normalize((worldMatrix * vec4(normal, 0.0)).xyz);\n#endif\n\n#ifdef RN_USE_TEXCOORD_0\n output.texcoord_0 = texcoord_0;\n#endif\n\n // output.Position = vec4(position, 1.0);\n\n return output;\n}\n",shaderStage:"vertex",isFragmentShader:!1},V={code:"/* shaderity: @{definitions} */\nstruct VertexOutput {\n @builtin(position) position : vec4,\n @location(0) normal : vec3,\n @location(1) texcoord_0 : vec2,\n}\n\nstruct StorageData {\n data: array>,\n}\n@binding(0) @group(0) var storageData : StorageData;\n\noverride _materialSID: u32;\n\nfn fetchElement(vec4_idx: u32) -> vec4\n{\n return storageData.data[vec4_idx];\n}\n\nfn fetchVec3No16BytesAligned(scalar_idx: u32) -> vec3 {\n let posIn4bytes = scalar_idx % 4u;\n\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n if (posIn4bytes == 0u) {\n let val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1u) {\n let val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2u) {\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n let val0 = fetchElement(basePosIn16bytes);\n let val1 = fetchElement(basePosIn16bytes+1u);\n return vec3(val0.w, val1.xy);\n }\n}\n\nfn fetchVec4(vec4_idx: u32) -> vec4 {\n return fetchElement(vec4_idx);\n}\n\nfn fetchScalarNo16BytesAligned(scalar_idx: u32) -> f32 {\n let posIn4bytes = scalar_idx % 4u;\n let basePosIn16bytes = (scalar_idx - posIn4bytes) / 4u;\n let val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0u) {\n return val.x;\n } else if (posIn4bytes == 1u) {\n return val.y;\n } else if (posIn4bytes == 2u) {\n return val.z;\n } else { // posIn4bytes == 3u\n return val.w;\n }\n}\n\n\n\n\nfn fetchMat4(vec4_idx: u32) -> mat4x4\n{\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n let col3 = fetchElement(vec4_idx + 3u);\n\n let val = mat4x4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\n\nfn fetchMat4x3(vec4_idx: u32) -> mat4x3 {\n let col0 = fetchElement(vec4_idx);\n let col1 = fetchElement(vec4_idx + 1u);\n let col2 = fetchElement(vec4_idx + 2u);\n\n let val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n\n return val;\n}\n\n\n/* shaderity: @{getters} */\n\n// #param diffuseColorFactor: vec4; // initialValue=(1,1,1,1)\n\n@group(1) @binding(0) var baseColorTexture: texture_2d; // initialValue=blue\n@group(2) @binding(0) var baseColorSampler: sampler;\n\n@fragment\nfn main(\n input: VertexOutput\n) -> @location(0) vec4 {\nlet materialSID = _materialSID;\n\n\n var Normal = input.normal * 0.5 + 0.5;\n // return vec4(Normal.x, Normal.y, Normal.z, 1);\n\n#ifdef RN_USE_TEXCOORD_0\n var baseColor = textureSample(baseColorTexture, baseColorSampler, input.texcoord_0);\n return baseColor;\n#else\n return vec4(1, 0, 0, 1);\n#endif\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},O={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec2 a_texcoord_1;\nin vec2 a_texcoord_2;\nin vec4 a_joint;\nin vec4 a_weight;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\nuniform float u_pointSize; // initialValue=30, soloDatum=true\nuniform vec3 u_pointDistanceAttenuation; // initialValue=(0.0, 0.1, 0.01), soloDatum=true\n\n#ifdef RN_IS_MORPHING\nuniform int u_morphTargetNumber; // initialValue=0, isCustomSetting=true, soloDatum=true, needUniformInDataTextureMode=true\n#endif\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main()\n{\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isBillboard = get_isBillboard(a_instanceInfo.x);\n\n v_color = a_color;\n\n bool isSkinning = false;\n\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n isBillboard,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n bool visibility = get_isVisible(a_instanceInfo.x);\n if (!visibility)\n {\n gl_Position = vec4(0.0);\n }\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n\n",shaderStage:"vertex",isFragmentShader:!1},U={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\n\nvoid main (){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float depth = gl_FragCoord.z;\n float dx = dFdx(depth);\n float dy = dFdy(depth);\n\n rt0.x = depth; // M1\n rt0.y = sq(depth) + 0.25 * (sq(dx) + sq(dy)); // M2\n rt0.z = 0.0;\n rt0.w = 1.0;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n\n",shaderStage:"fragment",isFragmentShader:!0};var k=n(1813),Q=n(903),W=n(2192);const X={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec3 a_position;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},q={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n// uniform bool isHorizontal; // initialValue=1\n// uniform int gaussianKernelSize; // initialValue=1\n// uniform float framebufferWidth; // initialValue=1\n// uniform sampler2D baseColorTexture; // initialValue=(0,white)\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n\tfloat tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n\n vec2 blurDirection;\n bool isHorizontal = get_isHorizontal(materialSID, 0);\n if(isHorizontal){\n blurDirection = vec2(1.0,0.0);\n }else{\n blurDirection = vec2(0.0,1.0);\n }\n\n vec4 color = vec4(0.0);\n int gaussianKernelSize = get_gaussianKernelSize(materialSID, 0);\n float minStrideLength = -float(gaussianKernelSize - 1) / 2.0;\n\n for(int i=0; i < 30; i++) {\n if(gaussianKernelSize == i) {\n break;\n }\n\n float strideLength = minStrideLength + float(i);\n vec2 stride = strideLength * blurDirection;\n\n float gaussianRatio = u_gaussianRatio[i];\n color += texture(u_baseColorTexture, (offset + stride) * tFrag) * gaussianRatio;\n }\n\n rt0 = color;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0},H={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec3 a_position;\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},j={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nfloat decodeRGBAToDepth(vec4 RGBA){\n const float rMask = 1.0;\n const float gMask = 1.0 / 255.0;\n const float bMask = 1.0 / (255.0 * 255.0);\n const float aMask = 1.0 / (255.0 * 255.0 * 255.0);\n float depth = dot(RGBA, vec4(rMask, gMask, bMask, aMask));\n return depth;\n}\n\nvec4 encodeDepthToRGBA(float depth){\n float r = depth;\n float g = fract(r * 255.0);\n float b = fract(g * 255.0);\n float a = fract(b * 255.0);\n float coef = 1.0 / 255.0;\n r -= g * coef;\n g -= b * coef;\n b -= a * coef;\n return vec4(r, g, b, a);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n\tfloat tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n\n vec2 blurDirection;\n bool isHorizontal = get_isHorizontal(materialSID, 0);\n if(isHorizontal){\n blurDirection = vec2(1.0,0.0);\n }else{\n blurDirection = vec2(0.0,1.0);\n }\n\n float depth = 0.0;\n int gaussianKernelSize = get_gaussianKernelSize(materialSID, 0);\n float minStrideLength = -float(gaussianKernelSize - 1) / 2.0;\n\n for(int i=0; i < 30; i++) {\n if(gaussianKernelSize == i) {\n break;\n }\n\n float strideLength = minStrideLength + float(i);\n vec2 stride = strideLength * blurDirection;\n float depthData = decodeRGBAToDepth(texture(u_baseColorTexture, (offset + stride) * tFrag));\n if(depthData > 1.0) depthData = 1.0;\n\n float gaussianRatio = u_gaussianRatio[i];\n depth += depthData * gaussianRatio;\n }\n\n rt0 = encodeDepthToRGBA(depth);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var Y=n(3616);function K(e,t,n){let i=0,o=!1;do{const a=e+`__${i}`;if(o=Q.r.isFullOrOverOfThisMaterialType(a),!o)return Q.r.registerMaterial(a,t,n),Q.r.createMaterial(a,t);i++}while(o);return Q.r.isRegisteredMaterialType(e)||Q.r.registerMaterial(e,t,n),Q.r.createMaterial(e,t)}function J(e,t,n){return Q.r.forceRegisterMaterial(e,t,n),Q.r.createMaterial(e,t)}const Z=Object.freeze({createMaterial:K,recreateMaterial:J,recreateCustomMaterial:function(e,t,{additionalName:n="",isSkinning:o=!0,isLighting:a=!1,isMorphing:r=!1,maxInstancesNumber:s=i.D.maxMaterialInstanceForEachType}={}){const c=`Custom_${n}_`+(r?"+morphing":"")+(o?"+skinning":"")+(a?"":"-lighting"),_=new l.f({name:c,isSkinning:o,isLighting:a,isMorphing:r,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:{code:e,shaderStage:"vertex",isFragmentShader:!1},pixelShader:{code:t,shaderStage:"fragment",isFragmentShader:!0},noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});return _.isSingleOperation=!0,J(c,_,s)},recreateShaderityMaterial:function(e,t,{additionalName:n="",maxInstancesNumber:o=i.D.maxMaterialInstanceForEachType}={}){const a=`Shaderity_${n}`,r=new p.u({name:a,vertexShaderityObj:e,pixelShaderityObj:t});return r.isSingleOperation=!0,J(a,r,o)},createEmptyMaterial:function(){const e=K("Empty",void 0,i.D.maxMaterialInstanceForEachType);return e.tryToSetUniqueName("EmptyMaterial",!0),e},createClassicUberMaterial:function({additionalName:e="",isSkinning:t=!0,isLighting:n=!1,isMorphing:o=!1,isShadow:a=!1,maxInstancesNumber:r=i.D.maxMaterialInstanceForEachType}={}){const s=`ClassicUber_${e}_`+(t?"+skinning":"")+(n?"":"-lighting"),c=new l.f({name:"ClassicUber",isSkinning:t,isLighting:n,isMorphing:o,isShadow:a,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:I,pixelShader:b,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});return c.isSingleOperation=!0,K(s,c,r)},createDepthMomentEncodeMaterial:function({additionalName:e="",isSkinning:t=!0,isMorphing:n=!1,maxInstancesNumber:o=i.D.maxMaterialInstanceForEachType}={}){const a=`DepthMomentEncode_${e}_`,r=new l.f({name:"DepthMomentEncode",isSkinning:t,isLighting:!1,isMorphing:n,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:O,pixelShader:U,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});return r.isSingleOperation=!0,K(a,r,o)},createFlatMaterial:function({additionalName:e="",isSkinning:t=!0,isMorphing:n=!1,maxInstancesNumber:o=i.D.maxMaterialInstanceForEachType}={}){const a=`Flat_${e}_`+(t?"+skinning":""),r=new l.f({name:"Flat",isSkinning:t,isLighting:!1,isMorphing:n,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:F,pixelShader:G,noUseCameraTransform:!1,additionalShaderSemanticInfo:[],vertexShaderWebGpu:z,pixelShaderWebGpu:V});return r.isSingleOperation=!0,K(a,r,o)},createPbrUberMaterial:function({additionalName:e="",isMorphing:t=!0,isSkinning:n=!0,isLighting:o=!0,isClearCoat:a=!1,isTransmission:r=!1,isVolume:s=!1,isSheen:c=!1,isSpecular:_=!1,isIridescence:h=!1,isAnisotropy:u=!1,isShadow:d=!1,useTangentAttribute:m=!1,useNormalTexture:f=!0,maxInstancesNumber:p=i.D.maxMaterialInstanceForEachType}={}){const I=`PbrUber_${e}_`+(t?"+morphing":"")+(n?"+skinning":"")+(o?"":"-lighting")+(a?"+clearcoat":"")+(r?"+transmission":"")+(s?"+volume":"")+(c?"+sheen":"")+(_?"+specular":"")+(h?"+iridescence":"")+(u?"+anisotropy":"")+(m?"+tangentAttribute":"")+(f?"":"-normalTexture");let b=[];t&&(b=[{semantic:v.f5.DataTextureMorphOffsetPosition,componentType:A.r.Int,compositionType:y.d.ScalarArray,arrayLength:i.D.maxVertexMorphNumberInShader,stage:x.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new g.j(new Int32Array(i.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:v.f5.MorphWeights,componentType:A.r.Float,compositionType:y.d.ScalarArray,arrayLength:i.D.maxVertexMorphNumberInShader,stage:x.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new g.j(new Float32Array(i.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0}]);let w=8;a&&(b.push({semantic:v.f5.ClearCoatTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.ClearCoatRoughnessTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.ClearCoatNormalTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.$R],min:0,max:Number.MAX_VALUE})),r&&(b.push({semantic:v.f5.TransmissionTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.BackBufferTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.mg],min:0,max:Number.MAX_VALUE})),s&&b.push({semantic:v.f5.ThicknessTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),c&&(b.push({semantic:v.f5.SheenColorTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.SheenRoughnessTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.SheenLutTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.NB],min:0,max:Number.MAX_VALUE})),_&&(b.push({semantic:v.f5.SpecularTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.SpecularColorTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE})),h&&(b.push({semantic:v.f5.IridescenceTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE}),b.push({semantic:v.f5.IridescenceThicknessTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE})),u&&b.push({semantic:v.f5.AnisotropyTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!0,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Lx],min:0,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0}),d&&b.push({semantic:v.f5.DepthTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,soloDatum:!1,updateInterval:k.a.EveryTime,initialValue:[w++,W.Dx],min:0,max:Number.MAX_VALUE});const R=new l.f({name:"PbrUber",isSkinning:n,isLighting:o,isMorphing:t,isClearCoat:a,isTransmission:r,isVolume:s,isSheen:c,isSpecular:_,isIridescence:h,isAnisotropy:u,isShadow:d,useTangentAttribute:m,useNormalTexture:f,vertexShader:E,pixelShader:T,vertexShaderWebGpu:S,pixelShaderWebGpu:C,noUseCameraTransform:!1,additionalShaderSemanticInfo:b});return R.isSingleOperation=!0,K(I,R,p)},createEnvConstantMaterial:function({additionalName:e="",maxInstancesNumber:t=5,makeOutputSrgb:n=!0}={}){const i=`EnvConstant_${e}`,o=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!1,vertexShader:w.Z,pixelShader:R.Z,noUseCameraTransform:!1,additionalShaderSemanticInfo:[]});o.isSingleOperation=!0;const a=K(i,o,t);return a.setParameter(v.f5.MakeOutputSrgb,n?1:0),a},createFXAA3QualityMaterial:function({additionalName:e="",maxInstancesNumber:t=1,noUseCameraTransform:n=!1}={}){const i=`FXAA3Quality_${e}`,o=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:P,pixelShader:M,noUseCameraTransform:n,additionalShaderSemanticInfo:[]});return o.isSingleOperation=!0,K(i,o,t)},createDepthEncodeMaterial:function({additionalName:e="",isSkinning:t=!1,depthPow:n=1,maxInstancesNumber:i=10}={}){const a=`DepthEncode_${e}_`+(t?"+skinning":""),r=new o.Q(n,{isSkinning:t});return r.isSingleOperation=!0,K(a,r,i)},createShadowMapDecodeClassicSingleMaterial:function({additionalName:e="",isMorphing:t=!1,isSkinning:n=!1,isLighting:i=!0,isDebugging:o=!1,colorAttachmentsNumber:r=0,maxInstancesNumber:s=20}={},l){const c=`ShadowMapDecodeClassic_${e}_`+(n?"+skinning":"")+(i?"":"-lighting"),_=new a.R({isMorphing:t,isSkinning:n,isLighting:i,isDebugging:o,colorAttachmentsNumber:r},l);return _.isSingleOperation=!0,K(c,_,s)},createGammaCorrectionMaterial:function({additionalName:e="",maxInstancesNumber:t=1,noUseCameraTransform:n=!1}={}){const i=`GammaCorrection_${e}`,o=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:D,pixelShader:N,noUseCameraTransform:n,additionalShaderSemanticInfo:[]});return o.isSingleOperation=!0,K(i,o,t)},createSummedAreaTableMaterial:function({additionalName:e="",maxInstancesNumber:t=1,noUseCameraTransform:n=!1}={}){const i=`SummedAreaTable_${e}`,o=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,useTangentAttribute:!1,useNormalTexture:!0,vertexShader:B,pixelShader:L,noUseCameraTransform:n,additionalShaderSemanticInfo:[]});return o.isSingleOperation=!0,K(i,o,t)},createVarianceShadowMapDecodeClassicSingleMaterial:function({additionalName:e="",isMorphing:t=!1,isSkinning:n=!1,isDebugging:i=!1,isLighting:o=!0,colorAttachmentsNumberDepth:a=0,colorAttachmentsNumberSquareDepth:r=0,depthCameraComponent:s,maxInstancesNumber:l=10},c){const _=`VarianceShadowMapDecodeShading_${e}_`+(t?"+morphing":"")+(n?"+skinning":"")+(o?"":"-lighting")+(i?"":"+debugging"),h=new f.Q({isMorphing:t,isSkinning:n,isLighting:o,isDebugging:i,colorAttachmentsNumberDepth:a,colorAttachmentsNumberSquareDepth:r,depthCameraComponent:s},c);return h.isSingleOperation=!0,K(_,h,l)},createEntityUIDOutputMaterial:function({additionalName:e="",maxInstancesNumber:t=10}={}){const n=`EntityUIDOutput_${e}`,i=new r.z;return i.isSingleOperation=!0,K(n,i,t)},createMToonMaterial:function({additionalName:e="",isMorphing:t=!1,isSkinning:n=!1,isLighting:o=!0,useTangentAttribute:a=!1,isOutline:r=!1,materialProperties:l,textures:c,samplers:_,debugMode:h,maxInstancesNumber:u=i.D.maxMaterialInstanceForEachType,makeOutputSrgb:d=!0}){const m=`MToon_${e}_`+(t?"+morphing":"")+(n?"+skinning":"")+(o?"":"-lighting")+(a?"+tangentAttribute":"")+(r?"-outline":""),f=new s.f(r,l,c,_,t,n,o,a,h,d);f.isSingleOperation=!0;const p=K(m,f,u);return f.setMaterialParameters(p,r),p},createFurnaceTestMaterial:function({additionalName:e="",maxInstancesNumber:t=1}={}){const n=`FurnaceTest_${e}`,i=new _.b;return i.isSingleOperation=!0,K(n,i,t)},createGaussianBlurForEncodedDepthMaterial:function({additionalName:e="",maxInstancesNumber:t=10,noUseCameraTransform:n=!1}={}){const i=`GaussianBlurForEncodedDepth_${e}`,o=[],a=new Float32Array(30);o.push({semantic:v.f5.IsHorizontal,componentType:A.r.Bool,compositionType:y.d.Scalar,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:Y.Ru.fromCopyNumber(1),min:0,max:1},{semantic:v.f5.GaussianRatio,componentType:A.r.Float,compositionType:y.d.ScalarArray,arrayLength:30,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:new g.j(a),min:0,max:1,needUniformInDataTextureMode:!0},{semantic:v.f5.GaussianKernelSize,componentType:A.r.Int,compositionType:y.d.Scalar,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:Y.Ru.fromCopyNumber(1),min:1,max:30},{semantic:v.f5.FramebufferWidth,componentType:A.r.Float,compositionType:y.d.Scalar,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:Y.Ru.fromCopyNumber(1),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:v.f5.BaseColorTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[0,W.mg],min:0,max:Number.MAX_SAFE_INTEGER});const r=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,isClearCoat:!1,isTransmission:!1,isVolume:!1,isSheen:!1,isSpecular:!1,isIridescence:!1,isShadow:!1,useTangentAttribute:!1,useNormalTexture:!1,vertexShader:H,pixelShader:j,noUseCameraTransform:n,additionalShaderSemanticInfo:o});return r.isSingleOperation=!0,K(i,r,t)},createDetectHighLuminanceMaterial:function({additionalName:e="",colorAttachmentsNumber:t=0,maxInstancesNumber:n=5}={},i){const o=`DetectHighLuminance_${e}_`,a=new h.t(i,t);return a.isSingleOperation=!0,K(o,a,n)},createGaussianBlurMaterial:function({additionalName:e="",maxInstancesNumber:t=10,noUseCameraTransform:n=!1}={}){const i=`GaussianBlur_${e}`,o=[],a=new Float32Array(30);o.push({semantic:v.f5.IsHorizontal,componentType:A.r.Bool,compositionType:y.d.Scalar,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:Y.Ru.fromCopyNumber(1),min:0,max:1},{semantic:v.f5.GaussianRatio,componentType:A.r.Float,compositionType:y.d.ScalarArray,arrayLength:30,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:new g.j(a),min:0,max:1,needUniformInDataTextureMode:!0},{semantic:v.f5.GaussianKernelSize,componentType:A.r.Int,compositionType:y.d.Scalar,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:Y.Ru.fromCopyNumber(1),min:1,max:30},{semantic:v.f5.FramebufferWidth,componentType:A.r.Float,compositionType:y.d.Scalar,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.FirstTimeOnly,soloDatum:!1,initialValue:Y.Ru.fromCopyNumber(1),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:v.f5.BaseColorTexture,componentType:A.r.Int,compositionType:y.d.Texture2D,stage:x.H.PixelShader,isCustomSetting:!1,updateInterval:k.a.EveryTime,initialValue:[0,W.mg],min:0,max:Number.MAX_SAFE_INTEGER});const r=new l.f({name:i,isSkinning:!1,isLighting:!1,isMorphing:!1,isClearCoat:!1,isTransmission:!1,isVolume:!1,isSheen:!1,isSpecular:!1,isIridescence:!1,isShadow:!1,useTangentAttribute:!1,useNormalTexture:!1,vertexShader:X,pixelShader:q,noUseCameraTransform:n,additionalShaderSemanticInfo:o});return r.isSingleOperation=!0,K(i,r,t)},createSynthesizeHDRMaterial:function({additionalName:e="",targetRegionTexture:t,maxInstancesNumber:n=1},i){const o=`SynthesizeHDR_${e}`,a=new u.d(i,t);return a.isSingleOperation=!0,K(o,a,n)},createColorGradingUsingLUTsMaterial:function({additionalName:e="",colorAttachmentsNumber:t=0,uri:n,texture:i,maxInstancesNumber:o=1},a){const r=`ColorGradingUsingLUTs_${e}`,s=new d.h(a,t,n,i);return s.isSingleOperation=!0,K(r,s,o)},createMatCapMaterial:function({additionalName:e="",isSkinning:t=!1,uri:n,texture:i,sampler:o,maxInstancesNumber:a=10}){const r=`MatCap_${e}`+(t?"+skinning":""),s=new m.S(t,n,i,o);return s.isSingleOperation=!0,K(r,s,a)},changeMaterial:function(e,t,n){const i=e.getMeshRenderer();t.material=n,i.moveStageTo(c.I.Load)}})},2749:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var i=n(3449),o=n(4252),a=n(4690),r=n(6098),s=n(3738);class l{constructor(){}static async importFromUri(e,t){var n;const o=await i.j.fetchArrayBuffer(e);return o.isErr()?new s.UG({message:"fetchArrayBuffer error",error:void 0}):await this._importGltfOrGlbFromArrayBuffers(o.unwrapForce(),null!==(n=null==t?void 0:t.files)&&void 0!==n?n:{},t,e)}static async importFromArrayBuffers(e,t){for(const n in e){const o=i.j.getExtension(n);if("gltf"===o||"glb"===o)return await this._importGltfOrGlbFromArrayBuffers(e[n],e,t)}return new s.UG({message:"no gltf or glb file found",error:void 0})}static async _importGltfOrGlbFromArrayBuffers(e,t,n,o){if(1179937895!==new DataView(e,0,20).getUint32(0,!0)){const a=i.j.arrayBufferToString(e),r=JSON.parse(a);try{const e=await this._importGltf(r,t,n,o);return new s.Ok(e)}catch(e){return new s.UG({message:"this.__importGltf error",error:void 0})}}else try{const i=await this._importGlb(e,t,n);return new s.Ok(i)}catch(e){return new s.UG({message:"this.importGlb error",error:void 0})}}static _getOptions(e,t,n){var i,o;if(null!=(null===(o=null===(i=t.asset)||void 0===i?void 0:i.extras)||void 0===o?void 0:o.rnLoaderOptions))for(const n in t.asset.extras.rnLoaderOptions)e[n]=t.asset.extras.rnLoaderOptions[n];for(const t in n)e[t]=n[t];return n&&n.loaderExtensionName&&"string"==typeof n.loaderExtensionName&&(null!=Rn[n.loaderExtensionName]?e.loaderExtension=Rn[n.loaderExtensionName].getInstance():(console.error(`${n.loaderExtensionName} not found!`),e.loaderExtension=void 0)),e}static async _importGlb(e,t,n){const o=new DataView(e,0,20);if(2!==o.getUint32(4,!0))throw new Error("invalid version field in this binary glTF file.");const a=o.getUint32(12,!0);if(1313821514!==o.getUint32(16,!0))throw new Error("invalid chunkType of chunk0 in this binary glTF file.");const r=new Uint8Array(e,20,a),s=i.j.uint8ArrayToString(r),l=JSON.parse(s),c=i.j.createDefaultGltfOptions();n=this._getOptions(c,l,n);const _=new Uint8Array(e,20+a+8);void 0===l.asset.extras&&(l.asset.extras={fileType:"glTF",version:"2"}),this._mergeExtendedJson(l,n.extendedJson),l.asset.extras.rnLoaderOptions=n;try{await this._loadInner(l,t,n,_)}catch(e){console.log("this._loadInner error in _loadAsBinaryJson",e)}return l}static async _importGltf(e,t,n,o,a){const r=(null==o?void 0:o.substring(0,null==o?void 0:o.lastIndexOf("/")))+"/";void 0===e.asset.extras&&(e.asset.extras={fileType:"glTF",version:"2"});const s=i.j.createDefaultGltfOptions();n=this._getOptions(s,e,n),this._mergeExtendedJson(e,n.extendedJson),e.asset.extras.rnLoaderOptions=n;try{await this._loadInner(e,t,n,void 0,r,a)}catch(e){console.error("this._loadInner error in _loadAsTextJson",e)}return e}static _loadInner(e,t,n,i,a,r){const s=[];return s.push(this._loadResources(i,e,t,n,a,r)),s.push(new o.n((t=>{this._loadJsonContent(e),t()}))),o.n.all(s)}static _loadJsonContent(e){this._loadDependenciesOfScenes(e),this._loadDependenciesOfNodes(e),this._loadDependenciesOfMeshes(e),this._loadDependenciesOfMaterials(e),this._loadDependenciesOfTextures(e),this._loadDependenciesOfJoints(e),this._loadDependenciesOfAnimations(e),this._loadDependenciesOfAccessors(e),this._loadDependenciesOfBufferViews(e),void 0===e.asset.extras&&(e.asset.extras={})}static _loadDependenciesOfScenes(e){for(const t of e.scenes){a.Is.undefined(t.nodesObjects)&&(t.nodesObjects=[]);for(const n of t.nodes)t.nodesObjects[n]=e.nodes[t.nodes[n]]}}static _loadDependenciesOfNodes(e){var t,n;for(const i of e.nodes){if(i.childrenObjects=null!==(t=i.childrenObjects)&&void 0!==t?t:[],i.children)for(const t of i.children)i.childrenObjects[t]=e.nodes[t];void 0!==i.mesh&&void 0!==e.meshes&&(i.meshObject=e.meshes[i.mesh]),void 0!==i.skin&&void 0!==e.skins&&(i.skinObject=e.skins[i.skin],a.Is.exist(i.skinObject)&&(a.Is.not.exist(null===(n=i.meshObject)||void 0===n?void 0:n.extras)&&(i.meshObject.extras={}),i.meshObject.extras._skin=i.skin)),void 0!==i.camera&&void 0!==e.cameras&&(i.cameraObject=e.cameras[i.camera]),void 0!==i.extensions&&void 0!==e.extensions&&void 0!==e.extensions.KHR_lights_punctual&&(i.extensions.KHR_lights_punctual.lightIndex=i.extensions.KHR_lights_punctual.light,i.extensions.KHR_lights_punctual.light=e.extensions.KHR_lights_punctual.lights[i.extensions.KHR_lights_punctual.lightIndex])}}static _loadDependenciesOfMeshes(e){var t;if(!a.Is.not.exist(e.meshes))for(const n of e.meshes)for(const i of n.primitives){if(void 0!==i.material&&(i.materialObject=e.materials[i.material]),null!=(null===(t=i.extensions)||void 0===t?void 0:t.KHR_materials_variants)){i.materialVariants=[];const t=i.extensions.KHR_materials_variants.mappings,n=e.extensions.KHR_materials_variants.variants;for(const o of t){const t=o.variants.map((e=>n[e].name)),a={materialObject:e.materials[o.material],variants:t};i.materialVariants.push(a)}}i.attributesObjects={};for(const t in i.attributes){const n=i.attributes[t],o=e.accessors[n];o.extras={toGetAsTypedArray:!0,attributeName:t},i.attributesObjects[t]=o}if(null!=i.indices&&(i.indicesObject=e.accessors[i.indices]),null!=i.targets){i.targetsObjects=[];for(const t of i.targets){const n={};for(const i in t){const o=t[i];if(o>=0){const t=e.accessors[o];t.extras={toGetAsTypedArray:!0,attributeName:i},n[i]=t}}i.targetsObjects.push(n)}}}}static _checkRnGltfLoaderOptionsExist(e){return!(!e.asset.extras||!e.asset.extras.rnLoaderOptions)}static _loadDependenciesOfMaterials(e){if(e.textures||(e.textures=[]),e.materials)for(const t of e.materials){if(t.pbrMetallicRoughness){const n=t.pbrMetallicRoughness.baseColorTexture;void 0!==n&&(n.texture=e.textures[n.index]);const i=t.pbrMetallicRoughness.metallicRoughnessTexture;void 0!==i&&(i.texture=e.textures[i.index])}const n=t.normalTexture;void 0!==n&&(n.texture=e.textures[n.index]);const i=t.occlusionTexture;void 0!==i&&(i.texture=e.textures[i.index]);const o=t.emissiveTexture;if(void 0!==o&&(o.texture=e.textures[o.index]),this._checkRnGltfLoaderOptionsExist(e)&&e.asset.extras.rnLoaderOptions.loaderExtension&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures(e,t),a.Is.exist(t.extensions)){const n=t.extensions;if(a.Is.exist(n.KHR_materials_clearcoat)){const t=n.KHR_materials_clearcoat.clearcoatTexture;void 0!==t&&(t.texture=e.textures[t.index]);const i=n.KHR_materials_clearcoat.clearcoatRoughnessTexture;void 0!==i&&(i.texture=e.textures[i.index]);const o=n.KHR_materials_clearcoat.clearcoatNormalTexture;void 0!==o&&(o.texture=e.textures[o.index])}if(a.Is.exist(n.KHR_materials_transmission)){const t=n.KHR_materials_transmission.transmissionTexture;void 0!==t&&(t.texture=e.textures[t.index])}if(a.Is.exist(n.KHR_materials_volume)){const t=n.KHR_materials_volume.thicknessTexture;void 0!==t&&(t.texture=e.textures[t.index])}if(a.Is.exist(n.KHR_materials_sheen)){const t=n.KHR_materials_sheen.sheenColorTexture;void 0!==t&&(t.texture=e.textures[t.index]);const i=n.KHR_materials_sheen.sheenRoughnessTexture;void 0!==i&&(i.texture=e.textures[i.index])}if(a.Is.exist(n.KHR_materials_specular)){const t=n.KHR_materials_specular.specularTexture;void 0!==t&&(t.texture=e.textures[t.index]);const i=n.KHR_materials_specular.specularColorTexture;void 0!==i&&(i.texture=e.textures[i.index])}if(a.Is.exist(n.KHR_materials_iridescence)){const t=n.KHR_materials_iridescence.iridescenceTexture;void 0!==t&&(t.texture=e.textures[t.index]);const i=n.KHR_materials_iridescence.iridescenceThicknessTexture;void 0!==i&&(i.texture=e.textures[i.index])}if(a.Is.exist(n.KHR_materials_anisotropy)){const t=n.KHR_materials_anisotropy.anisotropyTexture;void 0!==t&&(t.texture=e.textures[t.index])}}}}static _loadDependenciesOfTextures(e){var t,n;if(e.textures)for(const i of e.textures)(0,r.Jx)((t=>i.samplerObject=e.samplers[t]),i.sampler),null!=(null===(n=null===(t=i.extensions)||void 0===t?void 0:t.KHR_texture_basisu)||void 0===n?void 0:n.source)?(i.extensions.KHR_texture_basisu.fallbackSourceIndex=i.source,i.source=i.extensions.KHR_texture_basisu.source,i.image=e.images[i.source]):void 0!==i.source&&(i.image=e.images[i.source])}static _loadDependenciesOfJoints(e){if(e.skins)for(const t of e.skins){t.skeletonObject=e.nodes[t.skeleton],t.inverseBindMatricesObject=e.accessors[t.inverseBindMatrices],a.Is.not.exist(t.skeleton)&&(t.skeleton=t.joints[0],t.skeletonObject=e.nodes[t.skeleton]),t.jointsObjects=[];for(const n of t.joints)t.jointsObjects.push(e.nodes[n])}}static _loadDependenciesOfAnimations(e){if(e.animations)for(const t of e.animations)for(const n of t.channels)if(a.Is.exist(n.sampler)){if(n.samplerObject=t.samplers[n.sampler],n.target.nodeObject=e.nodes[n.target.node],n.samplerObject.inputObject=e.accessors[n.samplerObject.input],n.samplerObject.outputObject=e.accessors[n.samplerObject.output],a.Is.undefined(n.samplerObject.outputObject.extras)&&(n.samplerObject.outputObject.extras={}),"weights"===n.target.path){let e=n.samplerObject.outputObject.count/n.samplerObject.inputObject.count;"CUBICSPLINE"===n.samplerObject.interpolation&&(e=n.samplerObject.outputObject.count/n.samplerObject.inputObject.count/3),n.samplerObject.outputObject.extras.weightsArrayLength=e}"rotation"===n.target.path&&(n.samplerObject.outputObject.extras.quaternionIfVec4=!0)}}static _loadDependenciesOfAccessors(e){for(const t of e.accessors)if(null==t.bufferView&&(t.bufferView=0),t.bufferViewObject=e.bufferViews[t.bufferView],a.Is.exist(t.sparse)){const n=t.sparse;a.Is.exist(n)&&a.Is.exist(n.indices)&&a.Is.exist(n.values)&&(n.indices.bufferViewObject=e.bufferViews[n.indices.bufferView],n.values.bufferViewObject=e.bufferViews[n.values.bufferView])}}static _loadDependenciesOfBufferViews(e){for(const t of e.bufferViews)void 0!==t.buffer&&(t.bufferObject=e.buffers[t.buffer])}static _mergeExtendedJson(e,t){let n=null;if(t instanceof ArrayBuffer){const e=i.j.arrayBufferToString(t);n=JSON.parse(e)}else"string"==typeof t?n=JSON.parse(t):"object"==typeof t&&(n=t);Object.assign(e,n)}static _loadResources(e,t,n,r,s,l){var c;const _=[];let h;for(const a of t.buffers){let t="";if(a.uri){const e=a.uri.split("/");t=e[e.length-1]}h=void 0===a.uri?new o.n((t=>{a.buffer=e,t(e)})):a.uri.match(/^data:application\/(.*);base64,/)?new o.n((e=>{const t=i.j.dataUriToArrayBuffer(a.uri);a.buffer=new Uint8Array(t),e(t)})):n&&this.__containsFileName(n,t)?new o.n((e=>{const i=this.__getFullPathOfFileName(n,t),o=n[i];a.buffer=new Uint8Array(o),e(o)})):new o.n(i.j.loadResourceAsync(s+a.uri,!0,((e,t)=>{a.buffer=new Uint8Array(t),e(t)}),((e,t)=>{e("HTTP Error Status:"+t)}))),a.bufferPromise=h,_.push(h)}for(const r of null!==(c=t.images)&&void 0!==c?c:[])if(null==r.uri)if(a.Is.exist(e)){const o=i.j.createUint8ArrayFromBufferViewInfo(t,r.bufferView,e),a=i.j.createBlobImageUriFromUint8Array(o,r.mimeType);_.push(this.__loadImageUri(a,r,n))}else{const e=t.bufferViews[r.bufferView].bufferObject;if(a.Is.not.exist(e)){console.error("gltf2BufferView.bufferObject not found");continue}const s=e.bufferPromise,l=new o.n((e=>{s.then((o=>{const a=i.j.createUint8ArrayFromBufferViewInfo(t,r.bufferView,o),s=i.j.createBlobImageUriFromUint8Array(a,r.mimeType);this.__loadImageUri(s,r,n).then((()=>{e(o)}))}))})),c=_.indexOf(s);_[c]=l,e.bufferPromise=l}else{const e=r.uri,t=e.split("/"),o=t[t.length-1];let a;if(n&&this.__containsFileName(n,o)){const e=this.__getFullPathOfFileName(n,o),t=n[e];a=i.j.createBlobImageUriFromUint8Array(new Uint8Array(t),r.mimeType)}else a=e.match(/^data:/)?e:s+e;_.push(this.__loadImageUri(a,r,n))}if(r.defaultTextures){const e=r.defaultTextures.basePath,t=r.defaultTextures.textureInfos;for(const n of t){const t=n.fileName,o=e+t,a=i.j.getExtension(t),r=i.j.getMimeTypeFromExtension(a),s=i.j.createImageFromUri(o,r).then((e=>(e.crossOrigin="Anonymous",n.image={image:e},n.image)));_.push(s)}}return o.n.all(_,l).catch((e=>{console.log("Promise.all error",e)}))}static __containsFileName(e,t){for(const n in e){const e=n.split("/");if(e[e.length-1]===t)return!0}return!1}static __getFullPathOfFileName(e,t){for(const n in e){const e=n.split("/");if(e[e.length-1]===t)return n}}static __loadImageUri(e,t,n){var a,r;let s;return s=e.match(/basis$/)?new o.n((n=>{fetch(e,{mode:"cors"}).then((e=>{e.arrayBuffer().then((e=>{const i=new Uint8Array(e);t.basis=i,n(t)}))}))})):(null===(a=t.uri)||void 0===a?void 0:a.match(/basis$/))?new o.n((e=>{t.basis=new Uint8Array(n[t.uri]),e(t)})):e.match(/\.ktx2$/)||e.match(/^data:image\/ktx2/)||null!=t.bufferView&&"image/ktx2"===t.mimeType?new o.n((n=>{fetch(e,{mode:"cors"}).then((e=>{e.arrayBuffer().then((e=>{const i=new Uint8Array(e);t.ktx2=i,n(t)}))}))})):(null===(r=t.uri)||void 0===r?void 0:r.match(/ktx2$/))?new o.n((e=>{t.ktx2=new Uint8Array(n[t.uri]),e(t)})):i.j.createImageFromUri(e,t.mimeType).then((e=>(e.crossOrigin="Anonymous",t.image=e,t))),s}}},6694:(e,t,n)=>{"use strict";n.d(t,{e:()=>W});var i=n(1350),o=n(4097),a=n(2471),r=n(9207),s=n(5467),l=n(1845),c=n(4235),_=n(8696),h=n(810),u=n(3999),d=n(128),m=n(9646),f=n(2575),p=n(7192),v=n(1564),A=n(7305),y=n(3032),x=n(1656),g=n(5704),I=n(3913),b=n(4587),E=n(2390),T=n(9840),S=n(6214),C=n(4536),w=n(5634),R=n(3258),P=n(752),M=n(9286),D=n(3616),N=n(5981),B=n(7987),L=n(4690),F=n(3449),G=n(4350),z=n(7973),V=n(6456),O=n(6683),U=n(1220),k=n(3496),Q=n(580);class W{constructor(){}static __generateGroupEntity(e){const t=z._.createGroupEntity();return this.addTags(t,e),t}static addTags(e,t){e.tryToSetTag({tag:"SourceType",value:t.asset.extras.fileType}),e.tryToSetTag({tag:"SourceTypeVersion",value:t.asset.extras.version})}static __generateMeshEntity(e){const t=z._.createMeshEntity();return this.addTags(t,e),t}static __generateCameraEntity(e){const t=z._.createCameraEntity();return this.addTags(t,e),t}static __generateLightEntity(e){const t=z._.createLightEntity();return this.addTags(t,e),t}static convertToRhodoniteObject(e){var t;e.asset.extras.rnMeshesAtGltMeshIdx=[];const n=this.createRnBuffer(e);e.asset.extras.rnMaterials={};const{rnEntities:i,rnEntitiesByNames:o}=this.__setupObjects(e,n);e.asset.extras.rnEntities=i,this._setupTransform(e,i),this._setupAnimation(e,i,n),this._setupSkeleton(e,i,n),this._setupHierarchy(e,i),this._setupAnimation(e,i,n);const a=this.__generateGroupEntity(e);if(a.tryToSetUniqueName("FileRoot",!0),a.tryToSetTag({tag:"ObjectType",value:"top"}),e.scenes[0].nodes)for(const t of e.scenes[0].nodes){const e=i[t].getSceneGraph();a.getSceneGraph().addChild(e)}if(e.asset.extras&&e.asset.extras.rnLoaderOptions){const n=e.asset.extras.rnLoaderOptions;n&&n.loaderExtension&&(null===(t=null==n?void 0:n.loaderExtension)||void 0===t?void 0:t.loadExtensionInfoAndSetToRootGroup)&&n.loaderExtension.loadExtensionInfoAndSetToRootGroup(a,e),n&&n.expression&&n.expression.tryToSetTag({tag:"gltfModel",value:e})}return a.tryToSetTag({tag:"rnEntities",value:i}),a.tryToSetTag({tag:"rnEntitiesByNames",value:o}),a.tryToSetTag({tag:"gltfModel",value:e}),L.Is.not.exist(e.extras)&&(e.extras={}),e.extras.rnEntities=i,e.extras.rnEntitiesByNames=o,U.z.importEffect(e,a),U.z.importBillboard(e,i),L.Is.exist(e.extensionsUsed)&&e.extensionsUsed.indexOf("VRMC_vrm"),a}static createRnBuffer(e){const t=[];for(const n of e.buffers){const e=new c.l({byteLength:n.byteLength,buffer:n.buffer,name:`gltf2Buffer_0_(${n.uri})`,byteAlign:4});t.push(e)}return t}static _setupTransform(e,t){for(const n in e.nodes){const i=t[n],o=e.nodes[n],l=i.getTransform();o.translation&&(l.localPosition=a.P.fromCopyArray([o.translation[0],o.translation[1],o.translation[2]])),o.scale&&(l.localScale=a.P.fromCopyArray([o.scale[0],o.scale[1],o.scale[2]])),o.rotation&&(l.localRotation=r._.fromCopy4(o.rotation[0],o.rotation[1],o.rotation[2],o.rotation[3])),o.matrix&&(l.localMatrix=s.J.fromCopyArrayColumnMajor(o.matrix))}}static _setupHierarchy(e,t){const n=t.map((e=>e.getSceneGraph()));for(const t in e.nodes){const i=parseInt(t),o=e.nodes[i];if(L.Is.exist(o.children)){const e=n[i];for(const t of o.children){const i=n[t];e.addChild(i)}}}}static _setupAnimation(e,t,n){var o;if(e.animations)for(const t of e.animations)for(const e of t.samplers)this._readBinaryFromAccessorAndSetItToAccessorExtras(e.inputObject,n),this._readBinaryFromAccessorAndSetItToAccessorExtras(e.outputObject,n);if(L.Is.exist(e.animations)&&e.animations.length>0)for(const n of e.animations)for(const e of n.channels)if(L.Is.exist(e.samplerObject)){const a=e.samplerObject.inputObject.extras.typedDataArray,r=e.samplerObject.outputObject.extras.typedDataArray,s=null!==(o=e.samplerObject.interpolation)&&void 0!==o?o:"LINEAR";let l="undefined";l="translation"===e.target.path?"translate":"rotation"===e.target.path?"quaternion":e.target.path;const c=t[e.target.node];if(L.Is.exist(c)){let t=c.tryToGetAnimation();if(L.Is.not.exist(t)&&(t=i.g.addComponentToEntity(v.c,c).getAnimation()),L.Is.exist(t)){const i=e.samplerObject.outputObject.extras.componentN;t.setAnimation(L.Is.exist(n.name)?n.name:"Untitled_Animation",l,a,r,i,A.k.fromString(s))}}}}static _setupSkeleton(e,t,n){if(null!=e.skins)for(const o in e.nodes){const a=e.nodes[o],r=t[o].getSceneGraph();let l;if(L.Is.exist(a.skinObject)){const e=t[o];if(l=i.g.addComponentToEntity(x.Y,e).getSkeletal(),L.Is.exist(a.skinObject.bindShapeMatrix)&&(l._bindShapeMatrix=s.J.fromCopyArrayColumnMajor(a.skinObject.bindShapeMatrix)),L.Is.exist(a.skinObject.skeleton)&&(r.isRootJoint=!0,L.Is.exist(a.mesh))){const e=[];for(const n of a.skinObject.joints)e.push(t[n].getSceneGraph());l.setJoints(e),L.Is.exist(a.skinObject.skeleton)?l.topOfJointsHierarchy=t[a.skinObject.skeleton].getSceneGraph():l.topOfJointsHierarchy=e[0]}for(const e of a.skinObject.joints)t[e].getSceneGraph().jointIndex=e;const c=a.skinObject.inverseBindMatricesObject;if(L.Is.exist(c)){const e=this.__getRnBufferViewAndRnAccessor(c,n[c.bufferViewObject.buffer]);l.setInverseBindMatricesAccessor(e)}}}}static __setupObjects(e,t){var n,a,r,s,l;const c=[],_=new Map;for(const h in e.nodes){const u=e.nodes[parseInt(h)];let d;if(null!=u.mesh){const i=u.mesh,a=this.__setupMesh(u,u.meshObject,i,t,e);u.name&&a.tryToSetUniqueName(u.name,!0),(null===(n=u.meshObject)||void 0===n?void 0:n.name)&&a.getComponent(o.$).tryToSetUniqueName(u.meshObject.name,!0),d=a}else if(null!=u.cameraObject){const t=this.__setupCamera(u.cameraObject,e);u.name&&t.tryToSetUniqueName(u.name,!0),d=t}else if(null===(a=u.extensions)||void 0===a?void 0:a.KHR_lights_punctual)d=this.__setupLight(u.extensions.KHR_lights_punctual.light,e);else{const t=this.__generateGroupEntity(e);u.name&&t.tryToSetUniqueName(u.name,!0),d=t}if(this.__isMorphing(u,e)){let e=[];if(u.weights)e=u.weights;else if(null===(r=u.meshObject)||void 0===r?void 0:r.weights)e=u.meshObject.weights;else{let t=0;for(const e of u.meshObject.primitives)L.Is.exist(e.targets)&&e.targets.length>t&&(t=e.targets.length);e=new Array(t).fill(0)}d=i.g.addComponentToEntity(V.x,d);const t=d.getBlendShape();t.weights=e,(null===(l=null===(s=u.meshObject)||void 0===s?void 0:s.primitives[0].extras)||void 0===l?void 0:l.targetNames)&&(t.targetNames=u.meshObject.primitives[0].extras.targetNames)}d.tryToSetTag({tag:G.j,value:h}),c.push(d),_.set(u.name,d)}return{rnEntities:c,rnEntitiesByNames:_}}static __isMorphing(e,t){var n,i,o;const a=null===(i=null===(n=t.asset.extras)||void 0===n?void 0:n.rnLoaderOptions)||void 0===i?void 0:i.defaultMaterialHelperArgumentArray[0];return!1!==(null==a?void 0:a.isMorphing)&&null!=(null===(o=e.meshObject)||void 0===o?void 0:o.primitives[0].targets)}static __setupLight(e,t){var n,i;const o=this.__generateLightEntity(t),r=o.getComponent(O.r);if(null!=e.name){r.tryToSetUniqueName(e.name,!0),r.type=w.v.fromString(e.type);let t=a.P.fromCopyArray3([1,1,1]),o=1;null!=e.color&&(t=a.P.fromCopyArray3(e.color)),null!=e.intensity&&(o=e.intensity),r.intensity=a.P.multiply(t,o),null!=e.range&&(r.range=e.range),"spot"===e.type&&(null!=(null===(n=e.spot)||void 0===n?void 0:n.innerConeAngle)&&(r.innerConeAngle=e.spot.innerConeAngle),null!=(null===(i=e.spot)||void 0===i?void 0:i.outerConeAngle)&&(r.outerConeAngle=e.spot.outerConeAngle))}return o}static __setupCamera(e,t){const n=this.__generateCameraEntity(t),i=n.getCamera();return i.direction=a.P.fromCopyArray([0,0,-1]),t.asset&&t.asset.LastSaved_ApplicationVendor&&(i.direction=a.P.fromCopyArray([1,0,0]),i.directionInner=a.P.fromCopyArray([1,0,0])),i.up=a.P.fromCopyArray([0,1,0]),i.type=m.i.fromString(e.type),i.type===m.i.Perspective?(i.aspect=e.perspective.aspectRatio?e.perspective.aspectRatio:1,i.setFovyAndChangeFocalLength(y.k.radianToDegree(e.perspective.yfov)),i.zNear=e.perspective.znear,i.zFar=e.perspective.zfar?e.perspective.zfar:1e5,i.tryToSetTag({tag:"OriginalFovY",value:i.fovy})):i.type===m.i.Orthographic&&(i.xMag=e.orthographic.xmag,i.yMag=e.orthographic.ymag,i.zNear=e.orthographic.znear,i.zFar=e.orthographic.zfar,i.tryToSetTag({tag:"OriginalXMag",value:i.xMag}),i.tryToSetTag({tag:"OriginalYMag",value:i.yMag})),i.tryToSetTag({tag:"OriginalAspect",value:i.aspect}),n}static __setupMesh(e,t,n,i,o){var a;const r=this.__generateMeshEntity(o),s=o.asset.extras.rnMeshesAtGltMeshIdx[n];let c=_.T.Triangles;const h=r.getMesh();if(null!=s)h.setMesh(s);else{const r=new S.K,s=o.asset.extras.rnLoaderOptions;null!=(null==s?void 0:s.tangentCalculationMode)&&(r.tangentCalculationMode=s.tangentCalculationMode);const u=(t,n)=>{const i=this.__setupMaterial(t,e,o,n,n.materialObject);return!1===i.isEmptyMaterial()&&W.setDefaultTextures(i,o),i},m=(t,n)=>{const i=n.materialVariants;if(!L.Is.not.exist(i))for(const a of i){const i=this.__setupMaterial(t,e,o,n,a.materialObject);!1===i.isEmptyMaterial()&&W.setDefaultTextures(i,o);for(const e of a.variants)t.setMaterialVariant(e,i)}};for(const e in t.primitives){const n=t.primitives[e];null!=n.mode&&(c=_.T.from(n.mode));const h=new l.W,f=u(h,n);let p;m(h,n);const v=new Map;if(null===(a=n.extensions)||void 0===a?void 0:a.KHR_draco_mesh_compression){if(p=this.__decodeDraco(n,i,o,v),L.Is.not.exist(p))break}else{L.Is.exist(n.indices)&&(p=this.__getRnBufferViewAndRnAccessor(n.indicesObject,i[n.indicesObject.bufferViewObject.buffer]));const e=new Map;for(const t in n.attributesObjects){const o=n.attributesObjects[t],a=i[o.bufferViewObject.buffer];let r;L.Is.exist(o.bufferView)?(r=e.get(o.bufferView),L.Is.not.exist(r)&&(r=this.__getRnBufferView(o.bufferViewObject,a),e.set(o.bufferView,r))):r=a.takeBufferView({byteLengthToNeed:0,byteStride:0}).unwrapForce();const s=this.__getRnAccessor(o,r),l=d.T.toVertexAttributeSemanticJoinedStringAsGltfStyle(d.T.fromString(o.extras.attributeName));v.set(l,s)}}if(h.setData(v,c,f,p),null!=n.targets){let e=R.D.maxMorphTargetNumber;null!=(null==s?void 0:s.maxMorphTargetNumber)&&(e=s.maxMorphTargetNumber);const t=[];for(let o=0;o=e);o++){const e=n.targetsObjects[o],a=new Map;for(const t in e){const n=e[t],o=this.__getRnBufferViewAndRnAccessor(n,i[n.bufferViewObject.buffer]),r=this.__copyRnAccessorAndBufferView(o),s=d.T.fromString(t),l=d.T.toVertexAttributeSemanticJoinedStringAsGltfStyle(s);a.set(l,r)}t.push(a)}h.setBlendShapeTargets(t)}r.addPrimitive(h)}h.setMesh(r),o.asset.extras.rnMeshesAtGltMeshIdx[n]=r}return r}static setSparseAccessor(e,t){var n,i,o,a;const r=e.bufferViewObject.bufferObject.buffer,s=e.sparse.count,l=e.sparse.indices,c=(null!==(n=l.bufferViewObject.byteOffset)&&void 0!==n?n:0)+(null!==(i=l.byteOffset)&&void 0!==i?i:0),_=this._checkBytesPerComponent(l),h=_*s,u=new DataView(r.buffer,c+r.byteOffset,h),d=this._checkDataViewMethod(l),m=e.sparse.values,f=(null!==(o=m.bufferViewObject.byteOffset)&&void 0!==o?o:0)+(null!==(a=m.byteOffset)&&void 0!==a?a:0),p=this._checkBytesPerComponent(e),v=this._checkComponentNumber(e),A=p*v*s,y=new DataView(r.buffer,f+r.byteOffset,A),x=this._checkDataViewMethod(e),g=t.getTypedArray();for(let e=0;e=2){const e=null!==(f=null===(m=n.asset.extras)||void 0===m?void 0:m.rnLoaderOptions)&&void 0!==f?f:{},t=this.__useTangentAttribute(n,i),a=this.__useNormalTexture(n),r=I.G.createPbrUberMaterial({isMorphing:S,isSkinning:C,isLighting:w,isClearCoat:L.Is.exist(null===(p=null==o?void 0:o.extensions)||void 0===p?void 0:p.KHR_materials_clearcoat),isTransmission:L.Is.exist(null===(v=null==o?void 0:o.extensions)||void 0===v?void 0:v.KHR_materials_transmission),isVolume:L.Is.exist(null===(A=null==o?void 0:o.extensions)||void 0===A?void 0:A.KHR_materials_volume),isSheen:L.Is.exist(null===(y=null==o?void 0:o.extensions)||void 0===y?void 0:y.KHR_materials_sheen),isSpecular:L.Is.exist(null===(x=null==o?void 0:o.extensions)||void 0===x?void 0:x.KHR_materials_specular),isIridescence:L.Is.exist(null===(E=null==o?void 0:o.extensions)||void 0===E?void 0:E.KHR_materials_iridescence),isAnisotropy:L.Is.exist(null===(T=null==o?void 0:o.extensions)||void 0===T?void 0:T.KHR_materials_anisotropy),isShadow:!!e.shadow,useTangentAttribute:t,useNormalTexture:a,additionalName:M,maxInstancesNumber:D}),s=this.__makeOutputSrgb(n);return L.Is.exist(s)&&r.setParameter(b.f5.MakeOutputSrgb,s),r}return I.G.createClassicUberMaterial({isSkinning:C,isLighting:w,additionalName:M,maxInstancesNumber:D})}static __isLighting(e,t){var n,i,o,a;const r=null===(o=null===(i=null===(n=null==e?void 0:e.asset)||void 0===n?void 0:n.extras)||void 0===i?void 0:i.rnLoaderOptions)||void 0===o?void 0:o.defaultMaterialHelperArgumentArray[0];return null!=(null==r?void 0:r.isLighting)?r.isLighting:null==(null===(a=null==t?void 0:t.extensions)||void 0===a?void 0:a.KHR_materials_unlit)}static __isSkinning(e,t){var n,i,o;const a=null===(o=null===(i=null===(n=null==t?void 0:t.asset)||void 0===n?void 0:n.extras)||void 0===i?void 0:i.rnLoaderOptions)||void 0===o?void 0:o.defaultMaterialHelperArgumentArray[0];return!1!==(null==a?void 0:a.isSkinning)&&null!=e.skin}static __useTangentAttribute(e,t){var n,i,o;switch(null===(o=null===(i=null===(n=null==e?void 0:e.asset)||void 0===n?void 0:n.extras)||void 0===i?void 0:i.rnLoaderOptions)||void 0===o?void 0:o.tangentCalculationMode){case 0:case 3:return!1;case 1:break;case 2:case 4:return!0}for(const e in t.attributes)if("TANGENT"===e)return!0;return!1}static __useNormalTexture(e){var t,n,i,o,a,r;const s=null===(i=null===(n=null===(t=null==e?void 0:e.asset)||void 0===t?void 0:t.extras)||void 0===n?void 0:n.rnLoaderOptions)||void 0===i?void 0:i.defaultMaterialHelperArgumentArray[0];return!1!==(null==s?void 0:s.useNormalTexture)&&0!==(null===(r=null===(a=null===(o=null==e?void 0:e.asset)||void 0===o?void 0:o.extras)||void 0===a?void 0:a.rnLoaderOptions)||void 0===r?void 0:r.tangentCalculationMode)}static __makeOutputSrgb(e){var t,n,i;const o=null===(i=null===(n=null===(t=null==e?void 0:e.asset)||void 0===t?void 0:t.extras)||void 0===n?void 0:n.rnLoaderOptions)||void 0===i?void 0:i.defaultMaterialHelperArgumentArray[0];return null==o?void 0:o.makeOutputSrgb}static __getMaterialHash(e,t,n,i){return n.material+"_isSkinning_"+this.__isSkinning(e,t)+"_isMorphing_"+this.__isMorphing(e,t)+"_isLighting_"+this.__isLighting(t,i)+"_useTangentAttribute_"+this.__useTangentAttribute(t,n)}static __setupMaterial(e,t,n,i,o){var r,s,l,c,_,h,u,d,m,f,v,A;const y=null!=(null===(r=null==o?void 0:o.extensions)||void 0===r?void 0:r.KHR_materials_unlit),x=this.__generateAppropriateMaterial(e,t,n,i,o);if(!this.__needParameterInitialization(o,x.materialTypeName))return x;const I=n.asset.extras.rnLoaderOptions,S=null==o?void 0:o.pbrMetallicRoughness;if(null!=S)!function(e,t,n,i,o){var r;const s=null!=(null===(r=o.extensions)||void 0===r?void 0:r.KHR_materials_unlit),l=e.baseColorFactor;null!=l&&t.setParameter(b.f5.BaseColorFactor,p.Lt.fromCopyArray4(l));const c=e.baseColorTexture;if(null!=c){const e=W._createTexture(c.texture,n,{autoDetectTransparency:null==i?void 0:i.autoDetectTextureTransparency}),o=W._createSampler(c.texture);t.setTextureParameter(b.f5.BaseColorTexture,e,o),null!=c.texCoord&&t.setParameter(b.f5.BaseColorTexcoordIndex,c.texCoord)}const _=o.occlusionTexture;if(null!=_&&L.Is.falsy(s)){const e=W._createTexture(_.texture,n),i=W._createSampler(_.texture);t.setTextureParameter(b.f5.OcclusionTexture,e,i),null!=_.texCoord&&t.setParameter(b.f5.OcclusionTexcoordIndex,_.texCoord),null!=_.strength&&t.setParameter(b.f5.OcclusionStrength,_.strength),W._setupTextureTransform(_,t,b.f5.OcclusionTextureTransform,b.f5.OcclusionTextureRotation)}let h=e.metallicFactor;h=s?0:null!=h?h:1;let u=e.roughnessFactor;u=s?1:null!=u?u:1,t.setParameter(b.f5.MetallicRoughnessFactor,E.FM.fromCopyArray2([h,u]));const d=e.metallicRoughnessTexture;if(null!=d&&L.Is.falsy(s)){const e=W._createTexture(d.texture,n),i=W._createSampler(d.texture);t.setTextureParameter(b.f5.MetallicRoughnessTexture,e,i),null!=d.texCoord&&t.setParameter(b.f5.MetallicRoughnessTexcoordIndex,d.texCoord)}!function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_clearcoat;if(L.Is.exist(o)){const e=L.Is.exist(o.clearcoatFactor)?o.clearcoatFactor:0;t.setParameter(b.f5.ClearCoatFactor,e);const i=o.clearcoatTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.ClearCoatTexture,e,o),null!=i.texCoord&&t.setParameter(b.f5.ClearCoatTexcoordIndex,i.texCoord),W._setupTextureTransform(i,t,b.f5.ClearCoatTextureTransform,b.f5.ClearCoatTextureRotation)}const a=L.Is.exist(o.clearcoatRoughnessFactor)?o.clearcoatRoughnessFactor:0;t.setParameter(b.f5.ClearCoatRoughnessFactor,a);const r=o.clearcoatRoughnessTexture;if(null!=r){const e=W._createTexture(r.texture,n),i=W._createSampler(r.texture);t.setTextureParameter(b.f5.ClearCoatRoughnessTexture,e,i),null!=r.texCoord&&t.setParameter(b.f5.ClearCoatRoughnessTexcoordIndex,r.texCoord),W._setupTextureTransform(r,t,b.f5.ClearCoatRoughnessTextureTransform,b.f5.ClearCoatRoughnessTextureRotation)}const s=o.clearcoatNormalTexture;if(null!=s){const e=W._createTexture(s.texture,n),i=W._createSampler(s.texture);t.setTextureParameter(b.f5.ClearCoatNormalTexture,e,i),null!=s.texCoord&&t.setParameter(b.f5.ClearCoatNormalTexcoordIndex,s.texCoord),W._setupTextureTransform(s,t,b.f5.ClearCoatNormalTextureTransform,b.f5.ClearCoatNormalTextureRotation)}}}(o,t,n);const m=function(e,t,n){var i;const o=null===(i=e.extensions)||void 0===i?void 0:i.KHR_materials_transmission;if(L.Is.exist(o)){const e=L.Is.exist(o.transmissionFactor)?o.transmissionFactor:0;t.setParameter(b.f5.TransmissionFactor,e);const i=o.transmissionTexture;if(L.Is.exist(i)){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.TransmissionTexture,e,o)}return!0}return!1}(o,t,n);i.transmission||(i.transmission=m),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_volume;if(L.Is.exist(o)){const e=o.thicknessFactor?o.thicknessFactor:0;null!=e&&t.setParameter(b.f5.ThicknessFactor,e);const i=o.thicknessTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.ThicknessTexture,e,o)}const r=o.attenuationDistance?o.attenuationDistance:0;null!=r&&t.setParameter(b.f5.AttenuationDistance,r);const s=o.attenuationColor?a.P.fromCopyArray3(o.attenuationColor):a.P.fromCopy3(1,1,1);null!=s&&t.setParameter(b.f5.AttenuationColor,s)}}(o,t,n),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_sheen;if(L.Is.exist(o)){const e=L.Is.exist(o.sheenColorFactor)?o.sheenColorFactor:[0,0,0];t.setParameter(b.f5.SheenColorFactor,a.P.fromCopyArray3(e));const i=o.sheenColorTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.SheenColorTexture,e,o)}const r=L.Is.exist(o.sheenRoughnessFactor)?o.sheenRoughnessFactor:0;t.setParameter(b.f5.SheenRoughnessFactor,r);const s=o.sheenRoughnessTexture;if(null!=s){const e=W._createTexture(s.texture,n),i=W._createSampler(s.texture);t.setTextureParameter(b.f5.SheenRoughnessTexture,e,i)}}}(o,t,n),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_specular;if(L.Is.exist(o)){const e=L.Is.exist(o.specularFactor)?o.specularFactor:1;t.setParameter(b.f5.SpecularFactor,e);const i=o.specularTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.SpecularTexture,e,o)}const r=L.Is.exist(o.SpecularColorFactor)?o.SpecularColorFactor:[1,1,1];t.setParameter(b.f5.SpecularColorFactor,a.P.fromCopyArray3(r));const s=o.SpecularColorTexture;if(null!=s){const e=W._createTexture(s.texture,n),i=W._createSampler(s.texture);t.setTextureParameter(b.f5.SpecularColorTexture,e,i)}}}(o,t,n),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_ior;if(L.Is.exist(o)){const e=L.Is.exist(o.ior)?o.ior:1.5;t.setParameter(b.f5.Ior,e)}}(o,t),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_iridescence;if(L.Is.exist(o)){const e=L.Is.exist(o.iridescenceFactor)?o.iridescenceFactor:0;t.setParameter(b.f5.IridescenceFactor,e);const i=o.iridescenceTexture;if(null!=i){const e=W._createTexture(i.texture,n),o=W._createSampler(i.texture);t.setTextureParameter(b.f5.IridescenceTexture,e,o)}const a=L.Is.exist(o.iridescenceIor)?o.iridescenceIor:1.3;t.setParameter(b.f5.IridescenceIor,a);const r=L.Is.exist(o.iridescenceThicknessMinimum)?o.iridescenceThicknessMinimum:100;t.setParameter(b.f5.IridescenceThicknessMinimum,r);const s=L.Is.exist(o.iridescenceThicknessMaximum)?o.iridescenceThicknessMaximum:400;t.setParameter(b.f5.IridescenceThicknessMaximum,s);const l=o.iridescenceThicknessTexture;if(null!=l){const e=W._createTexture(l.texture,n),i=W._createSampler(l.texture);t.setTextureParameter(b.f5.IridescenceThicknessTexture,e,i)}}}(o,t,n),function(e,t,n){var i;const o=null===(i=null==e?void 0:e.extensions)||void 0===i?void 0:i.KHR_materials_anisotropy;if(L.Is.exist(o)){const e=L.Is.exist(o.anisotropyStrength)?o.anisotropyStrength:0;t.setParameter(b.f5.AnisotropyStrength,e);const i=L.Is.exist(o.anisotropyRotation)?o.anisotropyRotation:0;t.setParameter(b.f5.AnisotropyRotation,E.FM.fromCopy2(Math.cos(i),Math.sin(i)));const a=o.anisotropyTexture;if(null!=a){const e=W._createTexture(a.texture,n),i=W._createSampler(a.texture);t.setTextureParameter(b.f5.AnisotropyTexture,e,i)}}}(o,t,n),function(e,t,n){W._setupTextureTransform(e,t,b.f5.BaseColorTextureTransform,b.f5.BaseColorTextureRotation),W._setupTextureTransform(n,t,b.f5.MetallicRoughnessTextureTransform,b.f5.MetallicRoughnessTextureRotation)}(c,t,d)}(S,x,n,I,o);else{let e=T.D.Phong.index;if(null===(s=null==o?void 0:o.extras)||void 0===s?void 0:s.technique){switch(o.extras.technique){case T.D.Constant.str:e=T.D.Constant.index;break;case T.D.Lambert.str:e=T.D.Lambert.index;break;case T.D.BlinnPhong.str:e=T.D.BlinnPhong.index;break;case T.D.Phong.str:e=T.D.Phong.index}x.setParameter(b.f5.ShadingModel,D.Ru.fromCopyNumber(e))}}const C=y?[0,0,0]:null==o?void 0:o.emissiveFactor;null!=C&&x.setParameter(b.f5.EmissiveFactor,a.P.fromCopyArray3(C));const w=null==o?void 0:o.emissiveTexture;if(null!=w&&L.Is.falsy(y)){const e=W._createTexture(w.texture,n),t=W._createSampler(w.texture);x.setTextureParameter(b.f5.EmissiveTexture,e,t),parseFloat(null===(l=n.asset)||void 0===l?void 0:l.version)>=2&&null!=w.texCoord&&x.setParameter(b.f5.EmissiveTexcoordIndex,w.texCoord),W._setupTextureTransform(w,x,b.f5.EmissiveTextureTransform,b.f5.EmissiveTextureRotation)}let R=null==o?void 0:o.alphaMode;(null==I?void 0:I.alphaMode)&&(R=I.alphaMode),null!=R&&(x.alphaMode=g.F.fromGlTFString(R),x.alphaMode!==g.F.Mask||(null===(_=null===(c=n.asset.extras)||void 0===c?void 0:c.rnLoaderOptions)||void 0===_?void 0:_.__isImportVRM0x)||x.setParameter(b.f5.AlphaCutoff,D.Ru.fromCopyNumber(null!==(h=null==o?void 0:o.alphaCutoff)&&void 0!==h?h:.5))),L.Is.exist(null===(u=null==o?void 0:o.extensions)||void 0===u?void 0:u.KHR_materials_transmission)&&(x.alphaMode=g.F.Translucent);const P=null==o?void 0:o.doubleSided;if(null!=P&&(x.cullFace=!P),L.Is.exist(o.diffuseColorTexture)){const e=o.diffuseColorTexture,t=W._createTexture(e,n,{autoDetectTransparency:null==I?void 0:I.autoDetectTextureTransparency}),i=W._createSampler(e);if(x.setTextureParameter(b.f5.DiffuseColorTexture,t,i),this._checkRnGltfLoaderOptionsExist(n)&&(null===(m=null===(d=n.asset.extras)||void 0===d?void 0:d.rnLoaderOptions)||void 0===m?void 0:m.loaderExtension)){const t=n.asset.extras.rnLoaderOptions.loaderExtension;t.setUVTransformToTexture&&t.setUVTransformToTexture(x,e.samplerObject)}}if(L.Is.exist(null==o?void 0:o.diffuseColorFactor)){const e=null==o?void 0:o.diffuseColorFactor;x.setParameter(b.f5.DiffuseColorFactor,p.Lt.fromCopyArray4(e))}const M=null==o?void 0:o.normalTexture;if(null!=M&&L.Is.falsy(y)){const e=W._createTexture(M.texture,n),t=W._createSampler(M.texture);x.setTextureParameter(b.f5.NormalTexture,e,t),parseFloat(null===(f=n.asset)||void 0===f?void 0:f.version)>=2&&(null!=M.texCoord&&x.setParameter(b.f5.NormalTexcoordIndex,M.texCoord),null!=M.scale&&x.setParameter(b.f5.NormalScale,M.scale))}if(W._setupTextureTransform(M,x,b.f5.NormalTextureTransform,b.f5.NormalTextureRotation),this._checkRnGltfLoaderOptionsExist(n)){const e=null===(A=null===(v=n.asset.extras)||void 0===v?void 0:v.rnLoaderOptions)||void 0===A?void 0:A.loaderExtension;null!=(null==e?void 0:e.setupMaterial)&&e.setupMaterial(n,o,x)}return x}static _createSampler(e){var t,n,i,o;const a=new Q.Z({magFilter:L.Is.exist(null===(t=e.samplerObject)||void 0===t?void 0:t.magFilter)?N.d.from(e.samplerObject.magFilter):N.d.Linear,minFilter:L.Is.exist(null===(n=e.samplerObject)||void 0===n?void 0:n.minFilter)?N.d.from(e.samplerObject.minFilter):N.d.Linear,wrapS:L.Is.exist(null===(i=e.samplerObject)||void 0===i?void 0:i.wrapS)?N.d.from(e.samplerObject.wrapS):N.d.Repeat,wrapT:L.Is.exist(null===(o=e.samplerObject)||void 0===o?void 0:o.wrapT)?N.d.from(e.samplerObject.wrapT):N.d.Repeat});return a.create(),a}static _createTexture(e,t,{autoDetectTransparency:n=!1}={}){var i,o,a,r,s,l,c;const _=null===(i=t.asset.extras)||void 0===i?void 0:i.rnLoaderOptions,h=new f.x;h.autoDetectTransparency=n,h.autoResize=!0===(null==_?void 0:_.autoResizeTexture);const u={magFilter:L.Is.exist(null===(o=e.samplerObject)||void 0===o?void 0:o.magFilter)?N.d.from(e.samplerObject.magFilter):N.d.Linear,minFilter:L.Is.exist(null===(a=e.samplerObject)||void 0===a?void 0:a.minFilter)?N.d.from(e.samplerObject.minFilter):N.d.Linear,wrapS:L.Is.exist(null===(r=e.samplerObject)||void 0===r?void 0:r.wrapS)?N.d.from(e.samplerObject.wrapS):N.d.Repeat,wrapT:L.Is.exist(null===(s=e.samplerObject)||void 0===s?void 0:s.wrapT)?N.d.from(e.samplerObject.wrapT):N.d.Repeat},d=e.image;if(d.image){const e=d.image;!(null===(l=B.F.getWebGLResourceRepository().currentWebGLContextWrapper)||void 0===l?void 0:l.isWebGL2)&&!this.__sizeIsPowerOfTwo(e)&&this.__needResizeToPowerOfTwoOnWebGl1(u)&&(h.autoResize=!0),h.generateTextureFromImage(e),h.loadFromImgLazy()}else d.basis?h.generateTextureFromBasis(d.basis,{}):d.ktx2&&h.generateTextureFromKTX2(d.ktx2);if(d.uri)h.name=d.uri;else{const e=null===(c=d.mimeType)||void 0===c?void 0:c.split("/")[1];h.name=d.name+`.${e}`}return h}static __needResizeToPowerOfTwoOnWebGl1(e){return e.wrapS!==N.d.ClampToEdge||e.wrapT!==N.d.ClampToEdge||e.minFilter!==N.d.Linear&&e.minFilter!==N.d.Nearest}static __sizeIsPowerOfTwo(e){const t=e.width,n=e.height;return 0==(t&t-1)&&0==(n&n-1)}static __needParameterInitialization(e,t){return null!=e&&(null!=t.match(/PbrUber/)||null!=t.match(/ClassicUber/))}static _checkRnGltfLoaderOptionsExist(e){var t;return!!(null===(t=e.asset.extras)||void 0===t?void 0:t.rnLoaderOptions)}static __rewrapWithTypedArray(e,t,n,i){return new e(t.buffer,n+t.byteOffset,i)}static _checkBytesPerComponent(e){let t=0;switch(e.componentType){case 5120:case 5121:t=1;break;case 5122:case 5123:t=2;break;case 5124:case 5125:case 5126:t=4}return t}static _checkComponentNumber(e){let t=0;switch(e.type){case"SCALAR":t=1;break;case"VEC2":t=2;break;case"VEC3":t=3;break;case"VEC4":t=4;break;case"MAT4":t=16}return t}static _checkDataViewMethod(e){let t="";switch(e.componentType){case 5120:t="getInt8";break;case 5121:t="getUint8";break;case 5122:t="getInt16";break;case 5123:t="getUint16";break;case 5124:t="getInt32";break;case 5125:t="getUint32";break;case 5126:t="getFloat32"}return t}static _isSystemLittleEndian(){return!!new Uint8Array(new Uint16Array([255]).buffer)[0]}static _readBinaryFromAccessorAndSetItToAccessorExtras(e,t){var n,i,o;const a=e.bufferViewObject;let r=(null!==(n=a.byteOffset)&&void 0!==n?n:0)+(null!==(i=e.byteOffset)&&void 0!==i?i:0),s=a.bufferObject.buffer;const l=this._checkComponentNumber(e),c=this._checkBytesPerComponent(e),_=this._checkDataViewMethod(e);L.Is.not.exist(e.extras)&&(e.extras={attributeName:"",toGetAsTypedArray:!0,typedDataArray:new Float32Array,componentN:0,componentBytes:4,dataViewMethod:""}),e.extras.componentN=L.Is.exist(null===(o=e.extras)||void 0===o?void 0:o.weightsArrayLength)?e.extras.weightsArrayLength:l,e.extras.componentBytes=c,e.extras.dataViewMethod=_;const h=c*l*e.count;if(L.Is.exist(t)){const n=t[e.bufferViewObject.buffer],i=this.__getRnBufferView(a,n);s=this.__getRnAccessor(e,i).getUint8Array(),r=0}let u=new Float32Array;const d=[];if(W._isSystemLittleEndian()){let e=new Float32Array;"getFloat32"===_?e=this.__rewrapWithTypedArray(Float32Array,s,r,h/c):"getInt8"===_?e=new Int8Array(s,r,h/c):"getUint8"===_?e=new Uint8Array(s,r,h/c):"getInt16"===_?e=this.__rewrapWithTypedArray(Int16Array,s,r,h/c):"getUint16"===_?e=this.__rewrapWithTypedArray(Uint16Array,s,r,h/c):"getInt32"===_?e=this.__rewrapWithTypedArray(Int32Array,s,r,h/c):"getUint32"===_&&(e=this.__rewrapWithTypedArray(Uint32Array,s,r,h/c)),u=this.__normalizeTypedArrayToFloat32Array(_,e)}else{const t=new DataView(s.buffer,r+s.byteOffset,h),n=c*l,i=!0;for(let o=0;o{if(L.Is.exist(t.children))for(const a of t.children){const t=n[a];L.Is.exist(t)&&(o.getSceneGraph().addChild(t.getSceneGraph()),i(e.nodes[a],t))}};for(const i of e.nodes)if(L.Is.exist(i.skinObject)){const e=i.skinObject.joints;for(const i of e){const e=t[i],o=z._.createGroupEntity();o.getTransform().localMatrix=e.getTransform().localMatrix,n[i]=o}}for(const t of e.nodes)if(L.Is.exist(t.skinObject)){const e=n[t.skinObject.joints[0]];i(t.skinObject.jointsObjects[0],e)}for(let i=0;i{"use strict";n.d(t,{z:()=>c});var i=n(7015),o=n(1409),a=n(1350),r=n(1296),s=n(3449),l=n(4690);class c{static importBillboard(e,t){if(!l.Is.not.exist(e.extensionsUsed)&&-1!==e.extensionsUsed.findIndex((e=>"RHODONITE_billboard"===e)))for(const n in e.nodes){const i=t[n],o=e.nodes[n],a=i.getSceneGraph();void 0!==o.extensions&&void 0!==o.extensions.RHODONITE_billboard&&!0===o.extensions.RHODONITE_billboard.isBillboard&&(a.isBillboard=!0)}}static importEffect(e,t){if(l.Is.not.exist(e.extensions)||l.Is.not.exist(e.extensions.RHODONITE_effekseer)||-1===e.extensionsUsed.findIndex((e=>"RHODONITE_effekseer"===e)))return;const o=t.getTagValue("rnEntities"),r=e.extensions.RHODONITE_effekseer.effects;for(const t of r){const r=o[t.node],c=a.g.addComponentToEntity(i.D,r),h=c.getEffekseer();h.playJustAfterLoaded=!0,h.isLoop=!0,l.Is.exist(t.bufferView)?e.buffers[0].bufferPromise.then((n=>{const i=s.j.createUint8ArrayFromBufferViewInfo(e,t.bufferView,n);h.arrayBuffer=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),h.type="efkpkg"})):l.Is.exist(t.uri)?(h.uri=t.uri,h.type="efk"):console.error("No real effect data."),_(c,t);const u=n(6893).Zlib.Unzip;i.D.Unzip=u}}}function _(e,t){const n=e.getComponentByComponentTID(o.zz.EffekseerComponentTID);if(l.Is.exist(n)&&(n.playJustAfterLoaded=!0,n.isLoop=!0,l.Is.exist(t.timelines))){const n=t.timelines;for(const t of n){const n=t.values,i=t.name,s=n.map((e=>({input:e.input,event:e.event})));let c,_=e.tryToGetAnimation();l.Is.not.exist(_)&&(c=a.g.addComponentToEntity(o.cw,e)),_=c.getAnimation(),_.setAnimation(l.Is.exist(i)?i:"Default","effekseer",new Float32Array(s.map((e=>e.input))),new Float32Array(s.map((e=>"play"===e.event?1:(e.event,0)))),1,r.kO.Step,!0)}}}},8583:(e,t,n)=>{"use strict";n.d(t,{mNG:()=>M.mN,qfN:()=>xe.qf,lam:()=>r.l,bCT:()=>M.bC,mC0:()=>i.m,PxB:()=>Ct.P,XAY:()=>M.XA,lJH:()=>M.lJ,VI2:()=>wt,yEY:()=>Kn.y,OxW:()=>M.Ox,U_s:()=>Ln.U,yd$:()=>Gt,FvO:()=>f.Fv,tVY:()=>Ye,sdx:()=>f.sd,cwg:()=>r.cw,kOi:()=>f.kO,Sy_:()=>zt,JRY:()=>Vt,RDh:()=>re,l6R:()=>f.l6,xTt:()=>r.xT,afv:()=>Ut,fgK:()=>Qt,Nh_:()=>f.Nh,lWr:()=>Fn.l,$HW:()=>f.$H,qP0:()=>Gn.q,FOu:()=>Be.F,CtF:()=>be.Ct,Myt:()=>r.My,SPq:()=>r.SP,MyC:()=>f.My,iM5:()=>f.iM,zmi:()=>vt,h_U:()=>pn.h,sZ3:()=>M.sZ,tWC:()=>M.tW,et4:()=>fe,wA2:()=>s.w,C2e:()=>l.C,reR:()=>f.re,dh2:()=>f.dh,bfi:()=>f.bf,DeH:()=>c.D,SGm:()=>M.SG,zUz:()=>M.zU,igI:()=>M.ig,HOX:()=>M.HO,R1o:()=>M.R1,p8_:()=>M.p8,GYQ:()=>M.GY,cV0:()=>M.cV,n9W:()=>M.n9,GFx:()=>Xt,Xv:()=>se.X,BtG:()=>Vn.B,fZl:()=>vn.f,j4H:()=>be.j4,kTl:()=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ZzZ:()=>be.Zz,Z65:()=>be.Z6,UDi:()=>be.UD,Kyk:()=>f.Ky,U28:()=>be.U2,ABp:()=>be.AB,CTh:()=>Z,OHV:()=>w,j37:()=>be.j3,vAU:()=>r.vA,LSm:()=>be.LS,Dhi:()=>tt,jeP:()=>nt,CWu:()=>be.CW,$z2:()=>be.$z,Lx$:()=>Ft.Lx,pnp:()=>Ft.pn,mge:()=>Ft.mg,$RV:()=>Ft.$R,GVY:()=>Ft.GV,Dx8:()=>Ft.Dx,OTk:()=>A,nnL:()=>M.nn,w08:()=>M.w0,GWg:()=>M.GW,t5w:()=>M.t5,vk8:()=>M.vk,PFe:()=>M.PF,Ffi:()=>M.Ff,Upt:()=>M.Up,Dq2:()=>M.Dq,VIV:()=>M.VI,hxV:()=>M.hx,JIQ:()=>M.JI,EYp:()=>jn.EY,fKE:()=>M.fK,lxk:()=>M.lx,tSN:()=>be.tS,JxS:()=>be.WF,t0P:()=>be.t0,fK9:()=>be.fK,OBD:()=>be.OB,bhs:()=>be.bh,ZsA:()=>be.Zs,fYc:()=>be.fY,eD0:()=>be.eD,Cb2:()=>Ft.Cb,iCj:()=>qn.iC,lsI:()=>qn.ls,QjB:()=>be.Qj,nsy:()=>M.ns,p8g:()=>M.eI,n5i:()=>M.n5,QUJ:()=>M.QU,XgD:()=>M.Xg,vVE:()=>be.vV,YUA:()=>be.YU,ozT:()=>be.oz,EY5:()=>be.EY,Rlh:()=>M.Rl,_7O:()=>M._7,NBV:()=>Ft.NB,PjQ:()=>qn.Pj,wv6:()=>be.wv,kSU:()=>be.kS});var i=n(3658),o=n(6547),a=n(4478),r=n(1409),s=n(9721),l=n(2404),c=n(3258),_=n(1328),h=n(1350),u=n(7348),d=n(9286),m=n(9002),f=n(1296);const p=Symbol();class v{constructor(e){this.__raw=e}}Object.defineProperty(v.prototype,"getComponentFromEntities",{enumerable:!1,writable:!1,configurable:!0,value:function(e){const t=this.__raw,n=[];return t.forEach((t=>{const i=t.getComponentByComponentTID(e.componentTID);null!=i&&n.push(i)})),n}});const A=()=>{Object.defineProperty(Array.prototype,"Rn",{enumerable:!1,configurable:!1,get(){return new v(this)}})};var y=n(4587),x=n(4690),g=n(4350),I=n(3999),b=n(3449),E=n(7461),T=n(810),S=n(8491),C=n(4710);function w(e,t){let n=!1;const i=e.extras.bufferViewByteLengthAccumulatedArray.length-1,o=[];for(let a=0;a.5?"play":"pause"};o.push(i)}const a={name:t,values:o};i.push(a)}}}t.timelines=i}}var P=n(7192),M=n(4020);const D=n(5337).Z,N="glTF",B="glTF-Binary",L="glTF-Draco",F="glTF-Embedded",G="No-Download";class z{constructor(){}static async export(e,t={entities:void 0,type:B}){const{collectedEntities:n,topLevelEntities:i}=this.__collectEntities(t),{json:o,fileName:a}=this.__createJsonBase(e);this.__createBufferViewsAndAccessors(o,n),this.__createNodes(o,n,i),await this.__createMaterials(o,n,t),w(o,n);const r=this.__createBinary(o);this.__deleteEmptyArrays(o);const s=function(e,t){delete e.buffers[0].uri;let n=JSON.stringify(e,null,2),i=b.j.stringToBuffer(n);const o=b.j.calcPaddingBytes(i.byteLength,4);if(o>0){for(let e=0;e{if(x.Is.exist(e)&&x.Is.exist(e.excludeTags)){for(const n of e.excludeTags)if(t.matchTag(n.tag,n.value))return!1;if(t.matchTag("Being","gizmo"))return!0}return!0},n=t=>{if(x.Is.exist(e)&&x.Is.exist(e.excludeTags))for(const n of e.excludeTags)if(t.matchTag(n.tag,n.value))return[];return[t]},i=(e,t)=>{const o=e.getSceneGraph();if(o.children.length>0){const a=t?[]:n(e);for(let e=0;e0){const n=e.entities.flatMap((e=>i(e,!0)));let o=[];e.entities.forEach((e=>{-1===n.indexOf(e)&&t(e)&&o.push(e)}));let a=e.entities.concat();return Array.prototype.push.apply(a,n),a=[...new Set(a)],0===o.length&&(o=a),{collectedEntities:a,topLevelEntities:o}}let o=h.g._getEntities();o=o.filter((e=>t(e)));let a=S.a.getTopLevelComponents().flatMap((e=>e.entity));return a=a.filter((e=>t(e))),o=o.flatMap((e=>i(e,!0))),Array.prototype.push.apply(o,a),o=[...new Set(o)],{collectedEntities:o,topLevelEntities:a}}static __createJsonBase(e){const t=e||"Rhodonite_"+(new Date).getTime();return{json:{asset:{version:"2.0",generator:`Rhodonite (${D.version})`},buffers:[{uri:t+".bin",byteLength:0}],bufferViews:[],accessors:[],animations:[],meshes:[],skins:[],materials:[{pbrMetallicRoughness:{baseColorFactor:[1,1,1,1]}}],textures:[],images:[],extensionsUsed:[],extensions:{},extras:{rnSkins:[],bufferViewByteLengthAccumulatedArray:[]},cameras:[],samplers:[]},fileName:t}}static __createBufferViewsAndAccessors(e,t){const n=[],i=[],o=[];!function(e,t,n,i,o){for(let a=0;a{e.entity===t&&l.push(n)}));const c=r.getInverseBindMatricesAccessor();x.Is.exist(c)&&(te(e,n,i,c.bufferView),ne(e,e.bufferViews.length-1,o,c));const _=r.topOfJointsHierarchy,h=r._bindShapeMatrix;let u=-1;if(x.Is.exist(_)){const e=_.entity;u=t.indexOf(e)}else u=l[0];const d={joints:l,inverseBindMatrices:e.accessors.length-1,skeleton:u>=0?u:void 0,bindShapeMatrix:null==h?void 0:h.flattenAsArray()};e.skins.push(d)}}(e,t,n,i,o)}static __createNodes(e,t,n){e.nodes=[],e.scenes=[{nodes:[]}];const i=e.scenes[0];for(let e=0;e0){a.children=[];for(let e=0;e0&&(a.weights=e)}const h=i.tryToGetSkeletal();if(x.Is.exist(h)){const t=e.extras.rnSkins.indexOf(h.entity);t>=0&&(a.skin=t)}const u=i.tryToGetCamera();if(x.Is.exist(u)){let t;if(u.type===f.iM.Perspective){const e=u.getTagValue("OriginalAspect"),n=u.getTagValue("OriginalFovY");t={name:u.entity.uniqueName,type:"perspective",perspective:{aspectRatio:x.Is.exist(e)?e:u.aspect,yfov:x.Is.exist(n)?M.kj.degreeToRadian(n):M.kj.degreeToRadian(u.fovy),znear:u.zNear,zfar:u.zFar}}}else if(u.type===f.iM.Orthographic){const e=u.getTagValue("OriginalXMag"),n=u.getTagValue("OriginalYMag");t={name:u.entity.uniqueName,type:"orthographic",orthographic:{xmag:x.Is.exist(e)?e:u.xMag,ymag:x.Is.exist(n)?n:u.yMag,znear:u.zNear,zfar:u.zFar}}}e.cameras.push(t),a.camera=e.cameras.length-1}}n.forEach(((e,n)=>{const o=t.indexOf(e);o>=0&&i.nodes.push(o)}))}static async __createMaterials(e,t,n){let i=0;const o=[];e.extras.bufferViewByteLengthAccumulatedArray.push(0);const a=e.extras.bufferViewByteLengthAccumulatedArray.length-1;for(let r=0;r{if(i&&i.width>1&&i.height>1){let s=e.images.length,l=!1;for(let t=0;t(0,g.C)(t,e))),-1===c&&(e.samplers.push(t),c=e.samplers.length-1)}if(!l){const r={uri:i.name};r.rnTextureUID=i.textureUID,-1!==t.indexOf(i.name)&&(r.uri+="_"+i.textureUID),t.push(r.uri),x.Is.not.exist(r.uri.match(/\.(png)/))&&(r.uri+=".png");const s=i.htmlCanvasElement;if(s){const t=new Promise(((t,i)=>{s.toBlob((o=>{if(!x.Is.exist(o))throw Error("canvas to blob error!");J(e,a,o,n,r,t,i)}))}));o.push(t)}e.images.push(r)}const _={sampler:c,source:s};return-1===e.textures.indexOf(_)&&e.textures.push(_),e.textures.indexOf(_)}};let r,s=c.getParameter(y.f5.BaseColorTexture);if(null!=s)r=i(s[1],s[2]),null!=r&&(_.pbrMetallicRoughness.baseColorTexture={index:r});else if(s=c.getParameter(y.f5.DiffuseColorTexture),null!=s){const e=i(s[1],s[2]);null!=e&&(_.pbrMetallicRoughness.diffuseColorTexture={index:e})}s=c.getParameter(y.f5.MetallicRoughnessTexture),s&&(r=i(s[1],s[2]),null!=r&&(_.pbrMetallicRoughness.metallicRoughnessTexture={index:r})),s=c.getParameter(y.f5.NormalTexture),s&&(r=i(s[1],s[2]),null!=r&&(_.normalTexture={index:r})),s=c.getParameter(y.f5.OcclusionTexture),s&&(r=i(s[1],s[2]),null!=r&&(_.occlusionTexture={index:r})),s=c.getParameter(y.f5.EmissiveTexture),s&&(r=i(s[1],s[2]),null!=r&&(_.emissiveTexture={index:r}))}-1===e.materials.indexOf(_)&&e.materials.push(_),l.material=e.materials.indexOf(_)}}}return Promise.all(o)}static __createBinary(e){if(x.Is.undefined(e.accessors)||x.Is.undefined(e.bufferViews))return new ArrayBuffer(0);const t=e.extras.bufferViewByteLengthAccumulatedArray.reduce(((e,t)=>e+t));t>0&&(e.buffers[0].byteLength=t+b.j.calcPaddingBytes(t,4));const n=new ArrayBuffer(e.buffers[0].byteLength);let i=0;for(let t=0;te.isSame(t)))}function k(e,t){0===e.length&&e.push(t);const n=e.findIndex((e=>e.isSame(t))),i=-1===n?e.length:n;return-1===n&&e.push(t),i}function Q(e,t,n){return x.Is.exist(e[t])?e[t]+b.j.addPaddingBytes(n.byteLength,4):b.j.addPaddingBytes(n.byteLength,4)}function W(e){switch(e){case"translate":return"translation";case"quaternion":return"rotation";case"scale":return"scale";case"weights":return"weights";default:throw new Error("Invalid Path Name")}}function X(e,t,n,i){const o={sampler:t++,target:{path:W(e.target.pathName),node:i}};return n.channels.push(o),t}function q(e,t,n,i){const o={input:e,output:t,interpolation:n.sampler.interpolationMethod.GltfString};i.samplers.push(o)}function H(e,t,n,i){const o=I.r.fromTypedArray(ArrayBuffer.isView(t.sampler.input)?t.sampler.input:new Float32Array(t.sampler.input)),a=t.sampler.input.length,r=$({bufferIdx:n,bufferViewByteOffset:i,accessorByteOffset:0,accessorCount:a,bufferViewByteStride:I.r.Float.getSizeInBytes(),componentType:o,compositionType:T.d.Scalar,uint8Array:new Uint8Array(ArrayBuffer.isView(t.sampler.input)?t.sampler.input.buffer:new Float32Array(t.sampler.input).buffer)});e.bufferViews.push(r);const s=ee({bufferViewIdx:e.bufferViews.indexOf(r),accessorByteOffset:0,componentType:o,count:a,compositionType:T.d.Scalar,min:[t.sampler.input[0]],max:[t.sampler.input[t.sampler.input.length-1]]});return e.accessors.push(s),i=Y(0,r),{inputAccessorIdx:e.accessors.indexOf(s),inputBufferViewByteLengthAccumulated:i}}function j(e,t,n,i){const o=I.r.fromTypedArray(ArrayBuffer.isView(t.sampler.output)?t.sampler.output:new Float32Array(t.sampler.output)),a=t.target.pathName;let r=T.d.toGltf2AnimationAccessorCompositionType(t.sampler.outputComponentN),s=t.sampler.output.length/t.sampler.outputComponentN;"weights"===a&&(r=T.d.Scalar,s=t.sampler.output.length);const l=$({bufferIdx:n,bufferViewByteOffset:i,accessorByteOffset:0,accessorCount:s,bufferViewByteStride:o.getSizeInBytes()*t.sampler.outputComponentN,componentType:o,compositionType:r,uint8Array:new Uint8Array(ArrayBuffer.isView(t.sampler.output)?t.sampler.output.buffer:new Float32Array(t.sampler.output).buffer)});e.bufferViews.push(l);const c=ee({bufferViewIdx:e.bufferViews.indexOf(l),accessorByteOffset:0,componentType:o,count:s,compositionType:r});return e.accessors.push(c),i=Y(0,l),{outputAccessorIdx:e.accessors.indexOf(c),outputBufferViewByteLengthAccumulated:i}}function Y(e,t){return t.byteLength+b.j.calcPaddingBytes(t.byteLength,4)}function K(e){return e%4==0?e:e+(4-e%4)}async function J(e,t,n,i,o,a,r){if(i.type===N)setTimeout((()=>{const e=document.createElement("a"),t=new MouseEvent("click");e.href=URL.createObjectURL(n),e.download=o.uri,e.dispatchEvent(t),URL.revokeObjectURL(e.href)}),5e3*Math.random()),a();else{const i=new FileReader;i.addEventListener("load",(()=>{const n=i.result,r=Z(e,t,new Uint8ClampedArray(n));o.bufferView=e.bufferViews.indexOf(r),o.mimeType="image/png",delete o.uri,a()})),i.addEventListener("error",(()=>{r(i.error)})),i.readAsArrayBuffer(n)}}function Z(e,t,n){const i=e.extras.bufferViewByteLengthAccumulatedArray[t],o={buffer:t,byteLength:n.byteLength,byteOffset:i,extras:{uint8Array:n}},a=b.j.addPaddingBytes(o.byteLength,4)+i;return e.bufferViews.push(o),e.extras.bufferViewByteLengthAccumulatedArray[t]=a,o}function $({bufferIdx:e,bufferViewByteOffset:t,accessorByteOffset:n,accessorCount:i,bufferViewByteStride:o,componentType:a,compositionType:r,uint8Array:s}){const l=K(n),{fixedBufferViewByteLength:c,fixedBufferViewByteOffset:_}=function({accessorByteOffset:e,accessorCount:t,bufferViewByteStride:n,bufferViewByteOffset:i,sizeOfComponent:o,numberOfComponents:a}){const r=0===n?o*a:n;if(n%o!=0)throw Error("glTF2: When byteStride is defined, it MUST be a multiple of the size of the accessor’s component type.");const s=(_=r)%4==0?_:_+(4-_%4),l=K(e),c=o*a;var _;return{fixedBufferViewByteLength:l+s*(t-1)+o*a,fixedBufferViewByteOffset:K(i+(c-(l+i)%c))}}({accessorByteOffset:l,accessorCount:i,bufferViewByteStride:o,bufferViewByteOffset:t,sizeOfComponent:a.getSizeInBytes(),numberOfComponents:r.getNumberOfComponents()});return{buffer:e,byteLength:c,byteOffset:_,extras:{uint8Array:s}}}function ee({bufferViewIdx:e,accessorByteOffset:t,componentType:n,count:i,compositionType:o,min:a,max:r}){return{bufferView:e,byteOffset:K(t),componentType:I.r.toGltf2AccessorComponentType(n),count:i,type:o.str,min:a,max:r,extras:{}}}function te(e,t,n,i,o){const a=U(n,i);if(-1===a){const a=k(t,i.buffer),r={buffer:a,byteLength:i.byteLength,byteOffset:i.byteOffsetInBuffer,extras:{uint8Array:i.getUint8Array()}};return x.Is.exist(o)&&(r.target=o),e.extras.bufferViewByteLengthAccumulatedArray[a]=Q(e.extras.bufferViewByteLengthAccumulatedArray,a,r),n.push(i),e.bufferViews.push(r),r}return e.bufferViews[a]}function ne(e,t,n,i){const o=function(e,t){return e.findIndex((e=>e.isSame(t)))}(n,i);if(-1===o){const o={bufferView:t,byteOffset:i.byteOffsetInBufferView,componentType:I.r.toGltf2AccessorComponentType(i.componentType),count:i.elementCount,type:T.d.toGltf2AccessorCompositionTypeString(i.compositionType.getNumberOfComponents()),extras:{uint8Array:void 0}};return i.compositionType.getNumberOfComponents()<=4&&(o.max=i.max,o.min=i.min),n.push(i),e.accessors.push(o),o}return e.accessors[o]}var ie=n(128),oe=n(8696),ae=n(3713);class re extends ae.A{generate(e){var t;const n={length:null!==(t=e.length)&&void 0!==t?t:1,material:e.material},i=[new Float32Array([0,0,0,n.length,0,0,0,0,0,0,n.length,0,0,0,0,0,0,n.length]),new Float32Array([1,0,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,1])],o=[ie.T.Position.XYZ,ie.T.Color0.XYZ];this.copyVertexData({attributes:i,attributeSemantics:o,primitiveMode:oe.T.Lines,material:n.material})}}var se=n(7597);class le extends ae.A{generate(e){var t,n,i,o,a;const r={length:null!==(t=e.length)&&void 0!==t?t:1,division:null!==(n=e.division)&&void 0!==n?n:10,isXY:null===(i=e.isXY)||void 0===i||i,isXZ:null===(o=e.isXZ)||void 0===o||o,isYZ:null===(a=e.isYZ)||void 0===a||a,material:e.material},s=[];for(let e=0;e<2*r.division+3;e++){const t=-r.length,n=r.length/(r.division+1);r.isXZ&&(s.push(-r.length,0,t+n*e),s.push(r.length,0,t+n*e),s.push(t+n*e,0,-r.length),s.push(t+n*e,0,r.length)),r.isXY&&(s.push(-r.length,t+n*e,0),s.push(r.length,t+n*e,0),s.push(t+n*e,-r.length,0),s.push(t+n*e,r.length,0)),r.isYZ&&(s.push(0,-r.length,t+n*e),s.push(0,r.length,t+n*e),s.push(0,t+n*e,-r.length),s.push(0,t+n*e,r.length))}const l=[new Float32Array(s)],c=[ie.T.Position.XYZ];this.copyVertexData({attributes:l,attributeSemantics:c,primitiveMode:oe.T.Lines,material:null==r?void 0:r.material})}}var ce=n(2471);class _e extends ae.A{constructor(){super(...arguments),this.__worldPositionOfThisJoint=ce.P.fromCopyArray3([0,0,1]),this.__worldPositionOfParentJoint=ce.P.fromCopyArray3([0,0,0]),this.__width=1}generate(e){const t=ce.P.lengthBtw(this.__worldPositionOfThisJoint,this.__worldPositionOfParentJoint),n=this.__width,i=t-t/7.5,o=ce.P.subtract(this.__worldPositionOfParentJoint,this.__worldPositionOfThisJoint);let a=ce.P.fromCopyArray3([0,1,0]);o.isEqual(ce.P.zero())||(a=ce.P.normalize(ce.P.subtract(this.__worldPositionOfParentJoint,this.__worldPositionOfThisJoint)));const r=ce.P.add(this.__worldPositionOfThisJoint,ce.P.multiply(a,i));let s=ce.P.fromCopyArray3([0,1,0]),l=ce.P.fromCopyArray3([0,-1,0]);Math.abs(ce.P.dot(a,s))>.4&&(s=ce.P.fromCopyArray3([1,0,0]),l=ce.P.fromCopyArray3([-1,0,0])),Math.abs(ce.P.dot(a,s))>.4&&(s=ce.P.fromCopyArray3([0,0,1]),l=ce.P.fromCopyArray3([0,0,-1]));const c=ce.P.multiply(ce.P.normalize(ce.P.cross(a,s)),n),_=ce.P.multiply(ce.P.normalize(ce.P.cross(a,c)),n),h=ce.P.multiply(ce.P.normalize(ce.P.cross(a,l)),n),u=ce.P.multiply(ce.P.normalize(ce.P.cross(a,h)),n),d=ce.P.add(r,c),m=ce.P.add(r,_),f=ce.P.add(r,h),p=ce.P.add(r,u),v=[];v.push(this.__worldPositionOfThisJoint),v.push(d),v.push(this.__worldPositionOfThisJoint),v.push(m),v.push(this.__worldPositionOfThisJoint),v.push(f),v.push(this.__worldPositionOfThisJoint),v.push(p),v.push(d),v.push(m),v.push(m),v.push(f),v.push(f),v.push(p),v.push(p),v.push(d),v.push(this.__worldPositionOfParentJoint),v.push(d),v.push(this.__worldPositionOfParentJoint),v.push(m),v.push(this.__worldPositionOfParentJoint),v.push(f),v.push(this.__worldPositionOfParentJoint),v.push(p);const A=[];v.map((e=>{Array.prototype.push.apply(A,e.flattenAsArray())}));const y=[new Float32Array(A)],x=[ie.T.Position.XYZ];this.copyVertexData({attributes:y,attributeSemantics:x,primitiveMode:oe.T.Lines,material:null==e?void 0:e.material})}}class he extends ae.A{generate(e){var t,n,i;const o={startPos:null!==(t=e.startPos)&&void 0!==t?t:ce.P.fromCopy3(0,0,0),endPos:null!==(n=e.endPos)&&void 0!==n?n:ce.P.fromCopy3(1,0,0),hasTerminalMark:null===(i=e.hasTerminalMark)||void 0===i||i,material:e.material},a=[];if(a.push(...o.startPos.flattenAsArray()),a.push(...o.endPos.flattenAsArray()),o.hasTerminalMark){const e=.1*o.startPos.lengthTo(o.endPos);a.push(o.startPos.x-e,o.startPos.y,o.startPos.z),a.push(o.startPos.x+e,o.startPos.y,o.startPos.z),a.push(o.startPos.x,o.startPos.y,o.startPos.z-e),a.push(o.startPos.x,o.startPos.y,o.startPos.z+e),a.push(o.endPos.x-e,o.endPos.y,o.endPos.z),a.push(o.endPos.x+e,o.endPos.y,o.endPos.z),a.push(o.endPos.x,o.endPos.y,o.endPos.z-e),a.push(o.endPos.x,o.endPos.y,o.endPos.z+e)}const r=[new Float32Array(a)],s=[ie.T.Position.XYZ];this.copyVertexData({attributes:r,attributeSemantics:s,primitiveMode:oe.T.Lines,material:o.material})}}var ue=n(9561);class de extends ae.A{constructor(){super()}generate(e){var t,n,i;const o={radius:null!==(t=e.radius)&&void 0!==t?t:1,widthSegments:null!==(n=e.widthSegments)&&void 0!==n?n:10,heightSegments:null!==(i=e.heightSegments)&&void 0!==i?i:10,material:e.material},a=[],r=[],s=[];Math.abs(o.radius){const t=new ue.J;t.generate(e);const n=De(t);return be.Is.not.exist(e.direction)&&(e.direction="xz"),"xy"===e.direction?n.localEulerAngles=ce.P.fromCopy3(Math.PI/2,0,0):"yz"===e.direction&&(n.localEulerAngles=ce.P.fromCopy3(0,0,Math.PI/2)),n},createLine:(e={})=>{const t=new he;return t.generate(e),De(t)},createGrid:(e={})=>{const t=new le;return t.generate(e),De(t)},createCube:(e={})=>{var t;const n=new se.X;n.generate(e);const i=De(n);if(be.Is.exist(e.physics)&&e.physics.use){const n=h.g.addComponentToEntity(Ee.Z,i),o=n.getPhysics(),a=new Te.q,r={type:Me.Box,size:null!==(t=e.widthVector)&&void 0!==t?t:ce.P.fromCopy3(1,1,1),position:ce.P.fromCopy3(0,0,0),rotation:ce.P.fromCopy3(0,0,0),move:e.physics.move,density:e.physics.density,friction:e.physics.friction,restitution:e.physics.restitution};a.setShape(r,n),o.setStrategy(a)}return i},createCubes:(e,t={})=>{var n;const i=new se.X;i.generate(t);const o=new ve.K;o.addPrimitive(i);const a=[];for(let i=0;i{const t=new de;t.generate(e);const n=De(t);if(be.Is.exist(e.physics)&&e.physics.use){const t=h.g.addComponentToEntity(Ee.Z,n),i=t.getPhysics(),o=new Te.q,a={type:Me.Sphere,size:be.Is.exist(e.radius)?ce.P.fromCopy3(e.radius,e.radius,e.radius):ce.P.fromCopy3(1,1,1),position:ce.P.fromCopy3(0,0,0),rotation:ce.P.fromCopy3(0,0,0),move:e.physics.move,density:e.physics.density,friction:e.physics.friction,restitution:e.physics.restitution};o.setShape(a,t),i.setStrategy(o)}return n},createSpheres:(e,t={})=>{const n=new de;n.generate(t);const i=new ve.K;i.addPrimitive(n);const o=[];for(let n=0;n{const t=new _e;return t.generate(e),De(t)},createAxis:(e={})=>{const t=new re;return t.generate(e),De(t)},createShape:De});var Be=n(7987),Le=n(8422),Fe=n(4392);class Ge extends m.S{constructor(){super(),this.__colorAttachments=[],this.cgApiResourceUid=Be.F.InvalidCGAPIResourceUid,this.width=0,this.height=0,this.__colorAttachmentMap=new Map}get colorAttachmentsRenderBufferTargets(){return Array.from(this.__colorAttachmentMap.keys())}get colorAttachments(){return this.__colorAttachments}get depthAttachment(){return this.__depthAttachment}get stencilAttachment(){return this.__stencilAttachment}get depthStencilAttachment(){return this.__depthStencilAttachment}getColorAttachedRenderTargetTexture(e){return null!=this.__colorAttachments[e]&&this.__colorAttachments[e]instanceof Fe._?this.__colorAttachments[e]:void 0}getDepthAttachedRenderTargetTexture(){return this.__depthAttachment instanceof Fe._?this.__depthAttachment:void 0}create(e,t){this.width=e,this.height=t;const n=Be.F.getWebGLResourceRepository();return this.cgApiResourceUid=n.createFrameBufferObject(),this.cgApiResourceUid}get framebufferUID(){return this.cgApiResourceUid}setColorAttachmentAt(e,t){return t.width===this.width&&t.height===this.height&&(this.__colorAttachments[e]=t,Be.F.getWebGLResourceRepository().attachColorBufferToFrameBufferObject(this,e,t),this.__colorAttachmentMap.set(Le.G.from(e),t),!0)}setDepthAttachment(e){return e.width===this.width&&e.height===this.height&&(this.__depthAttachment=e,Be.F.getWebGLResourceRepository().attachDepthBufferToFrameBufferObject(this,e),!0)}setStencilAttachment(e){return e.width===this.width&&e.height===this.height&&(this.__stencilAttachment=e,Be.F.getWebGLResourceRepository().attachStencilBufferToFrameBufferObject(this,e),!0)}setDepthStencilAttachment(e){return e.width===this.width&&e.height===this.height&&(this.__depthStencilAttachment=e,Be.F.getWebGLResourceRepository().attachDepthStencilBufferToFrameBufferObject(this,e),!0)}resize(e,t){Be.F.getWebGLResourceRepository().deleteFrameBufferObject(this.cgApiResourceUid),this.cgApiResourceUid=Be.F.InvalidCGAPIResourceUid,this.width=0,this.height=0,this.create(e,t),this.depthAttachment&&(this.depthAttachment.resize(e,t),this.setDepthAttachment(this.depthAttachment)),this.depthStencilAttachment&&(this.depthStencilAttachment.resize(e,t),this.setDepthStencilAttachment(this.depthStencilAttachment)),this.stencilAttachment&&(this.stencilAttachment.resize(e,t),this.setStencilAttachment(this.stencilAttachment));for(let n=0;n0)for(const n of t.animations)for(const i of n.channels){const n=this.__getCorrespondingEntityWithVrma(e,t,i.target.node);if(n){const o=h.g.addComponentToEntity(qe.c,n).getAnimation(),a=t.extras.rnEntities[i.target.node],s=t.extensions.VRMC_vrm_animation.humanoidBoneNameMap.get(i.target.node);if(a.tryToSetUniqueName(s,!0),"0.x"===e.tryToGetVrm()._version){const e=new je.G(a);o.setAnimationRetarget(e)}else if("1.0"===e.tryToGetVrm()._version){const e=new r.B5(a);o.setAnimationRetarget(e)}}}return e}static getInstance(){return this.__instance||(this.__instance=new Ye),this.__instance}__getCorrespondingEntity(e,t,n,i,o,a){if(a){const n=e.getTagValue("rnEntitiesByNames"),o=t.nodes[i];return n.get(o.name)}if(x.Is.exist(n.extensions.VRM)){const t=n.extensions.VRM.humanoid.humanBones;let a;const r=new Map,s=new Map;for(const e of t)r.set(e.node,e.bone),s.set(e.name,e.bone);null!=o&&(a=s.get(o),null==a&&(a=r.get(i)));const l=e.getTagValue("humanoid_map_name_nodeId").get(a);if(null!=l)return e.getTagValue("rnEntities")[l];console.log(`humanoidBoneName: ${a}, nodeIndex: ${i}, nodeName: ${o}`)}else if(x.Is.exist(n.extensions.VRMC_vrm)){const t=n.extensions.VRMC_vrm.humanoid.humanBones;let a;const r=new Map;for(const e in t){const n=t[e];r.set(n.node,e)}null!=o&&(a=r.get(i));const s=e.getTagValue("humanoid_map_name_nodeId").get(a);if(null!=s)return e.getTagValue("rnEntities")[s];console.log(`humanoidBoneName: ${a}, nodeIndex: ${i}, nodeName: ${o}`)}}__getCorrespondingEntityWithVrma(e,t,n){const i=t.extensions.VRMC_vrm_animation.humanoidBoneNameMap.get(n),o=e.getTagValue("humanoid_map_name_nodeId").get(i);if(null!=o)return e.getTagValue("rnEntities")[o];console.log(`humanoidBoneName: ${i}, nodeIndex: ${n}`)}__isHips(e,t,n){const i=new Map;if(x.Is.exist(t.extensions.VRM)){const e=t.extensions.VRM.humanoid.humanBones;for(const t of e)i.set(t.node,t.bone)}else if(x.Is.exist(t.extensions.VRMC_vrm)){const e=t.extensions.VRMC_vrm.humanoid.humanBones;for(const t in e){const n=e[t];i.set(n.node,t)}}return e.getTagValue("humanoid_map_name_nodeId"),"hips"===i.get(n)}__setupAnimationForSameSkeleton(e,t,n,i,o){var a,s,l,c;if(t.animations)for(const e of t.animations)for(const t of e.samplers)Xe.e._readBinaryFromAccessorAndSetItToAccessorExtras(t.inputObject),Xe.e._readBinaryFromAccessorAndSetItToAccessorExtras(t.outputObject);if(t.animations&&t.animations.length>0)for(const _ of t.animations)for(const u of _.channels){const d=null===(s=null===(a=u.samplerObject)||void 0===a?void 0:a.inputObject)||void 0===s?void 0:s.extras.typedDataArray,m=null===(c=null===(l=u.samplerObject)||void 0===l?void 0:l.outputObject)||void 0===c?void 0:c.extras.typedDataArray,f=null!=u.samplerObject.interpolation?u.samplerObject.interpolation:"LINEAR",p=t.nodes[u.target.node],v=this.__getCorrespondingEntity(e,t,n,u.target.node,p.name,i);if(v){const i=h.g.addComponentToEntity(qe.c,v).getAnimation();if("none"===o){let t="translate";t="translation"===u.target.path?"translate":"rotation"===u.target.path?"quaternion":u.target.path,"quaternion"===t?i.setAnimation(x.Is.exist(_.name)?_.name:"Untitled",t,d,m,4,He.k.fromString(f)):"translate"===t&&this.__isHips(e,n,u.target.node)&&i.setAnimation(x.Is.exist(_.name)?_.name:"Untitled",t,d,m,3,He.k.fromString(f))}else{const e=t.extras.rnEntities[u.target.node];let n;if("global"===o)n=new r.B5(e);else{if("absolute"!==o)throw new Error("unknown retarget mode");n=new r.l(e)}i.setAnimationRetarget(n)}}}}}var Ke=n(4252),Je=n(6098),Ze=n(3738);class $e{constructor(){}async importPointCloud(e,t){const n=e.substring(0,e.lastIndexOf("/"))+"/",i=b.j.createDefaultGltfOptions();if(t&&t.files)for(const e in t.files)if("drc"===b.j.getExtension(e)){const o=await this.__decodeDraco(t.files[e],i,n,t);return new Ze.Ok(o)}const o=await b.j.fetchArrayBuffer(e);if(o.isErr())return new Ze.UG({message:"fetchArrayBuffer failed",error:o});const a=await this.__decodeDraco(o.unwrapForce(),i,n,t);return new Ze.Ok(a)}importArrayBuffer(e,t,n){const i=e.substring(0,e.lastIndexOf("/"))+"/",o=b.j.createDefaultGltfOptions();return this.__decodeDraco(t,o,i,n).catch((e=>{console.log("__loadFromArrayBuffer error",e)}))}async __loadFromArrayBuffer(e,t,n,i){const o=new DataView(e,0,20);let a;if(1179937895!==o.getUint32(0,!0)){const o=b.j.arrayBufferToString(e),r=JSON.parse(o);a=await this._loadAsTextJson(r,i,t,n).catch((e=>{console.log("this.__loadAsTextJson error",e)}))}else a=await this._loadAsBinaryJson(o,!0,e,i,t,n).catch((e=>{console.log("this.__loadAsBinaryJson error",e)}));return a}_getOptions(e,t,n){if(t.asset&&t.asset.extras&&t.asset.extras.rnLoaderOptions)for(const n in t.asset.extras.rnLoaderOptions)e[n]=t.asset.extras.rnLoaderOptions[n];for(const t in n)e[t]=n[t];return n&&n.loaderExtensionName&&"string"==typeof n.loaderExtensionName&&(null!=Rn[n.loaderExtensionName]?e.loaderExtension=Rn[n.loaderExtensionName].getInstance():(console.error(`${n.loaderExtensionName} not found!`),e.loaderExtension=void 0)),e}async _loadAsBinaryJson(e,t,n,i,o,a){const r=e.getUint32(12,t);if(1313821514!==e.getUint32(16,t))throw new Error("invalid chunkType of chunk0 in this binary glTF file.");const s=new Uint8Array(n,20,r),l=b.j.uint8ArrayToString(s),c=JSON.parse(l);i=this._getOptions(o,c,i);const _=new Uint8Array(n,20+r+8);void 0===c.asset.extras&&(c.asset.extras={fileType:"glTF",version:"2"}),this._mergeExtendedJson(c,i.extendedJson),c.asset.extras.rnLoaderOptions=i;try{await this._loadInner(_,a,c,i)}catch(e){console.log("this._loadInner error in _loadAsBinaryJson",e)}return c}async _loadAsTextJson(e,t,n,i){void 0===e.asset.extras&&(e.asset.extras={fileType:"glTF",version:"2"}),t=this._getOptions(n,e,t),this._mergeExtendedJson(e,t.extendedJson),e.asset.extras.rnLoaderOptions=t;try{await this._loadInner(void 0,i,e,t)}catch(e){console.log("this._loadInner error in _loadAsTextJson",e)}return e}_loadInner(e,t,n,i){const o=[];return o.push(this._loadResources(e,t,n,i,{shaders:[],buffers:[],images:[]})),o.push(new Promise(((e,t)=>{this._loadJsonContent(n,i),e()}))),Promise.all(o)}_loadJsonContent(e,t){this._loadDependenciesOfScenes(e),this._loadDependenciesOfNodes(e),this._loadDependenciesOfMeshes(e),this._loadDependenciesOfMaterials(e),this._loadDependenciesOfTextures(e),this._loadDependenciesOfJoints(e),this._loadDependenciesOfAnimations(e),this._loadDependenciesOfAccessors(e),this._loadDependenciesOfBufferViews(e),void 0===e.asset.extras&&(e.asset.extras={})}_loadDependenciesOfScenes(e){for(const t of e.scenes)for(const n in t.nodes)t.nodesObjects[n]=e.nodes[t.nodes[n]]}_loadDependenciesOfNodes(e){for(const t of e.nodes){if(t.children){x.Is.not.exist(t.childrenObjects)&&(t.childrenObjects=[]);for(const n in t.children)t.childrenObjects[n]=e.nodes[t.children[n]]}void 0!==t.mesh&&void 0!==e.meshes&&(t.meshObject=e.meshes[t.mesh]),void 0!==t.skin&&void 0!==e.skins&&(t.skinObject=e.skins[t.skin],void 0===t.meshObject.extras&&(t.meshObject.extras={}),t.meshObject.extras._skin=t.skin),void 0!==t.camera&&void 0!==e.cameras&&(t.cameraObject=e.cameras[t.camera]),void 0!==t.extensions&&void 0!==e.extensions&&void 0!==e.extensions.KHR_lights_punctual&&(t.extensions.KHR_lights_punctual.lightIndex=t.extensions.KHR_lights_punctual.light,t.extensions.KHR_lights_punctual.light=e.extensions.KHR_lights_punctual.lights[t.extensions.KHR_lights_punctual.lightIndex])}}_loadDependenciesOfMeshes(e){for(const t of e.meshes)for(const n of t.primitives){void 0!==n.material&&(n.materialObject=e.materials[n.material]);for(const t in n.attributes){const i=n.attributes[t],o=e.accessors[i];o.extras={toGetAsTypedArray:!0,attributeName:t},n.attributesObjects[t]=o}if(null!=n.indices&&(n.indicesObject=e.accessors[n.indices]),null!=n.targets){n.targetsObjects=[];for(const t of n.targets){const i={};for(const n in t){const o=t[n];if(o>=0){const t=e.accessors[o];t.extras={toGetAsTypedArray:!0,attributeName:n},i[n]=t}}n.targetsObjects.push(i)}}}}_checkRnGltfLoaderOptionsExist(e){return!(!e.asset.extras||!e.asset.extras.rnLoaderOptions)}_loadDependenciesOfMaterials(e){if(e.textures||(e.textures=[]),e.materials)for(const t of e.materials){if(t.pbrMetallicRoughness){const n=t.pbrMetallicRoughness.baseColorTexture;void 0!==n&&(n.texture=e.textures[n.index]);const i=t.pbrMetallicRoughness.metallicRoughnessTexture;void 0!==i&&(i.texture=e.textures[i.index])}const n=t.normalTexture;void 0!==n&&(n.texture=e.textures[n.index]);const i=t.occlusionTexture;void 0!==i&&(i.texture=e.textures[i.index]);const o=t.emissiveTexture;void 0!==o&&(o.texture=e.textures[o.index]),this._checkRnGltfLoaderOptionsExist(e)&&e.asset.extras.rnLoaderOptions.loaderExtension&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures&&e.asset.extras.rnLoaderOptions.loaderExtension.setTextures(e,t)}}_loadDependenciesOfTextures(e){if(e.textures)for(const t of e.textures)(0,Je.Jx)((n=>{t.samplerObject=e.samplers[n]}),t.sampler),void 0!==t.source&&(t.image=e.images[t.source])}_loadDependenciesOfJoints(e){if(e.skins)for(const t of e.skins)if(x.Is.exist(t.skeleton)){t.skeletonObject=e.nodes[t.skeleton],(0,Je.Jx)((n=>t.inverseBindMatricesObject=e.accessors[n]),t.inverseBindMatrices),(0,Je.fY)((()=>t.skeletonObject=e.nodes[t.joints[0]]),t.skeleton),t.jointsObjects=[];for(const n of t.joints)t.jointsObjects.push(e.nodes[n])}}_loadDependenciesOfAnimations(e){if(e.animations)for(const t of e.animations){for(const n of t.channels)n.samplerObject=t.samplers[n.sampler],n.target.nodeObject=e.nodes[n.target.node];for(const n of t.channels)if(x.Is.exist(n.samplerObject)&&(n.samplerObject.inputObject=e.accessors[n.samplerObject.input],n.samplerObject.outputObject=e.accessors[n.samplerObject.output],void 0===n.samplerObject.outputObject.extras&&(n.samplerObject.outputObject.extras={}),"rotation"===n.target.path&&(n.samplerObject.outputObject.extras.quaternionIfVec4=!0),"weights"===n.target.path)){const e=n.samplerObject.outputObject.count/n.samplerObject.inputObject.count;n.samplerObject.outputObject.extras.weightsArrayLength=e}}}_loadDependenciesOfAccessors(e){for(const t of e.accessors)if(null==t.bufferView&&(t.bufferView=0),t.bufferViewObject=e.bufferViews[t.bufferView],null!=t.sparse){const n=t.sparse;n.indices.bufferViewObject=e.bufferViews[n.indices.bufferView],n.values.bufferViewObject=e.bufferViews[n.values.bufferView]}}_loadDependenciesOfBufferViews(e){for(const t of e.bufferViews)void 0!==t.buffer&&(t.bufferObject=e.buffers[t.buffer])}_mergeExtendedJson(e,t){let n=null;if(t instanceof ArrayBuffer){const e=b.j.arrayBufferToString(t);n=JSON.parse(e)}else"string"==typeof t?n=JSON.parse(t):"object"==typeof t&&(n=t);Object.assign(e,n)}_loadResources(e,t,n,i,o){const a=[];let r;for(const s in n.buffers){const l=n.buffers[s];let c,_;l.uri&&(c=l.uri.split("/"),_=c[c.length-1]),r=void 0===l.uri?new Ke.n(((t,n)=>{o.buffers[s]=e,l.buffer=e,t(e)})):l.uri.match(/^data:application\/(.*);base64,/)?new Ke.n(((e,t)=>{const n=b.j.dataUriToArrayBuffer(l.uri);o.buffers[s]=new Uint8Array(n),l.buffer=new Uint8Array(n),e(n)})):i.files&&i.files[_]?new Ke.n(((e,t)=>{const n=i.files[_];o.buffers[s]=new Uint8Array(n),l.buffer=new Uint8Array(n),e(n)})):new Ke.n(b.j.loadResourceAsync(t+l.uri,!0,((e,t)=>{o.buffers[s]=new Uint8Array(t),l.buffer=new Uint8Array(t),e(t)}),((e,t)=>{}))),l.bufferPromise=r,a.push(r)}for(const r in n.images){const s=r,l=n.images[s];let c;if(void 0===l.uri){let t=e;null==e&&(t=n.bufferViews[l.bufferView].bufferObject.buffer);const i=b.j.createUint8ArrayFromBufferViewInfo(n,l.bufferView,e);c=b.j.createBlobImageUriFromUint8Array(i,l.mimeType)}else{const e=l.uri,n=e.split("/"),o=n[n.length-1];if(i.files&&i.files[o]){const e=i.files[o];c=b.j.createBlobImageUriFromUint8Array(new Uint8Array(e),l.mimeType)}else c=e.match(/^data:/)?e:t+e}const _=b.j.createImageFromUri(c,l.mimeType).then((e=>{e.crossOrigin="Anonymous",o.images[s]=e,l.image=e}));a.push(_)}if(i.defaultTextures){const e=i.defaultTextures.basePath,t=i.defaultTextures.textureInfos;for(const n of t){const t=n.fileName,i=e+t,o=b.j.getExtension(t),r=b.j.getMimeTypeFromExtension(o),s=b.j.createImageFromUri(i,r).then((e=>{e.crossOrigin="Anonymous",n.image={image:e}}));a.push(s)}}return Promise.all(a).catch((e=>{console.log("Promise.all error",e)}))}static getInstance(){return this.__instance||(this.__instance=new $e),this.__instance}__decodeDraco(e,t,n,i){return this.__decodeBuffer(e).then((e=>{const o=JSON.stringify(e),a=JSON.parse(o);return this._loadAsTextJson(a,i,t,n).catch((e=>{console.log("this.__loadAsTextJson error",e)}))}))}__decodeBuffer(e){const t=new DracoDecoderModule,n=new t.Decoder,i=this.__getGeometryFromDracoBuffer(t,n,e);if(null==i)throw new Error("invalid dracoGeometry.");if(i.geometryType!==t.POINT_CLOUD)throw new Error("invalid geometryType of drc file.");if(-1===n.GetAttributeId(i,t.POSITION))throw t.destroy(n),t.destroy(i),new Error("Draco: No position attribute found.");const o=["POSITION","NORMAL","COLOR","TEX_COORD","GENERIC"],a=i.num_points(),r=[],s=[];let l=0;for(let e=0;e{e(o)}))}__setBuffersToJSON(e,t){return this.__convertBufferToURI(e.buffer).then((n=>{t.buffers=[{name:"input",byteLength:e.byteLength,uri:n}]})).catch((e=>{console.log("this.__convertBufferToURI error:",e)}))}__convertBufferToURI(e){return new Promise(((t,n)=>{const i=new Blob([e],{type:"application/octet-stream"}),o=new FileReader;o.onload=()=>{t(o.result)},o.onerror=()=>{n(o.error)},o.readAsDataURL(i)}))}__setAccessorsAndBufferViewsToJSON(e,t,n,i){const o=[],a=[];let r=0;for(let i=0,s=0;i0){const e=i[0].entity.getTransform().localPosition;e.lengthSquared(){for(let n=0;nt[e]));const s=[];for(const t in i.bones){const n=i.bones[t],o=e.asset.extras.rnEntities[n];this.__addSpringBoneRecursively(r,o,i,s)}n.push(r)}for(const e of n)this.__addPhysicsComponent(e,e.rootBone)}static __addSpringBoneRecursively(e,t,n,i){const o=t.getSceneGraph().children;if(!i.includes(t)){const o=new ft(t);o.dragForce=n.dragForce,o.stiffnessForce=n.stiffiness,o.gravityPower=n.gravityPower,o.gravityDir=ce.P.fromCopyArray([n.gravityDir.x,n.gravityDir.y,n.gravityDir.z]),o.hitRadius=n.hitRadius,e.bones.push(o),i.push(t)}for(const t of o)this.__addSpringBoneRecursively(e,t.entity,n,i)}static __addPhysicsComponent(e,t){const n=t.entity,i=h.g.addComponentToEntity(Ee.Z,n).getPhysics(),o=new _t;o.setSpring(e),i.setStrategy(o)}static _createTextures(e){e.textures||(e.textures=[]);const t=e.textures,n=[];for(let i=0;i({entityIdx:e.extras.rnEntities[t.node].entityUID,blendShapeIdx:t.index,weight:t.weight}))));const r={name:t,isBinary:n.isBinary,binds:i};o.push(r)}const s=h.g.addComponentToEntity(r.ZA,t);s.getVrm().setVrmExpressions(o),s.getVrm()._version="1.0"}static _readVRMHumanoidInfo(e,t){const n=e.extensions.VRMC_vrm.humanoid.humanBones,i=new Map;for(const e in n){const t=n[e];i.set(e,t.node)}null!=t&&t.tryToSetTag({tag:"humanoid_map_name_nodeId",value:i})}static _readSpringBone(e){var t,n;const i=[];if(x.Is.exist(null===(t=e.extensions.VRMC_springBone)||void 0===t?void 0:t.colliderGroups))for(const t in e.extensions.VRMC_springBone.colliderGroups){const n=e.extensions.VRMC_springBone.colliderGroups[t],o=new ut;i.push(o);for(const t of n.colliders){const n=e.extensions.VRMC_springBone.colliders[t],i=e.asset.extras.rnEntities[n.node].getSceneGraph();if(x.Is.exist(n.shape.sphere)){const e=new ht;e.baseSceneGraph=i,e.position=ce.P.fromCopyArray([n.shape.sphere.offset[0],n.shape.sphere.offset[1],n.shape.sphere.offset[2]]),e.radius=n.shape.sphere.radius,o.sphereColliders.push(e)}else if(x.Is.exist(n.shape.capsule)){const e=new vt;e.baseSceneGraph=i,e.position=ce.P.fromCopyArray([n.shape.capsule.offset[0],n.shape.capsule.offset[1],n.shape.capsule.offset[2]]),e.radius=n.shape.capsule.radius,e.tail=ce.P.fromCopyArray([n.shape.capsule.tail[0],n.shape.capsule.tail[1],n.shape.capsule.tail[2]]),o.capsuleColliders.push(e)}}}const o=[];if(x.Is.exist(null===(n=e.extensions.VRMC_springBone)||void 0===n?void 0:n.springs))for(const t of e.extensions.VRMC_springBone.springs){const n=t.joints[0],a=e.asset.extras.rnEntities[n.node],r=new dt(a.getSceneGraph());r.tryToSetUniqueName(t.name,!0);const s=x.Is.exist(t.colliderGroups)?t.colliderGroups:[];r.colliderGroups=s.map((e=>i[e]));const l=[];for(const n in t.joints){const i=t.joints[n],o=e.asset.extras.rnEntities[i.node],a=new ft(o);a.dragForce=i.dragForce,a.stiffnessForce=i.stiffness,a.gravityPower=x.Is.exist(i.gravityPower)?i.gravityPower:1,a.gravityDir=x.Is.exist(i.gravityDir)?ce.P.fromCopyArray3([i.gravityDir[0],i.gravityDir[1],i.gravityDir[2]]):ce.P.fromCopyArray3([0,-1,0]),a.hitRadius=i.hitRadius,r.bones.push(a),l.push(o)}this.__addSpringBoneRecursively(r,a,l),o.push(r)}for(const e of o)this.__addPhysicsComponent(e,e.rootBone)}static __addSpringBoneRecursively(e,t,n){const i=t.getSceneGraph().children;if(!n.includes(t)){const i=new ft(t);e.bones.push(i),n.push(t)}for(const t of i)this.__addSpringBoneRecursively(e,t.entity,n)}static __addPhysicsComponent(e,t){const n=t.entity,i=h.g.addComponentToEntity(Ee.Z,n).getPhysics(),o=new _t;o.setSpring(e),i.setStrategy(o)}static _createTextures(e){e.textures||(e.textures=[]);const t=e.textures,n=[];for(let i=0;i=0?(n.__isImportVRM0x=!1,i.asset.extras.rnLoaderOptions.__isImportVRM0x=!1,n.__importedType="vrm1",await bt.__importVRM(i,t)):i.extensionsUsed.indexOf("VRM")>=0&&(n.__importedType="vrm0x",await pt.__importVRM0x(i,t)),new Ze.Ok}return(0,Ze.Z6)(e),new Ze.UG({message:e.getRnError().message,error:void 0})}default:return new Ze.UG({message:"detect invalid format",error:void 0})}}static __getFileTypeFromFilePromise(e,t,n){return null!=n?et.T.fromString(n):tt({[e]:t.files[e]})}}var Tt=n(1220);class St{static async importFromUri(e){const t=await it.Z.importFromUri(e,{});if(t.isErr())return new Ze.UG({message:"Failed to import VRM file.",error:t});(0,Ze.UD)(t);const n=t.get();return this.readHumanoid(n),new Ze.Ok(n)}static async importFromArrayBuffer(e){const t=await it.Z.importFromArrayBuffers({"data.glb":e},{});if(t.isErr())return new Ze.UG({message:"Failed to import VRM file.",error:t});(0,Ze.UD)(t);const n=t.get();return this.readHumanoid(n),new Ze.Ok(n)}static readHumanoid(e){var t;const n=null===(t=e.extensions.VRMC_vrm_animation.humanoid)||void 0===t?void 0:t.humanBones;if(x.Is.not.exist(n))return;const i=new Map;e.extensions.VRMC_vrm_animation.humanoidBoneNameMap=i;for(const e in n){const t=n[e];i.set(t.node,e)}}}var Ct=n(5868);class wt extends m.S{constructor(e,t,n){super(),this.__inputs=[],this.__outputs=[],this.__inputConnections=[],this.__shaderFunctionName=e,this.__shaderCode=t,this.__shaderNodeUid=++wt.__invalidShaderNodeCount,wt._shaderNodes[wt.__invalidShaderNodeCount]=this,this.__shader=n}addInputConnection(e,t,n){this.__inputConnections.push({shaderNodeUid:e.shaderNodeUid,outputNameOfPrev:t,inputNameOfThis:n})}get shaderFunctionName(){return this.__shaderFunctionName}get shaderCode(){return this.__shaderCode}get shaderNodeUid(){return this.__shaderNodeUid}getInput(e){for(const t of this.__inputs)if(t.name===e)return t}getInputs(){return this.__inputs}getOutput(e){for(const t of this.__outputs)if(t.name===e)return t}getOutputs(){return this.__outputs}get inputConnections(){return this.__inputConnections}get shader(){return this.__shader}}wt._shaderNodes=[],wt.__invalidShaderNodeCount=-1;var Rt=n(7882),Pt=n(903),Mt=n(5324),Dt=n(836);const Nt="const float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n";class Bt{static createVertexShaderCode(e){var t;const n=e.concat(),i=this.__findBeginNode(n),o=this.__sortTopologically(i,n);let a="",r="attribute";(null===(t=Be.F.getWebGLResourceRepository().currentWebGLContextWrapper)||void 0===t?void 0:t.isWebGL2)&&(r="in"),a+=`\n#version 300 es\nprecision highp float;\nprecision highp int;\n${Nt}\n\n ${r} vec4 a_instanceInfo;\n`,a+=`\nuniform bool u_vertexAttributesExistenceArray[${ie.T.AttributeTypeNumber}];\n`,a+="/* shaderity: @{matricesGetters} */",a+="/* shaderity: @{getters} */";let s="";return s+=Bt.getFunctionDefinition(o,Mt.H.VertexShader),s+=Bt.__constructShaderWithNodes(o),{shader:a+s,shaderBody:s}}static createPixelShaderCode(e){const t=e.concat(),n=this.__findBeginNode(t),i=this.__sortTopologically(n,t);let o="";o+=`\n#version 300 es\nprecision highp float;\nprecision highp int;\n${Nt}\n`,o+="/* shaderity: @{getters} */",o+="layout(location = 0) out vec4 rt0;";let a="";return a+=Bt.getFunctionDefinition(i,Mt.H.PixelShader),a+=Bt.__constructShaderWithNodes(i),{shader:o+a,shaderBody:a}}static __findBeginNode(e){let t;for(let n=0;n{let i=0;for(const e of t.inputConnections)-1===n.indexOf(e.shaderNodeUid)&&i++;0===i&&(e=t)})),i.push(e),n.push(e.shaderNodeUid),t.splice(t.indexOf(e),1)}while(0!==t.length);return i}static getFunctionDefinition(e,t){let n="";const i=[];for(let o=0;o=0&&null==o[l-1]&&(o[l-1]=[]);const _=c.inputConnections;for(let e=0;e<_.length;e++){const o=_[e],r=wt._shaderNodes[o.shaderNodeUid];if(n(c.getInputs()[e]))continue;const h=r.getOutput(o.outputNameOfPrev),u=c.getInput(o.inputNameOfThis),d=`${h.name}_${o.shaderNodeUid}_to_${c.shaderNodeUid}`;-1===a.indexOf(r.shaderNodeUid)&&(t+=`${u.compositionType.getGlslStr(u.componentType)} ${d} = ${u.compositionType.getGlslInitialValue(u.componentType)};\n`);const m=s.get(r.shaderNodeUid);i[l].push(m||d),a.push(o.shaderNodeUid)}for(let t=l;t=0&&o[l-1].push(e),s.set(t.shaderNodeUid,e)}r.push(t.shaderNodeUid)}}}}}let a="";for(let n=0;n0){l+=`${s}(`;for(let t=0;t rhs;\n}\n\nvoid greater(in int lhs, in int rhs, out bool outValue) {\n outValue = lhs > rhs;\n}\n"),this.__inputs.push({compositionType:e,componentType:t,name:"lhs"}),this.__inputs.push({compositionType:e,componentType:I.r.Float,name:"rhs"}),this.__outputs.push({compositionType:T.d.Scalar,componentType:I.r.Bool,name:"outValue"})}}var jt=n(4109);class Yt extends wt{constructor(){super("ifStatement",void 0,new jt.p),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Bool,name:"condition"}),this.__outputs.push({compositionType:T.d.Unknown,componentType:I.r.Unknown,name:"ifStart"})}}class Kt extends wt{constructor(e,t,n,i){super("multiply","\nvoid multiply(in float lfs, in float rhs, out float outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in int lfs, in int rhs, out int outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat2 lfs, in mat2 rhs, out mat2 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat3 lfs, in mat3 rhs, out mat3 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat4 lfs, in mat4 rhs, out mat4 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat3 lfs, in vec3 rhs, out vec3 outValue) {\n outValue = lfs * rhs;\n}\nvoid multiply(in mat4 lfs, in vec4 rhs, out vec4 outValue) {\n outValue = lfs * rhs;\n}\n\n");let o=T.d.Unknown;e===T.d.Mat4&&n===T.d.Mat4?o=T.d.Mat4:e===T.d.Mat4&&n===T.d.Vec4?o=T.d.Vec4:e===T.d.Scalar&&n===T.d.Scalar&&(o=T.d.Scalar),this.__inputs.push({compositionType:e,componentType:t,name:"lhs"}),this.__inputs.push({compositionType:n,componentType:i,name:"rhs"}),this.__outputs.push({compositionType:o,componentType:t,name:"outValue"})}}class Jt extends wt{constructor(){super("normalMatrix","\nvoid normalMatrix(out mat3 outValue) {\n outValue = get_normalMatrix(a_instanceInfo.x);\n}\n"),this.__outputs.push({compositionType:T.d.Mat3,componentType:I.r.Float,name:"outValue"})}}class Zt extends wt{constructor(e,t){super("normalize","\nvoid normalize(in vec2 value, out vec2 outValue) {\n outValue = normalize(value);\n}\n\nvoid normalize(in vec3 value, out vec3 outValue) {\n outValue = normalize(value);\n}\n\nvoid normalize(in vec4 value, out vec4 outValue) {\n outValue = normalize(value);\n}\n"),this.__inputs.push({compositionType:e,componentType:t,name:"value"}),this.__outputs.push({compositionType:e,componentType:t,name:"outValue"})}}var $t=n(4212);class en extends wt{constructor(){super("outColor",void 0,$t.x.getInstance()),this.__inputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"value"})}}class tn extends wt{constructor(){super("outPosition",void 0,$t.x.getInstance()),this.__inputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"value"})}}class nn extends wt{constructor(){super("projectionMatrix","\nvoid projectionMatrix(out mat4 outValue) {\n float cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID}*/];\n outValue = get_projectionMatrix(cameraSID, 0);\n}\n"),this.__outputs.push({compositionType:T.d.Mat4,componentType:I.r.Float,name:"outValue"})}}class on extends wt{constructor(){super("scalarToVector4","\nvoid scalarToVector4(in float x, in float y, in float z, in float w, out vec4 outValue) {\n outValue.x = x;\n outValue.y = y;\n outValue.z = z;\n outValue.w = w;\n}\n"),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"x"}),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"y"}),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"z"}),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"w"}),this.__outputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"outValue"})}}var an=n(6796);class rn extends Ct.P{constructor(){super(new an.S,"textureFetch"),this.generalTextureMaterialNodeUID=new y.wy({str:`generalTexture_${this.materialNodeUid}`});const e=[{semantic:this.generalTextureMaterialNodeUID,componentType:I.r.Int,compositionType:T.d.Texture2D,stage:Mt.H.PixelShader,isCustomSetting:!1,soloDatum:!1,min:0,max:Number.MAX_SAFE_INTEGER}];this.setShaderSemanticsInfoArray(e),this.__vertexInputs.push({compositionType:T.d.Vec2,componentType:I.r.Float,name:"texcoord"}),this.__vertexOutputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"outColor"})}}var sn=n(204);class ln extends wt{constructor(e,t){super("uniformData"),this.__shaderFunctionName+="_"+this.__shaderNodeUid,this.__shader=new sn.$(this.__shaderFunctionName,e,t),this.__outputs.push({compositionType:e,componentType:t,name:"outValue"})}setDefaultInputValue(e,t){"value"===e&&this.__shader.setDefaultValue(t)}setUniformDataName(e){this.__shader.setVariableName(e)}}var cn=n(9071);class _n extends wt{constructor(e,t){super("varyingInVariable"),this.__shaderFunctionName+="_"+this.__shaderNodeUid,this.__shader=new cn.e(this.__shaderFunctionName,e,t),this.__outputs.push({compositionType:e,componentType:t,name:"outValue",isClosed:!0})}setVaryingVariableName(e){this.__shader.setVariableName(e)}}class hn extends wt{constructor(e,t){super("varyingOutVariable"),this.__shaderFunctionName+="_"+this.__shaderNodeUid,this.__shader=new cn.e(this.__shaderFunctionName,e,t),this.__inputs.push({compositionType:e,componentType:t,name:"value"})}setVaryingVariableName(e){this.__shader.setVariableName(e)}}class un extends wt{constructor(){super("vector3AndScalarToVector4","\nvoid vector3AndScalarToVector4(in vec3 xyz, in float w, out vec4 outValue) {\n outValue.x = xyz.x;\n outValue.y = xyz.y;\n outValue.z = xyz.z;\n outValue.w = w;\n}\n"),this.__inputs.push({compositionType:T.d.Vec3,componentType:I.r.Float,name:"xyz"}),this.__inputs.push({compositionType:T.d.Scalar,componentType:I.r.Float,name:"w"}),this.__outputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"outValue"})}}class dn extends wt{constructor(){super("viewMatrix","\nvoid viewMatrix(out mat4 outValue) {\n float cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID}*/];\n outValue = get_viewMatrix(cameraSID, 0);\n}\n"),this.__outputs.push({compositionType:T.d.Mat4,componentType:I.r.Float,name:"outValue"})}}class mn extends wt{constructor(){super("wireframe","bool wireframe(\n in vec4 existingFragColor,\n in vec4 wireframeColor,\n out vec4 outColor\n) {\n vec3 wireframeInfo = get_wireframe(a_instanceInfo.x);\n\n // Wireframe\n float threshold = 0.001;\n float wireframeWidthInner = wireframeInfo.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframeInfo.x > 0.5 && wireframeInfo.y < 0.5) {\n outColor.a = 0.0;\n }\n vec4 wireframeResult = existingFragColor;\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + existingFragColor.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(existingFragColor.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframeInfo.x > 0.5) {\n outColor = wireframeResult;\n if (wireframeInfo.y < 0.5 && existingFragColor.a == 0.0) {\n discard;\n }\n }\n}\n"),this.__inputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"existingFragColor"}),this.__inputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"wireframeColor"}),this.__outputs.push({compositionType:T.d.Vec4,componentType:I.r.Float,name:"outColor"})}}class fn extends wt{constructor(){super("worldMatrix","\nvoid worldMatrix(out mat4 outValue) {\n outValue = get_worldMatrix(a_instanceInfo.x);\n}\n"),this.__outputs.push({compositionType:T.d.Mat4,componentType:I.r.Float,name:"outValue"})}}var pn=n(6863),vn=n(1995),An=n(621),yn=n(9604),xn=n(8774),gn=n(3616),In=n(224),bn=n(1813),En=n(5757),Tn=n(4878);class Sn extends Ct.P{constructor(){super(null,"envConstantShading",{},En.Z,Tn.Z);const e=[{semantic:Sn.EnvHdriFormat,componentType:I.r.Int,compositionType:T.d.Scalar,stage:Mt.H.PixelShader,isCustomSetting:!1,updateInterval:bn.a.EveryTime,soloDatum:!1,initialValue:gn.Ru.fromCopyNumber(0),min:0,max:5},{semantic:Sn.envRotation,componentType:I.r.Float,compositionType:T.d.Scalar,stage:Mt.H.PixelShader,isCustomSetting:!1,updateInterval:bn.a.EveryTime,soloDatum:!1,initialValue:gn.Ru.fromCopyNumber(0),min:-Math.PI,max:Math.PI},{semantic:y.f5.DiffuseColorFactor,componentType:I.r.Float,compositionType:T.d.Vec4,stage:Mt.H.PixelShader,isCustomSetting:!1,updateInterval:bn.a.EveryTime,soloDatum:!1,initialValue:P.Lt.fromCopyArray([1,1,1,1]),min:0,max:2},{semantic:y.f5.ColorEnvTexture,componentType:I.r.Int,compositionType:T.d.TextureCube,stage:Mt.H.PixelShader,isCustomSetting:!1,updateInterval:bn.a.EveryTime,initialValue:[0,Ft.pn],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:y.f5.MakeOutputSrgb,compositionType:T.d.Scalar,componentType:I.r.Bool,stage:Mt.H.PixelShader,min:0,max:1,isCustomSetting:!1,updateInterval:bn.a.FirstTimeOnly,initialValue:gn.Ru.fromCopyNumber(1)}];this.setShaderSemanticsInfoArray(e)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix));let o=i.renderPass.cameraComponent;null==o&&(o=l.C.getComponent(In.M,In.M.current)),o&&(this.setViewInfo(t,o,i.isVr,i.displayIdx),this.setProjection(t,o,i.isVr,i.displayIdx))}}Sn.envRotation=new y.wy({str:"envRotation"}),Sn.EnvHdriFormat=new y.wy({str:"envHdriFormat"});var Cn=n(8287),wn=n(1554),Pn=n(9330),Mn=n(8283),Dn=n(9764),Nn=n(7369),Bn=n(968),Ln=n(5519),Fn=n(4235),Gn=n(1050),zn=n(6312),Vn=n(2858),On=n(3981),Un=n(3648),kn=n(2251),Qn=n(580);class Wn extends m.S{constructor(){super(),this.__width=0,this.__height=0,this.__isShadow=!1,this.__shadowMapSize=1024,this.__oFrame=new zn.Hq,this.__oFrameDepthMoment=new zn.Hq,this.__oFrameBufferMsaa=new zn.Hq,this.__oFrameBufferResolve=new zn.Hq,this.__oFrameBufferResolveForReference=new zn.Hq,this.__oInitialExpression=new zn.Hq,this.__expressions=[],this.__depthMomentExpressions=[],this.__oMsaaResolveExpression=new zn.Hq,this.__oGammaExpression=new zn.Hq,this.__transparentOnlyExpressions=[],this.__oGammaBoardEntity=new zn.Hq,this.__oWebXRSystem=new zn.Hq,this.__oDrawFunc=new zn.Hq,this.__oDiffuseCubeTexture=new zn.Hq,this.__oSpecularCubeTexture=new zn.Hq,this.__oSamplerForBackBuffer=new zn.Hq}async setup(e,t,{isShadow:n=!1,shadowMapSize:i=1024}={}){if(this.__width=e,this.__height=t,this.__shadowMapSize=i,this.__oFrame.has())return new Ze.UG({message:"Already setup",error:void 0});const o=new zn.bD(new On.R);this.__oFrame=o,this.__oSamplerForBackBuffer=new zn.bD(new Qn.Z({wrapS:ze.d.Repeat,wrapT:ze.d.Repeat,minFilter:ze.d.LinearMipmapLinear,magFilter:ze.d.Linear})),this.__oSamplerForBackBuffer.unwrapForce().create();const{framebufferMsaa:a,framebufferResolve:r,framebufferResolveForReference:s}=this.__createRenderTargets(e,t);n&&(this.__isShadow=!0,this.__oFrameDepthMoment=this.__setupDepthMomentFramebuffer(i));const l=this.__setupInitialExpression(a,this.__oFrameDepthMoment);this.__oInitialExpression=new zn.bD(l);const c=this.__setupMsaaResolveExpression(o,a,r,s);this.__oMsaaResolveExpression=new zn.bD(c),this.__oFrameBufferMsaa=new zn.bD(a),this.__oFrameBufferResolve=new zn.bD(r),this.__oFrameBufferResolveForReference=new zn.bD(s);const _=this.__setupGammaExpression(o,r,e/t);this.__oGammaExpression=new zn.bD(_);const h=await kn.x.getInstance().getModule("xr");return x.Is.exist(h)&&(this.__oWebXRSystem=new zn.bD(h.WebXRSystem.getInstance())),new Ze.Ok}setExpressions(e,t={isTransmission:!0}){this.__setExpressionsInner(e,{isTransmission:t.isTransmission});const n=e.map((e=>e.clone()));t.isTransmission&&this.__setTransparentExpressionsForTransmission(n),this.__setDepthTextureToEntityMaterials()}__setDepthTextureToEntityMaterials(){if(x.Is.false(this.__isShadow))return;this.__depthMomentExpressions=[];for(const e of this.__expressions)this.__depthMomentExpressions.push(e.clone());const e=Ie.G.createDepthMomentEncodeMaterial();for(const t of this.__depthMomentExpressions)for(const n of t.renderPasses)n.setFramebuffer(this.__oFrameDepthMoment.unwrapForce()),n.toClearColorBuffer=!0,n.toClearDepthBuffer=!0,n.toRenderTransparentPrimitives=!1,n.setMaterial(e);for(const e of this.__expressions)for(const t of e.renderPasses){const e=t.entities;for(const t of e){const e=t.tryToGetMesh();if(x.Is.exist(e)){const t=e.mesh;if(x.Is.exist(t)){const e=t.primitives;for(const t of e)t.material.setTextureParameter(y.f5.DepthTexture,this.__oFrameDepthMoment.unwrapForce().getColorAttachedRenderTargetTexture(0))}}}}}startRenderLoop(e){return this.__oFrame.doesNotHave()?new Ze.UG({message:"not initialized.",error:void 0}):(this.__oDrawFunc=new zn.bD(e),Un.x.startRenderLoop((()=>{this.__setExpressions(),e(this.__oFrame.unwrapForce())})),new Ze.Ok)}draw(){this.__oDrawFunc.unwrapForce()(this.__oFrame.unwrapForce())}resize(e,t){if(this.__oFrame.doesNotHave())return new Ze.UG({message:"not initialized.",error:void 0});(0,zn.Zz)(this.__oFrame),(0,zn.Zz)(this.__oFrameBufferMsaa),(0,zn.Zz)(this.__oFrameBufferResolve),(0,zn.Zz)(this.__oFrameBufferResolveForReference),(0,zn.Zz)(this.__oGammaExpression),(0,zn.Zz)(this.__oGammaBoardEntity);const n=this.__oWebXRSystem.unwrapOrUndefined();return x.Is.exist(n)&&n.isWebXRMode&&(e=n.getCanvasWidthForVr(),t=n.getCanvasHeightForVr()),Un.x.resizeCanvas(e,t),this.__oFrame.get().setViewport(P.Lt.fromCopy4(0,0,e,t)),this.__oFrameDepthMoment.has()&&this.__oFrameDepthMoment.get().resize(Math.floor(this.__shadowMapSize*(this.__width/this.__height)),this.__shadowMapSize),this.__oFrameBufferMsaa.get().resize(e,t),this.__oFrameBufferResolve.get().resize(e,t),this.__oFrameBufferResolveForReference.get().resize(e,t),this.__oGammaExpression.get().renderPasses[0].setViewport(P.Lt.fromCopy4(0,0,e,t)),new Ze.Ok}setIBL(e){const t=new Vn.B;t.baseUriToLoad=e.diffuse.baseUri,t.hdriFormat=e.diffuse.hdriFormat,t.isNamePosNeg=e.diffuse.isNamePosNeg,t.mipmapLevelNumber=e.diffuse.mipmapLevelNumber,t.loadTextureImagesAsync(),this.__oDiffuseCubeTexture=new zn.bD(t);const n=new Vn.B;n.baseUriToLoad=e.specular.baseUri,n.isNamePosNeg=e.specular.isNamePosNeg,n.hdriFormat=e.specular.hdriFormat,n.mipmapLevelNumber=e.specular.mipmapLevelNumber,n.loadTextureImagesAsync(),this.__oSpecularCubeTexture=new zn.bD(n),this.__setIblInner(),this.__setIblInnerForTransparentOnly()}setIBLTextures(e,t){this.__oDiffuseCubeTexture=new zn.bD(e),this.__oSpecularCubeTexture=new zn.bD(t),this.__setIblInner(),this.__setIblInnerForTransparentOnly()}getInitialExpression(){return this.__oInitialExpression.unwrapOrUndefined()}getMsaaResolveExpression(){return this.__oMsaaResolveExpression.unwrapOrUndefined()}getGammaExpression(){return this.__oGammaExpression.unwrapOrUndefined()}setDiffuseIBLContribution(e){for(const t of this.__expressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();x.Is.exist(n)&&(n.diffuseCubeMapContribution=e)}for(const t of this.__transparentOnlyExpressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();x.Is.exist(n)&&(n.diffuseCubeMapContribution=e)}}setSpecularIBLContribution(e){for(const t of this.__expressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();x.Is.exist(n)&&(n.specularCubeMapContribution=e)}for(const t of this.__transparentOnlyExpressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();x.Is.exist(n)&&(n.specularCubeMapContribution=e)}}setIBLRotation(e){for(const t of this.__expressions)for(const n of t.renderPasses)for(const t of n.entities){const n=t.tryToGetMeshRenderer();x.Is.exist(n)&&(n.rotationOfCubeMap=e)}}setCameraComponentOfLight(e){if(this.__isShadow){for(const t of this.__depthMomentExpressions)for(const n of t.renderPasses)n.cameraComponent=e;for(const t of this.__expressions)for(const n of t.renderPasses)n.setPostRenderFunction((function(){const t=n.entities;for(const n of t){const t=n.tryToGetMesh();if(x.Is.exist(t)){const n=t.mesh;if(x.Is.exist(n)){const t=n.primitives;for(const n of t)n.material.setParameter(y.f5.DepthBiasPV,e.biasViewProjectionMatrix)}}}}))}}__setExpressionsInner(e,t={isTransmission:!0}){for(const n of e)for(const e of n.renderPasses)e.toRenderOpaquePrimitives=!0,t.isTransmission?e.toRenderTransparentPrimitives=!1:e.toRenderTransparentPrimitives=!0,e.toClearDepthBuffer=!1,e.setFramebuffer(this.__oFrameBufferMsaa.unwrapForce());this.__expressions=e,this.__setIblInner()}__setTransparentExpressionsForTransmission(e){for(const t of e){t.tryToSetUniqueName("modelTransparentForTransmission",!0);for(const e of t.renderPasses){e.toRenderOpaquePrimitives=!1,e.toRenderTransparentPrimitives=!0,e.toClearDepthBuffer=!1,e.setFramebuffer(this.__oFrameBufferMsaa.unwrapForce());for(const t of e.entities){const e=t.tryToGetMesh();if(x.Is.exist(e)){const t=e.mesh;if(x.Is.exist(t))for(let e=0;eo?(r=Math.min(i,t),s=r*a):(s=Math.min(o,t),r=s/a),n.width=r,n.height=s;const l=n.getContext("2d");if(l.drawImage(e,0,0,e.width,e.height,0,0,r,s),this.autoDetectTransparency){this.__imageData=l.getImageData(0,0,r,s);for(let e=0;e{const _=()=>{this.__width=h.videoWidth,this.__height=h.videoHeight;const e=Be.F.getCgApiResourceRepository().createTextureFromImageBitmapData(h,{level:t,internalFormat:n,width:this.__width,height:this.__height,border:0,format:i,type:o,generateMipmap:a});this._textureResourceUid=e,this.__isTextureReady=!0,l()};null==s||s.addEventListener("click",(()=>{_(),h.play()}),!0);const h=document.createElement("video");h.crossOrigin="anonymous",h.setAttribute("playsinline","playsinline"),r&&(h.autoplay=!0,h.muted=!0),h.preload="auto",Zn(this,Xn,h,"f"),h.addEventListener("canplaythrough",(()=>{_(),h.play()}),!0),h.addEventListener("ended",(()=>{h.play()}),!0),h.src=e}))}updateTexture(){const e=Be.F.getWebGLResourceRepository();this.__isTextureReady&&$n(this,Xn,"f")&&e.updateTexture(this._textureResourceUid,$n(this,Xn,"f"),{level:0,xoffset:0,yoffset:0,width:this.__width,height:this.__height,format:Ve.V.RGBA,type:I.r.UnsignedByte})}getCurrentFramePixelData(){let e;const t=Be.F.getWebGLResourceRepository();return this.__isTextureReady&&$n(this,Xn,"f")&&(e=t.getPixelDataFromTexture(this._textureResourceUid,0,0,this.width,this.height)),[e,this.width,this.height]}set playbackRate(e){$n(this,Xn,"f")&&($n(this,Xn,"f").playbackRate=e)}get playbackRate(){var e;const t=null===(e=$n(this,Xn,"f"))||void 0===e?void 0:e.playbackRate;return null!=t?t:1}play(){var e;null===(e=$n(this,Xn,"f"))||void 0===e||e.play()}pause(){$n(this,Xn,"f").pause()}}Xn=new WeakMap,ei.__loadedBasisFunc=!1},6863:(e,t,n)=>{"use strict";n.d(t,{h:()=>A});var i=n(7290),o=n(224),a=n(810),r=n(2404),s=n(3999),l=n(4587),c=n(5324),_=n(1813),h=n(2575),u=n(5981),d=n(5868);const m={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord;\nin vec3 a_position;\n\nout vec2 v_texcoord;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n v_texcoord = a_texcoord;\n}\n",shaderStage:"vertex",isFragmentShader:!1},f={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec2 v_texcoord;\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec4 textureColor = texture(u_baseColorTexture, v_texcoord);\n\n float r = textureColor.r;\n float g = textureColor.g;\n float b = textureColor.b;\n float r16 = r * 15.0;\n float g16 = g * 15.0;\n float b16 = b * 15.0;\n float rInt = floor(r16);\n float gInt = floor(g16);\n float bInt = floor(b16);\n\n float rRate, gRate, bRate;\n float rIntAdjust, gIntAdjust, bIntAdjust;\n\n vec3 newColor = vec3(0.0);\n for(int i=0; i<8; i++){\n rRate = 1.0 - fract(r16);\n gRate = 1.0 - fract(g16);\n bRate = 1.0 - fract(b16);\n rIntAdjust = rInt;\n gIntAdjust = gInt;\n bIntAdjust = bInt;\n\n if(fract(float(i) / 2.0) != 0.0){\n rIntAdjust += 1.0;\n rRate = 1.0 - rRate;\n }\n if(fract(float(i / 2) / 2.0) != 0.0){\n gIntAdjust += 1.0;\n gRate = 1.0 - gRate;\n }\n if(fract(float(i / 4) / 2.0) != 0.0){\n bIntAdjust += 1.0;\n bRate = 1.0 - bRate;\n }\n\n if( rRate * gRate * bRate != 0.0){\n newColor += texture(u_lookupTableTexture, vec2(rIntAdjust / 256.0 + bIntAdjust / 16.0 + 1.0 / 512.0, gIntAdjust / 16.0 + 1.0 / 32.0)).rgb * rRate * gRate * bRate;\n }\n }\n\n rt0 = vec4(newColor, 1.0);\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var p=n(580),v=n(2192);class A extends d.P{constructor(e,t,n,o){let r;super(null,"colorGradingUsingLUTsShading",{},m,f);const d=e.getFramebuffer();let y;null!=d&&null!=d.colorAttachments[t]?r=d.colorAttachments[t]:(r=v.mg,null!=d?console.warn("renderPass does not have framebuffer.colorAttachments["+t+"]"):console.warn("renderPass does not have framebuffer")),"string"==typeof n?(y=new h.x,async function(e){y.generateTextureFromUri(e,{type:s.r.UnsignedByte}),await y.loadFromUrlLazy()}(n)):o instanceof i.y?y=o:(console.warn("no LUT texture is specified"),y=v.mg);const x=new p.Z({minFilter:u.d.Nearest,magFilter:u.d.Nearest,wrapS:u.d.ClampToEdge,wrapT:u.d.ClampToEdge,anisotropy:!1});x.create();const g=[{semantic:l.f5.BaseColorTexture,componentType:s.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:_.a.EveryTime,initialValue:[0,r],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:A.lookupTableTexture,componentType:s.r.Int,compositionType:a.d.Texture2D,stage:c.H.PixelShader,isCustomSetting:!1,updateInterval:_.a.EveryTime,initialValue:[1,y,x],min:0,max:Number.MAX_SAFE_INTEGER}];this.setShaderSemanticsInfoArray(g)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&this.setWorldMatrix(t,i.worldMatrix);let a=i.renderPass.cameraComponent;null==a&&(a=r.C.getComponent(o.M,o.M.current)),a&&(this.setViewInfo(t,a,i.isVr,i.displayIdx),this.setProjection(t,a,i.isVr,i.displayIdx))}}A.lookupTableTexture=new l.wy({str:"lookupTableTexture"})},1995:(e,t,n)=>{"use strict";n.d(t,{f:()=>M});var i=n(4587),o=n(5868),a=n(5324),r=n(2404),s=n(224),l=n(1986),c=n(430),_=n(7348),h=n(2192),u=n(8430),d=n(7683),m=n(3034),f=n.n(m),p=n(3999),v=n(810),A=n(4710),y=n(3258),x=n(1813),g=n(8182),I=n(9190),b=n(4536),E=n(2566),T=n(3496),S=n(4267),C=n(7035),w=n(1296),R=n(580);class P{static fillTemplate(e,t){const n=Object.assign(t,{WellKnownComponentTIDs:A.z,Config:y.D});return f().fillTemplate(e,n)}static getShaderDataReflection(e,t){const n=this.__copyShaderityObject(e),i=new Map,o=e.code.split(/\r\n|\n/),a=[],r=[];for(const n of o){const o=/^[\t ]*\/\/[\t ]*#param[\t ]+(\w+)[ \t]*:[\t ]*([\w><]+);[\t ]*(\/\/)*[\t ]*(.*)/,s=n.match(o),l=/^[\t ]*@group\(1\) @binding\((\d+)\)[ \t]*var[ \t]*(\w+)[ \t]*:[ \t]*([\w><]+);[\t ]*\/\/*[\t ]*(.*)/,c=n.match(l),_=/^[\t ]*@group\(2\) @binding\((\d+)\)[ \t]*var[ \t]*(\w+)[ \t]*:[ \t]*sampler;/,h=n.match(_);if(s){const n=s[2],i=s[1],o=s[4],a=this.__createShaderSemanticsInfo(n,i,o,e.isFragmentShader,t);r.push(a)}else if(c){const o=parseInt(c[1]),s=c[2],l=c[3],_=c[4],h=this.__createShaderSemanticInfoForTexture(l,s,o,_,e.isFragmentShader,t);i.set(o,h),r.push(h),a.push(n)}else if(h){const e=parseInt(h[1]);if(h[2],i.has(e)){const t=i.get(e);if(t){const e=new R.Z({magFilter:w.dI.Linear,minFilter:w.dI.Linear,wrapS:w.dI.Repeat,wrapT:w.dI.Repeat,wrapR:w.dI.Repeat,anisotropy:!1});t.initialValue[2]=e}}a.push(n)}else a.push(n)}return n.code=a.join("\n"),{shaderSemanticsInfoArray:r,shaderityObject:n}}static __createShaderSemanticInfoForTexture(e,t,n,o,r,s){const l=p.r.Int,c=v.d.Texture2D,_=r?a.H.PixelShader:a.H.VertexShader;let h=i.f5.fromStringCaseSensitively(t);if(null==h){const e=null==s?void 0:s.get(t);h=null!=e?e.semantic:new i.wy({str:t})}const u={semantic:h,compositionType:c,componentType:l,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!1,stage:_,none_u_prefix:!0},d=o.match(/initialValue[\t ]*=[\t ]*(.+)[,\t ]*/);if(d){const e=d[1];u.initialValue=this.__getInitialValueFromTextForTexture(u,n,e)}else u.initialValue=this.__getDefaultInitialValue(u);return u}static __createShaderSemanticsInfo(e,t,n,o,r){const s=p.r.fromWgslString(e),l=v.d.fromWgslString(e),c=o?a.H.PixelShader:a.H.VertexShader;let _=i.f5.fromStringCaseSensitively(t);if(null==_){const e=null==r?void 0:r.get(t);_=null!=e?e.semantic:new i.wy({str:t})}const h={semantic:_,compositionType:l,componentType:s,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!1,stage:c,none_u_prefix:!0};return this.__setRhodoniteOriginalParametersTo(h,n),h}static __setRhodoniteOriginalParametersTo(e,t){var n;const i=t.match(/soloDatum[\t ]*=[\t ]*(\w+)[,\t ]*/);let o=!1;"true"===(null==i?void 0:i[1])&&(o=!0),e.soloDatum=o;const a=t.match(/isCustomSetting[\t ]*=[\t ]*(\w+)[,\t ]*/);let r=!1;"true"===(null==a?void 0:a[1])&&(r=!0),e.isCustomSetting=r;const s=t.match(/updateInterval[\t ]*=[\t ]*(\w+)[,\t ]*/);let l=x.a.FirstTimeOnly;"everytime"===(null===(n=null==s?void 0:s[1])||void 0===n?void 0:n.toLowerCase())&&(l=x.a.EveryTime),e.updateInterval=l;const c=t.match(/initialValue[\t ]*=[\t ]*(.+)[,\t ]*/);if(c){const t=c[1];e.initialValue=this.__getInitialValueFromText(e,t)}else e.initialValue=this.__getDefaultInitialValue(e);const _=t.match(/needUniformInDataTextureMode[\t ]*=[\t ]*(.+)[,\t ]*/);if(_){let t=!1;"true"===(null==_?void 0:_[1])&&(t=!0),e.needUniformInDataTextureMode=t}}static __getInitialValueFromTextForTexture(e,t,n){let i;if(e.compositionType===v.d.Texture2D||e.compositionType===v.d.Texture2DShadow){const e=n.charAt(0).toUpperCase()+n.slice(1);i=[t,h.kT[`dummy${e}Texture`]]}else if(e.compositionType===v.d.TextureCube){const e=n.charAt(0).toUpperCase()+n.slice(1);i=[t,h.kT[`dummy${e}CubeTexture`]]}return i}static __getInitialValueFromText(e,t){const n=t.match(/\(([\d\w., ]+)\)/),i=t=>{e.compositionType!==t&&console.error("component number of initialValue is invalid:"+e.semantic.str)};let o;if(n){const e=n[1].split(",");switch(e.length){case 1:i(v.d.Scalar),o="true"===e[0]?new S.DU(new Float32Array([1])):"false"===e[0]?new S.DU(new Float32Array([0])):new S.DU(new Float32Array([parseFloat(e[0])]));break;case 2:i(v.d.Vec2),o=g.NR.fromCopyArray([parseFloat(e[0]),parseFloat(e[1])]);break;case 3:i(v.d.Vec3),o=I.d6.fromCopyArray([parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2])]);break;case 4:i(v.d.Vec4),o=b.xQ.fromCopyArray([parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3])]);break;case 9:i(v.d.Mat3),o=E.x.fromCopy9RowMajor(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),parseFloat(e[7]),parseFloat(e[8]));break;case 16:i(v.d.Mat4),o=T.e.fromCopy16RowMajor(parseFloat(e[0]),parseFloat(e[1]),parseFloat(e[2]),parseFloat(e[3]),parseFloat(e[4]),parseFloat(e[5]),parseFloat(e[6]),parseFloat(e[7]),parseFloat(e[8]),parseFloat(e[9]),parseFloat(e[10]),parseFloat(e[11]),parseFloat(e[12]),parseFloat(e[13]),parseFloat(e[14]),parseFloat(e[15]));break;default:console.error("Invalid format")}}else i(v.d.Scalar),o="true"===t?new S.DU(new Float32Array([1])):"false"===t?new S.DU(new Float32Array([0])):new S.DU(new Float32Array([parseFloat(t)]));return o}static __getDefaultInitialValue(e){return e.compositionType===v.d.Scalar?new S.DU(new Float32Array([0])):e.compositionType===v.d.Vec2?g.NR.zero():e.compositionType===v.d.Vec3?I.d6.zero():e.compositionType===v.d.Vec4?b.xQ.zero():e.compositionType===v.d.Mat2?C.f.identity():e.compositionType===v.d.Mat3?E.x.identity():e.compositionType===v.d.Mat4?T.e.identity():e.compositionType===v.d.Texture2D||e.compositionType===v.d.Texture2DShadow?[0,h.Dx]:e.compositionType===v.d.TextureCube?[0,h.mg]:void console.warn("initial value is not found")}static __copyShaderityObject(e){return{code:e.code,shaderStage:e.shaderStage,isFragmentShader:"fragment"===e.shaderStage}}}class M extends o.P{constructor({name:e,isMorphing:t,isSkinning:n,isLighting:i,isClearCoat:r,isTransmission:s,isVolume:l,isSheen:_,isSpecular:h,isIridescence:m,isAnisotropy:f,isShadow:p,useTangentAttribute:v,useNormalTexture:A,vertexShader:y,pixelShader:x,noUseCameraTransform:g,additionalShaderSemanticInfo:I,vertexShaderWebGpu:b,pixelShaderWebGpu:E}){let T,S;super(null,e+(t?"+morphing":"")+(n?"+skinning":"")+(i?"":"-lighting")+(r?"+clearcoat":"")+(s?"+transmission":"")+(l?"+volume":"")+(h?"+specular":"")+(_?"+sheen":"")+(m?"+iridescence":"")+(f?"+anisotropy":"")+(v?"+tangentAttribute":""),{isMorphing:t,isSkinning:n,isLighting:i}),u.l.currentProcessApproach===d.V.WebGPU?(T=P.getShaderDataReflection(b,o.P.__semanticsMap.get(this.shaderFunctionName)),S=P.getShaderDataReflection(E,o.P.__semanticsMap.get(this.shaderFunctionName)),this.__vertexShaderityObject=T.shaderityObject,this.__pixelShaderityObject=S.shaderityObject):(T=c.u.getShaderDataReflection(y,o.P.__semanticsMap.get(this.shaderFunctionName)),S=c.u.getShaderDataReflection(x,o.P.__semanticsMap.get(this.shaderFunctionName)),this.__vertexShaderityObject=T.shaderityObject,this.__pixelShaderityObject=S.shaderityObject);const C=[];for(const e of T.shaderSemanticsInfoArray)e.stage=a.H.VertexShader,C.push(e);for(const e of S.shaderSemanticsInfoArray){const t=C.find((t=>t.semantic.str===e.semantic.str));t?t.stage=a.H.VertexAndPixelShader:(e.stage=a.H.PixelShader,C.push(e))}i&&(this.__definitions+="#define RN_IS_LIGHTING\n"),n&&(this.__definitions+="#define RN_IS_SKINNING\n"),t&&(this.__definitions+="#define RN_IS_MORPHING\n"),r&&(this.__definitions+="#define RN_USE_CLEARCOAT\n"),s&&(this.__definitions+="#define RN_USE_TRANSMISSION\n"),l&&(this.__definitions+="#define RN_USE_VOLUME\n"),_&&(this.__definitions+="#define RN_USE_SHEEN\n"),h&&(this.__definitions+="#define RN_USE_SPECULAR\n"),m&&(this.__definitions+="#define RN_USE_IRIDESCENCE\n"),f&&(this.__definitions+="#define RN_USE_ANISOTROPY\n"),p&&(this.__definitions+="#define RN_USE_SHADOW_MAPPING\n"),v&&(this.__definitions+="#define RN_USE_TANGENT_ATTRIBUTE\n"),A&&(this.__definitions+="#define RN_USE_NORMAL_TEXTURE\n"),g&&(this.__definitions+="#define RN_NO_CAMERA_TRANSFORM\n"),this.setShaderSemanticsInfoArray(C.concat(I))}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:a}){if(a.setUniform){if(this.setWorldMatrix(t,a.worldMatrix),this.setNormalMatrix(t,a.normalMatrix),this.setIsBillboard(t,a.isBillboard),n||a.isVr){let e=a.renderPass.cameraComponent;null==e&&(e=r.C.getComponent(s.M,s.M.current)),this.setViewInfo(t,e,a.isVr,a.displayIdx),this.setProjection(t,e,a.isVr,a.displayIdx)}n&&this.setLightsInfo(t,a.lightComponents,e,a.setUniform);const i=a.entity.tryToGetSkeletal();this.setSkinning(t,a.setUniform,i)}if(a.diffuseCube&&a.diffuseCube.isTextureReady?this.__webglResourceRepository.setUniformValue(t,i.f5.DiffuseEnvTexture.str,n,[5,a.diffuseCube]):this.__webglResourceRepository.setUniformValue(t,i.f5.DiffuseEnvTexture.str,n,[5,h.pn]),a.specularCube&&a.specularCube.isTextureReady?this.__webglResourceRepository.setUniformValue(t,i.f5.SpecularEnvTexture.str,n,[6,a.specularCube]):this.__webglResourceRepository.setUniformValue(t,i.f5.SpecularEnvTexture.str,n,[6,h.pn]),a.setUniform){if(n){const{mipmapLevelNumber:e,meshRenderComponent:o,diffuseHdriType:r,specularHdriType:s}=M.__setupHdriParameters(a);this.__webglResourceRepository.setUniformValue(t,i.f5.IBLParameter.str,n,{x:e,y:o.diffuseCubeMapContribution,z:o.specularCubeMapContribution,w:o.rotationOfCubeMap}),this.__webglResourceRepository.setUniformValue(t,i.f5.HDRIFormat.str,n,{x:r,y:s})}}else{const{mipmapLevelNumber:t,meshRenderComponent:n,diffuseHdriType:r,specularHdriType:s}=M.__setupHdriParameters(a),l=o.P.__tmp_vector4;l.x=t,l.y=n.diffuseCubeMapContribution,l.z=n.specularCubeMapContribution,l.w=n.rotationOfCubeMap,e.setParameter(i.f5.IBLParameter,l);const c=o.P.__tmp_vector2;c.x=r,c.y=s,e.setParameter(i.f5.HDRIFormat,c)}const l=a.entity.tryToGetBlendShape();this.setMorphInfo(t,a.entity.getMesh(),a.primitive,l);const c=a.glw.canvas.width,_=a.glw.canvas.height,u=M.__globalDataRepository.getValue(i.f5.BackBufferTextureSize,0);u._v[0]=c,u._v[1]=_,t._gl.uniform2fv(t.backBufferTextureSize,u._v);const d=M.__globalDataRepository.getValue(i.f5.VrState,0);d._v[0]=a.isVr?1:0,d._v[1]=a.displayIdx,t._gl.uniform2iv(t.vrState,d._v)}static __setupHdriParameters(e){let t=1;e.specularCube&&(t=e.specularCube.mipmapLevelNumber);const n=e.entity.getMeshRenderer();let i=l.c.LDR_SRGB.index,o=l.c.LDR_SRGB.index;return n.diffuseCubeMap&&(i=n.diffuseCubeMap.hdriFormat.index),n.specularCubeMap&&(o=n.specularCubeMap.hdriFormat.index),{mipmapLevelNumber:t,meshRenderComponent:n,diffuseHdriType:i,specularHdriType:o}}}M.__globalDataRepository=_.$.getInstance()},621:(e,t,n)=>{"use strict";n.d(t,{Q:()=>f});var i=n(5868),o=n(224),a=n(2404),r=n(3999),s=n(810),l=n(3616),c=n(4587),_=n(5324),h=n(1813),u=n(2471);const d={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec3 v_normal_inWorld;\nout vec4 v_position_inLocal;\nout vec4 v_position_inWorld;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n v_position_inLocal = gl_Position;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},m={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec4 v_position_inLocal;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nvec4 encodeDepthToRGBA(float depth){\n float r = depth;\n float g = fract(r * 255.0);\n float b = fract(g * 255.0);\n float a = fract(b * 255.0);\n float coef = 1.0 / 255.0;\n r -= g * coef;\n g -= b * coef;\n b -= a * coef;\n return vec4(r, g, b, a);\n}\n\nvoid main (){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n float depth;\n bool isPointLight = get_isPointLight(materialSID, 0);\n if(isPointLight){\n float zNear = get_zNearInner(materialSID, 0);\n float zFar = get_zFarInner(materialSID, 0);\n float normalizationCoefficient = 1.0 / (zFar - zNear);\n depth = normalizationCoefficient * length(v_position_inLocal);\n }else{\n depth = gl_FragCoord.z;\n }\n\n float depthPow = get_depthPow(materialSID, 0);\n float depthData = pow(depth, depthPow);\n vec4 encodedDepth = encodeDepthToRGBA(depthData);\n\n rt0 = encodedDepth;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};class f extends i.P{constructor(e,{isSkinning:t}){super(null,"depthEncodeShading"+(t?"+skinning":""),{isMorphing:!1,isSkinning:t,isLighting:!1},d,m),this.__lastZNear=0,this.__lastZFar=0;const n=[{semantic:f.zNearInner,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:l.Ru.fromCopyNumber(.1),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:f.zFarInner,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:l.Ru.fromCopyNumber(1e4),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:f.isPointLight,componentType:r.r.Bool,compositionType:s.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:l.Ru.fromCopyNumber(1),min:0,max:1},{semantic:f.depthPow,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:l.Ru.fromCopyNumber(e),min:1,max:2},{semantic:c.f5.PointSize,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:l.Ru.fromCopyNumber(30),min:0,max:100},{semantic:c.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:s.d.Vec3,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:u.P.fromCopyArray([0,.1,.01]),min:0,max:1}];t&&(this.__definitions+="#define RN_IS_SKINNING"),this.setShaderSemanticsInfoArray(n)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){let r=i.renderPass.cameraComponent;null==r&&(r=a.C.getComponent(o.M,o.M.current)),i.setUniform?(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix),this.setViewInfo(t,r,i.isVr,i.displayIdx),this.setProjection(t,r,i.isVr,i.displayIdx),(n||this.__lastZNear!==r.zNearInner)&&(t._gl.uniform1f(t.zNearInner,r.zNearInner),this.__lastZNear=r.zNearInner),this.__lastZFar!==r.zFarInner&&(t._gl.uniform1f(t.zFarInner,r.zFarInner),this.__lastZFar=r.zFarInner)):(e.setParameter(f.zNearInner,r.zNearInner),e.setParameter(f.zFarInner,r.zFarInner));const s=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,s)}}f.zNearInner=new c.wy({str:"zNearInner"}),f.zFarInner=new c.wy({str:"zFarInner"}),f.isPointLight=new c.wy({str:"isPointLight"}),f.depthPow=new c.wy({str:"depthPow"})},9604:(e,t,n)=>{"use strict";n.d(t,{t:()=>f});var i=n(4587),o=n(810),a=n(3999),r=n(5324),s=n(1813),l=n(2404),c=n(224),_=n(3616),h=n(5868);const u={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec3 a_position;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},d={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n\tfloat tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n vec4 baseColor = texture(u_baseColorTexture, offset * tFrag);\n\n float luminance = length(baseColor);\n\n float luminanceCriterion = get_luminanceCriterion(materialSID, 0);\n if(luminance < luminanceCriterion){\n baseColor = vec4(0.0);\n }else{\n float luminanceReduce = get_luminanceReduce(materialSID, 0);\n baseColor.rgb = pow(baseColor.rgb, vec3(luminanceReduce));\n }\n\n rt0 = baseColor;\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var m=n(2192);class f extends h.P{constructor(e,t){super(null,"HighLuminanceDetectShading",{},u,d);const n=[{semantic:f.LuminanceCriterion,componentType:a.r.Float,compositionType:o.d.Scalar,stage:r.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.FirstTimeOnly,soloDatum:!1,initialValue:_.Ru.fromCopyNumber(2),min:0,max:Number.MAX_VALUE},{semantic:f.LuminanceReduce,componentType:a.r.Float,compositionType:o.d.Scalar,stage:r.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.FirstTimeOnly,soloDatum:!1,initialValue:_.Ru.fromCopyNumber(.25),min:0,max:1}];let l,c;const h=e.getFramebuffer();null!=h&&null!=h.colorAttachments[t]?(l=h.colorAttachments[t],c=h.width):(l=m.mg,c=1,null!=h?console.warn("renderPass does not have framebuffer.colorAttachments["+t+"]"):console.warn("renderPass does not have framebuffer")),n.push({semantic:i.f5.FramebufferWidth,componentType:a.r.Float,compositionType:o.d.Scalar,stage:r.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.EveryTime,soloDatum:!1,initialValue:_.Ru.fromCopyNumber(c),min:0,max:Number.MAX_VALUE},{semantic:i.f5.BaseColorTexture,componentType:a.r.Int,compositionType:o.d.Texture2D,stage:r.H.PixelShader,isCustomSetting:!1,updateInterval:s.a.EveryTime,initialValue:[0,l],min:0,max:Number.MAX_SAFE_INTEGER}),this.setShaderSemanticsInfoArray(n)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&this.setWorldMatrix(t,i.worldMatrix);let o=i.renderPass.cameraComponent;null==o&&(o=l.C.getComponent(c.M,c.M.current)),o&&(this.setViewInfo(t,o,i.isVr,i.displayIdx),this.setProjection(t,o,i.isVr,i.displayIdx))}}f.LuminanceCriterion=new i.wy({str:"luminanceCriterion"}),f.LuminanceReduce=new i.wy({str:"luminanceReduce"}),f.FramebufferWidth=new i.wy({str:"framebufferWidth"})},8774:(e,t,n)=>{"use strict";n.d(t,{z:()=>v});var i=n(4587),o=n(5868),a=n(810),r=n(3999),s=n(2471),l=n(5324),c=n(3616),_=n(1813),h=n(2404),u=n(224),d=n(3496),m=n(2566);const f={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout float v_instanceInfo;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\n\nvoid main()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n v_instanceInfo = a_instanceInfo.x;\n}\n",shaderStage:"vertex",isFragmentShader:!1},p={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin float v_instanceInfo;\n\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nconst vec4 bitEnc = vec4(1.,255.,65025.,16581375.);\nconst vec4 bitDec = 1./bitEnc;\n\nvec4 encodeFloatRGBA(float v) {\n float val = v;\n float r = mod(val, 255.0);\n val -= r;\n float g = mod(val, 65025.0);\n val -= g;\n float b = mod(val, 16581375.0);\n return vec4(r/255.0, g/65025.0, b/16581375.0, 1.0);\n}\n\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n rt0 = encodeFloatRGBA(v_instanceInfo);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};class v extends o.P{constructor(){super(null,"entityUidOutputShading+skinning-lighting",{isMorphing:!1,isSkinning:!0,isLighting:!1},f,p);const e=[{semantic:i.f5.WorldMatrix,isComponentData:!0,compositionType:a.d.Mat4,componentType:r.r.Float,stage:l.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.EveryTime,initialValue:d.e.zero()},{semantic:i.f5.NormalMatrix,isComponentData:!0,compositionType:a.d.Mat3,componentType:r.r.Float,stage:l.H.VertexShader,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!0,updateInterval:_.a.EveryTime,initialValue:m.x.zero()},{semantic:i.f5.PointSize,componentType:r.r.Float,compositionType:a.d.Scalar,stage:l.H.VertexShader,isCustomSetting:!1,updateInterval:_.a.FirstTimeOnly,soloDatum:!0,initialValue:c.Ru.fromCopyNumber(30),min:0,max:100},{semantic:i.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:a.d.Vec3,stage:l.H.VertexShader,isCustomSetting:!1,updateInterval:_.a.FirstTimeOnly,soloDatum:!0,initialValue:s.P.fromCopyArray([0,.1,.01]),min:0,max:1}];this.__definitions+="#define RN_IS_SKINNING\n",this.setShaderSemanticsInfoArray(e)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix));let o=i.renderPass.cameraComponent;null==o&&(o=h.C.getComponent(u.M,u.M.current)),this.setViewInfo(t,o,i.isVr,i.displayIdx),this.setProjection(t,o,i.isVr,i.displayIdx);const a=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,a),this.setLightsInfo(t,i.lightComponents,e,i.setUniform)}}},8287:(e,t,n)=>{"use strict";n.d(t,{b:()=>p});var i=n(3999),o=n(810),a=n(3616),r=n(4587),s=n(5324),l=n(1813),c=n(2390),_=n(5868),h=n(2404),u=n(224);const d={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord;\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec2 v_texcoord;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n v_normal_inWorld = normalMatrix * a_normal;\n v_position_inWorld = worldMatrix * vec4(a_position, 1.0);\n v_texcoord = a_texcoord;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},m={code:'\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec2 v_texcoord;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n\n/* shaderity: @{getters} */\n\n#define MATH_PI 3.141592\n\n// These codes are referenced from https://github.com/knarkowicz/FurnaceTest\nfloat roughnessRemap(float userRoughness) {\n return userRoughness * userRoughness;\n}\n\n// GGX NDF\nfloat d_ggx(float userRoughness, float NH) {\n float alphaRoughness = userRoughness * userRoughness;\n float roughnessSqr = alphaRoughness * alphaRoughness;\n float f = (roughnessSqr - 1.0) * NH * NH + 1.0;\n return roughnessSqr / (MATH_PI * f * f);\n}\n\n// this is from https://www.unrealengine.com/blog/physically-based-shading-on-mobile\nvec2 envBRDFApprox( float Roughness, float NoV ) {\n const vec4 c0 = vec4(-1, -0.0275, -0.572, 0.022 );\n const vec4 c1 = vec4(1, 0.0425, 1.04, -0.04 );\n vec4 r = Roughness * c0 + c1;\n float a004 = min( r.x * r.x, exp2( -9.28 * NoV ) ) * r.x + r.y;\n vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n return AB;\n}\n\nfloat specularIBL(float userRoughness, float NV, float f0) {\n /// Use specular BRDF LUT\n // vec3 brdf = texture(u_brdfLutTexture, vec2(NV, 1.0 - userRoughness)).rgb;\n // float specular = 1.0 * (f0 * brdf.x + brdf.y);\n\n /// Use specular BRDF Approx\n vec2 f_ab = envBRDFApprox(userRoughness, NV);\n vec3 specular = vec3(f0) * f_ab.x + f_ab.y;\n return specular.x;\n}\n\n// The Schlick Approximation to Fresnel\nfloat fresnel(float f0, float VH) {\n return f0 + (1.0 - f0) * pow(1.0 - VH, 5.0);\n}\n\nfloat smithG1(float roughness, float NoV)\n{\n\tfloat a = roughnessRemap( roughness );\n\tfloat a2 = a * a;\n\tfloat NoV2 = NoV * NoV;\n\tfloat lambda = (-1.0 + sqrt(1.0 + a2 * (1.0 - NoV2) / NoV2)) * 0.5;\n\treturn 1.0 / (1.0 + lambda);\n}\n\nfloat smithG(float roughness, float NoV, float NoL)\n{\n\tfloat a = roughnessRemap( roughness );\n\tfloat a2 = a * a;\n\tfloat NoV2 = NoV * NoV;\n\tfloat NoL2 = NoL * NoL;\n\tfloat lambdaV = (-1.0 + sqrt(1.0 + a2 * (1.0 - NoV2) / NoV2)) * 0.5;\n\tfloat lambdaL = (-1.0 + sqrt(1.0 + a2 * (1.0 - NoL2) / NoL2)) * 0.5;\n\treturn 1.0 / (1.0 + lambdaV + lambdaL);\n}\n\nfloat g_shieldingForWeak(float alphaRoughness, float NV, float NL) {\n float r = alphaRoughness;\n\n // Local Masking using "Schlick-Smith" Masking Function\n float localMasking = 2.0 * NV / (NV + sqrt(r * r + (1.0 - r * r) * (NV * NV)));\n\n return localMasking;\n}\n\n\nfloat g_shielding(float roughness, float NV, float NL) {\n float a = roughnessRemap( roughness );\n float r = a;\n\n // Local Shadowing using "Schlick-Smith" Masking Function\n float localShadowing = 2.0 * NL / (NL + sqrt(r * r + (1.0 - r * r) * (NL * NL)));\n\n // Local Masking using "Schlick-Smith" Masking Function\n float localMasking = 2.0 * NV / (NV + sqrt(r * r + (1.0 - r * r) * (NV * NV)));\n\n return localShadowing * localMasking;\n}\n\nfloat v_SmithGGXCorrelatedForWeak(float roughness, float NV, float NL) {\n float a = roughnessRemap( roughness );\n float a2 = a * a;\n float GGXV = NL * sqrt(NV * NV * (1.0 - a2) + a2);\n return 0.5 / (GGXV);\n}\n\nfloat v_SmithGGXCorrelated(float roughness, float NV, float NL) {\n float a = roughnessRemap( roughness );\n float a2 = a * a;\n float GGXV = NL * sqrt(NV * NV * (1.0 - a2) + a2);\n float GGXL = NV * sqrt(NL * NL * (1.0 - a2) + a2);\n return 0.5 / (GGXV + GGXL);\n}\n\n// this is from https://learnopengl.com/PBR/IBL/Specular-IBL\nfloat vanDerCorpus(int n, int base)\n{\n float invBase = 1.0 / float(base);\n float denom = 1.0;\n float result = 0.0;\n\n for(int i = 0; i < 32; ++i)\n {\n if(n > 0)\n {\n denom = mod(float(n), 2.0);\n result += denom * invBase;\n invBase = invBase / 2.0;\n n = int(float(n) / 2.0);\n }\n }\n\n return result;\n}\n\nvec2 hammersleyNoBitOps(int i, int N)\n{\n return vec2(float(i)/float(N), vanDerCorpus(i, 2));\n}\n\nfloat radicalInverse_VdC(uint bits)\n{\n bits = (bits << 16u) | (bits >> 16u);\n bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);\n bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);\n bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);\n bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);\n return float(bits) * 2.3283064365386963e-10; // / 0x100000000\n}\n// ----------------------------------------------------------------------------\nvec2 hammersley(uint i, uint N)\n{\n return vec2(float(i)/float(N), radicalInverse_VdC(i));\n}\n\nvec3 sampleHemisphereGGX(vec2 Xi, float roughness) {\n float a = roughnessRemap(roughness);\n\tfloat a2 = a * a;\n\n float phi = 2.0 * MATH_PI * Xi.x;\n float cosPhi = cos(phi);\n float sinPhi = sin(phi);\n float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a2 - 1.0) * Xi.y)); // GGX\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\n\n return vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);\n}\n\nfloat weakWhiteFurnaceTest(float roughness, float NoV, float f0, int g_type, int disable_fresnel)\n{\n\tfloat vx = sqrt(1.0 - NoV * NoV);\n\tfloat vy = 0.0;\n\tfloat vz = NoV;\n\n\tfloat integral = 0.0;\n\tconst uint sampleNum = 2048u;\n\tfor (uint i = 0u; i < sampleNum; ++i)\n\t{\n vec2 Xi = hammersley(i, sampleNum);\n\n vec3 hvec = sampleHemisphereGGX(Xi, roughness);\n\n\t\tfloat VoHUnsat = vx * hvec.x + vy * hvec.y + vz * hvec.z;\n\n float lz = 2.0 * VoHUnsat * hvec.z - vz;\n\n float NoL = max(lz, 0.0);\n\t\tfloat NoH = max(hvec.z, 0.0);\n\t\tfloat VoH = max(VoHUnsat, 0.0);\n\n float f = fresnel(f0, VoH);\n\n float g1 = 0.0;\n if (g_type == 0) {\n g1 = smithG1(roughness, NoV);\n } else if (g_type == 1) {\n g1 = g_shieldingForWeak(roughness, NoV, NoL);\n } else if (g_type == 2) {\n g1 = v_SmithGGXCorrelatedForWeak(roughness, NoV, NoL) * 4.0 * NoV * NoL;\n }\n\n float pdf = 4.0 * VoH / NoH;\n float integralValue = (g1 * pdf) / (4.0 * NoV);\n if (disable_fresnel == 0) {\n integralValue *= f;\n }\n // integralValue *= 0.5; // Set furnace color 0.5\n\n integral += integralValue;\n\n\t}\n\tintegral /= float(sampleNum);\n\treturn clamp(integral, 0.0, 1.0);\n}\n\nfloat whiteFurnaceTest(float roughness, float NoV, float f0, int g_type, int disable_fresnel)\n{\n\tfloat vx = sqrt(1.0 - NoV * NoV);\n\tfloat vy = 0.0;\n\tfloat vz = NoV;\n\n\tfloat integral = 0.0;\n\tconst uint sampleNum = 4096u;\n\tfor (uint i = 0u; i < sampleNum; ++i)\n\t{\n\n vec2 Xi = hammersley(i, sampleNum);\n\n vec3 hvec = sampleHemisphereGGX(Xi, roughness);\n\n\t\tfloat VoHUnsat = vx * hvec.x + vy * hvec.y + vz * hvec.z;\n\t\tfloat lx = 2.0 * VoHUnsat * hvec.x - vx;\n\t\tfloat ly = 2.0 * VoHUnsat * hvec.y - vy;\n\t\tfloat lz = 2.0 * VoHUnsat * hvec.z - vz;\n\n\t\tfloat NoL = max(lz, 0.0);\n\t\tfloat NoH = max(hvec.z, 0.0);\n float VoH = max(VoHUnsat, 0.0);\n\n float f = fresnel(f0, VoH);\n\n float g = 0.0;\n if (g_type == 0) {\n g = smithG(roughness, NoV, NoL);\n } else if (g_type == 1){\n g = g_shielding(roughness, NoV, NoL);\n } else if (g_type == 2){\n g = v_SmithGGXCorrelated(roughness, NoV, NoL) * (4.0 * NoV * NoL);\n } else if (g_type == 3) {\n g = 0.0;\n }\n\n float pdf = 4.0 * VoH / NoH;\n float integralValue = (g * pdf) / (4.0 * NoV);\n if (disable_fresnel == 0 && g_type != 3) {\n integralValue *= f;\n }\n // integralValue *= 0.5; // Set furnace color 0.5\n integral += integralValue;\n\t}\n integral /= float(sampleNum);\n if (g_type == 3) {\n integral = specularIBL(roughness, NoV, f0);\n }\n\treturn clamp(integral, 0.0, 1.0);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec2 quadSizeInPixel = get_screenInfo(materialSID, 0);\n float roughness = 0.0;\n float NoV = 0.0; // normal dot view vector\n\n // 2D mode\n int mode = get_mode(materialSID, 0);\n if (mode == 0) {\n roughness = (gl_FragCoord.y) / quadSizeInPixel.y;\n NoV = (gl_FragCoord.x) / quadSizeInPixel.x;\n } else {\n // object mode\n // Roughness\n const float c_MinRoughness = 0.04;\n vec2 metallicRoughnessFactor = get_metallicRoughnessFactor(materialSID, 0);\n float userRoughness = metallicRoughnessFactor.y;\n float metallic = metallicRoughnessFactor.x;\n\n vec4 ormTexel = texture(u_metallicRoughnessTexture, v_texcoord);\n userRoughness = ormTexel.g * userRoughness;\n userRoughness = clamp(userRoughness, c_MinRoughness, 1.0);\n roughness = userRoughness;\n\n // vec3 viewVector = normalize(vec3(0.0, 0.0, 10.0) - v_position_inWorld.xyz);\n // vec3 viewVector = normalize(u_viewPosition - v_position_inWorld.xyz);\n vec3 viewVector = vec3(0.0, 0.0, 1.0);\n NoV = dot(v_normal_inWorld, viewVector);\n }\n\n int debugView = get_debugView(materialSID, 0);\n float f0 = get_f0(materialSID, 0);\n int g_type = get_g_type(materialSID, 0);\n int disable_fresnel = get_disable_fresnel(materialSID, 0);\n\n if (debugView == 0) {\n float whiteFurnaceResult = whiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n rt0 = vec4(whiteFurnaceResult, whiteFurnaceResult, whiteFurnaceResult, 1.0);\n\n } else if (debugView == 1) {\n float weakWhiteFurnaceResult = weakWhiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n rt0 = vec4(weakWhiteFurnaceResult, weakWhiteFurnaceResult, weakWhiteFurnaceResult, 1.0);\n\n } else if (debugView == 2){\n float nn = NoV*0.5+0.5;\n rt0 = vec4(nn, nn, nn, 1.0);\n\n } else if (debugView == 3){\n rt0 = vec4(v_normal_inWorld.xyz, 1.0);\n\n } else if (debugView == 4){\n float whiteFurnaceResult = whiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n float weakWhiteFurnaceResult = weakWhiteFurnaceTest(roughness, NoV, f0, g_type, disable_fresnel);\n rt0 = vec4(whiteFurnaceResult, weakWhiteFurnaceResult, 0.0, 1.0);\n\n } else if (debugView == 5){\n rt0 = vec4(roughness, NoV, 0.0, 1.0);\n\n } else {\n rt0 = vec4(1.0, 1.0, 1.0, 1.0);\n }\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n',shaderStage:"fragment",isFragmentShader:!0};var f=n(2192);class p extends _.P{constructor(){super(null,"FurnaceTestShading",{},d,m);const e=[{semantic:p.debugView,componentType:i.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(0),min:0,max:1},{semantic:p.disable_fresnel,componentType:i.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(0),min:0,max:1},{semantic:p.f0,componentType:i.r.Float,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(1),min:0,max:1},{semantic:p.g_type,componentType:i.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(0),min:0,max:3},{semantic:p.mode,componentType:i.r.Int,compositionType:o.d.Scalar,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:a.Ru.fromCopyNumber(0),min:0,max:1},{semantic:r.f5.ScreenInfo,componentType:i.r.Float,compositionType:o.d.Vec2,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:c.FM.fromCopyArray2([0,0]),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:r.f5.MetallicRoughnessFactor,componentType:i.r.Float,compositionType:o.d.Vec2,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,soloDatum:!1,initialValue:c.FM.fromCopyArray2([1,1]),min:0,max:2},{semantic:r.f5.MetallicRoughnessTexture,componentType:i.r.Int,compositionType:o.d.Texture2D,stage:s.H.PixelShader,isCustomSetting:!1,updateInterval:l.a.FirstTimeOnly,initialValue:[1,f.Dx],min:0,max:Number.MAX_SAFE_INTEGER}];this.setShaderSemanticsInfoArray(e)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){if(i.setUniform&&(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix),n)){let n=i.renderPass.cameraComponent;null==n&&(n=h.C.getComponent(u.M,u.M.current)),this.setViewInfo(t,n,i.isVr,i.displayIdx),this.setProjection(t,n,i.isVr,i.displayIdx),this.setLightsInfo(t,i.lightComponents,e,i.setUniform)}}}p.mode=new r.wy({str:"mode"}),p.debugView=new r.wy({str:"debugView"}),p.g_type=new r.wy({str:"g_type"}),p.disable_fresnel=new r.wy({str:"disable_fresnel"}),p.f0=new r.wy({str:"f0"})},1554:(e,t,n)=>{"use strict";n.d(t,{f:()=>I});var i=n(5868),o=n(5704),a=n(224),r=n(7987),s=n(2404),l=n(3999),c=n(810),_=n(3258),h=n(3616),u=n(4587),d=n(5324),m=n(1813),f=n(2471),p=n(7192),v=n(4255);const A={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n #ifdef WEBXR_MULTI_VIEW_VIEW_NUM_2\nlayout(num_views=2) in;\n #endif\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\n// This shader is based on https://github.com/Santarh/MToon\n\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec3 a_position;\nin vec3 a_normal;\nin vec4 a_baryCentricCoord;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec2 v_texcoord_0;\nout vec3 v_baryCentricCoord;\nout vec3 v_normal_inView;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\nin vec4 a_tangent;\nout vec3 v_tangent_inWorld;\nout vec3 v_binormal_inWorld; // bitangent_inWorld\n#endif\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_NONE\n return;\n #endif\n #endif\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n bool isSkinning = false;\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n\n v_normal_inView = vec3(viewMatrix * vec4(v_normal_inWorld, 0.0));\n\n #ifndef RN_MTOON_IS_OUTLINE\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n #else\n #if defined(RN_MTOON_HAS_OUTLINE_WIDTH_TEXTURE)\n float outlineTex = texture(u_outlineWidthTexture, a_texcoord_0).r;\n #else\n float outlineTex = 1.0;\n #endif\n\n #if defined(RN_MTOON_OUTLINE_WIDTH_WORLD)\n float outlineWidth = get_outlineWidth(materialSID, 0);\n vec3 outlineOffset = 0.01 * outlineWidth * outlineTex * a_normal;\n vec4 worldOutlineOffset = worldMatrix * vec4(outlineOffset, 0.0);\n gl_Position = projectionMatrix * viewMatrix * (v_position_inWorld + worldOutlineOffset);\n\n #elif defined(RN_MTOON_OUTLINE_WIDTH_SCREEN)\n vec4 vertex = projectionMatrix * viewMatrix * v_position_inWorld;\n\n vec3 clipNormal = (projectionMatrix * vec4(v_normal_inView, 1.0)).xyz;\n vec2 projectedNormal = normalize(clipNormal.xy);\n float outlineScaledMaxDistance = get_outlineScaledMaxDistance(materialSID, 0);\n projectedNormal *= min(vertex.w, outlineScaledMaxDistance);\n float aspect = abs(get_aspect(0.0, 0)); //solo datum\n projectedNormal.x *= aspect;\n\n float outlineWidth = get_outlineWidth(materialSID, 0);\n vertex.xy += 0.01 * outlineWidth * outlineTex * projectedNormal * clamp(1.0 - abs(v_normal_inView.z), 0.0, 1.0); // ignore offset when normal toward camera\n\n gl_Position = vertex;\n #else\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n #endif\n #endif\n\n #ifdef RN_USE_TANGENT_ATTRIBUTE\n v_tangent_inWorld = normalMatrix * a_tangent.xyz;\n v_binormal_inWorld = cross(v_normal_inWorld, v_tangent_inWorld) * a_tangent.w;\n #endif\n\n v_texcoord_0 = a_texcoord_0;\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n}\n",shaderStage:"vertex",isFragmentShader:!1},y={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nconst float EPS_COL = 0.00001;\n\nin vec2 v_texcoord_0;\nin vec3 v_baryCentricCoord;\nin vec3 v_normal_inView;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n in vec3 v_tangent_inWorld;\n in vec3 v_binormal_inWorld; // bitangent_inWorld\n#endif\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvec3 linearToSrgb(vec3 linearColor) {\n return pow(linearColor, vec3(1.0/2.2));\n}\n\nvec3 srgbToLinear(vec3 srgbColor) {\n return pow(srgbColor, vec3(2.2));\n}\n\n#ifdef RN_USE_TANGENT_ATTRIBUTE\n mat3 getTBN(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord) {\n vec3 tangent_inWorld = normalize(v_tangent_inWorld);\n vec3 binormal_inWorld = normalize(v_binormal_inWorld);\n mat3 tbnMat_tangent_to_world = mat3(tangent_inWorld, binormal_inWorld, normal_inWorld);\n\n return tbnMat_tangent_to_world;\n }\n#else\n // This is based on http://www.thetenthplanet.de/archives/1180\n mat3 cotangent_frame(vec3 normal_inWorld, vec3 position, vec2 uv) {\n uv = gl_FrontFacing ? uv : -uv;\n\n // get edge vectors of the pixel triangle\n vec3 dp1 = dFdx(position);\n vec3 dp2 = dFdy(position);\n vec2 duv1 = dFdx(uv);\n vec2 duv2 = dFdy(uv);\n\n // solve the linear system\n vec3 dp2perp = cross(dp2, normal_inWorld);\n vec3 dp1perp = cross(normal_inWorld, dp1);\n vec3 tangent = dp2perp * duv1.x + dp1perp * duv2.x;\n vec3 bitangent = dp2perp * duv1.y + dp1perp * duv2.y;\n bitangent *= -1.0;\n\n // construct a scale-invariant frame\n float invMat = inversesqrt(max(dot(tangent, tangent), dot(bitangent, bitangent)));\n return mat3(tangent * invMat, bitangent * invMat, normal_inWorld);\n }\n\n mat3 getTBN(vec3 normal_inWorld, vec3 viewVector, vec2 texcoord) {\n mat3 tbnMat_tangent_to_world = cotangent_frame(normal_inWorld, -viewVector, texcoord);\n\n return tbnMat_tangent_to_world;\n }\n#endif\n\n\nvoid main (){\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_NONE\n discard;\n #endif\n #endif\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n\n // TODO\n // uv transform\n\n // TODO\n // uv animation\n\n // main color\n vec4 litTextureColor = texture(u_litColorTexture, v_texcoord_0);\n vec4 litColorFactor = get_litColor(materialSID, 0);\n\n // alpha\n float alpha = 1.0;\n\n #ifdef RN_ALPHATEST_ON\n alpha = litTextureColor.a * litColorFactor.a;\n float cutoff = get_cutoff(materialSID, 0);\n if(alpha < cutoff) discard;\n #elif defined(RN_ALPHABLEND_ON)\n alpha = litTextureColor.a * litColorFactor.a;\n #endif\n\n if (alpha < 0.01) {\n discard;\n }else{\n rt0.w = alpha;\n }\n\n\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_COLOR_FIXED\n vec3 outlineColor = get_outlineColor(materialSID, 0);\n rt0.xyz = outlineColor;\n\n rt0.xyz = srgbToLinear(rt0.xyz);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n #endif\n #endif\n\n // view vector\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n vec3 viewVector = viewPosition - v_position_inWorld.xyz;\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n #ifdef RN_MTOON_HAS_BUMPMAP\n vec3 normal = texture(u_normalTexture, v_texcoord_0).xyz * 2.0 - 1.0;\n mat3 TBN = getTBN(normal_inWorld, viewVector, v_texcoord_0);\n normal_inWorld = normalize(TBN * normal);\n #endif\n\n #ifdef RN_MTOON_IS_OUTLINE\n normal_inWorld *= -1.0;\n #endif\n\n\n // Lighting, Direct Light\n\n float shadowAttenuation = 1.0;\n // TODO: shadowmap computation\n\n float receiveShadowRate = get_receiveShadowRate(materialSID, 0);\n float lightAttenuation = shadowAttenuation * mix(1.0, shadowAttenuation, receiveShadowRate * texture(u_receiveShadowTexture, v_texcoord_0).r);\n\n float shadingGradeRate = get_shadingGradeRate(materialSID, 0);\n float shadingGrade = 1.0 - shadingGradeRate * (1.0 - texture(u_shadingGradeTexture, v_texcoord_0).r);\n float lightColorAttenuation = get_lightColorAttenuation(materialSID, 0);\n\n vec3 shadeColorFactor = get_shadeColor(materialSID, 0);\n vec3 shadeColor = shadeColorFactor * texture(u_shadeColorTexture, v_texcoord_0).xyz;\n shadeColor.xyz = srgbToLinear(shadeColor.xyz);\n\n vec3 litColor = litColorFactor.xyz * litTextureColor.xyz;\n litColor.xyz = srgbToLinear(litColor.xyz);\n\n\n float shadeShift = get_shadeShift(materialSID, 0);\n float shadeToony = get_shadeToony(materialSID, 0);\n\n vec3 lightings[/* shaderity: @{Config.maxLightNumberInShader} */];\n #ifdef RN_MTOON_DEBUG_LITSHADERATE\n float lightIntensities[/* shaderity: @{Config.maxLightNumberInShader} */];\n #endif\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n // lightAttenuation *= distanceAttenuation * spotEffect;\n float dotNL = dot(light.direction, normal_inWorld);\n float lightIntensity = dotNL * 0.5 + 0.5; // from [-1, +1] to [0, 1]\n lightIntensity = lightIntensity * lightAttenuation; // TODO: receive shadow\n lightIntensity = lightIntensity * shadingGrade; // darker\n lightIntensity = lightIntensity * 2.0 - 1.0; // from [0, 1] to [-1, +1]\n\n // tooned. mapping from [minIntensityThreshold, maxIntensityThreshold] to [0, 1]\n float maxIntensityThreshold = mix(1.0, shadeShift, shadeToony);\n float minIntensityThreshold = shadeShift;\n lightIntensity = clamp((lightIntensity - minIntensityThreshold) / max(EPS_COL, (maxIntensityThreshold - minIntensityThreshold)), 0.0, 1.0);\n #ifdef RN_MTOON_DEBUG_LITSHADERATE\n lightIntensities[i] = lightIntensity;\n #endif\n\n // Albedo color\n vec3 col = mix(shadeColor, litColor, lightIntensity);\n\n // Direct Light\n vec3 lighting = light.attenuatedIntensity;\n lighting = mix(lighting, vec3(max(EPS_COL, max(lighting.x, max(lighting.y, lighting.z)))), lightColorAttenuation); // color atten\n\n\n if(i > 0){\n lighting *= 0.5; // darken if additional light.\n lighting *= min(0.0, dotNL) + 1.0; // darken dotNL < 0 area by using half lambert\n // lighting *= shadowAttenuation; // darken if receiving shadow\n #ifdef RN_ALPHABLEND_ON\n lighting *= step(0.0, dotNL); // darken if transparent. Because Unity's transparent material can't receive shadowAttenuation.\n #endif\n }\n\n col *= lighting;\n lightings[i] = lighting;\n\n rt0.xyz += col;\n\n lightAttenuation = 1.0;\n }\n\n\n // Indirect Light\n vec3 indirectLighting = get_ambientColor(materialSID, 0);\n indirectLighting = srgbToLinear(indirectLighting);\n indirectLighting = mix(indirectLighting, vec3(max(EPS_COL, max(indirectLighting.x, max(indirectLighting.y, indirectLighting.z)))), lightColorAttenuation); // color atten\n // TODO: use ShadeIrad in www.ppsloan.org/publications/StupidSH36.pdf\n\n rt0.xyz += indirectLighting * litColor;\n rt0.xyz = min(rt0.xyz, litColor); // comment out if you want to PBR absolutely.\n\n\n #ifdef RN_MTOON_IS_OUTLINE\n #ifdef RN_MTOON_OUTLINE_COLOR_MIXED\n vec3 outlineColor = get_outlineColor(materialSID, 0);\n outlineColor = srgbToLinear(outlineColor);\n float outlineLightingMix = get_outlineLightingMix(materialSID, 0);\n rt0.xyz = outlineColor * mix(vec3(1.0), rt0.xyz, outlineLightingMix);\n #endif\n #else\n vec3 viewDirection = normalize(viewVector);\n\n float rimFresnelPower = get_rimFresnelPower(materialSID, 0);\n float rimLift = get_rimLift(materialSID, 0);\n vec3 rimColorFactor = get_rimColor(materialSID, 0);\n vec3 rimTextureColor = texture(u_rimTexture, v_texcoord_0).xyz;\n vec3 rimColor = srgbToLinear(rimColorFactor * rimTextureColor);\n vec3 rim = pow(clamp(1.0 - dot(normal_inWorld, viewDirection) + rimLift, 0.0, 1.0), rimFresnelPower) * rimColor;\n\n float staticRimLighting = 1.0;\n float rimLightingMix = get_rimLightingMix(materialSID, 0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) break;\n\n if(i > 0) staticRimLighting = 0.0;\n\n vec3 rimLighting = mix(vec3(staticRimLighting), lightings[i], vec3(rimLightingMix));\n rt0.xyz += rim * rimLighting;\n }\n\n // additive matcap\n vec3 cameraUp = get_cameraUp(0.0, 0); //solo datum\n vec3 worldViewUp = normalize(cameraUp - viewDirection * dot(viewDirection, cameraUp));\n vec3 worldViewRight = normalize(cross(viewDirection, worldViewUp));\n vec2 matcapUv = vec2(dot(worldViewRight, normal_inWorld), dot(worldViewUp, normal_inWorld)) * 0.5 + 0.5;\n vec3 matCapColor = srgbToLinear(texture(u_matCapTexture, matcapUv).xyz);\n rt0.xyz += matCapColor;\n\n\n // Emission\n vec3 emissionColor = get_emissionColor(materialSID, 0);\n vec3 emission = srgbToLinear(texture(u_emissionTexture, v_texcoord_0).xyz) * emissionColor;\n rt0.xyz += emission;\n #endif\n\n\n // debug\n #ifdef RN_MTOON_DEBUG_NORMAL\n rt0 = vec4(normal_inWorld * 0.5 + 0.5, alpha);\n\n rt0.xyz = srgbToLinear(rt0.xyz);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n #elif defined(RN_MTOON_DEBUG_LITSHADERATE)\n rt0 = vec4(0.0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) break;\n rt0 += vec4(lightIntensities[i] * lightings[i], alpha);\n }\n\n rt0.xyz = srgbToLinear(rt0.xyz);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n #endif\n\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\nfloat makeOutputSrgb = float(get_makeOutputSrgb(materialSID, 0));\nrt0.rgb = mix(rt0.rgb, linearToSrgb(rt0.rgb), makeOutputSrgb);\n\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var x=n(7009),g=n(2192);class I extends i.P{constructor(e,t,n,i,o,a,r,s,x,b){super(null,"MToonShading"+(o?"+morphing":"")+(a?"+skinning":"")+(r?"":"-lighting")+(s?"+tangentAttribute":""),{isMorphing:o,isSkinning:a,isLighting:r},A,y),this.__OutlineWidthModeIsScreen=!1,this.__floatProperties={},this.__vectorProperties={},this.__textureProperties={};const E=[];switch(null!=t?(this.__floatProperties=t.floatProperties,this.__vectorProperties=t.vectorProperties,this.__textureProperties=t.textureProperties):(this.__floatProperties._BlendMode=0,this.__floatProperties._BumpScale=1,this.__floatProperties._CullMode=2,this.__floatProperties._Cutoff=.5,this.__floatProperties._DebugMode=0,this.__floatProperties._DstBlend=0,this.__floatProperties._IndirectLightIntensity=.1,this.__floatProperties._LightColorAttenuation=0,this.__floatProperties._OutlineColorMode=0,this.__floatProperties._OutlineCullMode=1,this.__floatProperties._OutlineLightingMix=1,this.__floatProperties._OutlineScaledMaxDistance=1,this.__floatProperties._OutlineWidth=.5,this.__floatProperties._OutlineWidthMode=0,this.__floatProperties._ReceiveShadowRate=1,this.__floatProperties._RimFresnelPower=1,this.__floatProperties._RimLift=0,this.__floatProperties._RimLightingMix=0,this.__floatProperties._ShadeShift=0,this.__floatProperties._ShadeToony=.9,this.__floatProperties._ShadingGradeRate=1,this.__floatProperties._SrcBlend=1,this.__floatProperties._ZWrite=1,this.__vectorProperties._Color=[1,1,1,1],this.__vectorProperties._EmissionColor=[0,0,0],this.__vectorProperties._OutlineColor=[0,0,0,1],this.__vectorProperties._ShadeColor=[.97,.81,.86,1],this.__vectorProperties._RimColor=[0,0,0],this.__textureProperties._BumpMap=0,this.__textureProperties._EmissionMap=1,this.__textureProperties._MainTex=0,this.__textureProperties._OutlineWidthTexture=0,this.__textureProperties._ReceiveShadowTexture=0,this.__textureProperties._RimTexture=1,this.__textureProperties._ShadeTexture=0,this.__textureProperties._ShadingGradeTexture=0,this.__textureProperties._SphereAdd=1,n=[g.Dx,g.mg]),x&&(this.__floatProperties._DebugMode=x),E.push({semantic:I._Cutoff,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._Cutoff),min:0,max:1},{semantic:I._Color,componentType:l.r.Float,compositionType:c.d.Vec4,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:p.Lt.fromCopyArray(this.__vectorProperties._Color),min:0,max:1},{semantic:I._ShadeColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray(this.__vectorProperties._ShadeColor),min:0,max:1},{semantic:I._BumpScale,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._BumpScale),min:0,max:1},{semantic:I._ReceiveShadowRate,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._ReceiveShadowRate),min:0,max:1},{semantic:I._ShadingGradeRate,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._ShadingGradeRate),min:0,max:1},{semantic:I._ShadeShift,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._ShadeShift),min:0,max:1},{semantic:I._ShadeToony,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._ShadeToony),min:0,max:1},{semantic:I._LightColorAttenuation,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._LightColorAttenuation),min:0,max:1},{semantic:I._AmbientColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray([.5785,.5785,.5785]),min:0,max:1},{semantic:I._RimColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray(this.__vectorProperties._RimColor),min:0,max:1},{semantic:I._RimLightingMix,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._RimLightingMix),min:0,max:1},{semantic:I._RimFresnelPower,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._RimFresnelPower),min:0,max:1},{semantic:I._RimLift,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._RimLift),min:0,max:1},{semantic:I.CameraUp,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!0,soloDatum:!0,initialValue:f.P.fromCopyArray([0,1,0]),min:0,max:1},{semantic:I._EmissionColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray(this.__vectorProperties._EmissionColor),min:0,max:1},{semantic:u.f5.Wireframe,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray([0,0,1]),min:0,max:10},{semantic:u.f5.MakeOutputSrgb,compositionType:c.d.Scalar,componentType:l.r.Bool,stage:d.H.PixelShader,min:0,max:1,isCustomSetting:!1,updateInterval:m.a.FirstTimeOnly,initialValue:h.Ru.fromCopyNumber(b?1:0)}),this.__floatProperties._DebugMode){case 1:this.__definitions+="#define RN_MTOON_DEBUG_NORMAL\n";break;case 2:this.__definitions+="#define RN_MTOON_DEBUG_LITSHADERATE\n"}if(e){switch(this.__definitions+="#define RN_MTOON_IS_OUTLINE\n",this.__floatProperties._OutlineWidthMode){case 0:this.__definitions+="#define RN_MTOON_OUTLINE_NONE\n";break;case 1:this.__definitions+="#define RN_MTOON_OUTLINE_WIDTH_WORLD\n";break;case 2:this.__definitions+="#define RN_MTOON_OUTLINE_WIDTH_SCREEN\n",this.__OutlineWidthModeIsScreen=!0}switch(this.__floatProperties._OutlineColorMode){case 0:this.__definitions+="#define RN_MTOON_OUTLINE_COLOR_FIXED\n";break;case 1:this.__definitions+="#define RN_MTOON_OUTLINE_COLOR_MIXED\n"}E.push({semantic:I._OutlineWidth,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.VertexShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._OutlineWidth),min:0,max:1},{semantic:I._OutlineScaledMaxDistance,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.VertexShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._OutlineScaledMaxDistance),min:0,max:1},{semantic:I._OutlineColor,componentType:l.r.Float,compositionType:c.d.Vec3,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:f.P.fromCopyArray(this.__vectorProperties._OutlineColor),min:0,max:1},{semantic:I._OutlineLightingMix,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,soloDatum:!1,initialValue:h.Ru.fromCopyNumber(this.__floatProperties._OutlineLightingMix),min:0,max:1},{semantic:I.Aspect,componentType:l.r.Float,compositionType:c.d.Scalar,stage:d.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:h.Ru.fromCopyNumber(1),min:0,max:1})}r&&(this.__definitions+="#define RN_IS_LIGHTING\n"),a&&(this.__definitions+="#define RN_IS_SKINNING\n"),o&&(this.__definitions+="#define RN_IS_MORPHING\n",E.push({semantic:u.f5.MorphTargetNumber,componentType:l.r.Int,compositionType:c.d.Scalar,stage:d.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:h.Ru.fromCopyNumber(0),min:0,max:_.D.maxVertexMorphNumberInShader,needUniformInDataTextureMode:!0},{semantic:u.f5.DataTextureMorphOffsetPosition,componentType:l.r.Int,compositionType:c.d.ScalarArray,arrayLength:_.D.maxVertexMorphNumberInShader,stage:d.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new v.j(new Int32Array(_.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:u.f5.MorphWeights,componentType:l.r.Float,compositionType:c.d.ScalarArray,arrayLength:_.D.maxVertexMorphNumberInShader,stage:d.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new v.j(new Float32Array(_.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0})),s&&(this.__definitions+="#define RN_USE_TANGENT_ATTRIBUTE\n"),this.__setTextures(n,i,E,e),this.setShaderSemanticsInfoArray(E)}__setTextures(e,t,n,i){n.push({semantic:I._MainTex,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[0,e[this.__textureProperties._MainTex],t[this.__textureProperties._MainTex]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._ShadeTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[1,e[this.__textureProperties._ShadeTexture],t[this.__textureProperties._ShadeTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._ReceiveShadowTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[2,e[this.__textureProperties._ReceiveShadowTexture],t[this.__textureProperties._ReceiveShadowTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._ShadingGradeTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[3,e[this.__textureProperties._ShadingGradeTexture],t[this.__textureProperties._ShadingGradeTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._RimTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[4,e[this.__textureProperties._RimTexture],t[this.__textureProperties._RimTexture]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._SphereAdd,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[5,e[this.__textureProperties._SphereAdd],t[this.__textureProperties._SphereAdd]],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I._EmissionMap,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[6,e[this.__textureProperties._EmissionMap],t[this.__textureProperties._EmissionMap]],min:0,max:Number.MAX_SAFE_INTEGER}),n.push({semantic:I._BumpMap,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.PixelShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[8,e[this.__textureProperties._BumpMap],t[this.__textureProperties._BumpMap]],min:0,max:Number.MAX_SAFE_INTEGER}),this.__textureProperties._BumpMap!==e.length-2&&(this.__definitions+="#define RN_MTOON_HAS_BUMPMAP\n"),i&&(n.push({semantic:I._OutlineWidthTexture,componentType:l.r.Int,compositionType:c.d.Texture2D,stage:d.H.VertexShader,isCustomSetting:!1,updateInterval:m.a.EveryTime,initialValue:[9,e[this.__textureProperties._OutlineWidthTexture],t[this.__textureProperties._OutlineWidthTexture]],min:0,max:Number.MAX_SAFE_INTEGER}),this.__textureProperties._OutlineWidthTexture!==e.length-2&&(this.__definitions+="#define RN_MTOON_HAS_OUTLINE_WIDTH_TEXTURE\n"))}setMaterialParameters(e,t){if(null==I.usableBlendEquationModeAlpha&&I.__initializeUsableBlendEquationModeAlpha(),0!==this.__floatProperties._BlendMode){switch(this.__floatProperties._BlendMode){case 1:this.__definitions+="#define RN_ALPHATEST_ON\n",e.alphaMode=o.F.Mask;break;case 2:case 3:this.__definitions+="#define RN_ALPHABLEND_ON\n",e.alphaMode=o.F.Translucent}const t=32774,n=I.usableBlendEquationModeAlpha,i=I.unityBlendEnumCorrespondence(this.__floatProperties._SrcBlend),a=I.unityBlendEnumCorrespondence(this.__floatProperties._DstBlend);e.setBlendEquationMode(x.C.from(t),null!=n?x.C.from(n):void 0),e.setBlendFuncFactor(x.C.from(i),x.C.from(a))}if(t)switch(this.__floatProperties._OutlineCullMode){case 0:e.cullFace=!1;break;case 1:e.cullFace=!0,e.cullFrontFaceCCW=!1;break;case 2:e.cullFace=!0,e.cullFrontFaceCCW=!0}else switch(this.__floatProperties._CullMode){case 0:e.cullFace=!1;break;case 1:e.cullFace=!0,e.cullFrontFaceCCW=!1;break;case 2:e.cullFace=!0,e.cullFrontFaceCCW=!0}}static __initializeUsableBlendEquationModeAlpha(){const e=r.F.getWebGLResourceRepository().currentWebGLContextWrapper,t=e.getRawContextAsWebGL2();e.isWebGL2?I.usableBlendEquationModeAlpha=t.MAX:e.webgl1ExtBM?I.usableBlendEquationModeAlpha=e.webgl1ExtBM.MAX_EXT:I.usableBlendEquationModeAlpha=t.FUNC_ADD}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){let o=i.renderPass.cameraComponent;if(null==o&&(o=s.C.getComponent(a.M,a.M.current)),i.setUniform){this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix),this.setViewInfo(t,o,i.isVr,i.displayIdx),this.setProjection(t,o,i.isVr,i.displayIdx);const n=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,n),this.setLightsInfo(t,i.lightComponents,e,i.setUniform),t._gl.uniform3fv(t.cameraUp,o.upInner._v),this.__OutlineWidthModeIsScreen&&t._gl.uniform1f(t.aspect,o.aspect)}else e.setParameter(I.CameraUp,o.upInner),this.__OutlineWidthModeIsScreen&&e.setParameter(I.Aspect,o.aspect);const r=i.entity.tryToGetBlendShape();this.setMorphInfo(t,i.entity.getMesh(),i.primitive,r)}static unityBlendEnumCorrespondence(e){const t=r.F.getWebGLResourceRepository().currentWebGLContextWrapper.getRawContext();let n=t.ZERO;switch(e){case 0:n=t.ZERO;break;case 1:n=t.ONE;break;case 2:n=t.DST_COLOR;break;case 3:n=t.SRC_COLOR;break;case 4:n=t.ONE_MINUS_DST_COLOR;break;case 5:n=t.SRC_ALPHA;break;case 6:n=t.ONE_MINUS_SRC_COLOR;break;case 7:n=t.DST_ALPHA;break;case 8:n=t.ONE_MINUS_DST_ALPHA;break;case 9:n=t.SRC_ALPHA_SATURATE;break;case 10:n=t.ONE_MINUS_SRC_ALPHA}return n}}I._Cutoff=new u.wy({str:"cutoff"}),I._Color=new u.wy({str:"litColor"}),I._ShadeColor=new u.wy({str:"shadeColor"}),I._MainTex=new u.wy({str:"litColorTexture"}),I._ShadeTexture=new u.wy({str:"shadeColorTexture"}),I._BumpScale=new u.wy({str:"normalScale"}),I._BumpMap=new u.wy({str:"normalTexture"}),I._ReceiveShadowRate=new u.wy({str:"receiveShadowRate"}),I._ReceiveShadowTexture=new u.wy({str:"receiveShadowTexture"}),I._ShadingGradeRate=new u.wy({str:"shadingGradeRate"}),I._ShadingGradeTexture=new u.wy({str:"shadingGradeTexture"}),I._ShadeShift=new u.wy({str:"shadeShift"}),I._ShadeToony=new u.wy({str:"shadeToony"}),I._LightColorAttenuation=new u.wy({str:"lightColorAttenuation"}),I._AmbientColor=new u.wy({str:"ambientColor"}),I._RimTexture=new u.wy({str:"rimTexture"}),I._RimColor=new u.wy({str:"rimColor"}),I._RimLightingMix=new u.wy({str:"rimLightingMix"}),I._RimFresnelPower=new u.wy({str:"rimFresnelPower"}),I._RimLift=new u.wy({str:"rimLift"}),I._SphereAdd=new u.wy({str:"matCapTexture"}),I._EmissionColor=new u.wy({str:"emissionColor"}),I._EmissionMap=new u.wy({str:"emissionTexture"}),I._OutlineWidthTexture=new u.wy({str:"outlineWidthTexture"}),I._OutlineWidth=new u.wy({str:"outlineWidth"}),I._OutlineScaledMaxDistance=new u.wy({str:"outlineScaledMaxDistance"}),I._OutlineColor=new u.wy({str:"outlineColor"}),I._OutlineLightingMix=new u.wy({str:"outlineLightingMix"}),I.Aspect=new u.wy({str:"aspect"}),I.CameraUp=new u.wy({str:"cameraUp"})},9330:(e,t,n)=>{"use strict";n.d(t,{S:()=>A});var i=n(7290),o=n(224),a=n(2404),r=n(3999),s=n(810),l=n(3616),c=n(4587),_=n(5324),h=n(1813),u=n(2575),d=n(2471),m=n(5868);const f={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec4 a_instanceInfo;\nin vec3 a_baryCentricCoord;\nin vec3 a_position;\nin vec3 a_normal;\nin vec4 a_joint;\nin vec4 a_weight;\n\nout vec3 v_baryCentricCoord;\nout vec3 v_normal_inView;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n\n bool isSkinning = false;\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n v_normal_inView = vec3(viewMatrix * vec4(normalMatrix * a_normal, 0.0));\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n v_baryCentricCoord = a_baryCentricCoord;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},p={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec3 v_baryCentricCoord;\nin vec3 v_normal_inView;\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n vec3 normal_inView = normalize(v_normal_inView);\n normal_inView.y *= -1.0;\n vec2 normalUVCordinate = normal_inView.xy * 0.5 + 0.5;\n vec4 matCapColor = texture(u_matCapTexture, normalUVCordinate);\n rt0 = matCapColor;\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var v=n(2192);class A extends m.P{constructor(e,t,n,o){let a;super(null,"MatCapShading"+(e?"+skinning":""),{isSkinning:e},f,p),"string"==typeof t?(a=new u.x,async function(e){a.generateTextureFromUri(e,{type:r.r.UnsignedByte}),await a.loadFromUrlLazy()}(t)):n instanceof i.y?a=n:(console.warn("no matcap texture"),a=v.mg);const m=[];m.push({semantic:c.f5.Wireframe,componentType:r.r.Float,compositionType:s.d.Vec3,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:d.P.fromCopyArray([0,0,1]),min:0,max:10}),m.push({semantic:c.f5.PointSize,componentType:r.r.Float,compositionType:s.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:l.Ru.fromCopyNumber(30),min:0,max:100},{semantic:c.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:s.d.Vec3,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:d.P.fromCopyArray([0,.1,.01]),min:0,max:1}),e&&(this.__definitions+="#define RN_IS_SKINNING\n"),m.push({semantic:A.MatCapTexture,componentType:r.r.Int,compositionType:s.d.Texture2D,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[0,a,o],min:0,max:Number.MAX_SAFE_INTEGER}),this.setShaderSemanticsInfoArray(m)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){i.setUniform&&(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix));let r=i.renderPass.cameraComponent;null==r&&(r=a.C.getComponent(o.M,o.M.current)),this.setViewInfo(t,r,i.isVr,i.displayIdx),this.setProjection(t,r,i.isVr,i.displayIdx);const s=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,s)}}A.MatCapTexture=new c.wy({str:"matCapTexture"})},8283:(e,t,n)=>{"use strict";n.d(t,{u:()=>_});var i=n(4587),o=n(5868),a=n(430),r=n(5324),s=n(2404),l=n(224),c=n(7348);class _ extends o.P{constructor({name:e,vertexShaderityObj:t,pixelShaderityObj:n}){super(null,e,{});const i=a.u.getShaderDataReflection(t,o.P.__semanticsMap.get(this.shaderFunctionName)),s=a.u.getShaderDataReflection(n,o.P.__semanticsMap.get(this.shaderFunctionName));this.__vertexShaderityObject=t,this.__pixelShaderityObject=n;const l=i.shaderSemanticsInfoArray.concat();for(const e of s.shaderSemanticsInfoArray){const t=l.find((t=>t.semantic.str===e.semantic.str));t?t.stage=r.H.VertexAndPixelShader:l.push(e)}_.__removeUselessShaderSemantics(l),this.setShaderSemanticsInfoArray(l)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){if(i.setUniform){if(this.setWorldMatrix(t,i.worldMatrix),this.setNormalMatrix(t,i.normalMatrix),n||i.isVr){let e=i.renderPass.cameraComponent;null==e&&(e=s.C.getComponent(l.M,l.M.current)),this.setViewInfo(t,e,i.isVr,i.displayIdx),this.setProjection(t,e,i.isVr,i.displayIdx)}n&&this.setLightsInfo(t,i.lightComponents,e,i.setUniform);const o=i.entity.tryToGetSkeletal();this.setSkinning(t,i.setUniform,o)}const o=i.entity.tryToGetBlendShape();this.setMorphInfo(t,i.entity.getMesh(),i.primitive,o)}static __removeUselessShaderSemantics(e){const t=c.$.getInstance().getGlobalProperties();for(const n of t){const t=n.shaderSemanticsInfo,i=e.findIndex((e=>e.semantic.str===t.semantic.str));-1!==i&&e.splice(i,1)}const n=[i.f5.VertexAttributesExistenceArray,i.f5.WorldMatrix,i.f5.NormalMatrix,i.f5.PointSize,i.f5.PointDistanceAttenuation];for(const t of n){const n=e.findIndex((e=>e.semantic.str===t.str));-1!==n&&e.splice(n,1)}}}},9764:(e,t,n)=>{"use strict";n.d(t,{R:()=>I});var i=n(4587),o=n(5868),a=n(810),r=n(3999),s=n(7192),l=n(2471),c=n(9840),_=n(5324),h=n(1813),u=n(2404),d=n(224),m=n(4255),f=n(3616),p=n(3258),v=n(7987),A=n(3496);const y={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec2 a_texcoord_1;\nin vec4 a_joint;\nin vec4 a_weight;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec4 v_texcoord_1;\nout vec4 v_projPosition_from_light;\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n\n // Skeletal\n processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n // Shadow mapping\n mat4 lightViewProjectionMatrix = get_lightViewProjectionMatrix(materialSID, 0);\n v_projPosition_from_light = lightViewProjectionMatrix * v_position_inWorld;\n\n // Following tMatrix is based on https://wgld.org/d/webgl/w051.html\n mat4 tMatrix = mat4(\n 0.5, 0.0, 0.0, 0.0,\n 0.0, 0.5, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.5, 0.5, 0.0, 1.0\n );\n v_texcoord_1 = tMatrix * v_projPosition_from_light;\n\n v_color = a_color;\n v_normal_inWorld = normalMatrix * a_normal;\n v_texcoord_0 = a_texcoord_0;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},x={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec4 v_texcoord_1;\nin vec4 v_projPosition_from_light;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nfloat decodeRGBAToDepth(vec4 RGBA){\n const float rMask = 1.0;\n const float gMask = 1.0 / 255.0;\n const float bMask = 1.0 / (255.0 * 255.0);\n const float aMask = 1.0 / (255.0 * 255.0 * 255.0);\n float depth = dot(RGBA, vec4(rMask, gMask, bMask, aMask));\n return depth;\n}\n\nvoid main (){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n // diffuseColor\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture\n vec4 textureColor = texture(u_diffuseColorTexture, v_texcoord_0);\n if (textureColor.r > 0.05) {\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n }\n\n // shadow mapping\n if(v_projPosition_from_light.w > 0.0){\n float zNear = get_zNearInner(materialSID, 0);\n float zFar = get_zFarInner(materialSID, 0);\n float normalizationCoefficient = 1.0 / (zFar - zNear);\n\n vec2 shadowMapUV = v_texcoord_1.xy / v_texcoord_1.w;\n\n #ifdef RN_IS_DEBUGGING\n bool inShadowMap = (shadowMapUV.x >= 0.0 && shadowMapUV.x <= 1.0) && (shadowMapUV.y >= 0.0 && shadowMapUV.y <= 1.0);\n if(inShadowMap == false){\n rt0 = get_debugColorFactor(materialSID, 0);\n/* shaderity: @{renderTargetEnd} */\n\n return;\n }\n #endif\n\n float measureDepth = normalizationCoefficient * length(v_projPosition_from_light);\n float textureDepth = decodeRGBAToDepth(texture(u_depthTexture, shadowMapUV));\n float allowableDepthError = get_allowableDepthError(materialSID, 0);\n\n if(measureDepth > textureDepth + allowableDepthError){\n // case of shadow\n vec4 shadowColorFactor = get_shadowColorFactor(materialSID, 0);\n diffuseColor = shadowColorFactor.rgb;\n alpha = shadowColorFactor.a;\n }\n }\n\n // Lighting\n vec3 shadingColor = vec3(0.0, 0.0, 0.0);\n int shadingModel = get_shadingModel(materialSID, 0);\n if (shadingModel > 0) {\n\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n int lightNumber = get_lightNumber(materialSID, 0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, light.direction)) * light.attenuatedIntensity;\n\n vec3 viewPosition = get_viewPosition(cameraSID, 0);\n float shininess = get_shininess(materialSID, 0);\n if (shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 halfVector = normalize(light.direction + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), shininess);\n } else if (shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 R = reflect(light.direction, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), shininess);\n }\n\n }\n\n shadingColor = diffuse + specular;\n } else {\n shadingColor = diffuseColor;\n }\n\n rt0 = vec4(shadingColor, alpha);\n //rt0 = vec4(u_lightNumber, 0.0, 0.0, 1.0);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var g=n(2192);class I extends o.P{constructor({isMorphing:e,isSkinning:t,isLighting:n,isDebugging:o,colorAttachmentsNumber:u},d){super(null,"ShadowMapDecodeClassicShading"+(t?"+skinning":"")+(n?"":"-lighting"),{isMorphing:e,isSkinning:t,isLighting:n},y,x),this.__encodedDepthRenderPass=d;const v=d.getFramebuffer();if(null==v)return void console.error("encodedDepthRenderPass does not have framebuffer");const b=v.colorAttachments[u],E=d.getViewport();E.setComponents(1,1,E.z-1,E.w-1),d.setViewport(E);const T=[{semantic:i.f5.LightViewProjectionMatrix,compositionType:a.d.Mat4,componentType:r.r.Float,stage:_.H.VertexShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:A.e.zero(),min:-Number.MAX_VALUE,max:Number.MAX_VALUE},{semantic:i.f5.ShadingModel,compositionType:a.d.Scalar,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(c.D.Constant.index),min:0,max:3},{semantic:i.f5.Shininess,compositionType:a.d.Scalar,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(5),min:0,max:Number.MAX_VALUE},{semantic:I.AllowableDepthError,compositionType:a.d.Scalar,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e-4),min:0,max:1},{semantic:I.ShadowColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([.5,.5,.5,1]),min:0,max:1},{semantic:i.f5.DiffuseColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,1,1,1]),min:0,max:2},{semantic:I.IsPointLight,componentType:r.r.Bool,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1),min:0,max:1},{semantic:i.f5.Wireframe,componentType:r.r.Float,compositionType:a.d.Vec3,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:l.P.fromCopyArray([0,0,1]),min:0,max:10},{semantic:i.f5.NormalTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[0,g.$R],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:i.f5.DepthTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[0,b],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:i.f5.DiffuseColorTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[1,g.Dx],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.zNearInner,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(.1),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:I.zFarInner,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e4),min:1e-4,max:Number.MAX_SAFE_INTEGER}];T.push({semantic:i.f5.PointSize,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(30),min:0,max:100},{semantic:i.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:a.d.Vec3,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:l.P.fromCopyArray([0,.1,.01]),min:0,max:1}),t&&(this.__definitions+="#define RN_IS_SKINNING\n"),n&&(this.__definitions+="#define RN_IS_LIGHTING\n"),e&&(this.__definitions+="#define RN_IS_MORPHING\n",T.push({semantic:i.f5.MorphTargetNumber,componentType:r.r.Int,compositionType:a.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(0),min:0,max:p.D.maxVertexMorphNumberInShader,needUniformInDataTextureMode:!0},{semantic:i.f5.DataTextureMorphOffsetPosition,componentType:r.r.Int,compositionType:a.d.ScalarArray,arrayLength:p.D.maxVertexMorphNumberInShader,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new m.j(new Int32Array(p.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:i.f5.MorphWeights,componentType:r.r.Float,compositionType:a.d.ScalarArray,arrayLength:p.D.maxVertexMorphNumberInShader,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new m.j(new Float32Array(p.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0})),o&&(this.__definitions+="#define RN_IS_DEBUGGING\n",T.push({semantic:I.DebugColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,0,0,1]),min:0,max:2})),this.setShaderSemanticsInfoArray(T)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:o}){let a=o.renderPass.cameraComponent;null==a&&(a=u.C.getComponent(d.M,d.M.current));const r=this.__encodedDepthRenderPass.cameraComponent;o.setUniform?(this.setWorldMatrix(t,o.worldMatrix),this.setNormalMatrix(t,o.normalMatrix),this.setViewInfo(t,a,o.isVr,o.displayIdx),this.setProjection(t,a,o.isVr,o.displayIdx),I.__lastZNear!==r.zNearInner&&(t._gl.uniform1f(t.zNearInner,r.zNearInner),I.__lastZNear=r.zNearInner),I.__lastZFar!==r.zFarInner&&(t._gl.uniform1f(t.zFarInner,r.zFarInner),I.__lastZFar=r.zFarInner),v.F.getWebGLResourceRepository().setUniformValue(t,i.f5.LightViewProjectionMatrix.str,!0,this.__encodedDepthRenderPass.cameraComponent.viewProjectionMatrix)):(e.setParameter(I.zNearInner,r.zNearInner),e.setParameter(I.zFarInner,r.zFarInner),e.setParameter(i.f5.LightViewProjectionMatrix,this.__encodedDepthRenderPass.cameraComponent.viewProjectionMatrix));const s=o.entity.tryToGetSkeletal();this.setSkinning(t,o.setUniform,s),this.setLightsInfo(t,o.lightComponents,e,o.setUniform);const l=o.entity.tryToGetBlendShape();this.setMorphInfo(t,o.entity.getMesh(),o.primitive,l)}}I.ShadowColorFactor=new i.wy({str:"shadowColorFactor"}),I.ShadowAlpha=new i.wy({str:"shadowAlpha"}),I.NonShadowAlpha=new i.wy({str:"nonShadowAlpha"}),I.AllowableDepthError=new i.wy({str:"allowableDepthError"}),I.zNearInner=new i.wy({str:"zNearInner"}),I.zFarInner=new i.wy({str:"zFarInner"}),I.DebugColorFactor=new i.wy({str:"debugColorFactor"}),I.DepthTexture=new i.wy({str:"depthTexture"}),I.IsPointLight=new i.wy({str:"isPointLight"}),I.__lastZNear=0,I.__lastZFar=0},7369:(e,t,n)=>{"use strict";n.d(t,{d:()=>p});var i=n(224),o=n(2404),a=n(3999),r=n(810),s=n(4587),l=n(5324),c=n(1813),_=n(5868),h=n(4255),u=n(3616);const d={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec4 a_instanceInfo;\nin vec3 a_baryCentricCoord;\nin vec3 a_position;\n\nout vec3 v_baryCentricCoord;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\nmat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n\n#ifdef RN_NO_CAMERA_TRANSFORM\n gl_Position = worldMatrix * vec4(a_position, 1.0);\n#else\n\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * worldMatrix * vec4(a_position, 1.0);\n\n#endif\n\n\n v_baryCentricCoord = a_baryCentricCoord;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},m={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\nin vec3 v_baryCentricCoord;\n\n/* shaderity: @{renderTargetBegin} */\n\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3 + vec3(1.0 - wireframeWidthInner) * d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n float framebufferWidth = get_framebufferWidth(materialSID, 0);\n float tFrag = 1.0 / framebufferWidth;\n vec2 offset = gl_FragCoord.st;\n\n float synthesizeCoefficient0 = u_synthesizeCoefficient[0];\n vec3 color = synthesizeCoefficient0 * texture(u_synthesizeTexture0, offset * tFrag).rgb;\n\n vec4 targetTextureColor = texture(u_targetRegionTexture, offset * tFrag);\n if (targetTextureColor != vec4(1.0, 1.0, 1.0, 1.0)) {\n float synthesizeCoefficient1 = u_synthesizeCoefficient[1];\n float synthesizeCoefficient2 = u_synthesizeCoefficient[2];\n float synthesizeCoefficient3 = u_synthesizeCoefficient[3];\n float synthesizeCoefficient4 = u_synthesizeCoefficient[4];\n float synthesizeCoefficient5 = u_synthesizeCoefficient[5];\n\n color += synthesizeCoefficient1 * texture(u_synthesizeTexture1, offset * tFrag).rgb;\n color += synthesizeCoefficient2 * texture(u_synthesizeTexture2, offset * tFrag).rgb;\n color += synthesizeCoefficient3 * texture(u_synthesizeTexture3, offset * tFrag).rgb;\n color += synthesizeCoefficient4 * texture(u_synthesizeTexture4, offset * tFrag).rgb;\n color += synthesizeCoefficient5 * texture(u_synthesizeTexture5, offset * tFrag).rgb;\n }\n\n rt0 = vec4(color, 1.0);\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n\n",shaderStage:"fragment",isFragmentShader:!0};var f=n(2192);class p extends _.P{constructor(e,t=f.mg){var n,i,o,_,v,A;super(null,"synthesizeHDRTextureShading",{},d,m),this.existTargetRegion=null!=t,this.textureNumber=e.length;const y=[{semantic:s.f5.FramebufferWidth,componentType:a.r.Float,compositionType:r.d.Scalar,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,soloDatum:!1,initialValue:u.Ru.fromCopyNumber(e[0].width),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeCoefficient,componentType:a.r.Float,compositionType:r.d.ScalarArray,arrayLength:6,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,soloDatum:!1,initialValue:new h.j(new Float32Array(6)),min:0,max:1,needUniformInDataTextureMode:!0},{semantic:p.SynthesizeTexture0,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[0,null!==(n=e[0])&&void 0!==n?n:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture1,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[1,null!==(i=e[1])&&void 0!==i?i:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture2,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[2,null!==(o=e[2])&&void 0!==o?o:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture3,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[3,null!==(_=e[3])&&void 0!==_?_:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture4,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[4,null!==(v=e[4])&&void 0!==v?v:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.SynthesizeTexture5,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[5,null!==(A=e[5])&&void 0!==A?A:f.mg],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:p.TargetRegionTexture,componentType:a.r.Int,compositionType:r.d.Texture2D,stage:l.H.PixelShader,isCustomSetting:!1,updateInterval:c.a.EveryTime,initialValue:[6,t],min:0,max:Number.MAX_SAFE_INTEGER}];this.setShaderSemanticsInfoArray(y)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:a}){a.setUniform?this.setWorldMatrix(t,a.worldMatrix):t._gl.uniform1fv(t.synthesizeCoefficient,e.getParameter(p.SynthesizeCoefficient)._v);let r=a.renderPass.cameraComponent;null==r&&(r=o.C.getComponent(i.M,i.M.current)),r&&(this.setViewInfo(t,r,a.isVr,a.displayIdx),this.setProjection(t,r,a.isVr,a.displayIdx))}get existTargetRegionTexture(){return this.existTargetRegion}get synthesizeTextureNumber(){return this.textureNumber}}p.SynthesizeCoefficient=new s.wy({str:"synthesizeCoefficient"}),p.TargetRegionTexture=new s.wy({str:"targetRegionTexture"}),p.SynthesizeTexture0=new s.wy({str:"synthesizeTexture0"}),p.SynthesizeTexture1=new s.wy({str:"synthesizeTexture1"}),p.SynthesizeTexture2=new s.wy({str:"synthesizeTexture2"}),p.SynthesizeTexture3=new s.wy({str:"synthesizeTexture3"}),p.SynthesizeTexture4=new s.wy({str:"synthesizeTexture4"}),p.SynthesizeTexture5=new s.wy({str:"synthesizeTexture5"})},968:(e,t,n)=>{"use strict";n.d(t,{Q:()=>I});var i=n(4587),o=n(5868),a=n(810),r=n(3999),s=n(7192),l=n(2471),c=n(9840),_=n(5324),h=n(1813),u=n(2404),d=n(224),m=n(4255),f=n(3616),p=n(3258),v=n(7987),A=n(3496);const y={code:"\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nin vec3 a_position;\nin vec3 a_color;\nin vec3 a_normal;\nin vec4 a_instanceInfo;\nin vec2 a_texcoord_0;\nin vec4 a_joint;\nin vec4 a_weight;\nin vec4 a_baryCentricCoord;\nout vec3 v_color;\nout vec3 v_normal_inWorld;\nout vec4 v_position_inWorld;\nout vec2 v_texcoord_0;\nout vec4 v_texcoord_1;\nout vec4 v_projPosition_from_light;\nout vec3 v_baryCentricCoord;\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\n/* shaderity: @{getters} */\n\n/* shaderity: @{matricesGetters} */\n\nmat3 toNormalMatrix(mat4 m) {\n float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2], a03 = m[0][3],\n a10 = m[1][0], a11 = m[1][1], a12 = m[1][2], a13 = m[1][3],\n a20 = m[2][0], a21 = m[2][1], a22 = m[2][2], a23 = m[2][3],\n a30 = m[3][0], a31 = m[3][1], a32 = m[3][2], a33 = m[3][3];\n\n float b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32;\n\n float determinantVal = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n return mat3(\n a11 * b11 - a12 * b10 + a13 * b09, a12 * b08 - a10 * b11 - a13 * b07, a10 * b10 - a11 * b08 + a13 * b06,\n a02 * b10 - a01 * b11 - a03 * b09, a00 * b11 - a02 * b08 + a03 * b07, a01 * b08 - a00 * b10 - a03 * b06,\n a31 * b05 - a32 * b04 + a33 * b03, a32 * b02 - a30 * b05 - a33 * b01, a30 * b04 - a31 * b02 + a33 * b00) / determinantVal;\n}\n\n\n\n#ifdef RN_IS_SKINNING\n\nhighp mat4x3 createMatrixFromQuaternionTranslationScale( highp vec4 quaternion, highp vec3 translation, highp vec3 scale ) {\n highp vec4 q = quaternion;\n highp vec3 t = translation;\n\n highp float sx = q.x * q.x;\n highp float sy = q.y * q.y;\n highp float sz = q.z * q.z;\n highp float cx = q.y * q.z;\n highp float cy = q.x * q.z;\n highp float cz = q.x * q.y;\n highp float wx = q.w * q.x;\n highp float wy = q.w * q.y;\n highp float wz = q.w * q.z;\n\n highp mat4 mat = mat4(\n 1.0 - 2.0 * (sy + sz), 2.0 * (cz + wz), 2.0 * (cy - wy), 0.0,\n 2.0 * (cz - wz), 1.0 - 2.0 * (sx + sz), 2.0 * (cx + wx), 0.0,\n 2.0 * (cy + wy), 2.0 * (cx - wx), 1.0 - 2.0 * (sx + sy), 0.0,\n t.x, t.y, t.z, 1.0\n );\n\n highp mat4 uniformScaleMat = mat4(\n scale.x, 0.0, 0.0, 0.0,\n 0.0, scale.y, 0.0, 0.0,\n 0.0, 0.0, scale.z, 0.0,\n 0.0, 0.0, 0.0, 1.0\n );\n\n return mat4x3(mat*uniformScaleMat);\n}\n\nhighp vec4 unpackedVec2ToNormalizedVec4(highp vec2 vec_xy, highp float criteria){\n\n highp float r;\n highp float g;\n highp float b;\n highp float a;\n\n highp float ix = floor(vec_xy.x * criteria);\n highp float v1x = ix / criteria;\n highp float v1y = ix - floor(v1x) * criteria;\n\n r = ( v1x + 1.0 ) / (criteria-1.0);\n g = ( v1y + 1.0 ) / (criteria-1.0);\n\n highp float iy = floor( vec_xy.y * criteria);\n highp float v2x = iy / criteria;\n highp float v2y = iy - floor(v2x) * criteria;\n\n b = ( v2x + 1.0 ) / (criteria-1.0);\n a = ( v2y + 1.0 ) / (criteria-1.0);\n\n r -= 1.0/criteria;\n g -= 1.0/criteria;\n b -= 1.0/criteria;\n a -= 1.0/criteria;\n\n r = r*2.0-1.0;\n g = g*2.0-1.0;\n b = b*2.0-1.0;\n a = a*2.0-1.0;\n\n return vec4(r, g, b, a);\n}\n\nmat4x3 getSkinMatrix(float skeletalComponentSID) {\n\n#ifdef RN_BONE_DATA_TYPE_Mat43x1\n mat4x3 skinMat = a_weight.x * get_boneMatrix(skeletalComponentSID, int(a_joint.x));\n skinMat += a_weight.y * get_boneMatrix(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.z * get_boneMatrix(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.w * get_boneMatrix(skeletalComponentSID, int(a_joint.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2)\n vec2 criteria = vec2(4096.0, 4096.0);\n\n vec4 tq_x = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 sq_x = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.x));\n vec4 quat = unpackedVec2ToNormalizedVec4(vec2(tq_x.w, sq_x.w), criteria.x);\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(quat, tq_x.xyz, sq_x.xyz);\n\n vec4 tq_y = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.y));\n vec4 sq_y = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.y));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_y.w, sq_y.w), criteria.x);\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(quat, tq_y.xyz, sq_y.xyz);\n\n vec4 tq_z = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.z));\n vec4 sq_z = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.z));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_z.w, sq_z.w), criteria.x);\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(quat, tq_z.xyz, sq_z.xyz);\n\n vec4 tq_w = get_boneTranslatePackedQuat(skeletalComponentSID, int(a_joint.w));\n vec4 sq_w = get_boneScalePackedQuat(skeletalComponentSID, int(a_joint.w));\n quat = unpackedVec2ToNormalizedVec4(vec2(tq_w.w, sq_w.w), criteria.x);\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(quat, tq_w.xyz, sq_w.xyz);\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X2_OLD)\n vec4 ts_x = get_boneTranslateScale(skeletalComponentSID, int(a_joint.x));\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.x)), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = get_boneTranslateScale(skeletalComponentSID, int(a_joint.y));\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.y)), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = get_boneTranslateScale(skeletalComponentSID, int(a_joint.z));\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.z)), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = get_boneTranslateScale(skeletalComponentSID, int(a_joint.w));\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n get_boneQuaternion(skeletalComponentSID, int(a_joint.w)), ts_w.xyz, vec3(ts_w.w));\n\n#elif defined(RN_BONE_DATA_TYPE_VEC4X1)\n vec4 boneCompressedChunksX = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.x));\n vec4 boneCompressedChunksY = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.y));\n vec4 boneCompressedChunksZ = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.z));\n vec4 boneCompressedChunksW = get_boneCompressedChunk(skeletalComponentSID, int(a_joint.w));\n\n vec2 criteria = vec2(4096.0, 4096.0);\n vec4 boneCompressedInfo = get_boneCompressedInfo(0.0, 0);\n\n vec4 ts_x = unpackedVec2ToNormalizedVec4(boneCompressedChunksX.zw, criteria.y)*boneCompressedInfo;\n mat4x3 skinMat = a_weight.x * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksX.xy, criteria.x), ts_x.xyz, vec3(ts_x.w));\n vec4 ts_y = unpackedVec2ToNormalizedVec4(boneCompressedChunksY.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.y * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksY.xy, criteria.x), ts_y.xyz, vec3(ts_y.w));\n vec4 ts_z = unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.z * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksZ.xy, criteria.x), ts_z.xyz, vec3(ts_z.w));\n vec4 ts_w = unpackedVec2ToNormalizedVec4(boneCompressedChunksW.zw, criteria.y)*boneCompressedInfo;\n skinMat += a_weight.w * createMatrixFromQuaternionTranslationScale(\n unpackedVec2ToNormalizedVec4(boneCompressedChunksW.xy, criteria.x), ts_w.xyz, vec3(ts_w.w));\n#endif\n return skinMat;\n}\n#endif\n\n\n\n#ifdef RN_IS_SKINNING\nbool skinning(\n float skeletalComponentSID,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n )\n{\n mat4 skinMat = mat4(getSkinMatrix(skeletalComponentSID));\n outPosition_inWorld = skinMat * vec4(inPosition_inLocal, 1.0);\n outNormalMatrix = toNormalMatrix(skinMat);\n outNormal_inWorld = normalize(outNormalMatrix * inNormal_inLocal);\n\n return true;\n}\n#endif\n\nbool processGeometryWithMorphingAndSkinning(\n float skeletalComponentSID,\n in mat4 worldMatrix,\n in mat4 viewMatrix,\n in bool isBillboard,\n in mat3 inNormalMatrix,\n out mat3 outNormalMatrix,\n in vec3 inPosition_inLocal,\n out vec4 outPosition_inWorld,\n in vec3 inNormal_inLocal,\n out vec3 outNormal_inWorld\n) {\n bool isSkinning = false;\n\n vec3 position_inLocal;\n#ifdef RN_IS_MORPHING\n if (u_morphTargetNumber == 0) {\n#endif\n position_inLocal = inPosition_inLocal;\n#ifdef RN_IS_MORPHING\n } else {\n float vertexIdx = a_baryCentricCoord.w;\n position_inLocal = get_position(vertexIdx, inPosition_inLocal);\n }\n#endif\n\n mat4 worldMatrixInner = worldMatrix;\n if (isBillboard) {\n mat4 inverseViewMatrix = inverse(viewMatrix);\n inverseViewMatrix[3][0] = 0.0;//worldMatrix[3][0];\n inverseViewMatrix[3][1] = 0.0;//worldMatrix[3][1];\n inverseViewMatrix[3][2] = 0.0;//worldMatrix[3][2];\n worldMatrixInner = inverseViewMatrix * worldMatrix;\n }\n\n#ifdef RN_IS_SKINNING\n if (skeletalComponentSID >= 0.0) {\n isSkinning = skinning(skeletalComponentSID, inNormalMatrix, outNormalMatrix, position_inLocal, outPosition_inWorld, inNormal_inLocal, outNormal_inWorld);\n } else {\n#endif\n outNormalMatrix = inNormalMatrix;\n outPosition_inWorld = worldMatrixInner * vec4(position_inLocal, 1.0);\n outNormal_inWorld = normalize(inNormalMatrix * inNormal_inLocal);\n#ifdef RN_IS_SKINNING\n }\n#endif\n\n return isSkinning;\n}\n\n\nvoid main(){\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n mat3 normalMatrix = get_normalMatrix(a_instanceInfo.x);\n mat4 worldMatrix = get_worldMatrix(a_instanceInfo.x);\n mat4 viewMatrix = get_viewMatrix(cameraSID, 0);\n\n bool isSkinning = false;\n isSkinning = processGeometryWithMorphingAndSkinning(\n skeletalComponentSID,\n worldMatrix,\n viewMatrix,\n false,\n normalMatrix,\n normalMatrix,\n a_position,\n v_position_inWorld,\n a_normal,\n v_normal_inWorld\n );\n\n mat4 projectionMatrix = get_projectionMatrix(cameraSID, 0);\n gl_Position = projectionMatrix * viewMatrix * v_position_inWorld;\n\n// #ifdef RN_IS_POINTSPRITE\n\nvec4 position_inWorld = worldMatrix * vec4(a_position, 1.0);\nvec3 viewPosition = get_viewPosition(cameraSID, 0);\nfloat distanceFromCamera = length(position_inWorld.xyz - viewPosition);\nvec3 pointDistanceAttenuation = get_pointDistanceAttenuation(materialSID, 0);\nfloat distanceAttenuationFactor = sqrt(1.0/(pointDistanceAttenuation.x + pointDistanceAttenuation.y * distanceFromCamera + pointDistanceAttenuation.z * distanceFromCamera * distanceFromCamera));\nfloat maxPointSize = get_pointSize(materialSID, 0);\ngl_PointSize = clamp(distanceAttenuationFactor * maxPointSize, 0.0, maxPointSize);\n\n// #endif\n\n\n v_baryCentricCoord = a_baryCentricCoord.xyz;\n v_color = a_color;\n v_texcoord_0 = a_texcoord_0;\n\n // Shadow mapping\n mat4 lightViewProjectionMatrix = get_lightViewProjectionMatrix(materialSID, 0);\n v_projPosition_from_light = lightViewProjectionMatrix * v_position_inWorld;\n\n // Following tMatrix is based on https://wgld.org/d/webgl/w051.html\n mat4 tMatrix = mat4(\n 0.5, 0.0, 0.0, 0.0,\n 0.0, 0.5, 0.0, 0.0,\n 0.0, 0.0, 1.0, 0.0,\n 0.5, 0.5, 0.0, 1.0\n );\n v_texcoord_1 = tMatrix * v_projPosition_from_light;\n\n}\n",shaderStage:"vertex",isFragmentShader:!1},x={code:"\n#ifdef WEBGL1_EXT_SHADER_TEXTURE_LOD\n#extension GL_EXT_shader_texture_lod : require\n#endif\n\n#ifdef WEBGL1_EXT_STANDARD_DERIVATIVES\n#extension GL_OES_standard_derivatives : require\n#endif\n\n#ifdef WEBGL1_EXT_DRAW_BUFFERS\n#extension GL_EXT_draw_buffers : require\n#endif\n\n#ifdef WEBGL2_MULTI_VIEW\n#extension GL_OVR_multiview : require\n#endif\n\nprecision highp float;\nprecision highp int;\n\n\n/* shaderity: @{definitions} */\n\nconst float Epsilon = 0.0000001;\n#define saturateEpsilonToOne(x) clamp(x, Epsilon, 1.0)\n\nuniform float u_materialSID; // skipProcess=true\nuniform int u_isMainVr; // skipProcess=true\nuniform highp sampler2D u_dataTexture; // skipProcess=true\n/* shaderity: @{widthOfDataTexture} */\n/* shaderity: @{heightOfDataTexture} */\n\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n/* shaderity: @{dataUBOVec4Size} */\n/* shaderity: @{dataUBODefinition} */\n#endif\n\n\nhighp vec4 fetchElement(int vec4_idx) {\n#if defined(GLSL_ES3) && defined(RN_IS_DATATEXTURE_MODE) && defined(RN_IS_UBO_ENABLED)\n if (vec4_idx < dataUBOVec4Size) {\n return fetchVec4FromVec4Block(vec4_idx);\n } else {\n int idxOnDataTex = vec4_idx - dataUBOVec4Size;\n highp ivec2 uv = ivec2(idxOnDataTex % widthOfDataTexture, idxOnDataTex / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n }\n#elif defined(GLSL_ES3)\n highp ivec2 uv = ivec2(vec4_idx % widthOfDataTexture, vec4_idx / widthOfDataTexture);\n return texelFetch( u_dataTexture, uv, 0 );\n#else\n // This idea from https://qiita.com/YVT/items/c695ab4b3cf7faa93885\n highp vec2 invSize = vec2(1.0/float(widthOfDataTexture), 1.0/float(heightOfDataTexture));\n highp float t = (float(vec4_idx) + 0.5) * invSize.x;\n highp float x = fract(t);\n highp float y = (floor(t) + 0.5) * invSize.y;\n #ifdef GLSL_ES3\n return texture( u_dataTexture, vec2(x, y));\n #else\n return texture( u_dataTexture, vec2(x, y));\n #endif\n#endif\n}\n\nvec2 fetchVec2No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xy;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec2(val0.yz);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.zw);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec2(val0.w, val1.x);\n }\n}\n\nvec3 fetchVec3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 val = fetchElement(basePosIn16bytes);\n return val.xyz;\n } else if (posIn4bytes == 1) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n return vec3(val0.yzw);\n } else if (posIn4bytes == 2) {\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.zw, val1.x);\n } else { // posIn4bytes == 3\n vec4 val0 = fetchElement(basePosIn16bytes);\n vec4 val1 = fetchElement(basePosIn16bytes+1);\n return vec3(val0.w, val1.xy);\n }\n}\n\nvec4 fetchVec4(int vec4_idx) {\n return fetchElement(vec4_idx);\n}\n\nfloat fetchScalarNo16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n vec4 val = fetchElement(basePosIn16bytes);\n if (posIn4bytes == 0) {\n return val.x;\n } else if (posIn4bytes == 1) {\n return val.y;\n } else if (posIn4bytes == 2) {\n return val.z;\n } else if (posIn4bytes == 3) {\n return val.w;\n }\n}\n\nmat2 fetchMat2No16BytesAligned(int scalar_idx) {\n int vec4_idx = scalar_idx*4;\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat2 fetchMat2(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n\n mat2 val = mat2(\n col0.x, col0.y,\n col0.z, col0.w\n );\n\n return val;\n}\n\nmat3 fetchMat3No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n mat3 val = mat3(\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w\n );\n return val;\n }\n\n}\n\nmat3 fetchMat3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat3 val = mat3(\n col0.x, col0.y, col0.z,\n col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x\n );\n\n return val;\n}\n\nmat4 fetchMat4No16BytesAligned(int scalar_idx) {\n#ifdef GLSL_ES3\n int posIn4bytes = scalar_idx % 4;\n#else\n int posIn4bytes = int(mod(float(scalar_idx), 4.0));\n#endif\n\n int basePosIn16bytes = (scalar_idx - posIn4bytes) / 4;\n if (posIn4bytes == 0) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n return val;\n } else if (posIn4bytes == 1) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.y, col0.z, col0.w, col1.x,\n col1.y, col1.z, col1.w, col2.x,\n col2.y, col2.z, col2.w, col3.x,\n col3.y, col3.z, col3.w, col4.x\n );\n return val;\n } else if (posIn4bytes == 2) {\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.z, col0.w, col1.x, col1.y,\n col1.z, col1.w, col2.x, col2.y,\n col2.z, col2.w, col3.x, col3.y,\n col3.z, col3.w, col4.x, col4.y\n );\n return val;\n } else { // posIn4bytes == 3\n vec4 col0 = fetchElement(basePosIn16bytes);\n vec4 col1 = fetchElement(basePosIn16bytes + 1);\n vec4 col2 = fetchElement(basePosIn16bytes + 2);\n vec4 col3 = fetchElement(basePosIn16bytes + 3);\n vec4 col4 = fetchElement(basePosIn16bytes + 4);\n mat4 val = mat4(\n col0.w, col1.x, col1.y, col1.z,\n col1.w, col2.x, col2.y, col2.z,\n col2.w, col3.x, col3.y, col3.z,\n col3.w, col4.x, col4.y, col4.z\n );\n return val;\n }\n}\n\nmat4 fetchMat4(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n vec4 col3 = fetchElement(vec4_idx + 3);\n\n mat4 val = mat4(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w,\n col3.x, col3.y, col3.z, col3.w\n );\n\n return val;\n}\n\nmat4x3 fetchMat4x3(int vec4_idx) {\n vec4 col0 = fetchElement(vec4_idx);\n vec4 col1 = fetchElement(vec4_idx + 1);\n vec4 col2 = fetchElement(vec4_idx + 2);\n\n mat4x3 val = mat4x3(\n col0.x, col0.y, col0.z, col0.w,\n col1.x, col1.y, col1.z, col1.w,\n col2.x, col2.y, col2.z, col2.w);\n return val;\n}\n\nfloat rand(const vec2 co){\n return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\n\nvec3 descramble(vec3 v) {\n float seed = 0.0;\n v.x -= sin(fract(v.y*20.0));\n v.z -= cos(fract(-v.y*10.0));\n return v;\n}\n\nconst float PI = 3.14159265358979323846;\n\nfloat max3(vec3 v)\n{\n return max(max(v.x, v.y), v.z);\n}\n\nfloat sq(float t)\n{\n return t * t;\n}\n\nvec2 sq(vec2 t)\n{\n return t * t;\n}\n\nvec3 sq(vec3 t)\n{\n return t * t;\n}\n\nvec4 sq(vec4 t)\n{\n return t * t;\n}\n\nfloat saturate(float t)\n{\n return clamp(t, 0.0, 1.0);\n}\n\n\nin vec3 v_color;\nin vec3 v_normal_inWorld;\nin vec4 v_position_inWorld;\nin vec2 v_texcoord_0;\nin vec4 v_texcoord_1;\nin vec4 v_projPosition_from_light;\nin vec3 v_baryCentricCoord;\n\n/* shaderity: @{renderTargetBegin} */\n\n\n/* shaderity: @{getters} */\n\nstruct Light {\n int type; // 0 = directional, 1 = point, 2 = spot\n vec3 position;\n vec3 intensity;\n vec3 attenuatedIntensity;\n vec3 directionOfLightObject;\n vec3 direction; // direction of light vector, equal to normalize(light.pointToLight)\n vec3 pointToLight; // not normalized\n float spotAngleScale;\n float spotAngleOffset;\n float effectiveRange;\n};\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#range-property\nfloat getRangeAttenuation(Light light)\n{\n float distance = length(light.pointToLight);\n // means no range limit\n if (light.effectiveRange <= 0.0)\n {\n return 1.0 / pow(distance, 2.0);\n }\n return max(min(1.0 - pow(distance / light.effectiveRange, 4.0), 1.0), 0.0) / pow(distance, 2.0);\n}\n\n// https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md#inner-and-outer-cone-angles\nfloat getSpotAttenuation(Light light)\n{\n\n float cd = dot(light.directionOfLightObject, light.direction);\n float angularAttenuation = clamp(cd * light.spotAngleScale + light.spotAngleOffset, 0.0, 1.0);\n return angularAttenuation;\n}\n\nvoid getLightAttenuated(Light light) {\n light.attenuatedIntensity = light.intensity;\n // if (light.type == 0) { // Directional Light\n // Directional Light don't attenuate geometically\n // }\n\n // Point Light and Spot Light\n if (light.type != 0)\n {\n light.attenuatedIntensity *= getRangeAttenuation(light);\n }\n // Spot light\n if (light.type == 2)\n {\n light.attenuatedIntensity *= getSpotAttenuation(light);\n }\n}\n\nLight getLight(int lightIdx, vec3 v_position_inWorld) {\n vec3 lightPosition = get_lightPosition(0.0, lightIdx);\n vec3 direction_and_w_of_LightObject = get_lightDirection(0.0, lightIdx);\n vec3 lightIntensity = get_lightIntensity(0.0, lightIdx);\n vec4 lightProperty = get_lightProperty(0.0, lightIdx);\n Light light;\n light.directionOfLightObject = direction_and_w_of_LightObject;\n float lightType = lightProperty.x;\n light.effectiveRange = lightProperty.y;\n light.spotAngleScale = lightProperty.z;\n light.spotAngleOffset = lightProperty.w;\n\n light.intensity = lightIntensity;\n light.position = lightPosition;\n if (lightType < -0.5) { // disabled light\n light.intensity = vec3(0.0);\n light.type = -1;\n } else if (0.75 < lightType) { // is pointlight or spotlight\n light.pointToLight = lightPosition - v_position_inWorld;\n light.direction = normalize(light.pointToLight);\n light.type = 1;\n } else { // is Directional Light\n light.type = 0;\n light.direction = normalize(light.directionOfLightObject * -1.0);\n }\n\n if (lightType > 1.75) { // is spotlight\n light.type = 2;\n }\n\n const float M_PI = 3.141592653589793;\n light.intensity *= M_PI; // Punctual Light\n\n // Attenuation\n light.attenuatedIntensity = light.intensity;\n getLightAttenuated(light);\n\n return light;\n}\n\n\nfloat edge_ratio(vec3 bary3, float wireframeWidthInner, float wireframeWidthRelativeScale) {\n vec3 d = fwidth(bary3);\n vec3 x = bary3+vec3(1.0 - wireframeWidthInner)*d;\n vec3 a3 = smoothstep(vec3(0.0), d, x);\n float factor = min(min(a3.x, a3.y), a3.z);\n\n return clamp((1.0 - factor), 0.0, 1.0);\n}\n\nfloat decodeRGBAToDepth(vec4 RGBA){\n const float rMask = 1.0;\n const float gMask = 1.0 / 255.0;\n const float bMask = 1.0 / (255.0 * 255.0);\n const float aMask = 1.0 / (255.0 * 255.0 * 255.0);\n float depth = dot(RGBA, vec4(rMask, gMask, bMask, aMask));\n return depth;\n}\n\nfloat linstep(float min,float max,float v){\n return clamp((v-min)/(max-min),0.0,1.0);\n}\n\nfloat reduceLightBleeding(float p_max, float parameter){\n return linstep(parameter,1.0,p_max);\n}\n\nfloat chebyshevUpperBound(float materialSID){\n float textureDepth = decodeRGBAToDepth(texture2DProj(u_depthTexture, v_texcoord_1));\n float textureSquareDepth = decodeRGBAToDepth(texture2DProj(u_squareDepthTexture, v_texcoord_1));\n if(textureDepth == 1.0 || textureSquareDepth == 1.0){\n return 1.0;\n }\n\n float nonShadowProb = 1.0;\n\n if(v_projPosition_from_light.w > 0.0){\n float measureDepth;\n bool isPointLight = get_isPointLight(materialSID, 0);\n if(isPointLight){\n float zNear = get_zNearInner(materialSID, 0);\n float zFar = get_zFarInner(materialSID, 0);\n float normalizationCoefficient = 1.0 / (zFar - zNear);\n measureDepth = normalizationCoefficient * length(v_projPosition_from_light);\n }else{\n measureDepth = (v_projPosition_from_light / v_projPosition_from_light.w).z;\n }\n\n float depthAdjustment = get_depthAdjustment(materialSID, 0);\n measureDepth += depthAdjustment;\n\n float textureDepthAdjustment = get_textureDepthAdjustment(materialSID, 0);\n textureDepth += textureDepthAdjustment;\n\n float d = measureDepth - textureDepth;\n if(d < 0.0) return 1.0;\n\n float variance = textureSquareDepth - textureDepth * textureDepth;\n float minimumVariance = get_minimumVariance(materialSID, 0);\n variance = max(variance, minimumVariance);\n\n nonShadowProb = variance / (variance + d * d);\n\n\n float lightBleedingParameter = get_lightBleedingParameter(materialSID, 0);\n nonShadowProb = reduceLightBleeding(nonShadowProb, lightBleedingParameter);\n }\n return nonShadowProb;\n}\n\nvoid main ()\n{\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = int(u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.LightComponentTID} */]);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n #ifdef RN_IS_VERTEX_SHADER\n skeletalComponentSID = a_instanceInfo.y;\n #else\n skeletalComponentSID = -1.0;\n #endif\n #endif\n\n#else\n\n float materialSID = u_materialSID;\n\n int lightNumber = 0;\n #ifdef RN_IS_LIGHTING\n lightNumber = get_lightNumber(0.0, 0);\n #endif\n\n float skeletalComponentSID = -1.0;\n #ifdef RN_IS_SKINNING\n skeletalComponentSID = float(get_skinningMode(0.0, 0));\n #endif\n\n#endif\n\nfloat cameraSID = u_currentComponentSIDs[/* shaderity: @{WellKnownComponentTIDs.CameraComponentTID} */];\n#ifdef WEBGL2_MULTI_VIEW\nif (u_isMainVr == 1) {\n cameraSID += float(gl_ViewID_OVR);\n}\n#endif\n\n\n // Normal\n vec3 normal_inWorld = normalize(v_normal_inWorld);\n\n // diffuseColor\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n float alpha = 1.0;\n\n vec4 diffuseColorFactor = get_diffuseColorFactor(materialSID, 0);\n if (v_color != diffuseColor && diffuseColorFactor.rgb != diffuseColor) {\n diffuseColor = v_color * diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (v_color == diffuseColor) {\n diffuseColor = diffuseColorFactor.rgb;\n alpha = diffuseColorFactor.a;\n } else if (diffuseColorFactor.rgb == diffuseColor) {\n diffuseColor = v_color;\n } else {\n diffuseColor = vec3(1.0, 1.0, 1.0);\n }\n\n // diffuseColorTexture\n vec4 textureColor = texture(u_diffuseColorTexture, v_texcoord_0);\n if (textureColor.r > 0.05) {\n diffuseColor *= textureColor.rgb;\n alpha *= textureColor.a;\n }\n\n // shadow mapping\n vec4 shadowColor = get_shadowColor(materialSID, 0);\n\n float nonShadowProb = chebyshevUpperBound(materialSID);\n diffuseColor = nonShadowProb * diffuseColor + (1.0 - nonShadowProb) * shadowColor.rgb;\n alpha = nonShadowProb * alpha + (1.0 - nonShadowProb) * shadowColor.a;\n\n // Lighting\n vec3 shadingColor = vec3(0.0, 0.0, 0.0);\n\n int shadingModel = get_shadingModel(materialSID, 0);\n if (shadingModel > 0) {\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n int lightNumber = get_lightNumber(materialSID, 0);\n for (int i = 0; i < /* shaderity: @{Config.maxLightNumberInShader} */ ; i++) {\n if (i >= lightNumber) {\n break;\n }\n\n // Light\n Light light = getLight(i, v_position_inWorld.xyz);\n\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, light.direction)) * light.attenuatedIntensity;\n\n vec3 viewPosition = get_viewPosition(materialSID, 0);\n float shininess = get_shininess(materialSID, 0);\n if (shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 halfVector = normalize(light.direction + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), shininess);\n } else if (shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(viewPosition - v_position_inWorld.xyz);\n vec3 R = reflect(light.direction, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), shininess);\n }\n\n }\n\n shadingColor = diffuse + specular;\n } else {\n shadingColor = diffuseColor;\n }\n\n rt0 = vec4(shadingColor, alpha);\n\n // Wireframe\n float threshold = 0.001;\n vec3 wireframe = get_wireframe(materialSID, 0);\n float wireframeWidthInner = wireframe.z;\n float wireframeWidthRelativeScale = 1.0;\n if (wireframe.x > 0.5 && wireframe.y < 0.5) {\n rt0.a = 0.0;\n }\n vec4 wireframeResult = rt0;\n vec4 wireframeColor = vec4(0.2, 0.75, 0.0, 1.0);\n float edgeRatio = edge_ratio(v_baryCentricCoord, wireframeWidthInner, wireframeWidthRelativeScale);\n float edgeRatioModified = mix(step(threshold, edgeRatio), clamp(edgeRatio*4.0, 0.0, 1.0), wireframeWidthInner / wireframeWidthRelativeScale/4.0);\n // if r0.a is 0.0, it is wireframe not on shaded\n wireframeResult.rgb = wireframeColor.rgb * edgeRatioModified + rt0.rgb * (1.0 - edgeRatioModified);\n wireframeResult.a = max(rt0.a, wireframeColor.a * mix(edgeRatioModified, pow(edgeRatioModified, 100.0), wireframeWidthInner / wireframeWidthRelativeScale/1.0));\n\n if (wireframe.x > 0.5) {\n rt0 = wireframeResult;\n if (wireframe.y < 0.5 && rt0.a == 0.0) {\n discard;\n }\n }\n\n/* shaderity: @{renderTargetEnd} */\n\n}\n",shaderStage:"fragment",isFragmentShader:!0};var g=n(2192);class I extends o.P{constructor({isMorphing:e,isSkinning:t,isLighting:n,isDebugging:o,colorAttachmentsNumberDepth:u,colorAttachmentsNumberSquareDepth:d,depthCameraComponent:v},b){super(null,"varianceShadowMapDecodeShading"+(e?"+morphing":"")+(t?"+skinning":"")+(n?"":"-lighting")+(o?"":"+debugging"),{isMorphing:e,isSkinning:t,isLighting:n},y,x),2!==b.length&&console.error("invalid length of renderPasses"),null==v?console.warn("need to set depth camera component"):this.__depthCameraComponent=v;for(const e of b){const t=e.getViewport();t.setComponents(1,1,t.z-1,t.w-1),e.setViewport(t)}let E;const T=b[0].getFramebuffer();let S;T?E=T.colorAttachments[u]:(console.warn("renderPass of depth does not have framebuffer"),E=g.mg);const C=b[1].getFramebuffer();C?S=C.colorAttachments[d]:(console.warn("renderPass of square depth does not have framebuffer"),S=g.mg);const w=[{semantic:i.f5.LightViewProjectionMatrix,compositionType:a.d.Mat4,componentType:r.r.Float,stage:_.H.VertexShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:A.e.zero(),min:-Number.MAX_VALUE,max:Number.MAX_VALUE},{semantic:i.f5.ShadingModel,compositionType:a.d.Scalar,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(c.D.Constant.index),min:0,max:3},{semantic:i.f5.Shininess,compositionType:a.d.Scalar,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(5),min:0,max:Number.MAX_VALUE},{semantic:I.AllowableDepthError,compositionType:a.d.Scalar,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e-4),min:0,max:1},{semantic:I.ShadowColor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([.5,.5,.5,1]),min:0,max:1},{semantic:i.f5.DiffuseColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,1,1,1]),min:0,max:2},{semantic:I.zNearInner,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(.1),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:I.zFarInner,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!0,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e4),min:1e-4,max:Number.MAX_SAFE_INTEGER},{semantic:I.IsPointLight,componentType:r.r.Bool,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1),min:0,max:1},{semantic:i.f5.Wireframe,componentType:r.r.Float,compositionType:a.d.Vec3,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:l.P.fromCopyArray([0,0,1]),min:0,max:10},{semantic:I.DepthAdjustment,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(0),min:0,max:1},{semantic:I.LightBleedingParameter,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(0),min:0,max:1},{semantic:I.MinimumVariance,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(1e-7),min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.TextureDepthAdjustment,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,soloDatum:!1,initialValue:f.Ru.fromCopyNumber(0),min:0,max:1},{semantic:i.f5.NormalTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[0,g.$R],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:i.f5.DiffuseColorTexture,compositionType:a.d.Texture2D,componentType:r.r.Int,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[1,g.Dx],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.DepthTexture,componentType:r.r.Int,compositionType:a.d.Texture2D,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[2,E],min:0,max:Number.MAX_SAFE_INTEGER},{semantic:I.SquareDepthTexture,componentType:r.r.Int,compositionType:a.d.Texture2D,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.EveryTime,initialValue:[3,S],min:0,max:Number.MAX_SAFE_INTEGER}];w.push({semantic:i.f5.PointSize,componentType:r.r.Float,compositionType:a.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(30),min:0,max:100},{semantic:i.f5.PointDistanceAttenuation,componentType:r.r.Float,compositionType:a.d.Vec3,stage:_.H.VertexShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!0,initialValue:l.P.fromCopyArray([0,.1,.01]),min:0,max:1}),t&&(this.__definitions+="#define RN_IS_SKINNING\n"),n&&(this.__definitions+="#define RN_IS_LIGHTING\n"),e&&(this.__definitions+="#define RN_IS_MORPHING\n",w.push({semantic:i.f5.MorphTargetNumber,componentType:r.r.Int,compositionType:a.d.Scalar,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:f.Ru.fromCopyNumber(0),min:0,max:p.D.maxVertexMorphNumberInShader,needUniformInDataTextureMode:!0},{semantic:i.f5.DataTextureMorphOffsetPosition,componentType:r.r.Int,compositionType:a.d.ScalarArray,arrayLength:p.D.maxVertexMorphNumberInShader,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new m.j(new Int32Array(p.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0},{semantic:i.f5.MorphWeights,componentType:r.r.Float,compositionType:a.d.ScalarArray,arrayLength:p.D.maxVertexMorphNumberInShader,stage:_.H.VertexShader,isCustomSetting:!0,soloDatum:!0,initialValue:new m.j(new Float32Array(p.D.maxVertexMorphNumberInShader)),min:-Number.MAX_VALUE,max:Number.MAX_VALUE,needUniformInDataTextureMode:!0})),o&&(this.__definitions+="#define RN_IS_DEBUGGING\n",w.push({semantic:I.DebugColorFactor,compositionType:a.d.Vec4,componentType:r.r.Float,stage:_.H.PixelShader,isCustomSetting:!1,updateInterval:h.a.FirstTimeOnly,soloDatum:!1,initialValue:s.Lt.fromCopyArray([1,0,0,1]),min:0,max:2})),this.setShaderSemanticsInfoArray(w)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:o}){var a;let r=o.renderPass.cameraComponent;null==r&&(r=u.C.getComponent(d.M,d.M.current));const s=null!==(a=this.__depthCameraComponent)&&void 0!==a?a:o.renderPass.cameraComponent;o.setUniform?(this.setWorldMatrix(t,o.worldMatrix),this.setNormalMatrix(t,o.normalMatrix),this.setViewInfo(t,r,o.isVr,o.displayIdx),this.setProjection(t,r,o.isVr,o.displayIdx),I.__lastZNear!==s.zNearInner&&(t._gl.uniform1f(t.zNearInner,s.zNearInner),I.__lastZNear=s.zNearInner),I.__lastZFar!==s.zFarInner&&(t._gl.uniform1f(t.zFarInner,s.zFarInner),I.__lastZFar=s.zFarInner),v.F.getWebGLResourceRepository().setUniformValue(t,i.f5.LightViewProjectionMatrix.str,!0,s.viewProjectionMatrix)):(e.setParameter(I.zNearInner,s.zNearInner),e.setParameter(I.zFarInner,s.zFarInner),e.setParameter(i.f5.LightViewProjectionMatrix,s.viewProjectionMatrix));const l=o.entity.tryToGetSkeletal();this.setSkinning(t,o.setUniform,l),this.setLightsInfo(t,o.lightComponents,e,o.setUniform);const c=o.entity.tryToGetBlendShape();this.setMorphInfo(t,o.entity.getMesh(),o.primitive,c),v.F.getWebGLResourceRepository().setUniformValue(t,i.f5.LightViewProjectionMatrix.str,!0,s.viewProjectionMatrix)}set depthCameraComponent(e){this.__depthCameraComponent=e}}I.IsPointLight=new i.wy({str:"isPointLight"}),I.DepthTexture=new i.wy({str:"depthTexture"}),I.SquareDepthTexture=new i.wy({str:"squareDepthTexture"}),I.DepthAdjustment=new i.wy({str:"depthAdjustment"}),I.TextureDepthAdjustment=new i.wy({str:"textureDepthAdjustment"}),I.MinimumVariance=new i.wy({str:"minimumVariance"}),I.LightBleedingParameter=new i.wy({str:"lightBleedingParameter"}),I.ShadowColor=new i.wy({str:"shadowColor"}),I.AllowableDepthError=new i.wy({str:"allowableDepthError"}),I.zNearInner=new i.wy({str:"zNearInner"}),I.zFarInner=new i.wy({str:"zFarInner"}),I.DebugColorFactor=new i.wy({str:"debugColorFactor"}),I.__lastZNear=0,I.__lastZFar=0},5868:(e,t,n)=>{"use strict";n.d(t,{P:()=>v});var i=n(9002),o=n(7987),a=n(3258),r=n(8182),s=n(4536),l=n(2471),c=n(3496),_=n(128),h=n(7683),u=n(1226),d=n(8430),m=n(5324),f=n(2251),p=n(2404);class v extends i.S{constructor(e,t,{isMorphing:n=!1,isSkinning:i=!1,isLighting:a=!1}={},r,s){super(),this.__semantics=[],this.__vertexInputs=[],this.__pixelInputs=[],this.__vertexOutputs=[],this.__pixelOutputs=[],this.__defaultInputValues=new Map,this.__vertexInputConnections=[],this.__pixelInputConnections=[],this.isSingleOperation=!1,this.__definitions="",this.shaderType=m.H.VertexAndPixelShader,this.__shaderFunctionName=t,this.__materialNodeUid=++v.__invalidMaterialNodeCount,v.materialNodes[v.__invalidMaterialNodeCount]=this,this.__isMorphing=n,this.__isSkinning=i,this.__isLighting=a,this.__vertexShaderityObject=r,this.__pixelShaderityObject=s,this.__webglResourceRepository=o.F.getWebGLResourceRepository(),this.__definitions+=`#define RN_MATERIAL_NODE_NAME ${t}\n`}get shaderFunctionName(){return this.__shaderFunctionName}get vertexShaderityObject(){return this.__vertexShaderityObject}get pixelShaderityObject(){return this.__pixelShaderityObject}getDefinitions(e){let t=this.__definitions.concat();return t+="#define RN_IS_ALPHAMODE_"+e.alphaMode.str+"\n",t}static getMaterialNode(e){return v.materialNodes[e]}get materialNodeUid(){return this.__materialNodeUid}get _semanticsInfoArray(){return this.__semantics}get isSkinning(){return this.__isSkinning}get isMorphing(){return this.__isMorphing}get isLighting(){return this.__isLighting}setShaderSemanticsInfoArray(e){const t=[];for(const n of e)t.push(n);this.__semantics=t,v.__semanticsMap.has(this.shaderFunctionName)||v.__semanticsMap.set(this.shaderFunctionName,new Map);const n=v.__semanticsMap.get(this.shaderFunctionName);for(const e of this.__semantics)n.set(e.semantic.str,e)}getShaderSemanticInfoFromName(e){return v.__semanticsMap.get(this.shaderFunctionName).get(e)}addVertexInputConnection(e,t,n){this.__vertexInputConnections.push({materialNodeUid:e.materialNodeUid,outputNameOfPrev:t,inputNameOfThis:n})}addPixelInputConnection(e,t,n){this.__pixelInputConnections.push({materialNodeUid:e.materialNodeUid,outputNameOfPrev:t,inputNameOfThis:n})}get vertexInputConnections(){return this.__vertexInputConnections}get pixelInputConnections(){return this.__pixelInputConnections}getVertexInput(e){for(const t of this.__vertexInputs)if(t.name===e)return t}getVertexInputs(){return this.__vertexInputs}getVertexOutput(e){for(const t of this.__vertexOutputs)if(t.name===e)return t}getVertexOutputs(){return this.__vertexOutputs}getPixelInput(e){for(const t of this.__pixelInputs)if(t.name===e)return t}getPixelInputs(){return this.__pixelInputs}getPixelOutput(e){for(const t of this.__pixelOutputs)if(t.name===e)return t}getPixelOutputs(){return this.__pixelOutputs}setupBasicInfo(e,t,n,i,o){if(e.setUniform){if(this.setWorldMatrix(t,e.worldMatrix),this.setNormalMatrix(t,e.normalMatrix),this.setIsBillboard(t,e.isBillboard),n||e.isVr){let n=e.renderPass.cameraComponent;null==n&&(n=p.C.getComponent(o,o.current)),this.setViewInfo(t,n,e.isVr,e.displayIdx),this.setProjection(t,n,e.isVr,e.displayIdx)}if(n){this.setLightsInfo(t,e.lightComponents,i,e.setUniform);const n=e.entity.tryToGetSkeletal();this.setSkinning(t,e.setUniform,n)}}const a=e.entity.tryToGetBlendShape();this.setMorphInfo(t,e.entity.getMesh(),e.primitive,a)}setWorldMatrix(e,t){e._gl.uniformMatrix4fv(e.worldMatrix,!1,t._v)}setNormalMatrix(e,t){e._gl.uniformMatrix3fv(e.normalMatrix,!1,t._v)}setIsBillboard(e,t){e._gl.uniform1i(e.isBillboard,t?1:0)}setViewInfo(e,t,n,i){let o,a;if(n){const e=f.x.getInstance().getModule("xr").WebXRSystem.getInstance();e.isWebXRMode&&(o=e._getViewMatrixAt(i),a=e._getCameraWorldPositionAt(i))}else t?(a=t.worldPosition,o=t.viewMatrix):(o=c.e.identity(),a=l.P.fromCopyArray([0,0,10]));e._gl.uniformMatrix4fv(e.viewMatrix,!1,o._v),e._gl.uniform3fv(e.viewPosition,a._v)}setProjection(e,t,n,i){let o;if(n){const e=f.x.getInstance().getModule("xr").WebXRSystem.getInstance();e.isWebXRMode&&(o=e._getProjectMatrixAt(i))}else o=t?t.projectionMatrix:c.e.identity();e._gl.uniformMatrix4fv(e.projectionMatrix,!1,o._v)}setSkinning(e,t,n){if(this.__isSkinning)if(n){if(t){if(a.D.boneDataType===u.N.Mat43x1){const t=n.jointMatricesArray;e._gl.uniformMatrix4x3fv(e.boneMatrix,!1,t)}else if(a.D.boneDataType===u.N.Vec4x2){const t=n.jointTranslatePackedQuat,i=n.jointScalePackedQuat;e._gl.uniform4fv(e.boneTranslatePackedQuat,t),e._gl.uniform4fv(e.boneScalePackedQuat,i)}else if(a.D.boneDataType===u.N.Vec4x2Old){const t=n.jointQuaternionArray,i=n.jointTranslateScaleArray;e._gl.uniform4fv(e.boneQuaternion,t),e._gl.uniform4fv(e.boneTranslateScale,i)}else if(a.D.boneDataType===u.N.Vec4x1){const t=n.jointCompressedChunk,i=n.jointCompressedInfo;e._gl.uniform4fv(e.boneCompressedChunk,t),e._gl.uniform4fv(e.boneCompressedInfo,i._v)}e._gl.uniform1i(e.skinningMode,n.componentSID)}}else t&&e._gl.uniform1i(e.skinningMode,-1)}setLightsInfo(e,t,n,i){if(this.__isLighting&&i){const n=t.filter((e=>e.enable));e._gl.uniform1i(e.lightNumber,n.length);const i=Math.min(n.length,a.D.maxLightNumberInShader);v.__lightPositions.length!==3*i&&(v.__lightPositions=new Float32Array(3*i),v.__lightDirections=new Float32Array(3*i),v.__lightIntensities=new Float32Array(3*i),v.__lightProperties=new Float32Array(4*i));for(let t=0;t=a.D.maxLightNumberInShader)&&null!=e.lightPosition;t++){const e=n[t],i=e.entity.getSceneGraph().worldPosition,o=e.direction,a=e.intensity;v.__lightPositions[3*t+0]=i.x,v.__lightPositions[3*t+1]=i.y,v.__lightPositions[3*t+2]=i.z;const r=1/Math.max(.001,Math.cos(e.innerConeAngle)-Math.cos(e.outerConeAngle)),s=-Math.cos(e.outerConeAngle)*r;v.__lightDirections[3*t+0]=o.x,v.__lightDirections[3*t+1]=o.y,v.__lightDirections[3*t+2]=o.z,v.__lightIntensities[3*t+0]=a.x,v.__lightIntensities[3*t+1]=a.y,v.__lightIntensities[3*t+2]=a.z,v.__lightProperties[4*t+0]=e.enable?e.type.index:-1,v.__lightProperties[4*t+1]=e.range,v.__lightProperties[4*t+2]=r,v.__lightProperties[4*t+3]=s}i>0&&(e._gl.uniform3fv(e.lightPosition,v.__lightPositions),e._gl.uniform3fv(e.lightDirection,v.__lightDirections),e._gl.uniform3fv(e.lightIntensity,v.__lightIntensities),e._gl.uniform4fv(e.lightProperty,v.__lightProperties))}}setMorphInfo(e,t,n,i){if(!this.__isMorphing)return;if(0===n.targets.length)return void e._gl.uniform1i(e.morphTargetNumber,0);e._gl.uniform1i(e.morphTargetNumber,n.targets.length);const o=n.targets.map((e=>{const t=e.get(_.T.Position.XYZ);let n=0;return h.V.isDataTextureApproach(d.l.currentProcessApproach)&&(n=a.D.totalSizeOfGPUShaderDataStorageExceptMorphData),(n+t.byteOffsetInBuffer)/4/4}));let r;e._gl.uniform1iv(e.dataTextureMorphOffsetPosition,o),r=i.weights.length>0?i.weights:new Float32Array(n.targets.length),e._gl.uniform1fv(e.morphWeights,r)}_setCustomSettingParametersToGpu({material:e,shaderProgram:t,firstTime:n,args:i}){}setDefaultInputValue(e,t){this.__defaultInputValues.set(e,t)}getDefinition(){return""}}v.__semanticsMap=new Map,v.__invalidMaterialNodeUid=-1,v.__invalidMaterialNodeCount=-1,v.materialNodes=[],v.__tmp_vector4=s.xQ.zero(),v.__tmp_vector2=r.NR.zero(),v.__lightPositions=new Float32Array(0),v.__lightDirections=new Float32Array(0),v.__lightIntensities=new Float32Array(0),v.__lightProperties=new Float32Array(0)},2192:(e,t,n)=>{"use strict";n.d(t,{$R:()=>l,Cb:()=>m,Dx:()=>s,GV:()=>u,Lx:()=>d,NB:()=>h,kT:()=>f,mg:()=>c,pn:()=>_});var i=n(7683),o=n(8430),a=n(2858),r=n(2575);const s=new r.x,l=new r.x,c=new r.x,_=new a.B,h=new r.x,u=new r.x,d=new r.x;async function m(){s.isTextureReady||(s.tryToSetUniqueName("dummyWhiteTexture",!0),l.tryToSetUniqueName("dummyBlueTexture",!0),c.tryToSetUniqueName("dummyBlackTexture",!0),_.tryToSetUniqueName("dummyBlackCubeTexture",!0),h.tryToSetUniqueName("sheenLutTexture",!0),u.tryToSetUniqueName("dummySRGBGrayTexture",!0),d.tryToSetUniqueName("dummyAnisotropyTexture",!0),s.generate1x1TextureFrom(),l.generate1x1TextureFrom("rgba(127.5, 127.5, 255, 1)"),c.generate1x1TextureFrom("rgba(0, 0, 0, 1)"),_.load1x1Texture("rgba(0, 0, 0, 1)"),o.l.currentProcessApproach!==i.V.WebGPU&&await h.generateSheenLutTextureFromDataUri(),u.generate1x1TextureFrom("rgba(186, 186, 186, 1)"),d.generate1x1TextureFrom("rgba(255, 127.5, 255, 1)"))}const f={dummyWhiteTexture:s,dummyBlueTexture:l,dummyBlackTexture:c,dummyBlackCubeTexture:_,sheenLutTexture:h,dummySRGBGrayTexture:u,dummyAnisotropyTexture:d}},7882:(e,t,n)=>{"use strict";n.d(t,{F:()=>T});var i=n(9002),o=n(5704),a=n(4587),r=n(810),s=n(8547),l=n(7987),c=n(5324),_=n(7348),h=n(1813),u=n(4690),d=n(7009),m=n(3034),f=n.n(m),p=n(3258),v=n(1226),A=n(7683),y=n(3449),x=n(8430),g=n(430);class I{static _createShaderProgramWithCache(e,t,n,i,o,a){const r=t+n;let s=this.__shaderStringMap.get(r);if(s)return s;const c=y.j.toCRC32(r);if(s=this.__shaderHashMap.get(c),s)return s;{const s=l.F.getCgApiResourceRepository().createShaderProgram({material:e,vertexShaderStr:t,fragmentShaderStr:n,attributeNames:i,attributeSemantics:o,onError:a});return this.__shaderStringMap.set(r,s),this.__shaderHashMap.set(c,s),s}}}function b(e){const t=g.u.getAttributeReflection(e.vertexShaderityObject);return{attributeNames:t.names,attributeSemantics:t.semantics}}function E(e){let t="";const n=l.F.getWebGLResourceRepository().currentWebGLContextWrapper;return n.isWebGL2&&(t+="#version 300 es\n#define GLSL_ES3\n",p.D.isUboEnabled&&(t+="#define RN_IS_UBO_ENABLED\n")),t+=`#define RN_MATERIAL_TYPE_NAME ${e}\n`,A.V.isDataTextureApproach(x.l.currentProcessApproach)?t+="#define RN_IS_DATATEXTURE_MODE\n":t+="#define RN_IS_UNIFORM_MODE\n",n.is_multiview&&(t+="#define WEBGL2_MULTI_VIEW\n"),(n.isWebGL2||n.webgl1ExtDRV)&&(t+="#define RN_IS_SUPPORTING_STANDARD_DERIVATIVES\n"),p.D.boneDataType===v.N.Mat43x1?t+="#define RN_BONE_DATA_TYPE_Mat43x1\n":p.D.boneDataType===v.N.Vec4x2?t+="#define RN_BONE_DATA_TYPE_VEC4X2\n":p.D.boneDataType===v.N.Vec4x2Old?t+="#define RN_BONE_DATA_TYPE_VEC4X2_OLD\n":p.D.boneDataType===v.N.Vec4x1&&(t+="#define RN_BONE_DATA_TYPE_VEC4X1\n"),t}I.__shaderHashMap=new Map,I.__shaderStringMap=new Map;class T extends i.S{constructor(e,t,n,i,a){super(),this._allFieldVariables=new Map,this._autoFieldVariablesOnly=new Map,this._allFieldsInfo=new Map,this.__belongPrimitives=new Map,this._shaderProgramUid=l.F.InvalidCGAPIResourceUid,this.__materialUid=-1,this.__materialSid=-1,this.__alphaMode=o.F.Opaque,this.cullFace=!0,this.cullFrontFaceCCW=!0,this.__alphaToCoverage=!1,this.__blendEquationMode=d.C.EquationFuncAdd,this.__blendEquationModeAlpha=d.C.EquationFuncAdd,this.__blendFuncSrcFactor=d.C.SrcAlpha,this.__blendFuncDstFactor=d.C.OneMinusSrcAlpha,this.__blendFuncAlphaSrcFactor=d.C.One,this.__blendFuncAlphaDstFactor=d.C.One,this.__stateVersion=0,this._materialContent=a,this.__materialTid=e,this.__materialUid=t,this.__materialSid=n,this.__materialTypeName=i}setParameter(e,t){const n=(0,a.UL)(e),i=this._allFieldsInfo.get(n);if(null!=i){let e;e=i.soloDatum?T._soloDatumFields.get(this.__materialTypeName).get(n):this._allFieldVariables.get(n),s.D._setForce(e.value,t)}this.__stateVersion++}setTextureParameter(e,t,n){if(this._allFieldsInfo.has(e.index)){const i=async()=>{void 0!==t.loadFromUrlLazy&&(await t.loadFromUrlLazy(),await t.loadFromImgLazy());const i=this._allFieldVariables.get(e.index),r={value:[i.value[0],t,n],info:i.info};this._allFieldVariables.set(e.index,r),i.info.isCustomSetting||this._autoFieldVariablesOnly.set(e.index,r),e!==a.f5.DiffuseColorTexture&&e!==a.f5.BaseColorTexture||t.isTransparent&&(this.alphaMode=o.F.Translucent),this.__stateVersion++};void 0!==t.hasDataToLoadLazy&&t.hasDataToLoadLazy?setTimeout(i,0):i()}}getTextureParameter(e){if(this._allFieldsInfo.has(e.index))return this._allFieldVariables.get(e.index).value[1]}setTextureParameterAsPromise(e,t){t.then((t=>{if(this._allFieldsInfo.has(e.index)){const n=this._allFieldVariables.get(e.index),i={value:[n.value[0],t],info:n.info};this._allFieldVariables.set(e.index,i),n.info.isCustomSetting||this._autoFieldVariablesOnly.set(e.index,i),e!==a.f5.DiffuseColorTexture&&e!==a.f5.BaseColorTexture||t.isTransparent&&(this.alphaMode=o.F.Translucent)}this.__stateVersion++}))}getParameter(e){var t,n;const i=this._allFieldsInfo.get(e.index);if(null!=i)return i.soloDatum?null===(t=T._soloDatumFields.get(this.__materialTypeName).get(e.index))||void 0===t?void 0:t.value:null===(n=this._allFieldVariables.get(e.index))||void 0===n?void 0:n.value}isShaderProgramReady(){return this._shaderProgramUid!==l.F.InvalidCGAPIResourceUid}_setUniformLocationsOfMaterialNodes(e){const t=l.F.getWebGLResourceRepository();let n=[];if(u.Is.exist(this._materialContent)){const e=this._materialContent._semanticsInfoArray;n=n.concat(e)}t.setupUniformLocations(this._shaderProgramUid,n,e)}_addBelongPrimitive(e){this.__belongPrimitives.set(e.primitiveUid,e)}_createProgramWebGL(e,t,n){const{vertexPropertiesStr:i,pixelPropertiesStr:o}=this._getProperties(t,n),a=function(e,t,n,i,o){const a=l.F.getWebGLResourceRepository(),r=e._materialContent,s=r.getDefinitions(e);let c=E(e.__materialTypeName);c+="#define RN_IS_VERTEX_SHADER\n";let _=E(e.__materialTypeName);_+="#define RN_IS_PIXEL_SHADER\n";const h=g.u.fillTemplate(r.vertexShaderityObject,{getters:t,definitions:s,dataUBODefinition:a.getGlslDataUBODefinitionString(),dataUBOVec4Size:a.getGlslDataUBOVec4SizeString(),matricesGetters:i}),u=g.u.transformWebGLVersion(h,o).code,d=g.u.fillTemplate(r.pixelShaderityObject,{renderTargetBegin:a.getGlslRenderTargetBeginString(4),getters:n,definitions:s,dataUBODefinition:a.getGlslDataUBODefinitionString(),dataUBOVec4Size:a.getGlslDataUBOVec4SizeString(),matricesGetters:i,renderTargetEnd:a.getGlslRenderTargetEndString(4)}),m=g.u.transformWebGLVersion(d,o).code;c+=u.replace(/#version\s+(100|300\s+es)/,""),_+=m.replace(/#version\s+(100|300\s+es)/,"");const{attributeNames:f,attributeSemantics:p}=b(r),v=function(e,t){let n="\n// Vertex Attributes Binding Info\n";for(let i=0;i{const r=this._allFieldsInfo.get(a);r.stage!==c.H.VertexShader&&r.stage!==c.H.VertexAndPixelShader||(n+=e(this.__materialTypeName,r,a,!1,t)),r.stage!==c.H.PixelShader&&r.stage!==c.H.VertexAndPixelShader||(i+=e(this.__materialTypeName,r,a,!1,t))}));const o=_.$.getInstance();return[n,i]=o._addPropertiesStr(n,i,e,t),{vertexPropertiesStr:n,pixelPropertiesStr:i}}__setAutoParametersToGpu(e,t,n){const i=l.F.getWebGLResourceRepository();e.setUniform?this._autoFieldVariablesOnly.forEach((e=>{const o=e.info;t||o.updateInterval!==h.a.FirstTimeOnly?i.setUniformValue(n,o.semantic.str,t,e.value):r.d.isTexture(o.compositionType)&&i.bindTexture(o,e.value)})):this._autoFieldVariablesOnly.forEach((e=>{const o=e.info;r.d.isTexture(o.compositionType)&&(t||o.updateInterval!==h.a.FirstTimeOnly?i.setUniformValue(n,o.semantic.str,t,e.value):i.bindTexture(o,e.value)),o.needUniformInDataTextureMode&&i.setUniformValue(n,o.semantic.str,t,e.value)}))}__setSoloDatumParametersToGpu({shaderProgram:e,firstTime:t,args:n}){const i=l.F.getWebGLResourceRepository(),o=this.__materialTypeName,a=T._soloDatumFields.get(o);null!=a&&a.forEach(((o,a)=>{const s=o.info;(n.setUniform||r.d.isTexture(s.compositionType))&&(s.isCustomSetting||(t||s.updateInterval!==h.a.FirstTimeOnly?i.setUniformValue(e,s.semantic.str,t,o.value):i.bindTexture(s,o.value)))}))}__getTargetShaderSemantics(e){const t=this.fieldsInfoArray.find((t=>(t.none_u_prefix?"":"u_")+t.semantic.str===e));if(null!=t)return t.semantic;console.error(`Material.__getTargetShaderSemantics: uniform ${e} is not found`)}setBlendEquationMode(e,t){this.__blendEquationMode=e,this.__blendEquationModeAlpha=null!=t?t:e,this.__stateVersion++}setBlendFuncSeparateFactor(e,t,n,i){this.__blendFuncSrcFactor=e,this.__blendFuncDstFactor=t,this.__blendFuncAlphaSrcFactor=n,this.__blendFuncAlphaDstFactor=i,this.__stateVersion++}setBlendFuncFactor(e,t){this.__blendFuncSrcFactor=e,this.__blendFuncDstFactor=t,this.__blendFuncAlphaSrcFactor=e,this.__blendFuncAlphaDstFactor=t,this.__stateVersion++}isEmptyMaterial(){return void 0===this._materialContent}isBlend(){return this.alphaMode===o.F.Translucent||this.alphaMode===o.F.Additive}set alphaToCoverage(e){e&&this.alphaMode===o.F.Translucent&&console.warn("If you set alphaToCoverage = true on a material whose AlphaMode is Translucent, you may get drawing problems."),this.__alphaToCoverage=e,this.__stateVersion++}get alphaToCoverage(){return this.__alphaToCoverage}get materialTID(){return this.__materialTid}get fieldsInfoArray(){return Array.from(this._allFieldsInfo.values())}get blendEquationMode(){return this.__blendEquationMode}get blendEquationModeAlpha(){return this.__blendEquationModeAlpha}get blendFuncSrcFactor(){return this.__blendFuncSrcFactor}get blendFuncDstFactor(){return this.__blendFuncDstFactor}get blendFuncAlphaSrcFactor(){return this.__blendFuncAlphaSrcFactor}get blendFuncAlphaDstFactor(){return this.__blendFuncAlphaDstFactor}get alphaMode(){return this.__alphaMode}set alphaMode(e){this.__alphaMode=e,this._shaderProgramUid=-1}get materialUID(){return this.__materialUid}get materialSID(){return this.__materialSid}get isSkinning(){return this._materialContent.isSkinning}get isMorphing(){return this._materialContent.isMorphing}get isLighting(){return this._materialContent.isLighting}get materialTypeName(){return this.__materialTypeName}get stateVersion(){return this.__stateVersion}}T._soloDatumFields=new Map},903:(e,t,n)=>{"use strict";n.d(t,{r:()=>u});var i=n(3258),o=n(9286),a=n(752),r=n(3999),s=n(810),l=n(1181),c=n(8547),_=n(4690),h=n(7882);class u{static registerMaterial(e,t,n=i.D.maxMaterialInstanceForEachType){return u.__materialNodes.has(e)?(console.info(`${e} is already registered.`),!1):(u.__registerInner(e,t,n),!0)}static forceRegisterMaterial(e,t,n=i.D.maxMaterialInstanceForEachType){return this.__registerInner(e,t,n),!0}static isRegisteredMaterialType(e){return u.__materialNodes.has(e)}static getMaterialByMaterialUid(e){return this.__materialMap.get(e)}static getAllMaterials(){return Array.from(u.__materialMap.values())}static createMaterial(e,t){let n=t;n||(n=u.__materialNodes.get(e));let i=u.__materialInstanceCountOfType.get(e);const o=new h.F(u.__materialTids.get(e),++u.__materialUidCount,i++,e,n);return this.__initialize(o,i),o}static isFullOrOverOfThisMaterialType(e){const t=u.__materialInstanceCountOfType.get(e);if(_.Is.not.exist(t))return!1;const n=u.__maxInstances.get(e);return!_.Is.not.exist(n)&&t>=n}static __initialize(e,t){e.tryToSetUniqueName(e.__materialTypeName,!0);{u.__materialMap.set(e.materialUID,e);let n=u.__instances.get(e.__materialTypeName);_.Is.not.exist(n)&&(n=new Map,u.__instances.set(e.materialTypeName,n)),n.set(e.materialSID,e),u.__materialInstanceCountOfType.set(e.materialTypeName,t)}if(_.Is.exist(e._materialContent)){const t=e._materialContent._semanticsInfoArray,n=u.__accessors.get(e.materialTypeName);t.forEach((t=>{const i=u._getPropertyIndex(t);if(e._allFieldsInfo.set(i,t),!t.soloDatum){const o=n.get(i).takeOne(),a={info:t,value:c.D.initWithFloat32Array(t.initialValue,t.initialValue,o,t.compositionType)};e._allFieldVariables.set(i,a),t.isCustomSetting||e._autoFieldVariablesOnly.set(i,a)}}))}}static getLocationOffsetOfMemberOfMaterial(e,t){const n=u.__instances.get(e).get(0);return n._allFieldsInfo.get(t).soloDatum?h.F._soloDatumFields.get(n.materialTypeName).get(t).value._v.byteOffset/4/4:this.__accessors.get(e).get(t).byteOffsetInBuffer/4/4}static _getPropertyIndex(e){return e.semantic.index}static __registerInner(e,t,n){const i=++u.__materialTidCount;u.__materialNodes.set(e,t),u.__materialTids.set(e,i),u.__maxInstances.set(e,n),_.Is.exist(t)&&u.__allocateBufferView(e,t),u.__materialInstanceCountOfType.set(e,0)}static __allocateBufferView(e,t){let n=0;const i=[];for(const o of t._semanticsInfoArray){const t=(0,l.K)(o);let a=1;o.soloDatum||(a=u.__maxInstances.get(e)),n+=t*a,i.push({alignedByte:t,semanticInfo:o})}this.__accessors.has(e)||this.__accessors.set(e,new Map);const _=o.B.getInstance().createOrGetBuffer(a.$.GPUInstanceData);let d;this.__bufferViews.has(e)?d=this.__bufferViews.get(e):(d=_.takeBufferView({byteLengthToNeed:n,byteStride:0}).unwrapForce(),this.__bufferViews.set(e,d));for(let t=0;t{"use strict";n.d(t,{u:()=>I});var i=n(3034),o=n.n(i),a=n(3999),r=n(810),s=n(128),l=n(9286),c=n(4710),_=n(3258),h=n(4587),u=n(1813),d=n(8182),m=n(9190),f=n(4536),p=n(2566),v=n(3496),A=n(4267),y=n(7035),x=n(5324),g=n(2192);class I{static fillTemplate(e,t){const n=Object.assign(t,{WellKnownComponentTIDs:c.z,widthOfDataTexture:`const int widthOfDataTexture = ${l.B.bufferWidthLength};`,heightOfDataTexture:`const int heightOfDataTexture = ${l.B.bufferHeightLength};`,Config:_.D});return o().fillTemplate(e,n)}static transformWebGLVersion(e,t){return t?o().transformToGLSLES3(e):o().transformToGLSLES1(e,!0)}static getAttributeReflection(e){const t=o().createReflectionObject(e);return this.__setDefaultAttributeSemanticMap(t),t.reflect(),{names:t.attributesNames,semantics:t.attributesSemantics.map((e=>s.T.fromString(e))),compositions:t.attributesTypes.map((e=>r.d.fromGlslString(e))),components:t.attributesTypes.map((e=>a.r.fromGlslString(e)))}}static __setDefaultAttributeSemanticMap(e){const t=new Map;t.set("instanceinfo","INSTANCE"),t.set("barycentriccoord","BARY_CENTRIC_COORD"),e.addAttributeSemanticsMap(t)}static getShaderDataReflection(e,t){const n=this.__copyShaderityObject(e),i=e.code.split(/\r\n|\n/),o=[],a=[];for(const n of i){const i=/^(?![/])[\t ]*uniform[\t ]+(\w+)[\t ]+(\w+);[\t ]*(\/\/)*[\t ]*(.*)/,r=n.match(i);if(r){const i=r[1],s=r[2],l=r[4];if(this.__ignoreThisUniformDeclaration(l)){o.push(n);continue}const c=this.__createShaderSemanticsInfo(i,s,l,e.isFragmentShader,t);a.push(c)}else o.push(n)}return n.code=o.join("\n"),{shaderSemanticsInfoArray:a,shaderityObject:n}}static __copyShaderityObject(e){return{code:e.code,shaderStage:e.shaderStage,isFragmentShader:"fragment"===e.shaderStage}}static __ignoreThisUniformDeclaration(e){const t=e.match(/skipProcess[\t ]*=[\t ]*(\w+)[,\t ]*/);return"true"===(null==t?void 0:t[1])}static __createShaderSemanticsInfo(e,t,n,i,o){const s=a.r.fromGlslString(e),l=r.d.fromGlslString(e),c=i?x.H.PixelShader:x.H.VertexShader;let _=!0;const u=t.match(/u_(\w+)/);u&&(t=u[1],_=!1);let d=h.f5.fromStringCaseSensitively(t);if(null==d){const e=null==o?void 0:o.get(t);d=null!=e?e.semantic:new h.wy({str:t})}const m={semantic:d,compositionType:l,componentType:s,min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isCustomSetting:!1,stage:c,none_u_prefix:_};return this.__setRhodoniteOriginalParametersTo(m,n),m}static __setRhodoniteOriginalParametersTo(e,t){var n;const i=t.match(/soloDatum[\t ]*=[\t ]*(\w+)[,\t ]*/);let o=!1;"true"===(null==i?void 0:i[1])&&(o=!0),e.soloDatum=o;const a=t.match(/isCustomSetting[\t ]*=[\t ]*(\w+)[,\t ]*/);let r=!1;"true"===(null==a?void 0:a[1])&&(r=!0),e.isCustomSetting=r;const s=t.match(/updateInterval[\t ]*=[\t ]*(\w+)[,\t ]*/);let l=u.a.FirstTimeOnly;"everytime"===(null===(n=null==s?void 0:s[1])||void 0===n?void 0:n.toLowerCase())&&(l=u.a.EveryTime),e.updateInterval=l;const c=t.match(/initialValue[\t ]*=[\t ]*(.+)[,\t ]*/);if(c){const t=c[1];e.initialValue=this.__getInitialValueFromText(e,t)}else e.initialValue=this.__getDefaultInitialValue(e);const _=t.match(/needUniformInDataTextureMode[\t ]*=[\t ]*(.+)[,\t ]*/);if(_){let t=!1;"true"===(null==_?void 0:_[1])&&(t=!0),e.needUniformInDataTextureMode=t}}static __getInitialValueFromText(e,t){const n=t.match(/\(([\d\w., ]+)\)/),i=t=>{e.compositionType!==t&&console.error("component number of initialValue is invalid:"+e.semantic.str)};let o;if(n){const t=n[1].split(",");switch(t.length){case 1:i(r.d.Scalar),o="true"===t[0]?new A.DU(new Float32Array([1])):"false"===t[0]?new A.DU(new Float32Array([0])):new A.DU(new Float32Array([parseFloat(t[0])]));break;case 2:if(e.compositionType===r.d.Texture2D||e.compositionType===r.d.Texture2DShadow){const e=t[1].charAt(0).toUpperCase()+t[1].slice(1);o=[parseInt(t[0]),g.kT[`dummy${e}Texture`]]}else if(e.compositionType===r.d.TextureCube){const e=t[1].charAt(0).toUpperCase()+t[1].slice(1);o=[parseInt(t[0]),g.kT[`dummy${e}CubeTexture`]]}else i(r.d.Vec2),o=d.NR.fromCopyArray([parseFloat(t[0]),parseFloat(t[1])]);break;case 3:i(r.d.Vec3),o=m.d6.fromCopyArray([parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]);break;case 4:i(r.d.Vec4),o=f.xQ.fromCopyArray([parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])]);break;case 9:i(r.d.Mat3),o=p.x.fromCopy9RowMajor(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]),parseFloat(t[7]),parseFloat(t[8]));break;case 16:i(r.d.Mat4),o=v.e.fromCopy16RowMajor(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]),parseFloat(t[7]),parseFloat(t[8]),parseFloat(t[9]),parseFloat(t[10]),parseFloat(t[11]),parseFloat(t[12]),parseFloat(t[13]),parseFloat(t[14]),parseFloat(t[15]));break;default:console.error("Invalid format")}}else i(r.d.Scalar),o="true"===t?new A.DU(new Float32Array([1])):"false"===t?new A.DU(new Float32Array([0])):new A.DU(new Float32Array([parseFloat(t)]));return o}static __getDefaultInitialValue(e){return e.compositionType===r.d.Scalar?new A.DU(new Float32Array([0])):e.compositionType===r.d.Vec2?d.NR.zero():e.compositionType===r.d.Vec3?m.d6.zero():e.compositionType===r.d.Vec4?f.xQ.zero():e.compositionType===r.d.Mat2?y.f.identity():e.compositionType===r.d.Mat3?p.x.identity():e.compositionType===r.d.Mat4?v.e.identity():e.compositionType===r.d.Texture2D||e.compositionType===r.d.Texture2DShadow?[0,g.Dx]:e.compositionType===r.d.TextureCube?[0,g.mg]:void console.warn("initial value is not found")}}},2477:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});var i=n(2471),o=n(9190),a=n(3032);class r{constructor(){this.__min=o.d6.fromCopyArray([Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE]),this.__max=o.d6.fromCopyArray([-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]),this.__centerPoint=o.d6.zero(),this.__lengthCenterToCorner=0,this.__isCenterPointDirty=!1,this.__isLengthCenterToCornerDirty=!1,this.__isVanilla=!0}clone(){const e=new r;return e.__max=this.__max.clone(),e.__min=this.__min.clone(),e.__centerPoint=this.__centerPoint.clone(),e.__lengthCenterToCorner=this.__lengthCenterToCorner,e.__isCenterPointDirty=this.__isCenterPointDirty,e.__isLengthCenterToCornerDirty=this.__isLengthCenterToCornerDirty,e}copyComponents(e){return this.__max.copyComponents(e.__max),this.__min.copyComponents(e.__min),this.__centerPoint.copyComponents(e.__centerPoint),this.__lengthCenterToCorner=e.__lengthCenterToCorner,this.__isCenterPointDirty=e.__isCenterPointDirty,this.__isLengthCenterToCornerDirty=e.__isLengthCenterToCornerDirty,this.__isVanilla=!1,this}initialize(){this.__min.setComponents(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),this.__max.setComponents(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),this.__centerPoint.zero(),this.__lengthCenterToCorner=0,this.__isCenterPointDirty=!1,this.__isLengthCenterToCornerDirty=!1,this.__isVanilla=!0}set minPoint(e){this.__min.copyComponents(e),this.__isCenterPointDirty=!0,this.__isLengthCenterToCornerDirty=!0,this.__isVanilla=!1}get minPoint(){return this.__min}set maxPoint(e){this.__max.copyComponents(e),this.__isCenterPointDirty=!0,this.__isLengthCenterToCornerDirty=!0,this.__isVanilla=!1}get maxPoint(){return this.__max}isVanilla(){return this.__isVanilla}addPosition(e){return this.__min.x=e.x{"use strict";n.d(t,{X:()=>i});class i{constructor(){this._v=new Float32Array}at(e,t){throw new Error("Method not implemented.")}toString(){throw new Error("Method not implemented.")}toStringApproximately(){throw new Error("Method not implemented.")}flattenAsArray(){throw new Error("Method not implemented.")}isDummy(){return 0===this._v.length}v(e){return this._v[e]}determinant(){throw new Error("Method not implemented.")}get className(){return this.constructor.name}get isIdentityMatrixClass(){return!1}isTheSourceSame(e){return this._v.buffer===e}}},3632:(e,t,n)=>{"use strict";n.d(t,{l:()=>i});class i{constructor(){this._v=new Float32Array}get className(){return this.constructor.name}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return this._v[3]}at(e){return this._v[e]}length(){return Math.hypot(this._v[0],this._v[1],this._v[2],this._v[3])}lengthSquared(){return this._v[0]**2+this._v[1]**2+this._v[2]**2+this._v[3]**2}toString(){throw new Error("Method not implemented.")}toStringApproximately(){throw new Error("Method not implemented.")}flattenAsArray(){throw new Error("Method not implemented.")}isDummy(){throw new Error("Method not implemented.")}isEqual(e,t){throw new Error("Method not implemented.")}isStrictEqual(e){throw new Error("Method not implemented.")}toEulerAnglesTo(e){throw new Error("Method not implemented.")}toEulerAngles(){throw new Error("Method not implemented.")}transformVector3(e){throw new Error("Method not implemented.")}transformVector3Inverse(e){throw new Error("Method not implemented.")}dot(e){return this._v[0]*e._v[0]+this._v[1]*e._v[1]+this._v[2]*e._v[2]+this._v[3]*e._v[3]}clone(){throw new Error("Method not implemented.")}}},3343:(e,t,n)=>{"use strict";n.d(t,{O:()=>i});class i{constructor(){this._v=new Float32Array}get glslStrAsFloat(){throw new Error("Method not implemented.")}get glslStrAsInt(){throw new Error("Method not implemented.")}isEqual(e,t){throw new Error("Method not implemented.")}isStrictEqual(e){throw new Error("Method not implemented.")}length(){throw new Error("Method not implemented.")}lengthSquared(){throw new Error("Method not implemented.")}lengthTo(e){throw new Error("Method not implemented.")}dot(e){throw new Error("Method not implemented.")}at(e){return this._v[e]}toString(){throw new Error("Method not implemented.")}toStringApproximately(){throw new Error("Method not implemented.")}flattenAsArray(){throw new Error("Method not implemented.")}isDummy(){return 0===this._v.length}v(e){return this._v[e]}isTheSourceSame(e){return this._v.buffer===e}get className(){return this.constructor.name}get bytesPerComponent(){throw new Error("Method not implemented.")}}},1162:(e,t,n)=>{"use strict";n.d(t,{s:()=>o});var i=n(2471);class o extends i.P{constructor(e){super(e)}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return 1}get r(){return this._v[0]}get g(){return this._v[1]}get b(){return this._v[2]}get a(){return 1}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}static cross(e,t){return super._cross(e,t,Float32Array)}clone(){return super.clone()}}},346:(e,t,n)=>{"use strict";n.d(t,{c:()=>r});var i=n(810),o=n(8775),a=n(2471);class r extends o.X{constructor(){super(),this._v=r.__v}toString(){return"1 0 0\n0 1 0\n0 0 1\n"}toStringApproximately(){return this.toString()}flattenAsArray(){return[1,0,0,0,1,0,0,0,1]}isDummy(){return!1}isEqual(e,t=Number.EPSILON){return Math.abs(e.m00-1){"use strict";n.d(t,{a:()=>r});var i=n(810),o=n(8775),a=n(2471);class r extends o.X{constructor(){super(),this._v=r.__v}toString(){return"1 0 0 0\n0 1 0 0\n0 0 1 0\n0 0 0 1\n"}toStringApproximately(){return this.toString()}flattenAsArray(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}isDummy(){return!1}isEqual(e,t=Number.EPSILON){return Math.abs(e.m00-1){"use strict";n.d(t,{D:()=>y});var i=n(2390),o=n(2471),a=n(7192),r=n(9207),s=n(1937),l=n(5467),c=n(810),_=n(3496),h=n(2566),u=n(4536),d=n(9190),m=n(8182),f=n(3616),p=n(963),v=n(4267),A=n(4255);class y{constructor(){}static arrayToVector(e){return Array.isArray(e)?void 0!==e[3]?a.Lt.fromCopyArray([e[0],e[1],e[2],e[3]]):void 0!==e[2]?o.P.fromCopyArray([e[0],e[1],e[2]]):i.FM.fromCopyArray2([e[0],e[1]]):e}static arrayToVectorOrMatrix(e){return Array.isArray(e)?void 0!==e[15]?l.J.fromCopyArrayRowMajor(e):void 0!==e[8]?s.h.fromCopyArrayRowMajor(e):void 0!==e[3]?a.Lt.fromCopyArray([e[0],e[1],e[2],e[3]]):void 0!==e[2]?o.P.fromCopyArray([e[0],e[1],e[2]]):i.FM.fromCopyArray2([e[0],e[1]]):e}static getImmutableValueClass(e){return e===c.d.Vec2?i.FM:e===c.d.Vec3?o.P:e===c.d.Vec4?a.Lt:e===c.d.Mat3?s.h:e===c.d.Mat4?l.J:void 0}static getMutableValueClass(e){return e===c.d.Vec2?m.NR:e===c.d.Vec3?d.d6:e===c.d.Vec4?u.xQ:e===c.d.Mat3?h.x:e===c.d.Mat4?_.e:void 0}static cloneOfMathObjects(e){return e instanceof l.J||e instanceof s.h||e instanceof a.Lt||e instanceof o.P||e instanceof i.FM?e.clone():e}static isAcceptableArrayForQuaternion(e){return!(!Array.isArray(e)||void 0===e[3])}static arrayToQuaternion(e){return r._.fromCopy4(e[0],e[1],e[2],e[3])}static makeSubArray(e,t){return 4===t?[e[0],e[1],e[2],e[3]]:3===t?[e[0],e[1],e[2]]:2===t?[e[0],e[1]]:e[0]}static vectorToArray(e){return e instanceof i.FM?[e.x,e.y]:e instanceof o.P?[e.x,e.y,e.z]:e instanceof a.Lt||e instanceof r._?[e.x,e.y,e.z,e.w]:e}static componentNumberOfVector(e){return e instanceof i.FM?2:e instanceof o.P?3:e instanceof a.Lt||e instanceof r._?4:Array.isArray(e)?e.length:0}static packNormalizedVec4ToVec2(e,t,n,i,o){let a=0,r=0;return e=(e+1)/2,t=(t+1)/2,n=(n+1)/2,i=(i+1)/2,a=(Math.floor(e*(o-1))*o+Math.floor(t*(o-1)))/o,r=(Math.floor(n*(o-1))*o+Math.floor(i*(o-1)))/o,[a,r]}static unProjectTo(e,t,n,i,o,a){const r=this.__tmpVector4_0.setComponents((e-o.x)/o.z*2-1,(t-o.y)/o.w*2-1,2*n-1,1),s=i.multiplyVectorTo(r,this.__tmpVector4_1);return 0===s.w&&console.error("0 division occurred!"),d.d6.multiplyTo(s,1/s.w,a)}static add(e,t){if(isFinite(e))return e+t;if(e instanceof i.FM)return i.FM.add(e,t);if(e instanceof o.P)return o.P.add(e,t);if(e instanceof a.Lt)return a.Lt.add(e,t);if(e instanceof r._)return r._.add(e,t);if(Array.isArray(e)){const n=[];for(let i=0;i{"use strict";function i(e){return 0==(e&e-1)}n.d(t,{k:()=>o});const o=Object.freeze({radianToDegree:function(e){return 180*e/Math.PI},degreeToRadian:function(e){return e*Math.PI/180},toHalfFloat:()=>function(e){const t=new Float32Array(1),n=new Int32Array(t.buffer);t[0]=e;const i=n[0];let o=i>>16&32768,a=i>>12&2047;const r=i>>23&255;return r<103?o:r>142?(o|=31744,o|=(255==r?0:1)&&8388607&i,o):r<113?(a|=2048,o|=(a>>114-r)+(a>>113-r&1),o):(o|=r-112<<10|a>>1,o+=1&a,o)},isPowerOfTwo:i,isPowerOfTwoTexture:function(e,t){return i(e)&&i(t)},packNormalizedVec4ToVec2:function(e,t,n,i,o){return e=(e+1)/2,t=(t+1)/2,n=(n+1)/2,i=(i+1)/2,[(Math.floor(e*(o-1))*o+Math.floor(t*(o-1)))/o,(Math.floor(n*(o-1))*o+Math.floor(i*(o-1)))/o]},convertToStringAsGLSLFloat:function(e){return Number.isInteger(e)?`${e}.0`:""+e},nearZeroToZero:function(e){return Math.abs(e)<1e-5?e=0:.999994&&Math.abs(n.at(o))+l==Math.abs(n.at(o))&&Math.abs(n.at(d))+l==Math.abs(n.at(d)))e.setAt(o,d,0);else if(Math.abs(e.at(o,d))>u){c=n.at(d)-n.at(o),Math.abs(c)+l==Math.abs(c)?s=e.at(o,d)/c:(h=.5*c/e.at(o,d),s=h<0?-1/(Math.sqrt(1+h*h)-h):1/(Math.sqrt(1+h*h)+h)),r=1/Math.sqrt(1+s*s),a=s*r,_=s*e.at(o,d),e.setAt(o,d,0),n.setAt(o,n.at(o)-_),n.setAt(d,n.at(d)+_);for(let t=0;t=0?" "+t:t},lerp:function(e,t,n){return e*(1-n)+t*n}})},18:(e,t,n)=>{"use strict";n.d(t,{a:()=>s});var i=n(810),o=n(2390),a=n(3032),r=n(8775);class s extends r.X{constructor(e){super(),this._v=e}get m00(){return this._v[0]}get m10(){return this._v[1]}get m01(){return this._v[2]}get m11(){return this._v[3]}get className(){return"Matrix22"}static get compositionType(){return i.d.Mat2}static zero(){return s.fromCopy4RowMajor(0,0,0,0)}static identity(){return s.fromCopy4RowMajor(1,0,0,1)}static dummy(){return new this(new Float32Array(0))}static transpose(e){return s.fromCopy4RowMajor(e._v[0],e._v[1],e._v[2],e._v[3])}static invert(e){const t=e.determinant();0===t&&console.error("the determinant is 0!");const n=e._v[3]/t,i=e._v[2]/t*-1,o=e._v[1]/t*-1,a=e._v[0]/t;return s.fromCopy4RowMajor(n,i,o,a)}static invertTo(e,t){const n=e.determinant();0===n&&console.error("the determinant is 0!");const i=e._v[3]/n,o=e._v[2]/n*-1,a=e._v[1]/n*-1,r=e._v[0]/n;return t.setComponents(i,o,a,r)}static rotate(e){const t=Math.cos(e),n=Math.sin(e);return s.fromCopy4RowMajor(t,-n,n,t)}static scale(e){return s.fromCopy4RowMajor(e._v[0],0,0,e._v[1])}static multiply(e,t){const n=e._v[0]*t._v[0]+e._v[2]*t._v[1],i=e._v[1]*t._v[0]+e._v[3]*t._v[1],o=e._v[0]*t._v[2]+e._v[2]*t._v[3],a=e._v[1]*t._v[2]+e._v[3]*t._v[3];return s.fromCopy4RowMajor(n,o,i,a)}static multiplyTo(e,t,n){const i=e._v[0]*t._v[0]+e._v[2]*t._v[1],o=e._v[1]*t._v[0]+e._v[3]*t._v[1],a=e._v[0]*t._v[2]+e._v[2]*t._v[3],r=e._v[1]*t._v[2]+e._v[3]*t._v[3];return n.setComponents(i,a,o,r)}toString(){return this._v[0]+" "+this._v[2]+"\n"+this._v[1]+" "+this._v[3]+" \n"}toStringApproximately(){return a.k.financial(this._v[0])+" "+a.k.financial(this._v[2])+"\n"+a.k.financial(this._v[1])+" "+a.k.financial(this._v[3])+" \n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){"use strict";n.d(t,{h:()=>l});var i=n(2471),o=n(810),a=n(3032),r=n(8775),s=n(346);class l extends r.X{constructor(e){super(),this._v=e}get m00(){return this._v[0]}get m10(){return this._v[1]}get m20(){return this._v[2]}get m01(){return this._v[3]}get m11(){return this._v[4]}get m21(){return this._v[5]}get m02(){return this._v[6]}get m12(){return this._v[7]}get m22(){return this._v[8]}get className(){return"Matrix33"}static get compositionType(){return o.d.Mat3}static zero(){return l.fromCopy9RowMajor(0,0,0,0,0,0,0,0,0)}static identity(){return new s.c}static dummy(){return new this(new Float32Array(0))}static transpose(e){return e.isIdentityMatrixClass?e:l.fromCopy9RowMajor(e._v[0],e._v[1],e._v[2],e._v[3],e._v[4],e._v[5],e._v[6],e._v[7],e._v[8])}static invert(e){if(e.isIdentityMatrixClass)return e;const t=e.determinant();0===t&&console.error("the determinant is 0!");const n=(e._v[4]*e._v[8]-e._v[7]*e._v[5])/t,i=(e._v[6]*e._v[5]-e._v[3]*e._v[8])/t,o=(e._v[3]*e._v[7]-e._v[6]*e._v[4])/t,a=(e._v[7]*e._v[2]-e._v[1]*e._v[8])/t,r=(e._v[0]*e._v[8]-e._v[6]*e._v[2])/t,s=(e._v[6]*e._v[1]-e._v[0]*e._v[7])/t,c=(e._v[1]*e._v[5]-e._v[4]*e._v[2])/t,_=(e._v[3]*e._v[2]-e._v[0]*e._v[5])/t,h=(e._v[0]*e._v[4]-e._v[3]*e._v[1])/t;return l.fromCopy9RowMajor(n,i,o,a,r,s,c,_,h)}static invertTo(e,t){if(e.isIdentityMatrixClass)return t.copyComponents(e);const n=e.determinant();0===n&&console.error("the determinant is 0!");const i=(e._v[4]*e._v[8]-e._v[7]*e._v[5])/n,o=(e._v[6]*e._v[5]-e._v[3]*e._v[8])/n,a=(e._v[3]*e._v[7]-e._v[6]*e._v[4])/n,r=(e._v[7]*e._v[2]-e._v[1]*e._v[8])/n,s=(e._v[0]*e._v[8]-e._v[6]*e._v[2])/n,l=(e._v[6]*e._v[1]-e._v[0]*e._v[7])/n,c=(e._v[1]*e._v[5]-e._v[4]*e._v[2])/n,_=(e._v[3]*e._v[2]-e._v[0]*e._v[5])/n,h=(e._v[0]*e._v[4]-e._v[3]*e._v[1])/n;return t.setComponents(i,o,a,r,s,l,c,_,h)}static rotateX(e){const t=Math.cos(e),n=Math.sin(e);return l.fromCopy9RowMajor(1,0,0,0,t,-n,0,n,t)}static rotateY(e){const t=Math.cos(e),n=Math.sin(e);return l.fromCopy9RowMajor(t,0,n,0,1,0,-n,0,t)}static rotateZ(e){const t=Math.cos(e),n=Math.sin(e);return l.fromCopy9RowMajor(t,-n,0,n,t,0,0,0,1)}static rotateXYZ(e,t,n){const i=Math.cos(e),o=Math.sin(e),a=Math.cos(t),r=Math.sin(t),s=Math.cos(n),c=Math.sin(n),_=-o,h=-c,u=r*o,d=r*i,m=s*a,f=s*u+h*i,p=s*d+h*_,v=c*a,A=c*u+s*i,y=c*d+s*_,x=-r,g=a*o,I=a*i;return l.fromCopy9RowMajor(m,f,p,v,A,y,x,g,I)}static rotate(e){return this.rotateXYZ(e._v[0],e._v[1],e._v[2])}static scale(e){return l.fromCopy9RowMajor(e._v[0],0,0,0,e._v[1],0,0,0,e._v[2])}static multiply(e,t){if(e.isIdentityMatrixClass)return t;if(t.isIdentityMatrixClass)return e;const n=e._v[0]*t._v[0]+e._v[3]*t._v[1]+e._v[6]*t._v[2],i=e._v[1]*t._v[0]+e._v[4]*t._v[1]+e._v[7]*t._v[2],o=e._v[2]*t._v[0]+e._v[5]*t._v[1]+e._v[8]*t._v[2],a=e._v[0]*t._v[3]+e._v[3]*t._v[4]+e._v[6]*t._v[5],r=e._v[1]*t._v[3]+e._v[4]*t._v[4]+e._v[7]*t._v[5],s=e._v[2]*t._v[3]+e._v[5]*t._v[4]+e._v[8]*t._v[5],c=e._v[0]*t._v[6]+e._v[3]*t._v[7]+e._v[6]*t._v[8],_=e._v[1]*t._v[6]+e._v[4]*t._v[7]+e._v[7]*t._v[8],h=e._v[2]*t._v[6]+e._v[5]*t._v[7]+e._v[8]*t._v[8];return l.fromCopy9RowMajor(n,a,c,i,r,_,o,s,h)}static multiplyTo(e,t,n){if(e.isIdentityMatrixClass)return n.copyComponents(t);if(t.isIdentityMatrixClass)return n.copyComponents(e);const i=e._v[0]*t._v[0]+e._v[3]*t._v[1]+e._v[6]*t._v[2],o=e._v[1]*t._v[0]+e._v[4]*t._v[1]+e._v[7]*t._v[2],a=e._v[2]*t._v[0]+e._v[5]*t._v[1]+e._v[8]*t._v[2],r=e._v[0]*t._v[3]+e._v[3]*t._v[4]+e._v[6]*t._v[5],s=e._v[1]*t._v[3]+e._v[4]*t._v[4]+e._v[7]*t._v[5],l=e._v[2]*t._v[3]+e._v[5]*t._v[4]+e._v[8]*t._v[5],c=e._v[0]*t._v[6]+e._v[3]*t._v[7]+e._v[6]*t._v[8],_=e._v[1]*t._v[6]+e._v[4]*t._v[7]+e._v[7]*t._v[8],h=e._v[2]*t._v[6]+e._v[5]*t._v[7]+e._v[8]*t._v[8];return n.setComponents(i,r,c,o,s,_,a,l,h)}toString(){return this._v[0]+" "+this._v[3]+" "+this._v[6]+"\n"+this._v[1]+" "+this._v[4]+" "+this._v[7]+"\n"+this._v[2]+" "+this._v[5]+" "+this._v[8]+"\n"}toStringApproximately(){return a.k.financial(this._v[0])+" "+a.k.financial(this._v[3])+" "+a.k.financial(this._v[6])+"\n"+a.k.financial(this._v[1])+" "+a.k.financial(this._v[4])+" "+a.k.financial(this._v[7])+" \n"+a.k.financial(this._v[2])+" "+a.k.financial(this._v[5])+" "+a.k.financial(this._v[8])+"\n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3],this._v[4],this._v[5],this._v[6],this._v[7],this._v[8]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){"use strict";n.d(t,{J:()=>_});var i=n(2471),o=n(7192),a=n(810),r=n(3032),s=n(2086),l=n(8775),c=n(3991);Float32Array;class _ extends l.X{constructor(e){super(),this._v=e}get m00(){return this._v[0]}get m10(){return this._v[1]}get m20(){return this._v[2]}get m30(){return this._v[3]}get m01(){return this._v[4]}get m11(){return this._v[5]}get m21(){return this._v[6]}get m31(){return this._v[7]}get m02(){return this._v[8]}get m12(){return this._v[9]}get m22(){return this._v[10]}get m32(){return this._v[11]}get m03(){return this._v[12]}get m13(){return this._v[13]}get m23(){return this._v[14]}get m33(){return this._v[15]}get translateX(){return this._v[12]}get translateY(){return this._v[13]}get translateZ(){return this._v[14]}static get compositionType(){return a.d.Mat4}static zero(){return _.fromCopy16RowMajor(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}static identity(){return new s.a}static dummy(){return new this(new Float32Array(0))}static transpose(e){return e.isIdentityMatrixClass?e:_.fromCopyFloat32ArrayRowMajor(e._v)}static invert(e){if(e.isIdentityMatrixClass)return e;const t=e._v[0]*e._v[5]-e._v[4]*e._v[1],n=e._v[0]*e._v[9]-e._v[8]*e._v[1],i=e._v[0]*e._v[13]-e._v[12]*e._v[1],o=e._v[4]*e._v[9]-e._v[8]*e._v[5],a=e._v[4]*e._v[13]-e._v[12]*e._v[5],r=e._v[8]*e._v[13]-e._v[12]*e._v[9],s=e._v[2]*e._v[7]-e._v[6]*e._v[3],l=e._v[2]*e._v[11]-e._v[10]*e._v[3],c=e._v[2]*e._v[15]-e._v[14]*e._v[3],h=e._v[6]*e._v[11]-e._v[10]*e._v[7],u=e._v[6]*e._v[15]-e._v[14]*e._v[7],d=e._v[10]*e._v[15]-e._v[14]*e._v[11],m=t*d-n*u+i*h+o*c-a*l+r*s;0===m&&console.error("the determinant is 0!");const f=(e._v[5]*d-e._v[9]*u+e._v[13]*h)/m,p=(e._v[8]*u-e._v[4]*d-e._v[12]*h)/m,v=(e._v[7]*r-e._v[11]*a+e._v[15]*o)/m,A=(e._v[10]*a-e._v[6]*r-e._v[14]*o)/m,y=(e._v[9]*c-e._v[1]*d-e._v[13]*l)/m,x=(e._v[0]*d-e._v[8]*c+e._v[12]*l)/m,g=(e._v[11]*i-e._v[3]*r-e._v[15]*n)/m,I=(e._v[2]*r-e._v[10]*i+e._v[14]*n)/m,b=(e._v[1]*u-e._v[5]*c+e._v[13]*s)/m,E=(e._v[4]*c-e._v[0]*u-e._v[12]*s)/m,T=(e._v[3]*a-e._v[7]*i+e._v[15]*t)/m,S=(e._v[6]*i-e._v[2]*a-e._v[14]*t)/m,C=(e._v[5]*l-e._v[1]*h-e._v[9]*s)/m,w=(e._v[0]*h-e._v[4]*l+e._v[8]*s)/m,R=(e._v[7]*n-e._v[3]*o-e._v[11]*t)/m,P=(e._v[2]*o-e._v[6]*n+e._v[10]*t)/m;return _.fromCopy16RowMajor(f,p,v,A,y,x,g,I,b,E,T,S,C,w,R,P)}static invertTo(e,t){if(e.isIdentityMatrixClass)return t.copyComponents(e);const n=e._v[0]*e._v[5]-e._v[4]*e._v[1],i=e._v[0]*e._v[9]-e._v[8]*e._v[1],o=e._v[0]*e._v[13]-e._v[12]*e._v[1],a=e._v[4]*e._v[9]-e._v[8]*e._v[5],r=e._v[4]*e._v[13]-e._v[12]*e._v[5],s=e._v[8]*e._v[13]-e._v[12]*e._v[9],l=e._v[2]*e._v[7]-e._v[6]*e._v[3],c=e._v[2]*e._v[11]-e._v[10]*e._v[3],_=e._v[2]*e._v[15]-e._v[14]*e._v[3],h=e._v[6]*e._v[11]-e._v[10]*e._v[7],u=e._v[6]*e._v[15]-e._v[14]*e._v[7],d=e._v[10]*e._v[15]-e._v[14]*e._v[11],m=n*d-i*u+o*h+a*_-r*c+s*l;0===m&&console.error("the determinant is 0!");const f=(e._v[5]*d-e._v[9]*u+e._v[13]*h)/m,p=(e._v[8]*u-e._v[4]*d-e._v[12]*h)/m,v=(e._v[7]*s-e._v[11]*r+e._v[15]*a)/m,A=(e._v[10]*r-e._v[6]*s-e._v[14]*a)/m,y=(e._v[9]*_-e._v[1]*d-e._v[13]*c)/m,x=(e._v[0]*d-e._v[8]*_+e._v[12]*c)/m,g=(e._v[11]*o-e._v[3]*s-e._v[15]*i)/m,I=(e._v[2]*s-e._v[10]*o+e._v[14]*i)/m,b=(e._v[1]*u-e._v[5]*_+e._v[13]*l)/m,E=(e._v[4]*_-e._v[0]*u-e._v[12]*l)/m,T=(e._v[3]*r-e._v[7]*o+e._v[15]*n)/m,S=(e._v[6]*o-e._v[2]*r-e._v[14]*n)/m,C=(e._v[5]*c-e._v[1]*h-e._v[9]*l)/m,w=(e._v[0]*h-e._v[4]*c+e._v[8]*l)/m,R=(e._v[7]*i-e._v[3]*a-e._v[11]*n)/m,P=(e._v[2]*a-e._v[6]*i+e._v[10]*n)/m;return t.setComponents(f,p,v,A,y,x,g,I,b,E,T,S,C,w,R,P)}static translate(e){return _.fromCopy16RowMajor(1,0,0,e._v[0],0,1,0,e._v[1],0,0,1,e._v[2],0,0,0,1)}static rotateX(e){const t=Math.cos(e),n=Math.sin(e);return _.fromCopy16RowMajor(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1)}static rotateY(e){const t=Math.cos(e),n=Math.sin(e);return _.fromCopy16RowMajor(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1)}static rotateZ(e){const t=Math.cos(e),n=Math.sin(e);return _.fromCopy16RowMajor(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1)}static rotateXYZ(e,t,n){const i=Math.cos(e),o=Math.sin(e),a=Math.cos(t),r=Math.sin(t),s=Math.cos(n),l=Math.sin(n),c=-o,h=-l,u=r*o,d=r*i,m=s*a,f=s*u+h*i,p=s*d+h*c,v=l*a,A=l*u+s*i,y=l*d+s*c,x=-r,g=a*o,I=a*i;return _.fromCopy16RowMajor(m,f,p,0,v,A,y,0,x,g,I,0,0,0,0,1)}static rotate(e){return this.rotateXYZ(e._v[0],e._v[1],e._v[2])}static scale(e){return _.fromCopy16RowMajor(e._v[0],0,0,0,0,e._v[1],0,0,0,0,e._v[2],0,0,0,0,1)}static multiply(e,t){if(e.isIdentityMatrixClass)return t;if(t.isIdentityMatrixClass)return e;const n=e._v,i=t._v,o=n[0]*i[0]+n[4]*i[1]+n[8]*i[2]+n[12]*i[3],a=n[1]*i[0]+n[5]*i[1]+n[9]*i[2]+n[13]*i[3],r=n[2]*i[0]+n[6]*i[1]+n[10]*i[2]+n[14]*i[3],s=n[3]*i[0]+n[7]*i[1]+n[11]*i[2]+n[15]*i[3],l=n[0]*i[4]+n[4]*i[5]+n[8]*i[6]+n[12]*i[7],c=n[1]*i[4]+n[5]*i[5]+n[9]*i[6]+n[13]*i[7],h=n[2]*i[4]+n[6]*i[5]+n[10]*i[6]+n[14]*i[7],u=n[3]*i[4]+n[7]*i[5]+n[11]*i[6]+n[15]*i[7],d=n[0]*i[8]+n[4]*i[9]+n[8]*i[10]+n[12]*i[11],m=n[1]*i[8]+n[5]*i[9]+n[9]*i[10]+n[13]*i[11],f=n[2]*i[8]+n[6]*i[9]+n[10]*i[10]+n[14]*i[11],p=n[3]*i[8]+n[7]*i[9]+n[11]*i[10]+n[15]*i[11],v=n[0]*i[12]+n[4]*i[13]+n[8]*i[14]+n[12]*i[15],A=n[1]*i[12]+n[5]*i[13]+n[9]*i[14]+n[13]*i[15],y=n[2]*i[12]+n[6]*i[13]+n[10]*i[14]+n[14]*i[15],x=n[3]*i[12]+n[7]*i[13]+n[11]*i[14]+n[15]*i[15];return _.fromCopy16RowMajor(o,l,d,v,a,c,m,A,r,h,f,y,s,u,p,x)}static multiplyTo(e,t,n){if(e.isIdentityMatrixClass)return n.copyComponents(t);if(t.isIdentityMatrixClass)return n.copyComponents(e);const i=e._v,o=t._v,a=i[0]*o[0]+i[4]*o[1]+i[8]*o[2]+i[12]*o[3],r=i[1]*o[0]+i[5]*o[1]+i[9]*o[2]+i[13]*o[3],s=i[2]*o[0]+i[6]*o[1]+i[10]*o[2]+i[14]*o[3],l=i[3]*o[0]+i[7]*o[1]+i[11]*o[2]+i[15]*o[3],c=i[0]*o[4]+i[4]*o[5]+i[8]*o[6]+i[12]*o[7],_=i[1]*o[4]+i[5]*o[5]+i[9]*o[6]+i[13]*o[7],h=i[2]*o[4]+i[6]*o[5]+i[10]*o[6]+i[14]*o[7],u=i[3]*o[4]+i[7]*o[5]+i[11]*o[6]+i[15]*o[7],d=i[0]*o[8]+i[4]*o[9]+i[8]*o[10]+i[12]*o[11],m=i[1]*o[8]+i[5]*o[9]+i[9]*o[10]+i[13]*o[11],f=i[2]*o[8]+i[6]*o[9]+i[10]*o[10]+i[14]*o[11],p=i[3]*o[8]+i[7]*o[9]+i[11]*o[10]+i[15]*o[11],v=i[0]*o[12]+i[4]*o[13]+i[8]*o[14]+i[12]*o[15],A=i[1]*o[12]+i[5]*o[13]+i[9]*o[14]+i[13]*o[15],y=i[2]*o[12]+i[6]*o[13]+i[10]*o[14]+i[14]*o[15],x=i[3]*o[12]+i[7]*o[13]+i[11]*o[14]+i[15]*o[15];return n.setComponents(a,c,d,v,r,_,m,A,s,h,f,y,l,u,p,x)}static multiplyTypedArrayTo(e,t,n,i){return t[c.QU](i,e._v,0,n._v),n}static fromQuaternionTo(e,t){const n=e._v[0]*e._v[0],i=e._v[1]*e._v[1],o=e._v[2]*e._v[2],a=e._v[1]*e._v[2],r=e._v[0]*e._v[2],s=e._v[0]*e._v[1],l=e._v[3]*e._v[0],c=e._v[3]*e._v[1],_=e._v[3]*e._v[2],h=1-2*(i+o),u=2*(s-_),d=2*(r+c),m=2*(s+_),f=1-2*(n+o),p=2*(a-l),v=2*(r-c),A=2*(a+l),y=1-2*(n+i);return t.setComponents(h,u,d,0,m,f,p,0,v,A,y,0,0,0,0,1)}toString(){return this._v[0]+" "+this._v[4]+" "+this._v[8]+" "+this._v[12]+" \n"+this._v[1]+" "+this._v[5]+" "+this._v[9]+" "+this._v[13]+" \n"+this._v[2]+" "+this._v[6]+" "+this._v[10]+" "+this._v[14]+" \n"+this._v[3]+" "+this._v[7]+" "+this._v[11]+" "+this._v[15]+" \n"}toStringApproximately(){return r.k.financial(this._v[0])+" "+r.k.financial(this._v[4])+" "+r.k.financial(this._v[8])+" "+r.k.financial(this._v[12])+" \n"+r.k.financial(this._v[1])+" "+r.k.financial(this._v[5])+" "+r.k.financial(this._v[9])+" "+r.k.financial(this._v[13])+" \n"+r.k.financial(this._v[2])+" "+r.k.financial(this._v[6])+" "+r.k.financial(this._v[10])+" "+r.k.financial(this._v[14])+" \n"+r.k.financial(this._v[3])+" "+r.k.financial(this._v[7])+" "+r.k.financial(this._v[11])+" "+r.k.financial(this._v[15])+" \n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3],this._v[4],this._v[5],this._v[6],this._v[7],this._v[8],this._v[9],this._v[10],this._v[11],this._v[12],this._v[13],this._v[14],this._v[15]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){const n=e._v;return Math.abs(n[0]-this._v[0]){"use strict";n.d(t,{f:()=>o});var i=n(18);class o extends i.a{constructor(e){super(e)}set m00(e){this._v[0]=e}get m00(){return this._v[0]}set m10(e){this._v[1]=e}get m10(){return this._v[1]}set m01(e){this._v[2]=e}get m01(){return this._v[2]}set m11(e){this._v[3]=e}get m11(){return this._v[3]}get className(){return"MutableMatrix22"}static zero(){return super.zero()}static identity(){return super.identity()}static dummy(){return super.dummy()}static transpose(e){return super.transpose(e)}static invert(e){return super.invert(e)}static rotate(e){return super.rotate(e)}static scale(e){return super.scale(e)}static multiply(e,t){return super.multiply(e,t)}clone(){return super.clone()}raw(){return this._v}setAt(e,t,n){return this._v[e+2*t]=n,this}setComponents(e,t,n,i){return this._v[0]=e,this._v[2]=t,this._v[1]=n,this._v[3]=i,this}copyComponents(e){return this._v[0]=e.m00,this._v[2]=e.m01,this._v[1]=e.m10,this._v[3]=e.m11,this}zero(){return this.setComponents(0,0,0,0)}identity(){return this.setComponents(1,0,0,1)}_swap(e,t){this._v[t]=[this._v[e],this._v[e]=this._v[t]][0]}transpose(){return this._swap(1,2),this}invert(){const e=this.determinant();0===e&&console.error("the determinant is 0!");const t=this._v[3]/e,n=this._v[2]/e*-1,i=this._v[1]/e*-1,o=this._v[0]/e;return this.setComponents(t,n,i,o)}rotate(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,-n,n,t)}scale(e){return this.setComponents(e._v[0],0,0,e._v[1])}multiplyScale(e){return this._v[0]*=e._v[0],this._v[2]*=e._v[0],this._v[1]*=e._v[1],this._v[3]*=e._v[1],this}multiply(e){const t=this._v[0]*e._v[0]+this._v[2]*e._v[1],n=this._v[0]*e._v[2]+this._v[2]*e._v[3],i=this._v[1]*e._v[0]+this._v[3]*e._v[1],o=this._v[1]*e._v[2]+this._v[3]*e._v[3];return this.setComponents(t,n,i,o)}multiplyByLeft(e){const t=e._v[0]*this._v[0]+e._v[2]*this._v[1],n=e._v[0]*this._v[2]+e._v[2]*this._v[3],i=e._v[1]*this._v[0]+e._v[3]*this._v[1],o=e._v[1]*this._v[2]+e._v[3]*this._v[3];return this.setComponents(t,n,i,o)}static fromCopy4RowMajor(e,t,n,i){const a=new Float32Array(4);return a[0]=e,a[2]=t,a[1]=n,a[3]=i,new o(a)}static fromCopy4ColumnMajor(e,t,n,i){const a=new Float32Array(4);return a[0]=e,a[2]=n,a[1]=t,a[3]=i,new o(a)}static fromFloat32ArrayColumnMajor(e){return new o(e)}static fromCopyFloat32ArrayColumnMajor(e){const t=new Float32Array(4);return t.set(e),new o(t)}static fromCopyFloat32ArrayRowMajor(e){const t=new Float32Array(4);return t[0]=e[0],t[3]=e[1],t[1]=e[2],t[4]=e[3],new o(t)}static fromCopyMatrix22(e){const t=new Float32Array(4);return t[0]=e._v[0],t[3]=e._v[1],t[1]=e._v[2],t[4]=e._v[3],new o(t)}static fromCopyArray9ColumnMajor(e){const t=new Float32Array(4);return t.set(e),new o(t)}static fromCopyArrayColumnMajor(e){const t=new Float32Array(4);return t.set(e),new o(t)}static fromCopyArray9RowMajor(e){const t=new Float32Array(4);return t[0]=e[0],t[3]=e[1],t[1]=e[2],t[4]=e[3],new o(t)}static fromCopyArrayRowMajor(e){const t=new Float32Array(4);return t[0]=e[0],t[3]=e[1],t[1]=e[2],t[4]=e[3],new o(t)}}},2566:(e,t,n)=>{"use strict";n.d(t,{x:()=>o});var i=n(1937);class o extends i.h{constructor(e){super(e)}set m00(e){this._v[0]=e}get m00(){return this._v[0]}set m10(e){this._v[1]=e}get m10(){return this._v[1]}set m20(e){this._v[2]=e}get m20(){return this._v[2]}set m01(e){this._v[3]=e}get m01(){return this._v[3]}set m11(e){this._v[4]=e}get m11(){return this._v[4]}set m21(e){this._v[5]=e}get m21(){return this._v[5]}set m02(e){this._v[6]=e}get m02(){return this._v[6]}set m12(e){this._v[7]=e}get m12(){return this._v[7]}set m22(e){this._v[8]=e}get m22(){return this._v[8]}get className(){return"MutableMatrix33"}static zero(){return super.zero()}static identity(){return o.fromCopy9RowMajor(1,0,0,0,1,0,0,0,1)}static dummy(){return super.dummy()}static transpose(e){return super.transpose(e)}static invert(e){return super.invert(e)}static rotateX(e){return super.rotateX(e)}static rotateY(e){return super.rotateY(e)}static rotateZ(e){return super.rotateZ(e)}static rotateXYZ(e,t,n){return super.rotateXYZ(e,t,n)}static rotate(e){return super.rotateXYZ(e._v[0],e._v[1],e._v[2])}static scale(e){return super.scale(e)}static multiply(e,t){return super.multiply(e,t)}clone(){return super.clone()}raw(){return this._v}setAt(e,t,n){return this._v[e+3*t]=n,this}setComponents(e,t,n,i,o,a,r,s,l){return this._v[0]=e,this._v[3]=t,this._v[6]=n,this._v[1]=i,this._v[4]=o,this._v[7]=a,this._v[2]=r,this._v[5]=s,this._v[8]=l,this}copyComponents(e){return this._v[0]=e.m00,this._v[3]=e.m01,this._v[6]=e.m02,this._v[1]=e.m10,this._v[4]=e.m11,this._v[7]=e.m12,this._v[2]=e.m20,this._v[5]=e.m21,this._v[8]=e.m22,this}zero(){return this.setComponents(0,0,0,0,0,0,0,0,0)}identity(){return this.setComponents(1,0,0,0,1,0,0,0,1)}_swap(e,t){this._v[t]=[this._v[e],this._v[e]=this._v[t]][0]}transpose(){return this._swap(1,3),this._swap(2,6),this._swap(5,8),this}invert(){const e=this.determinant();0===e&&console.error("the determinant is 0!");const t=(this._v[4]*this._v[8]-this._v[7]*this._v[5])/e,n=(this._v[6]*this._v[5]-this._v[3]*this._v[8])/e,i=(this._v[3]*this._v[7]-this._v[6]*this._v[4])/e,o=(this._v[7]*this._v[2]-this._v[1]*this._v[8])/e,a=(this._v[0]*this._v[8]-this._v[6]*this._v[2])/e,r=(this._v[6]*this._v[1]-this._v[0]*this._v[7])/e,s=(this._v[1]*this._v[5]-this._v[4]*this._v[2])/e,l=(this._v[3]*this._v[2]-this._v[0]*this._v[5])/e,c=(this._v[0]*this._v[4]-this._v[3]*this._v[1])/e;return this.setComponents(t,n,i,o,a,r,s,l,c)}rotateX(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(1,0,0,0,t,-n,0,n,t)}rotateY(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,0,n,0,1,0,-n,0,t)}rotateZ(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,-n,0,n,t,0,0,0,1)}rotateXYZ(e,t,n){const i=Math.cos(e),o=Math.sin(e),a=Math.cos(t),r=Math.sin(t),s=Math.cos(n),l=Math.sin(n),c=-o,_=-l,h=r*o,u=r*i,d=s*a,m=s*h+_*i,f=s*u+_*c,p=l*a,v=l*h+s*i,A=l*u+s*c,y=-r,x=a*o,g=a*i;return this.setComponents(d,m,f,p,v,A,y,x,g)}rotate(e){return this.rotateXYZ(e._v[0],e._v[1],e._v[2])}scale(e){return this.setComponents(e._v[0],0,0,0,e._v[1],0,0,0,e._v[2])}multiplyScale(e){return this._v[0]*=e._v[0],this._v[3]*=e._v[0],this._v[6]*=e._v[0],this._v[1]*=e._v[1],this._v[4]*=e._v[1],this._v[7]*=e._v[1],this._v[2]*=e._v[2],this._v[5]*=e._v[2],this._v[8]*=e._v[2],this}multiply(e){if(e.isIdentityMatrixClass)return this;const t=this._v[0]*e._v[0]+this._v[3]*e._v[1]+this._v[6]*e._v[2],n=this._v[0]*e._v[3]+this._v[3]*e._v[4]+this._v[6]*e._v[5],i=this._v[0]*e._v[6]+this._v[3]*e._v[7]+this._v[6]*e._v[8],o=this._v[1]*e._v[0]+this._v[4]*e._v[1]+this._v[7]*e._v[2],a=this._v[1]*e._v[3]+this._v[4]*e._v[4]+this._v[7]*e._v[5],r=this._v[1]*e._v[6]+this._v[4]*e._v[7]+this._v[7]*e._v[8],s=this._v[2]*e._v[0]+this._v[5]*e._v[1]+this._v[8]*e._v[2],l=this._v[2]*e._v[3]+this._v[5]*e._v[4]+this._v[8]*e._v[5],c=this._v[2]*e._v[6]+this._v[5]*e._v[7]+this._v[8]*e._v[8];return this.setComponents(t,n,i,o,a,r,s,l,c)}multiplyByLeft(e){if(e.isIdentityMatrixClass)return this;const t=e._v[0]*this._v[0]+e._v[3]*this._v[1]+e._v[6]*this._v[2],n=e._v[0]*this._v[3]+e._v[3]*this._v[4]+e._v[6]*this._v[5],i=e._v[0]*this._v[6]+e._v[3]*this._v[7]+e._v[6]*this._v[8],o=e._v[1]*this._v[0]+e._v[4]*this._v[1]+e._v[7]*this._v[2],a=e._v[1]*this._v[3]+e._v[4]*this._v[4]+e._v[7]*this._v[5],r=e._v[1]*this._v[6]+e._v[4]*this._v[7]+e._v[7]*this._v[8],s=e._v[2]*this._v[0]+e._v[5]*this._v[1]+e._v[8]*this._v[2],l=e._v[2]*this._v[3]+e._v[5]*this._v[4]+e._v[8]*this._v[5],c=e._v[2]*this._v[6]+e._v[5]*this._v[7]+e._v[8]*this._v[8];return this.setComponents(t,n,i,o,a,r,s,l,c)}static fromCopy9RowMajor(e,t,n,i,a,r,s,l,c){const _=new Float32Array(9);return _[0]=e,_[3]=t,_[6]=n,_[1]=i,_[4]=a,_[7]=r,_[2]=s,_[5]=l,_[8]=c,new o(_)}static fromCopy9ColumnMajor(e,t,n,i,a,r,s,l,c){const _=new Float32Array(9);return _[0]=e,_[3]=i,_[6]=s,_[1]=t,_[4]=a,_[7]=l,_[2]=n,_[5]=r,_[8]=c,new o(_)}static fromCopyMatrix44(e){const t=new Float32Array(9);return t.set(e._v),new o(t)}static fromFloat32ArrayColumnMajor(e){return new o(e)}static fromCopyFloat32ArrayColumnMajor(e){const t=new Float32Array(9);return t.set(e),new o(t)}static fromCopyFloat32ArrayRowMajor(e){const t=new Float32Array(9);return t[0]=e[0],t[3]=e[1],t[6]=e[2],t[1]=e[3],t[4]=e[4],t[7]=e[5],t[2]=e[6],t[5]=e[7],t[8]=e[8],new o(t)}static fromCopyMatrix33(e){const t=new Float32Array(9);return t[0]=e._v[0],t[3]=e._v[3],t[6]=e._v[6],t[1]=e._v[1],t[4]=e._v[4],t[7]=e._v[7],t[2]=e._v[2],t[5]=e._v[5],t[8]=e._v[8],new o(t)}static fromCopyArray9ColumnMajor(e){const t=new Float32Array(9);return t.set(e),new o(t)}static fromCopyArrayColumnMajor(e){const t=new Float32Array(9);return t.set(e),new o(t)}static fromCopyArray9RowMajor(e){const t=new Float32Array(9);return t[0]=e[0],t[3]=e[1],t[6]=e[2],t[1]=e[3],t[4]=e[4],t[7]=e[5],t[2]=e[6],t[5]=e[7],t[8]=e[8],new o(t)}static fromCopyArrayRowMajor(e){const t=new Float32Array(9);return t[0]=e[0],t[3]=e[1],t[6]=e[2],t[1]=e[3],t[4]=e[4],t[7]=e[5],t[2]=e[6],t[5]=e[7],t[8]=e[8],new o(t)}static fromCopyQuaternion(e){const t=e._v[0]*e._v[0],n=e._v[1]*e._v[1],i=e._v[2]*e._v[2],a=e._v[1]*e._v[2],r=e._v[0]*e._v[2],s=e._v[0]*e._v[1],l=e._v[3]*e._v[0],c=e._v[3]*e._v[1],_=e._v[3]*e._v[2],h=new Float32Array(9);return h[0]=1-2*(n+i),h[3]=2*(s-_),h[6]=2*(r+c),h[1]=2*(s+_),h[4]=1-2*(t+i),h[7]=2*(a-l),h[2]=2*(r-c),h[5]=2*(a+l),h[8]=1-2*(t+n),new o(h)}}},3496:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var i=n(5467);Float32Array;class o extends i.J{constructor(e){super(e)}set m00(e){this._v[0]=e}get m00(){return this._v[0]}set m10(e){this._v[1]=e}get m10(){return this._v[1]}set m20(e){this._v[2]=e}get m20(){return this._v[2]}set m30(e){this._v[3]=e}get m30(){return this._v[3]}set m01(e){this._v[4]=e}get m01(){return this._v[4]}set m11(e){this._v[5]=e}get m11(){return this._v[5]}set m21(e){this._v[6]=e}get m21(){return this._v[6]}set m31(e){this._v[7]=e}get m31(){return this._v[7]}set m02(e){this._v[8]=e}get m02(){return this._v[8]}set m12(e){this._v[9]=e}get m12(){return this._v[9]}set m22(e){this._v[10]=e}get m22(){return this._v[10]}set m32(e){this._v[11]=e}get m32(){return this._v[11]}set m03(e){this._v[12]=e}get m03(){return this._v[12]}set m13(e){this._v[13]=e}get m13(){return this._v[13]}set m23(e){this._v[14]=e}get m23(){return this._v[14]}set m33(e){this._v[15]=e}get m33(){return this._v[15]}get translateX(){return this._v[12]}set translateX(e){this._v[12]=e}get translateY(){return this._v[13]}set translateY(e){this._v[13]=e}get translateZ(){return this._v[14]}set translateZ(e){this._v[14]=e}get className(){return"MutableMatrix44"}static zero(){return o.fromCopy16RowMajor(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}static identity(){return o.fromCopy16RowMajor(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}static dummy(){return super.dummy()}static transpose(e){return e.isIdentityMatrixClass?e:o.fromCopyFloat32ArrayRowMajor(e._v)}static invert(e){return super.invert(e)}static translate(e){return super.translate(e)}static rotateX(e){return super.rotateX(e)}static rotateY(e){return super.rotateY(e)}static rotateZ(e){return super.rotateZ(e)}static rotateXYZ(e,t,n){return super.rotateXYZ(e,t,n)}static rotate(e){return super.rotateXYZ(e._v[0],e._v[1],e._v[2])}static scale(e){return super.scale(e)}static multiply(e,t){return super.multiply(e,t)}clone(){return super.clone()}getRotate(){return super.getRotate()}getTranslate(){return super.getTranslate()}getScale(){return super.getScale()}raw(){return this._v}setAt(e,t,n){return this._v[e+4*t]=n,this}setComponents(e,t,n,i,o,a,r,s,l,c,_,h,u,d,m,f){return this._v[0]=e,this._v[4]=t,this._v[8]=n,this._v[12]=i,this._v[1]=o,this._v[5]=a,this._v[9]=r,this._v[13]=s,this._v[2]=l,this._v[6]=c,this._v[10]=_,this._v[14]=h,this._v[3]=u,this._v[7]=d,this._v[11]=m,this._v[15]=f,this}copyComponents(e){return this._v[0]=e._v[0],this._v[4]=e._v[4],this._v[8]=e._v[8],this._v[12]=e._v[12],this._v[1]=e._v[1],this._v[5]=e._v[5],this._v[9]=e._v[9],this._v[13]=e._v[13],this._v[2]=e._v[2],this._v[6]=e._v[6],this._v[10]=e._v[10],this._v[14]=e._v[14],this._v[3]=e._v[3],this._v[7]=e._v[7],this._v[11]=e._v[11],this._v[15]=e._v[15],this}zero(){return this.setComponents(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}identity(){return this.setComponents(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)}_swap(e,t){this._v[t]=[this._v[e],this._v[e]=this._v[t]][0]}transpose(){return this._swap(1,4),this._swap(2,8),this._swap(3,12),this._swap(6,9),this._swap(7,13),this._swap(11,14),this}invert(){const e=this._v[0]*this._v[5]-this._v[4]*this._v[1],t=this._v[0]*this._v[9]-this._v[8]*this._v[1],n=this._v[0]*this._v[13]-this._v[12]*this._v[1],i=this._v[4]*this._v[9]-this._v[8]*this._v[5],o=this._v[4]*this._v[13]-this._v[12]*this._v[5],a=this._v[8]*this._v[13]-this._v[12]*this._v[9],r=this._v[2]*this._v[7]-this._v[6]*this._v[3],s=this._v[2]*this._v[11]-this._v[10]*this._v[3],l=this._v[2]*this._v[15]-this._v[14]*this._v[3],c=this._v[6]*this._v[11]-this._v[10]*this._v[7],_=this._v[6]*this._v[15]-this._v[14]*this._v[7],h=this._v[10]*this._v[15]-this._v[14]*this._v[11],u=e*h-t*_+n*c+i*l-o*s+a*r;0===u&&console.error("the determinant is 0!");const d=(this._v[5]*h-this._v[9]*_+this._v[13]*c)/u,m=(this._v[8]*_-this._v[4]*h-this._v[12]*c)/u,f=(this._v[7]*a-this._v[11]*o+this._v[15]*i)/u,p=(this._v[10]*o-this._v[6]*a-this._v[14]*i)/u,v=(this._v[9]*l-this._v[1]*h-this._v[13]*s)/u,A=(this._v[0]*h-this._v[8]*l+this._v[12]*s)/u,y=(this._v[11]*n-this._v[3]*a-this._v[15]*t)/u,x=(this._v[2]*a-this._v[10]*n+this._v[14]*t)/u,g=(this._v[1]*_-this._v[5]*l+this._v[13]*r)/u,I=(this._v[4]*l-this._v[0]*_-this._v[12]*r)/u,b=(this._v[3]*o-this._v[7]*n+this._v[15]*e)/u,E=(this._v[6]*n-this._v[2]*o-this._v[14]*e)/u,T=(this._v[5]*s-this._v[1]*c-this._v[9]*r)/u,S=(this._v[0]*c-this._v[4]*s+this._v[8]*r)/u,C=(this._v[7]*t-this._v[3]*i-this._v[11]*e)/u,w=(this._v[2]*i-this._v[6]*t+this._v[10]*e)/u;return this.setComponents(d,m,f,p,v,A,y,x,g,I,b,E,T,S,C,w)}translate(e){return this.setComponents(1,0,0,e._v[0],0,1,0,e._v[1],0,0,1,e._v[2],0,0,0,1)}putTranslate(e){return this._v[12]=e._v[0],this._v[13]=e._v[1],this._v[14]=e._v[2],this}addTranslate(e){return this._v[12]+=e._v[0],this._v[13]+=e._v[1],this._v[14]+=e._v[2],this}rotateX(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1)}rotateY(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1)}rotateZ(e){const t=Math.cos(e),n=Math.sin(e);return this.setComponents(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1)}rotateXYZ(e,t,n){const i=Math.cos(e),o=Math.sin(e),a=Math.cos(t),r=Math.sin(t),s=Math.cos(n),l=Math.sin(n),c=-o,_=-l,h=r*o,u=r*i,d=s*a,m=s*h+_*i,f=s*u+_*c,p=l*a,v=l*h+s*i,A=l*u+s*c,y=-r,x=a*o,g=a*i;return this.setComponents(d,m,f,0,p,v,A,0,y,x,g,0,0,0,0,1)}rotate(e){return this.rotateXYZ(e._v[0],e._v[1],e._v[2])}scale(e){return this.setComponents(e._v[0],0,0,0,0,e._v[1],0,0,0,0,e._v[2],0,0,0,0,1)}multiplyScale(e){return this._v[0]*=e._v[0],this._v[4]*=e._v[0],this._v[8]*=e._v[0],this._v[12]*=e._v[0],this._v[1]*=e._v[1],this._v[5]*=e._v[1],this._v[9]*=e._v[1],this._v[13]*=e._v[1],this._v[2]*=e._v[2],this._v[6]*=e._v[2],this._v[10]*=e._v[2],this._v[14]*=e._v[2],this}multiply(e){if(e.isIdentityMatrixClass)return this;const t=this._v[0]*e._v[0]+this._v[4]*e._v[1]+this._v[8]*e._v[2]+this._v[12]*e._v[3],n=this._v[0]*e._v[4]+this._v[4]*e._v[5]+this._v[8]*e._v[6]+this._v[12]*e._v[7],i=this._v[0]*e._v[8]+this._v[4]*e._v[9]+this._v[8]*e._v[10]+this._v[12]*e._v[11],o=this._v[0]*e._v[12]+this._v[4]*e._v[13]+this._v[8]*e._v[14]+this._v[12]*e._v[15],a=this._v[1]*e._v[0]+this._v[5]*e._v[1]+this._v[9]*e._v[2]+this._v[13]*e._v[3],r=this._v[1]*e._v[4]+this._v[5]*e._v[5]+this._v[9]*e._v[6]+this._v[13]*e._v[7],s=this._v[1]*e._v[8]+this._v[5]*e._v[9]+this._v[9]*e._v[10]+this._v[13]*e._v[11],l=this._v[1]*e._v[12]+this._v[5]*e._v[13]+this._v[9]*e._v[14]+this._v[13]*e._v[15],c=this._v[2]*e._v[0]+this._v[6]*e._v[1]+this._v[10]*e._v[2]+this._v[14]*e._v[3],_=this._v[2]*e._v[4]+this._v[6]*e._v[5]+this._v[10]*e._v[6]+this._v[14]*e._v[7],h=this._v[2]*e._v[8]+this._v[6]*e._v[9]+this._v[10]*e._v[10]+this._v[14]*e._v[11],u=this._v[2]*e._v[12]+this._v[6]*e._v[13]+this._v[10]*e._v[14]+this._v[14]*e._v[15],d=this._v[3]*e._v[0]+this._v[7]*e._v[1]+this._v[11]*e._v[2]+this._v[15]*e._v[3],m=this._v[3]*e._v[4]+this._v[7]*e._v[5]+this._v[11]*e._v[6]+this._v[15]*e._v[7],f=this._v[3]*e._v[8]+this._v[7]*e._v[9]+this._v[11]*e._v[10]+this._v[15]*e._v[11],p=this._v[3]*e._v[12]+this._v[7]*e._v[13]+this._v[11]*e._v[14]+this._v[15]*e._v[15];return this.setComponents(t,n,i,o,a,r,s,l,c,_,h,u,d,m,f,p)}multiplyByLeft(e){if(e.isIdentityMatrixClass)return this;const t=e._v[0]*this._v[0]+e._v[4]*this._v[1]+e._v[8]*this._v[2]+e._v[12]*this._v[3],n=e._v[0]*this._v[4]+e._v[4]*this._v[5]+e._v[8]*this._v[6]+e._v[12]*this._v[7],i=e._v[0]*this._v[8]+e._v[4]*this._v[9]+e._v[8]*this._v[10]+e._v[12]*this._v[11],o=e._v[0]*this._v[12]+e._v[4]*this._v[13]+e._v[8]*this._v[14]+e._v[12]*this._v[15],a=e._v[1]*this._v[0]+e._v[5]*this._v[1]+e._v[9]*this._v[2]+e._v[13]*this._v[3],r=e._v[1]*this._v[4]+e._v[5]*this._v[5]+e._v[9]*this._v[6]+e._v[13]*this._v[7],s=e._v[1]*this._v[8]+e._v[5]*this._v[9]+e._v[9]*this._v[10]+e._v[13]*this._v[11],l=e._v[1]*this._v[12]+e._v[5]*this._v[13]+e._v[9]*this._v[14]+e._v[13]*this._v[15],c=e._v[2]*this._v[0]+e._v[6]*this._v[1]+e._v[10]*this._v[2]+e._v[14]*this._v[3],_=e._v[2]*this._v[4]+e._v[6]*this._v[5]+e._v[10]*this._v[6]+e._v[14]*this._v[7],h=e._v[2]*this._v[8]+e._v[6]*this._v[9]+e._v[10]*this._v[10]+e._v[14]*this._v[11],u=e._v[2]*this._v[12]+e._v[6]*this._v[13]+e._v[10]*this._v[14]+e._v[14]*this._v[15],d=e._v[3]*this._v[0]+e._v[7]*this._v[1]+e._v[11]*this._v[2]+e._v[15]*this._v[3],m=e._v[3]*this._v[4]+e._v[7]*this._v[5]+e._v[11]*this._v[6]+e._v[15]*this._v[7],f=e._v[3]*this._v[8]+e._v[7]*this._v[9]+e._v[11]*this._v[10]+e._v[15]*this._v[11],p=e._v[3]*this._v[12]+e._v[7]*this._v[13]+e._v[11]*this._v[14]+e._v[15]*this._v[15];return this.setComponents(t,n,i,o,a,r,s,l,c,_,h,u,d,m,f,p)}fromQuaternion(e){const t=e._v[0]*e._v[0],n=e._v[1]*e._v[1],i=e._v[2]*e._v[2],o=e._v[1]*e._v[2],a=e._v[0]*e._v[2],r=e._v[0]*e._v[1],s=e._v[3]*e._v[0],l=e._v[3]*e._v[1],c=e._v[3]*e._v[2],_=1-2*(n+i),h=2*(r-c),u=2*(a+l),d=2*(r+c),m=1-2*(t+i),f=2*(o-s),p=2*(a-l),v=2*(o+s),A=1-2*(t+n);return this.setComponents(_,h,u,0,d,m,f,0,p,v,A,0,0,0,0,1)}static fromCopy16RowMajor(e,t,n,i,a,r,s,l,c,_,h,u,d,m,f,p){const v=new Float32Array(16);return v[0]=e,v[4]=t,v[8]=n,v[12]=i,v[1]=a,v[5]=r,v[9]=s,v[13]=l,v[2]=c,v[6]=_,v[10]=h,v[14]=u,v[3]=d,v[7]=m,v[11]=f,v[15]=p,new o(v)}static fromCopy16ColumnMajor(e,t,n,i,a,r,s,l,c,_,h,u,d,m,f,p){const v=new Float32Array(16);return v[0]=e,v[4]=a,v[8]=c,v[12]=d,v[1]=t,v[5]=r,v[9]=_,v[13]=m,v[2]=n,v[6]=s,v[10]=h,v[14]=f,v[3]=i,v[7]=l,v[11]=u,v[15]=p,new o(v)}static fromCopyMatrix44(e){const t=new Float32Array(16);return t.set(e._v),new o(t)}static fromFloat32ArrayColumnMajor(e){return new o(e)}static fromCopyFloat32ArrayColumnMajor(e){const t=new Float32Array(16);return t.set(e),new o(t)}static fromCopyFloat32ArrayRowMajor(e){const t=new Float32Array(16);return t[0]=e[0],t[4]=e[1],t[8]=e[2],t[12]=e[3],t[1]=e[4],t[5]=e[5],t[9]=e[6],t[13]=e[7],t[2]=e[8],t[6]=e[9],t[10]=e[10],t[14]=e[11],t[3]=e[12],t[7]=e[13],t[11]=e[14],t[15]=e[15],new o(t)}static fromCopyMatrix33(e){const t=new Float32Array(16);return t[0]=e._v[0],t[4]=e._v[3],t[8]=e._v[6],t[12]=0,t[1]=e._v[1],t[5]=e._v[4],t[9]=e._v[7],t[13]=0,t[2]=e._v[2],t[6]=e._v[5],t[10]=e._v[8],t[14]=0,t[3]=0,t[7]=0,t[11]=0,t[15]=1,new o(t)}static fromCopyArray16ColumnMajor(e){const t=new Float32Array(16);return t.set(e),new o(t)}static fromCopyArrayColumnMajor(e){const t=new Float32Array(16);return t.set(e),new o(t)}static fromCopyArray16RowMajor(e){const t=new Float32Array(16);return t[0]=e[0],t[4]=e[1],t[8]=e[2],t[12]=e[3],t[1]=e[4],t[5]=e[5],t[9]=e[6],t[13]=e[7],t[2]=e[8],t[6]=e[9],t[10]=e[10],t[14]=e[11],t[3]=e[12],t[7]=e[13],t[11]=e[14],t[15]=e[15],new o(t)}static fromCopyArrayRowMajor(e){const t=new Float32Array(16);return t[0]=e[0],t[4]=e[1],t[8]=e[2],t[12]=e[3],t[1]=e[4],t[5]=e[5],t[9]=e[6],t[13]=e[7],t[2]=e[8],t[6]=e[9],t[10]=e[10],t[14]=e[11],t[3]=e[12],t[7]=e[13],t[11]=e[14],t[15]=e[15],new o(t)}static fromCopyQuaternion(e){const t=e._v[0]*e._v[0],n=e._v[1]*e._v[1],i=e._v[2]*e._v[2],a=e._v[1]*e._v[2],r=e._v[0]*e._v[2],s=e._v[0]*e._v[1],l=e._v[3]*e._v[0],c=e._v[3]*e._v[1],_=e._v[3]*e._v[2],h=new Float32Array(16);return h[0]=1-2*(n+i),h[4]=2*(s-_),h[8]=2*(r+c),h[12]=0,h[1]=2*(s+_),h[5]=1-2*(t+i),h[9]=2*(a-l),h[13]=0,h[2]=2*(r-c),h[6]=2*(a+l),h[10]=1-2*(t+n),h[14]=0,h[3]=0,h[7]=0,h[11]=0,h[15]=1,new o(h)}}},963:(e,t,n)=>{"use strict";n.d(t,{y:()=>o});var i=n(9207);class o extends i._{constructor(e){super(e)}set x(e){this._v[0]=e}get x(){return this._v[0]}set y(e){this._v[1]=e}get y(){return this._v[1]}set z(e){this._v[2]=e}get z(){return this._v[2]}set w(e){this._v[3]=e}get w(){return this._v[3]}get className(){return"MutableQuaternion"}static identity(){return o.fromCopy4(0,0,0,1)}static dummy(){return new this(new Float32Array(0))}static invert(e){return super.invert(e)}static qlerp(e,t,n){return super.qlerp(e,t,n)}static lerp(e,t,n){return super.lerp(e,t,n)}static axisAngle(e,t){return super.axisAngle(e,t)}static fromMatrix(e){return super.fromMatrix(e)}static fromPosition(e){return super.fromPosition(e)}static add(e,t){return super.add(e,t)}static subtract(e,t){return super.subtract(e,t)}static multiply(e,t){return super.multiply(e,t)}static multiplyNumber(e,t){return super.multiplyNumber(e,t)}static divideNumber(e,t){return super.divideNumber(e,t)}raw(){return this._v}setAt(e,t){return this._v[e]=t,this}setComponents(e,t,n,i){return this._v[0]=e,this._v[1]=t,this._v[2]=n,this._v[3]=i,this}copyComponents(e){return this.setComponents(e._v[0],e._v[1],e._v[2],e._v[3])}identity(){return this.setComponents(0,0,0,1)}normalize(){const e=this.length();return this.divideNumber(e)}invert(){const e=this.length();return 0===e||(this._v[0]=-this._v[0]/e,this._v[1]=-this._v[1]/e,this._v[2]=-this._v[2]/e,this._v[3]=this._v[3]/e),this}qlerp(e,t,n){let i=e._v[3]*t._v[3]+e._v[0]*t._v[0]+e._v[1]*t._v[1]+e._v[2]*t._v[2];if(0==1-i*i)return this.copyComponents(e);{i>1?i=.999:i<-1&&(i=-.999);let o,a=Math.acos(i);i<0&&a>Math.PI/2?(i=-e._v[3]*t._v[3]-e._v[0]*t._v[0]-e._v[1]*t._v[1]-e._v[2]*t._v[2],a=Math.acos(i),o=-1*Math.sin(a*n)/Math.sin(a)):o=Math.sin(a*n)/Math.sin(a);const r=Math.sin(a*(1-n))/Math.sin(a);this._v[0]=e._v[0]*r+t._v[0]*o,this._v[1]=e._v[1]*r+t._v[1]*o,this._v[2]=e._v[2]*r+t._v[2]*o,this._v[3]=e._v[3]*r+t._v[3]*o}return this}lerp(e,t,n){return this._v[0]=e._v[0]*(1-n)+t._v[0]*n,this._v[1]=e._v[1]*(1-n)+t._v[1]*n,this._v[2]=e._v[2]*(1-n)+t._v[2]*n,this._v[3]=e._v[3]*(1-n)+t._v[3]*n,this}axisAngle(e,t){const n=.5*t,i=Math.sin(n),o=e.length();return 0===o&&console.error("0 division occurred!"),this._v[3]=Math.cos(n),this._v[0]=i*e._v[0]/o,this._v[1]=i*e._v[1]/o,this._v[2]=i*e._v[2]/o,this}fromMatrix(e){const t=e.m00+e.m11+e.m22;if(t>0){const n=.5/Math.sqrt(t+1);this._v[0]=(e.m21-e.m12)*n,this._v[1]=(e.m02-e.m20)*n,this._v[2]=(e.m10-e.m01)*n,this._v[3]=.25/n}else if(e.m00>e.m11&&e.m00>e.m22){const t=2*Math.sqrt(1+e.m00-e.m11-e.m22);this._v[0]=.25*t,this._v[1]=(e.m01+e.m10)/t,this._v[2]=(e.m02+e.m20)/t,this._v[3]=(e.m21-e.m12)/t}else if(e.m11>e.m22){const t=2*Math.sqrt(1+e.m11-e.m00-e.m22);this._v[0]=(e.m01+e.m10)/t,this._v[1]=.25*t,this._v[2]=(e.m12+e.m21)/t,this._v[3]=(e.m02-e.m20)/t}else{const t=2*Math.sqrt(1+e.m22-e.m00-e.m11);this._v[0]=(e.m02+e.m20)/t,this._v[1]=(e.m12+e.m21)/t,this._v[2]=.25*t,this._v[3]=(e.m10-e.m01)/t}return this}fromPosition(e){return this.setComponents(e._v[0],e._v[1],e._v[2],0)}add(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this._v[2]+=e._v[2],this._v[3]+=e._v[3],this}subtract(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this._v[2]-=e._v[2],this._v[3]-=e._v[3],this}multiply(e){const t=e._v[3]*this._v[0]+e._v[2]*this._v[1]+e._v[1]*this._v[2]-e._v[0]*this._v[3],n=-e._v[2]*this._v[0]+e._v[3]*this._v[1]+e._v[0]*this._v[2]-e._v[1]*this._v[3],i=e._v[1]*this._v[0]+e._v[0]*this._v[1]+e._v[3]*this._v[2]-e._v[2]*this._v[3],o=-e._v[0]*this._v[0]-e._v[1]*this._v[1]-e._v[2]*this._v[2]-e._v[3]*this._v[3];return this.setComponents(t,n,i,o)}multiplyNumber(e){return this._v[0]*=e,this._v[1]*=e,this._v[2]*=e,this._v[3]*=e,this}divideNumber(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e,this._v[2]/=e,this._v[3]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0,this._v[2]=1/0,this._v[3]=1/0),this}clone(){return o.fromCopy4(this._v[0],this._v[1],this._v[2],this._v[3])}static fromFloat32Array(e){return new o(e)}static fromCopyArray4(e){return new o(new Float32Array(e))}static fromCopyArray(e){return new o(new Float32Array(e.slice(0,4)))}static fromCopy4(e,t,n,i){return new o(new Float32Array([e,t,n,i]))}static fromCopyQuaternion(e){const t=new Float32Array(4);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],t[3]=e._v[3],new o(t)}static fromCopyVector4(e){const t=new Float32Array(4);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],t[3]=e._v[3],new o(t)}static fromCopyLogQuaternion(e){const t=e._v[0]*e._v[0]+e._v[1]*e._v[1]+e._v[2]*e._v[2],n=Math.sin(t),i=new Float32Array(4);return i[0]=e._v[0]*(n/t),i[1]=e._v[1]*(n/t),i[2]=e._v[2]*(n/t),i[3]=Math.cos(t),new o(i)}}},4267:(e,t,n)=>{"use strict";n.d(t,{$_:()=>s,DU:()=>r,Et:()=>a});var i=n(3616),o=n(810);class a extends i.ap{constructor(e,{type:t}){super(e,{type:t})}copyComponents(e){this._v[0]=e._v[0]}get x(){return this._v[0]}set x(e){this._v[0]=e}get y(){return 0}get z(){return 0}get w(){return 1}toString(){return"("+this._v[0]+")"}setValue(e){return this.x=e,this}static get compositionType(){return o.d.Scalar}get bytesPerComponent(){return this._v.BYTES_PER_ELEMENT}}class r extends a{constructor(e){super(e,{type:Float32Array})}clone(){return new r(new Float32Array([this.x]))}static one(){return new r(new Float32Array([1]))}static dummy(){return new r(new Float32Array([]))}static zero(){return new r(new Float32Array([0]))}get className(){return"MutableScalar"}}class s extends a{constructor(e){super(e,{type:Float64Array})}clone(){return new s(new Float64Array([this.x]))}static one(){return new s(new Float64Array([1]))}static dummy(){return new s(new Float64Array([]))}static zero(){return new s(new Float64Array([0]))}}},8182:(e,t,n)=>{"use strict";n.d(t,{NR:()=>a,el:()=>o,th:()=>r});var i=n(2390);class o extends i.pV{constructor(e,{type:t}){super(e,{type:t})}set x(e){this._v[0]=e}get x(){return this._v[0]}set y(e){this._v[1]=e}get y(){return this._v[1]}get z(){return 0}get w(){return 1}raw(){return this._v}setAt(e,t){return this._v[e]=t,this}setComponents(e,t){return this._v[0]=e,this._v[1]=t,this}copyComponents(e){return this.setComponents(e._v[0],e._v[1])}zero(){return this.setComponents(0,0)}one(){return this.setComponents(1,1)}normalize(){const e=this.length();return this.divide(e),this}add(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this}subtract(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this}multiply(e){return this._v[0]*=e,this._v[1]*=e,this}multiplyVector(e){return this._v[0]*=e._v[0],this._v[1]*=e._v[1],this}divide(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0),this}divideVector(e){return 0!==e._v[0]&&0!==e._v[1]?(this._v[0]/=e._v[0],this._v[1]/=e._v[1]):(console.error("0 division occurred!"),this._v[0]=0===e._v[0]?1/0:this._v[0]/e._v[0],this._v[1]=0===e._v[1]?1/0:this._v[1]/e._v[1]),this}get bytesPerComponent(){return this._v.BYTES_PER_ELEMENT}}class a extends o{constructor(e){super(e,{type:Float32Array})}static fromCopyArray2(e){return new a(new Float32Array(e))}static fromCopyArray(e){return new a(new Float32Array(e.slice(0,2)))}static fromFloat32Array(e){return new a(e)}static fromCopyFloat32Array(e){return new a(new Float32Array(e.buffer.slice(0)))}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}get className(){return"MutableVector2"}clone(){return super.clone()}}class r extends o{constructor(e){super(e,{type:Float64Array})}static fromCopyArray(e){return new r(new Float64Array(e))}static zero(){return super._zero(Float64Array)}static one(){return super._one(Float64Array)}static dummy(){return super._dummy(Float64Array)}static normalize(e){return super._normalize(e,Float64Array)}static add(e,t){return super._add(e,t,Float64Array)}static subtract(e,t){return super._subtract(e,t,Float64Array)}static multiply(e,t){return super._multiply(e,t,Float64Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float64Array)}static divide(e,t){return super._divide(e,t,Float64Array)}static divideVector(e,t){return super._divideVector(e,t,Float64Array)}clone(){return super.clone()}}},9190:(e,t,n)=>{"use strict";n.d(t,{I1:()=>o,d6:()=>a,oV:()=>r});var i=n(2471);class o extends i.pg{constructor(e,{type:t}){super(e,{type:t})}set x(e){this._v[0]=e}get x(){return this._v[0]}set y(e){this._v[1]=e}get y(){return this._v[1]}set z(e){this._v[2]=e}get z(){return this._v[2]}get w(){return 1}raw(){return this._v}setAt(e,t){return this._v[e]=t,this}setComponents(e,t,n){return this._v[0]=e,this._v[1]=t,this._v[2]=n,this}copyComponents(e){return this.setComponents(e._v[0],e._v[1],e._v[2])}zero(){return this.setComponents(0,0,0)}one(){return this.setComponents(1,1,1)}normalize(){const e=this.length();return this.divide(e),this}add(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this._v[2]+=e._v[2],this}subtract(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this._v[2]-=e._v[2],this}multiply(e){return this._v[0]*=e,this._v[1]*=e,this._v[2]*=e,this}multiplyVector(e){return this._v[0]*=e._v[0],this._v[1]*=e._v[1],this._v[2]*=e._v[2],this}divide(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e,this._v[2]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0,this._v[2]=1/0),this}divideVector(e){return 0!==e._v[0]&&0!==e._v[1]&&0!==e._v[2]?(this._v[0]/=e._v[0],this._v[1]/=e._v[1],this._v[2]/=e._v[2]):(console.error("0 division occurred!"),this._v[0]=0===e._v[0]?1/0:this._v[0]/e._v[0],this._v[1]=0===e._v[1]?1/0:this._v[1]/e._v[1],this._v[2]=0===e._v[2]?1/0:this._v[2]/e._v[2]),this}cross(e){const t=this._v[1]*e._v[2]-this._v[2]*e._v[1],n=this._v[2]*e._v[0]-this._v[0]*e._v[2],i=this._v[0]*e._v[1]-this._v[1]*e._v[0];return this.setComponents(t,n,i)}multiplyQuaternion(e){const t=2*e._v[0],n=2*e._v[1],i=2*e._v[2],o=e._v[0]*t,a=e._v[1]*n,r=e._v[2]*i,s=e._v[0]*n,l=e._v[0]*i,c=e._v[1]*i,_=e._v[3]*t,h=e._v[3]*n,u=e._v[3]*i,d=(1-(a+r))*this._v[0]+(s-u)*this._v[1]+(l+h)*this._v[2],m=(s+u)*this._v[0]+(1-(o+r))*this._v[1]+(c-_)*this._v[2],f=(l-h)*this._v[0]+(c+_)*this._v[1]+(1-(o+a))*this._v[2];return this.setComponents(d,m,f)}get bytesPerComponent(){return this._v.BYTES_PER_ELEMENT}static _fromCopy3(e,t,n,i){return new this(new i([e,t,n]),{type:i})}}class a extends o{constructor(e){super(e,{type:Float32Array})}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}static cross(e,t){return super._cross(e,t,Float32Array)}static multiplyQuaternion(e,t){return super._multiplyQuaternion(e,t,Float32Array)}get className(){return"MutableVector3"}static fromCopy3(e,t,n){return super._fromCopy3(e,t,n,Float32Array)}static fromCopy1(e){return super._fromCopy3(e,e,e,Float32Array)}static fromCopyArray3(e){return new a(new Float32Array(e))}static fromCopyArray(e){return new a(new Float32Array(e.slice(0,3)))}static fromFloat32Array(e){return new a(e)}static fromCopyFloat32Array(e){return new a(new Float32Array(e.buffer.slice(0)))}static fromCopyVector3(e){return super._fromCopyVector3(e,Float32Array)}static fromCopyVector4(e){return super._fromCopyVector4(e,Float32Array)}clone(){return super.clone()}static rotateX(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.y=e.y*i-e.z*o,n.z=e.y*o+e.z*i}static rotateY(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.x=e.x*i+e.z*o,n.z=-e.x*o+e.z*i}static rotateZ(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.x=e.x*i-e.y*o,n.y=e.x*o+e.y*i}}class r extends o{constructor(e){super(e,{type:Float64Array})}static zero(){return super._zero(Float64Array)}static one(){return super._one(Float64Array)}static dummy(){return super._dummy(Float64Array)}static normalize(e){return super._normalize(e,Float64Array)}static add(e,t){return super._add(e,t,Float64Array)}static subtract(e,t){return super._subtract(e,t,Float64Array)}static multiply(e,t){return super._multiply(e,t,Float64Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float64Array)}static divide(e,t){return super._divide(e,t,Float64Array)}static divideVector(e,t){return super._divideVector(e,t,Float64Array)}static cross(e,t){return super._cross(e,t,Float64Array)}static multiplyQuaternion(e,t){return super._multiplyQuaternion(e,t,Float64Array)}static fromCopy3(e,t,n){return super._fromCopy3(e,t,n,Float64Array)}static fromCopy1(e){return super._fromCopy3(e,e,e,Float64Array)}static fromCopyArray3(e){return new r(new Float64Array(e))}static fromCopyArray(e){return new r(new Float64Array(e.slice(0,3)))}static rotateX(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.y=e.y*i-e.z*o,n.z=e.y*o+e.z*i}static rotateY(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.x=e.x*i+e.z*o,n.z=-e.x*o+e.z*i}static rotateZ(e,t,n){const i=Math.cos(t),o=Math.sin(t);n.x=e.x*i-e.y*o,n.y=e.x*o+e.y*i}clone(){return super.clone()}}},4536:(e,t,n)=>{"use strict";n.d(t,{e2:()=>o,hn:()=>r,xQ:()=>a});var i=n(7192);class o extends i.rE{constructor(e,{type:t}){super(e,{type:t}),this.__updateCount=0}set x(e){this._v[0]=e,this.__updateCount++}get x(){return this._v[0]}set y(e){this._v[1]=e,this.__updateCount++}get y(){return this._v[1]}set z(e){this._v[2]=e,this.__updateCount++}get z(){return this._v[2]}set w(e){this._v[3]=e,this.__updateCount++}get w(){return this._v[3]}raw(){return this._v}setAt(e,t){return this._v[e]=t,this.__updateCount++,this}setComponents(e,t,n,i){return this._v[0]=e,this._v[1]=t,this._v[2]=n,this._v[3]=i,this.__updateCount++,this}copyComponents(e){return this.setComponents(e._v[0],e._v[1],e._v[2],e._v[3])}zero(){return this.setComponents(0,0,0,0)}one(){return this.setComponents(1,1,1,1)}get bytesPerComponent(){return this._v.BYTES_PER_ELEMENT}normalize(){const e=this.length();return this.divide(e),this}normalize3(){const e=Math.hypot(this._v[0],this._v[1],this._v[2]);return this.divide(e),this}add(e){return this._v[0]+=e._v[0],this._v[1]+=e._v[1],this._v[2]+=e._v[2],this._v[3]+=e._v[3],this}subtract(e){return this._v[0]-=e._v[0],this._v[1]-=e._v[1],this._v[2]-=e._v[2],this._v[3]-=e._v[3],this}multiply(e){return this._v[0]*=e,this._v[1]*=e,this._v[2]*=e,this._v[3]*=e,this}multiplyVector(e){return this._v[0]*=e._v[0],this._v[1]*=e._v[1],this._v[2]*=e._v[2],this._v[3]*=e._v[3],this}divide(e){return 0!==e?(this._v[0]/=e,this._v[1]/=e,this._v[2]/=e,this._v[3]/=e):(console.error("0 division occurred!"),this._v[0]=1/0,this._v[1]=1/0,this._v[2]=1/0,this._v[3]=1/0),this}divideVector(e){return 0!==e._v[0]&&0!==e._v[1]&&0!==e._v[2]&&0!==e._v[3]?(this._v[0]/=e._v[0],this._v[1]/=e._v[1],this._v[2]/=e._v[2],this._v[3]/=e._v[3]):(console.error("0 division occurred!"),this._v[0]=0===e._v[0]?1/0:this._v[0]/e._v[0],this._v[1]=0===e._v[1]?1/0:this._v[1]/e._v[1],this._v[2]=0===e._v[2]?1/0:this._v[2]/e._v[2],this._v[3]=0===e._v[3]?1/0:this._v[3]/e._v[3]),this}get _updateCount(){return this.__updateCount}}class a extends o{constructor(e){super(e,{type:Float32Array})}static fromCopyArray(e){return new a(new Float32Array(e).slice(0,4))}static fromCopyArray4(e){return new a(new Float32Array(e))}static fromCopy4(e,t,n,i){return new a(new Float32Array([e,t,n,i]))}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}get className(){return"MutableVector4"}clone(){return new this.constructor(new this._v.constructor([this._v[0],this._v[1],this._v[2],this._v[3]]))}}class r extends o{constructor(e){super(e,{type:Float64Array})}static zero(){return super._zero(Float64Array)}static one(){return super._one(Float64Array)}static dummy(){return super._dummy(Float64Array)}static normalize(e){return super._normalize(e,Float64Array)}static add(e,t){return super._add(e,t,Float64Array)}static subtract(e,t){return super._subtract(e,t,Float64Array)}static multiply(e,t){return super._multiply(e,t,Float64Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float64Array)}static divide(e,t){return super._divide(e,t,Float64Array)}static divideVector(e,t){return super._divideVector(e,t,Float64Array)}static fromCopyArray4(e){return new r(new Float64Array(e))}static fromCopyArray(e){return new r(new Float64Array(e.slice(0,4)))}static fromCopy4(e,t,n,i){return new r(new Float64Array([e,t,n,i]))}clone(){return super.clone()}}},9207:(e,t,n)=>{"use strict";n.d(t,{_:()=>l});var i=n(3032),o=n(810),a=n(3632),r=n(2471),s=n(9190);class l extends a.l{constructor(e){super(),this._v=e}get className(){return"Quaternion"}static get compositionType(){return o.d.Vec4}static identity(){return l.fromCopy4(0,0,0,1)}static dummy(){return new this(new Float32Array(0))}static invert(e){const t=e.length();if(0===t)return l.fromCopy4(0,0,0,0);const n=-e._v[0]/t,i=-e._v[1]/t,o=-e._v[2]/t,a=e._v[3]/t;return l.fromCopy4(n,i,o,a)}static invertTo(e,t){const n=e.length();return 0===n?t.setComponents(0,0,0,0):(t._v[0]=-e._v[0]/n,t._v[1]=-e._v[1]/n,t._v[2]=-e._v[2]/n,t._v[3]=e._v[3]/n,t)}static qlerp(e,t,n){let i=e._v[0]*t._v[0]+e._v[1]*t._v[1]+e._v[2]*t._v[2]+e._v[3]*t._v[3];if(0==1-i*i)return e.clone();{i>1?i=.999:i<-1&&(i=-.999);let o=Math.acos(i);const a=Math.sin(o);let r;i<0?(i*=-1,o=Math.acos(i),r=-1*Math.sin(o*n)/a):r=Math.sin(o*n)/a;const s=Math.sin(o*(1-n))/a;let c=e._v[0]*s+t._v[0]*r,_=e._v[1]*s+t._v[1]*r,h=e._v[2]*s+t._v[2]*r,u=e._v[3]*s+t._v[3]*r;const d=Math.hypot(c,_,h,u);return c/=d,_/=d,h/=d,u/=d,l.fromCopy4(c,_,h,u)}}static qlerpTo(e,t,n,i){let o=e._v[0]*t._v[0]+e._v[1]*t._v[1]+e._v[2]*t._v[2]+e._v[3]*t._v[3];if(0==1-o*o)return i.copyComponents(e);{o>1?o=.999:o<-1&&(o=-.999);let a=Math.acos(o);const r=Math.sin(a);let s;o<0?(o*=-1,a=Math.acos(o),s=-1*Math.sin(a*n)/r):s=Math.sin(a*n)/r;const l=Math.sin(a*(1-n))/r;i._v[0]=e._v[0]*l+t._v[0]*s,i._v[1]=e._v[1]*l+t._v[1]*s,i._v[2]=e._v[2]*l+t._v[2]*s,i._v[3]=e._v[3]*l+t._v[3]*s}return i.normalize()}static lerp(e,t,n){const i=e._v[0]*(1-n)+t._v[0]*n,o=e._v[1]*(1-n)+t._v[1]*n,a=e._v[2]*(1-n)+t._v[2]*n,r=e._v[3]*(1-n)+t._v[3]*n;return l.fromCopy4(i,o,a,r)}static lerpTo(e,t,n,i){return i._v[0]=e._v[0]*(1-n)+t._v[0]*n,i._v[1]=e._v[1]*(1-n)+t._v[1]*n,i._v[2]=e._v[2]*(1-n)+t._v[2]*n,i._v[3]=e._v[3]*(1-n)+t._v[3]*n,i}static axisAngle(e,t){const n=.5*t,i=Math.sin(n),o=e.length();return 0===o&&console.error("0 division occurred!"),l.fromCopy4(i*e._v[0]/o,i*e._v[1]/o,i*e._v[2]/o,Math.cos(n))}static fromMatrix(e){const t=l.fromCopy4(0,0,0,1),n=e.m00+e.m11+e.m22;if(n>0){const i=.5/Math.sqrt(n+1);t._v[3]=.25/i,t._v[0]=(e.m21-e.m12)*i,t._v[1]=(e.m02-e.m20)*i,t._v[2]=(e.m10-e.m01)*i}else if(e.m00>e.m11&&e.m00>e.m22){const n=2*Math.sqrt(1+e.m00-e.m11-e.m22);t._v[3]=(e.m21-e.m12)/n,t._v[0]=.25*n,t._v[1]=(e.m01+e.m10)/n,t._v[2]=(e.m02+e.m20)/n}else if(e.m11>e.m22){const n=2*Math.sqrt(1+e.m11-e.m00-e.m22);t._v[3]=(e.m02-e.m20)/n,t._v[0]=(e.m01+e.m10)/n,t._v[1]=.25*n,t._v[2]=(e.m12+e.m21)/n}else{const n=2*Math.sqrt(1+e.m22-e.m00-e.m11);t._v[3]=(e.m10-e.m01)/n,t._v[0]=(e.m02+e.m20)/n,t._v[1]=(e.m12+e.m21)/n,t._v[2]=.25*n}return t}static fromMatrixTo(e,t){const n=e.m00+e.m11+e.m22;if(n>0){const i=.5/Math.sqrt(n+1);t._v[3]=.25/i,t._v[0]=(e.m21-e.m12)*i,t._v[1]=(e.m02-e.m20)*i,t._v[2]=(e.m10-e.m01)*i}else if(e.m00>e.m11&&e.m00>e.m22){const n=2*Math.sqrt(1+e.m00-e.m11-e.m22);t._v[3]=(e.m21-e.m12)/n,t._v[0]=.25*n,t._v[1]=(e.m01+e.m10)/n,t._v[2]=(e.m02+e.m20)/n}else if(e.m11>e.m22){const n=2*Math.sqrt(1+e.m11-e.m00-e.m22);t._v[3]=(e.m02-e.m20)/n,t._v[0]=(e.m01+e.m10)/n,t._v[1]=.25*n,t._v[2]=(e.m12+e.m21)/n}else{const n=2*Math.sqrt(1+e.m22-e.m00-e.m11);t._v[3]=(e.m10-e.m01)/n,t._v[0]=(e.m02+e.m20)/n,t._v[1]=(e.m12+e.m21)/n,t._v[2]=.25*n}return t}static lookFromTo(e,t){return e.isEqual(t)?l.fromCopy4(0,0,0,1):this.qlerp(this.lookForward(e),this.lookForward(t),1)}static lookForward(e){return null==l.__tmp_upVec&&(l.__tmp_upVec=new e.constructor(0,1,0)),this.lookForwardAccordingToThisUp(e,l.__tmp_upVec)}static lookForwardAccordingToThisUp(e,t){const n=e.length();0===n&&console.error("0 division occurred!");const i=e._v[0]/n,o=e._v[1]/n,a=e._v[2]/n,r=t.length();0===r&&console.error("0 division occurred!");const s=t._v[0]/r,c=t._v[1]/r,_=t._v[2]/r;let h=t._v[1]*e._v[2]-t._v[2]*e._v[1],u=t._v[2]*e._v[0]-t._v[0]*e._v[2],d=t._v[0]*e._v[1]-t._v[1]*e._v[0];const m=Math.hypot(h,u,d);0===m&&console.error("0 division occurred!"),h/=m,u/=m,d/=m;const f=h,p=u,v=d,A=s,y=c,x=_,g=i,I=o,b=a,E=f+y+b;if(E>0){const e=Math.sqrt(E+1),t=.5/e;return l.fromCopy4((x-I)*t,(g-v)*t,(p-A)*t,.5*e)}if(f>=y&&f>=b){const e=Math.sqrt(1+f-y-b),t=.5/e;return l.fromCopy4(.5*e,(p+A)*t,(v+g)*t,(x-I)*t)}if(y>b){const e=Math.sqrt(1+y-f-b),t=.5/e;return l.fromCopy4((A+p)*t,.5*e,(I+x)*t,(g-v)*t)}{const e=Math.sqrt(1+b-f-y),t=.5/e;return l.fromCopy4((g+v)*t,(I+x)*t,.5*e,(p-A)*t)}}static fromPosition(e){return l.fromCopy4(e._v[0],e._v[1],e._v[2],0)}static add(e,t){const n=e._v[0]+t._v[0],i=e._v[1]+t._v[1],o=e._v[2]+t._v[2],a=e._v[3]+t._v[3];return l.fromCopy4(n,i,o,a)}static addTo(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n._v[2]=e._v[2]+t._v[2],n._v[3]=e._v[3]+t._v[3],n}static subtract(e,t){const n=e._v[0]-t._v[0],i=e._v[1]-t._v[1],o=e._v[2]-t._v[2],a=e._v[3]-t._v[3];return l.fromCopy4(n,i,o,a)}static subtractTo(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n._v[2]=e._v[2]-t._v[2],n._v[3]=e._v[3]-t._v[3],n}static multiply(e,t){const n=t._v[3]*e._v[0]+t._v[2]*e._v[1]-t._v[1]*e._v[2]+t._v[0]*e._v[3],i=-t._v[2]*e._v[0]+t._v[3]*e._v[1]+t._v[0]*e._v[2]+t._v[1]*e._v[3],o=t._v[1]*e._v[0]-t._v[0]*e._v[1]+t._v[3]*e._v[2]+t._v[2]*e._v[3],a=-t._v[0]*e._v[0]-t._v[1]*e._v[1]-t._v[2]*e._v[2]+t._v[3]*e._v[3];return l.fromCopy4(n,i,o,a)}static multiplyTo(e,t,n){const i=t._v[3]*e._v[0]+t._v[2]*e._v[1]-t._v[1]*e._v[2]+t._v[0]*e._v[3],o=-t._v[2]*e._v[0]+t._v[3]*e._v[1]+t._v[0]*e._v[2]+t._v[1]*e._v[3],a=t._v[1]*e._v[0]-t._v[0]*e._v[1]+t._v[3]*e._v[2]+t._v[2]*e._v[3],r=-t._v[0]*e._v[0]-t._v[1]*e._v[1]-t._v[2]*e._v[2]+t._v[3]*e._v[3];return n.setComponents(i,o,a,r)}static multiplyNumber(e,t){const n=e._v[0]*t,i=e._v[1]*t,o=e._v[2]*t,a=e._v[3]*t;return l.fromCopy4(n,i,o,a)}static multiplyNumberTo(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n._v[2]=e._v[2]*t,n._v[3]=e._v[3]*t,n}static divideNumber(e,t){0===t&&console.error("0 division occurred!");const n=e._v[0]/t,i=e._v[1]/t,o=e._v[2]/t,a=e._v[3]/t;return l.fromCopy4(n,i,o,a)}static divideNumberTo(e,t,n){return 0===t&&console.error("0 division occurred!"),n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t,n._v[2]=e._v[2]/t,n._v[3]=e._v[3]/t,n}toString(){return"("+this._v[0]+", "+this._v[1]+", "+this._v[2]+", "+this._v[3]+")"}toStringApproximately(){return i.k.financial(this._v[0])+" "+i.k.financial(this._v[1])+" "+i.k.financial(this._v[2])+" "+i.k.financial(this._v[3])+"\n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0])1?1:i,i=i<-1?-1:i,e._v[1]=Math.asin(i);const o=2*(this._v[3]*this._v[2]+this._v[0]*this._v[1]),a=1-2*(this._v[1]*this._v[1]+this._v[2]*this._v[2]);return e._v[2]=Math.atan2(o,a),e}toEulerAngles(){const e=new r.P(new Float32Array(3)),t=2*(this._v[3]*this._v[0]+this._v[1]*this._v[2]),n=1-2*(this._v[0]*this._v[0]+this._v[1]*this._v[1]);e._v[0]=Math.atan2(t,n);let i=2*(this._v[3]*this._v[1]-this._v[2]*this._v[0]);i=i>1?1:i,i=i<-1?-1:i,e._v[1]=Math.asin(i);const o=2*(this._v[3]*this._v[2]+this._v[0]*this._v[1]),a=1-2*(this._v[1]*this._v[1]+this._v[2]*this._v[2]);return e._v[2]=Math.atan2(o,a),e}static _divide(e,t){let n,i,o,a;return 0!==t?(n=e._v[0]/t,i=e._v[1]/t,o=e._v[2]/t,a=e._v[3]/t):(console.error("0 division occurred!"),n=1/0,i=1/0,o=1/0,a=1/0),l.fromCopy4(n,i,o,a)}static normalize(e){const t=e.length();return this._divide(e,t)}fromToRotation(e,t){const n=s.d6.fromCopyVector3(e),i=s.d6.fromCopyVector3(t);n.normalize(),i.normalize();const o=n.dot(i);if(o>-1+Number.EPSILON){const e=Math.sqrt(2*(1+o)),t=1/e,a=r.P.multiply(n.cross(i),t);return this._v[0]=a.x,this._v[1]=a.y,this._v[2]=a.z,this._v[3]=.5*e,l.normalize(this)}{let e=r.P.fromCopy3(0,1,0),t=n.cross(e);return t.length()-1+Number.EPSILON){const e=Math.sqrt(2*(1+o)),t=1/e,a=r.P.multiply(n.cross(i),t);return l.fromCopy4(a.x,a.y,a.z,.5*e)}{let e=r.P.fromCopy3(0,1,0),t=n.cross(e);return t.length(){"use strict";n.d(t,{Ru:()=>s,ap:()=>r,kO:()=>l});var i=n(3032),o=n(3343),a=n(810);class r extends o.O{constructor(e,{type:t}){super(),this._v=e}getValue(){return this._v[0]}getValueInArray(){return[this._v[0]]}get x(){return this._v[0]}get raw(){return this._v}isStrictEqual(e){return this.x===e.x}isEqual(e,t=Number.EPSILON){return Math.abs(e.x-this.x){"use strict";n.d(t,{EY:()=>l,FM:()=>s,HO:()=>c,ig:()=>_,pV:()=>r});var i=n(3032),o=n(810),a=n(3343);class r extends a.O{constructor(e,{type:t}){super(),this._v=e}get x(){return this._v[0]}get y(){return this._v[1]}get glslStrAsFloat(){return`vec2(${i.k.convertToStringAsGLSLFloat(this._v[0])}, ${i.k.convertToStringAsGLSLFloat(this._v[1])})`}get glslStrAsInt(){return`ivec2(${Math.floor(this._v[0])}, ${Math.floor(this._v[1])})`}static get compositionType(){return o.d.Vec2}static lengthSquared(e){return e.lengthSquared()}static lengthBtw(e,t){return e.lengthTo(t)}static angleOfVectors(e,t){const n=e.length()*t.length();0===n&&console.error("length of a vector is 0!");const i=e.dot(t)/n;return Math.acos(i)}static _zero(e){return this._fromCopyArray2([0,0],e)}static _one(e){return this._fromCopyArray2([1,1],e)}static _dummy(e){return new this(new e,{type:e})}static _normalize(e,t){const n=e.length();return this._divide(e,n,t)}static _add(e,t,n){const i=e._v[0]+t._v[0],o=e._v[1]+t._v[1];return this._fromCopyArray2([i,o],n)}static addTo(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n}static _subtract(e,t,n){const i=e._v[0]-t._v[0],o=e._v[1]-t._v[1];return this._fromCopyArray2([i,o],n)}static subtractTo(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n}static _multiply(e,t,n){const i=e._v[0]*t,o=e._v[1]*t;return this._fromCopyArray2([i,o],n)}static multiplyTo(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n}static _multiplyVector(e,t,n){const i=e._v[0]*t._v[0],o=e._v[1]*t._v[1];return this._fromCopyArray2([i,o],n)}static multiplyVectorTo(e,t,n){return n._v[0]=e._v[0]*t._v[0],n._v[1]=e._v[1]*t._v[1],n}static _divide(e,t,n){let i,o;return 0!==t?(i=e._v[0]/t,o=e._v[1]/t):(console.error("0 division occurred!"),i=1/0,o=1/0),this._fromCopyArray2([i,o],n)}static divideTo(e,t,n){return 0!==t?(n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t):(console.error("0 division occurred!"),n._v[0]=1/0,n._v[1]=1/0),n}static _divideVector(e,t,n){let i,o;return 0!==t._v[0]&&0!==t._v[1]?(i=e._v[0]/t._v[0],o=e._v[1]/t._v[1]):(console.error("0 division occurred!"),i=0===t._v[0]?1/0:e._v[0]/t._v[0],o=0===t._v[1]?1/0:e._v[1]/t._v[1]),this._fromCopyArray2([i,o],n)}static divideVectorTo(e,t,n){return 0!==t._v[0]&&0!==t._v[1]?(n._v[0]=e._v[0]/t._v[0],n._v[1]=e._v[1]/t._v[1]):(console.error("0 division occurred!"),n._v[0]=0===t._v[0]?1/0:e._v[0]/t._v[0],n._v[1]=0===t._v[1]?1/0:e._v[1]/t._v[1]),n}static dot(e,t){return e.dot(t)}toString(){return"("+this._v[0]+", "+this._v[1]+")"}toStringApproximately(){return i.k.financial(this._v[0])+" "+i.k.financial(this._v[1])+"\n"}flattenAsArray(){return[this._v[0],this._v[1]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){"use strict";n.d(t,{P:()=>s,R1:()=>_,UJ:()=>l,p8:()=>c,pg:()=>r});var i=n(3032),o=n(810),a=n(3343);class r extends a.O{constructor(e,{type:t}){super(),this._v=e}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return 1}get glslStrAsFloat(){return`vec3(${i.k.convertToStringAsGLSLFloat(this._v[0])}, ${i.k.convertToStringAsGLSLFloat(this._v[1])}, ${i.k.convertToStringAsGLSLFloat(this._v[2])})`}get glslStrAsInt(){return`ivec3(${Math.floor(this._v[0])}, ${Math.floor(this._v[1])}, ${Math.floor(this._v[2])})`}static get compositionType(){return o.d.Vec3}static lengthSquared(e){return e.lengthSquared()}static lengthBtw(e,t){return e.lengthTo(t)}static angleOfVectors(e,t){const n=e.length()*t.length();0===n&&console.error("length of a vector is 0!");const i=e.dot(t)/n;return Math.acos(i)}static _zero(e){return this._fromCopyArray([0,0,0],e)}static _one(e){return this._fromCopyArray([1,1,1],e)}static _dummy(e){return new this(new e([]),{type:e})}static _normalize(e,t){const n=e.length();return this._divide(e,n,t)}static _add(e,t,n){const i=e._v[0]+t._v[0],o=e._v[1]+t._v[1],a=e._v[2]+t._v[2];return this._fromCopyArray([i,o,a],n)}static addTo(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n._v[2]=e._v[2]+t._v[2],n}static _subtract(e,t,n){const i=e._v[0]-t._v[0],o=e._v[1]-t._v[1],a=e._v[2]-t._v[2];return this._fromCopyArray([i,o,a],n)}static subtractTo(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n._v[2]=e._v[2]-t._v[2],n}static _multiply(e,t,n){const i=e._v[0]*t,o=e._v[1]*t,a=e._v[2]*t;return this._fromCopyArray([i,o,a],n)}static multiplyTo(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n._v[2]=e._v[2]*t,n}static _multiplyVector(e,t,n){const i=e._v[0]*t._v[0],o=e._v[1]*t._v[1],a=e._v[2]*t._v[2];return this._fromCopyArray([i,o,a],n)}static multiplyVectorTo(e,t,n){return n._v[0]=e._v[0]*t._v[0],n._v[1]=e._v[1]*t._v[1],n._v[2]=e._v[2]*t._v[2],n}static _divide(e,t,n){let i,o,a;return 0!==t?(i=e._v[0]/t,o=e._v[1]/t,a=e._v[2]/t):(console.error("0 division occurred!"),i=1/0,o=1/0,a=1/0),this._fromCopyArray([i,o,a],n)}static divideTo(e,t,n){return 0!==t?(n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t,n._v[2]=e._v[2]/t):(console.error("0 division occurred!"),n._v[0]=1/0,n._v[1]=1/0,n._v[2]=1/0),n}static _divideVector(e,t,n){let i,o,a;return 0!==t._v[0]&&0!==t._v[1]&&0!==t._v[2]?(i=e._v[0]/t._v[0],o=e._v[1]/t._v[1],a=e._v[2]/t._v[2]):(console.error("0 division occurred!"),i=0===t._v[0]?1/0:e._v[0]/t._v[0],o=0===t._v[1]?1/0:e._v[1]/t._v[1],a=0===t._v[2]?1/0:e._v[2]/t._v[2]),this._fromCopyArray([i,o,a],n)}static divideVectorTo(e,t,n){return 0!==t._v[0]&&0!==t._v[1]&&0!==t._v[2]?(n._v[0]=e._v[0]/t._v[0],n._v[1]=e._v[1]/t._v[1],n._v[2]=e._v[2]/t._v[2]):(console.error("0 division occurred!"),n._v[0]=0===t._v[0]?1/0:e._v[0]/t._v[0],n._v[1]=0===t._v[1]?1/0:e._v[1]/t._v[1],n._v[2]=0===t._v[2]?1/0:e._v[2]/t._v[2]),n}static dot(e,t){return e.dot(t)}static _cross(e,t,n){const i=e._v[1]*t._v[2]-e._v[2]*t._v[1],o=e._v[2]*t._v[0]-e._v[0]*t._v[2],a=e._v[0]*t._v[1]-e._v[1]*t._v[0];return this._fromCopyArray([i,o,a],n)}static crossTo(e,t,n){const i=e._v[1]*t._v[2]-e._v[2]*t._v[1],o=e._v[2]*t._v[0]-e._v[0]*t._v[2],a=e._v[0]*t._v[1]-e._v[1]*t._v[0];return n.setComponents(i,o,a)}static _multiplyQuaternion(e,t,n){const i=2*e._v[0],o=2*e._v[1],a=2*e._v[2],r=e._v[0]*i,s=e._v[1]*o,l=e._v[2]*a,c=e._v[0]*o,_=e._v[0]*a,h=e._v[1]*a,u=e._v[3]*i,d=e._v[3]*o,m=e._v[3]*a,f=(1-(s+l))*t._v[0]+(c-m)*t._v[1]+(_+d)*t._v[2],p=(c+m)*t._v[0]+(1-(r+l))*t._v[1]+(h-u)*t._v[2],v=(_-d)*t._v[0]+(h+u)*t._v[1]+(1-(r+s))*t._v[2];return this._fromCopyArray([f,p,v],n)}static multiplyQuaternionTo(e,t,n){const i=2*e._v[0],o=2*e._v[1],a=2*e._v[2],r=e._v[0]*i,s=e._v[1]*o,l=e._v[2]*a,c=e._v[0]*o,_=e._v[0]*a,h=e._v[1]*a,u=e._v[3]*i,d=e._v[3]*o,m=e._v[3]*a,f=(1-(s+l))*t._v[0]+(c-m)*t._v[1]+(_+d)*t._v[2],p=(c+m)*t._v[0]+(1-(r+l))*t._v[1]+(h-u)*t._v[2],v=(_-d)*t._v[0]+(h+u)*t._v[1]+(1-(r+s))*t._v[2];return n.setComponents(f,p,v)}toString(){return"("+this._v[0]+", "+this._v[1]+", "+this._v[2]+")"}toStringApproximately(){return i.k.financial(this._v[0])+" "+i.k.financial(this._v[1])+" "+i.k.financial(this._v[2])+"\n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){"use strict";n.d(t,{GY:()=>h,Lt:()=>s,Tj:()=>l,cV:()=>_,n9:()=>c,rE:()=>r});var i=n(3032),o=n(810),a=n(3343);class r extends a.O{constructor(e,{type:t}){super(),this._v=e}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return this._v[3]}get glslStrAsFloat(){return`vec4(${i.k.convertToStringAsGLSLFloat(this._v[0])}, ${i.k.convertToStringAsGLSLFloat(this._v[1])}, ${i.k.convertToStringAsGLSLFloat(this._v[2])}, ${i.k.convertToStringAsGLSLFloat(this._v[3])})`}get glslStrAsInt(){return`ivec4(${Math.floor(this._v[0])}, ${Math.floor(this._v[1])}, ${Math.floor(this._v[2])}, ${Math.floor(this._v[3])})`}static _fromCopyArray4(e,t){return new this(new t(e),{type:t})}static _fromCopy4(e,t,n,i,o){return new this(new o([e,t,n,i]),{type:o})}static _fromCopyArray(e,t){return new this(new t(e.slice(0,4)),{type:t})}static _fromCopyVector4(e,t){return new this(new t([e._v[0],e._v[1],e._v[2],e._v[3]]),{type:t})}static _fromCopyVector3(e,t){return new this(new t([e._v[0],e._v[1],e._v[2],1]),{type:t})}static _fromVector2(e,t){return new this(new t([e._v[0],e._v[1],0,1]),{type:t})}static get compositionType(){return o.d.Vec4}static lengthSquared(e){return e.lengthSquared()}static lengthBtw(e,t){return e.lengthTo(t)}static _zero(e){return new this(new e([0,0,0,0]),{type:e})}static _one(e){return new this(new e([1,1,1,1]),{type:e})}static _dummy(e){return new this(new e([]),{type:e})}static _normalize(e,t){const n=e.length();return this._divide(e,n,t)}static _add(e,t,n){return new this(new n([e._v[0]+t._v[0],e._v[1]+t._v[1],e._v[2]+t._v[2],e._v[3]+t._v[3]]),{type:n})}static addTo(e,t,n){return n._v[0]=e._v[0]+t._v[0],n._v[1]=e._v[1]+t._v[1],n._v[2]=e._v[2]+t._v[2],n._v[3]=e._v[3]+t._v[3],n}static _subtract(e,t,n){return new this(new n([e._v[0]-t._v[0],e._v[1]-t._v[1],e._v[2]-t._v[2],e._v[3]-t._v[3]]),{type:n})}static subtractTo(e,t,n){return n._v[0]=e._v[0]-t._v[0],n._v[1]=e._v[1]-t._v[1],n._v[2]=e._v[2]-t._v[2],n._v[3]=e._v[3]-t._v[3],n}static _multiply(e,t,n){return new this(new n([e._v[0]*t,e._v[1]*t,e._v[2]*t,e._v[3]*t]),{type:n})}static multiplyTo(e,t,n){return n._v[0]=e._v[0]*t,n._v[1]=e._v[1]*t,n._v[2]=e._v[2]*t,n._v[3]=e._v[3]*t,n}static _multiplyVector(e,t,n){return new this(new n([e._v[0]*t._v[0],e._v[1]*t._v[1],e._v[2]*t._v[2],e._v[3]*t._v[3]]),{type:n})}static multiplyVectorTo(e,t,n){return n._v[0]=e._v[0]*t._v[0],n._v[1]=e._v[1]*t._v[1],n._v[2]=e._v[2]*t._v[2],n._v[3]=e._v[3]*t._v[3],n}static _divide(e,t,n){let i,o,a,r;return 0!==t?(i=e._v[0]/t,o=e._v[1]/t,a=e._v[2]/t,r=e._v[3]/t):(console.error("0 division occurred!"),i=1/0,o=1/0,a=1/0,r=1/0),new this(new n([i,o,a,r]),{type:n})}static divideTo(e,t,n){return 0!==t?(n._v[0]=e._v[0]/t,n._v[1]=e._v[1]/t,n._v[2]=e._v[2]/t,n._v[3]=e._v[3]/t):(console.error("0 division occurred!"),n._v[0]=1/0,n._v[1]=1/0,n._v[2]=1/0,n._v[3]=1/0),n}static _divideVector(e,t,n){let i,o,a,r;return 0!==t._v[0]&&0!==t._v[1]&&0!==t._v[2]&&0!==t._v[3]?(i=e._v[0]/t._v[0],o=e._v[1]/t._v[1],a=e._v[2]/t._v[2],r=e._v[3]/t._v[3]):(console.error("0 division occurred!"),i=0===t._v[0]?1/0:e._v[0]/t._v[0],o=0===t._v[1]?1/0:e._v[1]/t._v[1],a=0===t._v[2]?1/0:e._v[2]/t._v[2],r=0===t._v[3]?1/0:e._v[3]/t._v[3]),new this(new n([i,o,a,r]),{type:n})}static divideVectorTo(e,t,n){return 0!==t._v[0]&&0!==t._v[1]&&0!==t._v[2]&&0!==t._v[3]?(n._v[0]=e._v[0]/t._v[0],n._v[1]=e._v[1]/t._v[1],n._v[2]=e._v[2]/t._v[2],n._v[3]=e._v[3]/t._v[3]):(console.error("0 division occurred!"),n._v[0]=0===t._v[0]?1/0:e._v[0]/t._v[0],n._v[1]=0===t._v[1]?1/0:e._v[1]/t._v[1],n._v[2]=0===t._v[2]?1/0:e._v[2]/t._v[2],n._v[3]=0===t._v[3]?1/0:e._v[3]/t._v[3]),n}static dot(e,t){return e.dot(t)}toString(){return"("+this._v[0]+", "+this._v[1]+", "+this._v[2]+", "+this._v[3]+")"}toStringApproximately(){return i.k.financial(this._v[0])+" "+i.k.financial(this._v[1])+" "+i.k.financial(this._v[2])+" "+i.k.financial(this._v[3])+"\n"}flattenAsArray(){return[this._v[0],this._v[1],this._v[2],this._v[3]]}isDummy(){return 0===this._v.length}isEqual(e,t=Number.EPSILON){return Math.abs(e._v[0]-this._v[0]){"use strict";n.d(t,{j:()=>i});class i{constructor(e){this._v=e}}},4020:(e,t,n)=>{"use strict";n.d(t,{mN:()=>o.m,bC:()=>a,XA:()=>r.X,lJ:()=>s.l,Ox:()=>l.O,sZ:()=>c.s,tW:()=>h,SG:()=>d,zU:()=>u,ig:()=>F.ig,HO:()=>F.HO,R1:()=>B.R1,p8:()=>B.p8,GY:()=>_.GY,cV:()=>_.cV,n9:()=>_.n9,cm:()=>m.c,aq:()=>f.a,lW:()=>v,Db:()=>A.D,kj:()=>y.k,ak:()=>x.a,h:()=>g.h,Je:()=>I.J,CE:()=>E,l$:()=>S,f7:()=>C.f,xk:()=>w.x,ec:()=>R.e,yG:()=>P.y,DU:()=>M.DU,Et:()=>M.Et,$_:()=>M.$_,NR:()=>D.NR,el:()=>D.el,th:()=>D.th,d6:()=>b.d6,I1:()=>b.I1,oV:()=>b.oV,xQ:()=>T.xQ,e2:()=>T.e2,hn:()=>T.hn,_f:()=>p._,Ru:()=>N.Ru,ap:()=>N.ap,kO:()=>N.kO,WQ:()=>L,FM:()=>F.FM,pV:()=>F.pV,EY:()=>F.EY,P:()=>B.P,pg:()=>B.pg,UJ:()=>B.UJ,Lt:()=>_.Lt,rE:()=>_.rE,Tj:()=>_.Tj,j8:()=>G.j,Zz:()=>i.Zz,TL:()=>i.TL,RZ:()=>i.sZ,jI:()=>i.jI,F5:()=>i.F5,vP:()=>i.vP,to:()=>i.to,wr:()=>i.wr,nn:()=>i.nn,w0:()=>i.w0,GW:()=>i.GW,t5:()=>i.t5,vk:()=>i.vk,PF:()=>i.PF,Ff:()=>i.Ff,Up:()=>i.Up,Dq:()=>i.Dq,VI:()=>i.VI,hx:()=>i.hx,JI:()=>i.JI,fK:()=>i.fK,lx:()=>i.lx,ns:()=>i.ns,eI:()=>i.p8,n5:()=>i.n5,QU:()=>i.QU,Xg:()=>i.Xg,Rl:()=>i.Rl,_7:()=>i._7});var i=n(3991),o=n(2477);class a{constructor(){this._v=new Float32Array}isTheSourceSame(e){return this._v.buffer===e}}var r=n(8775),s=n(3632),l=n(3343),c=n(1162),_=n(7192);class h extends _.Lt{constructor(e){super(e)}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return this._v[3]}get r(){return this._v[0]}get g(){return this._v[1]}get b(){return this._v[2]}get a(){return this._v[3]}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}clone(){return super.clone()}static fromCopyArray(e){return this._fromCopyArray(e,Float32Array)}static fromCopyArray4(e){return this._fromCopyArray4(e,Float32Array)}static fromCopy4(e,t,n,i){return this._fromCopy4(e,t,n,i,Float32Array)}static fromCopyVector4(e){return this._fromCopyVector4(e,Float32Array)}}const u=new h(new Float32Array([1,1,1,1])),d=new h(new Float32Array([0,0,0,1]));var m=n(346),f=n(2086),p=n(9207);class v{constructor(e){this._v=e}get x(){return this._v[0]}get y(){return this._v[1]}get z(){return this._v[2]}get w(){return 1}static fromFloat32Array(e){return new v(e)}static fromCopyArray3(e){return new p._(new Float32Array(e))}static fromCopyArray(e){return new p._(new Float32Array(e.slice(0,3)))}static fromCopy3(e,t,n){return new p._(new Float32Array([e,t,n]))}static fromCopyLogQuaternion(e){const t=new Float32Array(3);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],new p._(t)}static fromCopyVector4(e){const t=new Float32Array(3);return t[0]=e._v[0],t[1]=e._v[1],t[2]=e._v[2],new p._(t)}static fromCopyQuaternion(e){const t=Math.acos(e.w),n=Math.sin(t),i=new Float32Array(3);return i[0]=e.x*(t/n),i[1]=e.y*(t/n),i[2]=e.z*(t/n),new v(i)}get className(){return"LogQuaternion"}}var A=n(8547),y=n(3032),x=n(18),g=n(1937),I=n(5467),b=n(9190);class E extends b.d6{constructor(e){super(e)}get x(){return this._v[0]}set x(e){this._v[0]=e}get y(){return this._v[1]}set y(e){this._v[1]=e}get z(){return this._v[2]}set z(e){this._v[2]=e}get w(){return 1}get r(){return this._v[0]}set r(e){this._v[0]=e}get g(){return this._v[1]}set g(e){this._v[1]=e}get b(){return this._v[2]}set b(e){this._v[2]=e}get a(){return 1}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}static cross(e,t){return super._cross(e,t,Float32Array)}clone(){return super.clone()}}var T=n(4536);class S extends T.xQ{constructor(e){super(e)}get x(){return this._v[0]}set x(e){this._v[0]=e}get y(){return this._v[1]}set y(e){this._v[1]=e}get z(){return this._v[2]}set z(e){this._v[2]=e}get w(){return this._v[3]}set w(e){this._v[3]=e}get r(){return this._v[0]}set r(e){this._v[0]=e}get g(){return this._v[1]}set g(e){this._v[1]=e}get b(){return this._v[2]}set b(e){this._v[2]=e}get a(){return this._v[3]}set a(e){this._v[3]=e}static zero(){return super._zero(Float32Array)}static one(){return super._one(Float32Array)}static dummy(){return super._dummy(Float32Array)}static normalize(e){return super._normalize(e,Float32Array)}static add(e,t){return super._add(e,t,Float32Array)}static subtract(e,t){return super._subtract(e,t,Float32Array)}static multiply(e,t){return super._multiply(e,t,Float32Array)}static multiplyVector(e,t){return super._multiplyVector(e,t,Float32Array)}static divide(e,t){return super._divide(e,t,Float32Array)}static divideVector(e,t){return super._divideVector(e,t,Float32Array)}clone(){return super.clone()}}var C=n(7035),w=n(2566),R=n(3496),P=n(963),M=n(4267),D=n(8182),N=n(3616),B=n(2471);class L{constructor(e){this.__is_position_updated=!0,this.__is_scale_updated=!0,this.__is_rotation_updated=!0,this.__is_trs_matrix_updated=!0,this.__updateCount=0,this.__position=b.d6.dummy(),this.__scale=b.d6.dummy(),this.__rotation=P.y.dummy(),this.__matrix=R.e.dummy(),void 0!==e?this.setTransform(e.positionInner,b.d6.fromCopyVector3(e.eulerAnglesInner),e.scaleInner,P.y.fromCopyQuaternion(e.rotationInner),e.matrixInner):(this.__position=b.d6.zero(),this.__scale=b.d6.one(),this.__rotation=P.y.identity(),this.__matrix=R.e.identity())}clone(){return new L(this)}set position(e){this.__position.copyComponents(e),this.__is_position_updated=!0,this.__is_trs_matrix_updated=!1,this.__updateTransform()}get position(){return this.positionInner.clone()}get positionInner(){return this.__is_position_updated||this.__is_trs_matrix_updated&&(this.__matrix.getTranslateTo(this.__position),this.__is_position_updated=!0),this.__position}set eulerAngles(e){const t=Math.sin(.5*e._v[0]),n=Math.cos(.5*e._v[0]),i=Math.sin(.5*e._v[1]),o=Math.cos(.5*e._v[1]),a=Math.sin(.5*e._v[2]),r=Math.cos(.5*e._v[2]);this.rotation=P.y.fromCopy4(t*o*r-n*i*a,n*i*r+t*o*a,n*o*a-t*i*r,n*o*r+t*i*a)}get eulerAngles(){return this.eulerAnglesInner.clone()}get eulerAnglesInner(){return this.__rotation.toEulerAngles()}set scale(e){this.__scale.copyComponents(e),this.__is_scale_updated=!0,this.__is_trs_matrix_updated=!1,this.__updateTransform()}get scale(){return this.scaleInner.clone()}get scaleInner(){return this.__is_scale_updated||this.__is_trs_matrix_updated&&(this.__matrix.getScaleTo(this.__scale),this.__is_scale_updated=!0),this.__scale}set rotation(e){this.__rotation.copyComponents(e),this.__is_rotation_updated=!0,this.__is_trs_matrix_updated=!1,this.__updateTransform()}get rotation(){return this.rotationInner.clone()}get rotationInner(){return this.__is_rotation_updated?this.__rotation:!this.__is_rotation_updated&&this.__is_trs_matrix_updated?(this.__is_rotation_updated=!0,this.__rotation.fromMatrix(this.__matrix),this.__rotation):this.__rotation}__updateTransform(){this.__updateEulerAngles(),this.__updatePosition(),this.__updateScale(),this.__needUpdate()}__updateEulerAngles(){!this.__is_rotation_updated&&this.__is_trs_matrix_updated&&(this.__rotation.fromMatrix(this.__matrix),this.__is_rotation_updated=!0)}__updatePosition(){!this.__is_position_updated&&this.__is_trs_matrix_updated&&(this.__matrix.getTranslateTo(this.__position),this.__is_position_updated=!0)}__updateScale(){!this.__is_scale_updated&&this.__is_trs_matrix_updated&&(this.__matrix.getScaleTo(this.__scale),this.__is_scale_updated=!0)}__updateMatrix(){if(!this.__is_trs_matrix_updated&&this.__is_position_updated&&this.__is_rotation_updated&&this.__is_scale_updated){const e=this.__matrix.fromQuaternion(this.__rotation),t=L.__tmpMatrix44_0.scale(this.__scale);e.multiply(t).putTranslate(this.__position),this.__is_trs_matrix_updated=!0}}set matrix(e){this.__matrix.copyComponents(e),this.__is_trs_matrix_updated=!0,this.__is_position_updated=!1,this.__is_rotation_updated=!1,this.__is_scale_updated=!1,this.__updateTransform()}get matrix(){return this.matrixInner.clone()}get matrixInner(){if(this.__is_trs_matrix_updated)return this.__matrix;const e=this.scaleInner,t=e._v[0],n=e._v[1],i=e._v[2],o=this.rotationInner,a=o._v[0]*o._v[0],r=o._v[1]*o._v[1],s=o._v[2]*o._v[2],l=o._v[1]*o._v[2],c=o._v[0]*o._v[2],_=o._v[0]*o._v[1],h=o._v[3]*o._v[0],u=o._v[3]*o._v[1],d=o._v[3]*o._v[2],m=1-2*(r+s),f=2*(_-d),p=2*(c+u),v=2*(_+d),A=1-2*(a+s),y=2*(l-h),x=2*(c-u),g=2*(l+h),I=1-2*(a+r),b=this.positionInner;return this.__matrix.m00=m*t,this.__matrix.m01=f*n,this.__matrix.m02=p*i,this.__matrix.m03=b.x,this.__matrix.m10=v*t,this.__matrix.m11=A*n,this.__matrix.m12=y*i,this.__matrix.m13=b.y,this.__matrix.m20=x*t,this.__matrix.m21=g*n,this.__matrix.m22=I*i,this.__matrix.m23=b.z,this.__matrix.m30=0,this.__matrix.m31=0,this.__matrix.m32=0,this.__matrix.m33=1,this.__is_trs_matrix_updated=!0,this.__matrix}__needUpdate(){this.__updateCount++}get updateCount(){return this.__updateCount}set rotateMatrix44(e){this.rotation=L.__tmpQuaternion_0.fromMatrix(e)}get rotateMatrix44(){return I.J.fromCopyQuaternion(this.rotation)}setPropertiesFromJson(e){let t=e;"string"==typeof e&&(t=JSON.parse(e));for(const e in t)t.hasOwnProperty(e)&&e in this&&("quaternion"===e?this.rotation=p._.fromCopyArray4(t[e]):this[e]="matrix"===e?I.J.fromCopyArray16RowMajor(t[e]):B.P.fromCopyArray(t[e]))}setRotationFromNewUpAndFront(e,t){const n=e,i=b.d6.crossTo(n,t,L.__tmpVector3_0),o=b.d6.crossTo(i,n,L.__tmpVector3_1),a=L.__tmpMatrix44_0.setComponents(i.x,n.x,o.x,0,i.y,n.y,o.y,0,i.z,n.z,o.z,0,0,0,0,1);this.rotateMatrix44=a}headToDirection(e,t){const n=L.__tmpVector3_0.copyComponents(e).normalize(),i=L.__tmpVector3_1.copyComponents(t).normalize(),o=b.d6.crossTo(n,i,L.__tmpVector3_2),a=B.P.dot(n,i),r=Math.acos(a);this.rotation=L.__tmpQuaternion_0.axisAngle(o,r)}setTransform(e,t,n,i,o){this.__is_trs_matrix_updated=!1,null!=o&&(this.__matrix=o.clone(),this.__is_trs_matrix_updated=!0,this.__is_position_updated=!1,this.__is_rotation_updated=!1,this.__is_scale_updated=!1),null!=e&&(this.__position=e.clone(),this.__is_position_updated=!0),null!=t&&null!=i?(this.__rotation=i.clone(),this.__is_rotation_updated=!0):null!=t?this.__is_rotation_updated=!1:null!=i&&(this.__rotation=i.clone(),this.__is_rotation_updated=!0),null!=n&&(this.__scale=n.clone(),this.__is_scale_updated=!0),this.__updateTransform()}}L.__tmpMatrix44_0=R.e.zero(),L.__tmpVector3_0=b.d6.zero(),L.__tmpVector3_1=b.d6.zero(),L.__tmpVector3_2=b.d6.zero(),L.__tmpQuaternion_0=P.y.identity();var F=n(2390),G=n(4255)},3991:(e,t,n)=>{"use strict";n.d(t,{Dq:()=>h,F5:()=>g,Ff:()=>c,GW:()=>a,JI:()=>m,PF:()=>l,QU:()=>T,Rl:()=>C,TL:()=>A,Up:()=>_,VI:()=>u,Xg:()=>M,Zz:()=>v,_7:()=>w,fK:()=>f,hx:()=>d,jI:()=>x,lx:()=>p,n5:()=>E,nn:()=>i,ns:()=>I,p8:()=>b,sZ:()=>y,t5:()=>r,to:()=>R,vP:()=>S,vk:()=>s,w0:()=>o,wr:()=>P});const i=Symbol("get1"),o=Symbol("get1_offset"),a=Symbol("get1_offsetAsComposition"),r=Symbol("get2"),s=Symbol("get2_offset"),l=Symbol("get2_offsetAsComposition"),c=Symbol("get3"),_=Symbol("get3_offset"),h=Symbol("get3_offsetAsComposition"),u=Symbol("get4"),d=Symbol("get4_offset"),m=Symbol("get4_offsetAsComposition"),f=Symbol("getN_offset"),p=Symbol("getN_offsetAsComposition"),v=Symbol("add2"),A=Symbol("add2_offset"),y=Symbol("add3"),x=Symbol("add3_offset"),g=Symbol("add4"),I=Symbol("mulArray3WithScalar_offset"),b=Symbol("mulArray4WithScalar_offset"),E=Symbol("mulArrayNWithScalar_offset"),T=Symbol("mulThatAndThisToOutAsMat44_offsetAsComposition"),S=Symbol("add4_offset"),C=Symbol("qlerp_offsetAsComposition"),w=Symbol("scalar_lerp_offsetAsComposition"),R=Symbol("array3_lerp_offsetAsComposition"),P=Symbol("arrayN_lerp_offsetAsComposition"),M=Symbol("normalizeArray4"),D=[Array,Float32Array,Float64Array,Int8Array,Int16Array,Int32Array,Uint8Array,Uint16Array,Uint32Array],N=[a,l,i,o,r,s,c,_,h,u,d,m,f,p,v,A,y,x,g,S,I,b,E,T,C,w,R,P,M],B=[function(e){return[this[e]]},function(e){return[this[2*e],this[2*e+1]]},function(){return[this[0]]},function(e){return[this[e]]},function(){return[this[0],this[1]]},function(e){return[this[e],this[e+1]]},function(){return[this[0],this[1],this[2]]},function(e){return[this[e],this[e+1],this[e+2]]},function(e){return[this[3*e],this[3*e+1],this[3*e+2]]},function(){return[this[0],this[1],this[2],this[3]]},function(e){return[this[e],this[e+1],this[e+2],this[e+3]]},function(e){return[this[4*e],this[4*e+1],this[4*e+2],this[4*e+3]]},function(e,t){const n=new Array(t);for(let i=0;i1?a=.999:a<-1&&(a=-.999);let r=Math.acos(a);const s=Math.sin(r);let l;a<0?(a*=-1,r=Math.acos(a),l=-1*Math.sin(r*t)/s):l=Math.sin(r*t)/s;const c=Math.sin(r*(1-t))/s;o[0]=this[0+4*n]*c+e[0+4*i]*l,o[1]=this[1+4*n]*c+e[1+4*i]*l,o[2]=this[2+4*n]*c+e[2+4*i]*l,o[3]=this[3+4*n]*c+e[3+4*i]*l}return o},function(e,t,n,i){return this[n]*(1-t)+e[i]*t},function(e,t,n,i){const o=new Array(3);for(let a=0;a<3;a++)o[a]=this[3*n+a]*(1-t)+e[3*i+a]*t;return o},function(e,t,n,i,o){const a=new Array(t);for(let r=0;r{"use strict";n.d(t,{U:()=>m});var i=n(3999),o=n(810),a=n(2390),r=n(2471),s=n(7192),l=n(8182),c=n(9190),_=n(4536),h=n(1937),u=n(3496),d=n(4690);class m{constructor({bufferView:e,byteOffsetInBufferView:t,compositionType:n,componentType:a,byteStride:r,count:s,raw:l,max:c,min:h,arrayLength:u,normalized:m}){var f,p,v,A,y,x,g,I;this.__compositionType=o.d.Unknown,this.__componentType=i.r.Unknown,this.__count=0,this.__takenCount=0,this.__byteStride=0,this.__max=_.xQ.fromCopyArray([-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE]),this.__min=_.xQ.fromCopyArray([Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE]),this.__arrayLength=1,this.__normalized=!1,this.__isMinMixDirty=!0,this.__version=0,this.__bufferView=e,this.__byteOffsetInRawArrayBufferOfBuffer=e.byteOffsetInRawArrayBufferOfBuffer+t,this.__compositionType=n,this.__componentType=a,this.__count=s,this.__arrayLength=u,d.Is.exist(c)&&this.__max.setComponents(null!==(f=c[0])&&void 0!==f?f:-Number.MAX_VALUE,null!==(p=c[1])&&void 0!==p?p:-Number.MAX_VALUE,null!==(v=c[2])&&void 0!==v?v:-Number.MAX_VALUE,null!==(A=c[3])&&void 0!==A?A:-Number.MAX_VALUE),d.Is.exist(h)&&this.__min.setComponents(null!==(y=h[0])&&void 0!==y?y:Number.MAX_VALUE,null!==(x=h[1])&&void 0!==x?x:Number.MAX_VALUE,null!==(g=h[2])&&void 0!==g?g:Number.MAX_VALUE,null!==(I=h[3])&&void 0!==I?I:Number.MAX_VALUE),d.Is.exist(c)&&d.Is.exist(h)&&(this.__isMinMixDirty=!1),this.__raw=l,this.__normalized=m,this.__byteStride=r,0===this.__byteStride&&(this.__byteStride=this.__compositionType.getNumberOfComponents()*this.__componentType.getSizeInBytes()*this.__arrayLength);const b=this.getTypedArrayClass(this.__componentType);this.__typedArrayClass=b;const E=this.__byteStride-this.__compositionType.getNumberOfComponents()*this.__componentType.getSizeInBytes(),T=this.__raw.byteLength-this.__byteOffsetInRawArrayBufferOfBuffer,S=this.byteStride*this.__count-E;T=this.__count&&console.error("You are trying to allocate more than you have secured.");const t=new this.__typedArrayClass(e,this.__byteOffsetInRawArrayBufferOfBuffer+this.__byteStride*this.__takenCount,this.__compositionType.getNumberOfComponents()*this.__arrayLength);return t._accessor=this,t._idx_of_accessor=this.__takenCount,this.__takenCount+=1,t}_takeExistedOne(e){const t=this.__raw;e>=this.__count&&console.error("You are trying to allocate more than you have secured.");const n=new this.__typedArrayClass(t,this.__byteOffsetInRawArrayBufferOfBuffer+this.__byteStride*e,this.__compositionType.getNumberOfComponents()*this.__arrayLength);return n._accessor=this,n._idx_of_accessor=e,n}get takenCount(){return this.takenCount}get numberOfComponents(){return this.__compositionType.getNumberOfComponents()}get componentSizeInBytes(){return this.__componentType.getSizeInBytes()}get elementSizeInBytes(){return this.numberOfComponents*this.componentSizeInBytes}get elementCount(){return this.__count}get byteLength(){return this.__byteStride*this.__count}get componentType(){return this.__componentType}get compositionType(){return this.__compositionType}getTypedArray(){return this.__typedArray}getUint8Array(){return new Uint8Array(this.bufferView.buffer.getArrayBuffer(),this.byteOffsetInRawArrayBufferOfBuffer,this.byteLength)}get isAoS(){return!this.isSoA}get isSoA(){return this.byteStride===this.__compositionType.getNumberOfComponents()*this.__componentType.getSizeInBytes()}get byteStride(){return this.__byteStride}getScalar(e,{indicesAccessor:t,endian:n=!0}){let i=e;return t&&(i=t.getScalar(e,{})),this.__dataViewGetter(this.__byteStride*i,n)}getScalarAt(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;return n&&(o=n.getScalar(e,{})),this.__dataViewGetter(this.__byteStride*o+t,i)}getVec2AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n)]}getVec3AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n)]}getVec4AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n)]}getMat3AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n),this.__dataViewGetter(this.__byteStride*i+4*o,n),this.__dataViewGetter(this.__byteStride*i+5*o,n),this.__dataViewGetter(this.__byteStride*i+6*o,n),this.__dataViewGetter(this.__byteStride*i+7*o,n),this.__dataViewGetter(this.__byteStride*i+8*o,n)]}getMat4AsArray(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return[this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n),this.__dataViewGetter(this.__byteStride*i+4*o,n),this.__dataViewGetter(this.__byteStride*i+5*o,n),this.__dataViewGetter(this.__byteStride*i+6*o,n),this.__dataViewGetter(this.__byteStride*i+7*o,n),this.__dataViewGetter(this.__byteStride*i+8*o,n),this.__dataViewGetter(this.__byteStride*i+9*o,n),this.__dataViewGetter(this.__byteStride*i+10*o,n),this.__dataViewGetter(this.__byteStride*i+11*o,n),this.__dataViewGetter(this.__byteStride*i+12*o,n),this.__dataViewGetter(this.__byteStride*i+13*o,n),this.__dataViewGetter(this.__byteStride*i+14*o,n),this.__dataViewGetter(this.__byteStride*i+15*o,n)]}getVec2(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return a.FM.fromCopyArray2([this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n)])}getVec3(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return r.P.fromCopyArray([this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n)])}getVec4(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return s.Lt.fromCopyArray([this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n)])}getMat3(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return h.h.fromCopy9RowMajor(this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n),this.__dataViewGetter(this.__byteStride*i+4*o,n),this.__dataViewGetter(this.__byteStride*i+5*o,n),this.__dataViewGetter(this.__byteStride*i+6*o,n),this.__dataViewGetter(this.__byteStride*i+7*o,n),this.__dataViewGetter(this.__byteStride*i+8*o,n))}getMat4(e,{indicesAccessor:t,endian:n=!0}){let i=e;t&&(i=t.getScalar(e,{}));const o=this.componentSizeInBytes;return u.e.fromCopy16RowMajor(this.__dataViewGetter(this.__byteStride*i,n),this.__dataViewGetter(this.__byteStride*i+1*o,n),this.__dataViewGetter(this.__byteStride*i+2*o,n),this.__dataViewGetter(this.__byteStride*i+3*o,n),this.__dataViewGetter(this.__byteStride*i+4*o,n),this.__dataViewGetter(this.__byteStride*i+5*o,n),this.__dataViewGetter(this.__byteStride*i+6*o,n),this.__dataViewGetter(this.__byteStride*i+7*o,n),this.__dataViewGetter(this.__byteStride*i+8*o,n),this.__dataViewGetter(this.__byteStride*i+9*o,n),this.__dataViewGetter(this.__byteStride*i+10*o,n),this.__dataViewGetter(this.__byteStride*i+11*o,n),this.__dataViewGetter(this.__byteStride*i+12*o,n),this.__dataViewGetter(this.__byteStride*i+13*o,n),this.__dataViewGetter(this.__byteStride*i+14*o,n),this.__dataViewGetter(this.__byteStride*i+15*o,n))}getVec2To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i))}getVec3To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i),this.__dataViewGetter(this.__byteStride*o+2*a,i))}getVec4To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i),this.__dataViewGetter(this.__byteStride*o+2*a,i),this.__dataViewGetter(this.__byteStride*o+3*a,i))}getMat3To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i),this.__dataViewGetter(this.__byteStride*o+2*a,i),this.__dataViewGetter(this.__byteStride*o+3*a,i),this.__dataViewGetter(this.__byteStride*o+4*a,i),this.__dataViewGetter(this.__byteStride*o+5*a,i),this.__dataViewGetter(this.__byteStride*o+6*a,i),this.__dataViewGetter(this.__byteStride*o+7*a,i),this.__dataViewGetter(this.__byteStride*o+8*a,i))}getMat4To(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;return t.setComponents(this.__dataViewGetter(this.__byteStride*o,i),this.__dataViewGetter(this.__byteStride*o+1*a,i),this.__dataViewGetter(this.__byteStride*o+2*a,i),this.__dataViewGetter(this.__byteStride*o+3*a,i),this.__dataViewGetter(this.__byteStride*o+4*a,i),this.__dataViewGetter(this.__byteStride*o+5*a,i),this.__dataViewGetter(this.__byteStride*o+6*a,i),this.__dataViewGetter(this.__byteStride*o+7*a,i),this.__dataViewGetter(this.__byteStride*o+8*a,i),this.__dataViewGetter(this.__byteStride*o+9*a,i),this.__dataViewGetter(this.__byteStride*o+10*a,i),this.__dataViewGetter(this.__byteStride*o+11*a,i),this.__dataViewGetter(this.__byteStride*o+12*a,i),this.__dataViewGetter(this.__byteStride*o+13*a,i),this.__dataViewGetter(this.__byteStride*o+14*a,i),this.__dataViewGetter(this.__byteStride*o+15*a,i))}setScalar(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{})),this.__dataViewSetter(this.__byteStride*o,t,i),this.__isMinMixDirty=!0,this.__version++}setVec2(e,t,n,{indicesAccessor:i,endian:o=!0}){let a=e;i&&(a=i.getScalar(e,{}));const r=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*a,t,o),this.__dataViewSetter(this.__byteStride*a+1*r,n,o),this.__isMinMixDirty=!0,this.__version++}setVec3(e,t,n,i,{indicesAccessor:o,endian:a=!0}){let r=e;o&&(r=o.getScalar(e,{}));const s=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*r,t,a),this.__dataViewSetter(this.__byteStride*r+1*s,n,a),this.__dataViewSetter(this.__byteStride*r+2*s,i,a),this.__isMinMixDirty=!0,this.__version++}setVec4(e,t,n,i,o,{indicesAccessor:a,endian:r=!0}){let s=e;a&&(s=a.getScalar(e,{}));const l=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*s,t,r),this.__dataViewSetter(this.__byteStride*s+1*l,n,r),this.__dataViewSetter(this.__byteStride*s+2*l,i,r),this.__dataViewSetter(this.__byteStride*s+3*l,o,r),this.__isMinMixDirty=!0,this.__version++}setMat4(e,t,n,i,o,a,r,s,l,c,_,h,u,d,m,f,p,{indicesAccessor:v,endian:A=!0}){let y=e;v&&(y=v.getScalar(e,{}));const x=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*y,t,A),this.__dataViewSetter(this.__byteStride*y+1*x,n,A),this.__dataViewSetter(this.__byteStride*y+2*x,i,A),this.__dataViewSetter(this.__byteStride*y+3*x,o,A),this.__dataViewSetter(this.__byteStride*y+4*x,a,A),this.__dataViewSetter(this.__byteStride*y+5*x,r,A),this.__dataViewSetter(this.__byteStride*y+6*x,s,A),this.__dataViewSetter(this.__byteStride*y+7*x,l,A),this.__dataViewSetter(this.__byteStride*y+8*x,c,A),this.__dataViewSetter(this.__byteStride*y+9*x,_,A),this.__dataViewSetter(this.__byteStride*y+10*x,h,A),this.__dataViewSetter(this.__byteStride*y+11*x,u,A),this.__dataViewSetter(this.__byteStride*y+12*x,d,A),this.__dataViewSetter(this.__byteStride*y+13*x,m,A),this.__dataViewSetter(this.__byteStride*y+14*x,f,A),this.__dataViewSetter(this.__byteStride*y+15*x,p,A),this.__isMinMixDirty=!0,this.__version++}setVec2AsVector(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*o,t.x,i),this.__dataViewSetter(this.__byteStride*o+1*a,t.y,i),this.__isMinMixDirty=!0,this.__version++}setVec3AsVector(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*o,t.x,i),this.__dataViewSetter(this.__byteStride*o+1*a,t.y,i),this.__dataViewSetter(this.__byteStride*o+2*a,t.z,i),this.__isMinMixDirty=!0,this.__version++}setVec4AsVector(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*o,t.x,i),this.__dataViewSetter(this.__byteStride*o+1*a,t.y,i),this.__dataViewSetter(this.__byteStride*o+2*a,t.z,i),this.__dataViewSetter(this.__byteStride*o+3*a,t.w,i),this.__isMinMixDirty=!0,this.__version++}setMat4AsMatrix44(e,t,{indicesAccessor:n,endian:i=!0}){let o=e;n&&(o=n.getScalar(e,{}));const a=this.componentSizeInBytes;this.__dataViewSetter(this.__byteStride*o,t._v[0],i),this.__dataViewSetter(this.__byteStride*o+1*a,t._v[1],i),this.__dataViewSetter(this.__byteStride*o+2*a,t._v[2],i),this.__dataViewSetter(this.__byteStride*o+3*a,t._v[3],i),this.__dataViewSetter(this.__byteStride*o+4*a,t._v[4],i),this.__dataViewSetter(this.__byteStride*o+5*a,t._v[5],i),this.__dataViewSetter(this.__byteStride*o+6*a,t._v[6],i),this.__dataViewSetter(this.__byteStride*o+7*a,t._v[7],i),this.__dataViewSetter(this.__byteStride*o+8*a,t._v[8],i),this.__dataViewSetter(this.__byteStride*o+9*a,t._v[9],i),this.__dataViewSetter(this.__byteStride*o+10*a,t._v[10],i),this.__dataViewSetter(this.__byteStride*o+11*a,t._v[11],i),this.__dataViewSetter(this.__byteStride*o+12*a,t._v[12],i),this.__dataViewSetter(this.__byteStride*o+13*a,t._v[13],i),this.__dataViewSetter(this.__byteStride*o+14*a,t._v[14],i),this.__dataViewSetter(this.__byteStride*o+15*a,t._v[15],i),this.__isMinMixDirty=!0,this.__version++}copyFromTypedArray(e){const t=this.numberOfComponents;for(let n=0;n{"use strict";n.d(t,{l:()=>l});var i=n(1050),o=n(810),a=n(3999),r=n(3449),s=n(2253);class l{constructor({byteLength:e,buffer:t,name:n,byteAlign:i}){this.__byteLength=0,this.__byteOffset=0,this.__takenBytesIndex=0,this.__name="",this.__bufferViews=[],this.__name=n,this.__byteLength=e,this.__byteAlign=i,t instanceof Uint8Array?(this.__raw=t.buffer,this.__byteOffset=t.byteOffset):this.__raw=t}set name(e){this.__name=e}get name(){return this.__name}getArrayBuffer(){return this.__raw}__padding(e,t){const n=r.j.calcPaddingBytes(e,t);return n>0&&console.info("Padding bytes added to takenBytesIndex."),n}takeBufferView({byteLengthToNeed:e,byteStride:t}){const n=e;if(n+this.__takenBytesIndex>this.byteLength){const e=`The size of the BufferView you are trying to take exceeds the byte length left in the Buffer.\nBuffer.byteLength: ${this.byteLength}, Buffer.takenSizeInByte: ${this.takenSizeInByte},\nbyteSizeToTake: ${n}, the byte length left in the Buffer: ${this.__byteLength-this.__takenBytesIndex}`;return new s.UG({message:e,error:void 0})}const o=new i.q({buffer:this,byteOffsetInBuffer:this.__takenBytesIndex,defaultByteStride:t,byteLength:n,raw:this.__raw});return this.__takenBytesIndex+=n,this.__takenBytesIndex=r.j.addPaddingBytes(this.__takenBytesIndex,this.__byteAlign),this.__bufferViews.push(o),new s.Ok(o)}takeBufferViewWithByteOffset({byteLengthToNeed:e,byteStride:t,byteOffset:n}){if(e+n>this.byteLength){const t=`The size of the BufferView you are trying to take exceeds the byte length left in the Buffer.\nBuffer.byteLength: ${this.byteLength}, Buffer.takenSizeInByte: ${this.takenSizeInByte},\nbyteSizeToTake: ${e}, the byte length left in the Buffer: ${this.__byteLength-this.__takenBytesIndex}`;return new s.UG({message:t,error:void 0})}const o=new i.q({buffer:this,byteOffsetInBuffer:n,defaultByteStride:t,byteLength:e,raw:this.__raw}),a=Uint8Array.BYTES_PER_ELEMENT*e+n;return this.__takenBytesIndex{"use strict";n.d(t,{q:()=>a});var i=n(5519),o=n(2253);class a{constructor({buffer:e,byteOffsetInBuffer:t,defaultByteStride:n,byteLength:i,raw:o}){this.__defaultByteStride=0,this.__takenByte=0,this.__takenAccessorCount=0,this.__accessors=[],this.__buffer=e,this.__byteOffsetInBuffer=t,this.__byteOffsetInRawArrayBufferOfBuffer=e.byteOffsetInRawArrayBuffer+t,this.__byteLength=i,this.__defaultByteStride=n,this.__raw=o}get defaultByteStride(){return this.__defaultByteStride}get byteLength(){return this.__byteLength}get byteOffsetInBuffer(){return this.__byteOffsetInRawArrayBufferOfBuffer-this.__buffer.byteOffsetInRawArrayBuffer}get byteOffsetInRawArrayBufferOfBuffer(){return this.__byteOffsetInRawArrayBufferOfBuffer}get buffer(){return this.__buffer}get isSoA(){return!this.isAoS}get isAoS(){for(const e of this.__accessors)if(e.isAoS)return!0;return!1}getUint8Array(){return new Uint8Array(this.__raw,this.__byteOffsetInRawArrayBufferOfBuffer,this.__byteLength)}takeAccessor({compositionType:e,componentType:t,count:n,byteStride:i=this.defaultByteStride,max:o,min:a,arrayLength:r=1,normalized:s=!1}){return this.__takeAccessorInner({compositionType:e,componentType:t,count:n,byteStride:i,max:o,min:a,normalized:s,arrayLength:r})}takeAccessorWithByteOffset({compositionType:e,componentType:t,count:n,byteOffsetInBufferView:i,byteStride:o=this.defaultByteStride,max:a,min:r,normalized:s=!1}){return this.__takeAccessorInnerWithByteOffset({compositionType:e,componentType:t,count:n,byteStride:o,byteOffsetInBufferView:i,max:a,min:r,normalized:s})}__takeAccessorInner({compositionType:e,componentType:t,count:n,byteStride:a,max:r,min:s,arrayLength:l,normalized:c}){const _=this.__takenByte;let h=a;if(0===h&&(h=e.getNumberOfComponents()*t.getSizeInBytes()*l),this.__takenByte+h*(n-1)+t.getSizeInBytes()*e.getNumberOfComponents()>this.byteLength){const e=`The size of the Accessor you are trying to take exceeds the byte length left in the BufferView.\nBufferView.byteLength: ${this.byteLength}, BufferView.takenSizeInByte: ${this.__takenByte}, Accessor.byteStride: ${a}, Accessor.count: ${n};\nbyteSizeToTake: ${h*n}, the byte length left in the Buffer: ${this.byteLength-this.__takenByte}`;return new o.UG({message:e,error:void 0})}const u=new i.U({bufferView:this,byteOffsetInBufferView:_,compositionType:e,componentType:t,byteStride:a,count:n,raw:this.__raw,max:r,min:s,arrayLength:l,normalized:c});return this.__accessors.push(u),this.__takenByte+=h*n,new o.Ok(u)}__takeAccessorInnerWithByteOffset({compositionType:e,componentType:t,count:n,byteStride:a,byteOffsetInBufferView:r,max:s,min:l,normalized:c}){if(this.__takenByte+a*(n-1)+t.getSizeInBytes()*e.getNumberOfComponents()>this.byteLength){const e=`The size of the Accessor you are trying to take exceeds the byte length left in the BufferView.\nBufferView.byteLength: ${this.byteLength}, BufferView.takenSizeInByte: ${this.__takenByte}, Accessor.byteStride: ${a}, Accessor.count: ${n};\nbyteSizeToTake: ${a*n}, the byte length left in the Buffer: ${this.byteLength-this.__takenByte}`;return new o.UG({message:e,error:void 0})}const _=new i.U({bufferView:this,byteOffsetInBufferView:r,compositionType:e,componentType:t,byteStride:a,count:n,raw:this.__raw,max:s,min:l,arrayLength:1,normalized:c});return this.__accessors.push(_),new o.Ok(_)}isSame(e){return this.byteLength===e.byteLength&&this.byteOffsetInRawArrayBufferOfBuffer===e.byteOffsetInRawArrayBufferOfBuffer&&this.defaultByteStride===e.defaultByteStride&&this.buffer.getArrayBuffer()===e.buffer.getArrayBuffer()}}},3449:(e,t,n)=>{"use strict";n.d(t,{j:()=>a});var i=n(3738),o=n(4252);class a{static isNode(){return void 0===window&&"undefined"!=typeof process&&!0}static btoa(e){if(a.isNode()){let t;return t=Buffer.isBuffer(e)?e:Buffer.from(e.toString(),"binary"),t.toString("base64")}return btoa(e)}static atob(e){return a.isNode()?Buffer.from(e,"base64").toString("binary"):atob(e)}static dataUriToArrayBuffer(e){const t=e.split(","),n=a.atob(t[1]),i=n.length,o=new ArrayBuffer(i),r=new Uint8Array(o);for(let e=0;e{if(a.isNode());else{const a=new XMLHttpRequest;t?(a.onload=e=>{let i=null;i=t?a.response:a.responseText,n(o,i)},a.open("GET",e,!0),a.responseType="arraybuffer"):(a.onreadystatechange=()=>{if(4!==a.readyState||2!==Math.floor(a.status/100)&&0!==a.status)i&&i(r,a.status);else{let e=null;e=t?a.response:a.responseText,n(o,e)}},a.open("GET",e,!0)),a.send(null)}}))}static toCRC32(e){let t=0,n=0,i=0;const o=a.crc32table;t^=-1;for(let a=0,r=e.length;a>>8^n;return(-1^t)>>>0}static accessBinaryAsImage(e,t,n,i){const o=this.takeBufferViewAsUint8Array(t,e,n);return this.accessArrayBufferAsImage(o,i)}static createBlobImageUriFromUint8Array(e,t){const n=new Blob([e],{type:t});return URL.createObjectURL(n)}static takeBufferViewAsUint8Array(e,t,n){var i;const o=e.bufferViews[t];let a=null!==(i=o.byteOffset)&&void 0!==i?i:0;const r=o.byteLength;let s=n;return n instanceof Uint8Array&&(s=n.buffer,a+=n.byteOffset),new Uint8Array(s,a,r)}static accessArrayBufferAsImage(e,t){const n=this.uint8ArrayToStringInner(new Uint8Array(e));return this.getImageType(t)+a.btoa(n)}static uint8ArrayToStringInner(e){const t=new Array(e.byteLength);for(let n=0;n{const i=new Image;if(i.crossOrigin="Anonymous",e.match(/^blob:/)||e.match(/^data:/))i.onload=()=>{n(i)},i.src=e;else{const o=(e,i)=>{const o=new Uint8Array(i),r=a.createBlobImageUriFromUint8Array(o,t);e.onload=()=>{n(e),URL.revokeObjectURL(r)},e.src=r};(()=>{const t=new XMLHttpRequest;var n;t.onreadystatechange=(n=i,function(){4===t.readyState&&200===t.status&&o(n,t.response)}),t.open("GET",e),t.responseType="arraybuffer",t.send()})()}}))}static createDefaultGltfOptions(){return{files:{},loaderExtension:void 0,defaultMaterialHelperName:void 0,defaultMaterialHelperArgumentArray:[],statesOfElements:[{targets:[],states:{enable:[],functions:{}},isTransparent:!0,opacity:1,isTextureImageToLoadPreMultipliedAlpha:!1}],tangentCalculationMode:1,extendedJson:void 0,__importedType:"undefined"}}static async fetchArrayBuffer(e){try{const t=await fetch(e,{mode:"cors"}),n=await t.arrayBuffer();return new i.Ok(n)}catch(t){return new i.UG({message:`fetchArrayBuffer failed. uri: ${e}`,error:t})}}static getResizedCanvas(e,t){const n=document.createElement("canvas"),i=this.getNearestPowerOfTwo(e.width),o=this.getNearestPowerOfTwo(e.height),a=o/i;let r=0,s=0;return i>o?(r=Math.min(i,t),s=r*a):(s=Math.min(o,t),r=s/a),n.width=r,n.height=s,n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,r,s),[n,r,s]}static detectTransparentPixelExistence(e,t=1){const n=e.width,i=e.height;let o,a;e instanceof ImageData?a=e:e instanceof HTMLImageElement?(o=document.createElement("canvas").getContext("2d"),o.drawImage(e,0,0),a=o.getImageData(0,0,n,i)):(o=e.getContext("2d"),o.drawImage(e,0,0),a=o.getImageData(0,0,n,i));for(let e=0;e{"use strict";n.d(t,{Jx:()=>i,bm:()=>r,cu:()=>a,li:()=>o});class i{constructor({index:e,str:t,noCheckStrUnique:n}){if(null==i.__indices.get(this.constructor)&&i.__indices.set(this.constructor,[]),null==i.__strings.get(this.constructor)&&i.__strings.set(this.constructor,[]),-1!==i.__indices.get(this.constructor).indexOf(e))throw new Error("Dont use duplicate index.");if(!0!==n&&-1!==i.__strings.get(this.constructor).indexOf(t))throw new Error("Dont use duplicate str.");this.index=e,this.str=t,this.symbol=Symbol(t),i.__indices.get(this.constructor).push(e),i.__strings.get(this.constructor).push(t)}toString(){return this.str}toJSON(){return this.index}}function o({typeList:e,index:t}){const n=e.find((e=>e.index===t));if(n)return n}function a({typeList:e,str:t}){const n=e.find((e=>e.str.toLowerCase()===t.toLowerCase()));if(n)return n}function r({typeList:e,str:t}){const n=e.find((e=>e.str===t));if(n)return n}i.__indices=new Map,i.__strings=new Map},4690:(e,t,n)=>{"use strict";n.d(t,{Is:()=>r,V:()=>i});const i={defined:(e,...t)=>void 0!==e,undefined:(e,...t)=>void 0===e,null:(e,...t)=>null===e,exist:(e,...t)=>null!=e,function:(e,...t)=>"function"==typeof e,true:(e,...t)=>!0===e,truly:(e,...t)=>!!e,false:(e,...t)=>!1===e,falsy:(e,...t)=>!e,stringContaining:(e,t)=>-1!==e.indexOf(t)},o={not:e=>function(){return e.apply(null,[...arguments])},all:e=>function(){return Array.isArray(arguments[0])?arguments[0].every(e):[...arguments].every(e)},any:e=>function(){return Array.isArray(arguments[0])?arguments[0].some(e):[...arguments].some(e)}},a={defined:(e,...t)=>void 0===e,undefined:(e,...t)=>void 0!==e,null:(e,...t)=>null!==e,exist:(e,...t)=>null==e,function:(e,...t)=>"function"!=typeof e,true:(e,...t)=>!0!==e,truly:(e,...t)=>!e,false:(e,...t)=>!1!==e,falsy:(e,...t)=>!!e};for(const e in o)if(Object.prototype.hasOwnProperty.call(o,e)){i[e]={};for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&(i[e][t]="not"===e?o[e](a[t]):o[e](i[t]))}const r=i},6098:(e,t,n)=>{"use strict";n.d(t,{$z:()=>T,CW:()=>E,Jx:()=>c,Kf:()=>S,LS:()=>f,OB:()=>l,Qj:()=>x,YU:()=>A,Zs:()=>m,_z:()=>g,bh:()=>d,dK:()=>I,eD:()=>u,fK:()=>s,fY:()=>h,j3:()=>b,kS:()=>r,t0:()=>_,tS:()=>y,vV:()=>v,wv:()=>p});var i=n(4690);const o=function(){const e=["iPod","iPad","iPhone","Android"];for(let t=0;t0)return!0;return a()},a=function(){return navigator.userAgent.indexOf("Macintosh")>-1&&"ontouchend"in document},r=({value:e,defaultValue:t})=>null==e?t:e,s=(e,t)=>!!i.Is.exist(t)&&(e(t),!0),l=(e,t)=>i.Is.exist(t)?e(t):t,c=(e,t)=>!!i.Is.exist(t)&&(e(t),!0),_=(e,t)=>i.Is.exist(t)?e(t):t,h=(e,t)=>!i.Is.undefined(t)||(e(),!1),u=(e,t)=>i.Is.undefined(t)?e():t,d=(e,t)=>{i.Is.undefined(t)&&e()},m=(e,t)=>i.Is.undefined(t)?e():t,f=(e,t)=>null==t?e:t,p=({value:e,compensation:t})=>null==e?t():e,v=e=>null==e?[]:e,A=e=>null==e?new Map:e,y=(e,t)=>e>t?{result:!0,greater:e,less:t}:{result:!1,greater:t,less:e},x=(e,t)=>e{const t=e.split(/\r\n|\r|\n/);let n="";for(let e=0;e=100&&(o=": "),n+=i+o+t[e]+"\n"}return n};function I(e){if(null==e)throw new Error(`Expected 'val' to be existed, but received ${e}`)}function b(e){return JSON.parse(JSON.stringify(e))}function E(e,t){const n=document.createElement("a");n.download=e;const i=new Blob([t],{type:"octet/stream"}),o=URL.createObjectURL(i);n.href=o;const a=new MouseEvent("click");n.dispatchEvent(a),URL.revokeObjectURL(o)}function T(e,t){const n=document.createElement("a");n.download=e;const i=new Blob([t],{type:"octet/stream"}),o=URL.createObjectURL(i);n.href=o;const a=new MouseEvent("click");n.dispatchEvent(a),URL.revokeObjectURL(o)}const S=Object.freeze({isMobileVr:function(){return/(Pacific Build.+OculusBrowser.+SamsungBrowser.+)|(SamsungBrowser)|(Mobile VR)/i.test(window.navigator.userAgent)},isMobile:o,isIOS:function(){const e=["iPod","iPad","iPhone"];for(let t=0;t0)return!0;return a()},isSafari:function(){return navigator.userAgent.indexOf("Safari")>0&&-1===navigator.userAgent.indexOf("Chrome")},preventDefaultForDesktopOnly:function(e){o()||e.preventDefault()},isObject:function(e){return e instanceof Object&&!(e instanceof Array)},fillTemplate:function(e,t){return new Function("return `"+e+"`;").call(t)},isNode:function(){return"undefined"!=typeof process&&!0},concatArrayBuffers:function(e,t,n,i){let o,a=0;for(let e=0;enull!=i&&s+e>i?s+e-i:0;let s=0;const l=(t,i)=>{const a=r(t);return a?(o.set(new Uint8Array(e[i],n[i],a),s),s+=a,!0):(o.set(new Uint8Array(e[i],n[i],t),s),s+=t,!1)},c=e=>{const t=r(e);return t?(o.set(new Uint8Array(t),s),s+=t,!0):(o.set(new Uint8Array(e),s),s+=e,!1)};for(let i=0;i0?a:0;if(l(t[i]-r,i))return o.buffer;if(r>0&&c(r))return o.buffer}return null!=i&&s{const o=new Uint8Array(new ArrayBuffer(e));let a=0;for(const e in t){const r=t[e],s=new Uint8Array(r,n[e],i[e]);o.set(s,a),a+=i[e]}return o.buffer},addLineNumberToCode:g,downloadArrayBuffer:E,downloadTypedArray:T})},6312:(e,t,n)=>{"use strict";n.d(t,{Hq:()=>s,W:()=>c,Wx:()=>a,Zz:()=>l,bD:()=>r});var i=n(4690);const o="The value does not exist!";class a{constructor(e){this.value=e}set(e){this.value=e}then(e){return i.Is.exist(this.value)?e(this.value):new s}unwrapOrDefault(e){return i.Is.exist(this.value)?this.value:e}unwrapOrElse(e){return i.Is.exist(this.value)?this.value:e()}unwrapForce(){if(i.Is.exist(this.value))return this.value;throw new ReferenceError(o)}unwrapOrUndefined(){return i.Is.exist(this.value)?this.value:void 0}has(){return i.Is.exist(this.value)}doesNotHave(){return!i.Is.exist(this.value)}}class r{constructor(e){this.value=e}then(e){return e(this.value)}unwrapOrDefault(e){return this.value}unwrapOrElse(e){return this.value}unwrapForce(){return this.value}unwrapOrUndefined(){return this.value}get(){return this.value}has(){return!0}doesNotHave(){return!1}}class s{then(){return this}unwrapOrDefault(e){return e}unwrapOrElse(e){return e(void 0)}unwrapForce(){throw new ReferenceError(o)}unwrapOrUndefined(){}has(){return!1}doesNotHave(){return!0}}function l(e){if(!e.has())throw new ReferenceError(o)}function c(e){if(e.has())throw new ReferenceError(o)}},3738:(e,t,n)=>{"use strict";n.d(t,{Mr:()=>c,Ok:()=>a,UD:()=>s,UG:()=>r,Z6:()=>l});var i=n(4690);class o{constructor(e){this.val=e}match(e){this instanceof a?e.Ok(this.val):this instanceof r&&e.Err(this.val),i.Is.exist(e.Finally)&&e.Finally()}name(){return this.constructor.name}}class a extends o{constructor(e){super(e)}unwrap(e){return this.val}unwrapForce(){return this.val}true(){return!0}isOk(){return!0}isErr(){return!1}get(){return this.val}}class r extends o{constructor(e){super(e),this.__rnException=new c(this.val)}unwrap(e){e(this.val)}unwrapForce(){throw this.__rnException}false(){return!1}isOk(){return!1}isErr(){return!0}getRnError(){return this.val}toString(){return this.__rnException.stack}}function s(e){if(e.isErr())throw new Error("This is Err. No Ok.")}function l(e){if(e.isOk())throw new Error("This is Ok. No Err.")}class c extends Error{constructor(e){super(`\n message: ${e.message}\n error: ${e.error instanceof r?"see below Exception ↓"+e.error:e.error}\n`),this.err=e,this.name=c._prefix}getRnError(){return this.err}}c._prefix="\nRhodonite Exception"},4252:(e,t,n)=>{"use strict";n.d(t,{n:()=>i});class i extends Promise{constructor(e){super(((e,t)=>{})),this.name="",this.__callbackObj={promiseAllNum:0,resolvedNum:0,rejectedNum:0,pendingNum:0,processedPromises:[]},this.__promise=e instanceof Promise?e:new Promise(e)}static resolve(e){if(e instanceof Promise)return new i(e);if(e instanceof i)return e;if(null!=e.then){const t=new i(((t,n)=>{t(e)}));return t.then=e.then,t}return new i(((t,n)=>{t(e)}))}static all(e,t){if(t){const n=[],o={promiseAllNum:e.length,resolvedNum:0,rejectedNum:0,pendingNum:e.length,processedPromises:[]};for(const a of e){const e=i.resolve(a);e.__callback=t,e.__callbackObj=o,n.push(e)}return new i(Promise.all(n))}return new i(Promise.all(e))}static race(e){return new i(Promise.race(e))}then(e,t){let n;return e&&(n=t=>(0!==this.__callbackObj.promiseAllNum&&-1===this.__callbackObj.processedPromises.indexOf(this)&&(this.__callbackObj.pendingNum--,this.__callbackObj.resolvedNum++,this.__callbackObj.processedPromises.push(this)),this.__callback&&this.__callback(this.__callbackObj),e(t))),this.__promise.then(n,t)}catch(e){return new i(this.__promise.catch(e))}finally(e){return this.__promise.finally(e)}static reject(e){return new i(Promise.reject(e))}}},3581:(e,t,n)=>{"use strict";n.d(t,{q:()=>i});class i{static _processBegin(){0===i.__currentProcessBeginTime&&(i.__systemStartTime=performance.now()),i.__currentProcessBeginTime=performance.now()}static _processEnd(){i.__lastProcessEndTime=performance.now(),i.__lastTickTimeInterval=i.__lastProcessEndTime-i.__currentProcessBeginTime}static get timeFromSystemStart(){return i.__systemStartTime-performance.now()/1e3}static get lastTickTimeInterval(){return i.__lastTickTimeInterval/1e3}}i.__currentProcessBeginTime=0,i.__lastProcessEndTime=0,i.__lastTickTimeInterval=0,i.__systemStartTime=0},2852:(e,t,n)=>{"use strict";n.d(t,{Bx:()=>r,Lq:()=>s,lI:()=>a});var i=n(4690);const o="The value does not exist!";class a{constructor(){this.__weakMap=new WeakMap}set(e,t){this.__weakMap.set(e,t)}unwrapOrDefault(e,t){const n=this.__weakMap.get(e);return i.Is.exist(n)?n:t}unwrapOrElse(e,t){const n=this.__weakMap.get(e);return i.Is.exist(n)?n:t()}unwrapForce(e){const t=this.__weakMap.get(e);if(i.Is.exist(t))return t;throw new ReferenceError(o)}unwrapOrUndefined(e){return this.__weakMap.get(e)}has(e){return this.__weakMap.has(e)}}class r{constructor(e,t){this.__weakMap=new WeakMap,this.__weakMap.set(e,t)}unwrapOrDefault(e,t){return this.__weakMap.get(e)}unwrapOrElse(e,t){return this.__weakMap.get(e)}unwrapForce(e){return this.__weakMap.get(e)}get(e){return this.__weakMap.get(e)}unwrapOrUndefined(e){return this.__weakMap.get(e)}has(e){return!0}}class s{then(){return this}unwrapOrDefault(e,t){return t}unwrapOrElse(e,t){return t(void 0)}unwrapForce(e){throw new ReferenceError(o)}unwrapOrUndefined(e){}has(){return!1}}},2253:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>a,j4:()=>l.j,Jx:()=>c.Jx,UG:()=>C.UG,Lk:()=>E,Is:()=>i.Is,V5:()=>i.V,Kf:()=>T.Kf,Hq:()=>S.Hq,Ok:()=>C.Ok,Wx:()=>S.Wx,Mr:()=>C.Mr,ni:()=>w.n,bD:()=>S.bD,bs:()=>o,qp:()=>R.q,Lq:()=>P.Lq,lI:()=>P.lI,Bx:()=>P.Bx,li:()=>c.li,cu:()=>c.cu,bm:()=>c.bm,_z:()=>T._z,W:()=>S.W,dK:()=>T.dK,Zz:()=>S.Zz,Z6:()=>C.Z6,UD:()=>C.UD,U2:()=>b,AB:()=>I,j3:()=>T.j3,LS:()=>T.LS,CW:()=>T.CW,$z:()=>T.$z,tS:()=>T.tS,WF:()=>T.Jx,t0:()=>T.t0,fK:()=>T.fK,OB:()=>T.OB,bh:()=>T.bh,Zs:()=>T.Zs,fY:()=>T.fY,eD:()=>T.eD,Qj:()=>T.Qj,vV:()=>T.vV,YU:()=>T.YU,oz:()=>r,EY:()=>s,wv:()=>T.wv,kS:()=>T.kS});var i=n(4690);class o{constructor(){this.__weakMap=new WeakMap}set(e,t){return!this.__weakMap.has(e)&&(this.__weakMap.set(e,t),!0)}has(e){return!!this.__weakMap.has(e)}get(e){const t=this.__weakMap.get(e);if(!i.Is.not.exist(t))return this.__weakMap.get(e)}delete(e){return!!this.__weakMap.has(e)&&(this.__weakMap.delete(e),!0)}}class a{constructor(){this.__symbolWeakMap=new o}register(e){this.__symbolWeakMap.set(Symbol(),e)}}const r=e=>{const t=new WeakMap;return n=>{if(t.has(n))return t.get(n);const i=e(n);return t.set(n,i),i}},s=e=>{const t=new Map;return n=>{if(t.has(n))return t.get(n);const i=e(n);return t.set(n,i),i}};var l=n(3449),c=n(2343),_=n(2471),h=n(2566),u=n(3032),d=n(9190),m=n(1162),f=n(8182),p=n(9849);function v(e,t,n){const i=1<e.valuet.value?1:0));for(let e=0;eet?1:0));for(let e=0;e{"use strict";n.d(t,{q:()=>r});var i=n(4020),o=n(2471),a=n(4690);class r{constructor(){if(this.__localScale=o.P.one(),a.Is.not.exist(r.__world)){const e=new OIMO.World({timestep:1/60,iterations:8,broadphase:2,worldscale:1,random:r.__worldProperty.random,info:!1,gravity:[r.__worldProperty.gravity.x,r.__worldProperty.gravity.y,r.__worldProperty.gravity.z]});r.__world=e}}setShape(e,t){const n=r.__world;this.__localScale=e.size,this.__property={type:e.type.str.toLowerCase(),size:[e.size.x,e.size.y,e.size.z],pos:[e.position.x,e.position.y,e.position.z],rot:[e.rotation.x,e.rotation.y,e.rotation.z],move:e.move,density:e.density,friction:e.friction,restitution:e.restitution},this.__body=n.add(this.__property),this.__entity=t}update(){if(void 0===this.__entity)return;const e=this.__body.getPosition(),t=this.__body.getQuaternion();this.__entity.getSceneGraph().setPositionWithoutPhysics(o.P.fromCopy3(e.x,e.y,e.z)),this.__entity.getSceneGraph().setRotationWithoutPhysics(i._f.fromCopy4(t.x,t.y,t.z,t.w))}setPosition(e){const t=r.__world;if(void 0===this.__entity)return;this.__body.remove();const n=this.__property;this.__property={type:n.type,size:[n.size[0],n.size[1],n.size[2]],pos:[e.x,e.y,e.z],rot:[this.__entity.eulerAngles.x,this.__entity.eulerAngles.y,this.__entity.eulerAngles.z],move:n.move,density:n.density,friction:n.friction,restitution:n.restitution},this.__body=t.add(this.__property)}setEulerAngle(e){const t=r.__world;if(void 0===this.__entity)return;const n=this.__body.getPosition();this.__body.remove();const o=this.__property;this.__property={type:o.type,size:[o.size[0],o.size[1],o.size[2]],pos:[n.x,n.y,n.z],rot:[i.kj.radianToDegree(e.x),i.kj.radianToDegree(e.y),i.kj.radianToDegree(e.z)],move:o.move,density:o.density,friction:o.friction,restitution:o.restitution},this.__body=t.add(this.__property)}setScale(e){const t=r.__world;if(void 0===this.__entity)return;const n=this.__body.getPosition();this.__body.remove();const i=this.__property;this.__property={type:i.type,size:[this.__localScale.x*e.x,this.__localScale.y*e.y,this.__localScale.z*e.z],pos:[n.x,n.y,n.z],rot:[this.__entity.eulerAngles.x,this.__entity.eulerAngles.y,this.__entity.eulerAngles.z],move:i.move,density:i.density,friction:i.friction,restitution:i.restitution},this.__body=t.add(this.__property)}static update(){a.Is.exist(r.__world)&&r.__world.step()}}r.__worldProperty={gravity:o.P.fromCopy3(0,-9.8,0),random:!0}},7987:(e,t,n)=>{"use strict";n.d(t,{F:()=>r});var i=n(2251),o=n(8430),a=n(1296);class r{static getCgApiResourceRepository(){const e=a.V7.isWebGL2Approach(o.l.currentProcessApproach)?"webgl":"webgpu",t=i.x.getInstance().getModule(e);return"webgl"===e?t.WebGLResourceRepository.getInstance():t.WebGpuResourceRepository.getInstance()}static getWebGLResourceRepository(){return i.x.getInstance().getModule("webgl").WebGLResourceRepository.getInstance()}}r.InvalidCGAPIResourceUid=-1},8206:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var i=n(9002);class o extends i.S{constructor(){super(),this.__renderPasses=[]}clone(){const e=new o,t=[];for(const e of this.__renderPasses)t.push(e.clone());return e.addRenderPasses(t),e}addRenderPasses(e){for(const t of e)this.__renderPasses.push(t)}clearRenderPasses(){this.__renderPasses.length=0}get renderPasses(){return this.__renderPasses}setViewport(e){for(const t of this.__renderPasses)t.setViewport(e)}}},3981:(e,t,n)=>{"use strict";n.d(t,{R:()=>a});var i=n(9002),o=n(4690);class a extends i.S{constructor(){super(),this.__expressions=[],this.__expressionQueries=[]}addExpression(e,{inputRenderPasses:t,outputs:n}={inputRenderPasses:[],outputs:[]}){if(o.Is.exist(n))for(const t of n){let n=t.renderPass.instance;o.Is.exist(t.renderPass.instance)?n=t.renderPass.instance:o.Is.exist(t.renderPass.index)?n=e.renderPasses[t.renderPass.index]:o.Is.exist(t.renderPass.uniqueName)&&(n=i.S.getRnObjectByName(t.renderPass.uniqueName)),o.Is.exist(n)&&n.setFramebuffer(t.frameBuffer)}this.__expressions.push({expression:e,inputRenderPasses:o.Is.exist(t)?t:[]})}getColorAttachmentFromInputOf(e,t={renderPass:{index:0},colorAttachmentIndex:0,framebufferType:a.FrameBuffer}){return new Promise((n=>{const i=function*(){const e=yield;return n(e),e}();this.__expressionQueries.push([e,t.renderPass,t.colorAttachmentIndex,i,t.framebufferType])}))}resolve(){for(const[e,t,n,a,r]of this.__expressionQueries)for(const s of this.__expressions)if(e===s.expression){let e,l=t.instance;if(o.Is.exist(t.instance)?l=t.instance:o.Is.exist(t.index)?l=s.inputRenderPasses[t.index]:o.Is.exist(t.uniqueName)&&(l=i.S.getRnObjectByName(t.uniqueName)),"ResolveFrameBuffer2"===r?e=l.getResolveFramebuffer2():"ResolveFrameBuffer"===r?e=l.getResolveFramebuffer():"FrameBuffer"===r&&(e=l.getFramebuffer()),o.Is.exist(e)){const t=e.getColorAttachedRenderTargetTexture(n);o.Is.exist(t)&&(a.next(t),a.next(t))}}}clearExpressions(){this.__expressions.length=0}get expressions(){return this.__expressions.map((e=>e.expression))}setViewport(e){for(const t of this.__expressions)t.expression.setViewport(e)}}a.FrameBuffer="FrameBuffer",a.ResolveFrameBuffer="ResolveFrameBuffer",a.ResolveFrameBuffer2="ResolveFrameBuffer2"},4512:(e,t,n)=>{"use strict";n.d(t,{C:()=>h});var i=n(9002),o=n(8491),a=n(7192),r=n(2251),s=n(3952),l=n(4536),c=n(4710),_=n(8430);class h extends i.S{constructor(){super(),this.__entities=[],this.__sceneGraphDirectlyAdded=[],this.__topLevelSceneGraphComponents=[],this.toClearColorBuffer=!1,this.toClearDepthBuffer=!0,this.toClearStencilBuffer=!1,this.isDepthTest=!0,this.clearColor=a.Lt.fromCopyArray([1,1,1,1]),this.clearDepth=1,this.clearStencil=0,this.cullFrontFaceCCW=!0,this.__primitiveMaterial=new Map,this.isVrRendering=!0,this.isOutputForVr=!1,this.toRenderOpaquePrimitives=!0,this.toRenderTransparentPrimitives=!0,this.toRenderEffekseerEffects=!1,this.drawCount=1,this.__renderPassUID=++h.__mesh_uid_count}clone(){var e,t,n,i;const o=new h;return o.__entities=this.__entities.concat(),o.__sceneGraphDirectlyAdded=this.__sceneGraphDirectlyAdded.concat(),o.__topLevelSceneGraphComponents=null===(e=this.__topLevelSceneGraphComponents)||void 0===e?void 0:e.concat(),o.__meshComponents=null===(t=this.__meshComponents)||void 0===t?void 0:t.concat(),o.__frameBuffer=this.__frameBuffer,o.__resolveFrameBuffer=this.__resolveFrameBuffer,o.__resolveFrameBuffer2=this.__resolveFrameBuffer2,o.__viewport=null===(n=this.__viewport)||void 0===n?void 0:n.clone(),o.toClearColorBuffer=this.toClearColorBuffer,o.toClearDepthBuffer=this.toClearDepthBuffer,o.toClearStencilBuffer=this.toClearStencilBuffer,o.isDepthTest=this.isDepthTest,o.clearColor=this.clearColor.clone(),o.clearDepth=this.clearDepth,o.clearStencil=this.clearStencil,o.cameraComponent=this.cameraComponent,o.cullFrontFaceCCW=this.cullFrontFaceCCW,o.__material=this.__material,o.__primitiveMaterial=new Map(this.__primitiveMaterial),o.__webglRenderingStrategy=this.__webglRenderingStrategy,o.isVrRendering=this.isVrRendering,o.isOutputForVr=this.isOutputForVr,o.toRenderOpaquePrimitives=this.toRenderOpaquePrimitives,o.toRenderTransparentPrimitives=this.toRenderTransparentPrimitives,o.__preEachDrawFunc=this.__preEachDrawFunc,o.__postEachRenderFunc=this.__postEachRenderFunc,o.__renderTargetColorAttachments=null===(i=this.__renderTargetColorAttachments)||void 0===i?void 0:i.concat(),o}setPreDrawFunction(e){this.__preEachDrawFunc=e}unsetPreDrawFunction(){this.__preEachDrawFunc=void 0}doPreEachDraw(e){null!=this.__preEachDrawFunc&&this.__preEachDrawFunc(e)}setPostRenderFunction(e){this.__postEachRenderFunc=e}doPostRender(){null!=this.__postEachRenderFunc&&this.__postEachRenderFunc()}addEntities(e){for(const t of e){const e=t.getSceneGraph();this.__sceneGraphDirectlyAdded.push(e);const n=o.a.flattenHierarchy(e,!1).map((e=>e.entity)),i=this.__entities.concat(n).reduce(((e,t)=>(e.set(t.entityUID,t),e)),new Map);this.__entities=Array.from(i.values())}this.__meshComponents=void 0,this.__topLevelSceneGraphComponents=void 0,this.__collectMeshComponents(),this.__collectTopLevelSceneGraphComponents()}get entities(){return this.__entities}clearEntities(){this.__meshComponents=void 0,this.__topLevelSceneGraphComponents=void 0,this.__entities=[]}__collectTopLevelSceneGraphComponents(){if(null==this.__topLevelSceneGraphComponents){const e=t=>(t.parent&&e(t.parent),t);this.__topLevelSceneGraphComponents=this.__sceneGraphDirectlyAdded.map((t=>e(t)));const t=new Set(this.__topLevelSceneGraphComponents);this.__topLevelSceneGraphComponents=Array.from(t)}}__collectMeshComponents(){null==this.__meshComponents&&(this.__meshComponents=[],this.__entities.filter((e=>{const t=e.getComponentByComponentTID(c.z.MeshComponentTID);t&&this.__meshComponents.push(t)})))}get meshComponents(){var e;return null!==(e=this.__meshComponents)&&void 0!==e?e:[]}get sceneTopLevelGraphComponents(){return null!=this.__topLevelSceneGraphComponents?this.__topLevelSceneGraphComponents:[]}setFramebuffer(e){this.__frameBuffer=e,null!=e?this.setViewport(a.Lt.fromCopyArray([0,0,e.width,e.height])):this.__viewport=void 0}setRenderTargetColorAttachments(e){this.__renderTargetColorAttachments=e}getRenderTargetColorAttachments(){return this.__renderTargetColorAttachments}getFramebuffer(){return this.__frameBuffer}removeFramebuffer(){this.__frameBuffer=void 0}setViewport(e){null!=this.__viewport?this.__viewport.copyComponents(e):this.__viewport=l.xQ.fromCopyArray([e.x,e.y,e.z,e.w])}getViewport(){let e=this.__viewport;return null!=e&&(e=h.__tmp_Vector4_0.copyComponents(e)),e}setResolveFramebuffer(e){const t=s.x.getInstance().currentWebGLContextWrapper;t&&t.isWebGL2?this.__resolveFrameBuffer=e:console.error("resolve framebuffer is unavailable in this webgl context")}getResolveFramebuffer(){return this.__resolveFrameBuffer}setResolveFramebuffer2(e){const t=s.x.getInstance().currentWebGLContextWrapper;t&&t.isWebGL2?this.__resolveFrameBuffer2=e:console.error("resolve framebuffer is unavailable in this webgl context")}getResolveFramebuffer2(){return this.__resolveFrameBuffer2}_copyFramebufferToResolveFramebuffers(){this.__copyFramebufferToResolveFramebufferInner(this.__resolveFrameBuffer),this.__copyFramebufferToResolveFramebufferInner(this.__resolveFrameBuffer2)}__copyFramebufferToResolveFramebufferInner(e){if(null==e)return;const t=s.x.getInstance(),n=t.getWebGLResource(this.__frameBuffer.cgApiResourceUid),i=t.getWebGLResource(e.cgApiResourceUid),o=t.currentWebGLContextWrapper.getRawContextAsWebGL2();o.bindFramebuffer(o.READ_FRAMEBUFFER,n),o.bindFramebuffer(o.DRAW_FRAMEBUFFER,i),o.blitFramebuffer(0,0,this.__frameBuffer.width,this.__frameBuffer.height,0,0,e.width,e.height,o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT,o.NEAREST),o.bindFramebuffer(o.READ_FRAMEBUFFER,null),o.bindFramebuffer(o.DRAW_FRAMEBUFFER,null)}__setupMaterial(e){e.isEmptyMaterial()||this.__setWebglRenderingStrategyIfNotYet(this.__webglRenderingStrategy).setupShaderForMaterial(e)}setMaterialForPrimitive(e,t){this.__primitiveMaterial.set(t,e),this.__setupMaterial(e)}setMaterial(e){this.__material=e,this.__setupMaterial(e)}get material(){return this.__material}__setWebglRenderingStrategyIfNotYet(e){if(null!=e)return e;const t=_.l.currentProcessApproach,n=r.x.getInstance().getModule("webgl").getRenderingStrategy(t);return this.__webglRenderingStrategy=n,n}__getMaterialOf(e){return this.__primitiveMaterial.get(e)}__hasMaterialOf(e){return this.__primitiveMaterial.has(e)}getAppropriateMaterial(e){let t;return t=this.__hasMaterialOf(e)?this.__getMaterialOf(e):null!=this.material?this.material:e.material,t}get renderPassUID(){return this.__renderPassUID}}h.__tmp_Vector4_0=l.xQ.zero(),h.__mesh_uid_count=-1},4327:(e,t,n)=>{"use strict";n.d(t,{Pj:()=>c,iC:()=>l,ls:()=>s});var i=n(7683),o=n(4690),a=n(8430),r=n(7987);function s(e){return!(!e.isEmptyMaterial()&&-1!==e._shaderProgramUid)}function l(e){if(e.mesh._variationVBOUid!==r.F.InvalidCGAPIResourceUid){const t=e.mesh.getPrimitiveNumber();let n=0;for(let i=0;i{"use strict";n.d(t,{U:()=>a});var i=n(4690),o=n(6098);class a{constructor(){this.__subscriberMap=new Map}subscribe(e,t){let n=this.__subscriberMap.get(e);return i.Is.not.exist(n)&&(this.__subscriberMap.set(e,[]),n=this.__subscriberMap.get(e)),n.push(t)-1}unsubscribe(e,t){const n=this.__subscriberMap.get(e);null!=n&&n.splice(t,1)}unsubscribeAll(e){this.__subscriberMap.delete(e)}publishAsync(e,t){let n=0;const i=(0,o.vV)(this.__subscriberMap.get(e));for(const e of i)setTimeout(e.bind(this,t),0),n++;return n}publishSync(e,t){let n=0;const i=(0,o.vV)(this.__subscriberMap.get(e));for(const e of i)e(t),n++;return n}}},4742:(e,t,n)=>{"use strict";n.d(t,{$t:()=>j,Cf:()=>E,EY:()=>Q,K2:()=>H,KA:()=>k,KP:()=>U,KQ:()=>q,Lf:()=>h,RO:()=>y,Ry:()=>b,Rz:()=>w,SG:()=>C,Ss:()=>s,Tr:()=>W,UB:()=>T,VS:()=>z,Yw:()=>R,_6:()=>v,_Q:()=>u,ad:()=>O,ak:()=>l,cA:()=>A,cE:()=>g,cG:()=>r,cS:()=>f,fA:()=>x,hD:()=>S,hd:()=>B,jO:()=>X,jP:()=>V,jX:()=>F,k$:()=>d,k4:()=>a,lO:()=>m,lc:()=>I,lv:()=>M,n9:()=>c,oM:()=>P,p2:()=>G,pt:()=>D,q7:()=>p,us:()=>L,vE:()=>_,yy:()=>N,zU:()=>o});var i=n(4690);const o="mousedown",a="mousemove",r="mouseup",s="wheel",l="mouseenter",c="mouseleave",_="mouseover",h="click",u="keydown",d="keyup",m="keypress",f="pointerdown",p="MSPointerDown",v="pointermove",A="MSPointerMove",y="pointerup",x="MSPointerUp",g="pointercancel",I="pointerenter",b="pointerleave",E="pointerover",T="pointerout",S="resize",C="orientationchange",w="tap",R="doubletap",P="longtap",M="hold",D="drag",N="swipe",B="pinch",L="touchstart",F="touchmove",G="touchend",z="touchcancel",V="touchenter",O="touchleave",U="touchover",k="touchout";function Q(e){const t=void 0!==document.ontouchstart,n=window.navigator.pointerEnabled,i=window.navigator.msPointerEnabled;return{start:n?f:i?p:t?L:o,move:n?v:i?A:t?F:a,end:n?y:i?x:t?G:r,click:h}[e]}const W="None",X="CameraController",q="GizmoTranslation",H="GizmoScale";class j{static register(e,t){this.__inputHandlingStateMap.set(e,t),this.__activeMap.set(e,!0),this.__processEventListeners()}static unregister(e){this.__activeMap.set(e,!1),this.__inputHandlingStateMap.delete(e),this.__processEventListeners()}static setActive(e,t){this.__activeMap.set(e,t),e===q&&t?this.__activeMap.set(H,!1):e===H&&t&&this.__activeMap.set(q,!1),this.__processEventListeners()}static __addEventListeners(e){const t=j.__inputHandlingStateMap.get(e);if(i.Is.exist(t))for(const e of t)e.eventTargetDom.addEventListener(e.eventName,e.handler,e.options)}static __removeEventListeners(e){const t=j.__inputHandlingStateMap.get(e);if(i.Is.exist(t))for(const e of t)e.eventTargetDom.removeEventListener(e.eventName,e.handler,e.options)}static __processEventListeners(){const e=j.__inputHandlingStateMap.get(q),t=j.__inputHandlingStateMap.get(H);j.__inputHandlingStateMap.get(X)&&(this.__addEventListeners(X),this.__currentState=X),e&&(this.__addEventListeners(q),this.__removeEventListeners(H),this.__currentState=q),t&&(this.__addEventListeners(H),this.__removeEventListeners(q),this.__currentState=H)}static enableCameraController(){this.__addEventListeners(X),this.__activeMap.set(X,!0),this.__processEventListeners()}static disableCameraController(){this.__removeEventListeners(X),this.__activeMap.set(X,!1),this.__processEventListeners()}static getCurrentState(){return this.__currentState}}j.__inputHandlingStateMap=new Map,j.__activeMap=new Map,j.__currentState=W},2251:(e,t,n)=>{"use strict";n.d(t,{x:()=>i});class i{constructor(){this.__modules=new Map}async loadModule(e,t){let i;return"webgl"===e.toLowerCase()?i=await(await Promise.resolve().then(n.bind(n,8511))).default:"webgpu"===e.toLowerCase()?i=await(await Promise.resolve().then(n.bind(n,7235))).default:"effekseer"===e.toLowerCase()?(i=await(await Promise.resolve().then(n.bind(n,3995))).Effekseer,i.EffekseerComponent.wasmModuleUri=null==t?void 0:t.wasm):"pbr"===e.toLowerCase()?i=await(await Promise.resolve().then(n.bind(n,5649))).default:"xr"===e.toLowerCase()&&(i=await(await Promise.resolve().then(n.bind(n,9131))).default),this.__modules.set(e,i),i}getModule(e){return this.__modules.get(e)}static getInstance(){return this.__instance||(this.__instance=new i),this.__instance}}},3648:(e,t,n)=>{"use strict";n.d(t,{x:()=>C});var i=n(4507),o=n(2404),a=n(7683),r=n(2251),s=n(7987),l=n(9721),c=n(8206),_=n(1350),h=n(224),u=n(9286),d=n(7348),m=n(2471),f=n(9646),p=n(3581),v=n(8430),A=n(6098),y=n(4690),x=n(7973),g=n(3258),I=n(3981),b=n(7192),E=n(4512),T=n(4710),S=n(2192);class C{constructor(){}static startRenderLoop(e,...t){this.__renderLoopFunc=e,this.__args=t;const n=this.__getAnimationFrameObject();this.__animationFrameId=n.requestAnimationFrame(((n,i)=>{const o=r.x.getInstance().getModule("xr");if(y.Is.exist(o)){const e=o.WebXRSystem.getInstance();e.isReadyForWebXR&&e._preRender(n,i);const t=o.WebARSystem.getInstance();t.isReadyForWebAR&&t._preRender(n,i)}if(e.apply(e,[n,...t]),y.Is.exist(o)){const e=o.WebXRSystem.getInstance();e.isReadyForWebXR&&e._postRender();const t=o.WebARSystem.getInstance();t.isReadyForWebAR&&t._preRender(n,i)}this.startRenderLoop(e,...t)}))}static __getAnimationFrameObject(){let e=window;const t=r.x.getInstance().getModule("xr");if(y.Is.exist(t)){const n=t.WebXRSystem.getInstance(),i=t.WebARSystem.getInstance();if(n.requestedToEnterWebXR?e=n.xrSession:i.requestedToEnterWebAR&&(e=i.arSession),y.Is.not.exist(e))return window}return e}static stopRenderLoop(){this.__getAnimationFrameObject().cancelAnimationFrame(this.__animationFrameId),this.__animationFrameId=-1}static restartRenderLoop(){null!=this.__renderLoopFunc&&this.startRenderLoop(this.__renderLoopFunc,0,this.__args)}static processAuto(e=b.Lt.fromCopy4(0,0,0,1)){if(y.Is.not.exist(C.__expressionForProcessAuto)){const t=new c.A,n=new E.C;n.toClearColorBuffer=!0,n.toClearDepthBuffer=!0,n.clearColor=e;const i=new E.C;t.addRenderPasses([n,i]),C.__expressionForProcessAuto=t,C.__renderPassForProcessAuto=i}C.__renderPassForProcessAuto.clearEntities();const t=_.g._getEntities();C.__renderPassForProcessAuto.addEntities(t),this.process([C.__expressionForProcessAuto])}static process(e){if("undefined"!=typeof spector&&spector.setMarker("Rn#"),this.__processApproach===a.V.None)throw new Error("Choose a process approach first.");p.q._processBegin();let t=e;e instanceof I.R&&(t=e.expressions),h.M.current===l.w.InvalidObjectUID&&C.createCamera();const n=s.F.getWebGLResourceRepository(),c=r.x.getInstance().getModule("xr"),_=o.C.getComponentTIDs(),u=o.C.getRenderingComponentTIDs();for(const e of l.w._processStages){const r="common_"+e.methodName;if(e===i.I.Render)for(const i of t)for(const t of u){const s=o.C.getComponentClass(t),l=i.renderPasses.length;for(let o=0;o{e.preventDefault(),this.stopRenderLoop(),console.error("WebGL context lost occurred.")}).bind(this)),e.canvas.addEventListener("webglcontextrestored",(()=>{console.error("WebGL context restored."),this.restartRenderLoop()})),await(0,S.Cb)(),t}static get processApproach(){return this.__processApproach}static resizeCanvas(e,t){s.F.getCgApiResourceRepository().resizeCanvas(e,t)}static getCanvasSize(){return s.F.getWebGLResourceRepository().getCanvasSize()}static getCurrentWebGLContextWrapper(){return this.__cgApiResourceRepository.currentWebGLContextWrapper}}C.__processApproach=a.V.None,C.__renderPassTickCount=0,C.__animationFrameId=-1,C.__args=[],C.__stageMethods=new Map},8430:(e,t,n)=>{"use strict";n.d(t,{l:()=>i});const i={currentProcessApproach:n(7683).V.None}},7290:(e,t,n)=>{"use strict";n.d(t,{y:()=>_});var i=n(9002),o=n(9216),a=n(3999),r=n(5981),s=n(9849),l=n(810),c=n(4690);class _ extends i.S{constructor(){super(),this.__width=0,this.__height=0,this.__level=0,this.__internalFormat=r.d.RGBA8,this.__format=o.V.RGBA,this.__type=a.r.UnsignedByte,this.__hasTransparentPixels=!1,this.__isTextureReady=!1,this.__startedToLoad=!1,this.__name="untitled",this._textureResourceUid=-1,this._samplerResourceUid=-1,this.__textureUid=++_.__textureUidCount}get textureUID(){return this.__textureUid}get width(){return this.__width}set width(e){this.__width=e}get height(){return this.__height}set height(e){this.__height=e}get isTextureReady(){return this.__isTextureReady}get startedToLoad(){return this.__startedToLoad}get htmlImageElement(){return this.__htmlImageElement}get htmlCanvasElement(){const e=document.createElement("canvas"),t=null==e?void 0:e.getContext("2d");return this.__htmlCanvasElement=e,c.Is.exist(t)&&c.Is.exist(this.__htmlImageElement)&&(e.width=this.__htmlImageElement.width,e.height=this.__htmlImageElement.height,t.drawImage(this.__htmlImageElement,0,0,this.__htmlImageElement.width,this.__htmlImageElement.height)),this.__htmlCanvasElement}get uri(){return this.__uri}static getRhodoniteTexture(e){return this.__textureMap.get(e)}set name(e){this.__name=e}get name(){return this.__name}getImageData(e,t,n,i){return void 0===this.__canvasContext&&this.createInternalCanvasContext(),this.__canvasContext.getImageData(e,t,n,i)}getPixelAs(e,t,n){const i=this.getImageData(e,t,1,1).data;return n.compositionType===l.d.Vec4?new n(new Float32Array([i[0],i[1],i[2],i[3]])):new n(new Float32Array([i[0],i[1],i[2]]))}getPixelAsArray(e,t){return this.getImageData(e,t,1,1).data}setPixel(e,t,n){const i=this.getImageData(e,t,1,1),o=i.data,a=n.constructor.compositionType.getNumberOfComponents();for(let e=0;e{"use strict";n.d(t,{B:()=>s});var i=n(7290),o=n(1986),a=n(7987),r=n(5981);class s extends i.y{constructor(){super(),this.mipmapLevelNumber=1,this.hdriFormat=o.c.LDR_SRGB,this.isNamePosNeg=!1}async loadTextureImages(){this.__startedToLoad=!0;const e=a.F.getWebGLResourceRepository(),[t,n]=await e.createCubeTextureFromFiles(this.baseUriToLoad,this.mipmapLevelNumber,this.isNamePosNeg,this.hdriFormat);this._recommendedTextureSampler=n,this._textureResourceUid=t,this.__isTextureReady=!0}loadTextureImagesAsync(){this.__startedToLoad=!0,a.F.getWebGLResourceRepository().createCubeTextureFromFiles(this.baseUriToLoad,this.mipmapLevelNumber,this.isNamePosNeg,this.hdriFormat).then((([e,t])=>{this._textureResourceUid=e,this._recommendedTextureSampler=t})).then((()=>{this.__isTextureReady=!0}))}loadTextureImagesFromBasis(e,{magFilter:t=r.d.Linear,minFilter:n=r.d.LinearMipmapLinear,wrapS:i=r.d.Repeat,wrapT:o=r.d.Repeat}={}){this.__startedToLoad=!0,"undefined"==typeof BASIS&&console.error("Failed to call BASIS() function. Please check to import basis_transcoder.js."),BASIS().then((r=>{const{initializeBasis:s}=r;s();const l=new(0,r.BasisFile)(e);if(!l.startTranscoding())return console.error("failed to start transcoding."),l.close(),void l.delete();const c=a.F.getWebGLResourceRepository().createCubeTextureFromBasis(l,{magFilter:t,minFilter:n,wrapS:i,wrapT:o});this._textureResourceUid=c,this.__isTextureReady=!0,l.close(),l.delete()}))}load1x1Texture(e="rgba(0,0,0,1)"){const t=document.createElement("canvas");t.width=1,t.height=1;const n=t.getContext("2d");n.fillStyle=e,n.fillRect(0,0,1,1);const i=a.F.getCgApiResourceRepository(),[o,r]=i.createCubeTexture(1,[{posX:t,negX:t,posY:t,negY:t,posZ:t,negZ:t}],1,1);this._textureResourceUid=o,this.__isTextureReady=!0}generateTextureFromTypedArrays(e,t,n){const o=a.F.getWebGLResourceRepository(),[r,s]=o.createCubeTexture(e.length,e,t,n);this._recommendedTextureSampler=s,this._textureResourceUid=r,this.__isTextureReady=!0,this.__startedToLoad=!0,i.y.__textureMap.set(this._textureResourceUid,this)}importWebGLTextureDirectly(e,t=0,n=0){this.__width=t,this.__height=n;const o=a.F.getWebGLResourceRepository().setWebGLTextureDirectly(e);this._textureResourceUid=o,this.__startedToLoad=!0,this.__isTextureReady=!0,i.y.__textureMap.set(o,this)}}},4392:(e,t,n)=>{"use strict";n.d(t,{_:()=>c});var i=n(7290),o=n(5981),a=n(9216),r=n(3999),s=n(7987),l=n(7192);class c extends i.y{constructor(){super()}create({width:e,height:t,level:n=0,internalFormat:i=o.d.RGB8,format:s=a.V.RGBA,type:l=r.r.UnsignedByte}){this.__width=e,this.__height=t,this.__level=n,this.__internalFormat=i,this.__format=s,this.__type=l,this.__createRenderTargetTexture()}set _fbo(e){this.__fbo=e}get fbo(){return this.__fbo}__createRenderTargetTexture(){const e=s.F.getWebGLResourceRepository().createRenderTargetTexture({width:this.__width,height:this.__height,level:this.__level,internalFormat:this.__internalFormat,format:this.__format,type:this.__type});this._textureResourceUid=e,i.y.__textureMap.set(e,this)}resize(e,t){this.destroy3DAPIResources(),this.__width=e,this.__height=t,this.__createRenderTargetTexture()}destroy3DAPIResources(){return i.y.__textureMap.delete(this._textureResourceUid),s.F.getWebGLResourceRepository().deleteTexture(this._textureResourceUid),this._textureResourceUid=s.F.InvalidCGAPIResourceUid,!0}getTexturePixelData(){const e=s.F.getWebGLResourceRepository(),t=e.currentWebGLContextWrapper.getRawContext(),n=e.getWebGLResource(this.__fbo.framebufferUID);t.bindFramebuffer(t.FRAMEBUFFER,n);const i=new Uint8Array(this.width*this.height*4);return null!=t.readBuffer&&t.readBuffer(36064+this.__fbo.whichColorAttachment(this)),t.readPixels(0,0,this.width,this.height,t.RGBA,t.UNSIGNED_BYTE,i),t.bindFramebuffer(t.FRAMEBUFFER,null),i}downloadTexturePixelData(){const e=this.getTexturePixelData(),t=document.createElement("canvas");t.width=this.__width,t.height=this.__height;const n=t.getContext("2d"),i=new ImageData(new Uint8ClampedArray(e.buffer),this.__width,this.__height);n.putImageData(i,this.__width,this.__height);const o=t.toDataURL("image/png"),a=document.createElement("a"),r=document.createEvent("MouseEvent");a.href=o,a.download="texture.png",r.initEvent("click",!0,!0),a.dispatchEvent(r)}getPixelValueAt(e,t,n){let i=n;return i||(i=this.getTexturePixelData()),l.Lt.fromCopyArray([i[4*(t*this.width+e)+0],i[4*(t*this.width+e)+1],i[4*(t*this.width+e)+2],i[4*(t*this.width+e)+3]])}generateMipmap(){const e=s.F.getWebGLResourceRepository(),t=e.currentWebGLContextWrapper.getRawContext(),n=e.getWebGLResource(this._textureResourceUid);t.bindTexture(t.TEXTURE_2D,n),t.generateMipmap(t.TEXTURE_2D),t.bindTexture(t.TEXTURE_2D,null)}}},580:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});var i=n(1296),o=n(7987);class a{constructor(e){var t,n;this.__samplerResourceUid=-1,this.__minFilter=e.minFilter,this.__magFilter=e.magFilter,this.__wrapS=e.wrapS,this.__wrapT=e.wrapT,this.__wrapR=null!==(t=e.wrapR)&&void 0!==t?t:i.dI.Repeat,this.__anisotropy=null===(n=e.anisotropy)||void 0===n||n}create(){const e=o.F.getCgApiResourceRepository();this.__samplerResourceUid=e.createTextureSampler({minFilter:this.__minFilter,magFilter:this.__magFilter,wrapS:this.__wrapS,wrapT:this.__wrapT,wrapR:this.__wrapR,anisotropy:this.__anisotropy})}get created(){return-1!==this.__samplerResourceUid}get minFilter(){return this.__minFilter}get magFilter(){return this.__magFilter}get wrapS(){return this.__wrapS}get wrapT(){return this.__wrapT}get wrapR(){return this.__wrapR}get _samplerResourceUid(){return this.__samplerResourceUid}}},2575:(e,t,n)=>{"use strict";n.d(t,{x:()=>u});var i=n(9216),o=n(3999),a=n(5981),r=n(7290),s=n(7987),l=n(3258),c=n(3449),_=n(3667),h=n(2251);class u extends r.y{constructor(){super(),this.autoResize=!0,this.autoDetectTransparency=!1}get hasDataToLoadLazy(){return null!=this.__uriToLoadLazy||null!=this.__imgToLoadLazy}generateTextureFromBasis(e,t){var n;this.__startedToLoad=!0,"undefined"==typeof BASIS&&console.error("Failed to call BASIS() function. Please check to import basis_transcoder.js."),u.__loadedBasisFunc?u.__BasisFile?this.__setBasisTexture(e,t):null===(n=u.__basisLoadPromise)||void 0===n||n.then((()=>{this.__setBasisTexture(e,t)})):(u.__loadedBasisFunc=!0,u.__basisLoadPromise=new Promise((n=>{BASIS().then((i=>{const{initializeBasis:o}=i;o(),u.__BasisFile=i.BasisFile,this.__setBasisTexture(e,t),n()}))})))}__setBasisTexture(e,{level:t=0,internalFormat:n=a.d.RGBA8,format:l=i.V.RGBA,type:c=o.r.UnsignedByte,generateMipmap:_=!0}={}){this.__startedToLoad=!0;const h=new u.__BasisFile(e);if(!h.startTranscoding())return console.error("failed to start transcoding."),h.close(),void h.delete();const d=s.F.getWebGLResourceRepository().createCompressedTextureFromBasis(h,{border:0,format:l,type:c});this._textureResourceUid=d,this.__isTextureReady=!0,r.y.__textureMap.set(d,this),h.close(),h.delete()}async generateTextureFromKTX2(e){this.__startedToLoad=!0;const t=await _.N.getInstance().transcode(e);this.__width=t.width,this.__height=t.height,this.generateCompressedTextureWithMipmapFromTypedArray(t.mipmapData,t.compressionTextureType)}generateTextureFromImage(e,{level:t=0,internalFormat:n=a.d.RGBA8,format:r=i.V.RGBA,type:s=o.r.UnsignedByte,generateMipmap:l=!0}={}){this.__imgToLoadLazy=e,this.__optionsToLoadLazy={level:t,internalFormat:n,format:r,type:s,generateMipmap:l}}async loadFromImgLazy(){var e,t,n,_,h,u,d,m,f,p;if(null==this.__imgToLoadLazy)return;const v=this.__imgToLoadLazy,A=null!==(t=null===(e=this.__optionsToLoadLazy)||void 0===e?void 0:e.level)&&void 0!==t?t:0,y=null!==(_=null===(n=this.__optionsToLoadLazy)||void 0===n?void 0:n.internalFormat)&&void 0!==_?_:a.d.RGBA8,x=null!==(u=null===(h=this.__optionsToLoadLazy)||void 0===h?void 0:h.format)&&void 0!==u?u:i.V.RGBA,g=null!==(m=null===(d=this.__optionsToLoadLazy)||void 0===d?void 0:d.type)&&void 0!==m?m:o.r.UnsignedByte,I=null===(p=null===(f=this.__optionsToLoadLazy)||void 0===f?void 0:f.generateMipmap)||void 0===p||p;this.__startedToLoad=!0,this.__htmlImageElement=v;let b=v;if(this.autoResize){const[e,t,n]=c.j.getResizedCanvas(b,l.D.maxSizeLimitOfNonCompressedTexture);b=e,this.__width=t,this.__height=n,this.__htmlCanvasElement=e}this.autoDetectTransparency&&(this.__hasTransparentPixels=c.j.detectTransparentPixelExistence(b)),this.__width=b.width,this.__height=b.height;const E=s.F.getCgApiResourceRepository();let T;if(b instanceof HTMLImageElement)T=await E.createTextureFromHTMLImageElement(b,{level:A,internalFormat:y,width:this.__width,height:this.__height,border:0,format:x,type:g,generateMipmap:I});else{if(!(b instanceof HTMLCanvasElement))throw new Error("Unsupported image type.");T=E.createTextureFromImageBitmapData(b,{level:A,internalFormat:y,width:this.__width,height:this.__height,border:0,format:x,type:g,generateMipmap:I})}this._textureResourceUid=T,this.__isTextureReady=!0,this.__uri=v.src,r.y.__textureMap.set(T,this),this.__imgToLoadLazy=void 0}generateTextureFromUri(e,{level:t=0,internalFormat:n=a.d.RGBA8,format:r=i.V.RGBA,type:s=o.r.UnsignedByte,generateMipmap:l=!0}={}){this.__uriToLoadLazy=e,this.__optionsToLoadLazy={level:t,internalFormat:n,format:r,type:s,generateMipmap:l}}async loadFromUrlLazy(){var e,t,n,_,h,u,d,m,f,p;if(null==this.__uriToLoadLazy)return;const v=this.__uriToLoadLazy,A=null!==(t=null===(e=this.__optionsToLoadLazy)||void 0===e?void 0:e.level)&&void 0!==t?t:0,y=null!==(_=null===(n=this.__optionsToLoadLazy)||void 0===n?void 0:n.internalFormat)&&void 0!==_?_:a.d.RGBA8,x=null!==(u=null===(h=this.__optionsToLoadLazy)||void 0===h?void 0:h.format)&&void 0!==u?u:i.V.RGBA,g=null!==(m=null===(d=this.__optionsToLoadLazy)||void 0===d?void 0:d.type)&&void 0!==m?m:o.r.UnsignedByte,I=null===(p=null===(f=this.__optionsToLoadLazy)||void 0===f?void 0:f.generateMipmap)||void 0===p||p;return this.__uri=v,this.__startedToLoad=!0,new Promise(((e,t)=>{this.__img=new Image,v.match(/^data:/)||(this.__img.crossOrigin="Anonymous"),this.__img.onload=()=>{this.__htmlImageElement=this.__img;let t=this.__img;if(this.autoResize){const[e,n,i]=c.j.getResizedCanvas(t,l.D.maxSizeLimitOfNonCompressedTexture);t=e,this.__width=n,this.__height=i,this.__htmlCanvasElement=e}this.autoDetectTransparency&&(this.__hasTransparentPixels=c.j.detectTransparentPixelExistence(t)),this.__width=t.width,this.__height=t.height;const n=s.F.getCgApiResourceRepository();let i=s.F.InvalidCGAPIResourceUid;(async()=>{if(t instanceof HTMLImageElement)i=await n.createTextureFromHTMLImageElement(t,{level:A,internalFormat:y,width:this.__width,height:this.__height,border:0,format:x,type:g,generateMipmap:I});else{if(!(t instanceof HTMLCanvasElement))throw new Error("Unsupported image type");{const e=n.createTextureFromImageBitmapData(t,{level:A,internalFormat:y,width:this.__width,height:this.__height,border:0,format:x,type:g,generateMipmap:I});i=e}}this._textureResourceUid=i,this.__isTextureReady=!0,r.y.__textureMap.set(i,this),this.__uriToLoadLazy=void 0,e()})()},this.__img.src=v}))}generate1x1TextureFrom(e="rgba(255,255,255,1)"){const t=document.createElement("canvas");t.width=1,t.height=1,this.__width=1,this.__height=1;const n=t.getContext("2d");n.fillStyle=e,n.fillRect(0,0,1,1);const l=s.F.getCgApiResourceRepository().createTextureFromImageBitmapData(t,{level:0,internalFormat:a.d.RGBA8,width:1,height:1,border:0,format:i.V.RGBA,type:o.r.UnsignedByte,generateMipmap:!1});this._textureResourceUid=l,this.__isTextureReady=!0,r.y.__textureMap.set(l,this)}async generateSheenLutTextureFromDataUri(){const e=h.x.getInstance().getModule("pbr"),t=s.F.getWebGLResourceRepository(),n=await t.createTextureFromDataUri(e.sheen_E_and_DGTerm,{level:0,internalFormat:a.d.RGBA8,border:0,format:i.V.RGBA,type:o.r.UnsignedByte,generateMipmap:!1});this._textureResourceUid=n,this.__isTextureReady=!0,r.y.__textureMap.set(n,this)}generateTextureFromTypedArray(e,{level:t=0,internalFormat:n=a.d.RGBA8,format:l=i.V.RGBA,generateMipmap:c=!0}={}){const _=o.r.fromTypedArray(e),h=s.F.getWebGLResourceRepository().createTextureFromTypedArray(e,{level:t,internalFormat:n,width:this.__width,height:this.__height,border:0,format:l,type:_,generateMipmap:c});this._textureResourceUid=h,this.__isTextureReady=!0,r.y.__textureMap.set(h,this)}generateCompressedTextureFromTypedArray(e,t,n,i){this.__width=t,this.__height=n;const o={level:0,width:t,height:n,buffer:e},a=s.F.getWebGLResourceRepository().createCompressedTexture([o],i);this._textureResourceUid=a,this.__isTextureReady=!0,r.y.__textureMap.set(a,this)}generateCompressedTextureWithMipmapFromTypedArray(e,t){const n=e.find((e=>0===e.level));if(null==n)throw new Error("texture data with level 0 is not found");this.__width=n.width,this.__height=n.height;const i=s.F.getWebGLResourceRepository().createCompressedTexture(e,t);this._textureResourceUid=i,this.__isTextureReady=!0,r.y.__textureMap.set(i,this)}importWebGLTextureDirectly(e,t=0,n=0){this.__width=t,this.__height=n;const i=s.F.getWebGLResourceRepository().setWebGLTextureDirectly(e);this._textureResourceUid=i,this.__startedToLoad=!0,this.__isTextureReady=!0,r.y.__textureMap.set(i,this)}destroy3DAPIResources(){return r.y.__textureMap.delete(this._textureResourceUid),s.F.getWebGLResourceRepository().deleteTexture(this._textureResourceUid),this._textureResourceUid=s.F.InvalidCGAPIResourceUid,this.__isTextureReady=!1,this.__startedToLoad=!1,!0}}u.__loadedBasisFunc=!1},9849:(e,t,n)=>{"use strict";n.d(t,{h:()=>i});class i{constructor(e,t,n){this.__channels=n,this.__width=e,this.__height=t,this.__data=new Float32Array(e*t*n)}resize(e,t,n){this.__width=e,this.__height=t,this.__channels=n,this.__data=new Float32Array(i.transfer(this.__data.buffer,e*t*n*4))}setPixelAtChannel(e,t,n,i){this.__data[t*this.__width*this.__channels+e*this.__channels+n]=i}get width(){return this.__width}get height(){return this.__height}get data(){return this.__data}getPixel(e,t,n){return this.__data[t*this.__width*this.__channels+e*this.__channels+n]}getPixelAs(e,t,n,i){return 3===n?new i(new Float32Array([this.__data[t*this.__width*this.__channels+e*this.__channels+0],this.__data[t*this.__width*this.__channels+e*this.__channels+1],this.__data[t*this.__width*this.__channels+e*this.__channels+2]])):4===n?new i(new Float32Array([this.__data[t*this.__width*this.__channels+e*this.__channels+0],this.__data[t*this.__width*this.__channels+e*this.__channels+1],this.__data[t*this.__width*this.__channels+e*this.__channels+2],this.__data[t*this.__width*this.__channels+e*this.__channels+3]])):void 0}getPixelAsArray(e,t){const n=[];for(let i=0;i=e.byteLength){let t=0,i=e.byteLength;[8,4,2,1].forEach((o=>{if(i>=o){const a=function(e,t,n,i,o){let a=Uint8Array;switch(e){case 8:a=Float64Array;break;case 4:a=Float32Array;break;case 2:a=Uint16Array;break;default:a=Uint8Array}const r=new a(t,i,Math.trunc(o/e)),s=new a(n,i,Math.trunc(o/e));for(let e=0;e{"use strict";n.r(t),n.d(t,{default:()=>i});const i=Object.freeze({sheen_E_and_DGTerm:"data:image/png;base64,iVBORw0KGgoA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zSL:()=>K,zSP:()=>Be,zfW:()=>Xl,zsc:()=>wa});const i=256,o=1024,a=16384,r=0,s=1,l=2,c=3,_=4,h=5,u=6,d=0,m=1,f=768,p=769,v=770,A=771,y=772,x=773,g=774,I=775,b=776,E=32769,T=32770,S=32771,C=32772,w=32774,R=32778,P=32779,M=32777,D=32777,N=34877,B=32968,L=32969,F=32970,G=32971,z=32773,V=34964,O=34965,U=2849,k=33901,Q=33902,W=2885,X=2886,q=2928,H=2930,j=2931,Y=2932,K=2961,J=2962,Z=2964,$=2965,ee=2966,te=2967,ne=2963,ie=2968,oe=34816,ae=34817,re=34818,se=34819,le=36003,ce=36004,_e=36005,he=2978,ue=3088,de=3106,me=3107,fe=3317,pe=3333,ve=3379,Ae=3386,ye=3408,xe=3410,ge=3411,Ie=3412,be=3413,Ee=3414,Te=3415,Se=10752,Ce=32824,we=32873,Re=32936,Pe=32937,Me=32938,De=32939,Ne=34467,Be=7936,Le=7937,Fe=7938,Ge=35738,ze=35739,Ve=37444,Oe=35044,Ue=35040,ke=35048,Qe=34962,We=34963,Xe=34660,qe=34661,He=34342,je=34338,Ye=34339,Ke=34340,Je=34341,Ze=34922,$e=34373,et=34975,tt=2884,nt=1028,it=1029,ot=1032,at=3042,rt=2929,st=3024,lt=32823,ct=32926,_t=32928,ht=3089,ut=2960,dt=0,mt=1280,ft=1281,pt=1282,vt=1285,At=37442,yt=2304,xt=2305,gt=4352,It=4353,bt=4354,Et=33170,Tt=5120,St=5121,Ct=5122,wt=5123,Rt=5124,Pt=5125,Mt=5126,Dt=6402,Nt=6406,Bt=6407,Lt=6408,Ft=6409,Gt=6410,zt=5121,Vt=32819,Ot=32820,Ut=33635,kt=35632,Qt=35633,Wt=35713,Xt=35712,qt=35714,Ht=35715,jt=35717,Yt=35721,Kt=35718,Jt=34921,Zt=36347,$t=36348,en=35661,tn=35660,nn=34930,on=36349,an=35663,rn=35724,sn=35725,ln=512,cn=519,_n=513,hn=514,un=515,dn=516,mn=518,fn=517,pn=7680,vn=7681,An=7682,yn=7683,xn=5386,gn=34055,In=34056,bn=9728,En=9729,Tn=9984,Sn=9985,Cn=9986,wn=9987,Rn=10240,Pn=10241,Mn=10242,Dn=10243,Nn=3553,Bn=5890,Ln=34067,Fn=34068,Gn=34069,zn=34070,Vn=34071,On=34072,Un=34073,kn=34074,Qn=34076,Wn=33984,Xn=33985,qn=33986,Hn=33987,jn=33988,Yn=33989,Kn=33990,Jn=33991,Zn=33992,$n=33993,ei=33994,ti=33995,ni=33996,ii=33997,oi=33998,ai=33999,ri=34e3,si=34001,li=34002,ci=34003,_i=34004,hi=34005,ui=34006,di=34007,mi=34008,fi=34009,pi=34010,vi=34011,Ai=34012,yi=34013,xi=34014,gi=34015,Ii=34016,bi=10497,Ei=33071,Ti=33648,Si=35664,Ci=35665,wi=35666,Ri=35667,Pi=35668,Mi=35669,Di=35670,Ni=35671,Bi=35672,Li=35673,Fi=35674,Gi=35675,zi=35676,Vi=35678,Oi=35680,Ui=36336,ki=36337,Qi=36338,Wi=36339,Xi=36340,qi=36341,Hi=36160,ji=36161,Yi=32854,Ki=32855,Ji=36194,Zi=33189,$i=6401,eo=36168,to=34041,no=36162,io=36163,oo=36164,ao=36176,ro=36177,so=36178,lo=36179,co=36180,_o=36181,ho=36048,uo=36049,mo=36050,fo=36051,po=36064,vo=36096,Ao=36128,yo=33306,xo=0,go=36053,Io=36054,bo=36055,Eo=36057,To=36061,So=36006,Co=36007,wo=34024,Ro=1286,Po=37440,Mo=37441,Do=37443,No=3074,Bo=3314,Lo=3315,Fo=3316,Go=3330,zo=3331,Vo=3332,Oo=32874,Uo=32877,ko=32878,Qo=32883,Wo=33e3,Xo=33001,qo=34045,Ho=35657,jo=35658,Yo=35071,Ko=35076,Jo=35077,Zo=35659,$o=35723,ea=35977,ta=34229,na=37154,ia=37157,oa=37137,aa=36203,ra=6403,sa=32849,la=32856,ca=32857,_a=32879,ha=32882,ua=33082,da=33083,ma=33084,fa=33085,pa=34892,va=34893,Aa=35904,ya=35905,xa=35907,ga=34894,Ia=34836,ba=34837,Ea=34842,Ta=34843,Sa=35866,Ca=35869,wa=35898,Ra=35901,Pa=36208,Ma=36209,Da=36214,Na=36215,Ba=36220,La=36221,Fa=36226,Ga=36227,za=36232,Va=36233,Oa=36238,Ua=36239,ka=36244,Qa=36248,Wa=36249,Xa=33321,qa=33323,Ha=33325,ja=33326,Ya=33327,Ka=33328,Ja=33329,Za=33330,$a=33331,er=33332,tr=33333,nr=33334,ir=33335,or=33336,ar=33337,rr=33338,sr=33339,lr=33340,cr=36756,_r=36757,hr=36758,ur=36759,dr=36975,mr=37167,fr=33503,pr=33640,vr=35899,Ar=35902,yr=36269,xr=34042,gr=5131,Ir=33319,br=33320,Er=36255,Tr=34917,Sr=34918,Cr=34919,wr=35887,Rr=36202,Pr=34852,Mr=34853,Dr=34854,Nr=34855,Br=34856,Lr=34857,Fr=34858,Gr=34859,zr=34860,Vr=34861,Or=34862,Ur=34863,kr=34864,Qr=34865,Wr=34866,Xr=34867,qr=34868,Hr=36063,jr=36065,Yr=36066,Kr=36067,Jr=36068,Zr=36069,$r=36070,es=36071,ts=36072,ns=36073,is=36074,os=36075,as=36076,rs=36077,ss=36078,ls=36079,cs=35679,_s=35682,hs=36289,us=36292,ds=36293,ms=36298,fs=36299,ps=36300,vs=36303,As=36306,ys=36307,xs=36308,gs=36311,Is=36183,bs=35097,Es=35051,Ts=35052,Ss=35053,Cs=35055,ws=36662,Rs=36663,Ps=36662,Ms=36663,Ds=35685,Ns=35686,Bs=35687,Ls=35688,Fs=35689,Gs=35690,zs=36294,Vs=36295,Os=36296,Us=35863,ks=36764,Qs=35069,Ws=35070,Xs=35967,qs=35968,Hs=35971,js=35972,Ys=35973,Ks=35976,Js=35978,Zs=35979,$s=35980,el=35981,tl=35982,nl=35983,il=36386,ol=36387,al=36388,rl=36389,sl=33296,ll=33297,cl=33298,_l=33299,hl=33300,ul=33301,dl=33302,ml=33303,fl=33304,pl=35056,vl=36006,Al=36008,yl=36009,xl=36010,gl=36011,Il=36052,bl=36182,El=35345,Tl=35368,Sl=35369,Cl=35370,wl=35371,Rl=35373,Pl=35374,Ml=35375,Dl=35376,Nl=35377,Bl=35379,Ll=35380,Fl=35382,Gl=35383,zl=35384,Vl=35386,Ol=35387,Ul=35388,kl=35389,Ql=35390,Wl=35391,Xl=35392,ql=35394,Hl=35395,jl=35396,Yl=35398,Kl=37138,Jl=37139,Zl=37140,$l=37141,ec=37142,tc=37143,nc=37144,ic=37145,oc=37146,ac=37147,rc=37148,sc=37149,lc=1,cc=6144,_c=6145,hc=6146,uc=32775,dc=32776,mc=33190,fc=35041,pc=35042,vc=35045,Ac=35046,yc=35049,xc=35050,gc=36012,Ic=36013,bc=4294967295,Ec=-1,Tc=37447,Sc=35070,Cc=37445,wc=37446,Rc=34047,Pc=34046,Mc=33776,Dc=33777,Nc=33778,Bc=33779,Lc=35916,Fc=35917,Gc=35918,zc=35919,Vc=37488,Oc=37489,Uc=37490,kc=37491,Qc=37492,Wc=37493,Xc=37494,qc=37495,Hc=37496,jc=37497,Yc=35840,Kc=35842,Jc=35841,Zc=35843,$c=36196,e_=35986,t_=35986,n_=34798,i_=37808,o_=37809,a_=37810,r_=37811,s_=37812,l_=37813,c_=37814,__=37815,h_=37816,u_=37817,d_=37818,m_=37819,f_=37820,p_=37821,v_=37840,A_=37841,y_=37842,x_=37843,g_=37844,I_=37845,b_=37846,E_=37847,T_=37848,S_=37849,C_=37850,w_=37851,R_=37852,P_=37853,M_=34042,D_=36193,N_=34836,B_=34837,L_=33297,F_=35863,G_=32775,z_=32776,V_=35904,O_=35906,U_=35907,k_=33296,Q_=35723,W_=36064,X_=36065,q_=36066,H_=36067,j_=36068,Y_=36069,K_=36070,J_=36071,Z_=36072,$_=36073,eh=36074,th=36075,nh=36076,ih=36077,oh=36078,ah=36079,rh=34853,sh=34854,lh=34855,ch=34856,_h=34857,hh=34858,uh=34859,dh=34860,mh=34861,fh=34862,ph=34863,vh=34864,Ah=34865,yh=34866,xh=34867,gh=34868,Ih=36063,bh=34852,Eh=34229,Th=34916,Sh=34917,Ch=34918,wh=34919,Rh=35007,Ph=36392,Mh=36795},4350:(e,t,n)=>{"use strict";n.d(t,{C:()=>o,j:()=>i});const i="gltf_node_index";function o(e,t){return e.magFilter===t.magFilter&&e.minFilter===t.minFilter&&e.wrapS===t.wrapS&&e.wrapT===t.wrapT}},10:(e,t,n)=>{"use strict";n.d(t,{_$8:()=>a._$8,lkt:()=>a.lkt,Td9:()=>a.Td9,wEd:()=>a.wEd,ogk:()=>a.ogk,AY1:()=>a.AY1,fNk:()=>a.fNk,Y0n:()=>a.Y0n,WPj:()=>a.WPj,gOo:()=>a.gOo,$LR:()=>a.$LR,faJ:()=>a.faJ,TdU:()=>a.TdU,UAv:()=>a.UAv,Q$l:()=>a.Q$l,wIF:()=>a.wIF,ZXb:()=>a.ZXb,hzX:()=>a.hzX,r9F:()=>a.r9F,Kzo:()=>a.Kzo,ttq:()=>a.ttq,XG_:()=>a.XG_,HPC:()=>a.HPC,QH$:()=>a.QH$,_1o:()=>a._1o,EZ0:()=>a.EZ0,N9T:()=>a.N9T,vgW:()=>a.vgW,tqi:()=>a.tqi,iU2:()=>a.iU2,BWL:()=>a.BWL,F_m:()=>a.F_m,$et:()=>a.$et,gx8:()=>a.gx8,Y8m:()=>a.Y8m,Wlc:()=>a.Wlc,krQ:()=>a.krQ,YCV:()=>a.YCV,p7w:()=>a.p7w,Axb:()=>a.Axb,eqO:()=>a.eqO,gwn:()=>a.gwn,BM1:()=>a.BM1,w4x:()=>a.w4x,CCZ:()=>a.CCZ,FQh:()=>a.FQh,AOk:()=>a.AOk,rjz:()=>a.rjz,LwI:()=>a.LwI,_8G:()=>a._8G,ZC4:()=>a.ZC4,$9l:()=>a.$9l,Bky:()=>a.Bky,qNf:()=>a.qNf,I2u:()=>a.I2u,oC9:()=>a.oC9,ip$:()=>a.ip$,HBF:()=>a.HBF,_Mr:()=>a._Mr,vpR:()=>a.vpR,w_G:()=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ccF,VYu:()=>a.VYu,y3j:()=>a.y3j,FgH:()=>a.FgH,vtI:()=>a.vtI,uCq:()=>a.uCq,qWZ:()=>a.qWZ,t75:()=>a.t75,Kzi:()=>a.Kzi,tNI:()=>a.tNI,zfW:()=>a.zfW,mcF:()=>a.mcF,Nyi:()=>a.Nyi,sxC:()=>a.sxC,q__:()=>a.q__,DBb:()=>a.DBb,mMN:()=>a.mMN,rve:()=>a.rve,o7C:()=>a.o7C,HM$:()=>a.HM$,mS1:()=>a.mS1,xUI:()=>a.xUI,djG:()=>a.djG,Kn4:()=>a.Kn4,jGD:()=>a.jGD,ycd:()=>a.ycd,GM3:()=>a.GM3,XxT:()=>a.XxT,PYx:()=>a.PYx,EVZ:()=>a.EVZ,WYY:()=>a.WYY,m7j:()=>a.m7j,SK7:()=>a.SK7,YrP:()=>a.YrP,bd_:()=>a.bd_,n9O:()=>a.n9O,nQ9:()=>a.nQ9,bTv:()=>a.bTv,iyB:()=>a.iyB,LX0:()=>a.LX0,vEp:()=>a.vEp,Zx4:()=>a.Zx4,yd2:()=>a.yd2,ZtN:()=>a.ZtN,lg3:()=>a.lg3,DAo:()=>a.DAo,TAU:()=>a.TAU,Ki3:()=>a.Ki3,Dr$:()=>a.Dr$,$z8:()=>a.$z8,eQR:()=>a.eQR,zSP:()=>a.zSP,$bm:()=>a.$bm,RGR:()=>a.RGR,fsT:()=>a.fsT,HRE:()=>a.HRE,LUh:()=>a.LUh,C9t:()=>a.C9t,I4M:()=>a.I4M,XZ2:()=>a.XZ2,s7G:()=>a.s7G,bsK:()=>a.bsK,vEN:()=>a.vEN,cqm:()=>a.cqm,eFf:()=>a.eFf,lQo:()=>a.lQo,Ith:()=>a.Ith,GIj:()=>a.GIj,_sJ:()=>a._sJ,j3U:()=>r.j,bup:()=>o,CLY:()=>r.C});var i=n(810);function o(e){switch(e.className){case"Scalar":return i.d.Scalar;case"Vector2":return i.d.Vec2;case"Vector3":return i.d.Vec3;case"Vector4":return i.d.Vec4;case"Matrix22":return i.d.Mat2;case"Matrix33":return i.d.Mat3;case"Matrix44":return i.d.Mat4;default:return console.error("CompositionType.Unknown"),i.d.Unknown}}var a=n(7461),r=n(4350)},5551:(e,t,n)=>{"use strict";n.d(t,{d:()=>m});var i,o,a,r,s,l,c=n(3346),_=n(7192),h=function(e,t,n,i,o){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?o.call(e,n):o?o.value=n:t.set(e,n),n},u=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};const d=-1;class m{constructor(e,t,n){this.__webglVersion=1,this.width=0,this.height=0,this.__activeTextureBackup=-1,this.__activeTextures2D=[],this.__activeTexturesCube=[],this.__isDebugMode=!1,this.__viewport_left=0,this.__viewport_top=0,this.__viewport_width=0,this.__viewport_height=0,this.__default_viewport_left=0,this.__default_viewport_top=0,this.__default_viewport_width=0,this.__default_viewport_height=0,i.set(this,d),o.set(this,d),a.set(this,d),r.set(this,d),s.set(this,d),l.set(this,d),this.__maxVertexUniformVectors=d,this.__maxFragmentUniformVectors=d,this._isWebXRMode=!1,this.__extensions=new Map,this.__gl=e,this.width=t.width,this.height=t.height,this.canvas=t,this.__viewport_width=this.__default_viewport_width=this.width,this.__viewport_height=this.__default_viewport_height=this.height,this.__isDebugMode=n,this.is_multiview=!0,"WebGL2RenderingContext"===this.__gl.constructor.name&&(this.__webglVersion=2,this.webgl2ExtTFL=this.__getExtension(c.c.TextureFloatLinear),this.webgl2ExtTFA=this.__getExtension(c.c.TextureFilterAnisotropic),this.webgl2ExtCBF=this.__getExtension(c.c.ColorBufferFloatWebGL2),this.webgl2ExtCBHF=this.__getExtension(c.c.ColorBufferHalfFloatWebGL2),this.webgl2ExtCTAstc=this.__getCompressedTextureExtension(c.c.CompressedTextureAstc),this.webgl2ExtCTS3tc=this.__getCompressedTextureExtension(c.c.CompressedTextureS3tc),this.webgl2ExtCTPvrtc=this.__getCompressedTextureExtension(c.c.CompressedTexturePvrtc),this.webgl2ExtCTAtc=this.__getCompressedTextureExtension(c.c.CompressedTextureAtc),this.webgl2ExtCTEtc=this.__getCompressedTextureExtension(c.c.CompressedTextureEtc),this.webgl2ExtCTEtc1=this.__getCompressedTextureExtension(c.c.CompressedTextureEtc1),this.webgl2ExtCTBptc=this.__getCompressedTextureExtension(c.c.CompressedTextureBptc),this.webgl2ExtMLTVIEW=this.__getExtension(c.c.OculusMultiview),this.webgl2ExtMLTVIEW?this.webgl2ExtMLTVIEW.is_multisample=!0:(this.webgl2ExtMLTVIEW=this.__getExtension(c.c.OvrMultiview2),this.webgl2ExtMLTVIEW?this.webgl2ExtMLTVIEW.is_multisample=!1:(console.warn("Neither OCULUS_multiview nor OVR_multiview2 extensions are supported"),this.is_multiview=!1)),this.webgl2ExtGmanWM=this.__getCompressedTextureExtension(c.c.GMAN_WEBGL_MEMORY)),this.__getUniformBufferInfo(),this.__getMaxUniformVectors()}getRawContext(){return this.__gl}getRawContextAsWebGL1(){return this.__gl}getRawContextAsWebGL2(){return this.__gl}get viewport(){return _.Lt.fromCopyArray([this.__viewport_left,this.__viewport_top,this.__viewport_width,this.__viewport_height])}get defaultViewport(){return _.Lt.fromCopyArray([this.__default_viewport_left,this.__default_viewport_top,this.__default_viewport_width,this.__default_viewport_height])}isSupportWebGL1Extension(e){return!!this.__getExtension(e)}isNotSupportWebGL1Extension(e){return!this.isSupportWebGL1Extension(e)}get isDebugMode(){return this.__isDebugMode}getIsWebGL2(e){return this.isWebGL2}get isWebGL2(){return 2===this.__webglVersion}createVertexArray(){return this.getIsWebGL2(this.__gl)?this.__gl.createVertexArray():null!=this.webgl1ExtVAO?this.webgl1ExtVAO.createVertexArrayOES():void 0}deleteVertexArray(e){this.getIsWebGL2(this.__gl)?this.__gl.deleteVertexArray(e):null!=this.webgl1ExtVAO&&this.webgl1ExtVAO.deleteVertexArrayOES(e)}bindVertexArray(e){this.getIsWebGL2(this.__gl)?this.__gl.bindVertexArray(e):null!=this.webgl1ExtVAO&&this.webgl1ExtVAO.bindVertexArrayOES(e)}vertexAttribDivisor(e,t){this.getIsWebGL2(this.__gl)?this.__gl.vertexAttribDivisor(e,t):this.webgl1ExtIA.vertexAttribDivisorANGLE(e,t)}drawElementsInstanced(e,t,n,i,o){this.getIsWebGL2(this.__gl)?this.__gl.drawElementsInstanced(e,t,n,i,o):this.webgl1ExtIA.drawElementsInstancedANGLE(e,t,n,i,o)}drawArraysInstanced(e,t,n,i){this.getIsWebGL2(this.__gl)?this.__gl.drawArraysInstanced(e,t,n,i):this.webgl1ExtIA.drawArraysInstancedANGLE(e,t,n,i)}colorAttachment(e){return 36064+e}drawBuffers(e){const t=this.__gl;if(0===e.length)return void t.drawBuffers([t.NONE]);const n=e[0].webGLConstantValue();t.drawBuffers(e.map((e=>e.webGLConstantValue()))),n===t.NONE||0===e.length?t.colorMask(!1,!1,!1,!1):t.colorMask(!0,!0,!0,!0)}__activeTexture(e){if(this.__activeTextureBackup!==e){switch(e){case 0:this.__gl.activeTexture(this.__gl.TEXTURE0);break;case 1:this.__gl.activeTexture(this.__gl.TEXTURE1);break;case 2:this.__gl.activeTexture(this.__gl.TEXTURE2);break;case 3:this.__gl.activeTexture(this.__gl.TEXTURE3);break;case 4:this.__gl.activeTexture(this.__gl.TEXTURE4);break;case 5:this.__gl.activeTexture(this.__gl.TEXTURE5);break;case 6:this.__gl.activeTexture(this.__gl.TEXTURE6);break;case 7:this.__gl.activeTexture(this.__gl.TEXTURE7);break;case 8:this.__gl.activeTexture(this.__gl.TEXTURE8);break;case 9:this.__gl.activeTexture(this.__gl.TEXTURE9);break;case 10:this.__gl.activeTexture(this.__gl.TEXTURE10);break;case 11:this.__gl.activeTexture(this.__gl.TEXTURE11);break;case 12:this.__gl.activeTexture(this.__gl.TEXTURE12);break;case 13:this.__gl.activeTexture(this.__gl.TEXTURE13);break;case 14:this.__gl.activeTexture(this.__gl.TEXTURE14);break;case 15:this.__gl.activeTexture(this.__gl.TEXTURE15)}this.__activeTextureBackup=e}}bindTexture2D(e,t){this.__activeTexture(e),this.__gl.bindTexture(this.__gl.TEXTURE_2D,t),this.__activeTextures2D[e]=t}bindTextureSampler(e,t){this.__gl.bindSampler(e,t)}bindTextureCube(e,t){this.__activeTexture(e),this.__gl.bindTexture(this.__gl.TEXTURE_CUBE_MAP,t),this.__activeTexturesCube[e]=t}unbindTexture2D(e){this.__activeTexture(e),this.__gl.bindTexture(this.__gl.TEXTURE_2D,null),delete this.__activeTextures2D[e]}unbindTextureCube(e){this.__activeTexture(e),this.__gl.bindTexture(this.__gl.TEXTURE_CUBE_MAP,null),delete this.__activeTexturesCube[e]}unbindTextures(){for(let e=0;e{"use strict";n.d(t,{c:()=>P});var i=n(2343);class o extends i.Jx{constructor({index:e,str:t}){super({index:e,str:t})}}const a=new o({index:1,str:"OES_vertex_array_object"}),r=new o({index:2,str:"OES_texture_float"}),s=new o({index:3,str:"OES_texture_half_float"}),l=new o({index:4,str:"OES_texture_float_linear"}),c=new o({index:5,str:"OES_texture_half_float_linear"}),_=new o({index:6,str:"ANGLE_instanced_arrays"}),h=new o({index:7,str:"EXT_texture_filter_anisotropic"}),u=new o({index:8,str:"OES_element_index_uint"}),d=new o({index:9,str:"EXT_shader_texture_lod"}),m=new o({index:10,str:"OES_standard_derivatives"}),f=new o({index:11,str:"WEBGL_draw_buffers"}),p=new o({index:12,str:"EXT_blend_minmax"}),v=new o({index:13,str:"WEBGL_color_buffer_float"}),A=new o({index:14,str:"WEBGL_compressed_texture_astc"}),y=new o({index:15,str:"WEBGL_compressed_texture_s3tc"}),x=new o({index:16,str:"WEBGL_compressed_texture_pvrtc"}),g=new o({index:17,str:"WEBGL_compressed_texture_atc"}),I=new o({index:18,str:"WEBGL_compressed_texture_etc"}),b=new o({index:19,str:"WEBGL_compressed_texture_etc1"}),E=new o({index:20,str:"EXT_texture_compression_bptc"}),T=new o({index:21,str:"GMAN_webgl_memory"}),S=new o({index:22,str:"EXT_color_buffer_float"}),C=new o({index:23,str:"EXT_color_buffer_half_float"}),w=new o({index:24,str:"OCULUS_multiview"}),R=new o({index:25,str:"OVR_multiview2"}),P=Object.freeze({VertexArrayObject:a,TextureFloat:r,TextureHalfFloat:s,TextureFloatLinear:l,TextureHalfFloatLinear:c,InstancedArrays:_,TextureFilterAnisotropic:h,ElementIndexUint:u,ShaderTextureLod:d,ShaderDerivatives:m,DrawBuffers:f,BlendMinmax:p,ColorBufferFloatWebGL1:v,CompressedTextureAstc:A,CompressedTextureS3tc:y,CompressedTexturePvrtc:x,CompressedTextureAtc:g,CompressedTextureEtc:I,CompressedTextureEtc1:b,CompressedTextureBptc:E,ColorBufferFloatWebGL2:S,ColorBufferHalfFloatWebGL2:C,OculusMultiview:w,OvrMultiview2:R,GMAN_WEBGL_MEMORY:T})},3952:(e,t,n)=>{"use strict";n.d(t,{x:()=>C});var i=n(7987),o=n(128),a=n(5981),r=n(9216),s=n(810),l=n(3999),c=n(5551),_=n(3032),h=n(4587),u=n(4392),d=n(1986),m=n(7192),f=n(8422),p=n(6098),v=n(3449),A=n(290),y=n(3346),x=n(4690),g=n(3648),I=n(3007),b=n(3258),E=n(7461),T=n(580);const S=n(3705);class C extends i.F{constructor(){super(),this.__webglContexts=new Map,this.__resourceCounter=i.F.InvalidCGAPIResourceUid,this.__webglResources=new Map,this.__samplerClampToEdgeLinearUid=i.F.InvalidCGAPIResourceUid,this.__samplerClampToEdgeNearestUid=i.F.InvalidCGAPIResourceUid,this.__samplerRepeatNearestUid=i.F.InvalidCGAPIResourceUid,this.__samplerRepeatLinearUid=i.F.InvalidCGAPIResourceUid,this.__samplerShadowUid=i.F.InvalidCGAPIResourceUid,this.__samplerRepeatTriLinearUid=i.F.InvalidCGAPIResourceUid,this.__samplerRepeatAnisotropyLinearUid=i.F.InvalidCGAPIResourceUid}static getInstance(){return this.__instance||(this.__instance=new C),this.__instance}addWebGLContext(e,t,n,i){const o=new c.d(e,t,i);this.__webglContexts.set("default",o),n&&(this.__glw=o)}generateWebGLContext(e,t,n,i,o,a=!0){const r=e.getContext("webgl2",o);return this.addWebGLContext(r,e,n,i),p.Kf.isSafari()&&(b.D.isUboEnabled=!1),r}get currentWebGLContextWrapper(){return this.__glw}getResourceNumber(){return++this.__resourceCounter}__registerResource(e){const t=this.getResourceNumber();return e._resourceUid=t,this.__webglResources.set(t,e),t}getWebGLResource(e){const t=this.__webglResources.get(e);return null!=t?t:null}createIndexBuffer(e){const t=this.__glw.getRawContext();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");this.__glw.bindVertexArray(null);const n=t.createBuffer(),i=this.__registerResource(n);return t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,n),t.bufferData(t.ELEMENT_ARRAY_BUFFER,e.getTypedArray(),t.STATIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),i}updateIndexBuffer(e,t){const n=this.__glw,i=null==n?void 0:n.getRawContext();if(x.Is.not.exist(i))throw new Error("No WebGLRenderingContext set as Default.");const o=this.__webglResources.get(t);if(x.Is.not.exist(o))throw new Error("Not found IBO.");n.bindVertexArray(null),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,o),i.bufferSubData(i.ELEMENT_ARRAY_BUFFER,0,e.getTypedArray()),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,null)}createVertexBuffer(e){const t=this.__glw.getRawContext();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");this.__glw.bindVertexArray(null);const n=t.createBuffer(),i=this.__registerResource(n);return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,e.getUint8Array(),t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),i}createVertexBufferFromTypedArray(e){const t=this.__glw.getRawContext();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");this.__glw.bindVertexArray(null);const n=t.createBuffer(),i=this.__registerResource(n);return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,e,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),i}updateVertexBuffer(e,t){const n=this.__glw,i=null==n?void 0:n.getRawContext();if(!x.Is.exist(i))throw new Error("No WebGLRenderingContext set as Default.");const o=this.__webglResources.get(t);if(!x.Is.exist(o))throw new Error("Not found VBO.");n.bindVertexArray(null),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferSubData(i.ARRAY_BUFFER,0,e.bufferView.getUint8Array()),i.bindBuffer(i.ARRAY_BUFFER,null)}createVertexArray(){if(null==this.__glw)throw new Error("No WebGLRenderingContext set as Default.");const e=this.__glw.createVertexArray();if(!x.Is.not.exist(e))return this.__registerResource(e)}bindTexture2D(e,t){const n=this.getWebGLResource(t);this.__glw.bindTexture2D(e,n)}bindTextureSampler(e,t){if(-1===t)this.__glw.bindTextureSampler(e,null);else{const n=this.getWebGLResource(t);this.__glw.bindTextureSampler(e,n)}}bindTextureCube(e,t){const n=this.getWebGLResource(t);this.__glw.bindTextureCube(e,n)}createVertexBufferAndIndexBuffer(e){let t;e.hasIndices()&&(t=this.createIndexBuffer(e.indicesAccessor));const n=[];for(let e=0;e{const r=this.createVertexBuffer(t),s=o.T.toAttributeSlotFromJoinedString(e.attributeSemantics[a]);n[s]=!0,i.push(r)})),{vaoHandle:-1,iboHandle:t,vboHandles:i,attributesFlags:n,setComplete:!1}}updateVertexBufferAndIndexBuffer(e,t){t.iboHandle&&this.updateIndexBuffer(e.indicesAccessor,t.iboHandle);const n=e.attributeAccessors;for(let e=0;e{s.bindAttribLocation(h,a[t].getAttributeSlot(),e)})),s.linkProgram(h),l&&!this.__checkShaderProgramLinkStatus(e.materialTypeName,h,t,n))return i.F.InvalidCGAPIResourceUid;h.__SPECTOR_rebuildProgram=this.rebuildProgramBySpector.bind(h);const u=this.__registerResource(h);return s.deleteShader(c),s.deleteShader(_),u}__checkShaderCompileStatus(e,t,n,i){const o=this.__glw.getRawContext();if(x.Is.false(o.getShaderParameter(t,o.COMPILE_STATUS))&&x.Is.false(o.isContextLost())){console.log("MaterialTypeName: "+e);const a=p.Kf.addLineNumberToCode(n);console.log(a);const r=o.getShaderInfoLog(t);return void 0===i?(console.error("An error occurred compiling the shaders:"+r),!1):(i(r),!1)}return!0}__checkShaderProgramLinkStatus(e,t,n,i){const o=this.__glw.getRawContext();if(x.Is.false(o.getProgramParameter(t,o.LINK_STATUS))&&x.Is.false(o.isContextLost())){console.log("MaterialTypeName: "+e),console.log(p.Kf.addLineNumberToCode("Vertex Shader:")),console.log(p.Kf.addLineNumberToCode(n)),console.log(p.Kf.addLineNumberToCode("Fragment Shader:")),console.log(p.Kf.addLineNumberToCode(i));const a=o.getProgramInfoLog(t);return console.error("Unable to initialize the shader program: "+a),!1}return!0}setupUniformLocations(e,t,n){const i=this.__glw,o=i.getRawContext(),a=this.getWebGLResource(e),r=t.length;for(let e=0;e{const n=this.getWebGLResource(e);if(null==n)throw new Error("Nothing Element Array Buffer at index "+t);c.bindBuffer(c.ARRAY_BUFFER,n),c.enableVertexAttribArray(o.T.toAttributeSlotFromJoinedString(a.attributeSemantics[t])),c.vertexAttribPointer(o.T.toAttributeSlotFromJoinedString(a.attributeSemantics[t]),a.attributeCompositionTypes[t].getNumberOfComponents(),a.attributeComponentTypes[t].index,a.attributeAccessors[t].normalized,a.attributeAccessors[t].byteStride,0)})),r!==i.F.InvalidCGAPIResourceUid){const e=this.getWebGLResource(r);if(null==e)throw new Error("Nothing Element Array Buffer at index");c.bindBuffer(c.ARRAY_BUFFER,e),c.enableVertexAttribArray(o.T.Instance.getAttributeSlot()),c.vertexAttribPointer(o.T.Instance.getAttributeSlot(),s.d.Vec4.getNumberOfComponents(),l.r.Float.index,!1,0,0),this.__glw.vertexAttribDivisor(o.T.Instance.getAttributeSlot(),1)}c.bindBuffer(c.ARRAY_BUFFER,null),this.__glw.bindVertexArray(null),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,null)}createTexStorage2D({levels:e,internalFormat:t,width:n,height:i}){const o=this.__glw.getRawContextAsWebGL2(),a=o.createTexture();this.__glw.bindTexture2D(0,a),o.texStorage2D(E.CbE,e,t.index,n,i);const r=this.__registerResource(a);return this.__glw.unbindTexture2D(0),r}createTextureSampler({magFilter:e,minFilter:t,wrapS:n,wrapT:i,wrapR:o,anisotropy:a,isPremultipliedAlpha:r}){const s=this.__glw.getRawContextAsWebGL2(),l=s.createSampler(),c=this.__registerResource(l);return s.samplerParameteri(l,s.TEXTURE_MIN_FILTER,t.index),s.samplerParameteri(l,s.TEXTURE_MAG_FILTER,e.index),s.samplerParameteri(l,s.TEXTURE_WRAP_S,n.index),s.samplerParameteri(l,s.TEXTURE_WRAP_T,i.index),s.samplerParameteri(l,s.TEXTURE_WRAP_R,o.index),a&&this.__glw.webgl2ExtTFA&&s.samplerParameteri(l,this.__glw.webgl2ExtTFA.TEXTURE_MAX_ANISOTROPY_EXT,4),c}createOrGetTextureSamplerClampToEdgeLinear(){if(this.__samplerClampToEdgeLinearUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerClampToEdgeLinearUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE)}return this.__samplerClampToEdgeLinearUid}createOrGetTextureSamplerClampToEdgeNearest(){if(this.__samplerClampToEdgeNearestUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerClampToEdgeNearestUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE)}return this.__samplerClampToEdgeNearestUid}createOrGetTextureSamplerRepeatNearest(){if(this.__samplerRepeatNearestUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerRepeatNearestUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.REPEAT)}return this.__samplerRepeatNearestUid}createOrGetTextureSamplerRepeatLinear(){if(this.__samplerRepeatLinearUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerRepeatLinearUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.REPEAT)}return this.__samplerRepeatLinearUid}createOrGetTextureSamplerRepeatTriLinear(){if(this.__samplerRepeatTriLinearUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerRepeatTriLinearUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.REPEAT)}return this.__samplerRepeatTriLinearUid}createOrGetTextureSamplerShadow(){if(this.__samplerShadowUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerShadowUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.samplerParameteri(t,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.samplerParameteri(t,e.TEXTURE_COMPARE_FUNC,e.LESS)}return this.__samplerShadowUid}createOrGetTextureSamplerRepeatAnisotropyLinear(){if(this.__samplerRepeatAnisotropyLinearUid===i.F.InvalidCGAPIResourceUid){const e=this.__glw.getRawContextAsWebGL2(),t=e.createSampler(),n=this.__registerResource(t);this.__samplerRepeatAnisotropyLinearUid=n,e.samplerParameteri(t,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_LINEAR),e.samplerParameteri(t,e.TEXTURE_MAG_FILTER,e.LINEAR),e.samplerParameteri(t,e.TEXTURE_WRAP_S,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_T,e.REPEAT),e.samplerParameteri(t,e.TEXTURE_WRAP_R,e.REPEAT),e.samplerParameteri(t,this.__glw.webgl2ExtTFA.TEXTURE_MAX_ANISOTROPY_EXT,4)}return this.__samplerRepeatAnisotropyLinearUid}createTextureFromImageBitmapData(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:l}){const c=this.__glw.getRawContextAsWebGL2(),_=c.createTexture(),h=this.__registerResource(_);this.__glw.bindTexture2D(0,_);const u=l?Math.max(Math.log2(i),Math.log2(o)):1;return c.texStorage2D(E.CbE,u,n.index,i,o),c.texSubImage2D(c.TEXTURE_2D,0,0,0,r.index,s.index,e),this.__createTextureInner(c,i,o,l),h}__createTextureInner(e,t,n,i){_.k.isPowerOfTwoTexture(t,n)&&i&&1!==n&&1!==t&&e.generateMipmap(e.TEXTURE_2D),this.__glw.unbindTexture2D(0)}async createTextureFromHTMLImageElement(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:l}){const c=this.__glw.getRawContextAsWebGL2(),_=c.createTexture(),h=this.__registerResource(_);this.__glw.bindTexture2D(0,_);const u=l?Math.max(Math.log2(i),Math.log2(o)):1;return c.texStorage2D(E.CbE,u,n.index,i,o),c.texSubImage2D(c.TEXTURE_2D,0,0,0,r.index,s.index,e),this.__createTextureInner(c,i,o,l),h}createTextureFromTypedArray(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:l}){const c=this.__glw.getRawContextAsWebGL2(),_=c.createTexture(),h=this.__registerResource(_);this.__glw.bindTexture2D(0,_);const u=l?Math.max(Math.log2(i),Math.log2(o)):1;return c.texStorage2D(E.CbE,u,n.index,i,o),c.texSubImage2D(c.TEXTURE_2D,0,0,0,i,o,r.index,s.index,e),this.__createTextureInner(c,i,o,l),h}createCompressedTexture(e,t){const n=this.__glw.getRawContext(),i=n.createTexture(),o=this.__registerResource(i);this.__glw.bindTexture2D(0,i);const a=t.index;for(const t of e)n.compressedTexImage2D(n.TEXTURE_2D,t.level,a,t.width,t.height,0,t.buffer);return this.__glw.unbindTexture2D(0),o}createCompressedTextureFromBasis(e,{border:t,format:n,type:i}){let o,a;const r=this.__glw.getRawContext(),s=r.createTexture(),l=this.__registerResource(s);r.bindTexture(r.TEXTURE_2D,s);const c=r.getExtension("WEBGL_compressed_texture_s3tc");c&&(o=A.l.BC3,a=c.COMPRESSED_RGBA_S3TC_DXT5_EXT);const _=r.getExtension("WEBGL_compressed_texture_etc1");_&&(o=A.l.ETC1,a=_.COMPRESSED_RGB_ETC1_WEBGL);const h=r.getExtension("WEBGL_compressed_texture_atc");h&&(o=A.l.ATC_RGBA,a=h.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL);const u=r.getExtension("WEBGL_compressed_texture_etc");u&&(o=A.l.ETC2,a=u.COMPRESSED_RGBA8_ETC2_EAC);const d=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");d&&(o=A.l.PVRTC1_RGBA,a=d.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG);const m=r.getExtension("WEBGL_compressed_texture_astc");m&&(o=A.l.ASTC,a=m.COMPRESSED_RGBA_ASTC_4x4_KHR);const f=e.getNumLevels(0);for(let n=0;n=2?a.d.NearestMipmapNearest:a.d.Nearest,h=a.d.Nearest):(_=e>=2?a.d.LinearMipmapLinear:a.d.Linear,h=a.d.Linear);const u=new T.Z({wrapS:l,wrapT:c,minFilter:_,magFilter:h});u.create();const m=(e,t,a)=>{if(e.hdriFormat===d.c.HDR_LINEAR){const n=this.__glw.getRawContextAsWebGL2();n.texImage2D(t,a,n.RGB32F,e.width,e.height,0,n.RGB,n.FLOAT,e.dataFloat)}else e instanceof HTMLImageElement||e instanceof HTMLCanvasElement?o.texImage2D(t,a,o.RGBA,o.RGBA,o.UNSIGNED_BYTE,e):o.texImage2D(t,a,o.RGBA,n/2**a,i/2**a,0,o.RGBA,o.UNSIGNED_BYTE,e)};for(let e=0;enew Promise(((t,a)=>{let r=0;const s=[];let c=".jpg";i===d.c.HDR_LINEAR?c=".hdr":i===d.c.RGBE_PNG&&(c=".RGBE.PNG");let _="_right_",h="_left_",u="_top_",m="_bottom_",f="_front_",p="_back_";n&&(_="_posx_",h="_negx_",u="_posy_",m="_negy_",f="_posz_",p="_negz_");const v=[[e+_+l+c,o.TEXTURE_CUBE_MAP_POSITIVE_X],[e+h+l+c,o.TEXTURE_CUBE_MAP_NEGATIVE_X],[e+u+l+c,o.TEXTURE_CUBE_MAP_POSITIVE_Y],[e+m+l+c,o.TEXTURE_CUBE_MAP_NEGATIVE_Y],[e+f+l+c,o.TEXTURE_CUBE_MAP_POSITIVE_Z],[e+p+l+c,o.TEXTURE_CUBE_MAP_NEGATIVE_Z]];for(let e=0;e{r++,s.push(o),6===r&&t(s)},o.onerror=()=>{a(o.uri)},o.src=v[e][0]}}));let c;try{c=await t()}catch(e){try{c=await t()}catch(e){console.error(`failed to load ${e}`)}}const _={};for(const e of c){switch(e.side){case o.TEXTURE_CUBE_MAP_POSITIVE_X:_.posX=e;break;case o.TEXTURE_CUBE_MAP_POSITIVE_Y:_.posY=e;break;case o.TEXTURE_CUBE_MAP_POSITIVE_Z:_.posZ=e;break;case o.TEXTURE_CUBE_MAP_NEGATIVE_X:_.negX=e;break;case o.TEXTURE_CUBE_MAP_NEGATIVE_Y:_.negY=e;break;case o.TEXTURE_CUBE_MAP_NEGATIVE_Z:_.negZ=e}0===l&&(r=e.width,s=e.height)}a.push(_)}return this.createCubeTexture(t,a,r,s)}createCubeTextureFromBasis(e,{magFilter:t=a.d.Linear,minFilter:n=a.d.LinearMipmapLinear,wrapS:i=a.d.Repeat,wrapT:o=a.d.Repeat,border:r=0}){const s=this.__glw.getRawContext();let l,c;const _=s.createTexture(),h=this.__registerResource(_);this.__glw.bindTextureCube(0,_);const u=s.getExtension("WEBGL_compressed_texture_s3tc");u&&(l=A.l.BC3,c=u.COMPRESSED_RGBA_S3TC_DXT5_EXT);const d=s.getExtension("WEBGL_compressed_texture_etc1");d&&(l=A.l.ETC1,c=d.COMPRESSED_RGB_ETC1_WEBGL);const m=s.getExtension("WEBGL_compressed_texture_atc");m&&(l=A.l.ATC_RGBA,c=m.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL);const f=s.getExtension("WEBGL_compressed_texture_etc");f&&(l=A.l.ETC2,c=f.COMPRESSED_RGBA8_ETC2_EAC);const p=s.getExtension("WEBGL_compressed_texture_pvrtc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");p&&(l=A.l.PVRTC1_RGBA,c=p.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG);const v=s.getExtension("WEBGL_compressed_texture_astc");v&&(l=A.l.ASTC,c=v.COMPRESSED_RGBA_ASTC_4x4_KHR);const y=e.getNumImages(),x=e.getNumLevels(0);if(s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_S,i.index),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_WRAP_T,o.index),x>=2)s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,n.index),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,t.index);else{let e=n;n===a.d.LinearMipmapLinear&&(e=a.d.Linear),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MIN_FILTER,e.index),s.texParameteri(s.TEXTURE_CUBE_MAP,s.TEXTURE_MAG_FILTER,t.index)}for(let t=0;t{const l=new Image;e.match(/^data:/)||(l.crossOrigin="Anonymous"),l.onload=()=>{const e=l.width,c=l.height,_=this.createTextureFromHTMLImageElement(l,{level:t,internalFormat:n,width:e,height:c,border:i,format:o,type:a,generateMipmap:r});s(_)},l.src=e}))}updateLevel0TextureAndGenerateMipmap(e,t,{width:n,height:i,format:o,type:a}){const r=this.getWebGLResource(e);this.__glw.bindTexture2D(0,r);const s=this.__glw.getRawContextAsWebGL2();s.texSubImage2D(s.TEXTURE_2D,0,0,0,n,i,o.index,a.index,t),s.generateMipmap(s.TEXTURE_2D),this.__glw.unbindTexture2D(0)}updateTexture(e,t,{level:n,xoffset:i,yoffset:o,width:a,height:r,format:s,type:l}){const c=this.getWebGLResource(e);this.__glw.bindTexture2D(0,c);const _=this.__glw.getRawContextAsWebGL2();_.texSubImage2D(_.TEXTURE_2D,n,0,0,a,r,s.index,l.index,t),this.__glw.unbindTexture2D(0)}deleteFrameBufferObject(e){const t=this.getWebGLResource(e),n=this.__glw.getRawContext();null!=t&&(n.deleteFramebuffer(t),this.__webglResources.delete(e))}deleteRenderBuffer(e){const t=this.__glw.getRawContext(),n=this.getWebGLResource(e);t.deleteRenderbuffer(n),this.__webglResources.delete(e)}deleteTexture(e){const t=this.getWebGLResource(e),n=this.__glw.getRawContext();null!=t&&(n.deleteTexture(t),this.__webglResources.delete(e))}createDummyTexture(e="rgba(255,255,255,1)"){const t=document.createElement("canvas");t.width=1,t.height=1;const n=t.getContext("2d");return n.fillStyle=e,n.fillRect(0,0,1,1),this.createTextureFromImageBitmapData(t,{level:0,internalFormat:a.d.RGBA8,width:1,height:1,border:0,format:r.V.RGBA,type:l.r.UnsignedByte,generateMipmap:!1})}createDummyBlackTexture(){return this.__createDummyTextureInner("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg==")}createDummyWhiteTexture(){return this.__createDummyTextureInner("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5/hPwAIAgL/4d1j8wAAAABJRU5ErkJggg==")}createDummyNormalTexture(){return this.__createDummyTextureInner("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOsr///HwAGgAL+v1RumAAAAABJRU5ErkJggg==")}__createDummyTextureInner(e){const t=v.j.base64ToArrayBuffer(e);return this.createTextureFromTypedArray(new Uint8Array(t),{level:0,internalFormat:a.d.RGBA8,width:1,height:1,border:0,format:r.V.RGBA,type:l.r.UnsignedByte,generateMipmap:!1})}createUniformBuffer(e){const t=this.__glw.getRawContextAsWebGL2();if(null==t)throw new Error("No WebGLRenderingContext set as Default.");const n=t.createBuffer(),i=this.__registerResource(n);return t.bindBuffer(t.UNIFORM_BUFFER,n),t.bufferData(t.UNIFORM_BUFFER,e,t.DYNAMIC_DRAW),t.bindBuffer(t.UNIFORM_BUFFER,null),i}updateUniformBuffer(e,t,n,i){const o=this.__glw.getRawContextAsWebGL2(),a=this.getWebGLResource(e);o.bindBuffer(o.UNIFORM_BUFFER,a),o.bufferSubData(o.UNIFORM_BUFFER,0,t,n,i),o.bindBuffer(o.UNIFORM_BUFFER,null)}bindUniformBlock(e,t,n){const i=this.__glw.getRawContextAsWebGL2();if(null==i)throw new Error("No WebGLRenderingContext set as Default.");const o=this.getWebGLResource(e),a=i.getUniformBlockIndex(o,t);i.uniformBlockBinding(o,a,n)}bindUniformBufferBase(e,t){const n=this.__glw.getRawContextAsWebGL2();if(null==n)throw new Error("No WebGLRenderingContext set as Default.");const i=this.getWebGLResource(t);n.bindBufferBase(n.UNIFORM_BUFFER,e,i)}deleteUniformBuffer(e){const t=this.__glw.getRawContext();null==t&&new Error("No WebGLRenderingContext set as Default.");const n=this.getWebGLResource(e);this.__webglResources.delete(e),t.deleteBuffer(n)}setupUniformBufferDataArea(e){const t=this.__glw.getRawContextAsWebGL2();null==t&&new Error("No WebGLRenderingContext set as Default.");const n=t.createBuffer(),i=this.__registerResource(n),o=this.__glw.getMaxConventionUniformBlocks(),a=this.__glw.getAlignedMaxUniformBlockSize(),r=new Float32Array(a*o/4);x.Is.exist(e)&&r.set(e.subarray(0,r.length)),t.bindBuffer(t.UNIFORM_BUFFER,n),t.bufferData(t.UNIFORM_BUFFER,r,t.DYNAMIC_DRAW,0,0);for(let e=0;ew,Z:()=>R});var i=n(5704),o=n(9974),a=n(4097),r=n(7987),s=n(2251),l=n(3952),c=n(4587),_=n(810),h=n(3999),u=n(5324),d=n(3616),m=n(1813),f=n(2471);let p,v,A,y,x,g,I,b,E,T;function S(e,t,n){(v!==e||A!==t)&&(n.blendEquationSeparate(e,t),v=e,A=t)}function C(e,t,n,i,o){(y!==e||x!==t||g!==n||I!==i)&&(o.blendFuncSeparate(e,t,n,i),y=e,x=t,g=n,I=i)}function w(e,t){if(null==t.mesh)return void a.$.alertNoMeshSet(t);const n=t.mesh.getPrimitiveNumber();for(let i=0;i{"use strict";n.d(t,{X:()=>R});var i=n(3952),o=n(9286),a=n(9216),r=n(3999),s=n(5981),l=n(752),c=n(4097),_=n(1845),h=n(7987),u=n(4587),d=n(810),m=n(9721),f=n(8491),p=n(9974),v=n(2404),A=n(3258),y=n(224),x=n(7348),g=n(4710),I=n(6098),b=n(6406),E=n(2251),T=n(4690),S=n(6683),C=n(903),w=n(4327);class R{constructor(){this.__webglResourceRepository=i.x.getInstance(),this.__dataTextureUid=h.F.InvalidCGAPIResourceUid,this.__dataUBOUid=h.F.InvalidCGAPIResourceUid,this.__lastShader=h.F.InvalidCGAPIResourceUid,this.__lastRenderPassTickCount=-1,this._totalSizeOfGPUShaderDataStorageExceptMorphData=0,this.__latestPrimitivePositionAccessorVersions=[]}static dumpDataTextureBuffer(){this.__isDebugOperationToDataTextureBufferDone=!1}static getVertexShaderMethodDefinitions_dataTexture(){return`\n\n mat4 get_worldMatrix(float instanceId)\n {\n int index = ${m.w.getLocationOffsetOfMemberOfComponent(f.a,"worldMatrix")} + 4 * int(instanceId);\n mat4 matrix = fetchMat4(index);\n\n return matrix;\n }\n\n\n mat3 get_normalMatrix(float instanceId) {\n int index = ${m.w.getLocationOffsetOfMemberOfComponent(f.a,"normalMatrix")} * 4 + 9 * int(instanceId);\n mat3 matrix = fetchMat3No16BytesAligned(index);\n return matrix;\n }\n\n bool get_isVisible(float instanceId) {\n int index = ${m.w.getLocationOffsetOfMemberOfComponent(f.a,"isVisible")} * 4 + int(instanceId);\n float visibility = fetchScalarNo16BytesAligned(index);\n return (visibility > 0.5) ? true : false;\n }\n\n bool get_isBillboard(float instanceId) {\n int index = ${m.w.getLocationOffsetOfMemberOfComponent(f.a,"isBillboard")} * 4 + int(instanceId);\n float isBillboard = fetchScalarNo16BytesAligned(index);\n return (isBillboard > 0.5) ? true : false;\n }\n\n#ifdef RN_IS_VERTEX_SHADER\n #ifdef RN_IS_MORPHING\n vec3 get_position(float vertexId, vec3 basePosition) {\n vec3 position = basePosition;\n int scalar_idx = 3 * int(vertexId);\n for (int i=0; i<${A.D.maxVertexMorphNumberInShader}; i++) {\n\n int basePosIn4bytes = u_dataTextureMorphOffsetPosition[i] * 4 + scalar_idx;\n vec3 addPos = fetchVec3No16BytesAligned(basePosIn4bytes);\n\n position += addPos * u_morphWeights[i];\n if (i == u_morphTargetNumber-1) {\n break;\n }\n }\n\n return position;\n }\n #endif\n#endif\n`}setupShaderForMaterial(e){const t=i.x.getInstance().currentWebGLContextWrapper,n=e._createProgramWebGL(R.getVertexShaderMethodDefinitions_dataTexture(),R.__getShaderProperty,t.isWebGL2);return e._setupBasicUniformsLocations(),e._setUniformLocationsOfMaterialNodes(!1),e._setupAdditionalUniformLocations(b.Z.getPointSpriteShaderSemanticsInfoArray(),!1),R.__globalDataRepository._setUniformLocationsForDataTextureModeOnly(e._shaderProgramUid),n}_reSetupShaderForMaterialBySpector(e,t,n){const i=e._createProgramByUpdatedSources(t,n);return e._setupBasicUniformsLocations(),e._setUniformLocationsOfMaterialNodes(!1),e._setupAdditionalUniformLocations(b.Z.getPointSpriteShaderSemanticsInfoArray(),!1),R.__globalDataRepository._setUniformLocationsForDataTextureModeOnly(e._shaderProgramUid),i}static __getShaderProperty(e,t,n,i,o){var a,s;const l=t.compositionType.getGlslStr(t.componentType);let c;const _=d.d.isTexture(t.compositionType),h=t.semantic.str.replace(".","_");let u="";const m=t.compositionType.getGlslStr(t.componentType);let f="";t.arrayLength&&(f=`[${t.arrayLength}]`),(t.needUniformInDataTextureMode||_)&&(u=` uniform ${m} u_${h}${f};\n`);const p=t.compositionType.getVec4SizeOfProperty(),v=t.compositionType.getNumberOfComponents(),A=R.getOffsetOfPropertyInShader(i,n,e);-1===A&&console.error("Could not get the location offset of the property.");const y=p*(null!==(a=t.arrayLength)&&void 0!==a?a:1);c=`int vec4_idx = ${A} + ${y} * instanceId;\n`,d.d.isArray(t.compositionType)&&(c=`int vec4_idx = ${A} + ${y} * instanceId + ${p} * idxOfArray;\n`,c+=`int scalar_idx = ${4*A} + ${v*(null!==(s=t.arrayLength)&&void 0!==s?s:1)} * instanceId + ${v} * idxOfArray;\n`);let x="";t.componentType===r.r.Int&&t.compositionType!==d.d.Scalar&&(x="i");let g="";if(_||t.needUniformInDataTextureMode){if(!_&&t.needUniformInDataTextureMode){if(!o&&t.arrayLength)return`\n${u}\n`;{let e="";return t.arrayLength&&(e="[idxOfArray]"),`${u}\n${l} get_${h}(highp float _instanceId, const int idxOfArray) {\n return u_${h}${e};\n}\n`}}return u}{g+=`\n${l} get_${h}(highp float _instanceId, const int idxOfArray) {\n int instanceId = int(_instanceId);\n ${c}\n `;let e=`${u}\n${g}`;switch(t.compositionType){case d.d.Vec4:case d.d.Vec4Array:e+=" highp vec4 val = fetchElement(vec4_idx);\n";break;case d.d.Vec3:e+=" vec4 col0 = fetchElement(vec4_idx);\n",e+=` highp ${x}vec3 val = ${x}vec3(col0.xyz);`;break;case d.d.Vec3Array:e+=" vec3 val = fetchVec3No16BytesAligned(scalar_idx);\n";break;case d.d.Vec2:e+=" highp vec4 col0 = fetchElement(vec4_idx);\n",e+=` highp ${x}vec2 val = ${x}vec2(col0.xy);`;break;case d.d.Vec2Array:e+=" highp vec2 val = fetchVec2No16BytesAligned(scalar_idx);\n";break;case d.d.Scalar:e+=" vec4 col0 = fetchElement(vec4_idx);\n",t.componentType===r.r.Int?e+=" int val = int(col0.x);":t.componentType===r.r.Bool?e+=" bool val = bool(col0.x);":e+=" float val = col0.x;";break;case d.d.ScalarArray:e+=" float col0 = fetchScalarNo16BytesAligned(scalar_idx);\n",t.componentType===r.r.Int?e+=" int val = int(col0);":t.componentType===r.r.Bool?e+=" bool val = bool(col0);":e+=" float val = col0;";break;case d.d.Mat4:case d.d.Mat4Array:e+=" mat4 val = fetchMat4(vec4_idx);\n";break;case d.d.Mat3:e+=" mat3 val = fetchMat3(vec4_idx);\n";break;case d.d.Mat3Array:e+=" mat3 val = fetchMat3No16BytesAligned(scalar_idx);\n";break;case d.d.Mat2:e+=" mat2 val = fetchMat2(vec4_idx);\n";break;case d.d.Mat2Array:e+=" mat2 val = fetchMat2No16BytesAligned(scalar_idx);\n";break;case d.d.Mat4x3Array:e+=" mat4x3 val = fetchMat4x3(vec4_idx);\n";break;default:e+=""}return e+="\n return val;\n}\n",e}}static getOffsetOfPropertyInShader(e,t,n){return e?x.$.getInstance().getLocationOffsetOfProperty(t):C.r.getLocationOffsetOfMemberOfMaterial(n,t)}$load(e){const t=e.mesh;if(T.Is.not.exist(t))c.$.alertNoMeshSet(e);else if(R.__currentComponentSIDs=R.__globalDataRepository.getValue(u.f5.CurrentComponentSIDs,0),(0,w.iC)(e)||(0,b.M)(this,e),!this.__isMeshSetup(t)){this.deleteDataTexture(),(0,w.Pj)(t);const e=t.getPrimitiveNumber();for(let n=0;nc&&console.warn("The buffer size exceeds the size of the data texture.");const l=new Float32Array(t.getArrayBuffer(),i,s/4);this.__webglResourceRepository.updateTexture(this.__dataTextureUid,l,{level:0,xoffset:0,yoffset:0,width:o.B.bufferWidthLength,height:n,format:a.V.RGBA,type:r.r.Float}),R.__isDebugOperationToDataTextureBufferDone||(I.Kf.downloadTypedArray("Rhodonite_dataTextureBuffer.bin",l),R.__isDebugOperationToDataTextureBufferDone=!0)}else{const n=e.getBuffer(l.$.GPUVertexData);let _,h=0,u=new ArrayBuffer(0);T.Is.exist(n)&&(h=n.takenSizeInByte,u=n.getArrayBuffer());{const n=e.getBuffer(l.$.GPUVertexData);let a=0;T.Is.exist(n)&&(a=n.takenSizeInByte);let r=new ArrayBuffer(0);T.Is.exist(n)&&(r=n.getArrayBuffer());const s=t.takenSizeInByte-i,h=4*(o.B.bufferWidthLength-s/4/4%o.B.bufferWidthLength)*4,u=I.Kf.concatArrayBuffers2({finalSize:c,srcs:[t.getArrayBuffer(),r],srcsCopySize:[s+h,a],srcsOffset:[i,0]});s+h+a>c&&console.warn("The buffer size exceeds the size of the data texture."),_=new Float32Array(u),A.D.totalSizeOfGPUShaderDataStorageExceptMorphData=t.takenSizeInByte+h}this.__dataTextureUid=this.__webglResourceRepository.createTextureFromTypedArray(_,{level:0,internalFormat:s.d.RGBA32F,width:o.B.bufferWidthLength,height:o.B.bufferHeightLength,border:0,format:a.V.RGBA,type:r.r.Float,generateMipmap:!1})}}deleteDataTexture(){null!=this.__dataTextureUid&&(this.__webglResourceRepository.deleteTexture(this.__dataTextureUid),this.__dataTextureUid=h.F.InvalidCGAPIResourceUid)}common_$prerender(){this.__createAndUpdateDataTexture(),this.__createAndUpdateUBO(),this.__lightComponents=v.C.getComponentsWithType(S.r)}__isUboUse(){return this.__webglResourceRepository.currentWebGLContextWrapper.isWebGL2&&A.D.isUboEnabled}__createAndUpdateUBO(){if(this.__isUboUse()){const e=this.__webglResourceRepository.currentWebGLContextWrapper,t=e.getAlignedMaxUniformBlockSize(),n=e.getMaxConventionUniformBlocks(),i=o.B.getInstance().getBuffer(l.$.GPUInstanceData);if(this.__dataUBOUid===h.F.InvalidCGAPIResourceUid)this.__dataUBOUid=this.__webglResourceRepository.setupUniformBufferDataArea(new Float32Array(i.getArrayBuffer()));else{const e=new Float32Array(i.getArrayBuffer());this.__webglResourceRepository.updateUniformBuffer(this.__dataUBOUid,e,0,t*n/4)}}}attachGPUData(e){}attachGPUDataInner(e,t){}attachShaderProgram(e){const t=e._shaderProgramUid;if(t!==this.__lastShader){const e=this.__webglResourceRepository.currentWebGLContextWrapper.getRawContext(),n=this.__webglResourceRepository.getWebGLResource(t);e.useProgram(n),this.__lastShader=t}}attachVertexData(e,t,n,i){}attachVertexDataInner(e,t,n,i,o){const a=t.vertexHandles,r=i.getRawContext(),s=this.__webglResourceRepository.getWebGLResource(e.getVaoUids(n));if(null!=s)i.bindVertexArray(s);else{this.__webglResourceRepository.setVertexDataToPipeline(a,t,e._variationVBOUid);const n=this.__webglResourceRepository.getWebGLResource(a.iboHandle);r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,n)}}static getInstance(){return this.__instance||(this.__instance=new R),this.__instance}__setCurrentComponentSIDsForEachRenderPass(e,t,n){if(n){const e=E.x.getInstance().getModule("xr").WebXRSystem.getInstance();let n=-1;e.isWebXRMode&&(n=e.isMultiView()?e._getCameraComponentSIDAt(0):e._getCameraComponentSIDAt(t)),R.__currentComponentSIDs._v[g.z.CameraComponentTID]=n}else{let t=e.cameraComponent;null==t&&(t=v.C.getComponent(y.M,y.M.current)),R.__currentComponentSIDs._v[g.z.CameraComponentTID]=t?t.componentSID:-1}}__setCurrentComponentSIDsForEachPrimitive(e,t,n){R.__currentComponentSIDs._v[0]=t.materialSID,e.uniform1fv(n.currentComponentSIDs,R.__currentComponentSIDs._v)}common_$render(e,t,n){"undefined"!=typeof spector&&spector.setMarker("| | DataTexture:common_$render#");const i=this.__webglResourceRepository.currentWebGLContextWrapper,o=i.getRawContext(),a=b.Z.isVrMainPass(t),r=b.Z.getDisplayNumber(a);for(let n=0;n{"use strict";n.d(t,{I:()=>E});var i=n(3952),o=n(1845),a=n(7987),r=n(4587),s=n(2404),l=n(6683),c=n(3258),_=n(9216),h=n(3999),u=n(5981),d=n(9974),m=n(810),f=n(1813),p=n(9286),v=n(5324),A=n(752),y=n(7348),x=n(6098),g=n(6406),I=n(4690),b=n(4327);class E{constructor(){this.__webglResourceRepository=i.x.getInstance(),this.__dataTextureUid=a.F.InvalidCGAPIResourceUid,this.__lastShader=-1,this.__lastRenderPassTickCount=-1,this.__latestPrimitivePositionAccessorVersions=[]}setupShaderForMaterial(e){const t=i.x.getInstance().currentWebGLContextWrapper,n=e._createProgramWebGL(E.__vertexShaderMethodDefinitions_uniform,r.f5.getShaderProperty,t.isWebGL2);e._setupBasicUniformsLocations(),e._setUniformLocationsOfMaterialNodes(!0);const o=E.componentMatrices,a=g.Z.getPointSpriteShaderSemanticsInfoArray();return e._setupAdditionalUniformLocations(o.concat(a),!0),E.__globalDataRepository._setUniformLocationsForUniformModeOnly(e._shaderProgramUid),n}_reSetupShaderForMaterialBySpector(e,t,n){const i=e._createProgramByUpdatedSources(t,n);e._setupBasicUniformsLocations(),e._setUniformLocationsOfMaterialNodes(!0);const o=E.componentMatrices,a=g.Z.getPointSpriteShaderSemanticsInfoArray();return e._setupAdditionalUniformLocations(o.concat(a),!0),E.__globalDataRepository._setUniformLocationsForUniformModeOnly(e._shaderProgramUid),i}$load(e){const t=e.mesh;if(I.Is.exist(t)&&((0,b.iC)(e)||(0,g.M)(this,e),!this.__isMeshSetup(t))){(0,b.Pj)(t);const e=t.getPrimitiveNumber();for(let n=0;np.B.bufferHeightLength&&console.warn("The buffer size exceeds the size of the data texture.");const t=p.B.bufferWidthLength*p.B.bufferHeightLength*4*4,n=x.Kf.concatArrayBuffers2({finalSize:t,srcs:[e.getArrayBuffer()],srcsCopySize:[e.takenSizeInByte],srcsOffset:[0]}),i=new Float32Array(n);this.__dataTextureUid=this.__webglResourceRepository.createTextureFromTypedArray(i,{level:0,internalFormat:u.d.RGBA32F,width:p.B.bufferWidthLength,height:p.B.bufferHeightLength,border:0,format:_.V.RGBA,type:h.r.Float,generateMipmap:!1})}}attachGPUData(e){}attachShaderProgram(e){}attachVertexData(e,t,n,i){}attachVertexDataInner(e,t,n,i,o){const a=t.vertexHandles,r=this.__webglResourceRepository.getWebGLResource(e.getVaoUidsByPrimitiveUid(n)),s=i.getRawContext();if(null!=r)i.bindVertexArray(r);else{this.__webglResourceRepository.setVertexDataToPipeline(a,t,o);const e=this.__webglResourceRepository.getWebGLResource(a.iboHandle);s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e)}}dettachVertexData(e){const t=e.getRawContext();e.bindVertexArray&&e.bindVertexArray(null),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null),t.bindBuffer(t.ARRAY_BUFFER,null)}static getInstance(){return this.__instance||(this.__instance=new E),this.__instance}common_$render(e,t,n){"undefined"!=typeof spector&&spector.setMarker("| | Uniform:$render#");const i=this.__webglResourceRepository.currentWebGLContextWrapper,o=i.getRawContext(),a=g.Z.isVrMainPass(t),r=g.Z.getDisplayNumber(a);for(let s=0;s{"use strict";n.d(t,{Z:()=>r});var i=n(7683),o=n(6042),a=n(9430);const r=function(e){return i.V.isDataTextureApproach(e)?a.X.getInstance():(i.V.isUniformApproach(e),o.I.getInstance())}},8511:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>_});var i=n(3007),o=n(836),a=n(5551),r=n(3952),s=n(6042),l=n(9430);const c=Object.freeze({getRenderingStrategy:i.Z,GLSLShader:o.m,WebGLContextWrapper:a.d,WebGLResourceRepository:r.x,WebGLStrategyUniform:s.I,WebGLStrategyDataTexture:l.X}),_=c;(0,eval)("this").RnWebGL=c},836:(e,t,n)=>{"use strict";n.d(t,{m:()=>l});var i=n(7683),o=n(4587),a=n(128),r=n(3952),s=n(8430);class l{constructor(){this.__webglResourceRepository=r.x.getInstance()}get glsl_fragColor(){const e=this.__webglResourceRepository;return null!=e.currentWebGLContextWrapper&&e.currentWebGLContextWrapper.isWebGL2?"":"gl_FragColor = rt0;\n"}get glsl_textureCube(){return this.__webglResourceRepository.currentWebGLContextWrapper.isWebGL2?"texture":"textureCube"}static get glslMainBegin(){return"\nvoid main() {\n"}static get glslMainEnd(){return"\n}\n "}getGlslVertexShaderProperies(e=""){return e}get prerequisites(){return"uniform float u_materialSID;\n"}get mainPrerequisites(){const e=s.l.currentProcessApproach;return i.V.isDataTextureApproach(e)?"\n":"\n "}static getStringFromShaderAnyDataType(e){return e instanceof o.wy?"u_"+e.str:a.T.isInstanceOfVertexAttributeClass(e)?e.shaderStr:e}}},2647:(e,t,n)=>{"use strict";n.d(t,{I:()=>o});var i=n(836);class o extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__valueInputs=t,this.__valueOutputs=n}get vertexShaderDefinitions(){let e=`void ${this.__functionName}(\nin bool context,\n `;for(let t=0;t{"use strict";n.d(t,{$:()=>o});var i=n(836);class o extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__valueInputs=t,this.__valueOutputs=n}get vertexShaderDefinitions(){let e=`void ${this.__functionName}(`;for(let t=0;t{"use strict";n.d(t,{i:()=>a});var i=n(836),o=n(3999);class a extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__compositionType=t,this.__componentType=n,this.__constantValueStr=""}setConstantValue(e){let t="";this.__componentType.isFloatingPoint()?t=e.glslStrAsFloat:this.__componentType.isInteger()?t=e.glslStrAsInt:this.__componentType===o.r.Bool&&(t=e.x?"true":"false"),this.__constantValueStr=t}get vertexShaderDefinitions(){return`\n void ${this.__functionName}(\n out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n outValue = ${this.__constantValueStr};\n }\n `}get pixelShaderDefinitions(){return`\n void ${this.__functionName}(\n out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n outValue = ${this.__constantValueStr};\n }\n `}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},4212:(e,t,n)=>{"use strict";n.d(t,{x:()=>a});var i=n(836),o=n(3591);class a extends i.m{constructor(){super()}static getInstance(){return this.__instance||(this.__instance=new a),this.__instance}get vertexShaderDefinitions(){return"\n void outPosition(in vec4 inPosition) {\n gl_Position = inPosition;\n }\n "}get vertexShaderBody(){return"\n\n "}get pixelShaderDefinitions(){const e=this.glsl_fragColor;let t="";return""!==e&&(t="vec4"),`\n void outColor(in vec4 inColor) {\n ${t} rt0 = inColor;\n ${e}\n }\n `}getPixelShaderBody(){return""}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}a.materialElement=o.Z.PBRShading},4109:(e,t,n)=>{"use strict";n.d(t,{p:()=>o});var i=n(836);class o extends i.m{constructor(){super()}get vertexShaderDefinitions(){return"\n "}get pixelShaderDefinitions(){return"\n "}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},6796:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var i=n(836);class o extends i.m{constructor(){super(),this.__materialNodeUid=0,this.vertexShaderBody="\n "}set materialNodeUid(e){this.__materialNodeUid=e}getPixelShaderBody(){return"\n "}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},204:(e,t,n)=>{"use strict";n.d(t,{$:()=>o});var i=n(836);class o extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__compositionType=t,this.__componentType=n,this.__variableName="",this.__valueStr=""}setVariableName(e){this.__variableName=e}setDefaultValue(e){this.__valueStr=e.toString()}get vertexShaderDefinitions(){return`\n uniform ${this.__compositionType.getGlslStr(this.__componentType)} u_${this.__variableName}; // initialValue=${this.__valueStr}\n void ${this.__functionName}(out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n#else\n float materialSID = u_materialSID;\n#endif\n\noutValue = get_${this.__variableName}(materialSID, 0);\n }\n `}get pixelShaderDefinitions(){return`\n uniform ${this.__compositionType.getGlslStr(this.__componentType)} u_${this.__variableName}; // initialValue=${this.__valueStr}\n void ${this.__functionName}(out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n#ifdef RN_IS_DATATEXTURE_MODE\n float materialSID = u_currentComponentSIDs[0]; // index 0 data is the materialSID\n#else\n float materialSID = u_materialSID;\n#endif\n\noutValue = get_${this.__variableName}(materialSID, 0);\n }\n `}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},9071:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var i=n(836);class o extends i.m{constructor(e,t,n){super(),this.__functionName=e,this.__compositionType=t,this.__componentType=n,this.__variableName=""}setVariableName(e){this.__variableName=e}get vertexShaderDefinitions(){return`\n out ${this.__compositionType.getGlslStr(this.__componentType)} ${this.__variableName};\n void ${this.__functionName}(\n in ${this.__compositionType.getGlslStr(this.__componentType)} value) {\n ${this.__variableName} = value;\n }\n `}get pixelShaderDefinitions(){return`\n in ${this.__compositionType.getGlslStr(this.__componentType)} ${this.__variableName};\n void ${this.__functionName}(\n out ${this.__compositionType.getGlslStr(this.__componentType)} outValue) {\n outValue = ${this.__variableName};\n }\n `}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}},3667:(e,t,n)=>{"use strict";n.d(t,{N:()=>T}),new Uint8Array([0]);const i=[171,75,84,88,32,50,48,187,13,10,26,10];var o,a,r,s,l,c,_,h,u;(u=o||(o={}))[u.NONE=0]="NONE",u[u.BASISLZ=1]="BASISLZ",u[u.ZSTD=2]="ZSTD",u[u.ZLIB=3]="ZLIB",function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(a||(a={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(r||(r={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(s||(s={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(l||(l={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(c||(c={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(_||(_={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(h||(h={}));class d{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=o.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:a.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:r.UNSPECIFIED,colorPrimaries:s.SRGB,transferFunction:s.SRGB,flags:c.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null}}class m{constructor(e,t,n,i){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=i,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+2**32*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==t&&ie.arrayBuffer())).then((e=>WebAssembly.instantiate(e,g))).then(this._init):WebAssembly.instantiate(Buffer.from(b,"base64"),g).then(this._init),A)}_init(e){y=e.instance,g.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!y)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,i=y.exports.malloc(n);x.set(e,i),t=t||Number(y.exports.ZSTD_findDecompressedSize(i,n));const o=y.exports.malloc(t),a=y.exports.ZSTD_decompress(o,t,i,n),r=x.slice(o,o+a);return y.exports.free(i),y.exports.free(o),r}}const b="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lb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2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQ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4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQ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AAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",E="ETC1_RGB";class T{constructor(){"undefined"==typeof MSC_TRANSCODER&&console.error("Failed to call MSC_TRANSCODER() function. Please check to import msc_basis_transcoder.js."),this.__mscTranscoderPromise=this.__loadMSCTranscoder()}static getInstance(){return this.__instance||(this.__instance=new T),this.__instance}transcode(e){const t=this.__parse(e);if(t.pixelDepth>0)throw new Error("Only 2D textures are currently supported");if(t.layerCount>1)throw new Error("Array textures are not currently supported");if(t.faceCount>1)throw new Error("Cube textures are not currently supported");return t.supercompressionScheme===o.ZSTD?(null==T.__zstdDecoder&&(T.__zstdDecoder=new I),T.__zstdDecoder.init().then((()=>this.__mscTranscoderPromise.then((()=>this.__transcodeData(t)))))):this.__mscTranscoderPromise.then((()=>this.__transcodeData(t)))}__loadMSCTranscoder(){return new Promise((e=>{T.__mscTranscoderModule&&e(),MSC_TRANSCODER().then((t=>{t.initTranscoders(),T.__mscTranscoderModule=t,e()}))}))}__getDeviceDependentParameters(e){const t=p.F.getWebGLResourceRepository().currentWebGLContextWrapper,n=t.webgl2ExtCTAstc||t.webgl1ExtCTAstc,i=t.webgl2ExtCTBptc||t.webgl1ExtCTBptc,o=t.webgl2ExtCTS3tc||t.webgl1ExtCTS3tc,a=t.webgl2ExtCTPvrtc||t.webgl1ExtCTPvrtc,r=t.webgl2ExtCTEtc||t.webgl1ExtCTEtc,s=t.webgl2ExtCTEtc1||t.webgl1ExtCTEtc1;let l,c;return n?(l="ASTC_4x4_RGBA",c=v.b.ASTC_RGBA_4x4):i?(l="BC7_RGBA",c=v.b.BPTC_RGBA):o?e?(l="BC3_RGBA",c=v.b.S3TC_RGBA_DXT5):(l="BC1_RGB",c=v.b.S3TC_RGB_DXT1):a?e?(l="PVRTC1_4_RGBA",c=v.b.PVRTC_RGBA_4BPPV1):(l="PVRTC1_4_RGB",c=v.b.PVRTC_RGB_4BPPV1):r?e?(l="ETC2_RGBA",c=v.b.ETC2_RGBA8_EAC):(l=E,c=v.b.ETC2_RGB8):s?(l=E,c=v.b.ETC1_RGB):(l="RGBA32",c=v.b.RGBA8_EXT),{transcodeTargetStr:l,compressionTextureType:c}}__parse(e){return function(e){const t=new Uint8Array(e.buffer,e.byteOffset,i.length);if(t[0]!==i[0]||t[1]!==i[1]||t[2]!==i[2]||t[3]!==i[3]||t[4]!==i[4]||t[5]!==i[5]||t[6]!==i[6]||t[7]!==i[7]||t[8]!==i[8]||t[9]!==i[9]||t[10]!==i[10]||t[11]!==i[11])throw new Error("Missing KTX 2.0 identifier.");const n=new d,o=17*Uint32Array.BYTES_PER_ELEMENT,a=new m(e,i.length,o,!0);n.vkFormat=a._nextUint32(),n.typeSize=a._nextUint32(),n.pixelWidth=a._nextUint32(),n.pixelHeight=a._nextUint32(),n.pixelDepth=a._nextUint32(),n.layerCount=a._nextUint32(),n.faceCount=a._nextUint32();const r=a._nextUint32();n.supercompressionScheme=a._nextUint32();const s=a._nextUint32(),l=a._nextUint32(),c=a._nextUint32(),_=a._nextUint32(),h=a._nextUint64(),u=a._nextUint64(),p=new m(e,i.length+o,3*r*8,!0);for(let t=0;t>t),l=Math.max(1,i>>t),f=new u.ImageInfo(m,r,l,t);let p=e.levels[t].levelData;const y=e.levels[t].uncompressedByteLength,x=f.numBlocksX*f.numBlocksY*c.bytesPlane[0];e.supercompressionScheme===o.ZSTD&&(p=T.__zstdDecoder.decode(p,y));let g=0;const I=t*Math.max(e.layerCount,1)*a*Math.max(e.pixelDepth,1);for(let n=0;n0?c.rgbSliceByteLength:0,f.alphaByteLength=c.alphaSliceByteLength,a=n.transcodeImage(v,i,f,0,!1)}if(null!=(null==a?void 0:a.transcodedImage)){const e=a.transcodedImage.get_typed_memory_view().slice();a.transcodedImage.delete();const n={level:t,width:r,height:l,buffer:e};A.push(n)}}}return y}__hasAlpha(e,t){return 1===t?e.samples[0].channelID===h.RGBA:2===e.samples.length&&(e.samples[0].channelID===_.AAA||e.samples[1].channelID===_.AAA)}}},3870:(e,t,n)=>{"use strict";n.d(t,{V:()=>i});class i{constructor(e,t,n){this.__canvas=e,this.__context=e.getContext("webgpu"),this.__gpuAdapter=t,this.__gpuDevice=n;const i=navigator.gpu.getPreferredCanvasFormat();this.__context.configure({device:this.__gpuDevice,format:i,alphaMode:"opaque"})}get canvas(){return this.__canvas}get gpuAdapter(){return this.__gpuAdapter}get gpuDevice(){return this.__gpuDevice}get context(){return this.__context}}},1193:(e,t,n)=>{"use strict";n.d(t,{g:()=>_});var i=n(3449),o=n(810),a=n(5981),r=n(128),s=n(4690),l=n(7987),c=n(580);class _ extends l.F{constructor(){super(),this.__webGpuResources=new Map,this.__webGpuRenderPipelineMap=new Map,this.__materialStateVersionMap=new Map,this.__resourceCounter=l.F.InvalidCGAPIResourceUid,this.__bindGroupTextureMap=new Map,this.__bindGroupLayoutTextureMap=new Map,this.__bindGroupSamplerMap=new Map,this.__bindGroupLayoutSamplerMap=new Map}addWebGpuDeviceWrapper(e){this.__webGpuDeviceWrapper=e}static getInstance(){return this.__instance||(this.__instance=new _),this.__instance}getResourceNumber(){return++this.__resourceCounter}__registerResource(e){const t=this.getResourceNumber();return e._resourceUid=t,this.__webGpuResources.set(t,e),t}getCanvasSize(){const e=this.__webGpuDeviceWrapper.canvas;return[e.width,e.height]}createTextureFromImageBitmapData(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:l}){const c=this.__webGpuDeviceWrapper.gpuDevice,_=c.createTexture({size:[i,o,1],format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT});return c.queue.copyExternalImageToTexture({source:e},{texture:_},[i,o]),this.__registerResource(_)}createTextureSampler({magFilter:e,minFilter:t,wrapS:n,wrapT:i,wrapR:o,anisotropy:r,isPremultipliedAlpha:s}){const l=this.__webGpuDeviceWrapper.gpuDevice,c=r?4:1,_={magFilter:e.webgpu,minFilter:t.webgpu,mipmapFilter:t===a.d.LinearMipmapLinear||t===a.d.NearestMipmapLinear?"linear":"nearest",addressModeU:n.webgpu,addressModeV:i.webgpu,addressModeW:o.webgpu,lodMinClamp:0,lodMaxClamp:0,maxAnisotropy:c};"nearest"!==_.magFilter&&"nearest"!==_.minFilter&&"nearest"!==_.mipmapFilter||(_.maxAnisotropy=1);const h=l.createSampler(_);return this.__registerResource(h)}createVertexBuffer(e){const t=this.__webGpuDeviceWrapper.gpuDevice.createBuffer({size:e.byteLength,usage:GPUBufferUsage.VERTEX,mappedAtCreation:!0});return new Uint8Array(t.getMappedRange()).set(e.getUint8Array()),t.unmap(),this.__registerResource(t)}createVertexBufferFromTypedArray(e){const t=this.__webGpuDeviceWrapper.gpuDevice.createBuffer({size:e.byteLength,usage:GPUBufferUsage.VERTEX,mappedAtCreation:!0});return new Uint8Array(t.getMappedRange()).set(new Uint8Array(e.buffer)),t.unmap(),this.__registerResource(t)}createIndexBuffer(e){const t=this.__webGpuDeviceWrapper.gpuDevice,n=i.j.addPaddingBytes(e.byteLength,4),o=t.createBuffer({size:n,usage:GPUBufferUsage.INDEX,mappedAtCreation:!0});return new Uint8Array(o.getMappedRange()).set(e.getUint8Array()),o.unmap(),this.__registerResource(o)}updateVertexBuffer(e,t){const n=this.__webGpuResources.get(t);if(s.Is.not.exist(n))throw new Error("Not found VBO.");n.mapAsync(GPUMapMode.WRITE).then((()=>{new Uint8Array(n.getMappedRange()).set(e.bufferView.getUint8Array()),n.unmap()}))}updateIndexBuffer(e,t){const n=this.__webGpuResources.get(t);if(s.Is.not.exist(n))throw new Error("Not found IBO.");n.mapAsync(GPUMapMode.WRITE).then((()=>{new Uint8Array(n.getMappedRange()).set(e.getUint8Array()),n.unmap()}))}deleteVertexBuffer(e){const t=this.__webGpuResources.get(e);if(s.Is.not.exist(t))throw new Error("Not found VBO.");t.destroy(),this.__webGpuResources.delete(e)}createVertexBufferAndIndexBuffer(e){let t;e.hasIndices()&&(t=this.createIndexBuffer(e.indicesAccessor));const n=[];for(let e=0;e{const a=this.createVertexBuffer(t),s=r.T.toAttributeSlotFromJoinedString(e.attributeSemantics[o]);n[s]=!0,i.push(a)})),{vaoHandle:-1,iboHandle:t,vboHandles:i,attributesFlags:n,setComplete:!1}}updateVertexBufferAndIndexBuffer(e,t){t.iboHandle&&this.updateIndexBuffer(e.indicesAccessor,t.iboHandle);const n=e.attributeAccessors;for(let e=0;e{const n=this.__webGpuResources.get(e);r.setVertexBuffer(t+1,n)})),e.hasIndices()){const t=this.__webGpuResources.get(c.iboHandle),n=e.getIndexBitSize();r.setIndexBuffer(t,n);const i=e.indicesAccessor;r.drawIndexed(i.elementCount,_.meshEntitiesInner.length)}else{const t=e.attributeAccessors[0].elementCount;r.draw(t,_.meshEntitiesInner.length)}r.end()}getOrCreateRenderPipeline(e,t,n,i){if(this.__webGpuRenderPipelineMap.has(e)){if(this.__materialStateVersionMap.get(e)===n.stateVersion)return this.__webGpuRenderPipelineMap.get(e);this.__webGpuRenderPipelineMap.delete(e),this.__materialStateVersionMap.delete(e),this.__bindGroupTextureMap.delete(e),this.__bindGroupLayoutTextureMap.delete(e),this.__bindGroupSamplerMap.delete(e),this.__bindGroupLayoutSamplerMap.delete(e)}this.createBindGroup(e,n);const o=this.__webGpuDeviceWrapper.gpuDevice,a=navigator.gpu.getPreferredCanvasFormat(),s=this.__webGpuResources.get(n._shaderProgramUid);null!=s&&new Error("Shader Modules is not found");const l=[];l.push({stepMode:"instance",attributes:[{shaderLocation:r.T.Instance.getAttributeSlot(),offset:0,format:"float32x4"}],arrayStride:16}),t.attributeAccessors.forEach(((e,n)=>{const i={shaderLocation:r.T.toAttributeSlotFromJoinedString(t.attributeSemantics[n]),offset:0,format:e.componentType.webgpu+e.compositionType.webgpu};l.push({stepMode:"vertex",arrayStride:t.attributeAccessors[n].actualByteStride,attributes:[i]})}));const c=o.createPipelineLayout({bindGroupLayouts:[this.__bindGroupLayoutStorageBuffer,this.__bindGroupLayoutTextureMap.get(e),this.__bindGroupLayoutSamplerMap.get(e)]}),_=t.primitiveMode.getWebGPUTypeStr(),h=o.createRenderPipeline({layout:c,vertex:{module:s.vsModule,entryPoint:"main",constants:{_materialSID:n.materialSID},buffers:l},fragment:{module:s.fsModule,entryPoint:"main",constants:{_materialSID:n.materialSID},targets:[{format:a}]},primitive:{topology:_},depthStencil:{depthWriteEnabled:!0,depthCompare:"less",format:"depth24plus"}});return this.__webGpuRenderPipelineMap.set(e,h),this.__materialStateVersionMap.set(e,n.stateVersion),h}flush(){this.__webGpuDeviceWrapper.gpuDevice.queue.submit([this.__commandEncoder.finish()]),this.__commandEncoder=void 0}createCubeTexture(e,t,n,i){const o=[];(t[0].posX instanceof ImageBitmap||t[0].posX instanceof HTMLCanvasElement)&&(o.push(t[0].posX),o.push(t[0].negX),o.push(t[0].posY),o.push(t[0].negY),o.push(t[0].posZ),o.push(t[0].negZ));const r=this.__webGpuDeviceWrapper.gpuDevice,s=r.createTexture({dimension:"2d",size:[o[0].width,o[0].height,6],format:"rgba8unorm",usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT});for(let e=0;e{const t=e.info;if(o.d.isTexture(t.compositionType)){const t=e.value[0],n=e.value[1],o=e.value[2],l=this.__webGpuResources.get(n._textureResourceUid);i.push({binding:t,resource:l.createView()}),a.push({binding:t,texture:{viewDimension:"2d"},visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT}),o.created||o.create();const c=this.__webGpuResources.get(o._samplerResourceUid);r.push({binding:t,resource:c}),s.push({binding:t,sampler:{type:"filtering"},visibility:GPUShaderStage.VERTEX|GPUShaderStage.FRAGMENT})}}));const l={entries:a},c=n.createBindGroupLayout(l),_=n.createBindGroup({layout:c,entries:i});this.__bindGroupTextureMap.set(e,_),this.__bindGroupLayoutTextureMap.set(e,c);const h={entries:s},u=n.createBindGroupLayout(h),d=n.createBindGroup({layout:u,entries:r});this.__bindGroupSamplerMap.set(e,d),this.__bindGroupLayoutSamplerMap.set(e,u)}}async createTextureFromHTMLImageElement(e,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:c}){e.crossOrigin="Anonymous";let _=l.F.InvalidCGAPIResourceUid;await e.decode();const h=await createImageBitmap(e);return _=this.createTextureFromImageBitmapData(h,{level:t,internalFormat:n,width:i,height:o,border:a,format:r,type:s,generateMipmap:c}),_}recreateSystemDepthTexture(){const e=this.__webGpuDeviceWrapper.gpuDevice,t=this.__webGpuDeviceWrapper.canvas;null!=this.__systemDepthTexture&&this.__systemDepthTexture.destroy(),this.__systemDepthTexture=e.createTexture({size:[t.width,t.height],format:"depth24plus",usage:GPUTextureUsage.RENDER_ATTACHMENT})}resizeCanvas(e,t){const n=this.__webGpuDeviceWrapper.canvas;n.width=e,n.height=t,this.recreateSystemDepthTexture()}}},2161:(e,t,n)=>{"use strict";n.d(t,{p:()=>b});var i=n(4097),o=n(9974),a=n(9286),r=n(752),s=n(1845),l=n(4690),c=n(7987),_=n(4327),h=n(1193),u=n(9721),d=n(8491),m=n(7348),f=n(903),p=n(810),v=n(3999),A=n(4587),y=n(2251),x=n(4710),g=n(2404),I=n(224);class b{constructor(){this.__latestPrimitivePositionAccessorVersions=[],this.__storageBufferUid=c.F.InvalidCGAPIResourceUid}static getInstance(){return this.__instance||(this.__instance=new b),this.__instance}static getVertexShaderMethodDefinitions_storageBuffer(){return`\n\n fn get_worldMatrix(instanceId: u32) -> mat4x4\n {\n let index: u32 = ${u.w.getLocationOffsetOfMemberOfComponent(d.a,"worldMatrix")}u + 4u * instanceId;\n let matrix = fetchMat4(index);\n\n return matrix;\n }\n`}static __getShaderProperty(e,t,n,i){var o,a;const r=t.compositionType.toWGSLType(t.componentType),s=t.semantic.str.replace(".","_");if(p.d.isTexture(t.compositionType))return"";const l=t.compositionType.getVec4SizeOfProperty(),c=t.compositionType.getNumberOfComponents(),_=b.getOffsetOfPropertyInShader(i,n,e);let h;-1===_&&console.error("Could not get the location offset of the property.");const u=l*(null!==(o=t.arrayLength)&&void 0!==o?o:1);h=` let vec4_idx: u32 = ${_}u + ${u}u * instanceId;\n`,p.d.isArray(t.compositionType)&&(h=` let vec4_idx: u32 = ${_}u + ${u} * instanceId + ${l}u * idxOfArray;\n`,h+=` let scalar_idx: u32 = ${4*_} + ${c*(null!==(a=t.arrayLength)&&void 0!==a?a:1)} * instanceId + ${c}u * idxOfArray;\n`);let d=`\nfn get_${s}(instanceId: u32, idxOfArray: u32) -> ${r} {\n${h}\n`;switch(t.compositionType){case p.d.Vec4:case p.d.Vec4Array:d+=" let val = fetchElement(vec4_idx);\n";break;case p.d.Vec3:d+=" let col0 = fetchElement(vec4_idx);\n",d+=` let val = ${r}(col0.xyz);`;break;case p.d.Vec3Array:d+=" let val = fetchVec3No16BytesAligned(scalar_idx);\n";break;case p.d.Vec2:d+=" let col0 = fetchElement(vec4_idx);\n",d+=` let val = ${r}(col0.xy);`;break;case p.d.Vec2Array:d+=" let val = fetchVec2No16BytesAligned(scalar_idx);\n";break;case p.d.Scalar:d+=" let col0 = fetchElement(vec4_idx);\n",t.componentType===v.r.Int?d+=" let val = i32(col0.x);":t.componentType===v.r.Bool?d+=" let val = bool(col0.x);":d+=" let val = col0.x;";break;case p.d.ScalarArray:d+=" let col0 = fetchScalarNo16BytesAligned(scalar_idx);\n",t.componentType===v.r.Int?d+=" let val = i32(col0);":t.componentType===v.r.Bool?d+=" let val = bool(col0);":d+=" let val = col0;";break;case p.d.Mat4:case p.d.Mat4Array:d+=" let val = fetchMat4(vec4_idx);\n";break;case p.d.Mat3:d+=" let val = fetchMat3(vec4_idx);\n";break;case p.d.Mat3Array:d+=" let val = fetchMat3No16BytesAligned(scalar_idx);\n";break;case p.d.Mat2:d+=" let val = fetchMat2(vec4_idx);\n";break;case p.d.Mat2Array:d+=" let val = fetchMat2No16BytesAligned(scalar_idx);\n";break;case p.d.Mat4x3Array:d+=" let val = fetchMat4x3(vec4_idx);\n";break;default:d+=""}return d+="\n return val;\n}\n",d}static getOffsetOfPropertyInShader(e,t,n){return e?m.$.getInstance().getLocationOffsetOfProperty(t):f.r.getLocationOffsetOfMemberOfMaterial(n,t)}$load(e){const t=e.mesh;if(l.Is.exist(t)&&(b.__currentComponentSIDs=b.__globalDataRepository.getValue(A.f5.CurrentComponentSIDs,0),(0,_.iC)(e)||this.__setupShaderProgramForMeshComponent(e),!this.__isMeshSetup(t))){(0,_.Pj)(t);const e=t.getPrimitiveNumber();for(let n=0;n{"use strict";n.r(t),n.d(t,{default:()=>s});var i=n(3870),o=n(1193),a=n(2161);const r=Object.freeze({WebGpuDeviceWrapper:i.V,WebGpuResourceRepository:o.g,WebGpuStrategyBasic:a.p}),s=r;(0,eval)("this").RnWebGpu=r},5514:(e,t,n)=>{"use strict";n.d(t,{RQ:()=>x,sz:()=>T,KA:()=>g,_0:()=>E});const i={Handedness:Object.freeze({NONE:"none",LEFT:"left",RIGHT:"right"}),ComponentState:Object.freeze({DEFAULT:"default",TOUCHED:"touched",PRESSED:"pressed"}),ComponentProperty:Object.freeze({BUTTON:"button",X_AXIS:"xAxis",Y_AXIS:"yAxis",STATE:"state"}),ComponentType:Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON:"button"}),ButtonTouchThreshold:.05,AxisTouchThreshold:.1,VisualResponseProperty:Object.freeze({TRANSFORM:"transform",VISIBILITY:"visibility"})},o={xAxis:0,yAxis:0,button:0,state:i.ComponentState.DEFAULT};class a{constructor(e){this.componentProperty=e.componentProperty,this.states=e.states,this.valueNodeName=e.valueNodeName,this.valueNodeProperty=e.valueNodeProperty,this.valueNodeProperty===i.VisualResponseProperty.TRANSFORM&&(this.minNodeName=e.minNodeName,this.maxNodeName=e.maxNodeName),this.value=0,this.updateFromComponent(o)}updateFromComponent({xAxis:e,yAxis:t,button:n,state:o}){const{normalizedXAxis:a,normalizedYAxis:r}=function(e=0,t=0){let n=e,i=t;if(Math.sqrt(e*e+t*t)>1){const o=Math.atan2(t,e);n=Math.cos(o),i=Math.sin(o)}return{normalizedXAxis:.5*n+.5,normalizedYAxis:.5*i+.5}}(e,t);switch(this.componentProperty){case i.ComponentProperty.X_AXIS:this.value=this.states.includes(o)?a:.5;break;case i.ComponentProperty.Y_AXIS:this.value=this.states.includes(o)?r:.5;break;case i.ComponentProperty.BUTTON:this.value=this.states.includes(o)?n:0;break;case i.ComponentProperty.STATE:this.valueNodeProperty===i.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(o):this.value=this.states.includes(o)?1:0;break;default:throw new Error(`Unexpected visualResponse componentProperty ${this.componentProperty}`)}}}class r{constructor(e,t){if(!(e&&t&&t.visualResponses&&t.gamepadIndices&&0!==Object.keys(t.gamepadIndices).length))throw new Error("Invalid arguments supplied");this.id=e,this.type=t.type,this.rootNodeName=t.rootNodeName,this.touchPointNodeName=t.touchPointNodeName,this.visualResponses={},Object.keys(t.visualResponses).forEach((e=>{const n=new a(t.visualResponses[e]);this.visualResponses[e]=n})),this.gamepadIndices=Object.assign({},t.gamepadIndices),this.values={state:i.ComponentState.DEFAULT,button:void 0!==this.gamepadIndices.button?0:void 0,xAxis:void 0!==this.gamepadIndices.xAxis?0:void 0,yAxis:void 0!==this.gamepadIndices.yAxis?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(e){if(this.values.state=i.ComponentState.DEFAULT,void 0!==this.gamepadIndices.button&&e.buttons.length>this.gamepadIndices.button){const t=e.buttons[this.gamepadIndices.button];this.values.button=t.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,t.pressed||1===this.values.button?this.values.state=i.ComponentState.PRESSED:(t.touched||this.values.button>i.ButtonTouchThreshold)&&(this.values.state=i.ComponentState.TOUCHED)}void 0!==this.gamepadIndices.xAxis&&e.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=e.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===i.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>i.AxisTouchThreshold&&(this.values.state=i.ComponentState.TOUCHED)),void 0!==this.gamepadIndices.yAxis&&e.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=e.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===i.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>i.AxisTouchThreshold&&(this.values.state=i.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach((e=>{e.updateFromComponent(this.values)}))}}class s{constructor(e,t,n){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No profile supplied");this.xrInputSource=e,this.assetUrl=n,this.id=t.profileId,this.layoutDescription=t.layouts[e.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach((e=>{const t=this.layoutDescription.components[e];this.components[e]=new r(e,t)})),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const e=[];return Object.values(this.components).forEach((t=>{e.push(t.data)})),e}updateFromGamepad(){Object.values(this.components).forEach((e=>{e.updateFromGamepad(this.xrInputSource.gamepad)}))}}async function l(e){const t=await fetch(e);if(t.ok)return t.json();throw new Error(t.statusText)}var c=n(2749),_=n(6694),h=n(4690),u=n(9207),d=n(2471),m=n(6098),f=n(9190),p=n(2566);const v=new Map,A=Object.freeze({TRIGGER:"trigger",SQUEEZE:"squeeze",TOUCHPAD:"touchpad",THUMBSTICK:"thumbstick",BUTTON_1:"button_1",BUTTON_2:"button_2",BUTTON_3:"button_3",BUTTON_SPECIAL:"button_special"}),y=new Map;async function x(e,t,n){const{profile:i,assetPath:o}=await async function(e,t,n=null,i=!0){if(!e)throw new Error("No xrInputSource supplied");if(!t)throw new Error("No basePath supplied");const o=await async function(e){if(!e)throw new Error("No basePath supplied");return await l(`${e}/profilesList.json`)}(t);let a;if(e.profiles.some((e=>{const n=o[e];return n&&(a={profileId:e,profilePath:`${t}/${n.path}`,deprecated:!!n.deprecated}),!!a})),!a){if(!n)throw new Error("No matching profile name found");const e=o[n];if(!e)throw new Error(`No matching profile name found and default profile "${n}" missing.`);a={profileId:n,profilePath:`${t}/${e.path}`,deprecated:!!e.deprecated}}const r=await l(a.profilePath);let s;if(i){let t;if(t="any"===e.handedness?r.layouts[Object.keys(r.layouts)[0]]:r.layouts[e.handedness],!t)throw new Error(`No matching handedness, ${e.handedness}, in profile ${a.profileId}`);t.assetPath&&(s=a.profilePath.replace("profile.json",t.assetPath))}return{profile:r,assetPath:s}}(e,t),a=new s(e,i,o);v.set(e,a);const r=await async function(e){const t=await c.Z.importFromUri(e.assetUrl);return function(e,t){Object.values(e.components).forEach((e=>{e.touchPointNodeName&&t.getChildByName(e.touchPointNodeName,!0)}))}(e,t),t}(a);if(r.isOk())return _.e.convertToRhodoniteObject(r.get())}function g(e,t,n){Array.from(v.values()).forEach((t=>{t.updateFromGamepad(),Object.keys(t.components).forEach((i=>{!function(e,t,n,i){const o=y.get(e.rootNodeName);if(h.Is.not.exist(o))return;if(0===I)return void(I=i);const a=1e-6*(i-I);switch(o){case A.TRIGGER:!function(e,t,n,i){let o=0;const a=y.get(e.rootNodeName);("pressed"===e.values.state||"touched"===e.values.state)&&(console.log(a,e.values.button,t),o=(0,m.kS)({value:e.values.button,defaultValue:0})*i),"right"===t&&(o*=-1),b.x-=.1*o,b.y-=.1*o,b.z-=.1*o,b.x=Math.max(b.x,.05),b.y=Math.max(b.y,.05),b.z=Math.max(b.z,.05),b.x=Math.min(b.x,3),b.y=Math.min(b.y,3),b.z=Math.min(b.z,3),n.viewerScale.copyComponents(b)}(e,t,n,a);break;case A.THUMBSTICK:!function(e,t,n,i){const o=y.get(e.rootNodeName);let a=0,r=0;"pressed"===e.values.state?(console.log(o,e.values.button,e.values.state,t),a=(0,m.kS)({value:e.values.xAxis,defaultValue:0})*i,r=(0,m.kS)({value:e.values.yAxis,defaultValue:0})*i):"touched"===e.values.state&&(a=(0,m.kS)({value:e.values.xAxis,defaultValue:0})*i,r=(0,m.kS)({value:e.values.yAxis,defaultValue:0})*i),a=Math.min(a,1),r=Math.min(r,1);const s=f.d6.zero();"right"===t?(n.viewerAzimuthAngle.x-=.15*a,s.y-=.1*r*n.viewerScale.x):(s.x+=.25*a*n.viewerScale.x,s.z+=.25*r*n.viewerScale.x);p.x.fromCopyQuaternion(n.viewerOrientation).multiply(p.x.rotateY(n.viewerAzimuthAngle.x)).multiplyVectorTo(s,s),n.viewerTranslate.add(s)}(e,t,n,a);break;case A.SQUEEZE:!function(e,t,n,i){const o=y.get(e.rootNodeName);("pressed"===e.values.state||"touched"===e.values.state)&&console.log(o,e.values.button,t)}(e,t);break;case A.BUTTON_1:case A.BUTTON_2:case A.BUTTON_3:case A.BUTTON_SPECIAL:!function(e,t,n,i){const o=y.get(e.rootNodeName);("pressed"===e.values.state||"touched"===e.values.state)&&console.log(o,e.values.button,e.values.state,t)}(e,t);break;case A.TOUCHPAD:"pressed"===(r=e).values.state||"touched"===r.values.state&&0!==r.values.yAxis&&r.values.yAxis}var r}(t.components[i],t.xrInputSource.handedness,n,e)}))}))}y.set("a_button",A.BUTTON_1),y.set("b_button",A.BUTTON_2),y.set("x_button",A.BUTTON_1),y.set("y_button",A.BUTTON_2),y.set("thumbrest",A.BUTTON_3),y.set("menu",A.BUTTON_SPECIAL),y.set("xr_standard_trigger",A.TRIGGER),y.set("xr_standard_squeeze",A.SQUEEZE),y.set("xr_standard_thumbstick",A.THUMBSTICK),y.set("xr_standard_touchpad",A.TOUCHPAD),y.set("trigger",A.TRIGGER),y.set("squeeze",A.SQUEEZE),y.set("thumbstick",A.THUMBSTICK),y.set("touchpad",A.TOUCHPAD);let I=0;const b=f.d6.one();function E(e,t){const n=e.getTagValue("rnEntitiesByNames");Object.values(t.components).forEach((e=>{for(const t in e.visualResponses){const i=e.visualResponses[t],o=n.get(i.valueNodeName);if(h.Is.not.exist(o))console.warn("The entity of the controller doesn't exist");else if("visibility"===i.valueNodeProperty)o.getSceneGraph().isVisible=!!i.value;else if("transform"===i.valueNodeProperty){const e=n.get(i.minNodeName),t=n.get(i.maxNodeName);if(h.Is.not.exist(e)||h.Is.not.exist(t)){console.warn("The min/max Node of the component of the controller doesn't exist");continue}const a=e.getTransform(),r=t.getTransform();o.getTransform().quaternion=u._.qlerp(a.localRotationInner,r.localRotationInner,i.value),o.getTransform().localPosition=d.P.lerp(a.localPositionInner,r.localPositionInner,i.value)}}}))}function T(e){return v.get(e)}},2102:(e,t,n)=>{"use strict";n.d(t,{X:()=>v});var i=n(7987),o=n(2471),a=n(3496),r=n(7192),s=n(3648),l=n(2251),c=n(5514),_=n(4690),h=n(9190),u=n(963),d=n(4267),m=n(7973),f=n(8583);const p=o.P.fromCopyArray([0,1.1,0]);class v{constructor(){this.__isWebXRMode=!1,this.__spaceType="local",this.__requestedToEnterWebXR=!1,this.__isReadyForWebXR=!1,this.__defaultPositionInLocalSpaceMode=p,this.__canvasWidthForVR=0,this.__canvasHeightForVR=0,this.__controllerEntities=[],this.__xrInputSources=[],this.__viewerTranslate=h.d6.zero(),this.__viewerAzimuthAngle=d.DU.zero(),this.__viewerOrientation=u.y.identity(),this.__viewerScale=h.d6.one(),this.__multiviewFramebufferHandle=-1,this.__multiviewColorTextureHandle=-1,this.__viewerEntity=m._.createGroupEntity(),this.__viewerEntity.tryToSetUniqueName("WebXR Viewer",!0),this.__viewerEntity.tryToSetTag({tag:"type",value:"background-assets"}),this.__leftCameraEntity=m._.createCameraEntity(),this.__leftCameraEntity.tryToSetUniqueName("WebXR Left Camera",!0),this.__leftCameraEntity.tryToSetTag({tag:"type",value:"background-assets"}),this.__leftCameraEntity.getCamera()._xrLeft=!0,this.__rightCameraEntity=m._.createCameraEntity(),this.__rightCameraEntity.tryToSetUniqueName("WebXR Right Camera",!0),this.__rightCameraEntity.tryToSetTag({tag:"type",value:"background-assets"}),this.__rightCameraEntity.getCamera()._xrRight=!0,this.__viewerEntity.getSceneGraph().addChild(this.__leftCameraEntity.getSceneGraph()),this.__viewerEntity.getSceneGraph().addChild(this.__rightCameraEntity.getSceneGraph())}async readyForWebXR(e,t){this.__basePath=t,await l.x.getInstance().loadModule("xr");const n=i.F.getWebGLResourceRepository().currentWebGLContextWrapper;if(null==n)return console.error("WebGL Context is not ready yet."),[];if(this.__glw=n,!await navigator.xr.isSessionSupported("immersive-vr"))throw new Error("WebXR is not supported in this environment.");if(e)e.style.display="block";else{const e=document.createElement("p"),t=document.createElement("a");t.setAttribute("id","enter-vr");const i=document.createTextNode("Enter VR");t.appendChild(i),e.appendChild(t);const o=n.canvas;o.parentNode.insertBefore(e,o),window.addEventListener("click",this.enterWebXR.bind(this))}return this.__isReadyForWebXR=!0,[]}async enterWebXR({initialUserPosition:e,callbackOnXrSessionStart:t=(()=>{}),callbackOnXrSessionEnd:n=(()=>{}),profilePriorities:o=[]}){const a=i.F.getWebGLResourceRepository().currentWebGLContextWrapper;if(null!=a&&this.__isReadyForWebXR){let i;const r=await navigator.xr.requestSession("immersive-vr");this.__xrSession=r,r.addEventListener("end",(()=>{a.__gl.bindFramebuffer(a.__gl.FRAMEBUFFER,null),this.__xrSession=void 0,this.__webglLayer=void 0,this.__xrViewerPose=void 0,this.__xrReferenceSpace=void 0,this.__spaceType="local",this.__isReadyForWebXR=!1,this.__requestedToEnterWebXR=!1,this.__setWebXRMode(!1),f.rFg._makeShaderInvalidateToAllMaterials(),this.__defaultPositionInLocalSpaceMode=p,console.log("XRSession ends."),s.x.stopRenderLoop(),s.x.restartRenderLoop(),n()}));const l=new Promise((e=>{r.addEventListener("inputsourceschange",(t=>{this.__onInputSourcesChange(t,e,o)}))}));return i=await r.requestReferenceSpace("local"),this.__spaceType="local",this.__defaultPositionInLocalSpaceMode=null!=e?e:p,this.__xrReferenceSpace=i,s.x.stopRenderLoop(),await this.__setupWebGLLayer(r,t),this.__requestedToEnterWebXR=!0,s.x.restartRenderLoop(),console.warn("End of enterWebXR."),l}console.error("WebGL context or WebXRSession is not ready yet.")}async exitWebXR(){null!=this.__xrSession&&await this.__xrSession.end()}getCanvasWidthForVr(){return this.__canvasWidthForVR}getCanvasHeightForVr(){return this.__canvasHeightForVR}getControllerEntities(){return this.__controllerEntities}get leftViewMatrix(){return this.__leftCameraEntity.getCamera().viewMatrix}get rightViewMatrix(){return this.__rightCameraEntity.getCamera().viewMatrix}get leftProjectionMatrix(){var e;const t=null===(e=this.__xrViewerPose)||void 0===e?void 0:e.views[0];return a.e.fromCopyFloat32ArrayColumnMajor(_.Is.exist(t)?t.projectionMatrix:a.e.identity()._v)}get rightProjectionMatrix(){var e;const t=null===(e=this.__xrViewerPose)||void 0===e?void 0:e.views[1];return a.e.fromCopyFloat32ArrayColumnMajor(_.Is.exist(t)?t.projectionMatrix:a.e.identity()._v)}get framebuffer(){var e,t;return this.__multiviewFramebufferHandle>0?i.F.getWebGLResourceRepository().getWebGLResource(this.__multiviewFramebufferHandle):null===(t=null===(e=this.__xrSession)||void 0===e?void 0:e.renderState.baseLayer)||void 0===t?void 0:t.framebuffer}isMultiView(){return this.__multiviewFramebufferHandle>0}get requestedToEnterWebXR(){return this.__requestedToEnterWebXR}get xrSession(){return this.__xrSession}get requestedToEnterWebVR(){return this.__requestedToEnterWebXR}get isWebXRMode(){return this.__isWebXRMode}__setWebXRMode(e){this.__isWebXRMode=e,this.__glw._isWebXRMode=e}get isReadyForWebXR(){return this.__isReadyForWebXR}static getInstance(){return this.__instance||(this.__instance=new v),this.__instance}_getViewMatrixAt(e){return 0===e?this.leftViewMatrix:this.rightViewMatrix}_getProjectMatrixAt(e){return 0===e?this.leftProjectionMatrix:this.rightProjectionMatrix}_getViewportAt(e){return 0===e?this._getLeftViewport():this._getRightViewport()}_getLeftViewport(){return r.Lt.fromCopyArray([0,0,this.__canvasWidthForVR/2,this.__canvasHeightForVR])}_getRightViewport(){return this.__multiviewFramebufferHandle>0?r.Lt.fromCopyArray([0,0,this.__canvasWidthForVR/2,this.__canvasHeightForVR]):r.Lt.fromCopyArray([this.__canvasWidthForVR/2,0,this.__canvasWidthForVR/2,this.__canvasHeightForVR])}_setValuesToGlobalDataRepository(){this.__leftCameraEntity.getCamera().projectionMatrix=this.leftProjectionMatrix,this.__rightCameraEntity.getCamera().projectionMatrix=this.rightProjectionMatrix,this.__leftCameraEntity.getCamera().setValuesToGlobalDataRepository(),this.__rightCameraEntity.getCamera().setValuesToGlobalDataRepository()}_getCameraWorldPositionAt(e){var t;const n=null===(t=this.__xrViewerPose)||void 0===t?void 0:t.views[e];if(_.Is.exist(n)){const e=n.transform.position,t=this.__defaultPositionInLocalSpaceMode,i=this.__viewerTranslate,a=o.P.add(o.P.fromCopyArray([e.x,e.y,e.z]),t);return o.P.fromCopyArray([(a.x+i.x)*this.__viewerScale.x,(a.y+i.y)*this.__viewerScale.y,(a.z+i.z)*this.__viewerScale.z])}return this.__defaultPositionInLocalSpaceMode}_getCameraComponentSIDAt(e){return 0===e?this.__leftCameraEntity.getCamera().componentSID:this.__rightCameraEntity.getCamera().componentSID}_preRender(e,t){this.isWebXRMode&&this.__requestedToEnterWebXR&&null!=t&&(this.__updateView(t),this.__updateInputSources(t),(0,c.KA)(e,t,{viewerTranslate:this.__viewerTranslate,viewerScale:this.__viewerScale,viewerOrientation:this.__viewerOrientation,viewerAzimuthAngle:this.__viewerAzimuthAngle}))}_postRender(){if(this.__isWebXRMode){const e=this.__glw.getRawContextAsWebGL2();if(this.__multiviewFramebufferHandle>0){const t=i.F.getWebGLResourceRepository();e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[e.DEPTH_STENCIL_ATTACHMENT]),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this.__xrSession.renderState.baseLayer.framebuffer);const n=t.getWebGLResource(this.__multiviewColorTextureHandle);this.__webglStereoUtil.blit(n,0,0,1,1,this.__canvasWidthForVR,this.__canvasHeightForVR)}}this.requestedToEnterWebVR}async __onInputSourcesChange(e,t,n){this.__xrInputSources.length=0;for(const t of e.added){this.__xrInputSources.push(t);const e=await(0,c.RQ)(t,this.__basePath,n);_.Is.exist(e)&&(this.__controllerEntities.push(e),this.__viewerEntity.getSceneGraph().addChild(e.getSceneGraph()))}t(this.__controllerEntities)}__setCameraInfoFromXRViews(e){if(_.Is.not.exist(e))return void console.warn("xrViewerPose not exist");const t=e.views[0],n=e.views[1];if(_.Is.not.exist(t)||_.Is.not.exist(n))return;const i=e.transform.orientation;this.__viewerOrientation.x=i.x,this.__viewerOrientation.y=i.y,this.__viewerOrientation.z=i.z,this.__viewerOrientation.w=i.w;const r=a.e.fromCopyFloat32ArrayColumnMajor(null==t?void 0:t.transform.matrix),s=a.e.fromCopyFloat32ArrayColumnMajor(null==n?void 0:n.transform.matrix),l=this.__viewerScale.x,c=t.transform.position,u=h.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate),d=h.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate),m=o.P.fromCopyArray([c.x,c.y,c.z]),f=o.P.fromCopyArray([c.x,c.y,c.z]),p=h.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate).add(m),v=h.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate).add(f),A=(u.x+d.x)/2,y=(u.z+d.z)/2,x=(p.x+v.x)/2,g=(p.z+v.z)/2,I=this.__viewerEntity.getTransform();I.localPosition=o.P.fromCopyArray([A,0,y]),I.localScale=o.P.fromCopyArray([l,l,l]),I.localEulerAngles=o.P.fromCopyArray([0,this.__viewerAzimuthAngle.x,0]),r.translateY=p.y,r.translateX=p.x-x,r.translateZ=p.z-g,r.translateY+=m.y,r.translateX+=m.x,r.translateZ+=m.z,s.translateY=v.y,s.translateX=v.x-x,s.translateZ=v.z-g,s.translateY+=f.y,s.translateX+=f.x,s.translateZ+=f.z,this.__leftCameraEntity.getTransform().localMatrix=r,this.__rightCameraEntity.getTransform().localMatrix=s}async __setupWebGLLayer(e,t){var n;const o=null===(n=this.__glw)||void 0===n?void 0:n.getRawContextAsWebGL2();if(null!=o){await o.makeXRCompatible(),this.__webglLayer=new window.XRWebGLLayer(e,o);const n=this.__webglLayer;e.updateRenderState({baseLayer:n,depthNear:.01,depthFar:1e3});const a=i.F.getWebGLResourceRepository();this.__canvasWidthForVR=n.framebufferWidth,this.__canvasHeightForVR=n.framebufferHeight,console.log(this.__canvasWidthForVR),console.log(this.__canvasHeightForVR),this.__multiviewFramebufferHandle,f.rFg._makeShaderInvalidateToAllMaterials(),a.resizeCanvas(this.__canvasWidthForVR,this.__canvasHeightForVR),this.__setWebXRMode(!0),t()}else console.error("WebGL context is not ready for WebXR.")}__updateView(e){this.__xrViewerPose=e.getViewerPose(this.__xrReferenceSpace),this.__setCameraInfoFromXRViews(this.__xrViewerPose)}__updateInputSources(e){this.__xrInputSources.forEach(((t,n)=>{if(_.Is.exist(t.gripSpace)){const i=e.getPose(t.gripSpace,this.__xrReferenceSpace);if(_.Is.exist(i)){const e=this.__controllerEntities[n];if(_.Is.exist(e)){const n=a.e.fromCopyFloat32ArrayColumnMajor(i.transform.matrix),o=a.e.fromCopyMatrix44(n);o.translateY+=this.__defaultPositionInLocalSpaceMode.y,o.translateY+=this.__viewerTranslate.y,e.getTransform().localMatrix=o;const r=(0,c.sz)(t);_.Is.exist(r)?(0,c._0)(e,r):console.warn("motionController not found")}}}}))}}},9131:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>A});var i=n(2102),o=n(7973),a=n(3496),r=n(963),s=n(4267),l=n(9190),c=n(2471),_=n(4690),h=n(6312),u=n(7987),d=n(2251),m=n(3648);const f=c.P.fromCopyArray([0,1.1,0]);class p{constructor(){this.__oGlw=new h.Hq,this.__isReadyForWebAR=!1,this.__oArSession=new h.Hq,this.__oWebglLayer=new h.Hq,this.__spaceType="local",this.__isWebARMode=!1,this.__requestedToEnterWebAR=!1,this.__oArViewerPose=new h.Hq,this.__oArReferenceSpace=new h.Hq,this.__defaultPositionInLocalSpaceMode=f,this.__canvasWidthForAR=0,this.__canvasHeightForAR=0,this._cameraEntity=o._.createCameraEntity(),this.__viewerTranslate=l.d6.zero(),this.__viewerAzimuthAngle=s.DU.zero(),this.__viewerOrientation=r.y.identity(),this.__viewerScale=l.d6.one(),this._cameraEntity.tryToSetUniqueName("WebAR Viewer",!0),this._cameraEntity.tryToSetTag({tag:"type",value:"background-assets"})}static getInstance(){return this.__instance||(this.__instance=new p),this.__instance}async readyForWebAR(e){await d.x.getInstance().loadModule("xr");const t=u.F.getWebGLResourceRepository().currentWebGLContextWrapper;if(null==t)throw new Error("WebGL Context is not ready yet.");if(this.__oGlw=new h.bD(t),!await navigator.xr.isSessionSupported("immersive-ar"))throw new Error("WebAR is not supported in this environment.");if(console.log("WebAR is supported."),e)e.style.display="block";else{const e=document.createElement("p"),n=document.createElement("a");n.setAttribute("id","enter-ar");const i=document.createTextNode("Enter AR");n.appendChild(i),e.appendChild(n);const o=t.canvas;o.parentNode.insertBefore(e,o),window.addEventListener("click",this.enterWebAR.bind(this))}return this.__isReadyForWebAR=!0,[]}async enterWebAR({initialUserPosition:e,callbackOnXrSessionStart:t=(()=>{}),callbackOnXrSessionEnd:n=(()=>{})}){const i=u.F.getWebGLResourceRepository().currentWebGLContextWrapper;if(null!=i&&this.__isReadyForWebAR){const o=await navigator.xr.requestSession("immersive-vr");this.__oArSession=new h.bD(o),o.addEventListener("end",(()=>{i.__gl.bindFramebuffer(i.__gl.FRAMEBUFFER,null),this.__oArSession=new h.Hq,this.__oWebglLayer=new h.Hq,this.__oArViewerPose=new h.Hq,this.__oArReferenceSpace=new h.Hq,this.__spaceType="local",this.__isReadyForWebAR=!1,this.__requestedToEnterWebAR=!1,this.__isWebARMode=!1,this.__defaultPositionInLocalSpaceMode=f,console.log("XRSession ends."),m.x.stopRenderLoop(),m.x.restartRenderLoop(),n()}));const a=await o.requestReferenceSpace("local");return this.__spaceType="local",this.__defaultPositionInLocalSpaceMode=null!=e?e:f,this.__oArReferenceSpace=new h.bD(a),m.x.stopRenderLoop(),await this.__setupWebGLLayer(o,t),this.__requestedToEnterWebAR=!0,m.x.restartRenderLoop(),void console.warn("End of enterWebXR.")}console.error("WebGL context or WebXRSession is not ready yet.")}async __setupWebGLLayer(e,t){const n=this.__oGlw.unwrapForce().getRawContext();if(null!=n){await n.makeXRCompatible(),this.__oWebglLayer=new h.bD(window.XRWebGLLayer(e,n));const i=this.__oWebglLayer.unwrapForce();e.updateRenderState({baseLayer:i,depthNear:.1,depthFar:1e4});const o=u.F.getWebGLResourceRepository();this.__canvasWidthForAR=i.framebufferWidth,this.__canvasHeightForAR=i.framebufferHeight,console.log(this.__canvasWidthForAR),console.log(this.__canvasHeightForAR),o.resizeCanvas(this.__canvasWidthForAR,this.__canvasHeightForAR),this.__isWebARMode=!0,t()}else console.error("WebGL context is not ready for WebXR.")}async exitWebAR(){this.__oArSession.has()&&await this.__oArSession.get().end()}getCanvasWidthForVr(){return this.__canvasWidthForAR}getCanvasHeightForVr(){return this.__canvasHeightForAR}get viewMatrix(){return this._cameraEntity.getCamera().viewMatrix}__updateView(e){this.__oArViewerPose=new h.bD(e.getViewerPose(this.__oArReferenceSpace.unwrapForce())),this.__setCameraInfoFromXRViews(this.__oArViewerPose.unwrapForce())}__setCameraInfoFromXRViews(e){if(_.Is.not.exist(e))return void console.warn("xrViewerPose not exist");const t=e.views[0];if(_.Is.not.exist(t))return;const n=e.transform.orientation;this.__viewerOrientation.x=n.x,this.__viewerOrientation.y=n.y,this.__viewerOrientation.z=n.z,this.__viewerOrientation.w=n.w;const i=a.e.fromCopyFloat32ArrayColumnMajor(null==t?void 0:t.transform.matrix),o=this.__viewerScale.x,r=t.transform.position,s=l.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate),h=c.P.fromCopyArray([r.x,r.y,r.z]),u=l.d6.add(this.__defaultPositionInLocalSpaceMode,this.__viewerTranslate).add(h),d=s.x,m=s.z,f=u.x,p=u.z,v=this._cameraEntity.getTransform();v.localPosition=c.P.fromCopyArray([d,0,m]),v.localScale=c.P.fromCopyArray([o,o,o]),v.localEulerAngles=c.P.fromCopyArray([0,this.__viewerAzimuthAngle.x,0]),i.translateY=u.y,i.translateX=u.x-f,i.translateZ=u.z-p,i.translateY+=h.y,i.translateX+=h.x,i.translateZ+=h.z,this._cameraEntity.getTransform().localMatrix=i}get projectionMatrix(){const e=this.__oArViewerPose.unwrapForce().views[0];return a.e.fromCopyFloat32ArrayColumnMajor(_.Is.exist(e)?e.projectionMatrix:a.e.identity()._v)}_preRender(e,t){this.isWebARMode&&this.__requestedToEnterWebAR&&null!=t&&this.__updateView(t)}_postRender(){this.isWebARMode&&this.__oGlw.unwrapForce().getRawContext(),this.requestedToEnterWebAR}get isWebARMode(){return this.__isWebARMode}get isReadyForWebAR(){return this.__isReadyForWebAR}get requestedToEnterWebAR(){return this.__requestedToEnterWebAR}get arSession(){return this.__oArSession.unwrapOrUndefined()}get framebuffer(){var e,t;return null===(t=null===(e=this.__oArSession.unwrapOrUndefined())||void 0===e?void 0:e.renderState.baseLayer)||void 0===t?void 0:t.framebuffer}}const v=Object.freeze({WebXRSystem:i.X,WebARSystem:p}),A=v;(0,eval)("this").RnXR=v},5337:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});const i={version:"48c8e47-dirty",branch:"feat/webgpu"}},6893:function(){(function(){"use strict";function l(e){throw e}var r=void 0,t,aa=this;function v(e,t){var n,i=e.split("."),o=aa;!(i[0]in o)&&o.execScript&&o.execScript("var "+i[0]);for(;i.length&&(n=i.shift());)i.length||t===r?o=o[n]?o[n]:o[n]={}:o[n]=t}var y="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array&&"undefined"!=typeof DataView,z;for(new(y?Uint8Array:Array)(256),z=0;256>z;++z)for(var B=z,ba=7,B=B>>>1;B;B>>>=1)--ba;var ca=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],C=y?new Uint32Array(ca):ca,a;if(aa.Uint8Array!==r)try{eval("String.fromCharCode.apply(null, new Uint8Array([0]));")}catch(e){String.fromCharCode.apply=(a=String.fromCharCode.apply,function(e,t){return a.call(String.fromCharCode,e,Array.prototype.slice.call(t))})}function D(e){var t,n,i,o,a,r,s,l,c,_,h=e.length,u=0,d=Number.POSITIVE_INFINITY;for(l=0;lu&&(u=e[l]),e[l]>=1;for(_=i<<16|l,c=r;cG;G++)switch(!0){case 143>=G:F.push([G+48,8]);break;case 255>=G:F.push([G-144+400,9]);break;case 279>=G:F.push([G-256+0,7]);break;case 287>=G:F.push([G-280+192,8]);break;default:l("invalid literal: "+G)}var fa=function(){function e(e){switch(!0){case 3===e:return[257,e-3,0];case 4===e:return[258,e-4,0];case 5===e:return[259,e-5,0];case 6===e:return[260,e-6,0];case 7===e:return[261,e-7,0];case 8===e:return[262,e-8,0];case 9===e:return[263,e-9,0];case 10===e:return[264,e-10,0];case 12>=e:return[265,e-11,1];case 14>=e:return[266,e-13,1];case 16>=e:return[267,e-15,1];case 18>=e:return[268,e-17,1];case 22>=e:return[269,e-19,2];case 26>=e:return[270,e-23,2];case 30>=e:return[271,e-27,2];case 34>=e:return[272,e-31,2];case 42>=e:return[273,e-35,3];case 50>=e:return[274,e-43,3];case 58>=e:return[275,e-51,3];case 66>=e:return[276,e-59,3];case 82>=e:return[277,e-67,4];case 98>=e:return[278,e-83,4];case 114>=e:return[279,e-99,4];case 130>=e:return[280,e-115,4];case 162>=e:return[281,e-131,5];case 194>=e:return[282,e-163,5];case 226>=e:return[283,e-195,5];case 257>=e:return[284,e-227,5];case 258===e:return[285,e-258,0];default:l("invalid length: "+e)}}var t,n,i=[];for(t=3;258>=t;t++)n=e(t),i[t]=n[2]<<24|n[1]<<16|n[0];return i}();function I(e,t){switch(this.l=[],this.m=32768,this.d=this.f=this.c=this.t=0,this.input=y?new Uint8Array(e):e,this.u=!1,this.n=J,this.K=!1,!t&&(t={})||(t.index&&(this.c=t.index),t.bufferSize&&(this.m=t.bufferSize),t.bufferType&&(this.n=t.bufferType),t.resize&&(this.K=t.resize)),this.n){case ga:this.a=32768,this.b=new(y?Uint8Array:Array)(32768+this.m+258);break;case J:this.a=0,this.b=new(y?Uint8Array:Array)(this.m),this.e=this.W,this.B=this.R,this.q=this.V;break;default:l(Error("invalid inflate mode"))}}y&&new Uint32Array(fa);var ga=0,J=1;I.prototype.r=function(){for(;!this.u;){var e=K(this,3);switch(1&e&&(this.u=!0),e>>>=1){case 0:var t=this.input,n=this.c,i=this.b,o=this.a,a=t.length,s=r,c=i.length,_=r;switch(this.d=this.f=0,n+1>=a&&l(Error("invalid uncompressed block header: LEN")),s=t[n++]|t[n++]<<8,n+1>=a&&l(Error("invalid uncompressed block header: NLEN")),s===~(t[n++]|t[n++]<<8)&&l(Error("invalid uncompressed block header: length verify")),n+s>t.length&&l(Error("input buffer is broken")),this.n){case ga:for(;o+s>i.length;){if(s-=_=c-o,y)i.set(t.subarray(n,n+_),o),o+=_,n+=_;else for(;_--;)i[o++]=t[n++];this.a=o,i=this.e(),o=this.a}break;case J:for(;o+s>i.length;)i=this.e({H:2});break;default:l(Error("invalid inflate mode"))}if(y)i.set(t.subarray(n,n+s),o),o+=s,n+=s;else for(;s--;)i[o++]=t[n++];this.c=n,this.a=o,this.b=i;break;case 1:this.q(ha,ia);break;case 2:var h,u,d,m,f=K(this,5)+257,p=K(this,5)+1,v=K(this,4)+4,A=new(y?Uint8Array:Array)(L.length),x=r,g=r,I=r,b=r,E=r;for(E=0;E=R?8:255>=R?9:279>=R?7:8;var ha=D(Q),S=new(y?Uint8Array:Array)(30),T,ra;for(T=0,ra=S.length;T=s&&l(Error("input buffer is broken")),i|=a[r++]<>>t,e.d=o-t,e.c=r,n}function M(e,t){for(var n,i,o=e.f,a=e.d,r=e.input,s=e.c,c=r.length,_=t[0],h=t[1];a=c);)o|=r[s++]<>>16)>a&&l(Error("invalid code length: "+i)),e.f=o>>i,e.d=a-i,e.c=s,65535&n}function U(e){e=e||{},this.files=[],this.v=e.comment}function V(e,t){t=t||{},this.input=y&&e instanceof Array?new Uint8Array(e):e,this.c=0,this.ba=t.verify||!1,this.j=t.password}t=I.prototype,t.q=function(e,t){var n=this.b,i=this.a;this.C=e;for(var o,a,r,s,l=n.length-258;256!==(o=M(this,e));)if(256>o)i>=l&&(this.a=i,n=this.e(),i=this.a),n[i++]=o;else for(s=la[a=o-257],0=l&&(this.a=i,n=this.e(),i=this.a);s--;)n[i]=n[i++-r];for(;8<=this.d;)this.d-=8,this.c--;this.a=i},t.V=function(e,t){var n=this.b,i=this.a;this.C=e;for(var o,a,r,s,l=n.length;256!==(o=M(this,e));)if(256>o)i>=l&&(l=(n=this.e()).length),n[i++]=o;else for(s=la[a=o-257],0l&&(l=(n=this.e()).length);s--;)n[i]=n[i++-r];for(;8<=this.d;)this.d-=8,this.c--;this.a=i},t.e=function(){var e,t,n=new(y?Uint8Array:Array)(this.a-32768),i=this.a-32768,o=this.b;if(y)n.set(o.subarray(32768,n.length));else for(e=0,t=n.length;ee;++e)o[e]=o[i+e];return this.a=32768,o},t.W=function(e){var t,n,i,o=this.input.length/this.c+1|0,a=this.input,r=this.b;return e&&("number"==typeof e.H&&(o=e.H),"number"==typeof e.P&&(o+=e.P)),n=2>o?(i=(a.length-this.c)/this.C[2]/2*258|0)t&&(this.b.length=t),e=this.b),this.buffer=e},U.prototype.L=function(e){this.j=e},U.prototype.s=function(e){var t=65535&e[2]|2;return t*(1^t)>>8&255},U.prototype.k=function(e,t){e[0]=(C[255&(e[0]^t)]^e[0]>>>8)>>>0,e[1]=1+(6681*(20173*(e[1]+(255&e[0]))>>>0)>>>0)>>>0,e[2]=(C[255&(e[2]^e[1]>>>24)]^e[2]>>>8)>>>0},U.prototype.T=function(e){var t,n,i=[305419896,591751049,878082192];for(y&&(i=new Uint32Array(i)),t=0,n=e.length;t>>0,this.z=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.J=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.h=e[t++]|e[t++]<<8,this.g=e[t++]|e[t++]<<8,this.F=e[t++]|e[t++]<<8,this.ea=e[t++]|e[t++]<<8,this.ga=e[t++]|e[t++]<<8,this.fa=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,this.$=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.filename=String.fromCharCode.apply(null,y?e.subarray(t,t+=this.h):e.slice(t,t+=this.h)),this.X=y?e.subarray(t,t+=this.g):e.slice(t,t+=this.g),this.v=y?e.subarray(t,t+this.F):e.slice(t,t+this.F),this.length=t-this.offset};var va={N:1,ca:8,da:2048};function $(e){var t,n,i,o,a=[],s={};if(!e.i){if(e.o===r){var c,_=e.input;if(!e.D)e:{var h,u=e.input;for(h=u.length-12;0>>0,e.o=(_[c++]|_[c++]<<8|_[c++]<<16|_[c++]<<24)>>>0,e.w=_[c++]|_[c++]<<8,e.v=y?_.subarray(c,c+e.w):_.slice(c,c+e.w)}for(t=e.o,i=0,o=e.aa;i>>0,this.z=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.J=(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)>>>0,this.h=e[t++]|e[t++]<<8,this.g=e[t++]|e[t++]<<8,this.filename=String.fromCharCode.apply(null,y?e.subarray(t,t+=this.h):e.slice(t,t+=this.h)),this.X=y?e.subarray(t,t+=this.g):e.slice(t,t+=this.g),this.length=t-this.offset},t=V.prototype,t.Y=function(){var e,t,n,i=[];for(this.i||$(this),e=0,t=(n=this.i).length;e>>8^C[255&(p^c[v])];for(A=x>>3;A--;v+=8)p=(p=(p=(p=(p=(p=(p=(p=p>>>8^C[255&(p^c[v])])>>>8^C[255&(p^c[v+1])])>>>8^C[255&(p^c[v+2])])>>>8^C[255&(p^c[v+3])])>>>8^C[255&(p^c[v+4])])>>>8^C[255&(p^c[v+5])])>>>8^C[255&(p^c[v+6])])>>>8^C[255&(p^c[v+7])];_=(4294967295^p)>>>0,o.p!==_&&l(Error("wrong crc: file=0x"+o.p.toString(16)+", data=0x"+_.toString(16)))}return c},t.L=function(e){this.j=e},t.k=U.prototype.k,t.S=U.prototype.T,t.s=U.prototype.s,v("Zlib.Unzip",V),v("Zlib.Unzip.prototype.decompress",V.prototype.r),v("Zlib.Unzip.prototype.getFilenames",V.prototype.Y),v("Zlib.Unzip.prototype.setPassword",V.prototype.L)}).call(this)},3705:function(t,n,i){var o;o=function(){function t(){var e,t,s=document.createElement("canvas"),l="t",c=1,_=2.2,h=null;return s.__defineGetter__("exposure",(function(){return c})),s.__defineSetter__("exposure",(function(n){c=n,h&&(r(h,c,_,t.data),e.putImageData(t,0,0))})),s.__defineGetter__("gamma",(function(){return _})),s.__defineSetter__("gamma",(function(n){_=n,h&&(r(h,c,_,t.data),e.putImageData(t,0,0))})),s.__defineGetter__("dataFloat",(function(){return a(h)})),s.__defineGetter__("dataRGBE",(function(){return h})),s.toHDRBlob=function(e,t,i){function o(e,t,n){var i=e.createShader(n);return e.shaderSource(i,t),e.compileShader(i),i}var r=t&&t.match(/rgb9_e5/i)?new Uint8Array(n(a(h)).buffer):new Uint8Array(h.buffer),s=this.width,l=this.height;if(s*l*4=400)return this.onerror();for(var e,t="",n=0,i=new Uint8Array(this.response);!t.match(/\n\n[^\n]+\n/g);)t+=String.fromCharCode(i[n++]);if("32-bit_rle_rgbe"!=(e=t.match(/FORMAT=(.*)$/m)[1]))return console.warn("unknown format : "+e),this.onerror();for(var o=t.split(/\n/).reverse()[1].split(" "),a=1*o[3],r=1*o[1],s=new Uint8Array(a*r*4),l=0,c=0;c0;)if(s.set(i.slice(n,n+=4),l),1==s[l]&&1==s[l+1]&&1==s[l+2])for(s[l+3];m>0;m--)s.set(s.slice(l-4,l),l),l+=4,u--;else u--,l+=4}else{if((_[2]<<8)+_[3]!=a)return console.warn("HDR line mismatch .."),this.onerror();for(var m=0;m<4;m++)for(var f,p,v=m*a,A=(m+1)*a;v128)for(p=f[0]-128;p-- >0;)h[v++]=f[1];else for(p=f[0]-1,h[v++]=f[1];p-- >0;)h[v++]=i[n++];for(m=0;m>2,a=(t=t||new Float32Array(3*o),0);a>>23)*i,t[3*a+1]=(n>>>14&511)*i,t[3*a+2]=(n>>>5&511)*i;return t}function o(t,n){for(var i,o,a,r,s,l=t.byteLength/12|0,c=(n=n||new Uint8Array(4*l),0);c>2,o=(t=t||new Float32Array(3*i),0);o>2,s=(i=i||new Uint8ClampedArray(4*r),0);s{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{AABB:()=>e.mNG,AABBGizmo:()=>e.qfN,AbsoluteAnimation:()=>e.lam,AbstractArrayBufferBaseMathNumber:()=>e.bCT,AbstractCameraController:()=>e.mC0,AbstractMaterialContent:()=>e.PxB,AbstractMatrix:()=>e.XAY,AbstractQuaternion:()=>e.lJH,AbstractShaderNode:()=>e.VI2,AbstractTexture:()=>e.yEY,AbstractVector:()=>e.OxW,Accessor:()=>e.U_s,AddShaderNode:()=>e.yd$,AlphaMode:()=>e.FvO,AnimationAssigner:()=>e.tVY,AnimationAttribute:()=>e.sdx,AnimationComponent:()=>e.cwg,AnimationInterpolation:()=>e.kOi,AttributeNormalShaderNode:()=>e.Sy_,AttributePositionShaderNode:()=>e.JRY,Axis:()=>e.RDh,BasisCompressionType:()=>e.l6R,BlendShapeComponent:()=>e.xTt,BlockBeginShader:()=>l.I,BlockBeginShaderNode:()=>e.afv,BlockEndShader:()=>c.$,BlockEndShaderNode:()=>e.fgK,BoneDataType:()=>e.Nh_,Buffer:()=>e.lWr,BufferUse:()=>e.$HW,BufferView:()=>e.qP0,CGAPIResourceRepository:()=>e.FOu,Cache:()=>e.CtF,CameraComponent:()=>e.Myt,CameraControllerComponent:()=>e.SPq,CameraControllerType:()=>e.MyC,CameraType:()=>e.iM5,CapsuleCollider:()=>e.zmi,ClassicShadingShader:()=>u,ColorGradingUsingLUTsMaterialContent:()=>e.h_U,ColorRgb:()=>e.sZ3,ColorRgba:()=>e.tWC,ComplexVertexAttribute:()=>e.et4,Component:()=>e.wA2,ComponentRepository:()=>e.C2e,ComponentType:()=>e.reR,CompositionType:()=>e.dh2,CompressionTextureType:()=>e.bfi,Config:()=>e.DeH,ConstRgbaBlack:()=>e.SGm,ConstRgbaWhite:()=>e.zUz,ConstVector2_0_0:()=>e.igI,ConstVector2_1_1:()=>e.HOX,ConstVector3_0_0_0:()=>e.R1o,ConstVector3_1_1_1:()=>e.p8_,ConstVector4_0_0_0_0:()=>e.GYQ,ConstVector4_0_0_0_1:()=>e.cV0,ConstVector4_1_1_1_1:()=>e.n9W,ConstantVariableShader:()=>d.i,ConstantVariableShaderNode:()=>e.GFx,Cube:()=>e.Xv,CubeTexture:()=>e.BtG,CustomMaterialContent:()=>e.fZl,DataUtil:()=>e.j4H,DefaultTextures:()=>e.kTl,DepthEncodeMaterialContent:()=>e.Q5_,DetectHighLuminanceMaterialContent:()=>e.tlJ,DotProductShaderNode:()=>e.jLO,DrcPointCloudImporter:()=>e.c5O,EVENT_CLICK:()=>e.Lfs,EVENT_KEY_DOWN:()=>e._QQ,EVENT_KEY_PRESS:()=>e.lOB,EVENT_KEY_UP:()=>e.k$j,EVENT_MOUSE_DOWN:()=>e.zUJ,EVENT_MOUSE_ENTER:()=>e.ak0,EVENT_MOUSE_LEAVE:()=>e.n9,EVENT_MOUSE_MOVE:()=>e.k4,EVENT_MOUSE_OVER:()=>e.vE_,EVENT_MOUSE_UP:()=>e.cG$,EVENT_MOUSE_WHEEL:()=>e.Sss,EVENT_MSPOINTER_DOWN:()=>e.q7F,EVENT_MSPOINTER_MOVE:()=>e.cAE,EVENT_MSPOINTER_UP:()=>e.fAB,EVENT_ORIENTATION_CHANGE:()=>e.SGU,EVENT_POINTER_CANCEL:()=>e.cEP,EVENT_POINTER_DOWN:()=>e.cSB,EVENT_POINTER_ENTER:()=>e.lcf,EVENT_POINTER_LEAVE:()=>e.RyN,EVENT_POINTER_MOVE:()=>e._6o,EVENT_POINTER_OUT:()=>e.UB9,EVENT_POINTER_OVER:()=>e.Cfj,EVENT_POINTER_UP:()=>e.ROv,EVENT_RESIZE:()=>e.hDl,EVENT_TOUCH_CANCEL:()=>e.VS3,EVENT_TOUCH_DOUBLE_TAP:()=>e.Ywc,EVENT_TOUCH_DRAG:()=>e.pt8,EVENT_TOUCH_END:()=>e.p22,EVENT_TOUCH_ENTER:()=>e.jPE,EVENT_TOUCH_HOLD:()=>e.lv,EVENT_TOUCH_LEAVE:()=>e.adG,EVENT_TOUCH_LONG_TAP:()=>e.oM$,EVENT_TOUCH_MOVE:()=>e.jXG,EVENT_TOUCH_OUT:()=>e.fAN,EVENT_TOUCH_OVER:()=>e.KP1,EVENT_TOUCH_PINCH:()=>e.hdu,EVENT_TOUCH_START:()=>e.uso,EVENT_TOUCH_SWIPE:()=>e.yyZ,EVENT_TOUCH_TAP:()=>e.Rz4,Effekseer:()=>E.A,EffekseerComponent:()=>E.D,EndShader:()=>m.x,Entity:()=>e.JHW,EntityHelper:()=>e._nU,EntityRepository:()=>e.gIQ,EntityUIDOutputMaterialContent:()=>e.zFq,EnumClass:()=>e.Jxr,EnvConstantMaterialContent:()=>e.Zfh,Err:()=>e.UGl,EventPubSub:()=>e.U7Y,Expression:()=>e.A2z,FileType:()=>e.Tv5,ForwardRenderPipeline:()=>e.n8g,Frame:()=>e.RQC,FrameBuffer:()=>e.uLm,Frustum:()=>e.iWj,FurnaceTestMaterialContent:()=>e.bLY,GLSLShader:()=>s.m,GLTF2_EXPORT_DRACO:()=>e.Dy6,GLTF2_EXPORT_EMBEDDED:()=>e.jll,GLTF2_EXPORT_GLB:()=>e.Dbu,GLTF2_EXPORT_GLTF:()=>e.ESz,GLTF2_EXPORT_NO_DOWNLOAD:()=>e.S5k,GL_ACTIVE_ATTRIBUTES:()=>b._$8,GL_ACTIVE_TEXTURE:()=>b.lkt,GL_ACTIVE_UNIFORMS:()=>b.Td9,GL_ACTIVE_UNIFORM_BLOCKS:()=>b.wEd,GL_ALIASED_LINE_WIDTH_RANGE:()=>b.ogk,GL_ALIASED_POINT_SIZE_RANGE:()=>b.AY1,GL_ALPHA:()=>b.fNk,GL_ALPHA_BITS:()=>b.Y0n,GL_ALREADY_SIGNALED:()=>b.WPj,GL_ALWAYS:()=>b.gOo,GL_ANY_SAMPLES_PASSED:()=>b.$LR,GL_ANY_SAMPLES_PASSED_CONSERVATIVE:()=>b.faJ,GL_ARRAY_BUFFER:()=>b.TdU,GL_ARRAY_BUFFER_BINDING:()=>b.UAv,GL_ATTACHED_SHADERS:()=>b.Q$l,GL_BACK:()=>b.wIF,GL_BLEND:()=>b.ZXb,GL_BLEND_COLOR:()=>b.hzX,GL_BLEND_DST_ALPHA:()=>b.r9F,GL_BLEND_DST_RGB:()=>b.Kzo,GL_BLEND_EQUATION:()=>b.ttq,GL_BLEND_EQUATION_ALPHA:()=>b.XG_,GL_BLEND_EQUATION_RGB:()=>b.HPC,GL_BLEND_SRC_ALPHA:()=>b.QH$,GL_BLEND_SRC_RGB:()=>b._1o,GL_BLUE_BITS:()=>b.EZ0,GL_BOOL:()=>b.N9T,GL_BOOL_VEC2:()=>b.vgW,GL_BOOL_VEC3:()=>b.tqi,GL_BOOL_VEC4:()=>b.iU2,GL_BROWSER_DEFAULT_WEBGL:()=>b.BWL,GL_BUFFER_SIZE:()=>b.F_m,GL_BUFFER_USAGE:()=>b.$et,GL_CCW:()=>b.gx8,GL_CLAMP_TO_EDGE:()=>b.Y8m,GL_COLOR:()=>b.Wlc,GL_COLOR_ATTACHMENT0:()=>b.krQ,GL_COLOR_ATTACHMENT0_WEBGL:()=>b.YCV,GL_COLOR_ATTACHMENT1:()=>b.p7w,GL_COLOR_ATTACHMENT10:()=>b.Axb,GL_COLOR_ATTACHMENT10_WEBGL:()=>b.eqO,GL_COLOR_ATTACHMENT11:()=>b.gwn,GL_COLOR_ATTACHMENT11_WEBGL:()=>b.BM1,GL_COLOR_ATTACHMENT12:()=>b.w4x,GL_COLOR_ATTACHMENT12_WEBGL:()=>b.CCZ,GL_COLOR_ATTACHMENT13:()=>b.FQh,GL_COLOR_ATTACHMENT13_WEBGL:()=>b.AOk,GL_COLOR_ATTACHMENT14:()=>b.rjz,GL_COLOR_ATTACHMENT14_WEBGL:()=>b.LwI,GL_COLOR_ATTACHMENT15:()=>b._8G,GL_COLOR_ATTACHMENT15_WEBGL:()=>b.ZC4,GL_COLOR_ATTACHMENT1_WEBGL:()=>b.$9l,GL_COLOR_ATTACHMENT2:()=>b.Bky,GL_COLOR_ATTACHMENT2_WEBGL:()=>b.qNf,GL_COLOR_ATTACHMENT3:()=>b.I2u,GL_COLOR_ATTACHMENT3_WEBGL:()=>b.oC9,GL_COLOR_ATTACHMENT4:()=>b.ip$,GL_COLOR_ATTACHMENT4_WEBGL:()=>b.HBF,GL_COLOR_ATTACHMENT5:()=>b._Mr,GL_COLOR_ATTACHMENT5_WEBGL:()=>b.vpR,GL_COLOR_ATTACHMENT6:()=>b.w_G,GL_COLOR_ATTACHMENT6_WEBGL:()=>b.wpZ,GL_COLOR_ATTACHMENT7:()=>b.UBE,GL_COLOR_ATTACHMENT7_WEBGL:()=>b.L8z,GL_COLOR_ATTACHMENT8:()=>b.egt,GL_COLOR_ATTACHMENT8_WEBGL:()=>b.J6F,GL_COLOR_ATTACHMENT9:()=>b.O27,GL_COLOR_ATTACHMENT9_WEBGL:()=>b.L4c,GL_COLOR_BUFFER_BIT:()=>b.$FK,GL_COLOR_CLEAR_VALUE:()=>b.FEv,GL_COLOR_WRITEMASK:()=>b.Ut4,GL_COMPARE_REF_TO_TEXTURE:()=>b.M_A,GL_COMPILE_STATUS:()=>b.MKG,GL_COMPRESSED_R11_EAC:()=>b.d6W,GL_COMPRESSED_RG11_EAC:()=>b.y3r,GL_COMPRESSED_RGB8_ETC2:()=>b.L3p,GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:()=>b.aLt,GL_COMPRESSED_RGBA8_ETC2_EAC:()=>b.DM,GL_COMPRESSED_RGBA_ASTC_10X10_KHR:()=>b.Hfs,GL_COMPRESSED_RGBA_ASTC_10X5_KHR:()=>b.ObQ,GL_COMPRESSED_RGBA_ASTC_10X6_KHR:()=>b.Q2$,GL_COMPRESSED_RGBA_ASTC_10X8_KHR:()=>b.kvX,GL_COMPRESSED_RGBA_ASTC_12X10_KHR:()=>b.U05,GL_COMPRESSED_RGBA_ASTC_12X12_KHR:()=>b.nsH,GL_COMPRESSED_RGBA_ASTC_4X4_KHR:()=>b.mrS,GL_COMPRESSED_RGBA_ASTC_5X4_KHR:()=>b.yZM,GL_COMPRESSED_RGBA_ASTC_5X5_KHR:()=>b.ij3,GL_COMPRESSED_RGBA_ASTC_6X5_KHR:()=>b.qSO,GL_COMPRESSED_RGBA_ASTC_6X6_KHR:()=>b.Fh_,GL_COMPRESSED_RGBA_ASTC_8X5_KHR:()=>b._zC,GL_COMPRESSED_RGBA_ASTC_8X6_KHR:()=>b.$9u,GL_COMPRESSED_RGBA_ASTC_8X8_KHR:()=>b.Gow,GL_COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:()=>b.$1s,GL_COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:()=>b.$PT,GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:()=>b.fYk,GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:()=>b.DcX,GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:()=>b.bTO,GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:()=>b.TsK,GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:()=>b.G00,GL_COMPRESSED_RGB_ATC_WEBGL:()=>b.xug,GL_COMPRESSED_RGB_ETC1_WEBGL:()=>b.mhR,GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG:()=>b.Awc,GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG:()=>b.EW4,GL_COMPRESSED_RGB_S3TC_DXT1_EXT:()=>b.suj,GL_COMPRESSED_SIGNED_R11_EAC:()=>b.SzQ,GL_COMPRESSED_SIGNED_RG11_EAC:()=>b.Y_Y,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:()=>b.dN8,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:()=>b.TY8,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:()=>b.EMZ,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:()=>b.DnL,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:()=>b.dpg,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:()=>b.kW3,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:()=>b.dcZ,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:()=>b.qfx,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:()=>b.a2d,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:()=>b.hRd,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:()=>b.Tkf,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:()=>b.EiH,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:()=>b.Ham,GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:()=>b.kUS,GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:()=>b.iLk,GL_COMPRESSED_SRGB8_ETC2:()=>b.rZr,GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:()=>b.eyW,GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:()=>b.XY4,GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:()=>b.FyP,GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:()=>b.QrU,GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:()=>b.F8G,GL_COMPRESSED_TEXTURE_FORMATS:()=>b.r4j,GL_CONDITION_SATISFIED:()=>b.oRF,GL_CONSTANT_ALPHA:()=>b.HN$,GL_CONSTANT_COLOR:()=>b.obT,GL_CONTEXT_LOST_WEBGL:()=>b.Ahs,GL_COPY_READ_BUFFER:()=>b.jIl,GL_COPY_READ_BUFFER_BINDING:()=>b.F0I,GL_COPY_WRITE_BUFFER:()=>b.Pa5,GL_COPY_WRITE_BUFFER_BINDING:()=>b.$XJ,GL_CULL_FACE:()=>b.tef,GL_CULL_FACE_MODE:()=>b.lkd,GL_CURRENT_PROGRAM:()=>b.Gi2,GL_CURRENT_QUERY:()=>b.pcv,GL_CURRENT_QUERY_EXT:()=>b.bye,GL_CURRENT_VERTEX_ATTRIB:()=>b.tV_,GL_CW:()=>b.PU5,GL_DATA_BYTE:()=>b.q7Q,GL_DATA_FLOAT:()=>b.OT$,GL_DATA_INT:()=>b.Nq4,GL_DATA_SHORT:()=>b._TP,GL_DATA_UNSIGNED_BYTE:()=>b.Ywg,GL_DATA_UNSIGNED_INT:()=>b.M_8,GL_DATA_UNSIGNED_SHORT:()=>b.rkl,GL_DECR:()=>b.nTe,GL_DECR_WRAP:()=>b.k4y,GL_DELETE_STATUS:()=>b.Pw6,GL_DEPTH:()=>b.gLP,GL_DEPTH24_STENCIL8:()=>b.pmD,GL_DEPTH32F_STENCIL8:()=>b.WB9,GL_DEPTH_ATTACHMENT:()=>b.ksX,GL_DEPTH_BITS:()=>b.Ro9,GL_DEPTH_BUFFER_BIT:()=>b.GuG,GL_DEPTH_CLEAR_VALUE:()=>b.WRC,GL_DEPTH_COMPONENT:()=>b.pEo,GL_DEPTH_COMPONENT16:()=>b.r7P,GL_DEPTH_COMPONENT24:()=>b.LjI,GL_DEPTH_COMPONENT32F:()=>b.FcV,GL_DEPTH_FUNC:()=>b.hvl,GL_DEPTH_RANGE:()=>b.w97,GL_DEPTH_STENCIL:()=>b.Bwm,GL_DEPTH_STENCIL_ATTACHMENT:()=>b.y$A,GL_DEPTH_TEST:()=>b.oHv,GL_DEPTH_WRITEMASK:()=>b.b0C,GL_DITHER:()=>b.Rad,GL_DONT_CARE:()=>b.u3g,GL_DRAW_BUFFER0:()=>b.a36,GL_DRAW_BUFFER0_WEBGL:()=>b.Jql,GL_DRAW_BUFFER1:()=>b.lsi,GL_DRAW_BUFFER10:()=>b.y1m,GL_DRAW_BUFFER10_WEBGL:()=>b.L42,GL_DRAW_BUFFER11:()=>b.ubh,GL_DRAW_BUFFER11_WEBGL:()=>b.LcQ,GL_DRAW_BUFFER12:()=>b.j7V,GL_DRAW_BUFFER12_WEBGL:()=>b.Sp2,GL_DRAW_BUFFER13:()=>b.dk8,GL_DRAW_BUFFER13_WEBGL:()=>b.oLV,GL_DRAW_BUFFER14:()=>b.AV8,GL_DRAW_BUFFER14_WEBGL:()=>b.k5c,GL_DRAW_BUFFER15:()=>b.so$,GL_DRAW_BUFFER15_WEBGL:()=>b.uyr,GL_DRAW_BUFFER1_WEBGL:()=>b.mRc,GL_DRAW_BUFFER2:()=>b.E$e,GL_DRAW_BUFFER2_WEBGL:()=>b.B5U,GL_DRAW_BUFFER3:()=>b.AQ3,GL_DRAW_BUFFER3_WEBGL:()=>b.iMT,GL_DRAW_BUFFER4:()=>b.WUY,GL_DRAW_BUFFER4_WEBGL:()=>b.fln,GL_DRAW_BUFFER5:()=>b.AtN,GL_DRAW_BUFFER5_WEBGL:()=>b.l_g,GL_DRAW_BUFFER6:()=>b.PZH,GL_DRAW_BUFFER6_WEBGL:()=>b.HDK,GL_DRAW_BUFFER7:()=>b.KTo,GL_DRAW_BUFFER7_WEBGL:()=>b.WVN,GL_DRAW_BUFFER8:()=>b.R66,GL_DRAW_BUFFER8_WEBGL:()=>b.YxF,GL_DRAW_BUFFER9:()=>b.Wkg,GL_DRAW_BUFFER9_WEBGL:()=>b.wA8,GL_DRAW_FRAMEBUFFER:()=>b.l3h,GL_DRAW_FRAMEBUFFER_BINDING:()=>b.UwG,GL_DST_ALPHA:()=>b.J$B,GL_DST_COLOR:()=>b.koL,GL_DYNAMIC_COPY:()=>b.KCX,GL_DYNAMIC_DRAW:()=>b.Kn$,GL_DYNAMIC_READ:()=>b.opG,GL_ELEMENT_ARRAY_BUFFER:()=>b.hAw,GL_ELEMENT_ARRAY_BUFFER_BINDING:()=>b.fMn,GL_EQUAL:()=>b.IuO,GL_FASTEST:()=>b.wGk,GL_FLOAT_32_UNSIGNED_INT_24_8_REV:()=>b.wER,GL_FLOAT_MAT2:()=>b.a$d,GL_FLOAT_MAT2X3:()=>b.h$M,GL_FLOAT_MAT2X4:()=>b.d8l,GL_FLOAT_MAT3:()=>b.ODf,GL_FLOAT_MAT3X2:()=>b.oud,GL_FLOAT_MAT3X4:()=>b.LhK,GL_FLOAT_MAT4:()=>b.wSW,GL_FLOAT_MAT4X2:()=>b.ozE,GL_FLOAT_MAT4X3:()=>b.Dq,GL_FLOAT_VEC2:()=>b.e3O,GL_FLOAT_VEC3:()=>b.qhU,GL_FLOAT_VEC4:()=>b.dtP,GL_FRAGMENT_SHADER:()=>b.QoZ,GL_FRAGMENT_SHADER_DERIVATIVE_HINT:()=>b.AQL,GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:()=>b.Qh0,GL_FRAMEBUFFER:()=>b.Iqe,GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:()=>b.vEJ,GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:()=>b.BSP,GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:()=>b.Yhe,GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:()=>b.U4r,GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:()=>b.MLp,GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:()=>b.$ri,GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:()=>b.hCR,GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:()=>b.y8S,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:()=>b.UlJ,GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:()=>b.KY4,GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:()=>b.HHs,GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:()=>b.HGq,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:()=>b.jD8,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:()=>b.dIe,GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:()=>b.$TT,GL_FRAMEBUFFER_BINDING:()=>b.F06,GL_FRAMEBUFFER_COMPLETE:()=>b.Erj,GL_FRAMEBUFFER_DEFAULT:()=>b.AjE,GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:()=>b.Qlq,GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:()=>b.URo,GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:()=>b.lmp,GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:()=>b.rfC,GL_FRAMEBUFFER_UNSUPPORTED:()=>b.JZg,GL_FRONT:()=>b.dte,GL_FRONT_AND_BACK:()=>b.cN,GL_FRONT_FACE:()=>b.gI2,GL_FUNC_ADD:()=>b.gNb,GL_FUNC_REVERSE_SUBTRACT:()=>b.lJZ,GL_FUNC_SUBSTRACT:()=>b.xHF,GL_GENERATE_MIPMAP_HINT:()=>b.NyC,GL_GEQUAL:()=>b.qbs,GL_GPU_DISJOINT_EXT:()=>b.FpK,GL_GREATER:()=>b.hys,GL_GREEN_BITS:()=>b.jtX,GL_HALF_FLOAT:()=>b.XpU,GL_HALF_FLOAT_OES:()=>b.fb9,GL_HIGH_FLOAT:()=>b.w8k,GL_HIGH_INT:()=>b.F8$,GL_IMPLEMENTATION_COLOR_READ_FORMAT:()=>b.az3,GL_IMPLEMENTATION_COLOR_READ_TYPE:()=>b.AKO,GL_INCR:()=>b.uyu,GL_INCR_WRAP:()=>b.It5,GL_INTERLEAVED_ATTRIBS:()=>b.MNF,GL_INT_2_10_10_10_REV:()=>b.Seb,GL_INT_SAMPLER_2D:()=>b.qiu,GL_INT_SAMPLER_2D_ARRAY:()=>b.uU2,GL_INT_SAMPLER_3D:()=>b.PnX,GL_INT_SAMPLER_CUBE:()=>b.WfD,GL_INT_VEC2:()=>b.RS3,GL_INT_VEC3:()=>b.yYj,GL_INT_VEC4:()=>b.xyr,GL_INVALID_ENUM:()=>b.JC7,GL_INVALID_FRAMEBUFFER_OPERATION:()=>b.aXw,GL_INVALID_INDEX:()=>b.h2K,GL_INVALID_OPERATION:()=>b.lZq,GL_INVALID_VALUE:()=>b.Qpw,GL_INVERT:()=>b.SUn,GL_KEEP:()=>b.Rk$,GL_LEQUAL:()=>b.Vfd,GL_LESS:()=>b.hyR,GL_LINEAR:()=>b.utc,GL_LINEAR_MIPMAP_LINEAR:()=>b.Onn,GL_LINEAR_MIPMAP_NEAREST:()=>b.D68,GL_LINES:()=>b.CB7,GL_LINE_LOOP:()=>b.Jxz,GL_LINE_STRIP:()=>b.M0t,GL_LINE_WIDTH:()=>b.uik,GL_LINK_STATUS:()=>b.WNe,GL_LOW_FLOAT:()=>b.B2j,GL_LOW_INT:()=>b.OJ6,GL_LUMINANCE:()=>b.y9I,GL_LUMINANCE_ALPHA:()=>b.VPl,GL_MAX:()=>b.bQw,GL_MAX_3D_TEXTURE_SIZE:()=>b.TSE,GL_MAX_ARRAY_TEXTURE_LAYERS:()=>b.Dn,GL_MAX_CLIENT_WAIT_TIMEOUT_WEBGL:()=>b.Tr4,GL_MAX_COLOR_ATTACHMENTS:()=>b.DM2,GL_MAX_COLOR_ATTACHMENTS_WEBGL:()=>b.AA5,GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:()=>b.lPV,GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:()=>b.QZz,GL_MAX_COMBINED_UNIFORM_BLOCKS:()=>b.PKw,GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:()=>b.Dgg,GL_MAX_CUBE_MAP_TEXTURE_SIZE:()=>b.ly5,GL_MAX_DRAW_BUFFERS:()=>b.TQ9,GL_MAX_DRAW_BUFFERS_WEBGL:()=>b.GuK,GL_MAX_ELEMENTS_INDICES:()=>b.iIj,GL_MAX_ELEMENTS_VERTICES:()=>b.$OY,GL_MAX_ELEMENT_INDEX:()=>b.SKn,GL_MAX_EXT:()=>b.VdM,GL_MAX_FRAGMENT_INPUT_COMPONENTS:()=>b.YNJ,GL_MAX_FRAGMENT_UNIFORM_BLOCKS:()=>b.PUO,GL_MAX_FRAGMENT_UNIFORM_COMPONENTS:()=>b.Jvo,GL_MAX_FRAGMENT_UNIFORM_VECTORS:()=>b.JJY,GL_MAX_PROGRAM_TEXEL_OFFSET:()=>b._b_,GL_MAX_RENDERBUFFER_SIZE:()=>b.ml9,GL_MAX_SAMPLES:()=>b.WBe,GL_MAX_SERVER_WAIT_TIMEOUT:()=>b.epv,GL_MAX_TEXTURE_IMAGE_UNITS:()=>b.D8i,GL_MAX_TEXTURE_LOD_BIAS:()=>b.kky,GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:()=>b.oR$,GL_MAX_TEXTURE_SIZE:()=>b.S1v,GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:()=>b.QkI,GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:()=>b._YZ,GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:()=>b.Mlt,GL_MAX_UNIFORM_BLOCK_SIZE:()=>b.uri,GL_MAX_UNIFORM_BUFFER_BINDINGS:()=>b.E6I,GL_MAX_VARYING_COMPONENTS:()=>b.Cj5,GL_MAX_VARYING_VECTORS:()=>b.jHY,GL_MAX_VERTEX_ATTRIBS:()=>b.hfp,GL_MAX_VERTEX_OUTPUT_COMPONENTS:()=>b.ksA,GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS:()=>b.Rw3,GL_MAX_VERTEX_UNIFORM_BLOCKS:()=>b.SH3,GL_MAX_VERTEX_UNIFORM_COMPONENTS:()=>b.Ft1,GL_MAX_VERTEX_UNIFORM_VECTORS:()=>b.N8N,GL_MAX_VIEWPORT_DIMS:()=>b.oDL,GL_MEDIUM_FLOAT:()=>b.fL$,GL_MEDIUM_INT:()=>b.XEX,GL_MIN:()=>b.Awz,GL_MIN_EXT:()=>b.fxg,GL_MIN_PROGRAM_TEXEL_OFFSET:()=>b.pc5,GL_MIRRORED_REPEAT:()=>b.GjS,GL_NEAREST:()=>b.R1c,GL_NEAREST_MIPMAP_LINEAR:()=>b.vTv,GL_NEAREST_MIPMAP_NEAREST:()=>b.wWb,GL_NEVER:()=>b.shP,GL_NICEST:()=>b.wVD,GL_NONE:()=>b.Hh0,GL_NOTEQUAL:()=>b.UnN,GL_NO_ERROR:()=>b.Wen,GL_OBJECT_TYPE:()=>b.BHy,GL_ONE:()=>b.Qak,GL_ONE_MINUS_CONSTANT_ALPHA:()=>b.D__,GL_ONE_MINUS_CONSTANT_COLOR:()=>b.$rK,GL_ONE_MINUS_DST_ALPHA:()=>b.X5J,GL_ONE_MINUS_DST_COLOR:()=>b.hOW,GL_ONE_MINUS_SRC_ALPHA:()=>b.GR4,GL_ONE_MINUS_SRC_COLOR:()=>b.IDP,GL_OUT_OF_MEMORY:()=>b.gcz,GL_PACK_ALIGNMENT:()=>b.XPs,GL_PACK_ROW_LENGTH:()=>b.wMK,GL_PACK_SKIP_PIXELS:()=>b.voy,GL_PACK_SKIP_ROWS:()=>b.VNU,GL_PIXEL_PACK_BUFFER:()=>b.OAM,GL_PIXEL_PACK_BUFFER_BINDING:()=>b.vce,GL_PIXEL_UNPACK_BUFFER:()=>b.fsJ,GL_PIXEL_UNPACK_BUFFER_BINDING:()=>b.mED,GL_PIXEL_UNSIGNED_BYTE:()=>b.vnd,GL_PIXEL_UNSIGNED_SHORT_4_4_4_4:()=>b.yD3,GL_PIXEL_UNSIGNED_SHORT_5_5_5_1:()=>b.kyN,GL_PIXEL_UNSIGNED_SHORT_5_6_5:()=>b.nJx,GL_POINTS:()=>b.u$A,GL_POLYGON_OFFSET_FACTOR:()=>b.tzR,GL_POLYGON_OFFSET_FILL:()=>b.Lbl,GL_POLYGON_OFFSET_UNITS:()=>b.DEk,GL_QUERY_COUNTER_BITS_EXT:()=>b.HPM,GL_QUERY_RESULT:()=>b.dbf,GL_QUERY_RESULT_AVAILABLE:()=>b.vPW,GL_QUERY_RESULT_AVAILABLE_EXT:()=>b.KAt,GL_QUERY_RESULT_EXT:()=>b._UX,GL_R11F_G11F_B10F:()=>b.zsc,GL_R16F:()=>b.oY_,GL_R16I:()=>b.gj3,GL_R16UI:()=>b.oqe,GL_R32F:()=>b.uER,GL_R32I:()=>b._TF,GL_R32UI:()=>b.YlY,GL_R8:()=>b.cYm,GL_R8I:()=>b._EH,GL_R8UI:()=>b.S00,GL_R8_SNORM:()=>b.w9H,GL_RASTERIZER_DISCARD:()=>b.ZXo,GL_READ_BUFFER:()=>b._Ir,GL_READ_FRAMEBUFFER:()=>b.yun,GL_READ_FRAMEBUFFER_BINDING:()=>b.bXZ,GL_RED:()=>b.ZhV,GL_RED_BITS:()=>b.jZr,GL_RED_INTEGER:()=>b.iKz,GL_RENDERBUFFER:()=>b.vPm,GL_RENDERBUFFER_ALPHA_SIZE:()=>b.Ysb,GL_RENDERBUFFER_BINDING:()=>b.qk$,GL_RENDERBUFFER_BLUE_SIZE:()=>b.pBm,GL_RENDERBUFFER_DEPTH_SIZE:()=>b.lbA,GL_RENDERBUFFER_GREEN_SIZE:()=>b.OSM,GL_RENDERBUFFER_HEIGHT:()=>b.Bxb,GL_RENDERBUFFER_INTERNAL_FORMAT:()=>b.TpV,GL_RENDERBUFFER_RED_SIZE:()=>b.eco,GL_RENDERBUFFER_SAMPLES:()=>b.CW9,GL_RENDERBUFFER_STENCIL_SIZE:()=>b.Dm9,GL_RENDERBUFFER_WIDTH:()=>b._ZX,GL_RENDERER:()=>b.mfM,GL_REPEAT:()=>b.$7R,GL_REPLACE:()=>b.Snx,GL_RG:()=>b.SJU,GL_RG16F:()=>b.uLG,GL_RG16I:()=>b.XE4,GL_RG16UI:()=>b.r0$,GL_RG32F:()=>b.uM4,GL_RG32I:()=>b.dH_,GL_RG32UI:()=>b.xIw,GL_RG8:()=>b.OAe,GL_RG8I:()=>b.plb,GL_RG8UI:()=>b.lR$,GL_RG8_SNORM:()=>b.sOz,GL_RGB:()=>b.Zkt,GL_RGB10_A2:()=>b.Zvf,GL_RGB10_A2UI:()=>b.sC0,GL_RGB16F:()=>b.eok,GL_RGB16I:()=>b.j7s,GL_RGB16UI:()=>b.WHG,GL_RGB32F:()=>b.GV0,GL_RGB32F_EXT:()=>b.Aoj,GL_RGB32I:()=>b.P7o,GL_RGB32UI:()=>b.yx3,GL_RGB565:()=>b.Hft,GL_RGB5_A1:()=>b.PB9,GL_RGB8:()=>b.Evp,GL_RGB8I:()=>b.kWN,GL_RGB8UI:()=>b.ZB$,GL_RGB8_SNORM:()=>b.aig,GL_RGB9_E5:()=>b.SaD,GL_RGBA:()=>b.gAT,GL_RGBA16F:()=>b.kcF,GL_RGBA16I:()=>b.Spt,GL_RGBA16UI:()=>b.k26,GL_RGBA32F:()=>b.qNt,GL_RGBA32F_EXT:()=>b.ps6,GL_RGBA32I:()=>b.Zsj,GL_RGBA32UI:()=>b.mae,GL_RGBA4:()=>b.EYP,GL_RGBA8:()=>b.ebJ,GL_RGBA8I:()=>b.KkT,GL_RGBA8UI:()=>b.KdC,GL_RGBA8_SNORM:()=>b.wXe,GL_RGBA_INTEGER:()=>b.jH6,GL_RGB_INTEGER:()=>b.PUt,GL_RG_INTEGER:()=>b.qH5,GL_SAMPLER_2D:()=>b.tps,GL_SAMPLER_2D_ARRAY:()=>b.pXP,GL_SAMPLER_2D_ARRAY_SHADOW:()=>b.P8N,GL_SAMPLER_2D_SHADOW:()=>b.oEd,GL_SAMPLER_3D:()=>b.t_W,GL_SAMPLER_BINDING:()=>b.FSc,GL_SAMPLER_CUBE:()=>b.vUb,GL_SAMPLER_CUBE_SHADOW:()=>b.rWQ,GL_SAMPLES:()=>b.L_4,GL_SAMPLE_ALPHA_TO_COVERAGE:()=>b.oIP,GL_SAMPLE_BUFFERS:()=>b.Od7,GL_SAMPLE_COVERAGE:()=>b.Nu1,GL_SAMPLE_COVERAGE_INVERT:()=>b.JGk,GL_SAMPLE_COVERAGE_VALUE:()=>b.VJW,GL_SCISSOR_BOX:()=>b.LCZ,GL_SCISSOR_TEST:()=>b.iku,GL_SEPARATE_ATTRIBS:()=>b.ixi,GL_SHADER_TYPE:()=>b.wrZ,GL_SHADING_LANGUAGE_VERSION:()=>b.SFW,GL_SIGNALED:()=>b._M2,GL_SIGNED_NORMALIZED:()=>b.oiY,GL_SRC_ALPHA:()=>b.B3l,GL_SRC_ALPHA_SATURATE:()=>b.JRp,GL_SRC_COLOR:()=>b.o9e,GL_SRGB:()=>b.GTV,GL_SRGB8:()=>b.LQI,GL_SRGB8_ALPHA8:()=>b.TsT,GL_SRGB8_ALPHA8_EXT:()=>b.SNQ,GL_SRGB_ALPHA_EXT:()=>b.VFW,GL_SRGB_EXT:()=>b.Hjq,GL_STATIC_COPY:()=>b.yZh,GL_STATIC_DRAW:()=>b.o4I,GL_STATIC_READ:()=>b.Spp,GL_STENCIL:()=>b.EH4,GL_STENCIL_ATTACHMENT:()=>b.m88,GL_STENCIL_BACK_FAIL:()=>b._5_,GL_STENCIL_BACK_FUNC:()=>b.xR7,GL_STENCIL_BACK_PASS_DEPTH_FAIL:()=>b.WK5,GL_STENCIL_BACK_PASS_DEPTH_PASS:()=>b.PNz,GL_STENCIL_BACK_REF:()=>b.hoP,GL_STENCIL_BACK_VALUE_MASK:()=>b.n0B,GL_STENCIL_BACK_WRITEMASK:()=>b.Z$r,GL_STENCIL_BITS:()=>b.ad4,GL_STENCIL_BUFFER_BIT:()=>b.BbZ,GL_STENCIL_CLEAR_VALUE:()=>b.zSL,GL_STENCIL_FAIL:()=>b.wce,GL_STENCIL_FUNC:()=>b.Qbd,GL_STENCIL_INDEX:()=>b.OBi,GL_STENCIL_INDEX8:()=>b.VX_,GL_STENCIL_PASS_DEPTH_FAIL:()=>b.O5p,GL_STENCIL_PASS_DEPTH_PASS:()=>b.OiW,GL_STENCIL_REF:()=>b.nVM,GL_STENCIL_TEST:()=>b.lxv,GL_STENCIL_VALUE_MASK:()=>b.b6i,GL_STENCIL_WRITEMASK:()=>b.Q$q,GL_STREAM_COPY:()=>b.kMJ,GL_STREAM_DRAW:()=>b.RIC,GL_STREAM_READ:()=>b.BTT,GL_SUBPIXEL_BITS:()=>b.xp,GL_SYNC_CONDITION:()=>b.vHc,GL_SYNC_FENCE:()=>b.YoK,GL_SYNC_FLAGS:()=>b.lF1,GL_SYNC_FLUSH_COMMANDS_BIT:()=>b.tFw,GL_SYNC_GPU_COMMANDS_COMPLETE:()=>b.z8r,GL_SYNC_STATUS:()=>b.wm0,GL_TEXTURE:()=>b.p8j,GL_TEXTURE0:()=>b.Lmx,GL_TEXTURE1:()=>b.ZrN,GL_TEXTURE10:()=>b.M1Q,GL_TEXTURE11:()=>b.nPy,GL_TEXTURE12:()=>b.SX1,GL_TEXTURE13:()=>b.pYl,GL_TEXTURE14:()=>b.EPR,GL_TEXTURE15:()=>b.kpL,GL_TEXTURE16:()=>b.RjA,GL_TEXTURE17:()=>b.uJm,GL_TEXTURE18:()=>b.Wtd,GL_TEXTURE19:()=>b.emu,GL_TEXTURE2:()=>b.Ehj,GL_TEXTURE20:()=>b.iVc,GL_TEXTURE21:()=>b.Bvy,GL_TEXTURE22:()=>b.pJJ,GL_TEXTURE23:()=>b.WQq,GL_TEXTURE24:()=>b.AC$,GL_TEXTURE25:()=>b.jol,GL_TEXTURE26:()=>b.kOB,GL_TEXTURE27:()=>b.RO1,GL_TEXTURE28:()=>b.Uu$,GL_TEXTURE29:()=>b.Kwr,GL_TEXTURE3:()=>b._mt,GL_TEXTURE30:()=>b.SEn,GL_TEXTURE31:()=>b.Guy,GL_TEXTURE4:()=>b.OG0,GL_TEXTURE5:()=>b.PHR,GL_TEXTURE6:()=>b.vC$,GL_TEXTURE7:()=>b.uzX,GL_TEXTURE8:()=>b.Ac_,GL_TEXTURE9:()=>b.Rtt,GL_TEXTURE_2D:()=>b.CbE,GL_TEXTURE_2D_ARRAY:()=>b.k0l,GL_TEXTURE_3D:()=>b.FU3,GL_TEXTURE_BASE_LEVEL:()=>b.qz_,GL_TEXTURE_BINDING_2D:()=>b.Fp$,GL_TEXTURE_BINDING_2D_ARRAY:()=>b.alV,GL_TEXTURE_BINDING_3D:()=>b.M0H,GL_TEXTURE_BINDING_CUBE_MAP:()=>b.YZ8,GL_TEXTURE_COMPARE_FUNC:()=>b.n3r,GL_TEXTURE_COMPARE_MODE:()=>b.dUx,GL_TEXTURE_CUBE_MAP:()=>b.oHN,GL_TEXTURE_CUBE_MAP_NEGATIVE_X:()=>b.KZB,GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:()=>b.Q4l,GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:()=>b.QJs,GL_TEXTURE_CUBE_MAP_POSITIVE_X:()=>b.tkF,GL_TEXTURE_CUBE_MAP_POSITIVE_Y:()=>b.AE4,GL_TEXTURE_CUBE_MAP_POSITIVE_Z:()=>b.UP3,GL_TEXTURE_IMMUTABLE_FORMAT:()=>b.YCj,GL_TEXTURE_IMMUTABLE_LEVELS:()=>b.cds,GL_TEXTURE_MAG_FILTER:()=>b.c6V,GL_TEXTURE_MAX_ANISOTROPY_EXT:()=>b.bmu,GL_TEXTURE_MAX_LEVEL:()=>b.JqA,GL_TEXTURE_MAX_LOD:()=>b.Yz$,GL_TEXTURE_MIN_FILTER:()=>b.Bc6,GL_TEXTURE_MIN_LOD:()=>b.RDW,GL_TEXTURE_WRAP_R:()=>b.gbE,GL_TEXTURE_WRAP_S:()=>b.OoY,GL_TEXTURE_WRAP_T:()=>b.heo,GL_TIMEOUT_EXPIRED:()=>b.aK$,GL_TIMEOUT_IGNORED:()=>b.eke,GL_TIMESTAMP_EXT:()=>b.Qt8,GL_TIME_ELAPSED_EXT:()=>b.sr4,GL_TRANSFORM_FEEDBACK:()=>b.Sa0,GL_TRANSFORM_FEEDBACK_ACTIVE:()=>b.vWN,GL_TRANSFORM_FEEDBACK_BINDING:()=>b.C6I,GL_TRANSFORM_FEEDBACK_BUFFER:()=>b.AQZ,GL_TRANSFORM_FEEDBACK_BUFFER_BINDING:()=>b.x6H,GL_TRANSFORM_FEEDBACK_BUFFER_MODE:()=>b.H2K,GL_TRANSFORM_FEEDBACK_BUFFER_SIZE:()=>b.f5L,GL_TRANSFORM_FEEDBACK_BUFFER_START:()=>b.ILt,GL_TRANSFORM_FEEDBACK_PAUSED:()=>b.ccF,GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:()=>b.VYu,GL_TRANSFORM_FEEDBACK_VARYINGS:()=>b.y3j,GL_TRIANGLES:()=>b.FgH,GL_TRIANGLE_FAN:()=>b.vtI,GL_TRIANGLE_STRIP:()=>b.uCq,GL_UNIFORM_ARRAY_STRIDE:()=>b.qWZ,GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS:()=>b.t75,GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:()=>b.Kzi,GL_UNIFORM_BLOCK_BINDING:()=>b.tNI,GL_UNIFORM_BLOCK_DATA_SIZE:()=>b.zfW,GL_UNIFORM_BLOCK_INDEX:()=>b.mcF,GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:()=>b.Nyi,GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:()=>b.sxC,GL_UNIFORM_BUFFER:()=>b.q__,GL_UNIFORM_BUFFER_BINDING:()=>b.DBb,GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT:()=>b.mMN,GL_UNIFORM_BUFFER_SIZE:()=>b.rve,GL_UNIFORM_BUFFER_START:()=>b.o7C,GL_UNIFORM_IS_ROW_MAJOR:()=>b.HM$,GL_UNIFORM_MATRIX_STRIDE:()=>b.mS1,GL_UNIFORM_OFFSET:()=>b.xUI,GL_UNIFORM_SIZE:()=>b.djG,GL_UNIFORM_TYPE:()=>b.Kn4,GL_UNMASKED_RENDERER_WEBGL:()=>b.jGD,GL_UNMASKED_VENDOR_WEBGL:()=>b.ycd,GL_UNPACK_ALIGNMENT:()=>b.GM3,GL_UNPACK_COLORSPACE_CONVERSION_WEBGL:()=>b.XxT,GL_UNPACK_FLIP_Y_WEBGL:()=>b.PYx,GL_UNPACK_IMAGE_HEIGHT:()=>b.EVZ,GL_UNPACK_PREMULTIPLY_ALPHA_WEBGL:()=>b.WYY,GL_UNPACK_ROW_LENGTH:()=>b.m7j,GL_UNPACK_SKIP_IMAGES:()=>b.SK7,GL_UNPACK_SKIP_PIXELS:()=>b.YrP,GL_UNPACK_SKIP_ROWS:()=>b.bd_,GL_UNSIGNALED:()=>b.n9O,GL_UNSIGNED_INT_10F_11F_11F_REV:()=>b.nQ9,GL_UNSIGNED_INT_24_8:()=>b.bTv,GL_UNSIGNED_INT_24_8_WEBGL:()=>b.iyB,GL_UNSIGNED_INT_2_10_10_10_REV:()=>b.LX0,GL_UNSIGNED_INT_5_9_9_9_REV:()=>b.vEp,GL_UNSIGNED_INT_SAMPLER_2D:()=>b.Zx4,GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:()=>b.yd2,GL_UNSIGNED_INT_SAMPLER_3D:()=>b.ZtN,GL_UNSIGNED_INT_SAMPLER_CUBE:()=>b.lg3,GL_UNSIGNED_INT_VEC2:()=>b.DAo,GL_UNSIGNED_INT_VEC3:()=>b.TAU,GL_UNSIGNED_INT_VEC4:()=>b.Ki3,GL_UNSIGNED_NORMALIZED:()=>b.Dr$,GL_UNSIGNED_NORMALIZED_EXT:()=>b.$z8,GL_VALIDATE_STATUS:()=>b.eQR,GL_VENDOR:()=>b.zSP,GL_VERSION:()=>b.$bm,GL_VERTEX_ARRAY_BINDING:()=>b.RGR,GL_VERTEX_ARRAY_BINDING_OES:()=>b.fsT,GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:()=>b.HRE,GL_VERTEX_ATTRIB_ARRAY_DIVISOR:()=>b.LUh,GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:()=>b.C9t,GL_VERTEX_ATTRIB_ARRAY_ENABLED:()=>b.I4M,GL_VERTEX_ATTRIB_ARRAY_INTEGER:()=>b.XZ2,GL_VERTEX_ATTRIB_ARRAY_NORMALIZED:()=>b.s7G,GL_VERTEX_ATTRIB_ARRAY_POINTER:()=>b.bsK,GL_VERTEX_ATTRIB_ARRAY_SIZE:()=>b.vEN,GL_VERTEX_ATTRIB_ARRAY_STRIDE:()=>b.cqm,GL_VERTEX_ATTRIB_ARRAY_TYPE:()=>b.eFf,GL_VERTEX_SHADER:()=>b.lQo,GL_VIEWPORT:()=>b.Ith,GL_WAIT_FAILED:()=>b.GIj,GL_ZERO:()=>b._sJ,GetComponentFromEntities:()=>e.swI,Gizmo:()=>e.tb4,GlobalDataRepository:()=>e.$jt,GlobalRetarget:()=>e.B5B,GlobalRetargetReverse:()=>e.GZk,Gltf2Exporter:()=>e.ObQ,Gltf2Importer:()=>e.Zb6,GltfImporter:()=>e.j6Y,GreaterShaderNode:()=>e.imh,Grid:()=>e.rjZ,HdriFormat:()=>e.czt,INPUT_HANDLING_STATE_CAMERA_CONTROLLER:()=>e.jOP,INPUT_HANDLING_STATE_GIZMO_SCALE:()=>e.K2G,INPUT_HANDLING_STATE_GIZMO_TRANSLATION:()=>e.KQz,INPUT_HANDLING_STATE_NONE:()=>e.Tr1,IShape:()=>e.ALp,IdentityMatrix33:()=>e.cmF,IdentityMatrix44:()=>e.aqQ,IfStatementShader:()=>f.p,IfStatementShaderNode:()=>e.uP$,ImageUtil:()=>e.LkB,InputManager:()=>e.$tz,Is:()=>e.Is,IsObj:()=>e.V5,Joint:()=>e.d90,KTX2TextureLoader:()=>y.N,LightComponent:()=>e.r0A,LightGizmo:()=>e.SUW,LightType:()=>e.vBC,Line:()=>e.x12,LocatorGizmo:()=>e.klP,LogQuaternion:()=>e.lW,MToonMaterialContent:()=>e.fQ$,MatCapMaterialContent:()=>e.Svh,Material:()=>e.F5T,MaterialHelper:()=>e.G$p,MaterialRepository:()=>e.rFg,MathClassUtil:()=>e.Db6,MathUtil:()=>e.kj,Matrix22:()=>e.ak,Matrix33:()=>e.haE,Matrix44:()=>e.Jeh,MemoryManager:()=>e.B_3,Mesh:()=>e.Kj0,MeshComponent:()=>e.$tA,MeshHelper:()=>e.tVI,MeshRendererComponent:()=>e.YZ_,MiscUtil:()=>e.KfE,ModelConverter:()=>e.eDb,ModuleManager:()=>e.xJl,MultiplyShaderNode:()=>e.P4J,MutableColorRgb:()=>e.CEM,MutableColorRgba:()=>e.l$X,MutableMatrix22:()=>e.f7L,MutableMatrix33:()=>e.xkj,MutableMatrix44:()=>e.ecr,MutableQuaternion:()=>e.yGy,MutableScalar:()=>e.DUM,MutableScalar_:()=>e.EtM,MutableScalard:()=>e.$_9,MutableVector2:()=>e.NRp,MutableVector2_:()=>e.elw,MutableVector2d:()=>e.th1,MutableVector3:()=>e.d6n,MutableVector3_:()=>e.I18,MutableVector3d:()=>e.oVE,MutableVector4:()=>e.xQg,MutableVector4_:()=>e.e2p,MutableVector4d:()=>e.hnX,None:()=>e.Hq9,NormalMatrixShaderNode:()=>e.fbG,NormalizeShaderNode:()=>e.dHi,OimoPhysicsStrategy:()=>e.qiF,Ok:()=>e.Ok,Option:()=>e.Wxm,OrbitCameraController:()=>e.jfW,OutColorShaderNode:()=>e.y8Z,OutPositionShaderNode:()=>e.Nus,PhysicsComponent:()=>e.ZeV,PixelFormat:()=>e.VIj,Plane:()=>e.JOQ,Primitive:()=>e.WV0,PrimitiveMode:()=>e.TcR,PrimitiveSortKey_BitLength_Depth:()=>e.Qob,PrimitiveSortKey_BitLength_Material:()=>e.xzx,PrimitiveSortKey_BitLength_PrimitiveType:()=>e.aKP,PrimitiveSortKey_BitLength_TranslucencyType:()=>e.IMH,PrimitiveSortKey_BitOffset_Material:()=>e.V_R,PrimitiveSortKey_BitOffset_PrimitiveType:()=>e.Y1P,PrimitiveSortKey_BitOffset_TranslucencyType:()=>e.Yxr,PrimitiveSortKey_BitOffset_ViewportLayer:()=>e.BHz,ProcessApproach:()=>e.V7o,ProcessApproachClass:()=>e.yvy,ProcessStage:()=>e.Iqz,ProjectionMatrixShaderNode:()=>e.DEK,Quaternion:()=>e._fP,RenderBuffer:()=>e.NiD,RenderBufferTarget:()=>e.G22,RenderPass:()=>e.CDd,RenderPassHelper:()=>e.$Og,RenderTargetTexture:()=>e._iX,RenderableHelper:()=>e.L0o,RhodoniteImportExtension:()=>e.zYy,RnException:()=>e.MrI,RnObject:()=>e.S7_,RnPromise:()=>e.niV,Sampler:()=>e.Z46,Scalar:()=>e.Rus,ScalarToVector4ShaderNode:()=>e.udm,Scalar_:()=>e.apw,Scalard:()=>e.kOh,ScaleGizmo:()=>e.que,SceneGraphComponent:()=>e.aj7,ShaderGraphResolver:()=>e.dBk,ShaderNode:()=>e.Zp7,ShaderSemantics:()=>e.f5e,ShaderSemanticsClass:()=>e.wyA,ShaderType:()=>e.HoG,ShaderVariableType:()=>e.LvG,ShaderVariableUpdateInterval:()=>e.axw,ShaderityMaterialContent:()=>e.unQ,ShaderityUtilityWebGL:()=>e.uQo,ShadingModel:()=>e.DAE,ShadowMap:()=>e.l6Z,ShadowMapDecodeClassicMaterialContent:()=>e.RKA,SimpleVertexAttribute:()=>e.OCV,SkeletalComponent:()=>e.YbW,Some:()=>e.bDM,Sphere:()=>e.aLr,SphereCollider:()=>e.BMK,SymbolWeakMap:()=>e.bsk,SynthesizeHdrMaterialContent:()=>e.dob,System:()=>e.xP7,SystemState:()=>e.lBd,TagGltf2NodeIndex:()=>b.j3U,Texture:()=>e.xEZ,TextureDataFloat:()=>e.h36,TextureFetchMaterialNode:()=>e.IW4,TextureFetchShader:()=>p.S,TextureParameter:()=>e.dIQ,Time:()=>e.qpU,Transform3D:()=>e.WQ0,TransformComponent:()=>e.Uvn,TranslationGizmo:()=>e.ug2,UniformDataShader:()=>v.$,UniformDataShaderNode:()=>e.X1h,VERSION:()=>R,VRMColliderGroup:()=>e.Dit,VRMSpring:()=>e.U4t,VRMSpringBone:()=>e.$bl,VRMSpringBonePhysicsStrategy:()=>e.tM2,VarianceShadowMapDecodeClassicMaterialContent:()=>e.Q_Q,VaryingInVariableShaderNode:()=>e.hLT,VaryingOutVariableShaderNode:()=>e.H9W,VaryingVariableShader:()=>A.e,Vector2:()=>e.FM8,Vector2_:()=>e.pV,Vector2d:()=>e.EYs,Vector3:()=>e.Pa4,Vector3AndScalarToVector4ShaderNode:()=>e.TaZ,Vector3_:()=>e.pg_,Vector3d:()=>e.UJ,Vector4:()=>e.Ltg,Vector4_:()=>e.rEL,Vector4d:()=>e.Tjf,VectorN:()=>e.j8u,VertexAttribute:()=>e.TaT,VertexAttributeClass:()=>e.x$u,VideoTexture:()=>e.fO1,ViewMatrixShaderNode:()=>e.UaW,Visibility:()=>e.EEb,Vrm0xImporter:()=>e.ao$,VrmComponent:()=>e.ZAV,VrmImporter:()=>e.pbL,VrmaImporter:()=>e.vTZ,WalkThroughCameraController:()=>e.IsZ,WeakNone:()=>e.Lq7,WeakOption:()=>e.lIh,WeakSome:()=>e.Bxs,WebGLContextWrapper:()=>t.d,WebGLExtension:()=>n.c,WebGLResourceRepository:()=>i.x,WebGLStrategyDataTexture:()=>a.X,WebGLStrategyUniform:()=>r.I,WebGpuDeviceWrapper:()=>x.V,WebGpuResourceRepository:()=>g.g,WebGpuStrategyBasic:()=>I.p,WebXRSystem:()=>S.X,WellKnownComponentTIDs:()=>e.zzN,WireframeMaterialNode:()=>e.sqk,WorldMatrixShaderNode:()=>e.KRN,_from:()=>e.lim,_fromString:()=>e.cuJ,_fromStringCaseSensitively:()=>e.bmc,_getPropertyIndex:()=>e.VlM,_getPropertyIndex2:()=>e.ULo,add2:()=>e.Zzs,add2_offset:()=>e.TLr,add3:()=>e.sZE,add3_offset:()=>e.jIe,add4:()=>e.F5f,add4_offset:()=>e.vPp,addLineNumberToCode:()=>e._zI,applyMixins:()=>e.efS,array3_lerp_offsetAsComposition:()=>e.to5,arrayN_lerp_offsetAsComposition:()=>e.wrt,assertDoesNotHave:()=>e.Waq,assertExist:()=>e.dKe,assertHas:()=>e.ZzZ,assertIsErr:()=>e.Z65,assertIsOk:()=>e.UDi,calcAlignedByteLength:()=>e.Kyk,combineImages:()=>e.U28,convertHTMLImageElementToCanvas:()=>e.ABp,createAndAddGltf2BufferView:()=>e.CTh,createEffekseer:()=>e.OHV,createMotionController:()=>T.RQ,deepCopyUsingJsonStringify:()=>e.j37,defaultAnimationTrackName:()=>e.vAU,defaultValue:()=>e.LSm,detectFormatByArrayBuffers:()=>e.Dhi,detectFormatByUri:()=>e.jeP,downloadArrayBuffer:()=>e.CWu,downloadTypedArray:()=>e.$z2,dummyAnisotropyTexture:()=>e.Lx$,dummyBlackCubeTexture:()=>e.pnp,dummyBlackTexture:()=>e.mge,dummyBlueTexture:()=>e.$RV,dummySRGBGrayTexture:()=>e.GVY,dummyWhiteTexture:()=>e.Dx8,enhanceArray:()=>e.OTk,fromTensorToCompositionType:()=>b.bup,get1:()=>e.nnL,get1_offset:()=>e.w08,get1_offsetAsComposition:()=>e.GWg,get2:()=>e.t5w,get2_offset:()=>e.vk8,get2_offsetAsComposition:()=>e.PFe,get3:()=>e.Ffi,get3_offset:()=>e.Upt,get3_offsetAsComposition:()=>e.Dq2,get4:()=>e.VIV,get4_offset:()=>e.hxV,get4_offsetAsComposition:()=>e.JIQ,getEvent:()=>e.EYp,getMotionController:()=>T.sz,getN_offset:()=>e.fKE,getN_offsetAsComposition:()=>e.lxk,getWebXRSystem:()=>w,greaterThan:()=>e.tSN,ifDefinedThen:()=>e.JxS,ifDefinedThenWithReturn:()=>e.t0P,ifExistsThen:()=>e.fK9,ifExistsThenWithReturn:()=>e.OBD,ifNotExistsThen:()=>e.bhs,ifNotExistsThenWithReturn:()=>e.ZsA,ifUndefinedThen:()=>e.fYc,ifUndefinedThenWithReturn:()=>e.eD0,initDefaultTextures:()=>e.Cb2,isMaterialsSetup:()=>e.iCj,isSameGlTF2TextureSampler:()=>b.CLY,isSkipDrawing:()=>e.lsI,lessThan:()=>e.QjB,mulArray3WithScalar_offset:()=>e.nsy,mulArray4WithScalar_offset:()=>e.p8g,mulArrayNWithScalar_offset:()=>e.n5i,mulThatAndThisToOutAsMat44_offsetAsComposition:()=>e.QUJ,normalizeArray4:()=>e.XgD,nullishToEmptyArray:()=>e.vVE,nullishToEmptyMap:()=>e.YUA,objectCachify:()=>e.ozT,primitiveCachify1:()=>e.EY5,qlerp_offsetAsComposition:()=>e.Rlh,scalar_lerp_offsetAsComposition:()=>e._7O,setupShaderProgramForMeshComponent:()=>o.M,sheenLutTexture:()=>e.NBV,updateGamePad:()=>T.KA,updateMotionControllerModel:()=>T._0,updateVBOAndVAO:()=>e.PjQ,valueWithCompensation:()=>e.wv6,valueWithDefault:()=>e.kSU});var e=__webpack_require__(8583),t=__webpack_require__(5551),n=__webpack_require__(3346),i=__webpack_require__(3952),o=__webpack_require__(6406),a=__webpack_require__(9430),r=__webpack_require__(6042),s=(__webpack_require__(3007),__webpack_require__(836)),l=__webpack_require__(2647),c=__webpack_require__(5211),_=__webpack_require__(3258),h=__webpack_require__(3591);class u extends s.m{constructor(){super(),this.vertexShaderBody="\n\n\n "}static getInstance(){return this.__instance||(this.__instance=new u),this.__instance}get vertexShaderDefinitions(){return"\n\n"}get pixelShaderDefinitions(){return`\nuniform int u_shadingModel;\nuniform float u_shininess;\n\nstruct Light {\n vec4 lightPosition;\n vec4 lightDirection;\n vec4 lightIntensity;\n};\nuniform Light u_lights[${_.D.maxLightNumberInShader}];\nuniform int u_lightNumber;\nuniform vec3 u_viewPosition;\n\n\nbool classicShading(\n in vec3 diffuseColor,\n in vec3 position_inWorld,\n in vec3 normal_inWorld,\n out vec3 outColor\n )\n{\n // Lighting\n outColor = vec3(0.0, 0.0, 0.0);\n if (u_shadingModel > 0) {\n\n vec3 diffuse = vec3(0.0, 0.0, 0.0);\n vec3 specular = vec3(0.0, 0.0, 0.0);\n for (int i = 0; i < ${_.D.maxLightNumberInShader}; i++) {\n if (i >= u_lightNumber) {\n break;\n }\n\n vec3 lightDirection = u_lights[i].lightDirection.xyz;\n float lightType = u_lights[i].lightPosition.w;\n float spotCosCutoff = u_lights[i].lightDirection.w;\n float spotExponent = u_lights[i].lightIntensity.w;\n\n if (0.75 < lightType) { // is pointlight or spotlight\n lightDirection = normalize(u_lights[i].lightPosition.xyz - position_inWorld.xyz);\n }\n float spotEffect = 1.0;\n if (lightType > 1.75) { // is spotlight\n spotEffect = dot(u_lights[i].lightDirection.xyz, lightDirection);\n if (spotEffect > spotCosCutoff) {\n spotEffect = pow(spotEffect, spotExponent);\n } else {\n spotEffect = 0.0;\n }\n }\n\n vec3 incidentLight = spotEffect * u_lights[i].lightIntensity.xyz;\n// incidentLight *= M_PI;\n\n normal_inWorld = normalize(normal_inWorld);\n\n diffuse += diffuseColor * max(0.0, dot(normal_inWorld, lightDirection)) * incidentLight;\n\n if (u_shadingModel == 2) {// BLINN\n // ViewDirection\n vec3 viewDirection = normalize(u_viewPosition - position_inWorld.xyz);\n vec3 halfVector = normalize(lightDirection + viewDirection);\n specular += pow(max(0.0, dot(halfVector, normal_inWorld)), u_shininess);\n } else if (u_shadingModel == 3) { // PHONG\n vec3 viewDirection = normalize(u_viewPosition - position_inWorld.xyz);\n vec3 R = reflect(lightDirection, normal_inWorld);\n specular += pow(max(0.0, dot(R, viewDirection)), u_shininess);\n }\n\n }\n\n outColor = diffuse + specular;\n } else {\n outColor = diffuseColor;\n }\n}\n\n `}get pixelShaderBody(){return""}get attributeNames(){return[]}get attributeSemantics(){return[]}get attributeCompositions(){return[]}}u.materialElement=h.Z.PBRShading;var d=__webpack_require__(9214),m=__webpack_require__(4212),f=__webpack_require__(4109),p=__webpack_require__(6796),v=__webpack_require__(204),A=__webpack_require__(9071),y=__webpack_require__(3667),x=__webpack_require__(3870),g=__webpack_require__(1193),I=__webpack_require__(2161),b=__webpack_require__(10),E=__webpack_require__(8107),T=__webpack_require__(5514),S=__webpack_require__(2102),C=__webpack_require__(2251);function w(){return C.x.getInstance().getModule("xr").WebXRSystem.getInstance()}__webpack_require__(9131);const R=__webpack_require__(5337).Z})(),Rn=__webpack_exports__})(); \ No newline at end of file