bonesVertex.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Do not edit.
  2. import { ShaderStore } from "../../Engines/shaderStore.js";
  3. const name = "bonesVertex";
  4. const shader = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
  5. #if NUM_BONE_INFLUENCERS>0
  6. mat4 influence;
  7. #ifdef BONETEXTURE
  8. influence=readMatrixFromRawSampler(boneSampler,matricesIndices[0])*matricesWeights[0];
  9. #if NUM_BONE_INFLUENCERS>1
  10. influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[1])*matricesWeights[1];
  11. #endif
  12. #if NUM_BONE_INFLUENCERS>2
  13. influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[2])*matricesWeights[2];
  14. #endif
  15. #if NUM_BONE_INFLUENCERS>3
  16. influence+=readMatrixFromRawSampler(boneSampler,matricesIndices[3])*matricesWeights[3];
  17. #endif
  18. #if NUM_BONE_INFLUENCERS>4
  19. influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[0])*matricesWeightsExtra[0];
  20. #endif
  21. #if NUM_BONE_INFLUENCERS>5
  22. influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[1])*matricesWeightsExtra[1];
  23. #endif
  24. #if NUM_BONE_INFLUENCERS>6
  25. influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[2])*matricesWeightsExtra[2];
  26. #endif
  27. #if NUM_BONE_INFLUENCERS>7
  28. influence+=readMatrixFromRawSampler(boneSampler,matricesIndicesExtra[3])*matricesWeightsExtra[3];
  29. #endif
  30. #else
  31. influence=mBones[int(matricesIndices[0])]*matricesWeights[0];
  32. #if NUM_BONE_INFLUENCERS>1
  33. influence+=mBones[int(matricesIndices[1])]*matricesWeights[1];
  34. #endif
  35. #if NUM_BONE_INFLUENCERS>2
  36. influence+=mBones[int(matricesIndices[2])]*matricesWeights[2];
  37. #endif
  38. #if NUM_BONE_INFLUENCERS>3
  39. influence+=mBones[int(matricesIndices[3])]*matricesWeights[3];
  40. #endif
  41. #if NUM_BONE_INFLUENCERS>4
  42. influence+=mBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
  43. #endif
  44. #if NUM_BONE_INFLUENCERS>5
  45. influence+=mBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
  46. #endif
  47. #if NUM_BONE_INFLUENCERS>6
  48. influence+=mBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
  49. #endif
  50. #if NUM_BONE_INFLUENCERS>7
  51. influence+=mBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
  52. #endif
  53. #endif
  54. finalWorld=finalWorld*influence;
  55. #endif
  56. #endif
  57. `;
  58. // Sideeffect
  59. ShaderStore.IncludesShadersStore[name] = shader;
  60. /** @internal */
  61. export const bonesVertex = { name, shader };
  62. //# sourceMappingURL=bonesVertex.js.map