diff options
author | Richard Antalik <richardantalik@gmail.com> | 2020-08-17 21:39:07 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2020-08-17 21:39:07 +0300 |
commit | 118e78a8448d0237c1ed2b82badc7a25cd20e713 (patch) | |
tree | 561d3c3509af7d23a3ace2c0f92ef344fab7cb0a | |
parent | ac41215f074f37859a44adeef04711c24572ebc1 (diff) | |
parent | 4b69e55da358cbfe98fd9ac85151a7107315959b (diff) |
Merge branch 'blender-v2.90-release'
-rw-r--r-- | intern/cycles/kernel/svm/svm_sky.h | 2 | ||||
-rw-r--r-- | intern/cycles/render/light.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/render/nodes.cpp | 6 | ||||
-rw-r--r-- | intern/cycles/render/nodes.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/seqcache.c | 1 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_edit.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 2 |
7 files changed, 20 insertions, 5 deletions
diff --git a/intern/cycles/kernel/svm/svm_sky.h b/intern/cycles/kernel/svm/svm_sky.h index f824184c1d4..b908732f026 100644 --- a/intern/cycles/kernel/svm/svm_sky.h +++ b/intern/cycles/kernel/svm/svm_sky.h @@ -137,7 +137,7 @@ ccl_device float3 sky_radiance_nishita(KernelGlobals *kg, float sun_rotation = nishita_data[7]; float angular_diameter = nishita_data[8]; float sun_intensity = nishita_data[9]; - bool sun_disc = (angular_diameter > 0.0f); + bool sun_disc = (angular_diameter >= 0.0f); float3 xyz; /* convert dir to spherical coordinates */ float2 direction = direction_to_spherical(dir); diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp index 183c02cb6b9..567a53afc98 100644 --- a/intern/cycles/render/light.cpp +++ b/intern/cycles/render/light.cpp @@ -634,7 +634,7 @@ void LightManager::device_update_background(Device *device, sun_direction = transform_direction(&sky_transform, sun_direction); /* Pack sun direction and size. */ - float half_angle = sky->sun_size * 0.5f; + float half_angle = sky->get_sun_size() * 0.5f; kbackground->sun = make_float4( sun_direction.x, sun_direction.y, sun_direction.z, half_angle); diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index d5f65fb54db..a50544242f7 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -776,7 +776,7 @@ static void sky_texture_precompute_nishita(SunSky *sunsky, sunsky->nishita_data[5] = pixel_top[2]; sunsky->nishita_data[6] = sun_elevation; sunsky->nishita_data[7] = sun_rotation; - sunsky->nishita_data[8] = sun_disc ? sun_size : 0.0f; + sunsky->nishita_data[8] = sun_disc ? sun_size : -1.0f; sunsky->nishita_data[9] = sun_intensity; } @@ -834,7 +834,7 @@ void SkyTextureNode::compile(SVMCompiler &compiler) sky_texture_precompute_nishita(&sunsky, sun_disc, - sun_size, + get_sun_size(), sun_intensity, sun_elevation, sun_rotation, @@ -930,7 +930,7 @@ void SkyTextureNode::compile(OSLCompiler &compiler) sky_texture_precompute_nishita(&sunsky, sun_disc, - sun_size, + get_sun_size(), sun_intensity, sun_elevation, sun_rotation, diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h index 326f1d14168..c21bcacb3ce 100644 --- a/intern/cycles/render/nodes.h +++ b/intern/cycles/render/nodes.h @@ -179,6 +179,12 @@ class SkyTextureNode : public TextureNode { float ozone_density; float3 vector; ImageHandle handle; + + float get_sun_size() + { + /* Clamping for numerical precision. */ + return fmaxf(sun_size, 0.0005f); + } }; class OutputNode : public ShaderNode { diff --git a/source/blender/blenkernel/intern/seqcache.c b/source/blender/blenkernel/intern/seqcache.c index 3d1f33190dc..7d2858050be 100644 --- a/source/blender/blenkernel/intern/seqcache.c +++ b/source/blender/blenkernel/intern/seqcache.c @@ -1326,6 +1326,7 @@ void BKE_sequencer_cache_put(const SeqRenderData *context, context = BKE_sequencer_prefetch_get_original_context(context); scene = context->scene; seq = BKE_sequencer_prefetch_get_original_sequence(seq, scene); + BLI_assert(seq != NULL); } /* Prevent reinserting, it breaks cache key linking. */ diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 99d4c2d9f1a..78ca2832c55 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -2642,6 +2642,8 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op) seq = ed->seqbasep->first; /* Poll checks this is valid. */ + BKE_sequencer_prefetch_stop(scene); + while (seq) { if ((seq->flag & SELECT) && (seq->type == SEQ_TYPE_IMAGE) && (seq->len > 1)) { Sequence *seq_next; @@ -2837,6 +2839,8 @@ static int sequencer_meta_make_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } + BKE_sequencer_prefetch_stop(scene); + /* Remove all selected from main list, and put in meta. */ seqm = BKE_sequence_alloc(ed->seqbasep, 1, 1, SEQ_TYPE_META); /* Channel number set later. */ @@ -2922,6 +2926,8 @@ static int sequencer_meta_separate_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_CANCELLED; } + BKE_sequencer_prefetch_stop(scene); + for (seq = last_seq->seqbase.first; seq != NULL; seq = seq->next) { BKE_sequence_invalidate_cache_composite(scene, seq); } diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 0cfc6fd569c..629dc104ab5 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -637,6 +637,8 @@ static void rna_Sequence_name_set(PointerRNA *ptr, const char *value) char oldname[sizeof(seq->name)]; AnimData *adt; + BKE_sequencer_prefetch_stop(scene); + /* make a copy of the old name first */ BLI_strncpy(oldname, seq->name + 2, sizeof(seq->name) - 2); |