POV-Ray : Newsgroups : povray.binaries.images : --- : Re: Alternative rendering algorithm - attached files (1/3) - randomtrace64.png (1/1) Server Time
13 Aug 2026 03:14:44 EDT (-0400)
  Re: Alternative rendering algorithm - attached files (1/3) - randomtrace64.png (1/1)  
From: Micha Riser
Date: 10 Apr 2004 16:18:43
Message: <407856a3@news.povray.org>
Christopher James Huff wrote:
> 
>> It also introduces the "integral over all possible lightpaths" principle
>> wich I think is a really nice and general abstraction. I have started to
>> implement the bidirectional path integration method outlined in chapter
>> 10 in my own raytracer but had to stop it due to lack of time.
> 
> Well, the point of this is to spend time on only the most important
> paths, those shallower in depth. The traditional "ray splitting" method
> traces all possible paths, this method just samples some of them. Maybe
> that's what you meant, though.
> 

For the result to be correct (non-biased, i.e. correct expected value) with
the monte carlo method you have to divide the function value by the
probability density you chose the sample.

E.g. when you want to integrate 
 /b
 |  f(x) dx
 /a

and approximate the result by samples f(x0),...,f(xn) randomly chosen from
the interval then the monte carlo sum is

  n
 SUM ( f(x0) / p(x0) )
 i=1

Where p(x0) is the density of the probability distribution you chose the
samples from. When you do it uniformly it is just 1/(b-a). But you can
improve the sampling by chosing the p(x) approximatly proportional to the
function. With that the variance gets lower. If you would chose p(x)
proportional to f(x) the variance would be 0. Now you usually can't do this
because for that you already would need to know the integral.. But also if
you partially match f with p it helps because then you will chose more
samples where the value of f is higher.

Now how to apply this to ray-tracing? That's where the integral over all
pathes comes into play. The light that arrives at point p0 is the integral
of the light flux over all pathes p0,p1,...,pi of (possible infinite)
length i with pj on surfaces that start at p0 and end at a light source pi.
Classical ray-tracing ignores a big part of these pathes, with radiosity
and photon tracing you get some more. 

Here you can use monte carlo to integrate over the paths. Now the important
thing is how to chose the sampling paths, which means chosing the right
probablity density function for the paths. Now the thesis mentioned in my
last post describes two methods for doing this -- and when you look at the
example pictures they get non-grainy pictures with indirect illumination,
caustics and all with an amazing low number of samples. 

Well, it is definitley interesting but not that easy to understand fully in
this general approach.

- Micha

-- 
POV-Ray Objects Collection: http://objects.povworld.org


Post a reply to this message

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