POV-Ray : Newsgroups : povray.beta-test : Colour of blurred reflections in unbiased tracing Server Time
28 Dec 2024 19:37:36 EST (-0500)
  Colour of blurred reflections in unbiased tracing (Message 1 to 6 of 6)  
From: scott
Subject: Colour of blurred reflections in unbiased tracing
Date: 30 Jan 2013 08:58:31
Message: <51092707$1@news.povray.org>
As I heard some form of unbiased algorithm might be making its way into 
POV 3.7 at some point (similar to mcpov) I thought I'd bring up some 
thoughts/questions I had about how colours are used.

I understand that in mcpov the surface colour is determined by shooting 
out multiple rays and averaging their result, matching the real world 
closer and closer as the number of rays is increased. I also understand 
that you simulate diffuse or varying levels of blurred reflections by 
shaping the distribution of rays across the hemisphere. A very shiny 
surface (like a mirror) would only shoot rays in one direction, whereas 
a totally diffuse surface would shoot rays in all directions randomly.

My understanding from real life is that colour is handled differently in 
each case though. When I see a blue piece of plastic it's blue because 
all the light being reflected off it has its spectrum attenuated 
accordingly to make it blue. But when I see a glossy specular reflection 
(even if blurred slightly) in the same material the colour is not 
changed (white lights still appear white, not blue).

My assumption therefore is that the spectral attenuation that gives the 
appearance of colour somehow affects light more the further away the ray 
is from direct mirror reflection. It appears however mcpov does not 
allow for this. In the current POV this isn't an issue as specular and 
diffuse reflection are very clearly separated and you can choose the 
colour and amount of each, but if something like mcpov is to be 
incorporated into POV then the two terms become blurred and it's not 
clear how to correctly simulate the real life situation.

My guess is you need some kind of falloff parameter that determines how 
the diffuse colour specified affects the light as the angle increases 
away from direct mirror reflection. But that's a pure guess, I have no 
theoretical understanding of why this should be.


Post a reply to this message

From: clipka
Subject: Re: Colour of blurred reflections in unbiased tracing
Date: 30 Jan 2013 09:24:42
Message: <51092d2a$1@news.povray.org>
Am 30.01.2013 14:58, schrieb scott:

> My understanding from real life is that colour is handled differently in
> each case though. When I see a blue piece of plastic it's blue because
> all the light being reflected off it has its spectrum attenuated
> accordingly to make it blue. But when I see a glossy specular reflection
> (even if blurred slightly) in the same material the colour is not
> changed (white lights still appear white, not blue).
>
> My assumption therefore is that the spectral attenuation that gives the
> appearance of colour somehow affects light more the further away the ray
> is from direct mirror reflection.

No, that is not the case.

Instead, the following two physical effects will happen (except for 
metals, which follow different physical effects):

(1) At the very surface of an object, specular reflection is happening, 
more or less blurred depending on how rough the surface is, and more or 
less strong depending on both the material's index of refraction and 
surface structure. This reflected light will /always/ be "white", and 
its distribution will /always/ be related to the incoming light direction.

(2) Any light that is not reflected will penetrate into the object and 
scatter around in the material, where it will be subject to filtering 
(depending on wavelength), and if it is not thus "swallowed" it will 
ultimately exit the object once again in a very random direction. This 
scattered light will /always/ be "colored" depending on the material, 
and its distribution will (almost) /always/ be (almost) totally 
independent of the incoming light direction.

> It appears however mcpov does not
> allow for this. In the current POV this isn't an issue as specular and
> diffuse reflection are very clearly separated and you can choose the
> colour and amount of each, but if something like mcpov is to be
> incorporated into POV then the two terms become blurred and it's not
> clear how to correctly simulate the real life situation.

MCPov does it exactly the way it should be done (except that it has a 
bug in computing the contribution from (2), getting it wrong by a factor 
of 2, but that's another story).


Post a reply to this message

From: scott
Subject: Re: Colour of blurred reflections in unbiased tracing
Date: 30 Jan 2013 10:05:25
Message: <510936b5$1@news.povray.org>
> (1) At the very surface of an object, specular reflection is happening,
> more or less blurred depending on how rough the surface is, and more or
> less strong depending on both the material's index of refraction and
> surface structure. This reflected light will /always/ be "white", and
> its distribution will /always/ be related to the incoming light direction.

That makes sense.

> (2) Any light that is not reflected will penetrate into the object and
> scatter around in the material, where it will be subject to filtering
> (depending on wavelength), and if it is not thus "swallowed" it will
> ultimately exit the object once again in a very random direction. This
> scattered light will /always/ be "colored" depending on the material,
> and its distribution will (almost) /always/ be (almost) totally
> independent of the incoming light direction.

Is it really a uniform colouring effect across the entire range of 
angles though? I would have thought light that scatters less will come 
out nearer to "white" and nearer the "direct" reflection angle, whereas 
the light that is scattered more will be filtered more and come out more 
randomly spread.

It's hard to judge with real materials because even with no obvious 
specular I think there are still specular effects that are extremely 
blurred, it might just be this that I'm seeing.

> MCPov does it exactly the way it should be done (except that it has a
> bug in computing the contribution from (2), getting it wrong by a factor
> of 2, but that's another story).

Is there a rule then to ensure physical correctness in mcpov when 
supplying parameters for the diffuse and reflection contributions? So 
far I've been working on diffuse+reflection=1, but it seems like that's 
wrong now.

I'm still amazed though at how easy it is to produce ultra-realistic 
lighting in mcpov with relatively little effort.


Post a reply to this message

From: clipka
Subject: Re: Colour of blurred reflections in unbiased tracing
Date: 30 Jan 2013 10:35:55
Message: <51093ddb$1@news.povray.org>
Am 30.01.2013 16:05, schrieb scott:

>> (2) Any light that is not reflected will penetrate into the object and
>> scatter around in the material, where it will be subject to filtering
>> (depending on wavelength), and if it is not thus "swallowed" it will
>> ultimately exit the object once again in a very random direction. This
>> scattered light will /always/ be "colored" depending on the material,
>> and its distribution will (almost) /always/ be (almost) totally
>> independent of the incoming light direction.
>
> Is it really a uniform colouring effect across the entire range of
> angles though? I would have thought light that scatters less will come
> out nearer to "white" and nearer the "direct" reflection angle, whereas
> the light that is scattered more will be filtered more and come out more
> randomly spread.

The light that scatters less will indeed come out nearer to "white", but 
its direction is as random as any other light that manages to come back 
out. (At least that's true for most solid materials, in which the 
scattering is sufficiently anisotropic.)

> It's hard to judge with real materials because even with no obvious
> specular I think there are still specular effects that are extremely
> blurred, it might just be this that I'm seeing.
>
>> MCPov does it exactly the way it should be done (except that it has a
>> bug in computing the contribution from (2), getting it wrong by a factor
>> of 2, but that's another story).
>
> Is there a rule then to ensure physical correctness in mcpov when
> supplying parameters for the diffuse and reflection contributions? So
> far I've been working on diffuse+reflection=1, but it seems like that's
> wrong now.

It is wrong indeed, for quite a bunch of reasons as far as MCPov is 
concerned:

- It doesn't properly handle the variation in specular reflection 
depending on incoming angle and ior (modeled by the "fresnel" setting 
for reflections).

- MCPov gets diffuse reflections wrong by a factor of 2.

- When using a "brilliance" setting of something other than 1.0, the 
value specified in "diffuse" is /not/ the percentage of light scattered 
back diffusely. Instead, the "diffuse" parameter directly controls the 
brightness of the brightest spot. The new "albedo" keyword takes care of 
this discrepancy: If you specify "diffuse albedo X", then X is indeed 
the ratio of light scattered back diffusely (of all the light that comes 
in).


If you don't use "fresnel" on the reflection (nor variable reflection, 
for that matter), and if MCPov didn't have this factor-2 bug, then it 
should indeed be:

     diffuse albedo + reflection <= 1.0


As you can see there are still some details missing for physically 
realistic materials. But I'll keep working on it.


Post a reply to this message

From: scott
Subject: Re: Colour of blurred reflections in unbiased tracing
Date: 31 Jan 2013 03:19:45
Message: <510a2921$1@news.povray.org>
> The light that scatters less will indeed come out nearer to "white", but
> its direction is as random as any other light that manages to come back
> out. (At least that's true for most solid materials, in which the
> scattering is sufficiently anisotropic.)

OK that was the fact I was missing in my analysis. I didn't expect it 
was a digital difference between surface reflection rays emerging at a 
specific angle and then "reflection" rays from just under the surface at 
completely random angle. I had assumed it was some kind of transition 
between the two.

> - It doesn't properly handle the variation in specular reflection
> depending on incoming angle and ior (modeled by the "fresnel" setting
> for reflections).

Do you mean the specular reflections for point light sources controlled 
by the specular keyword? Or the specular reflections you get by using 
the reflection and power parameters (which the fresnel setting has an 
effect on)?

> - MCPov gets diffuse reflections wrong by a factor of 2.

Can I correct for this by simply halving the diffuse factor in the 
finish statement?

> - When using a "brilliance" setting of something other than 1.0, the
> value specified in "diffuse" is /not/ the percentage of light scattered
> back diffusely. Instead, the "diffuse" parameter directly controls the
> brightness of the brightest spot. The new "albedo" keyword takes care of
> this discrepancy: If you specify "diffuse albedo X", then X is indeed
> the ratio of light scattered back diffusely (of all the light that comes
> in).

OK, I've not played about with brilliance before - but I assume albedo 
is not part of mcpov.

> As you can see there are still some details missing for physically
> realistic materials. But I'll keep working on it.

Do you have an idea how much work it is to get mcpov type rendering into 
3.7? Currently I use a simple program that fires off multiple mcpov 
instances and then merges the results, which works ok but obviously it 
doesn't take advantage of all the other goodies in 3.7.


Post a reply to this message

From: clipka
Subject: Re: Colour of blurred reflections in unbiased tracing
Date: 31 Jan 2013 08:30:31
Message: <510a71f7$1@news.povray.org>
Am 31.01.2013 09:19, schrieb scott:

>> - It doesn't properly handle the variation in specular reflection
>> depending on incoming angle and ior (modeled by the "fresnel" setting
>> for reflections).
>
> Do you mean the specular reflections for point light sources controlled
> by the specular keyword? Or the specular reflections you get by using
> the reflection and power parameters (which the fresnel setting has an
> effect on)?

I mean the fresnel stuff in general: At low angles there is a lot of 
specular reflection. That reflected light obviously won't enter the 
material to be scattered diffusely. At high angles, however, the 
specular reflection is significantly lower, so more light enters the 
material to be scattered diffusely.

Neither POV-Ray nor MCPov honor this effect when computing the diffuse 
stuff.

>> - MCPov gets diffuse reflections wrong by a factor of 2.
>
> Can I correct for this by simply halving the diffuse factor in the
> finish statement?

To the contrary, you'll need to set the diffuse factor twice as high in 
MCPov.

>> - When using a "brilliance" setting of something other than 1.0, the
>> value specified in "diffuse" is /not/ the percentage of light scattered
>> back diffusely. Instead, the "diffuse" parameter directly controls the
>> brightness of the brightest spot. The new "albedo" keyword takes care of
>> this discrepancy: If you specify "diffuse albedo X", then X is indeed
>> the ratio of light scattered back diffusely (of all the light that comes
>> in).
>
> OK, I've not played about with brilliance before - but I assume albedo
> is not part of mcpov.

No, indeed not.

>> As you can see there are still some details missing for physically
>> realistic materials. But I'll keep working on it.
>
> Do you have an idea how much work it is to get mcpov type rendering into
> 3.7? Currently I use a simple program that fires off multiple mcpov
> instances and then merges the results, which works ok but obviously it
> doesn't take advantage of all the other goodies in 3.7.

It's not a thing to pull off in a week or so, that's for sure. I have 
already thrown together a patch that does blurred reflections, but 
blurred refractions are still missing, and I haven't yet fully 
integrated it with the other stochastic (or could-be-made-stochastic) 
elements already in POV-Ray (focal blur, anti-aliasing, area lights, 
diffraction and SSLT come to my mind). Importance sampling is still 
missing as well. It also doesn't render the image over and over again 
until you're satisfied - instead it uses a special oversampling mode 
that uses stochastic analysis of the rendered pixels to decide when to 
stop working on a render block and move on to the next one.


Post a reply to this message

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