This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
Jeroen Bakker 9d3f35a0bf Revert "Revert "GPUShaderCreateInfo for interface abstraction""
This reverts commit edee5a947b.

Fixes compilation error (Missing file BLI_float2.hh)
2022-01-17 14:46:32 +01:00

29 lines
511 B
GLSL

#ifndef USE_GPU_SHADER_CREATE_INFO
uniform float lineWidth;
uniform bool lineSmooth = true;
in vec4 finalColor;
noperspective in float smoothline;
# ifdef CLIP
in float clip;
# endif
out vec4 fragColor;
#endif
#define SMOOTH_WIDTH 1.0
void main()
{
#ifdef CLIP
if (clip < 0.0) {
discard;
}
#endif
fragColor = finalColor;
if (lineSmooth) {
fragColor.a *= clamp((lineWidth + SMOOTH_WIDTH) * 0.5 - abs(smoothline), 0.0, 1.0);
}
fragColor = blender_srgb_to_framebuffer_space(fragColor);
}