224 |
|
setcolor(nd.tdiff, m->oargs.farg[6], |
225 |
|
m->oargs.farg[7], |
226 |
|
m->oargs.farg[8]); |
227 |
< |
/* get modifiers */ |
227 |
> |
/* get modifiers */ |
228 |
|
raytexture(r, m->omod); |
229 |
|
nd.pdot = raynormal(nd.pnorm, r); /* perturb normal */ |
230 |
|
if (r->rod < 0.0) { /* orient perturbed values */ |
338 |
|
if (m->oargs.nsargs < (hasdata(m->otype)?4:2) | m->oargs.nfargs < |
339 |
|
(m->otype==MAT_TFUNC|m->otype==MAT_TDATA?6:4)) |
340 |
|
objerror(m, USER, "bad # arguments"); |
341 |
+ |
/* check for back side */ |
342 |
+ |
if (r->rod < 0.0) { |
343 |
+ |
if (!backvis && m->otype != MAT_TFUNC |
344 |
+ |
&& m->otype != MAT_TDATA) { |
345 |
+ |
raytrans(r); |
346 |
+ |
return(1); |
347 |
+ |
} |
348 |
+ |
raytexture(r, m->omod); |
349 |
+ |
flipsurface(r); /* reorient if backvis */ |
350 |
+ |
} else |
351 |
+ |
raytexture(r, m->omod); |
352 |
+ |
|
353 |
|
nd.mp = m; |
354 |
|
nd.pr = r; |
355 |
|
/* get material color */ |
371 |
|
/* compute reflectance */ |
372 |
|
dtmp = 1.0 - nd.trans - nd.rspec; |
373 |
|
setcolor(nd.rdiff, dtmp, dtmp, dtmp); |
362 |
– |
/* check for back side */ |
363 |
– |
if (r->rod < 0.0) { |
364 |
– |
if (!backvis && m->otype != MAT_TFUNC |
365 |
– |
&& m->otype != MAT_TDATA) { |
366 |
– |
raytrans(r); |
367 |
– |
return(1); |
368 |
– |
} |
369 |
– |
flipsurface(r); /* reorient if backvis */ |
370 |
– |
} |
371 |
– |
/* get modifiers */ |
372 |
– |
raytexture(r, m->omod); |
374 |
|
nd.pdot = raynormal(nd.pnorm, r); /* perturb normal */ |
375 |
|
multcolor(nd.mcolor, r->pcol); /* modify material color */ |
376 |
|
multcolor(nd.rdiff, nd.mcolor); |