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:
authorClément Foucault <foucault.clem@gmail.com>2018-04-05 16:27:53 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-04-05 17:08:46 +0300
commitd48597eb5422b33d5edc80f3b6d8d927f2f40444 (patch)
tree552200bdc04a76f2591386cf57898578aabc87cd /source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl
parent5fba4458e9a7a995343a3432abe230c9ea293813 (diff)
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.
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_nodelink_frag.glsl10
1 files changed, 10 insertions, 0 deletions
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