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:
authorStefan Werner <stefan.werner@tangent-animation.com>2018-11-23 15:08:15 +0300
committerStefan Werner <stefan.werner@tangent-animation.com>2018-11-23 15:19:53 +0300
commit071f4f4ce0b9520ab0c73d6d68365ad449ca8b80 (patch)
tree9f37bfcac669366b9ad5fb7605f2fbbed9b71b0a /source/blender/editors/sculpt_paint/paint_image_2d.c
parent0a2b2d59a5897212ba3771503feb6770fb636bc8 (diff)
Cycles: Improved robustness of hair motion blur.motion_curve_fix
In some instances, the number of control vertices of a hair could change mid-frame. Cycles would then be unable to calculate proper motion blur for those hairs. This adds interpolated CVs to fill in for the missing data. While this will not necessarily result in a fully accurate reconstruction of the guide hair, it preserves motion blur instead of disabling it. Reviewers: #cycles, sergey Reviewed By: #cycles, sergey Subscribers: sergey, brecht, #cycles Tags: #cycles Differential Revision: https://developer.blender.org/D3695
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_2d.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_2d.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index 76190b13b61..c5bd88d8047 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -409,7 +409,7 @@ static ImBuf *brush_painter_imbuf_new(BrushPainter *painter, int size, float pre
if (is_texbrush) {
brush_imbuf_tex_co(&tex_mapping, x, y, texco);
- BKE_brush_sample_tex_3D(scene, brush, texco, rgba, thread, pool);
+ BKE_brush_sample_tex_3d(scene, brush, texco, rgba, thread, pool);
/* TODO(sergey): Support texture paint color space. */
if (!use_float) {
IMB_colormanagement_scene_linear_to_display_v3(rgba, display);
@@ -484,7 +484,7 @@ static void brush_painter_imbuf_update(
if (!use_texture_old) {
if (is_texbrush) {
brush_imbuf_tex_co(&tex_mapping, x, y, texco);
- BKE_brush_sample_tex_3D(scene, brush, texco, rgba, thread, pool);
+ BKE_brush_sample_tex_3d(scene, brush, texco, rgba, thread, pool);
/* TODO(sergey): Support texture paint color space. */
if (!use_float) {
IMB_colormanagement_scene_linear_to_display_v3(rgba, display);
@@ -700,7 +700,7 @@ static void brush_painter_2d_refresh_cache(ImagePaintState *s, BrushPainter *pai
do_partial_update_mask = true;
renew_maxmask = true;
}
- /* explicilty disable partial update even if it has been enabled above */
+ /* explicitly disable partial update even if it has been enabled above */
if (brush->mask_pressure) {
do_partial_update_mask = false;
renew_maxmask = true;
@@ -1419,8 +1419,9 @@ static void paint_2d_fill_add_pixel_byte(
float color_f[4];
unsigned char *color_b = (unsigned char *)(ibuf->rect + coordinate);
rgba_uchar_to_float(color_f, color_b);
+ straight_to_premul_v4(color_f);
- if (compare_len_squared_v3v3(color_f, color, threshold_sq)) {
+ if (compare_len_squared_v4v4(color_f, color, threshold_sq)) {
BLI_stack_push(stack, &coordinate);
}
BLI_BITMAP_SET(touched, coordinate, true);
@@ -1439,7 +1440,7 @@ static void paint_2d_fill_add_pixel_float(
coordinate = ((size_t)y_px) * ibuf->x + x_px;
if (!BLI_BITMAP_TEST(touched, coordinate)) {
- if (compare_len_squared_v3v3(ibuf->rect_float + 4 * coordinate, color, threshold_sq)) {
+ if (compare_len_squared_v4v4(ibuf->rect_float + 4 * coordinate, color, threshold_sq)) {
BLI_stack_push(stack, &coordinate);
}
BLI_BITMAP_SET(touched, coordinate, true);
@@ -1546,6 +1547,7 @@ void paint_2d_bucket_fill(
else {
int pixel_color_b = *(ibuf->rect + coordinate);
rgba_uchar_to_float(pixel_color, (unsigned char *)&pixel_color_b);
+ straight_to_premul_v4(pixel_color);
}
BLI_stack_push(stack, &coordinate);