POV-Ray : Newsgroups : povray.general : subtle color_map problem when fading to transparency : subtle color_map problem when fading to transparency Server Time
1 Aug 2024 02:21:01 EDT (-0400)
  subtle color_map problem when fading to transparency  
From: Kenneth
Date: 22 May 2006 04:20:01
Message: <web.447172dfca331edbb96c08840@news.povray.org>
I've just recently noticed a little bit of a visual conundrum in attempting
to fade a color to transparency in a color_map. A seemingly simple
procedure, but the result isn't what I always assumed.  I suppose I wasn't
paying close enough attention to the visual result until now.  :-[  Perhaps
my "discovery" is an "old dog" in the POV world, already thoroughly
explained. But I gamely soldier on...

Looking back through the POV docs, specifically 2.3.4.1.4 and the following
sections, I see that the recommended way of fading a color in a color_map
is to use rgbf 1, basically like this:

 color_map{
 [0.0 rgb <1,.5,.3>] // any color
 [1.0 rgbf 1] // the transparent part
                 }
The trouble is, when this is done, the "fade transition" has WHITE mixed in
with the color, from the rgb components of rgbf 1. So instead of the color
just fading out, it becomes more of a pastel color as it does so. To my
eyes, this doesn't seem right...although that may be an arguable point.
(The only corresponding analogy in the real world that I can think of is a
graduated photographic filter, that transitions from color to clear. But I
don't own one, so I can't say what a real scene looks like when viewed
through it. I imagine the filter simply goes from *color* to *clear*.)

This pastel "addition" can be seen much more clearly if the color at index
0.0 is pure black and the color_map is applied to an object with
finish{ambient 1 diffuse 0}, against a black background. The (unwanted)
effect of the rgb components is very pronounced...the black color actualy
fades up to light gray before going transparent. Using rgbt 1 shows almost
the same effect. Lowering the ambient value improves things somewhat, but
even at ambient 0 the effect is still very visible. Using rgbf (or t)
<.5,.5,.5,1> shows some improvement, but it's just a work-around, with an
unwanted darkening effect.

While I do understand what's going on, it leaves me scratching my head for a
solution. In desperation, I even tried using a pure-alpha-channel png
image_map, in a pigment_list, as the "transparent" color...and the result
was exactly the same, the white "blank" image contributing its whiteness.
PERHAPS such an image_map would work if its blank image were made
*transparent*--but my version of Photoshop can't save such a file in any
file format other than its own...which POV doesn't recognize.

SO... is there some other way in POV to get a "pure" fade-out of a color,
devoid of any color "mixing"?

Ken W.


Post a reply to this message

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