Fix T44240: Lamp Halo invisible in rendering.

Halo is not possible when using 'deep' buffer shadow - reflect that in UI.
When not using buffered shadows, switch lamp bufftype to 'regular' on render, as already
done with 'halfway' method.
This commit is contained in:
Bastien Montagne 2015-04-03 11:17:58 +02:00
parent 43101289a6
commit 89530f1486
Notes: blender-bot 2023-02-14 09:17:54 +01:00
Referenced by issue #44322, Crash when trying to render spotlight halos
Referenced by issue #44240, Buffer shadow bug
2 changed files with 5 additions and 2 deletions

View File

@ -355,6 +355,7 @@ class DATA_PT_spot(DataButtonsPanel, Panel):
col = split.column()
col.active = (lamp.shadow_method != 'BUFFER_SHADOW' or lamp.shadow_buffer_type != 'DEEP')
col.prop(lamp, "use_halo")
sub = col.column(align=True)
sub.active = lamp.use_halo

View File

@ -3813,7 +3813,9 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
}
/* set flag for spothalo en initvars */
if (la->type==LA_SPOT && (la->mode & LA_HALO) && (la->buftype != LA_SHADBUF_DEEP)) {
if ((la->type == LA_SPOT) && (la->mode & LA_HALO) &&
(!(la->mode & LA_SHAD_BUF) || la->buftype != LA_SHADBUF_DEEP))
{
if (la->haint>0.0f) {
re->flag |= R_LAMPHALO;
@ -3832,7 +3834,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
lar->sh_invcampos[2]*= lar->sh_zfac;
/* halfway shadow buffer doesn't work for volumetric effects */
if (lar->buftype == LA_SHADBUF_HALFWAY)
if (ELEM(lar->buftype, LA_SHADBUF_HALFWAY, LA_SHADBUF_DEEP))
lar->buftype = LA_SHADBUF_REGULAR;
}