Flag for 'only shadow' was still working when lamp type switched to
Hemi. Also 'only shadow' didnt work yet for ray_shadow Spot lamp.
This commit is contained in:
Ton Roosendaal 2004-04-29 16:20:34 +00:00
parent d6eeceb83d
commit 97f2cf05f5
2 changed files with 26 additions and 25 deletions

@ -1927,11 +1927,11 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
if(i>0.0 && (R.r.mode & R_SHADOW)) {
if(ma->mode & MA_SHADOW) {
if(lar->type==LA_HEMI); // no shadow
else {
if(lar->shb) {
shadfac[3] = testshadowbuf(lar->shb, shi->co, inp);
}
else if(lar->type==LA_HEMI); // no shadow
else if(lar->mode & LA_SHAD_RAY) {
// this extra 0.001 prevents boundary cases (shadow on smooth sphere)
if((shi->vlr->n[0]*lv[0] + shi->vlr->n[1]*lv[1] + shi->vlr->n[2]*lv[2]) > -0.001)
@ -1955,6 +1955,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
i*= shadfac[3];
}
}
}
/* specularity */
if(shadfac[3]>0.0 && ma->spec!=0.0 && !(lar->mode & LA_NO_SPEC)) {

@ -1763,7 +1763,7 @@ void RE_add_render_lamp(Object *ob, int doshadbuf)
lar->spottexfac= 1.0/(xn);
if(lar->mode & LA_ONLYSHADOW) {
if((lar->mode & LA_SHAD)==0) lar->mode -= LA_ONLYSHADOW;
if((lar->mode & (LA_SHAD|LA_SHAD_RAY))==0) lar->mode -= LA_ONLYSHADOW;
}
}