POV-Ray : Newsgroups : povray.programming : Alternative rendering algorithm : Alternative rendering algorithm Server Time
30 Jun 2024 12:38:05 EDT (-0400)
  Alternative rendering algorithm  
From: Christopher James Huff
Date: 9 Apr 2004 14:41:30
Message: <cjameshuff-1204FF.14421809042004@news.povray.org>
The main reason glass objects are so slow to render is the fact that 
they require tracing two additional rays for each ray that hits a glass 
surface, one for reflection, one for refraction. This means that the 
number of rays increases with trace level as the nth power of 2: at a 
trace level of 2, 4 additional rays are required. With a trace level of 
5, 25 additional rays are required. If you have max_trace_level of 12 in 
a scene with a lot of glass, you may need to trace as many as 144 extra 
rays.

Some time ago, I heard about another method that follows rays through 
the scene one path at a time instead of splitting the rays at each 
surface. When a surface that both reflects and refracts is hit, one of 
the two is chosen at random. This is done many times for each pixel, 
sampling the possible light paths without taking the time to compute all 
of the deepest, least important paths and taking care of antialiasing at 
the same time.

I did some tests using my own raytracer, and it is possible to get good 
results with a very good increase in rendering speed. I've come up with 
two different algorithms based on this technique. The first chooses 
randomly between refraction and reflection for each material evaluation, 
which gives grainy results unless a lot of samples are used. The second 
makes these choices for an entire pass of the image. That is, it renders 
the image in multiple passes, deciding whether to do reflection or 
refraction for each trace level and using the same choices for the 
entire image pass. 64 passes with this technique took 5 minutes, where 
the traditional technique required 9 minutes.

I've posted three images in povray.binaries.images demonstrating the 
traditional method and the two new methods.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

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