bp-cloner
Version:
More info and explanations here - https://doc.babylonjs.com/communityExtensions/clonerSystem
189 lines (188 loc) • 8.14 kB
JavaScript
import { S as e } from "./index-7uRiSnMV.js";
const i = "uvAttributeDeclaration", a = `
attribute uv{X}: vec2f;
`;
e.IncludesShadersStoreWGSL[i] || (e.IncludesShadersStoreWGSL[i] = a);
const t = "prePassVertexDeclaration", c = `
varying vPosition : vec3f;
varying vViewPos: vec3f;
uniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
`;
e.IncludesShadersStoreWGSL[t] || (e.IncludesShadersStoreWGSL[t] = c);
const r = "samplerVertexDeclaration", h = `
varying v_VARYINGNAME_UV: vec2f;
`;
e.IncludesShadersStoreWGSL[r] || (e.IncludesShadersStoreWGSL[r] = h);
const s = "bumpVertexDeclaration", l = `
varying vTBN0: vec3f;varying vTBN1: vec3f;varying vTBN2: vec3f;
`;
e.IncludesShadersStoreWGSL[s] || (e.IncludesShadersStoreWGSL[s] = l);
const n = "lightVxUboDeclaration", S = `
struct Light{X}
{vLightData: vec4f,
vLightDiffuse: vec4f,
vLightSpecular: vec4f,
vLightDirection: vec4f,
vLightFalloff: vec4f,
vLightFalloff: vec4f,
vLightGround: vec3f,
vLightWidth: vec4f,
vLightHeight: vec4f,
shadowsInfo: vec4f,
depthValues: vec2f} ;var<uniform> light{X} : Light{X};
uniform lightMatrix{X}: array<mat4x4f,SHADOWCSMNUM_CASCADES{X}>;varying vPositionFromLight{X}_0: vec4f;varying vDepthMetric{X}_0: f32;varying vPositionFromLight{X}_1: vec4f;varying vDepthMetric{X}_1: f32;varying vPositionFromLight{X}_2: vec4f;varying vDepthMetric{X}_2: f32;varying vPositionFromLight{X}_3: vec4f;varying vDepthMetric{X}_3: f32;varying vPositionFromCamera{X}: vec4f;
varying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32;uniform lightMatrix{X}: mat4x4f;
`;
e.IncludesShadersStoreWGSL[n] || (e.IncludesShadersStoreWGSL[n] = S);
const f = "prePassVertex", E = `
vertexOutputs.vViewPos=(scene.view*worldPos).rgb;
vertexOutputs.vPosition=positionUpdated.xyz;
vertexOutputs.vCurrentPosition=scene.viewProjection*worldPos;
var previousInfluence: mat4x4f;previousInfluence=mPreviousBones[ i32(matricesIndices[0])]*matricesWeights[0];
previousInfluence+=mPreviousBones[ i32(matricesIndices[1])]*matricesWeights[1];
previousInfluence+=mPreviousBones[ i32(matricesIndices[2])]*matricesWeights[2];
previousInfluence+=mPreviousBones[ i32(matricesIndices[3])]*matricesWeights[3];
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);
vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);
`;
e.IncludesShadersStoreWGSL[f] || (e.IncludesShadersStoreWGSL[f] = E);
const o = "uvVariableDeclaration", _ = `
var uv{X}: vec2f=vec2f(0.,0.);
var uv{X}: vec2f=vertexInputs.uv{X};
vertexOutputs.vMainUV{X}=uv{X};
`;
e.IncludesShadersStoreWGSL[o] || (e.IncludesShadersStoreWGSL[o] = _);
const d = "samplerVertexImplementation", p = `
if (uniforms.v_INFONAME_==0.)
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uvUpdated,1.0,0.0)).xy;}
else if (uniforms.v_INFONAME_==1.)
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uv2Updated,1.0,0.0)).xy;}
else if (uniforms.v_INFONAME_==2.)
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv3,1.0,0.0)).xy;}
else if (uniforms.v_INFONAME_==3.)
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv4,1.0,0.0)).xy;}
else if (uniforms.v_INFONAME_==4.)
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv5,1.0,0.0)).xy;}
else if (uniforms.v_INFONAME_==5.)
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv6,1.0,0.0)).xy;}
`;
e.IncludesShadersStoreWGSL[d] || (e.IncludesShadersStoreWGSL[d] = p);
const v = "bumpVertex", m = `
var tbnNormal: vec3f=normalize(normalUpdated);var tbnTangent: vec3f=normalize(tangentUpdated.xyz);var tbnBitangent: vec3f=cross(tbnNormal,tbnTangent)*tangentUpdated.w;var matTemp= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz)* mat3x3f(tbnTangent,tbnBitangent,tbnNormal);vertexOutputs.vTBN0=matTemp[0];vertexOutputs.vTBN1=matTemp[1];vertexOutputs.vTBN2=matTemp[2];
`;
e.IncludesShadersStoreWGSL[v] || (e.IncludesShadersStoreWGSL[v] = m);
const u = "shadowsVertex", x = `
vertexOutputs.vPositionFromCamera{X}=scene.view*worldPos;
vertexOutputs.vPositionFromLight{X}_0=uniforms.lightMatrix{X}[0]*worldPos;
vertexOutputs.vDepthMetric{X}_0=(-vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;
vertexOutputs.vDepthMetric{X}_0= (vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;
vertexOutputs.vPositionFromLight{X}_1=uniforms.lightMatrix{X}[1]*worldPos;
vertexOutputs.vDepthMetric{X}_1=(-vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;
vertexOutputs.vDepthMetric{X}_1= (vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;
vertexOutputs.vPositionFromLight{X}_2=uniforms.lightMatrix{X}[2]*worldPos;
vertexOutputs.vDepthMetric{X}_2=(-vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;
vertexOutputs.vDepthMetric{X}_2= (vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;
vertexOutputs.vPositionFromLight{X}_3=uniforms.lightMatrix{X}[3]*worldPos;
vertexOutputs.vDepthMetric{X}_3=(-vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;
vertexOutputs.vDepthMetric{X}_3= (vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;
vertexOutputs.vPositionFromLight{X}=uniforms.lightMatrix{X}*worldPos;
vertexOutputs.vDepthMetric{X}=(-vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
vertexOutputs.vDepthMetric{X}=(vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
`;
e.IncludesShadersStoreWGSL[u] || (e.IncludesShadersStoreWGSL[u] = x);