我有一个徽标.png image = uImage,并在其上面贴有箔膜uColor。如何使用变量uTime和图像每秒淡出和淡入图像?
export const fragmentShader = `
uniform float uTime;
uniform float uColorSpeed;
uniform float uColorStretch;
uniform float uSwipeSpeed;
uniform float uSwipeSize;
uniform float uOpacity;
uniform float uFrequency;
uniform float uOpacityAll;
uniform sampler2D uColor;
uniform sampler2D uImage;
uniform vec2 uSpriteSheetPosition;
uniform float uSpriteSheetColumns;
uniform float uSpriteSheetRows;
varying vec2 vUv;
void main() {
float newTime = mod(uTime, 100.0);
vec4 color = texture2D(uColor, vec2((vUv.x - 1.0) * (newTime * 0.1), vUv.x));
vec4 image = texture2D(uImage,vec2(vUv.xy));
vec3 foilColor = vec3(color);
gl_FragColor = vec4(foilColor, image.a - 0.5);
}`;