prePassVertex.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Do not edit.
  2. import { ShaderStore } from "../../Engines/shaderStore.js";
  3. const name = "prePassVertex";
  4. const shader = `#ifdef PREPASS_DEPTH
  5. vViewPos=(view*worldPos).rgb;
  6. #endif
  7. #if defined(PREPASS_VELOCITY) && defined(BONES_VELOCITY_ENABLED)
  8. vCurrentPosition=viewProjection*worldPos;
  9. #if NUM_BONE_INFLUENCERS>0
  10. mat4 previousInfluence;previousInfluence=mPreviousBones[int(matricesIndices[0])]*matricesWeights[0];
  11. #if NUM_BONE_INFLUENCERS>1
  12. previousInfluence+=mPreviousBones[int(matricesIndices[1])]*matricesWeights[1];
  13. #endif
  14. #if NUM_BONE_INFLUENCERS>2
  15. previousInfluence+=mPreviousBones[int(matricesIndices[2])]*matricesWeights[2];
  16. #endif
  17. #if NUM_BONE_INFLUENCERS>3
  18. previousInfluence+=mPreviousBones[int(matricesIndices[3])]*matricesWeights[3];
  19. #endif
  20. #if NUM_BONE_INFLUENCERS>4
  21. previousInfluence+=mPreviousBones[int(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
  22. #endif
  23. #if NUM_BONE_INFLUENCERS>5
  24. previousInfluence+=mPreviousBones[int(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
  25. #endif
  26. #if NUM_BONE_INFLUENCERS>6
  27. previousInfluence+=mPreviousBones[int(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
  28. #endif
  29. #if NUM_BONE_INFLUENCERS>7
  30. previousInfluence+=mPreviousBones[int(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
  31. #endif
  32. vPreviousPosition=previousViewProjection*finalPreviousWorld*previousInfluence*vec4(positionUpdated,1.0);
  33. #else
  34. vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
  35. #endif
  36. #endif
  37. `;
  38. // Sideeffect
  39. ShaderStore.IncludesShadersStore[name] = shader;
  40. /** @internal */
  41. export const prePassVertex = { name, shader };
  42. //# sourceMappingURL=prePassVertex.js.map