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

Comparing ray/src/rt/ambient.c (file contents):
Revision 2.86 by greg, Wed May 7 01:16:03 2014 UTC vs.
Revision 2.87 by greg, Fri May 9 16:40:01 2014 UTC

# Line 443 | Line 443 | sumambient(            /* get interpolated ambient value */
443                  /*
444                   *  Ambient level test
445                   */
446 <                if (av->lvl > al)       /* list sorted, so this works */
446 >                if (av->lvl > al ||     /* list sorted, so this works */
447 >                                (av->lvl == al) & (av->weight < 0.9*r->rweight))
448                          break;
448                if (av->weight < 0.9*r->rweight)
449                        continue;
449                  /*
450                   *  Direction test using unperturbed normal
451                   */
# Line 608 | Line 607 | avinsert(                              /* insert ambient value in our tree */
607          }
608          avh.next = at->alist;           /* order by increasing level */
609          for (ap = &avh; ap->next != NULL; ap = ap->next)
610 <                if (ap->next->lvl >= av->lvl)
610 >                if ( ap->next->lvl > av->lvl ||
611 >                                (ap->next->lvl == av->lvl) &
612 >                                (ap->next->weight <= av->weight) )
613                          break;
614          av->next = ap->next;
615          ap->next = (AMBVAL*)av;
# Line 721 | Line 722 | sumambient(    /* get interpolated ambient value */
722                  /*
723                   *  Ambient level test.
724                   */
725 <                if (av->lvl > al)       /* list sorted, so this works */
725 >                if (av->lvl > al ||     /* list sorted, so this works */
726 >                                (av->lvl == al) & (av->weight < 0.9*r->rweight))
727                          break;
726                if (av->weight < 0.9*r->rweight)
727                        continue;
728                  /*
729                   *  Ambient radius test.
730                   */
# Line 906 | Line 906 | avinsert(                              /* insert ambient value in our tree */
906          }
907          avh.next = at->alist;           /* order by increasing level */
908          for (ap = &avh; ap->next != NULL; ap = ap->next)
909 <                if (ap->next->lvl >= av->lvl)
909 >                if ( ap->next->lvl > av->lvl ||
910 >                                (ap->next->lvl == av->lvl) &
911 >                                (ap->next->weight <= av->weight) )
912                          break;
913          av->next = ap->next;
914          ap->next = (AMBVAL*)av;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines