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:
authorAlexander Gavrilov <angavrilov@gmail.com>2018-09-27 18:38:07 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2018-10-08 14:15:47 +0300
commitba3ef44a6b57970b278c3a99a7ee00906efa3eb7 (patch)
tree654377386ee147e096ebba57725f5949cb32adbe /source/blender/draw/modes/paint_weight_mode.c
parentd12e7818104d01af2bec39cec430456a32d6b69c (diff)
Implement display of weight isoline contours in the fragment shader.
Add an option to display contour lines tracing through points with the same interpolated weight value in weight paint mode. This can be useful for working on gentle gradients over a relatively high resolution mesh, where the difference in color between adjacent vertices is very small. The contour grid has 3 levels of detail going down to step 0.001, which automatically fade in or out based on the weight gradient. Fade out works by capping both screen space and weight space line width, and reducing alpha when the screen space width becomes too small for moire and noise-less rendering. Reviewers: fclem Differential Revision: https://developer.blender.org/D3749
Diffstat (limited to 'source/blender/draw/modes/paint_weight_mode.c')
-rw-r--r--source/blender/draw/modes/paint_weight_mode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/draw/modes/paint_weight_mode.c b/source/blender/draw/modes/paint_weight_mode.c
index f5394e4e925..9060a97f412 100644
--- a/source/blender/draw/modes/paint_weight_mode.c
+++ b/source/blender/draw/modes/paint_weight_mode.c
@@ -140,6 +140,8 @@ static void PAINT_WEIGHT_cache_init(void *vedata)
stl->g_data->fweights_shgrp = DRW_shgroup_create(e_data.weight_face_shader, psl->weight_faces);
+ DRW_shgroup_uniform_bool_copy(stl->g_data->fweights_shgrp, "drawContours", (v3d->overlay.wpaint_flag & V3D_OVERLAY_WPAINT_CONTOURS) != 0);
+
DRW_shgroup_uniform_float(stl->g_data->fweights_shgrp, "opacity", &v3d->overlay.weight_paint_mode_opacity, 1);
DRW_shgroup_uniform_texture(stl->g_data->fweights_shgrp, "colorramp", globals_weight_ramp);
DRW_shgroup_uniform_block(stl->g_data->fweights_shgrp, "globalsBlock", globals_ubo);