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

Comparing ray/src/rt/m_bsdf.c (file contents):
Revision 2.34 by greg, Mon May 15 22:50:33 2017 UTC vs.
Revision 2.35 by greg, Tue May 16 02:52:15 2017 UTC

# Line 23 | Line 23 | static const char RCSid[] = "$Id$";
23   *  (opposite the surface normal) to bypass any intervening geometry.
24   *  Translation only affects scattered, non-source-directed samples.
25   *  A non-zero thickness has the further side-effect that an unscattered
26 < *  (view) ray will pass right through our material if it has any
27 < *  non-diffuse transmission, making the BSDF surface invisible.  This
28 < *  shows the proxied geometry instead. Thickness has the further
29 < *  effect of turning off reflection on the hidden side so that rays
30 < *  heading in the opposite direction pass unimpeded through the BSDF
26 > *  (view) ray will pass right through our material, making the BSDF
27 > *  surface invisible and showing the proxied geometry instead. Thickness
28 > *  has the further effect of turning off reflection on the reverse side so
29 > *  rays heading in the opposite direction pass unimpeded through the BSDF
30   *  surface.  A paired surface may be placed on the opposide side of
31   *  the detail geometry, less than this thickness away, if a two-way
32   *  proxy is desired.  Note that the sign of the thickness is important.
# Line 36 | Line 35 | static const char RCSid[] = "$Id$";
35   *  hides geometry in front of the surface when rays hit from behind,
36   *  and applies only the transmission and backside reflectance properties.
37   *  Reflection is ignored on the hidden side, as those rays pass through.
38 + *      When thickness is set to zero, shadow rays will be blocked unless
39 + *  a BTDF has a strong "through" component in the source direction.
40 + *  A separate test prevents over-counting by dropping specular & ambient
41 + *  samples that are too close to this "through" direction.  The same
42 + *  restriction applies for the proxy case (thickness != 0).
43   *      The "up" vector for the BSDF is given by three variables, defined
44   *  (along with the thickness) by the named function file, or '.' if none.
45   *  Together with the surface normal, this defines the local coordinate
# Line 43 | Line 47 | static const char RCSid[] = "$Id$";
47   *      We do not reorient the surface, so if the BSDF has no back-side
48   *  reflectance and none is given in the real arguments, a BSDF surface
49   *  with zero thickness will appear black when viewed from behind
50 < *  unless backface visibility is off.
50 > *  unless backface visibility is on, when it becomes invisible.
51   *      The diffuse arguments are added to components in the BSDF file,
52   *  not multiplied.  However, patterns affect this material as a multiplier
53   *  on everything except non-diffuse reflection.
# Line 59 | Line 63 | static const char RCSid[] = "$Id$";
63   /*
64   * Note that our reverse ray-tracing process means that the positions
65   * of incoming and outgoing vectors may be reversed in our calls
66 < * to the BSDF library.  This is fine, since the bidirectional nature
66 > * to the BSDF library.  This is usually fine, since the bidirectional nature
67   * of the BSDF (that's what the 'B' stands for) means it all works out.
68   */
69  
# Line 72 | Line 76 | typedef struct {
76          RREAL   toloc[3][3];    /* world to local BSDF coords */
77          RREAL   fromloc[3][3];  /* local BSDF coords to world */
78          double  thick;          /* surface thickness */
79 <        COLOR   cthru;          /* through component multiplier */
79 >        COLOR   cthru;          /* "through" component multiplier */
80          SDData  *sd;            /* loaded BSDF data */
81          COLOR   rdiff;          /* diffuse reflection */
82          COLOR   tdiff;          /* diffuse transmission */
# Line 80 | Line 84 | typedef struct {
84  
85   #define cvt_sdcolor(cv, svp)    ccy2rgb(&(svp)->spec, (svp)->cieY, cv)
86  
87 < /* Compute through component color */
87 > /* Compute "through" component color */
88   static void
89   compute_through(BSDFDAT *ndp)
90   {
# Line 148 | Line 152 | compute_through(BSDFDAT *ndp)
152                  goto baderror;
153          if (tomega > 1.5*dfp->minProjSA)
154                  return;                         /* not really a peak? */
155 <        if ((bright(vpeak) - ndp->sd->tLamb.cieY*(1./PI))*tomega <= .001)
156 <                return;                         /* < 0.1% transmission */
155 >        if ((bright(vpeak) - ndp->sd->tLamb.cieY*(1./PI))*tomega <= .007)
156 >                return;                         /* < 0.7% transmission */
157          for (i = 3; i--; )                      /* remove peak from average */
158                  colval(vsum,i) -= colval(vpeak,i);
159          --nsum;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines