2023-07-22 23:59:17 +08:00
|
|
|
#version 310 es
|
|
|
|
precision highp float;
|
|
|
|
precision highp int;
|
2023-07-25 19:06:12 +08:00
|
|
|
layout(location = TEXCOORD0) in vec2 v_texCoord;
|
2023-07-22 23:59:17 +08:00
|
|
|
|
|
|
|
layout(binding = 0) uniform sampler2D u_sampler0;
|
|
|
|
layout(binding = 1) uniform sampler2D u_sampler1;
|
|
|
|
layout(std140, binding = 0) uniform fs_ub {
|
|
|
|
vec4 u_color;
|
|
|
|
float offset;
|
|
|
|
float duration;
|
|
|
|
};
|
|
|
|
|
2023-07-25 19:06:12 +08:00
|
|
|
layout(location = SV_Target0) out vec4 FragColor;
|
2023-07-22 23:59:17 +08:00
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
|
|
|
vec4 color = duration*vec4(0,0.8,0.4,1.0);
|
|
|
|
//blend two texture
|
2023-07-25 19:06:12 +08:00
|
|
|
FragColor = u_color*texture(u_sampler0, vec2(v_texCoord.x- 2.0 * offset,v_texCoord.y)) * vec4(0.3,0.3,0.3,1)+texture(u_sampler1,vec2(v_texCoord.x-offset,v_texCoord.y)).r*color;
|
2023-07-22 23:59:17 +08:00
|
|
|
}
|