ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/ambcomp.c
(Generate patch)

Comparing ray/src/rt/ambcomp.c (file contents):
Revision 2.88 by greg, Wed Dec 15 01:38:50 2021 UTC vs.
Revision 2.89 by greg, Tue Apr 19 00:36:34 2022 UTC

# Line 178 | Line 178 | getambdiffs(AMBHEMI *hp)
178                  if (i) {                /* from above */
179                          b1 = bright(ap[-hp->ns].v);
180                          d2 = b - b1;
181 <                        d2 *= d2*normf/(b + b1);
181 >                        d2 *= d2*normf/(b + b1 + FTINY);
182                          ep[0] += d2;
183                          ep[-hp->ns] += d2;
184                  }
# Line 186 | Line 186 | getambdiffs(AMBHEMI *hp)
186                                          /* from behind */
187                  b1 = bright(ap[-1].v);
188                  d2 = b - b1;
189 <                d2 *= d2*normf/(b + b1);
189 >                d2 *= d2*normf/(b + b1 + FTINY);
190                  ep[0] += d2;
191                  ep[-1] += d2;
192                  if (!i) continue;
193                                          /* diagonal */
194                  b1 = bright(ap[-hp->ns-1].v);
195                  d2 = b - b1;
196 <                d2 *= d2*normf/(b + b1);
196 >                d2 *= d2*normf/(b + b1 + FTINY);
197                  ep[0] += d2;
198                  ep[-hp->ns-1] += d2;
199              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines