ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/Development/ray/src/rt/RcontribSimulManager.cpp
(Generate patch)

Comparing ray/src/rt/RcontribSimulManager.cpp (file contents):
Revision 2.21 by greg, Mon Oct 27 18:38:32 2025 UTC vs.
Revision 2.23 by greg, Tue Nov 11 02:08:52 2025 UTC

# Line 203 | Line 203 | RcontribSimulManager::RctCall(RAY *r, void *cd)
203          if (!mp)
204                  return 0;               // not in our modifier list
205  
206 <        int                     bi = 0; // get bin index
206 >        int     i;                      // pre-emptive check for zero
207 >        if (rcp->HasFlag(RCcontrib)) {
208 >                for (i = NCSAMP; i--; )
209 >                        if (r->rcoef[i]*r->rcol[i] > FTINY)
210 >                                break;
211 >                if (i < 0)
212 >                        return 0;       // zero contribution
213 >        } else if (sintens(r->rcoef) <= FTINY)
214 >                return 0;               // zero coefficient
215 >
216 >        int     bi = 0;                 // get bin index
217          if (mp->binv) {
218                  worldfunc(RCCONTEXT, r);
219                  set_eparams(mp->params);
# Line 223 | Line 233 | RcontribSimulManager::RctCall(RAY *r, void *cd)
233          if (rcp->HasFlag(RCcontrib))
234                  smultscolor(contr, r->rcol);    // -> value contribution
235  
236 <        for (int i = 0; i < NCSAMP; i++)
236 >        for (i = 0; i < NCSAMP; i++)
237                  *dvp++ += contr[i];             // accumulate color/spectrum
238          return 1;
239   }

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)