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>2019-06-17 21:28:27 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-06-17 21:32:02 +0300
commit28b06b6a05f7e0efb307aa3f4d2d609c9162358c (patch)
treef6872d726eb310b094283fe7b2ff6a7e72109621 /source/blender/gpu
parentbe52b25d3953696a775be9d2dae32cf713369e7c (diff)
Fix T57650 UVEdit: selection not visible if behind unselected UVs
Use depth buffer to order the uv edges correctly to always draw selected edges on top. We still use the double drawing workaround for points to keep the smooth antialiased display.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/GPU_framebuffer.h1
-rw-r--r--source/blender/gpu/intern/gpu_framebuffer.c5
-rw-r--r--source/blender/gpu/shaders/gpu_shader_2D_edituvs_edges_vert.glsl5
3 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/gpu/GPU_framebuffer.h b/source/blender/gpu/GPU_framebuffer.h
index 3cc972fabfb..b919a3dd8f3 100644
--- a/source/blender/gpu/GPU_framebuffer.h
+++ b/source/blender/gpu/GPU_framebuffer.h
@@ -209,6 +209,7 @@ void GPU_offscreen_viewport_data_get(GPUOffScreen *ofs,
struct GPUTexture **r_depth);
void GPU_clear_color(float red, float green, float blue, float alpha);
+void GPU_clear_depth(float depth);
void GPU_clear(eGPUFrameBufferBits flags);
#ifdef __cplusplus
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c
index 5950027a103..27a088fa922 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.c
+++ b/source/blender/gpu/intern/gpu_framebuffer.c
@@ -1041,6 +1041,11 @@ void GPU_clear_color(float red, float green, float blue, float alpha)
glClearColor(red, green, blue, alpha);
}
+void GPU_clear_depth(float depth)
+{
+ glClearDepth(depth);
+}
+
void GPU_clear(eGPUFrameBufferBits flags)
{
glClear(convert_buffer_bits_to_gl(flags));
diff --git a/source/blender/gpu/shaders/gpu_shader_2D_edituvs_edges_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_edituvs_edges_vert.glsl
index 5c6b8f0a1a1..02bbe545436 100644
--- a/source/blender/gpu/shaders/gpu_shader_2D_edituvs_edges_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_2D_edituvs_edges_vert.glsl
@@ -19,13 +19,14 @@ flat out vec4 finalColor;
void main()
{
- gl_Position = ModelViewProjectionMatrix * vec4(pos, 0.0, 1.0);
-
#ifdef SMOOTH_COLOR
bool is_select = (flag & VERT_UV_SELECT) != 0;
#else
bool is_select = (flag & EDGE_UV_SELECT) != 0;
#endif
+ gl_Position = ModelViewProjectionMatrix * vec4(pos, 0.0, 1.0);
+ gl_Position.z = float(!is_select);
+
finalColor = (is_select) ? selectColor : edgeColor;
}