@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.
38 lines (35 loc) • 1.38 kB
JavaScript
import { S as ShaderStore } from './index-MZPybX0H.esm.js';
// Do not edit.
const name = "bonesDeclaration";
const shader = `
attribute matricesIndices : vec4f;attribute matricesWeights : vec4f;
attribute matricesIndicesExtra : vec4f;attribute matricesWeightsExtra : vec4f;
var boneSampler : texture_2d<f32>;uniform boneTextureInfo : vec2f;
uniform mBones : array<mat4x4f,BonesPerMesh>;
uniform mPreviousBones : array<mat4x4f,BonesPerMesh>;
fn readMatrixFromRawSampler(smp : texture_2d<f32>,index : f32)->mat4x4f
{let offset=i32(index)*4;
let textureWidth=i32(uniforms.boneTextureInfo.x);let y=offset/textureWidth;let x=offset % textureWidth;let m0=textureLoad(smp,vec2<i32>(x+0,y),0);let m1=textureLoad(smp,vec2<i32>(x+1,y),0);let m2=textureLoad(smp,vec2<i32>(x+2,y),0);let m3=textureLoad(smp,vec2<i32>(x+3,y),0);return mat4x4f(m0,m1,m2,m3);}
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStoreWGSL[name]) {
ShaderStore.IncludesShadersStoreWGSL[name] = shader;
}
/** @internal */
const bonesDeclarationWGSL = { name, shader };
export { bonesDeclarationWGSL as b };
//# sourceMappingURL=bonesDeclaration-PMvyqkeE.esm.js.map