From d48597eb5422b33d5edc80f3b6d8d927f2f40444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Thu, 5 Apr 2018 15:27:53 +0200 Subject: GPUShader: Add 2D Nodelink shader. Special shader to draw nodelinks for the node editor. We only pass bezier points to the GPU and vertex position is handled inside the vertex shader. The arrow is also part of the batch to avoid separate drawcalls for it. We still draw 2 pass one for shadow and one for the link color on top. One variation to draw instances of theses links so that we only do one drawcall. --- source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl (limited to 'source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl') diff --git a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl new file mode 100644 index 00000000000..8dda575107a --- /dev/null +++ b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl @@ -0,0 +1,10 @@ + +in float colorGradient; +in vec4 finalColor; + +out vec4 fragColor; + +void main() { + fragColor = finalColor; + fragColor.a *= smoothstep(1.0, 0.1, abs(colorGradient)); +} \ No newline at end of file -- cgit v1.2.3