POV-Ray : Newsgroups : povray.binaries.images : Backward Forward Raytracing(?) : Backward Forward Raytracing(?) Server Time
4 Nov 2024 17:56:57 EST (-0500)
  Backward Forward Raytracing(?)  
From: triple r
Date: 9 Apr 2008 23:35:01
Message: <web.47fd8a6d74f49bc3ae42298f0@news.povray.org>
With such nice results going around I wanted to give this a try.  Here's the
image along with the full (!) implementation.  Feel free to laugh; just don't
say it doesn't work.  In short, it's just a modification for diffuse
reflection--so I hope you aren't too attached to color or specular reflection.

- Ricky


From lighting.cpp (line 2736):

e3[X]= 0.798698855654525;    //<--chosen with random number
e3[Y]=-0.402578539654782;    //generator.  Guaranteed to be
e3[Z]=-0.974274249331249;    //random every time. (#221) ;-)
VCross(e2,Jitter_Normal,e3); //set up a surface-normal
VNormalize(e3,e2);           //coord system at the point
VCross(e2,Jitter_Normal,e3); //of interest.
r1=sqrt(drand48());          //project the unit disc onto the
th=2.0*M_PI*drand48();       //unit sphere to get the proper
x1=r1*cos(th);               //distribution of diffusely
x2=r1*sin(th);               //reflected random rays
y1=sqrt(1.0-r1*r1);
VLinComb3(New_Ray.Direction, x1, e2, x2, e3, y3, Jitter_Normal);


Post a reply to this message


Attachments:
Download 'room2.jpg' (100 KB)

Preview of image 'room2.jpg'
room2.jpg


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.