POV-Ray : Newsgroups : povray.programming : Alternative rendering algorithm Server Time
22 Dec 2024 17:31:36 EST (-0500)
  Alternative rendering algorithm (Message 1 to 4 of 4)  
From: Christopher James Huff
Subject: Alternative rendering algorithm
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

From: Christoph Hormann
Subject: Re: Alternative rendering algorithm
Date: 9 Apr 2004 15:35:02
Message: <c56tkq$mtt$1@chho.imagico.de>
Christopher James Huff wrote:
> 
> 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.

That's how you do it with path tracing - noisy images are usually the 
result unless you use really lot of samples.

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

You mean 64 passes together 5 minutes?  And how do you combine them?

The problem also is you usually don't have only reflection and 
refraction but also a diffuse part.

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

Were not viewable here.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 21 Mar. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Warp
Subject: Re: Alternative rendering algorithm
Date: 9 Apr 2004 17:51:45
Message: <40771af1@news.povray.org>
Christopher James Huff <cja### [at] earthlinknet> wrote:
> I've posted three images in povray.binaries.images demonstrating the 
> traditional method and the two new methods.

  Perhaps posting in a way which is viewable by other people may be a
good idea.
  I only saw three posts with an attachment called "attachment" (and
nothing else). Absolutely no way of knowing what it is and how to
look at it. Not a very good idea if you really want people to see
them.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Christopher James Huff
Subject: Re: Alternative rendering algorithm
Date: 9 Apr 2004 20:17:12
Message: <cjameshuff-9FD7D7.20175909042004@news.povray.org>
In article <c56tkq$mtt$1@chho.imagico.de>,
 Christoph Hormann <chr### [at] gmxde> wrote:

> That's how you do it with path tracing - noisy images are usually the 
> result unless you use really lot of samples.

The second path tracing method uses the same choices for every pixel of 
a pass, removing the noisiness. However, that means the entire image is 
equally inaccurate if you use too few samples. (or get really unlucky)

I've also had good results with using single-path tracing once the trace 
level reaches a certain depth. Splitting for the first 3 levels and then 
following single paths seems to give good results with few samples, and 
trimming out enough of the deeper rays to give a good speedup.


> You mean 64 passes together 5 minutes? 

Yes.


> And how do you combine them?

A simple average. Each pass is traced at a slight offset, with the 
result of the ray origins covering the pixels.


> The problem also is you usually don't have only reflection and 
> refraction but also a diffuse part.

That's always computed, no matter what. I could make it a third "path", 
but I don't think the results would be very good. 


> > I've posted three images in povray.binaries.images demonstrating the 
> > traditional method and the two new methods.
> > 
> 
> Were not viewable here.

Try the new posts.

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