POV-Ray : Newsgroups : povray.general : which mathematics does POV-Ray use? Server Time
26 Nov 2024 20:47:20 EST (-0500)
  which mathematics does POV-Ray use? (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: marky addison
Subject: which mathematics does POV-Ray use?
Date: 16 Nov 2009 12:45:01
Message: <web.4b018f1fd5612874d4c5ca190@news.povray.org>
Hi everyone,

I am looking but can not find, what kind of mathematics does POV-Ray use.
He is primarily Ray tracer but he also uses radiocsity algorithm. Am
I right?
Please give me some links to some theoretical part of POV-Ray. Thank you!


Post a reply to this message

From: clipka
Subject: Re: which mathematics does POV-Ray use?
Date: 16 Nov 2009 13:10:57
Message: <4b0195b1$1@news.povray.org>
marky.addison schrieb:
> 
> I am looking but can not find, what kind of mathematics does POV-Ray use.
> He is primarily Ray tracer but he also uses radiocsity algorithm. Am
> I right?
> Please give me some links to some theoretical part of POV-Ray. Thank you!

At its origin and core, POV-Ray is indeed a classic (backward) 
raytracing software. There should be ample information out on the net 
about the mathematical details.


As for what POV-Ray calls radiosity, the algorithm is based on the 1988 
paper "A Ray Tracing Solution for Diffuse Interreflection" by Greg 
(Gregory J.) Ward et al.

A PDF version can be found at 
http://www.cs.virginia.edu/~gfx/Courses/2003/ImageSynthesis/papers/Monte%20Carlo/Ray%20Tracing%20Solution%20for%20Diffuse%20Interreflection.pdf,

but it lacks the figures.

http://radsite.lbl.gov/radiance/papers/sg88/paper.html has .gif and 
.tiff files scanned from a paper copy, which do include the figures.

There are other sites showing up on google which charge money for a PDF 
version of the paper, but I don't know whether it is any different from 
the one fount on virginia.edu.


Another algorithm used in POV-Ray that deserves mention is photon 
mapping, but I can't give any pointers on that one.


Post a reply to this message

From: marky addison
Subject: Re: which mathematics does POV-Ray use?
Date: 16 Nov 2009 14:10:01
Message: <web.4b01a31358e10a05d4c5ca190@news.povray.org>
thank you, great!!!

what I need are differential equations that POV-Ray uses.
Can you send me some link. Thanks!


Post a reply to this message

From: clipka
Subject: Re: which mathematics does POV-Ray use?
Date: 16 Nov 2009 15:29:39
Message: <4b01b633$1@news.povray.org>
marky.addison schrieb:

> what I need are differential equations that POV-Ray uses.
> Can you send me some link. Thanks!

Could you be somewhat more specific?

At its core, raytracing is about vector math, not differential 
equations. There are pretty likely some underlying differential 
equations involved for stuff like the fresnel formula used in 
refraction, or the phong / blinn-phong highlights, but someone else 
wrecked their brains earlier to come up with quite simple equations, 
with all integrals or derivatives either solved or approximated already.

As for radiosity, it does perform some integration, but it does so 
numerically using a monte-carlo-like approach.

I really wouldn't know off the top of my head where you expect to be 
differential equations involved.


Post a reply to this message

From: marky addison
Subject: Re: which mathematics does POV-Ray use?
Date: 17 Nov 2009 05:50:00
Message: <web.4b027fcf58e10a053a7b232a0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> marky.addison schrieb:
>
> > what I need are differential equations that POV-Ray uses.
> > Can you send me some link. Thanks!
>
> Could you be somewhat more specific?
>
> At its core, raytracing is about vector math, not differential
> equations. There are pretty likely some underlying differential
> equations involved for stuff like the fresnel formula used in
> refraction, or the phong / blinn-phong highlights, but someone else
> wrecked their brains earlier to come up with quite simple equations,
> with all integrals or derivatives either solved or approximated already.
>
> As for radiosity, it does perform some integration, but it does so
> numerically using a monte-carlo-like approach.
>
> I really wouldn't know off the top of my head where you expect to be
> differential equations involved.

Clipka thank you very much for your cooperation. ;)

I am trying to figure out what mathematics does POV-Ray use.
Does it use more Raytracing or Radiosity or it combines both?
How does it make shadows (isn't it with radiosity)?
So I need some formulas, integrals and derivatives so I can
better understand how it works.

Thanks


Post a reply to this message

From: Tim Attwood
Subject: Re: which mathematics does POV-Ray use?
Date: 17 Nov 2009 16:04:24
Message: <4b030fd8$1@news.povray.org>
"marky.addison" <mar### [at] gmailcom> wrote in message 
news:web.4b027fcf58e10a053a7b232a0@news.povray.org...
> clipka <ano### [at] anonymousorg> wrote:
>> marky.addison schrieb:
>>
>> > what I need are differential equations that POV-Ray uses.
>> > Can you send me some link. Thanks!
>>
>> Could you be somewhat more specific?
>>
>> At its core, raytracing is about vector math, not differential
>> equations. There are pretty likely some underlying differential
>> equations involved for stuff like the fresnel formula used in
>> refraction, or the phong / blinn-phong highlights, but someone else
>> wrecked their brains earlier to come up with quite simple equations,
>> with all integrals or derivatives either solved or approximated already.
>>
>> As for radiosity, it does perform some integration, but it does so
>> numerically using a monte-carlo-like approach.
>>
>> I really wouldn't know off the top of my head where you expect to be
>> differential equations involved.
>
> Clipka thank you very much for your cooperation. ;)
>
> I am trying to figure out what mathematics does POV-Ray use.
> Does it use more Raytracing or Radiosity or it combines both?
> How does it make shadows (isn't it with radiosity)?
> So I need some formulas, integrals and derivatives so I can
> better understand how it works.
>
> Thanks

What is going on is that a ray is being represented as a formula...

location = point + time * direction (where time > 0)

and an object is being represented by it's geometric formula,
for example a sphere...

X^2+Y^2+Z^2 = radius^2

and then the ray formula is being substituted into the objects'
formula ...

(point_x + time*direction_x)^2 +
(point_y + time*direction_y)^2 +
(point_z + time*direction_z)^2 = radius^2

and then this formula is solved for time, (in the sphere case using
the quadratic formula). From there you substitute the time back
into the ray formula to find the location of the intersects.

To calculate shadows another ray is cast from the intersection
point (A) at the light locations, if some other scene object has an
insection (B) with that shadow ray closer than the light then the
intersection point (A) is not illuminated by the light, so it's a darker
pixel.

Here's some links...
http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter0.htm
http://www.cl.cam.ac.uk/teaching/1999/AGraphHCI/SMAG/node2.html

Some college math and programming classes assign a toy ray-tracer as
a programming project, is that what you are doing?


Post a reply to this message

From: clipka
Subject: Re: which mathematics does POV-Ray use?
Date: 17 Nov 2009 21:37:30
Message: <4b035dea$1@news.povray.org>
marky.addison schrieb:

> I am trying to figure out what mathematics does POV-Ray use.
> Does it use more Raytracing or Radiosity or it combines both?

Normally it uses raytracing, unless you explicitly tell it to also 
include radiosity (note that the term may be ambiguous; a more fitting 
term would have been "ambient illumination", but that term was already 
occupied in POV-Ray for a quite cheap approximation thereof).

> How does it make shadows (isn't it with radiosity)?

No, ambient illumination kicks in regardless of whether a surface is 
exposed to direct light or not (although its effect is most obvious in 
shadows).

> So I need some formulas, integrals and derivatives so I can
> better understand how it works.

If you want to know how it /works/, you should ask for algorithms. I 
guess what you want to know is what these algorithms /represent/ in 
mathematical terms.

Unfortunately I'm more the practical guy, who broods over a mathematical 
formula with integrals and stuff, thinking "man, can't somebody just 
give me an algorithm so I can better understand what these integrals 
really mean?!"... well, anyway, I'll try to give it a shot (but you'll 
have to transpose my prose it into formal mathematical notation yourself).

Expressing all the mathematical stuff that POV-Ray tries to compute 
numerically wold probably fill a book, and it would probably take 
decades to write (at least if I ware to write it), so I'll concentrate 
on the one concrete thing you mentioned: Shadows. Or, more precisely, 
computing incident illumination for the sake of the diffuse reflection term.

Mathematically speaking, POV-Ray numerically (and approximately) 
computes the total incident illumination at a point P as the sum of 
three hemispherical integrals, each of: Incident light, matching certain 
category, from any direction, multiplied by the cosine of the angle of 
incidence.

(Note that while mathematically this could be simplified to a single 
hemispherical integral, the implementation computes/approximates the 
integrals separately for optimization.)

The three categories are:

(A) Direct incident illumination via light paths that don't involve any 
reflection or refraction. ("Direct light")

(B) Indirect incident illumination via light paths that involve only 
specular reflection/refraction, and no scattering. ("Caustics")

(C) Indirect indicent illumination via light paths that involve diffuse 
reflection/refraction, and/or media scattering. ("Ambient illumination")

(Transmittance through an interface between media with identical 
refractive indices are not considered refraction in this sense.)

For the sake of category (A), light sources are considered to be either 
point light sources, or arrays of point light sources. Incident light is 
computed only for vectors from any such point light source to P, for 
probably obvious reasons. The algorithm basically uses simple 
intersection testing, and some formula for light attenuation based on 
distance, media and surface properties; mathematically, this is probably 
best represented as the product of the light source brightness and a 
term representing attenuation.

For the sake of category (B), photon mapping is used. Basically, this 
uses forward-raytracing and monte-carlo integration to approximate the 
corresponding term for any point on any surface (and also for any point 
in any scattering media).

For the sake of category (C), the approach as described by Greg Ward 
(aka "radiosity" in POV-Ray) is used, and as the original paper is much 
more mathematical than I could ever rephrase it, you'd best look the 
details up there.

Alternatively, to speed up rendering, photon and/or radiosity mapping 
may be turned off. In this case, (B) is approximated by presuming that 
(for the sake of illumination computation) refractive indices of all 
media are identical and ignoring any light paths that include specular 
reflection, while (C) is approximated by a constant term (which may vary 
from surface to surface) specified by the scene designer.


The full incident illumination term is in turn used to compute the 
diffuse reflective term, but there's not much special in POV-Ray about 
this (nor the specular reflective or refractive terms) - we're talking 
about a quite straightforward BRDF illumination model here.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: which mathematics does POV-Ray use?
Date: 18 Nov 2009 04:30:29
Message: <4b03beb5@news.povray.org>
clipka wrote:
> marky.addison schrieb:
> 
>> I am trying to figure out what mathematics does POV-Ray use.
>> Does it use more Raytracing or Radiosity or it combines both?
> 
> Normally it uses raytracing, unless you explicitly tell it to also 
> include radiosity (note that the term may be ambiguous; a more fitting 
> term would have been "ambient illumination", but that term was already 
> occupied in POV-Ray for a quite cheap approximation thereof).
> 
>> How does it make shadows (isn't it with radiosity)?
> 
> No, ambient illumination kicks in regardless of whether a surface is 
> exposed to direct light or not (although its effect is most obvious in 
> shadows).
> 
>> So I need some formulas, integrals and derivatives so I can
>> better understand how it works.
> 
> If you want to know how it /works/, you should ask for algorithms. I 
> guess what you want to know is what these algorithms /represent/ in 
> mathematical terms.

The answer probably should be that anybody who wants to know how ray-tracing 
works should take a good look at the available literature. And that really 
is not hard to find thanks to the documentation:
<http://www.povray.org/documentation/view/3.6.1/211/>

Plus Andrew Glassner's Principles of Digital Image Synthesis, 
Morgan-Kaufmann Publishers, San Francisco, 1995, which has a lot of formulas 
inside and is way more theoretical than useful :-)

	Thorsten


Post a reply to this message

From: Sabrina Kilian
Subject: Re: which mathematics does POV-Ray use?
Date: 18 Nov 2009 05:30:33
Message: <4b03ccc9$1@news.povray.org>
Thorsten Froehlich wrote:
> clipka wrote:
>> marky.addison schrieb:
>>
>>> I am trying to figure out what mathematics does POV-Ray use.
>>> Does it use more Raytracing or Radiosity or it combines both?
>>
>> Normally it uses raytracing, unless you explicitly tell it to also
>> include radiosity (note that the term may be ambiguous; a more fitting
>> term would have been "ambient illumination", but that term was already
>> occupied in POV-Ray for a quite cheap approximation thereof).
>>
>>> How does it make shadows (isn't it with radiosity)?
>>
>> No, ambient illumination kicks in regardless of whether a surface is
>> exposed to direct light or not (although its effect is most obvious in
>> shadows).
>>
>>> So I need some formulas, integrals and derivatives so I can
>>> better understand how it works.
>>
>> If you want to know how it /works/, you should ask for algorithms. I
>> guess what you want to know is what these algorithms /represent/ in
>> mathematical terms.
> 
> The answer probably should be that anybody who wants to know how
> ray-tracing works should take a good look at the available literature.
> And that really is not hard to find thanks to the documentation:
> <http://www.povray.org/documentation/view/3.6.1/211/>
> 
> Plus Andrew Glassner's Principles of Digital Image Synthesis,
> Morgan-Kaufmann Publishers, San Francisco, 1995, which has a lot of
> formulas inside and is way more theoretical than useful :-)
> 
>     Thorsten

Physically Based Rendering by Pharr and Humphreys is the other standard
book I have seen mentioned. As recommended reading for ray-tracing, not
specifically in regards to how POV-Ray works.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: which mathematics does POV-Ray use?
Date: 18 Nov 2009 05:54:36
Message: <4b03d26c$1@news.povray.org>
Sabrina Kilian wrote:
> Physically Based Rendering by Pharr and Humphreys is the other standard
> book I have seen mentioned. As recommended reading for ray-tracing, not
> specifically in regards to how POV-Ray works.

It is certainly very good, but also very practical, which does not seem to 
be what the original poster is looking for.

	Thorsten


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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