From 2ba233a31fead52820763fb6637dcae20eeed574 Mon Sep 17 00:00:00 2001 From: Charlie Jolly Date: Thu, 22 Aug 2019 11:10:11 +0200 Subject: Nodes: Support for socket shapes other than circle Previously there was already "draw_shape" property, but it was doing nothing. This commit renames the property to "display_shape". Furthermore, different shapes like SQUARE and DIAMOND are supported now. Currently, the shapes are drawn using the shader that also draws keyframes. In the future we might want to separate this. The new shapes are not used anywhere yet, but they can be used by addon developers and will probably be useful when we want to support different kinds node systems later. For example, different shapes can be used to distinguish between data and control flow. Differential Revision: https://developer.blender.org/D2829 --- source/blender/gpu/shaders/gpu_shader_keyframe_diamond_vert.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/gpu') diff --git a/source/blender/gpu/shaders/gpu_shader_keyframe_diamond_vert.glsl b/source/blender/gpu/shaders/gpu_shader_keyframe_diamond_vert.glsl index 8dc92a2b415..2ba89230d80 100644 --- a/source/blender/gpu/shaders/gpu_shader_keyframe_diamond_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_keyframe_diamond_vert.glsl @@ -1,11 +1,11 @@ uniform mat4 ModelViewProjectionMatrix; uniform vec2 ViewportSize = vec2(-1, -1); +uniform float outline_scale = 1.0; const float line_falloff = 1.0; const float circle_scale = sqrt(2.0 / 3.1416); const float square_scale = sqrt(0.5); - const float diagonal_scale = sqrt(0.5); in vec2 pos; @@ -58,7 +58,7 @@ void main() float line_width = half_width + line_falloff; /* Outline thresholds. */ - thresholds.xy = line_thresholds(line_width); + thresholds.xy = line_thresholds(line_width * outline_scale); /* Inner dot thresholds. */ thresholds.zw = line_thresholds(line_width * 1.6); -- cgit v1.2.3