Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
Made hack for irradiance calculation even uglier to accommodate BSDF …
Browse files Browse the repository at this point in the history
…proxies
  • Loading branch information
Gregungory committed May 16, 2016
1 parent 6c75135 commit 4c73101
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/rt/raytrace.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: raytrace.c,v 2.70 2016/03/17 21:53:42 greg Exp $";
static const char RCSid[] = "$Id: raytrace.c,v 2.71 2016/05/16 17:32:10 greg Exp $";
#endif
/*
* raytrace.c - routines for tracing and shading rays.
Expand Down Expand Up @@ -199,6 +199,11 @@ raytrans( /* transmit ray as is */
}


/* Macro for test to see if BSDF material uses proxy */
#define isBSDFproxy(m) ((m)->otype == MAT_BSDF && (m)->oargs.nsargs && \
strcmp((m)->oargs.sarg[0], "0"))


int
rayshade( /* shade ray r with material mod */
RAY *r,
Expand All @@ -207,7 +212,7 @@ rayshade( /* shade ray r with material mod */
{
OBJREC *m;

r->rt = r->rot; /* set effective ray length */
r->rt = r->rot; /* preset effective ray length */
for ( ; mod != OVOID; mod = m->omod) {
m = objptr(mod);
/****** unnecessary test since modifier() is always called
Expand All @@ -218,8 +223,9 @@ rayshade( /* shade ray r with material mod */
******/
/* hack for irradiance calculation */
if (do_irrad && !(r->crtype & ~(PRIMARY|TRANS)) &&
(ofun[m->otype].flags & (T_M|T_X)) &&
m->otype != MAT_CLIP &&
(ofun[m->otype].flags & (T_M|T_X))) {
!isBSDFproxy(m)) {
if (irr_ignore(m->otype)) {
raytrans(r);
return(1);
Expand Down

0 comments on commit 4c73101

Please sign in to comment.