diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-01-28 20:39:58 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-01-28 20:39:58 +0300 |
commit | 14deacdc22875c87ce2005a21d99257a03da738f (patch) | |
tree | aaa9e146403373a1e2ca844478a176f8d9cc308d /source/blender | |
parent | b7075049732a0df53be6483ab5fc2333398b9ebb (diff) | |
parent | b2034c6ba245e131e6ecabe33ca9afa1e6394247 (diff) |
Merge branch 'blender-v2.82-release'
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_scene.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 11 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_particles.c | 25 | ||||
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_defaults.h | 1 |
6 files changed, 21 insertions, 31 deletions
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 51abc7390b8..40b4883349d 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -173,6 +173,8 @@ bool BKE_scene_uses_blender_eevee(const struct Scene *scene); bool BKE_scene_uses_blender_workbench(const struct Scene *scene); bool BKE_scene_uses_cycles(const struct Scene *scene); +void BKE_scene_copy_data_eevee(struct Scene *sce_dst, const struct Scene *sce_src); + void BKE_scene_disable_color_management(struct Scene *scene); bool BKE_scene_check_color_management_enabled(const struct Scene *scene); bool BKE_scene_check_rigidbody_active(const struct Scene *scene); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 244ffb674a4..6b87cf2df81 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3246,22 +3246,24 @@ static void psys_cache_edit_paths_iter(void *__restrict iter_data_v, } } else { + /* HACK(fclem): Instead of setting the color we pass the select state in the red channel. + * This is then picked up in DRW and the gpu shader will do the color interpolation. */ if ((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT) { if ((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT) { - copy_v3_v3(ca->col, iter_data->sel_col); + ca->col[0] = 1.0f; } else { keytime = (t - (*pind.ekey[0]->time)) / ((*pind.ekey[1]->time) - (*pind.ekey[0]->time)); - interp_v3_v3v3(ca->col, iter_data->sel_col, iter_data->nosel_col, keytime); + ca->col[0] = 1.0f - keytime; } } else { if ((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT) { keytime = (t - (*pind.ekey[0]->time)) / ((*pind.ekey[1]->time) - (*pind.ekey[0]->time)); - interp_v3_v3v3(ca->col, iter_data->nosel_col, iter_data->sel_col, keytime); + ca->col[0] = keytime; } else { - copy_v3_v3(ca->col, iter_data->nosel_col); + ca->col[0] = 0.0f; } } } diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 2fda6cfb43b..86b15641f81 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -351,6 +351,13 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, cons sce_dst->preview = NULL; } + BKE_scene_copy_data_eevee(sce_dst, sce_src); +} + +void BKE_scene_copy_data_eevee(Scene *sce_dst, const Scene *sce_src) +{ + /* Copy eevee data between scenes. */ + sce_dst->eevee = sce_src->eevee; sce_dst->eevee.light_cache = NULL; sce_dst->eevee.light_cache_info[0] = '\0'; /* TODO Copy the cache. */ @@ -374,9 +381,7 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type) sce_copy->unit = sce->unit; sce_copy->physics_settings = sce->physics_settings; sce_copy->audio = sce->audio; - sce_copy->eevee = sce->eevee; - sce_copy->eevee.light_cache = NULL; - sce_copy->eevee.light_cache_info[0] = '\0'; + BKE_scene_copy_data_eevee(sce_copy, sce); if (sce->id.properties) { sce_copy->id.properties = IDP_CopyProperty(sce->id.properties); diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index f4057927d55..795e7be63b1 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -637,23 +637,6 @@ static void particle_batch_cache_fill_segments_proc_pos(ParticleCacheKey **path_ } } -static float particle_key_select_ratio(const PTCacheEdit *edit, int strand, float t) -{ - const PTCacheEditPoint *point = &edit->points[strand]; - float edit_key_seg_t = 1.0f / (point->totkey - 1); - if (t == 1.0) { - return (point->keys[point->totkey - 1].flag & PEK_SELECT) ? 1.0f : 0.0; - } - else { - float interp = t / edit_key_seg_t; - int index = (int)interp; - interp -= floorf(interp); /* Time between 2 edit key */ - float s1 = (point->keys[index].flag & PEK_SELECT) ? 1.0f : 0.0; - float s2 = (point->keys[index + 1].flag & PEK_SELECT) ? 1.0f : 0.0; - return s1 + interp * (s2 - s1); - } -} - static float particle_key_weight(const ParticleData *particle, int strand, float t) { const ParticleData *part = particle + strand; @@ -673,8 +656,8 @@ static float particle_key_weight(const ParticleData *particle, int strand, float } static int particle_batch_cache_fill_segments_edit( - const PTCacheEdit *edit, /* NULL for weight data */ - const ParticleData *particle, /* NULL for select data */ + const PTCacheEdit *UNUSED(edit), /* NULL for weight data */ + const ParticleData *particle, /* NULL for select data */ ParticleCacheKey **path_cache, const int start_index, const int num_path_keys, @@ -697,8 +680,8 @@ static int particle_batch_cache_fill_segments_edit( seg_data->color = (weight < 1.0f) ? weight : 1.0f; } else { - float selected = particle_key_select_ratio(edit, i, strand_t); - seg_data->color = selected; + /* Computed in psys_cache_edit_paths_iter(). */ + seg_data->color = path[j].col[0]; } GPU_indexbuf_add_generic_vert(elb, curr_point); curr_point++; diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index 56ff733483f..f96f5f119c0 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -118,8 +118,7 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count) : Str freestyle_scene->id.properties = IDP_CopyProperty_ex(old_scene->id.properties, 0); } // Copy eevee render settings. - freestyle_scene->eevee = old_scene->eevee; - freestyle_scene->eevee.light_cache = NULL; + BKE_scene_copy_data_eevee(freestyle_scene, old_scene); /* Render with transparent background. */ freestyle_scene->r.alphamode = R_ALPHAPREMUL; diff --git a/source/blender/makesdna/DNA_object_defaults.h b/source/blender/makesdna/DNA_object_defaults.h index 1105a8fd4e1..554d68f2d4a 100644 --- a/source/blender/makesdna/DNA_object_defaults.h +++ b/source/blender/makesdna/DNA_object_defaults.h @@ -66,7 +66,6 @@ .col_mask = 0xffff, \ .preview = NULL, \ .duplicator_visibility_flag = OB_DUPLI_FLAG_VIEWPORT | OB_DUPLI_FLAG_RENDER, \ - .fluidsimSettings = NULL, \ .pc_ids = {NULL, NULL}, \ } |