Whisperings:Solo Piano Radio
  POV-Ray : Newsgroups : povray.beta-test : A step back in alpha transparency (+ua) blending? Server Time: 3 Dec 2008 02:50:10 GMT
  A step back in alpha transparency (+ua) blending? (Message 1 to 4 of 4)  
From: Warp
Subject: A step back in alpha transparency (+ua) blending?
Date: 29 May 2008 09: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

From: Thorsten Froehlich
Subject: Re: A step back in alpha transparency (+ua) blending?
Date: 29 May 2008 17:14:07
Message: <483ee45f$1@news.povray.org>
Warp wrote:
>   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.

It isn't complete.

	Thorsten


Post a reply to this message

From: Christoph Hormann
Subject: Re: A step back in alpha transparency (+ua) blending?
Date: 2 Jun 2008 06:18:32
Message: <484390b8@news.povray.org>
Warp schrieb:

>   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 current (3.6) behaviour was designed by Nathan - there was some 
discussion about this some time ago (don't remember where) about how 
exactly this background compensation should work.  If for example there 
is a specular highlight on a completely transparent surface you might 
want this highlight to be visible or not - the 3.6 code tried to address 
this but you can of course question if this is 'correct'.

Anyway what you describe how 3.7 handles transparency is of course not 
how you would usually like it.

-- Christoph


Post a reply to this message

From: Warp
Subject: Re: A step back in alpha transparency (+ua) blending?
Date: 2 Jun 2008 07:51:37
Message: <4843a688@news.povray.org>
Christoph Hormann <chris_hormann [at] gmxde> wrote:
> The current (3.6) behaviour was designed by Nathan - there was some 
> discussion about this some time ago (don't remember where) about how 
> exactly this background compensation should work.  If for example there 
> is a specular highlight on a completely transparent surface you might 
> want this highlight to be visible or not - the 3.6 code tried to address 
> this but you can of course question if this is 'correct'.

  Well, the highlight does make the surface less transparent regardless
of what is in the background, so I don't really see the ambiguity.

  But I understand that doing it "correctly" is not always necessarily
trivial. For example, one question is that if in an antialiased pixel
20% of the rays hit the object, 30% hit another differently-colored
object and 50% the background, what should be the color of that pixel?
The transparency is trivial (50% transparent), but what about the color?

  (I assume POV-Ray 3.6 makes the pixel 40% of the first object's shaded
color and 60% of the second's?)

-- 
                                                          - Warp


Post a reply to this message

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