@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
32 lines • 1.19 kB
JavaScript
// Do not edit.
import { ShaderStore } from "../../Engines/shaderStore.js";
const name = "bonesDeclaration";
const shader = `
attribute vec4 matricesIndices;attribute vec4 matricesWeights;
attribute vec4 matricesIndicesExtra;attribute vec4 matricesWeightsExtra;
uniform highp sampler2D boneSampler;uniform float boneTextureWidth;
uniform mat4 mBones[BonesPerMesh];
uniform mat4 mPreviousBones[BonesPerMesh];
mat4 readMatrixFromRawSampler(sampler2D smp,float index)
{float offset=index *4.0;float dx=1.0/boneTextureWidth;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),0.));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),0.));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),0.));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),0.));return mat4(m0,m1,m2,m3);}
`;
// Sideeffect
if (!ShaderStore.IncludesShadersStore[name]) {
ShaderStore.IncludesShadersStore[name] = shader;
}
/** @internal */
export const bonesDeclaration = { name, shader };
//# sourceMappingURL=bonesDeclaration.js.map