diff options
author | Mike Erwin <significant.bit@gmail.com> | 2016-10-08 10:34:05 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2016-10-08 10:34:05 +0300 |
commit | 187d8f473a16a657505dfb7a2b53606d0631fca8 (patch) | |
tree | f2fc656599cb339ad78ec730eec51cbfccf8413a /source/blender/gpu | |
parent | 7a552612c3eb2a66002134511cc59ae94d05dc5d (diff) |
OpenGL: fix smooth point fringe
Smooth edge was fading to transparent black instead of transparent color. My bad.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_smooth_frag.glsl | 6 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_point_uniform_color_smooth_frag.glsl | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_smooth_frag.glsl b/source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_smooth_frag.glsl index 605235b9335..f83785de95e 100644 --- a/source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_smooth_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_point_uniform_color_outline_smooth_frag.glsl @@ -27,8 +27,10 @@ void main() { float midStroke = 0.5 * (radii[1] + radii[2]); - if (dist > midStroke) - fragColor = mix(outlineColor, vec4(0.0), smoothstep(radii[1], radii[0], dist)); + if (dist > midStroke) { + fragColor.rgb = outlineColor.rgb; + fragColor.a = mix(outlineColor.a, 0.0, smoothstep(radii[1], radii[0], dist)); + } else fragColor = mix(color, outlineColor, smoothstep(radii[3], radii[2], dist)); } diff --git a/source/blender/gpu/shaders/gpu_shader_point_uniform_color_smooth_frag.glsl b/source/blender/gpu/shaders/gpu_shader_point_uniform_color_smooth_frag.glsl index dd8ecd6daa6..8c8d81f6997 100644 --- a/source/blender/gpu/shaders/gpu_shader_point_uniform_color_smooth_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_point_uniform_color_smooth_frag.glsl @@ -20,5 +20,6 @@ void main() { // ... // dist = 0 at center of point - fragColor = mix(color, vec4(0.0), smoothstep(radii[1], radii[0], dist)); + fragColor.rgb = color.rgb; + fragColor.a = mix(color.a, 0.0, smoothstep(radii[1], radii[0], dist)); } |