diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-12-01 21:49:31 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-12-01 22:38:52 +0300 |
commit | d55c269dd197288c30ca2881136330931bf05f98 (patch) | |
tree | 62ca84ecfa630e10154092a5157613caa069478e /source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl | |
parent | 6a80a786f88c7b09c451e3c585224a392c3cd95c (diff) |
UI: Simplify the area border drawing
Instead of doing a lot of alpha blended drawing with jittering, use the
fragment shader to do the masking using a circle mask.
This is much simpler and requires much less resources.
Hopefully this may solve the issue we have with the Intels UHD Graphics 620
on linux.
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl b/source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl new file mode 100644 index 00000000000..620568db500 --- /dev/null +++ b/source/blender/gpu/shaders/gpu_shader_2D_area_borders_frag.glsl @@ -0,0 +1,16 @@ + +uniform vec4 color; +uniform float scale; + +in vec2 uv; + +out vec4 fragColor; + +void main() +{ + /* Should be 0.8 but minimize the AA on the edges. */ + float dist = (length(uv) - 0.78) * scale; + + fragColor = color; + fragColor.a *= smoothstep(-0.09, 1.09, dist); +} |