|
![](/i/fill.gif) |
"Cousin Ricky" <ric### [at] yahoo com> wrote in message
news:web.490a9c11a1c415d885de7b680@news.povray.org...
> Alain <ele### [at] netscape net> 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
|
![](/i/fill.gif) |