Merge branch 'blender-v2.90-release'

This commit is contained in:
Richard Antalik 2020-08-17 20:39:07 +02:00
commit 118e78a844
7 changed files with 20 additions and 5 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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,

View File

@ -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 {

View File

@ -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. */

View File

@ -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);
}

View File

@ -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);