|
|
I've scripted a little program which places
tons and thousands of triangles in front of
the camera, effectively placing a set of triangles
in front of each pixel (if the triangles are set
to that resolution).
Anyways. What I currently do is take the color
information I gather from trace()-ing the objects
and calculating the resulting specular highlights,
and then place the color as a transparent rectangle
across a single pixel. I've got a crude method of
calculating how much the pixel has to be transparent
to get a similiar results, still, my calculations seem
somewhat more washed and smoother than what
POV-Ray calculates.
Here's the description on what I coded:
1. I calculate the Specular intensity like POV-Ray does, but
without the color component.
2. If the intensity is above 0, I add the color of the object to
an internal color-declaration. I also count the amount of
highlights added to a certain pixel, and add the intensities
for each pixel.
3. I normalize the color and multiply it with 1.85 (which is
slightly larger than sqrt(3), which is the length of <1,1,1>, pure
white)
4. I calculate the transparency of the pixel as follows:
pow(1-_Affect_T/_Affect_Counter,3);
Where _Affect_T is intensities and Affect_Counter is amount
of highlights at that pixel.
5. I put everything into rgbt and use that as pigment for the
pixel-quad.
The results are seen below: My calculated version is a little different,
in that it covers a slightly larger region and has a lesser degree of
"gradient" when moving from bright white highlight to the rim of the
highlight. Mine is much smoother in that regard than POV-Ray's.
Any suggestion on how to properly match it?
--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: Tim### [at] gmxde
Post a reply to this message
Attachments:
Download 'pixel320_without.jpg' (21 KB)
Download 'pixel320_PPP.jpg' (21 KB)
Preview of image 'pixel320_without.jpg'
Preview of image 'pixel320_PPP.jpg'
|
|