bonesDeclaration.js 1.1 KB

123456789101112131415161718192021222324252627282930
  1. // Do not edit.
  2. import { ShaderStore } from "../../Engines/shaderStore.js";
  3. const name = "bonesDeclaration";
  4. const shader = `#if NUM_BONE_INFLUENCERS>0
  5. attribute matricesIndices : vec4<f32>;attribute matricesWeights : vec4<f32>;
  6. #if NUM_BONE_INFLUENCERS>4
  7. attribute matricesIndicesExtra : vec4<f32>;attribute matricesWeightsExtra : vec4<f32>;
  8. #endif
  9. #ifndef BAKED_VERTEX_ANIMATION_TEXTURE
  10. #ifdef BONETEXTURE
  11. var boneSampler : texture_2d<f32>;uniform boneTextureWidth : f32;
  12. #else
  13. uniform mBones : array<mat4x4,BonesPerMesh>;
  14. #ifdef BONES_VELOCITY_ENABLED
  15. uniform mPreviousBones : array<mat4x4,BonesPerMesh>;
  16. #endif
  17. #endif
  18. #ifdef BONETEXTURE
  19. fn readMatrixFromRawSampler(smp : texture_2d<f32>,index : f32)->mat4x4<f32>
  20. {let offset=i32(index) *4;
  21. let m0=textureLoad(smp,vec2<i32>(offset+0,0),0);let m1=textureLoad(smp,vec2<i32>(offset+1,0),0);let m2=textureLoad(smp,vec2<i32>(offset+2,0),0);let m3=textureLoad(smp,vec2<i32>(offset+3,0),0);return mat4x4<f32>(m0,m1,m2,m3);}
  22. #endif
  23. #endif
  24. #endif
  25. `;
  26. // Sideeffect
  27. ShaderStore.IncludesShadersStoreWGSL[name] = shader;
  28. /** @internal */
  29. export const bonesDeclaration = { name, shader };
  30. //# sourceMappingURL=bonesDeclaration.js.map