D
Daniel Pitts
Hello everyone.
I've decided (for no reason other than experience) to create my own
ray-tracing engine in Java.
So far so good, but my modeling is completely "reflective", which means
only glossy surfaces. What approach should I take to give the
appearance of matte surfaces?
My thoughts are: When bouncing a ray, if it is a matte surface, average
the value of rays in several directions, rather than just the reflected
ray. For instance. The current reflective approach:
incoming normal outgoing
\ | /
\ t | t /
\ /-|-\ /
\ | /
where "t" is the angle between the normal and incident vectors.
The matt approach
incoming normal outgoing
\ | /
\ t | Ux /
\ /-|-\ /
\ | /
where Ux is some angle related to t, but offset somewhat. There will
also need to be Uy for scattering that isn't coplanar with the incident
and normal. For every reflection off a matte surface, the Ux and Uy
will be calculated several times, and the resulting ray-trace will be
merged (color averaged?)
Is this the right approach? If it is, how would I calculate the new
outgoing values? Am I going the completely wrong direction on this?
Thanks,
Daniel.
I've decided (for no reason other than experience) to create my own
ray-tracing engine in Java.
So far so good, but my modeling is completely "reflective", which means
only glossy surfaces. What approach should I take to give the
appearance of matte surfaces?
My thoughts are: When bouncing a ray, if it is a matte surface, average
the value of rays in several directions, rather than just the reflected
ray. For instance. The current reflective approach:
incoming normal outgoing
\ | /
\ t | t /
\ /-|-\ /
\ | /
where "t" is the angle between the normal and incident vectors.
The matt approach
incoming normal outgoing
\ | /
\ t | Ux /
\ /-|-\ /
\ | /
where Ux is some angle related to t, but offset somewhat. There will
also need to be Uy for scattering that isn't coplanar with the incident
and normal. For every reflection off a matte surface, the Ux and Uy
will be calculated several times, and the resulting ray-trace will be
merged (color averaged?)
Is this the right approach? If it is, how would I calculate the new
outgoing values? Am I going the completely wrong direction on this?
Thanks,
Daniel.