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.

60 lines (56 loc) 2.42 kB
import { S as ShaderStore } from './index-MZPybX0H.esm.js'; // Do not edit. const name$1 = "bakedVertexAnimationDeclaration"; const shader$1 = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE uniform bakedVertexAnimationTime: f32;uniform bakedVertexAnimationSettings: vec4<f32>;var bakedVertexAnimationTexture : texture_2d<f32>; #ifdef INSTANCES attribute bakedVertexAnimationSettingsInstanced : vec4<f32>; #endif fn readMatrixFromRawSamplerVAT(smp : texture_2d<f32>,index : f32,frame : f32)->mat4x4<f32> {let offset=i32(index)*4;let frameUV=i32(frame);let m0=textureLoad(smp,vec2<i32>(offset+0,frameUV),0);let m1=textureLoad(smp,vec2<i32>(offset+1,frameUV),0);let m2=textureLoad(smp,vec2<i32>(offset+2,frameUV),0);let m3=textureLoad(smp,vec2<i32>(offset+3,frameUV),0);return mat4x4<f32>(m0,m1,m2,m3);} #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name$1]) { ShaderStore.IncludesShadersStoreWGSL[name$1] = shader$1; } /** @internal */ const bakedVertexAnimationDeclarationWGSL = { name: name$1, shader: shader$1 }; // Do not edit. const name = "instancesVertex"; const shader = `#ifdef INSTANCES var finalWorld=mat4x4<f32>(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3); #if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR) var finalPreviousWorld=mat4x4<f32>( vertexInputs.previousWorld0,vertexInputs.previousWorld1, vertexInputs.previousWorld2,vertexInputs.previousWorld3); #endif #ifdef THIN_INSTANCES #if !defined(WORLD_UBO) finalWorld=uniforms.world*finalWorld; #else finalWorld=mesh.world*finalWorld; #endif #if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR) finalPreviousWorld=uniforms.previousWorld*finalPreviousWorld; #endif #endif #else #if !defined(WORLD_UBO) var finalWorld=uniforms.world; #else var finalWorld=mesh.world; #endif #if defined(PREPASS_VELOCITY) || defined(VELOCITY) || defined(PREPASS_VELOCITY_LINEAR) || defined(VELOCITY_LINEAR) var finalPreviousWorld=uniforms.previousWorld; #endif #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name]) { ShaderStore.IncludesShadersStoreWGSL[name] = shader; } /** @internal */ const instancesVertexWGSL = { name, shader }; export { bakedVertexAnimationDeclarationWGSL as b, instancesVertexWGSL as i }; //# sourceMappingURL=instancesVertex-DMZ4QPzF.esm.js.map