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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2022-06-20 15:32:48 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-06-20 15:42:09 +0300
commit72a5bb8ba98a2866709cfa1645f31771280368db (patch)
treef0c4765dd6dbe9163b70d6b6ed94974e8a7c1568 /source/blender/draw/intern/shaders
parentff1883307f12a8b734bfcf87b01743dc73afae75 (diff)
Fix artefacts with GPU subdiv and weight paint face selection
Addendum to previous fix, which was for point selection, this fixes the face selection mode. The issue is caused by wrong flags used for paint mode (the edit mode flag was always used). Also add back flag which was accidentally removed in 16f5d51109bce849dff5379c60360f271622ac0f.
Diffstat (limited to 'source/blender/draw/intern/shaders')
-rw-r--r--source/blender/draw/intern/shaders/common_subdiv_lib.glsl2
-rw-r--r--source/blender/draw/intern/shaders/common_subdiv_vbo_lnor_comp.glsl11
2 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/draw/intern/shaders/common_subdiv_lib.glsl b/source/blender/draw/intern/shaders/common_subdiv_lib.glsl
index d76a7369f79..1be6619dbad 100644
--- a/source/blender/draw/intern/shaders/common_subdiv_lib.glsl
+++ b/source/blender/draw/intern/shaders/common_subdiv_lib.glsl
@@ -36,6 +36,8 @@ layout(std140) uniform shader_data
/* Total number of elements to process. */
uint total_dispatch_size;
+
+ bool is_edit_mode;
};
uint get_global_invocation_index()
diff --git a/source/blender/draw/intern/shaders/common_subdiv_vbo_lnor_comp.glsl b/source/blender/draw/intern/shaders/common_subdiv_vbo_lnor_comp.glsl
index f5c4c7895aa..ca085c24c14 100644
--- a/source/blender/draw/intern/shaders/common_subdiv_vbo_lnor_comp.glsl
+++ b/source/blender/draw/intern/shaders/common_subdiv_vbo_lnor_comp.glsl
@@ -26,6 +26,11 @@ bool is_face_selected(uint coarse_quad_index)
return (extra_coarse_face_data[coarse_quad_index] & coarse_face_select_mask) != 0;
}
+bool is_face_hidden(uint coarse_quad_index)
+{
+ return (extra_coarse_face_data[coarse_quad_index] & coarse_face_hidden_mask) != 0;
+}
+
void main()
{
/* We execute for each quad. */
@@ -69,9 +74,13 @@ void main()
for (int i = 0; i < 4; i++) {
int origindex = input_vert_origindex[start_loop_index + i];
float flag = 0.0;
- if (origindex == -1) {
+ /* Flag for paint mode overlay and normals drawing in edit-mode. */
+ if (is_face_hidden(coarse_quad_index) || (is_edit_mode && origindex == -1)) {
flag = -1.0;
}
+ else if (is_face_selected(coarse_quad_index)) {
+ flag = 1.0;
+ }
loop_normal.flag = flag;
output_lnor[start_loop_index + i] = loop_normal;