POV-Ray : Newsgroups : povray.beta-test : A step back in alpha transparency (+ua) blending? : A step back in alpha transparency (+ua) blending? Server Time
28 Jul 2024 16:16:31 EDT (-0400)
  A step back in alpha transparency (+ua) blending?  
From: Warp
Date: 29 May 2008 05:32:21
Message: <483e7824@news.povray.org>
The change in behavior of the alpha transparency (+ua) feature in pov3.7
was made quite long time ago, but I didn't notice it until now.

  I must protest.

  Taking into account the background color when calculating transparent
pixels was how POV-Ray worked long time ago, and this was changed to the
pov3.6 behavior for a good reason. If I'm not mistaken, I was the one who
suggested the change in the first place. (I don't remember now when the
change was done. Possibly to some version of POV-Ray 3.5.)

  The suggestion came because some people were (IMO correctly) complaining
that they could not create transparent PNGs with POV-Ray which would blend
smoothly with the background, as the 'background' color was interfering
with the color of the semi-transparent pixels.

  Here's a demo:

  I rendered a white object against a transparent background using
antialiasing with POV-Ray 3.6. Then I opened the resulting image in
the gimp, added a layer below the opened image and colored that layer
red. This is a highly-zoomed view of a portion of that image:

http://warp.povusers.org/snaps/pov36-blending.png

  The white object nicely blends with the added red background.

  Then I did the exact same thing with POV-Ray 3.7 beta, and this is
the result:

http://warp.povusers.org/snaps/pov37-blending.png

  Now the shape doesn't blend nicely with the background. It has a darkened
contour because of the original black 'background' in the original scene.

  This is exactly how POV-Ray used to work in the past and is precisely
the reason why it was changed to how POV-Ray 3.6 works. Usually when you
render an alpha-channeled image, you want the semi-transparent pixels to
blend with whatever will be below them, without any extraneous colors.

  I strongly suggest either changing the behavior back to how POV-Ray 3.6
does it, or at least make this behavior optional (with the default behavior
being that of POV-Ray 3.6, which is what people usually want). If not, this
will, once again, greatly diminish the usability of POV-Ray to create
alpha-channeled images.

  If the idea in POV-Ray 3.7 is that you can specify a transparency value
for the background instead of it being an on/off switch like in 3.6 (not
a bad idea, IMO), make it so that this transparency value is taken into
account in those semi-transparent pixels. In other words, when blending
pixels with the background, take the background color into account weighted
by this transparency value (that is, if the transparency is set to 0.75,
only take the background color into account with a weight of 0.25; if the
transparency is set to 1, the weight would be 0, ie. the background color
is not taken into account at all).
  IMO that would be a more logical way of doing it. That's how it would
work if the background was a transparent plane with that color behind
everything else (if a transmission value of 1 has been specified for
that plane, its color doesn't matter).

-- 
                                                          - Warp


Post a reply to this message

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