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

Comparing ray/src/common/depthcodec.c (file contents):
Revision 2.10 by greg, Thu Mar 5 17:43:22 2020 UTC vs.
Revision 2.11 by greg, Tue Jan 26 18:47:25 2021 UTC

# Line 252 | Line 252 | compute_worldpos(FVECT wpos, DEPTHCODEC *dcp, int x, i
252          RREAL   loc[2];
253          FVECT   rdir;
254  
255 +        if (d >= FHUGE*.99)
256 +                goto badval;
257 +
258          pix2loc(loc, &dcp->res, x, y);
259  
260 <        if (viewray(wpos, rdir, &dcp->vw, loc[0], loc[1]) < -FTINY) {
261 <                VCOPY(wpos, dcp->vw.vp);
262 <                return 0;
260 >        if (viewray(wpos, rdir, &dcp->vw, loc[0], loc[1]) >= -FTINY) {
261 >                VSUM(wpos, wpos, rdir, d);
262 >                return 1;
263          }
264 <        VSUM(wpos, wpos, rdir, d);
265 <        return 1;
264 > badval:
265 >        VCOPY(wpos, dcp->vw.vp);
266 >        return 0;
267   }
268  
269  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines