aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/shared/squircle_rhi.frag
blob: 8da62b93e69fce3462e9c2f0213d04dbc1f6273b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#version 440

layout(location = 0) in vec2 coords;
layout(location = 0) out vec4 fragColor;

layout(std140, binding = 0) uniform buf {
    float t;
} ubuf;

void main()
{
    float i = 1. - (pow(abs(coords.x), 4.) + pow(abs(coords.y), 4.));
    i = smoothstep(ubuf.t - 0.8, ubuf.t + 0.8, i);
    i = floor(i * 20.) / 20.;
    fragColor = vec4(coords * .5 + .5, i, i);
}