diff options
author | Richard Antalik <richardantalik@gmail.com> | 2020-11-17 06:10:51 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2020-11-17 06:10:51 +0300 |
commit | 797dfa6a0a7d5d2bf62bdc03cf619addbc9e1064 (patch) | |
tree | 5a1e0f0a6b2439ceee4a8e0bae82b243e3831156 /source/blender/gpu/shaders | |
parent | 09045ff64d1f0948489354bd097f2930f45bacb9 (diff) | |
parent | 75bd286813eb5e3c227696b4cfd5616b17166641 (diff) |
Merge branch 'blender-v2.91-release'
Conflicts:
source/blender/editors/render/render_opengl.c
source/blender/sequencer/intern/effects.c
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl | 5 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl index 9c6b109d659..3ea8f7dbfbe 100644 --- a/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_frag.glsl @@ -1,5 +1,6 @@ uniform float lineWidth; +uniform bool lineSmooth = true; in vec4 finalColor; noperspective in float smoothline; @@ -19,6 +20,8 @@ void main() } #endif fragColor = finalColor; - fragColor.a *= clamp((lineWidth + SMOOTH_WIDTH) * 0.5 - abs(smoothline), 0.0, 1.0); + if (lineSmooth) { + fragColor.a *= clamp((lineWidth + SMOOTH_WIDTH) * 0.5 - abs(smoothline), 0.0, 1.0); + } fragColor = blender_srgb_to_framebuffer_space(fragColor); } diff --git a/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl b/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl index fd9b7e221e6..70026398937 100644 --- a/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl +++ b/source/blender/gpu/shaders/gpu_shader_3D_polyline_geom.glsl @@ -5,6 +5,7 @@ layout(triangle_strip, max_vertices = 4) out; uniform vec4 color; uniform vec2 viewportSize; uniform float lineWidth; +uniform bool lineSmooth = true; #if !defined(UNIFORM) in vec4 finalColor_g[]; @@ -53,12 +54,12 @@ void do_vertex(const int i, vec4 pos, vec2 ofs) clip = clip_g[i]; #endif - smoothline = (lineWidth + SMOOTH_WIDTH) * 0.5; + smoothline = (lineWidth + SMOOTH_WIDTH * float(lineSmooth)) * 0.5; gl_Position = pos; gl_Position.xy += ofs * pos.w; EmitVertex(); - smoothline = -(lineWidth + SMOOTH_WIDTH) * 0.5; + smoothline = -(lineWidth + SMOOTH_WIDTH * float(lineSmooth)) * 0.5; gl_Position = pos; gl_Position.xy -= ofs * pos.w; EmitVertex(); @@ -77,7 +78,7 @@ void main(void) vec2 ofs = vec2(-e.y, e.x); #endif ofs /= viewportSize.xy; - ofs *= lineWidth + SMOOTH_WIDTH; + ofs *= lineWidth + SMOOTH_WIDTH * float(lineSmooth); do_vertex(0, p0, ofs); do_vertex(1, p1, ofs); |