@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
222 lines (213 loc) • 7.96 kB
JavaScript
import { S as ShaderStore } from './index-MZPybX0H.esm.js';
// Do not edit.
const name$6 = "uvAttributeDeclaration";
const shader$6 = `
attribute uv{X}: vec2f;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name$6]) {
ShaderStore.IncludesShadersStoreWGSL[name$6] = shader$6;
}
/** @internal */
const uvAttributeDeclarationWGSL = { name: name$6, shader: shader$6 };
// Do not edit.
const name$5 = "prePassVertexDeclaration";
const shader$5 = `
varying vPosition : vec3f;
varying vViewPos: vec3f;
varying vNormViewDepth: f32;
uniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name$5]) {
ShaderStore.IncludesShadersStoreWGSL[name$5] = shader$5;
}
/** @internal */
const prePassVertexDeclarationWGSL = { name: name$5, shader: shader$5 };
// Do not edit.
const name$4 = "samplerVertexDeclaration";
const shader$4 = `
varying v_VARYINGNAME_UV: vec2f;
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name$4]) {
ShaderStore.IncludesShadersStoreWGSL[name$4] = shader$4;
}
/** @internal */
const samplerVertexDeclarationWGSL = { name: name$4, shader: shader$4 };
// Do not edit.
const name$3 = "vertexPullingVertex";
const shader$3 = `
let vpVertexIndex: u32=vp_readVertexIndex(vertexInputs.vertexIndex);positionUpdated=vp_readPosition(uniforms.vp_position_info,vpVertexIndex);
normalUpdated=vp_readNormal(uniforms.vp_normal_info,vpVertexIndex);
tangentUpdated=vp_readTangent(uniforms.vp_tangent_info,vpVertexIndex);
uvUpdated=vp_readUV(uniforms.vp_uv_info,vpVertexIndex);
uv2Updated=vp_readUV2(uniforms.vp_uv2_info,vpVertexIndex);
var uv3Updated: vec2f=vp_readUV3(uniforms.vp_uv3_info,vpVertexIndex);
var uv4Updated: vec2f=vp_readUV4(uniforms.vp_uv4_info,vpVertexIndex);
var uv5Updated: vec2f=vp_readUV5(uniforms.vp_uv5_info,vpVertexIndex);
var uv6Updated: vec2f=vp_readUV6(uniforms.vp_uv6_info,vpVertexIndex);
colorUpdated=vp_readColor(uniforms.vp_color_info,vpVertexIndex);
let vp_basePosition: vec3f=positionUpdated;
let vp_baseNormal: vec3f=normalUpdated;
let vp_baseTangent: vec4f=tangentUpdated;
let vp_baseUV: vec2f=uvUpdated;
let vp_baseUV2: vec2f=uv2Updated;
let vp_baseColor: vec4f=colorUpdated;
var vp_matricesIndices: vec4f=vp_readBoneIndices(uniforms.vp_matricesIndices_info,vpVertexIndex);var vp_matricesWeights: vec4f=vp_readBoneWeights(uniforms.vp_matricesWeights_info,vpVertexIndex);
var vp_matricesIndicesExtra: vec4f=vp_readBoneIndicesExtra(uniforms.vp_matricesIndicesExtra_info,vpVertexIndex);var vp_matricesWeightsExtra: vec4f=vp_readBoneWeightsExtra(uniforms.vp_matricesWeightsExtra_info,vpVertexIndex);
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name$3]) {
ShaderStore.IncludesShadersStoreWGSL[name$3] = shader$3;
}
/** @internal */
const vertexPullingVertexWGSL = { name: name$3, shader: shader$3 };
// Do not edit.
const name$2 = "prePassVertex";
const shader$2 = `
vertexOutputs.vViewPos=(scene.view*worldPos).rgb;
vertexOutputs.vNormViewDepth=((scene.view*worldPos).z-uniforms.cameraInfo.x)/(uniforms.cameraInfo.y-uniforms.cameraInfo.x);
vertexOutputs.vPosition=positionUpdated.xyz;
vertexOutputs.vCurrentPosition=scene.viewProjection*worldPos;
var previousInfluence: mat4x4f;previousInfluence=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];
previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];
vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);
vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name$2]) {
ShaderStore.IncludesShadersStoreWGSL[name$2] = shader$2;
}
/** @internal */
const prePassVertexWGSL = { name: name$2, shader: shader$2 };
// Do not edit.
const name$1 = "uvVariableDeclaration";
const shader$1 = `
var uv{X}: vec2f=vec2f(0.,0.);
var uv{X}: vec2f=uv{X}Updated;
var uv{X}: vec2f=vertexInputs.uv{X};
vertexOutputs.vMainUV{X}=uv{X};
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name$1]) {
ShaderStore.IncludesShadersStoreWGSL[name$1] = shader$1;
}
/** @internal */
const uvVariableDeclarationWGSL = { name: name$1, shader: shader$1 };
// Do not edit.
const name = "samplerVertexImplementation";
const shader = `
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;}
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name]) {
ShaderStore.IncludesShadersStoreWGSL[name] = shader;
}
/** @internal */
const samplerVertexImplementationWGSL = { name, shader };
export { prePassVertexWGSL as a, uvVariableDeclarationWGSL as b, samplerVertexImplementationWGSL as c, prePassVertexDeclarationWGSL as p, samplerVertexDeclarationWGSL as s, uvAttributeDeclarationWGSL as u, vertexPullingVertexWGSL as v };
//# sourceMappingURL=samplerVertexImplementation-DHLJnHs8.esm.js.map