Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl24
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
new file mode 100644
index 00000000000..9c6b109d659
--- /dev/null
+++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl
@@ -0,0 +1,24 @@
+
+uniform float lineWidth;
+
+in vec4 finalColor;
+noperspective in float smoothline;
+#ifdef CLIP
+in float clip;
+#endif
+
+out vec4 fragColor;
+
+#define SMOOTH_WIDTH 1.0
+
+void main()
+{
+#ifdef CLIP
+ if (clip < 0.0) {
+ discard;
+ }
+#endif
+ fragColor = finalColor;
+ fragColor.a *= clamp((lineWidth + SMOOTH_WIDTH) * 0.5 - abs(smoothline), 0.0, 1.0);
+ fragColor = blender_srgb_to_framebuffer_space(fragColor);
+}