|
 |
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'

|
 |