더 이상 관련이 있는지 모르겠지만 Doug 답변이 맞았습니다.
방금 게임에 내장 된 애니메이션과 동일한 에셋을 사용하여 애니메이션을 정확하게 재현 할 수 있다고 덧붙이고 싶었습니다.
마 그니 :
precision highp float;
uniform float uTime;
uniform sampler2D uSampler0;
uniform sampler2D uSampler1;
uniform sampler2D uSampler2;
uniform sampler2D uSampler3;
uniform sampler2D uSampler4;
uniform sampler2D uSampler5;
varying vec2 texCoords;
void main(void) {
float t = uTime;
vec3 mask = texture2D(uSampler1,texCoords).rgb;
vec4 img = texture2D(uSampler0,texCoords);
img.rg*=1.1;
vec2 flow = texture2D(uSampler3,texCoords).gr;
flow.y+=t*3.;
vec4 plas = texture2D(uSampler2,flow*1.2) * mask.r;
plas *= 15.5;
plas *= vec4(0.239, 0.224,0.488,1.);
vec2 ct = texCoords;
ct.y -=t*0.5;
vec4 clouds = texture2D(uSampler4,ct*2.);
float clouds_a = clouds.a;
clouds *= 4.5;
clouds *= vec4(0.275,0.23,0.161,1.);
clouds_a *= mask.b;
img += clouds * mask.b;
img += plas * mask.r ;
img += (sin(t*15.)+1.) * mask.g * vec4(0.239, 0.224,0.488,1.)*2.;
ct.x += t * 0.5;
vec4 clouds_overall = texture2D(uSampler5,ct * 0.5);
clouds_overall *= vec4(0.275,0.23,0.161,1.);
gl_FragColor = img +clouds_overall;
}
메디브 :
precision highp float;
uniform float uTime;
uniform sampler2D uSampler0;
uniform sampler2D uSampler1;
uniform sampler2D uSampler2;
uniform sampler2D uSampler3;
uniform sampler2D uSampler4;
uniform sampler2D uSampler5;
varying vec2 texCoords;
void main(void) {
float t = uTime;
vec2 tc = texCoords;
tc.x-=t*2.;
vec4 mask = texture2D(uSampler1,texCoords);
float bump = texture2D(uSampler4,tc*0.5).r;
vec4 img = texture2D(uSampler0,vec2(texCoords.x,texCoords.y+bump* 0.055 * mask.g));
tc = texCoords;
tc.x-=0.05;
tc.y+= 0.05;
vec2 flow = texture2D(uSampler3,tc).rg;
flow.y+=t;
flow.y*=2.;
vec4 plasma = texture2D(uSampler2,flow*1.5);
plasma.rgb *= vec3(0.52,0.26,0.54);
plasma *= 3.;
flow = texture2D(uSampler5,texCoords).rg;
flow.g+=t;
vec4 plasma2 = texture2D(uSampler2,flow);
plasma2 *= 4.;
plasma2.rgb *= vec3(0.52,0.26,0.54);
gl_FragColor =img+plasma*mask.r+bump*mask.a*0.35+plasma2*mask.b;
}