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

Comparing ray/src/cv/bsdfmesh.c (file contents):
Revision 2.8 by greg, Wed Mar 20 01:00:22 2013 UTC vs.
Revision 2.9 by greg, Fri Jun 28 23:18:51 2013 UTC

# Line 438 | Line 438 | mesh_from_edge(MIGRATION *edge)
438                  }
439          }
440   }
441
442 /* Compute minimum BSDF from histogram and clear it */
443 static void
444 comp_bsdf_min()
445 {
446        int     cnt;
447        int     i, target;
448
449        cnt = 0;
450        for (i = HISTLEN; i--; )
451                cnt += bsdf_hist[i];
452
453        target = cnt/100;                       /* ignore bottom 1% */
454        cnt = 0;
455        for (i = 0; cnt <= target; i++)
456                cnt += bsdf_hist[i];
457        bsdf_min = histval(i-1);
458        memset(bsdf_hist, 0, sizeof(bsdf_hist));
459 }
441          
442   /* Build our triangle mesh from recorded RBFs */
443   void
# Line 492 | Line 473 | build_mesh(void)
473                  mesh_from_edge(create_migration(shrt_edj[0], shrt_edj[1]));
474          else
475                  mesh_from_edge(create_migration(shrt_edj[1], shrt_edj[0]));
495                                                /* compute minimum BSDF */
496        comp_bsdf_min();
476                                                  /* complete migrations */
477          await_children(nchild);
478   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines