2022-10-13 17:39:57 +00:00
|
|
|
#version 440
|
|
|
|
|
|
|
|
layout( location = 0 ) in vec2 coord;
|
|
|
|
layout( location = 0 ) out vec4 fragColor;
|
|
|
|
|
|
|
|
layout( std140, binding = 0 ) uniform buf
|
|
|
|
{
|
|
|
|
mat4 matrix;
|
|
|
|
vec2 centerCoord;
|
|
|
|
vec2 radius;
|
|
|
|
float opacity;
|
|
|
|
} ubuf;
|
|
|
|
|
2022-11-13 10:05:53 +00:00
|
|
|
layout( binding = 1 ) uniform sampler2D colorRamp;
|
2022-10-13 17:39:57 +00:00
|
|
|
|
|
|
|
vec4 colorAt( float value )
|
|
|
|
{
|
2022-11-13 10:05:53 +00:00
|
|
|
return texture( colorRamp, vec2( value, 0.0 ) );
|
2022-10-13 17:39:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
fragColor = colorAt( length( coord / ubuf.radius ) ) * ubuf.opacity;
|
|
|
|
}
|