forked from bartvdbraak/blender
Two bugfixes:
#5387: transparent shadow crashed, caused by passes recode irc report: buffer shadow for tangent shaders didn't work. (2.42 bug)
This commit is contained in:
parent
902a69a7d3
commit
9e634957e0
@ -1950,9 +1950,16 @@ static void ray_trace_shadow_tra(Isect *is, int depth, int traflag)
|
|||||||
float d= 1.0f;
|
float d= 1.0f;
|
||||||
/* we got a face */
|
/* we got a face */
|
||||||
|
|
||||||
|
shi.depth= 1; /* only used to indicate tracing */
|
||||||
shi.mask= 1;
|
shi.mask= 1;
|
||||||
shi.osatex= 0;
|
shi.osatex= 0;
|
||||||
shi.depth= 1; // only now to indicate tracing
|
shi.thread= 0;
|
||||||
|
shi.lay= 0;
|
||||||
|
shi.passflag= 0;
|
||||||
|
shi.combinedflag= 0;
|
||||||
|
shi.do_preview= 0;
|
||||||
|
shi.light_override= NULL;
|
||||||
|
shi.mat_override= NULL;
|
||||||
|
|
||||||
shade_ray(is, &shi, &shr);
|
shade_ray(is, &shi, &shr);
|
||||||
if (traflag & RAY_TRA)
|
if (traflag & RAY_TRA)
|
||||||
|
@ -1152,6 +1152,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
|
|||||||
if(lar->mode & LA_TEXTURE) do_lamp_tex(lar, lv, shi, lacol);
|
if(lar->mode & LA_TEXTURE) do_lamp_tex(lar, lv, shi, lacol);
|
||||||
|
|
||||||
/* tangent case; calculate fake face normal, aligned with lampvector */
|
/* tangent case; calculate fake face normal, aligned with lampvector */
|
||||||
|
/* note, vnor==vn is used as tangent trigger for buffer shadow */
|
||||||
if(vlr->flag & R_TANGENT) {
|
if(vlr->flag & R_TANGENT) {
|
||||||
float cross[3];
|
float cross[3];
|
||||||
Crossf(cross, lv, vn);
|
Crossf(cross, lv, vn);
|
||||||
@ -1234,6 +1235,9 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
|
|||||||
if(ma->mode & MA_SHADOW) {
|
if(ma->mode & MA_SHADOW) {
|
||||||
if(lar->shb || (lar->mode & LA_SHAD_RAY)) {
|
if(lar->shb || (lar->mode & LA_SHAD_RAY)) {
|
||||||
|
|
||||||
|
if(vn==vnor) /* tangent trigger */
|
||||||
|
lamp_get_shadow(lar, shi, INPR(shi->vn, lv), shadfac, shi->depth);
|
||||||
|
else
|
||||||
lamp_get_shadow(lar, shi, inp, shadfac, shi->depth);
|
lamp_get_shadow(lar, shi, inp, shadfac, shi->depth);
|
||||||
|
|
||||||
/* warning, here it skips the loop */
|
/* warning, here it skips the loop */
|
||||||
|
Loading…
Reference in New Issue
Block a user