2023-06-08 09:00:18 +00:00
|
|
|
#version 450
|
2017-09-22 18:20:57 +00:00
|
|
|
|
2023-05-20 00:56:02 +00:00
|
|
|
#include "common.frag.glsl"
|
2017-09-22 18:20:57 +00:00
|
|
|
#include "clip.frag.glsl"
|
2023-05-20 23:28:36 +00:00
|
|
|
#include "rect.frag.glsl"
|
2017-09-22 18:20:57 +00:00
|
|
|
|
|
|
|
layout(location = 0) in vec2 inPos;
|
2023-05-20 23:28:36 +00:00
|
|
|
layout(location = 1) in Rect inStartRect;
|
|
|
|
layout(location = 2) in Rect inEndRect;
|
|
|
|
layout(location = 3) in vec2 inStartTexCoord;
|
|
|
|
layout(location = 4) in vec2 inEndTexCoord;
|
2023-06-28 18:50:43 +00:00
|
|
|
layout(location = 5) flat in uint inStartTexId;
|
|
|
|
layout(location = 6) flat in uint inEndTexId;
|
2023-05-20 23:28:36 +00:00
|
|
|
layout(location = 7) in float inProgress;
|
2017-09-22 18:20:57 +00:00
|
|
|
|
|
|
|
layout(location = 0) out vec4 color;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2023-05-20 23:28:36 +00:00
|
|
|
float start_alpha = rect_coverage (inStartRect, inPos);
|
2023-05-23 03:08:13 +00:00
|
|
|
vec4 start = texture (get_sampler (inStartTexId), inStartTexCoord) * start_alpha;
|
2023-05-20 23:28:36 +00:00
|
|
|
float end_alpha = rect_coverage (inEndRect, inPos);
|
2023-05-23 03:08:13 +00:00
|
|
|
vec4 end = texture (get_sampler (inEndTexId), inEndTexCoord) * end_alpha;
|
2017-09-22 18:20:57 +00:00
|
|
|
|
2023-05-20 23:28:36 +00:00
|
|
|
color = clip_scaled (inPos, mix (start, end, inProgress));
|
2017-09-22 18:20:57 +00:00
|
|
|
}
|