POV-Ray : Newsgroups : povray.advanced-users : Raytracing theory in Povray Server Time: 14 Dec 2018 00:33:08 GMT
  Raytracing theory in Povray (Message 1 to 6 of 6)  
From: muyu
Subject: Raytracing theory in Povray
Date: 9 Mar 2018 14:50:01
Message: <web.5aa29e2121ee733cd22d61e0@news.povray.org>
Hi,

In Povray, the optical properties of each surface can be set by ambient, diffuse
and specular. This is very flexible but only single value is allowed over
color-channels. As a matter of fact, the optical properties of object often
differs over wavelength or colors. I am wondering what's the assumption in
Povary to deal with this. It will be great if you could recommend a reference to
describe the raytracing theory used in Povray. Thanks a lot in advance.

Best regards
Shouyang


Post a reply to this message

From: Kenneth
Subject: Re: Raytracing theory in Povray
Date: 9 Mar 2018 20:20:00
Message: <web.5aa2ea57948a4d2ea47873e10@news.povray.org>
"muyu" <lsy### [at] gmailcom> wrote:
> Hi,
>
> In Povray, the optical properties of each surface can be set by ambient, diffuse
> and specular.

And phong. And also 'emission' now. And in other ways too.

> This is very flexible but only single value is allowed over
> color-channels.

Emission, ambient and diffuse can all use 'color' vectors, rather than just a
single (white/gray) value.

> As a matter of fact, the optical properties of object often
> differs over wavelength or colors. I am wondering what's the assumption in
> Povary to deal with this.

For reflections, there is the 'fresnel' keyword. Also 'irid' (iridescence).
POV-Ray doesn't actually use light wavelengths for computation; it works in a
different way.


> It will be great if you could recommend a reference to
> describe the raytracing theory used in Povray. Thanks a lot in advance.


The POV-Ray documentation itself has a section on the theory of raytracing...

2.3.11 SDL tutorial: A raytracer


Post a reply to this message

From: clipka
Subject: Re: Raytracing theory in Povray
Date: 10 Mar 2018 09:52:19
Message: <5aa3aad3$1@news.povray.org>
Am 09.03.2018 um 15:45 schrieb muyu:
> Hi,
> 
> In Povray, the optical properties of each surface can be set by ambient, diffuse
> and specular. This is very flexible but only single value is allowed over
> color-channels. As a matter of fact, the optical properties of object often
> differs over wavelength or colors. I am wondering what's the assumption in
> Povary to deal with this. It will be great if you could recommend a reference to
> describe the raytracing theory used in Povray. Thanks a lot in advance.

Actually, in real life the wavelength-dependent effects are pretty few:


(1) Different absorption and scattering coefficients in the material itself:

In most materials (specifically dielectrics), light actually penetrates
a tiny distance into the bulk of the object, scatters around a bit in
there, and either exits again nearby or gets absorbed along the way.
Three things can be wavelength-dependent here: (a) the distance a light
ray travels on average before being absorbed, (b) The distance a light
ray travels on average between scattering events, and (c) the
directionality of those scattering events.

At a large scale however, you'll only see the combination of all these
effects at work, most dominantly the ratio between (a) and (b), which
gives the material its apparent colour. This is modeled in POV-Ray via
the pigment.

For a more precise model suitable for realistic close-ups, POV-Ray
provides SSLT, where besides the ratio (again via pigment) you also
specify the effects' absolute values on a per-colour-channel basis. (c)
is currently not modeled.


(2) Different refractive indices:

In transparent materials, the refractive indices can vary slightly
between wavelengths, causing a change in the refraction angle. This is
modeled in POV-Ray via the "dispersion" setting.

Besides that, technically wavelength-dependent refractive indices also
affect how much light enters the material vs. how much light is
reflected (see Fresnel's law); however, this effect is miniscule for all
real-life materials.


(3) Interference in thin-film coatings:

Some materials are coated with a thin layer of another material; if the
thickness of the coating is reasonably uniform and close to the
wavelength of visible light, destructive interference occurs for some
wavelengths but constructive interference for others, affecting (a) how
much light traverses the coating to reaches the bulk of the material,
and (b) how much is reflected back.

For single-layer coatings with slight variations in thickness, you'll
get a rainbow effect (example: oil on water); in such cases, POV-Ray can
approximately model (a) using the `irid` (iridescence) feature. (b) is
currently not modeled.

Some objects are coated with a series of extremely uniform layers, such
as anti-reflex coating on camera lenses; in such cases, POV-Ray can
approximately model (b) using a colour instead of a scalar as the
reflection parameter. The effect on (a) is usually quite miniscule, but
could be approximated by slightly tweaking the pigment colour.


(4) Metals:

Metals behave entirely differently: Here, light does not enter the bulk
of the material, but rather some wavelengths are absorbed at the surface
while all others are reflected.

This can be modeled pretty well using the `metallic` setting for both
highlights and reflections, and choosing a suitable pigment.


(5) Diffraction:

When a surface has a regular structure and the size of the structure is
near the wavelength of visible light, this causes interference patterns,
messing up the directions at which light is reflected or refracted. This
effect also varies with wavelength, causing rainbow-like effects. (Think
CD/DVD).

Currently, this effect can not be modeled at all in POV-Ray.


To my knowledge, that about wraps it up as far as wavelength-dependent
effects on light are concerned. If you can think of any other, let me
know and I can tell you if and how they can be modeled in POV-Ray.


Post a reply to this message

From: Alain
Subject: Re: Raytracing theory in Povray
Date: 10 Mar 2018 17:22:56
Message: <5aa41470$1@news.povray.org>
Le 18-03-09 à 09:45, muyu a écrit :
> Hi,
> 
> In Povray, the optical properties of each surface can be set by ambient, diffuse
> and specular. This is very flexible but only single value is allowed over
> color-channels. As a matter of fact, the optical properties of object often
> differs over wavelength or colors. I am wondering what's the assumption in
> Povary to deal with this. It will be great if you could recommend a reference to
> describe the raytracing theory used in Povray. Thanks a lot in advance.
> 
> Best regards
> Shouyang
> 
> 
ambient and emission can use a colour vector.

diffuse set the % of incoming light that get diffused by the material. 
Use a float. Using a colour vector here is not physically correct, use 
the pigment.

The pigment control the tint of the material. Use a colour vector, but 
you can use a single float for grey levels.

reflection control the amount of light that get specularly reflected. 
Use a colour vector or a single float. Can be set to use the fresnel law 
where the amount of reflection is dependent on the IOR of the object and 
the angle of incidence, or metallic where the pigment affect the colour 
of the reflection.

specular and phong control the highlights. Use a float. Adding metallic 
make the highlight take on the colour of the pigment.

The material can be more or less transparent. Controlled by the filter 
and transmit optional components of the pigment.

Most transparent object should have an interior statement to set it's 
ior, and optionally it's chromatic dispersion strength. When an object 
have an ior, total internal reflections are taken care of automatically.

A transparent object can affect the colour of light going through it 
using light fading, also set in the interior block.
Such an object can also be filled with some media that will greatly 
affect it's appearance.

You can use SSLT by adding "subsurface integer, integer" in the 
global_settings and adding subsurface{translucency<float,float,float>} 
to the object itself. A single float can be used for the object.

In all cases, if the light used is not white, it will greatly affect the 
colour of any object.


Post a reply to this message

From: muyu
Subject: Re: Raytracing theory in Povray
Date: 16 Apr 2018 14:35:01
Message: <web.5ad4b44e948a4d2ed22d61e0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 09.03.2018 um 15:45 schrieb muyu:
> > Hi,
> >
> > In Povray, the optical properties of each surface can be set by ambient, diffuse
> > and specular. This is very flexible but only single value is allowed over
> > color-channels. As a matter of fact, the optical properties of object often
> > differs over wavelength or colors. I am wondering what's the assumption in
> > Povary to deal with this. It will be great if you could recommend a reference to
> > describe the raytracing theory used in Povray. Thanks a lot in advance.
>
> Actually, in real life the wavelength-dependent effects are pretty few:
>
>
> (1) Different absorption and scattering coefficients in the material itself:
>
> In most materials (specifically dielectrics), light actually penetrates
> a tiny distance into the bulk of the object, scatters around a bit in
> there, and either exits again nearby or gets absorbed along the way.
> Three things can be wavelength-dependent here: (a) the distance a light
> ray travels on average before being absorbed, (b) The distance a light
> ray travels on average between scattering events, and (c) the
> directionality of those scattering events.
>
> At a large scale however, you'll only see the combination of all these
> effects at work, most dominantly the ratio between (a) and (b), which
> gives the material its apparent colour. This is modeled in POV-Ray via
> the pigment.
>
> For a more precise model suitable for realistic close-ups, POV-Ray
> provides SSLT, where besides the ratio (again via pigment) you also
> specify the effects' absolute values on a per-colour-channel basis. (c)
> is currently not modeled.
>
>
> (2) Different refractive indices:
>
> In transparent materials, the refractive indices can vary slightly
> between wavelengths, causing a change in the refraction angle. This is
> modeled in POV-Ray via the "dispersion" setting.
>
> Besides that, technically wavelength-dependent refractive indices also
> affect how much light enters the material vs. how much light is
> reflected (see Fresnel's law); however, this effect is miniscule for all
> real-life materials.
>
>
> (3) Interference in thin-film coatings:
>
> Some materials are coated with a thin layer of another material; if the
> thickness of the coating is reasonably uniform and close to the
> wavelength of visible light, destructive interference occurs for some
> wavelengths but constructive interference for others, affecting (a) how
> much light traverses the coating to reaches the bulk of the material,
> and (b) how much is reflected back.
>
> For single-layer coatings with slight variations in thickness, you'll
> get a rainbow effect (example: oil on water); in such cases, POV-Ray can
> approximately model (a) using the `irid` (iridescence) feature. (b) is
> currently not modeled.
>
> Some objects are coated with a series of extremely uniform layers, such
> as anti-reflex coating on camera lenses; in such cases, POV-Ray can
> approximately model (b) using a colour instead of a scalar as the
> reflection parameter. The effect on (a) is usually quite miniscule, but
> could be approximated by slightly tweaking the pigment colour.
>
>
> (4) Metals:
>
> Metals behave entirely differently: Here, light does not enter the bulk
> of the material, but rather some wavelengths are absorbed at the surface
> while all others are reflected.
>
> This can be modeled pretty well using the `metallic` setting for both
> highlights and reflections, and choosing a suitable pigment.
>
>
> (5) Diffraction:
>
> When a surface has a regular structure and the size of the structure is
> near the wavelength of visible light, this causes interference patterns,
> messing up the directions at which light is reflected or refracted. This
> effect also varies with wavelength, causing rainbow-like effects. (Think
> CD/DVD).
>
> Currently, this effect can not be modeled at all in POV-Ray.
>
>
> To my knowledge, that about wraps it up as far as wavelength-dependent
> effects on light are concerned. If you can think of any other, let me
> know and I can tell you if and how they can be modeled in POV-Ray.

Thanks for your answer. Actually I am simulating radiative tansfer in vegetation
canopy. Under this context, surface optical properties mainly means the
reflectance, tansmitance of leaves, stems etc. Regarding green leaves, their
optical properties differ a lot over r g and b. Now I am setting diffuse x, xx
to simulate double face effect, corresponding to reflectance and transmitance.
However this only allow me set constant value over three color channels. I am
wondering how to set differet value for different channels. Thanks.


Post a reply to this message

From: clipka
Subject: Re: Raytracing theory in Povray
Date: 16 Apr 2018 16:40:07
Message: <5ad4d1e7$1@news.povray.org>
Am 16.04.2018 um 16:33 schrieb muyu:

> Thanks for your answer. Actually I am simulating radiative tansfer in vegetation
> canopy. Under this context, surface optical properties mainly means the
> reflectance, tansmitance of leaves, stems etc. Regarding green leaves, their
> optical properties differ a lot over r g and b. Now I am setting diffuse x, xx
> to simulate double face effect, corresponding to reflectance and transmitance.
> However this only allow me set constant value over three color channels. I am
> wondering how to set differet value for different channels. Thanks.

While this is currently not supported "out of the box", one thing you
could do is render the scene as an animation, using monochromatic
textures to model just one single wavelength per frame.

This might also give you more precise results than POV-Ray's standard
RGB colour model.


An alternative approach might be to model the leaves as solid objects,
and use the SSLT feature to model the difference between the reflected
and transmitted colour. However, this might need some tweaking to get
the material properties right.


Post a reply to this message

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