bakedVertexAnimationDeclaration.js 1.1 KB

123456789101112131415161718
  1. // Do not edit.
  2. import { ShaderStore } from "../../Engines/shaderStore.js";
  3. const name = "bakedVertexAnimationDeclaration";
  4. const shader = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
  5. uniform float bakedVertexAnimationTime;uniform vec2 bakedVertexAnimationTextureSizeInverted;uniform vec4 bakedVertexAnimationSettings;uniform sampler2D bakedVertexAnimationTexture;
  6. #ifdef INSTANCES
  7. attribute vec4 bakedVertexAnimationSettingsInstanced;
  8. #endif
  9. #define inline
  10. mat4 readMatrixFromRawSamplerVAT(sampler2D smp,float index,float frame)
  11. {float offset=index*4.0;float frameUV=(frame+0.5)*bakedVertexAnimationTextureSizeInverted.y;float dx=bakedVertexAnimationTextureSizeInverted.x;vec4 m0=texture2D(smp,vec2(dx*(offset+0.5),frameUV));vec4 m1=texture2D(smp,vec2(dx*(offset+1.5),frameUV));vec4 m2=texture2D(smp,vec2(dx*(offset+2.5),frameUV));vec4 m3=texture2D(smp,vec2(dx*(offset+3.5),frameUV));return mat4(m0,m1,m2,m3);}
  12. #endif
  13. `;
  14. // Sideeffect
  15. ShaderStore.IncludesShadersStore[name] = shader;
  16. /** @internal */
  17. export const bakedVertexAnimationDeclaration = { name, shader };
  18. //# sourceMappingURL=bakedVertexAnimationDeclaration.js.map