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.

61 lines (57 loc) 2.28 kB
import { S as ShaderStore } from './index-MZPybX0H.esm.js'; // Do not edit. const name$1 = "morphTargetsVertexGlobalDeclaration"; const shader$1 = `#ifdef MORPHTARGETS uniform morphTargetInfluences : array<f32,NUM_MORPH_INFLUENCERS>; #ifdef MORPHTARGETS_TEXTURE uniform morphTargetTextureIndices : array<f32,NUM_MORPH_INFLUENCERS>;uniform morphTargetTextureInfo : vec3<f32>;var morphTargets : texture_2d_array<f32>;fn readVector3FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec3<f32> { let textureWidth: i32=i32(uniforms.morphTargetTextureInfo.y);let y: i32=i32(vertexIndex)/textureWidth;let x: i32=i32(vertexIndex) % textureWidth;return textureLoad(morphTargets,vec2i(x,y),i32(uniforms.morphTargetTextureIndices[targetIndex]),0).xyz;} fn readVector4FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec4<f32> { let textureWidth: i32=i32(uniforms.morphTargetTextureInfo.y); let y: i32=i32(vertexIndex)/textureWidth;let x: i32=i32(vertexIndex) % textureWidth;return textureLoad(morphTargets,vec2i(x,y),i32(uniforms.morphTargetTextureIndices[targetIndex]),0);} #endif #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name$1]) { ShaderStore.IncludesShadersStoreWGSL[name$1] = shader$1; } /** @internal */ const morphTargetsVertexGlobalDeclarationWGSL = { name: name$1, shader: shader$1 }; // Do not edit. const name = "morphTargetsVertexDeclaration"; const shader = `#ifdef MORPHTARGETS #ifndef MORPHTARGETS_TEXTURE #ifdef MORPHTARGETS_POSITION attribute position{X} : vec3<f32>; #endif #ifdef MORPHTARGETS_NORMAL attribute normal{X} : vec3<f32>; #endif #ifdef MORPHTARGETS_TANGENT attribute tangent{X} : vec3<f32>; #endif #ifdef MORPHTARGETS_UV attribute uv_{X} : vec2<f32>; #endif #ifdef MORPHTARGETS_UV2 attribute uv2_{X} : vec2<f32>; #endif #ifdef MORPHTARGETS_COLOR attribute color{X} : vec4<f32>; #endif #elif {X}==0 uniform morphTargetCount: f32; #endif #endif `; // Sideeffect if (!ShaderStore.IncludesShadersStoreWGSL[name]) { ShaderStore.IncludesShadersStoreWGSL[name] = shader; } /** @internal */ const morphTargetsVertexDeclarationWGSL = { name, shader }; export { morphTargetsVertexDeclarationWGSL as a, morphTargetsVertexGlobalDeclarationWGSL as m }; //# sourceMappingURL=morphTargetsVertexDeclaration-BiDnarww.esm.js.map