60 |
|
|
61 |
|
if (r->rod < 0.0) /* reorient if necessary */ |
62 |
|
flipsurface(r); |
63 |
+ |
r->rt = r->rot; /* default ray length */ |
64 |
|
/* get modifiers */ |
65 |
|
raytexture(r, m->omod); |
66 |
|
pdot = raynormal(pnorm, r); |
82 |
|
} |
83 |
|
/* transmitted ray */ |
84 |
|
if (rayorigin(&p, r, TRANS, bright(trans)) == 0) { |
85 |
< |
VCOPY(p.rdir, r->rdir); |
85 |
> |
for (i = 0; i < 3; i++) /* perturb direction */ |
86 |
> |
p.rdir[i] = r->rdir[i] - r->pert[i]/RINDEX; |
87 |
> |
normalize(p.rdir); |
88 |
|
rayvalue(&p); |
89 |
|
multcolor(p.rcol, r->pcol); /* modify */ |
90 |
|
multcolor(p.rcol, trans); |
91 |
|
addcolor(r->rcol, p.rcol); |
92 |
+ |
if (bright(p.rcol) > .5) |
93 |
+ |
r->rt = r->rot + p.rt; |
94 |
|
} |
95 |
+ |
|
96 |
|
if (r->crtype & SHADOW) /* skip reflected ray */ |
97 |
|
return; |
98 |
|
/* compute reflectance */ |