Hi !, I tried to make a vertex animation, everything works with the babylon format, but the files are too large, I tried with the glb format and ran into a problem that can be seen from the link, I also attach the shader code BABYLON.Effect.ShadersStore.customVertexShader =
// Vertex shader
precision highp float;
// Attributes
attribute vec2 uv;
attribute vec2 uv2;
attribute vec4 animation;
attribute vec3 position;
attribute vec3 color;
attribute vec4 world0;
attribute vec4 world1;
attribute vec4 world2;
attribute vec4 world3;
// Uniforms
uniform mat4 worldViewProjection;
uniform float totalFrames;
uniform highp sampler2D texAnim;
uniform float T;
uniform float a;
// Varying
varying vec2 vUV;
varying vec3 vColor;
void main(void) {
vColor = color;
vec2 uvp = uv;
float fStart = animation.x;
float fEnd = animation.y;
float tot = totalFrames;
float b = fStart/tot;
float c = fEnd/tot;
float d = fract(T/(c-b))(c-b)+b;
float f = T30.0/(tot);
float e = fract(f/((fEnd-fStart)/(tot)))*((fEnd-fStart)/(tot)) + b;
vec2 uvPos2 = vec2(uv.x,uv.y - e);
vec4 pos1 = texture2D(texAnim ,uvPos2);
pos1 -= vec4(0.5,.5,0.05,0);
pos1 *= 100.0;
gl_Position = worldViewProjection * vec4(pos1.xyz,1.0);
vUV = uv;
}; BABYLON.Effect.ShadersStore.customFragmentShader =
precision highp float;
precision mediump float;
varying vec2 vUV;
varying vec3 vColor;
uniform sampler2D texDiff;
void main(void) {
gl_FragColor = vec4(vColor,1.0);
}; var shader = new BABYLON.ShaderMaterial("shaderGradient", scene, "custom",{ attributes: ["animation","uv2","uv","color","position"], defines: ["#define INSTANCES"], uniforms: ["texDiff","totalFrames","texAnim","worldViewProjection","T"] });
and link))? sorry its not playgroundLink but CORS dont access load my files from server or dropbox(
https://motya.v3normalize.ru/shaderBallGLB/