qskinny/src/nodes/shaders/gradientradial-vulkan.frag

25 lines
451 B
GLSL
Raw Normal View History

#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;
vec4 colorAt( float value )
{
2022-11-13 10:05:53 +00:00
return texture( colorRamp, vec2( value, 0.0 ) );
}
void main()
{
fragColor = colorAt( length( coord / ubuf.radius ) ) * ubuf.opacity;
}