263 |
|
/* diffuse reflection */ |
264 |
|
nd.rdiff = 1.0 - nd.trans - nd.rspec; |
265 |
|
|
266 |
< |
if (r->ro != NULL && (r->ro->otype == OBJ_FACE || |
267 |
< |
r->ro->otype == OBJ_RING)) |
266 |
> |
if (r->ro != NULL && isflat(r->ro->otype)) |
267 |
|
nd.specfl |= SP_FLAT; |
268 |
|
|
269 |
|
getacoords(r, &nd); /* set up coordinates */ |
272 |
|
agaussamp(r, &nd); |
273 |
|
|
274 |
|
if (nd.rdiff > FTINY) { /* ambient from this side */ |
275 |
< |
ambient(ctmp, r); |
275 |
> |
ambient(ctmp, r, nd.pnorm); |
276 |
|
if (nd.specfl & SP_RBLT) |
277 |
|
scalecolor(ctmp, 1.0-nd.trans); |
278 |
|
else |
282 |
|
} |
283 |
|
if (nd.tdiff > FTINY) { /* ambient from other side */ |
284 |
|
flipsurface(r); |
285 |
< |
ambient(ctmp, r); |
285 |
> |
ambient(ctmp, r, nd.pnorm); |
286 |
|
if (nd.specfl & SP_TBLT) |
287 |
|
scalecolor(ctmp, nd.trans); |
288 |
|
else |