UNPKG

@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.

176 lines (167 loc) 6.02 kB
import { S as ShaderStore } from './index-FzOfPXLV.esm.js'; // Do not edit. const name$7 = "uvAttributeDeclaration"; const shader$7 = `#ifdef UV{X} attribute uv{X}: vec2f; #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name$7]) { ShaderStore.IncludesShadersStoreWGSL[name$7] = shader$7; } // Do not edit. const name$6 = "prePassVertexDeclaration"; const shader$6 = `#ifdef PREPASS #ifdef PREPASS_LOCAL_POSITION varying vPosition : vec3f; #endif #ifdef PREPASS_DEPTH varying vViewPos: vec3f; #endif #ifdef PREPASS_NORMALIZED_VIEW_DEPTH varying vNormViewDepth: f32; #endif #if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) uniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f; #endif #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name$6]) { ShaderStore.IncludesShadersStoreWGSL[name$6] = shader$6; } // Do not edit. const name$5 = "samplerVertexDeclaration"; const shader$5 = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0 varying v_VARYINGNAME_UV: vec2f; #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name$5]) { ShaderStore.IncludesShadersStoreWGSL[name$5] = shader$5; } // Do not edit. const name$4 = "bumpVertexDeclaration"; const shader$4 = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC) #if defined(TANGENT) && defined(NORMAL) varying vTBN0: vec3f;varying vTBN1: vec3f;varying vTBN2: vec3f; #endif #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name$4]) { ShaderStore.IncludesShadersStoreWGSL[name$4] = shader$4; } // Do not edit. const name$3 = "prePassVertex"; const shader$3 = `#ifdef PREPASS_DEPTH vertexOutputs.vViewPos=(scene.view*worldPos).rgb; #endif #ifdef PREPASS_NORMALIZED_VIEW_DEPTH vertexOutputs.vNormViewDepth=((scene.view*worldPos).z-uniforms.cameraInfo.x)/(uniforms.cameraInfo.y-uniforms.cameraInfo.x); #endif #ifdef PREPASS_LOCAL_POSITION vertexOutputs.vPosition=positionUpdated.xyz; #endif #if (defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)) && defined(BONES_VELOCITY_ENABLED) vertexOutputs.vCurrentPosition=scene.viewProjection*worldPos; #if NUM_BONE_INFLUENCERS>0 var previousInfluence: mat4x4f;previousInfluence=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0]; #if NUM_BONE_INFLUENCERS>1 previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1]; #endif #if NUM_BONE_INFLUENCERS>2 previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2]; #endif #if NUM_BONE_INFLUENCERS>3 previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3]; #endif #if NUM_BONE_INFLUENCERS>4 previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0]; #endif #if NUM_BONE_INFLUENCERS>5 previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1]; #endif #if NUM_BONE_INFLUENCERS>6 previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2]; #endif #if NUM_BONE_INFLUENCERS>7 previousInfluence+=uniforms.mPreviousBones[ i32(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3]; #endif vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0); #else vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0); #endif #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name$3]) { ShaderStore.IncludesShadersStoreWGSL[name$3] = shader$3; } // Do not edit. const name$2 = "uvVariableDeclaration"; const shader$2 = `#ifdef MAINUV{X} #if !defined(UV{X}) var uv{X}: vec2f=vec2f(0.,0.); #else var uv{X}: vec2f=vertexInputs.uv{X}; #endif vertexOutputs.vMainUV{X}=uv{X}; #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name$2]) { ShaderStore.IncludesShadersStoreWGSL[name$2] = shader$2; } // Do not edit. const name$1 = "samplerVertexImplementation"; const shader$1 = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0 if (uniforms.v_INFONAME_==0.) {vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uvUpdated,1.0,0.0)).xy;} #ifdef UV2 else if (uniforms.v_INFONAME_==1.) {vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uv2Updated,1.0,0.0)).xy;} #endif #ifdef UV3 else if (uniforms.v_INFONAME_==2.) {vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv3,1.0,0.0)).xy;} #endif #ifdef UV4 else if (uniforms.v_INFONAME_==3.) {vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv4,1.0,0.0)).xy;} #endif #ifdef UV5 else if (uniforms.v_INFONAME_==4.) {vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv5,1.0,0.0)).xy;} #endif #ifdef UV6 else if (uniforms.v_INFONAME_==5.) {vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv6,1.0,0.0)).xy;} #endif #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name$1]) { ShaderStore.IncludesShadersStoreWGSL[name$1] = shader$1; } // Do not edit. const name = "vertexColorMixing"; const shader = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) vertexOutputs.vColor=vec4f(1.0); #ifdef VERTEXCOLOR #ifdef VERTEXALPHA vertexOutputs.vColor*=vertexInputs.color; #else vertexOutputs.vColor=vec4f(vertexOutputs.vColor.rgb*vertexInputs.color.rgb,vertexOutputs.vColor.a); #endif #endif #ifdef INSTANCESCOLOR vertexOutputs.vColor*=vertexInputs.instanceColor; #endif #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name]) { ShaderStore.IncludesShadersStoreWGSL[name] = shader; } //# sourceMappingURL=vertexColorMixing-DiAAfHEs.esm.js.map