POV-Ray : Newsgroups : povray.advanced-users : How is fade_color used? Server Time
23 Dec 2024 14:44:25 EST (-0500)
  How is fade_color used? (Message 1 to 8 of 8)  
From: Cousin Ricky
Subject: How is fade_color used?
Date: 30 Oct 2008 11:30:00
Message: <web.4909d1d8c4d5901485de7b680@news.povray.org>
The documentation of interior attenuation gives two formulas.  Neither formula
contains fade_color.

   http://www.povray.org/documentation/view/3.6.1/416/

I can experiment forever trying to get a feel for how fade_color affects
attenuation, but I always seem to get a surprise.  To say, "fade_color
colorizes the attenuation," has not been helpful to me at all.  It would be so
much easier to get the results I want if I knew exactly how fade_color fit into
the equations.

I find media absorption much more predictable despite the inverse coloring.
However, I tend to avoid it, as it is prone to artifacts.


Post a reply to this message

From: Alain
Subject: Re: How is fade_color used?
Date: 30 Oct 2008 18:20:37
Message: <490a3335@news.povray.org>
Cousin Ricky nous illumina en ce 2008-10-30 11:25 -->
> The documentation of interior attenuation gives two formulas.  Neither formula
> contains fade_color.
> 
>    http://www.povray.org/documentation/view/3.6.1/416/
> 
> I can experiment forever trying to get a feel for how fade_color affects
> attenuation, but I always seem to get a surprise.  To say, "fade_color
> colorizes the attenuation," has not been helpful to me at all.  It would be so
> much easier to get the results I want if I knew exactly how fade_color fit into
> the equations.
> 
> I find media absorption much more predictable despite the inverse coloring.
> However, I tend to avoid it, as it is prone to artifacts.
> 
> 
> 
In the interior block, you need not only face_color but also fade_distance, and 
fade_power.

fade_color control what color to fade to.
fade_distance controls the distance, in units, over whitch the face_color 
contribute to half of the final coloration.
fade_power controls the "shape" of the atenuation curve. This should normaly be 
set to 1 OR 1001. Both are correct. 1 is a linear atenuation 1001 is an 
exponential atenuation.


-- 
Alain
-------------------------------------------------
To define recursion, we must first define recursion.


Post a reply to this message

From: nemesis
Subject: Re: How is fade_color used?
Date: 30 Oct 2008 22:43:37
Message: <490a70d9@news.povray.org>
Alain wrote:
> fade_power controls the "shape" of the atenuation curve. This should 
> normaly be set to 1 OR 1001. Both are correct. 1 is a linear atenuation 
> 1001 is an exponential atenuation.

WTF?!

why 1001?!  I always used 2 and it seems to work...


Post a reply to this message

From: Cousin Ricky
Subject: Re: How is fade_color used?
Date: 31 Oct 2008 01:55:00
Message: <web.490a9c11a1c415d885de7b680@news.povray.org>
Alain <ele### [at] netscapenet> wrote:
> In the interior block, you need not only face_color but also fade_distance, and
> fade_power.
>
> fade_color control what color to fade to.
> fade_distance controls the distance, in units, over whitch the face_color
> contribute to half of the final coloration.
> fade_power controls the "shape" of the atenuation curve. This should normaly be
> set to 1 OR 1001. Both are correct. 1 is a linear atenuation 1001 is an
> exponential atenuation.

That's a nice summary of the documentation.  I could've done that.

My problem is that I can't relate fade_color to the appearance of the object.
It obviously controls the color, but in what manner?

Say I want a muted green color.  I try some numbers for fade_power,
fade_distance, and fade_color, and I get a smoky moss gray.  I tweak the
numbers a bit and end up with an overpowering emerald green.  I try to tone it
down a bit and end up with black with bright green fringes.  And so on.  It's
like throwing clay at a wall repeatedly, and hoping that a flower pot will come
out.

The root problem--at least for me--is that fade_color is not in either of the
attenuation formulas as documented.  Because of this, I just can't figure out
how fade_color will affect the attenuation.  That's what I'd like to know.


Post a reply to this message

From: Chris B
Subject: Re: How is fade_color used?
Date: 31 Oct 2008 16:44:23
Message: <490b6e27@news.povray.org>
"Cousin Ricky" <ric### [at] yahoocom> wrote in message 
news:web.490a9c11a1c415d885de7b680@news.povray.org...
> Alain <ele### [at] netscapenet> wrote:
>> In the interior block, you need not only face_color but also 
>> fade_distance, and
>> fade_power.
>>
>> fade_color control what color to fade to.
>> fade_distance controls the distance, in units, over whitch the face_color
>> contribute to half of the final coloration.
>> fade_power controls the "shape" of the atenuation curve. This should 
>> normaly be
>> set to 1 OR 1001. Both are correct. 1 is a linear atenuation 1001 is an
>> exponential atenuation.
>
> That's a nice summary of the documentation.  I could've done that.

That sounds a little harsh.

> My problem is that I can't relate fade_color to the appearance of the 
> object.
> It obviously controls the color, but in what manner?

I think this points to a potential misconception. These settings control the 
light passing through the object rather than directly controlling the 
appearance of the object's surface. As the object is at least partially 
transparent this means that the colors of things behind the object are 
changed as light passes from them and through the object to get to the 
camera.

> Say I want a muted green color.  I try some numbers for fade_power,
> fade_distance, and fade_color, and I get a smoky moss gray.  I tweak the
> numbers a bit and end up with an overpowering emerald green.  I try to 
> tone it
> down a bit and end up with black with bright green fringes.  And so on. 
> It's
> like throwing clay at a wall repeatedly, and hoping that a flower pot will 
> come
> out.
>
> The root problem--at least for me--is that fade_color is not in either of 
> the
> attenuation formulas as documented.  Because of this, I just can't figure 
> out
> how fade_color will affect the attenuation.  That's what I'd like to know.

Here's my shot at explaining it:

The fade_color is simply multiplied by the original light color to get the 
color that the light will change to when fully attenuated. So, if 
LightColorIn is the RGB color of the light going into an object and 
AttenuationColor is the attenuation color, then at 'full' attenuation, the 
light will end up with a color of LightColorIn * AttenuationColor (call this 
FullyAttenuatedColor).

At a specific distance into the object the actual attenuation (let's call 
this Attenuation) is given by the formula in the docs. The light at this 
point will therefore have a color given by the formula 
LightColorIn-(LightColorIn-FullyAttenuatedColor)*Attenuation.

If the object is completely transparent then you won't see the object at 
all, but you will see what's behind it and the appearance of what's behind 
it will be affected by the thickness of the parts of the object intersected 
by rays coming from the camera. Light falling directly on the object won't 
directly affect the image.

The very simple example below illustrates this by using a white light on the 
left of a transparent cylinder with a white plane behind it. The cylinder 
itself is only visible because it attenuates the light coming from the 
plane. Remove the plane and you no longer 'see' the cylinder.

The grey light from the plane is turned green because the fade_color is 
green. The centre line more so because it's thicker there than above and 
below that line. You also get reduced attenuation on the left and right 
edges because the distance through the end caps is less than the distance 
through the full body of the cylinder.

The light cast on the right hand side of the plane by white light that 
passes through the cylinder is also turned green, more so where it travels 
further through the cylinder.


camera {location <0,0,-3> look_at 0}
light_source {<-3,0,0>, rgb 1}

cylinder {-x,x,1
  texture {
    pigment {rgbt 1}
  }
  interior {fade_power 2 fade_distance 1 fade_color <0,1.8,0>}
}

plane {-z,-2 pigment {rgb 1}}


Hope this helps.

Regards,
Chris B.


Post a reply to this message

From: Alain
Subject: Re: How is fade_color used?
Date: 31 Oct 2008 18:23:59
Message: <490b857f$1@news.povray.org>
nemesis nous illumina en ce 2008-10-30 22:44 -->
> Alain wrote:
>> fade_power controls the "shape" of the atenuation curve. This should 
>> normaly be set to 1 OR 1001. Both are correct. 1 is a linear 
>> atenuation 1001 is an exponential atenuation.
> 
> WTF?!
> 
> why 1001?!  I always used 2 and it seems to work...

fade_power 2 is good for the fading of a light source as it fades according the 
the square of the distance, or the light's energy is spread over the square of 
the radius. Twice the distance = one fourth the illumination, or the same 
illumination spread over four times the surface.

When you work with transparency, the atenuation is linear, thus fade_power 1. 
Twice the distance = twice the effect.

-- 
Alain
-------------------------------------------------
If at first you don’t succeed, try again. Then quit. No use being a damn fool 
about it.


Post a reply to this message

From: Alain
Subject: Re: How is fade_color used?
Date: 31 Oct 2008 18:30:48
Message: <490b8718$1@news.povray.org>
Chris B nous illumina en ce 2008-10-31 16:44 -->
> 
> "Cousin Ricky" <ric### [at] yahoocom> wrote in message 
> news:web.490a9c11a1c415d885de7b680@news.povray.org...
>> Alain <ele### [at] netscapenet> wrote:
>>> In the interior block, you need not only face_color but also 
>>> fade_distance, and
>>> fade_power.
>>>
>>> fade_color control what color to fade to.
>>> fade_distance controls the distance, in units, over whitch the 
>>> face_color
>>> contribute to half of the final coloration.
>>> fade_power controls the "shape" of the atenuation curve. This should 
>>> normaly be
>>> set to 1 OR 1001. Both are correct. 1 is a linear atenuation 1001 is an
>>> exponential atenuation.
>>
>> That's a nice summary of the documentation.  I could've done that.
> 
> That sounds a little harsh.
> 
>> My problem is that I can't relate fade_color to the appearance of the 
>> object.
>> It obviously controls the color, but in what manner?
> 
> I think this points to a potential misconception. These settings control 
> the light passing through the object rather than directly controlling 
> the appearance of the object's surface. As the object is at least 
> partially transparent this means that the colors of things behind the 
> object are changed as light passes from them and through the object to 
> get to the camera.
> 
>> Say I want a muted green color.  I try some numbers for fade_power,
>> fade_distance, and fade_color, and I get a smoky moss gray.  I tweak the
>> numbers a bit and end up with an overpowering emerald green.  I try to 
>> tone it
>> down a bit and end up with black with bright green fringes.  And so 
>> on. It's
>> like throwing clay at a wall repeatedly, and hoping that a flower pot 
>> will come
>> out.
>>
>> The root problem--at least for me--is that fade_color is not in either 
>> of the
>> attenuation formulas as documented.  Because of this, I just can't 
>> figure out
>> how fade_color will affect the attenuation.  That's what I'd like to 
>> know.
> 
> Here's my shot at explaining it:
> 
> The fade_color is simply multiplied by the original light color to get 
> the color that the light will change to when fully attenuated. So, if 
> LightColorIn is the RGB color of the light going into an object and 
> AttenuationColor is the attenuation color, then at 'full' attenuation, 
> the light will end up with a color of LightColorIn * AttenuationColor 
> (call this FullyAttenuatedColor).
> 
> At a specific distance into the object the actual attenuation (let's 
> call this Attenuation) is given by the formula in the docs. The light at 
> this point will therefore have a color given by the formula 
> LightColorIn-(LightColorIn-FullyAttenuatedColor)*Attenuation.
> 
> If the object is completely transparent then you won't see the object at 
> all, but you will see what's behind it and the appearance of what's 
> behind it will be affected by the thickness of the parts of the object 
> intersected by rays coming from the camera. Light falling directly on 
> the object won't directly affect the image.
> 
> The very simple example below illustrates this by using a white light on 
> the left of a transparent cylinder with a white plane behind it. The 
> cylinder itself is only visible because it attenuates the light coming 
> from the plane. Remove the plane and you no longer 'see' the cylinder.
> 
> The grey light from the plane is turned green because the fade_color is 
> green. The centre line more so because it's thicker there than above and 
> below that line. You also get reduced attenuation on the left and right 
> edges because the distance through the end caps is less than the 
> distance through the full body of the cylinder.
> 
> The light cast on the right hand side of the plane by white light that 
> passes through the cylinder is also turned green, more so where it 
> travels further through the cylinder.
> 
> 
> camera {location <0,0,-3> look_at 0}
> light_source {<-3,0,0>, rgb 1}
> 
> cylinder {-x,x,1
>  texture {
>    pigment {rgbt 1}
>  }
>  interior {fade_power 2 fade_distance 1 fade_color <0,1.8,0>}
> }
> 
> plane {-z,-2 pigment {rgb 1}}
> 
> 
> Hope this helps.
> 
> Regards,
> Chris B.
A way to do your test is to use an animation where you shift a parameter's value 
accordint to the clock. It can look like:

interior{fade_power 1 fade_distance clock*2 fade_color <0,1,0>}

You can place tree copy side by side, one with fade_power 1, one with fade_power 
1001 and one with fade_power 2 to see the difference.

-- 
Alain
-------------------------------------------------
The last person that quit or was fired will be held responsible for  everything 
that goes wrong.


Post a reply to this message

From: Cousin Ricky
Subject: Re: How is fade_color used?
Date: 31 Oct 2008 19:10:00
Message: <web.490b8fbca1c415d885de7b680@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> Hope this helps.

It will take me a while to figure out (I'm not the fastest chip on the board
these days), but it's something that I can work with.  Thanks!


Post a reply to this message

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