POV-Ray : Newsgroups : povray.general : Making Background transparent... Server Time
9 Aug 2024 03:20:15 EDT (-0400)
  Making Background transparent... (Message 19 to 28 of 28)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Ron Parker
Subject: Re: Making Background transparent...
Date: 26 Sep 2000 15:57:28
Message: <slrn8t20p1.7a3.ron.parker@fwi.com>
On Tue, 26 Sep 2000 22:09:14 +0300, Peter Popov wrote:
>On Sun, 24 Sep 2000 22:19:02 +0200, "Rune" <run### [at] inamecom>
>wrote:
>
>>"PoD" wrote:
>>> At the edges of objects the rgb values of the object are AAed
>>> with the background colour.  When I turn on transparency, it's
>>> because I want the background to represent _nothing_, how can
>>> nothing have a colour?  There should be no leftovers to remove.
>>
>>Exactly. The background presence should be stored in the alpha
>>channel only. Not in the red, green and blue components.
>
>So, when anti-aliasing, how should POV treat rays that hit the
>background? Ignore them?

No, average them in as pure alpha.  Rune has the right idea.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.
Proudly not helping RIAA and SDMI steal my rights -- 
  http://www.eff.org/Misc/EFF/Newsletters/EFFector/HTML/effect13.08.html


Post a reply to this message

From: Rune
Subject: Re: Making Background transparent...
Date: 26 Sep 2000 17:40:40
Message: <39d117d8@news.povray.org>
"Peter Popov" wrote:
> If the edge of red sphere on a blue background takes only 10%
> of a pixel, then this pixel will have a color of <0.1,0,0.9> .
> If you make it <1,0,0>, antialiasing will be totally useless
> as no jaggies will be reduced.

The jaggies will disappear when you view the image in a program that
supports the alpha channel. I think my post in povray.binaries.images shows
very well the advantage of the method I describe and the disadvantage of the
current method.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated August 7)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Rune
Subject: Re: Making Background transparent...
Date: 26 Sep 2000 17:57:54
Message: <39d11be2@news.povray.org>
"Peter Popov" wrote:
> So, when anti-aliasing, how should POV treat rays that hit
> the background? Ignore them?

For antialiased pixels where only some of the rays hit the background I have
already explained what to do. However, for antialiased pixels where *all*
the rays hit the background we have a special case.

Since the pixel is 100% transparent technically the colour is indifferent.
Of course POV-Ray has to assign a colour anyway, and that is the colour that
is shown in programs that doesn't support the alpha channel. An obvious
choice to assign to those pixels would be the background colour specified by
the user. But remember that this colour should only be used in pixels that
are 100% background (= 100% transparent).

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated August 7)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Peter Popov
Subject: Re: Making Background transparent...
Date: 26 Sep 2000 23:36:04
Message: <ahq2ts48ia6keatkn6gf34ns5lae5itanc@4ax.com>
On Tue, 26 Sep 2000 23:40:17 +0200, "Rune" <run### [at] inamecom>
wrote:

>"Peter Popov" wrote:
>> If the edge of red sphere on a blue background takes only 10%
>> of a pixel, then this pixel will have a color of <0.1,0,0.9> .
>> If you make it <1,0,0>, antialiasing will be totally useless
>> as no jaggies will be reduced.
>
>The jaggies will disappear when you view the image in a program that
>supports the alpha channel. I think my post in povray.binaries.images shows
>very well the advantage of the method I describe and the disadvantage of the
>current method.

*If and only if* you know the background color. And how about
sky_sphere? Say you want your sky reflected in a metal sphere and then
you want that metal sphere masked out, how will you proceed?


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Peter Popov
Subject: Re: Making Background transparent...
Date: 26 Sep 2000 23:40:41
Message: <gmq2tsccjcd440mt2apso21nut0g5q9ovp@4ax.com>
On 26 Sep 2000 15:57:28 -0400, ron### [at] povrayorg (Ron Parker)
wrote:

>>So, when anti-aliasing, how should POV treat rays that hit the
>>background? Ignore them?
>
>No, average them in as pure alpha.  Rune has the right idea.

Rune proposes that they should be ignored in the color channels and
only the alpha channel carried information about them. This would make
more sense if a) the background color is stored in the image somehow
(I like Rune's idea about 100% transparent pixels) and b) sky_sphere
is not used. I dont' really know how this will affect fog, global
media and rainbow effects. I am pretty sure it will mess the former
two up, though.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: J  Grimbert
Subject: Re: Making Background transparent...
Date: 27 Sep 2000 03:40:35
Message: <39D1A480.52C49523@atos-group.com>
Peter Popov wrote:
> 
> On 26 Sep 2000 15:57:28 -0400, ron### [at] povrayorg (Ron Parker)
> wrote:
> 
> >>So, when anti-aliasing, how should POV treat rays that hit the
> >>background? Ignore them?
> >
> >No, average them in as pure alpha.  Rune has the right idea.
> 
> Rune proposes that they should be ignored in the color channels and
> only the alpha channel carried information about them. This would make
> more sense if a) the background color is stored in the image somehow
> (I like Rune's idea about 100% transparent pixels) and b) sky_sphere
> is not used. I dont' really know how this will affect fog, global
> media and rainbow effects. I am pretty sure it will mess the former
> two up, though.
> 

a) Only meaningfull if you do not want any alpha.
If I request the alpha channel, the background is only a 
placeholder for the directview in POV. If I intended
to have a picture with an alpha channel, you can assumed
that I will be able to use it in the generated picture.
So 100% transparent pixel does not need to adapt their
color to the background of the pov-script.

b) If sky_sphere is used, how can you have any alpha information ?
I do not understand how it could happen (No ray reach infinity,
they hit the sky_sphere first, hence, I suppose, no transparency
in the alpha channel.)

So basically, I currently agree with Rune & Ron Parker.


Post a reply to this message

From: Rune
Subject: Re: Making Background transparent...
Date: 27 Sep 2000 08:58:24
Message: <39d1eef0@news.povray.org>
"Peter Popov" wrote:
> Rune proposes that they should be ignored in the color channels
> and only the alpha channel carried information about them.
> This would make more sense if a) the background color is stored
> in the image somehow

I don't understand why. You don't come with any arguments. Try to provide an
example to demonstrate what you mean. I have made both an image example and
in the reply to warp a mathematical demonstration of why my method makes
more sense. You haven't commented on either of those. Please tell me exactly
why they are wrong.

> and b) sky_sphere is not used.

The sky_sphere works in the alpha channel the same way as a solid object so
it makes perfectly sense to use it.

> I dont' really know how this will affect fog, global media
> and rainbow effects. I am pretty sure it will mess the former
> two up, though.

Keep in mind that my original point was only about how the alpha channel
worked together with anti-aliasing, not how it works in general. I'd like to
go on and discuss those aspects later, but first I'd like to know why you
think my method is wrong in general.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated August 7)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Ron Parker
Subject: Re: Making Background transparent...
Date: 27 Sep 2000 09:36:28
Message: <slrn8t3ur4.7hh.ron.parker@fwi.com>
On Wed, 27 Sep 2000 06:37:45 +0300, Peter Popov wrote:
>On 26 Sep 2000 15:57:28 -0400, ron### [at] povrayorg (Ron Parker)
>wrote:
>
>>>So, when anti-aliasing, how should POV treat rays that hit the
>>>background? Ignore them?
>>
>>No, average them in as pure alpha.  Rune has the right idea.
>
>Rune proposes that they should be ignored in the color channels and
>only the alpha channel carried information about them. This would make
>more sense if a) the background color is stored in the image somehow
>(I like Rune's idea about 100% transparent pixels)

Why do you want the background color stored in the image?   By asking for
alpha, you're asking that the background color be irrelevant.  Programs 
that ignore the alpha channel aren't working properly and should be 
ignored themselves.  In effect, you're asking for a background color of
pure alpha, which should override the setting in the global_settings block.

 and b) sky_sphere
>is not used. I dont' really know how this will affect fog, global
>media and rainbow effects. I am pretty sure it will mess the former
>two up, though.

Fog at least will always preclude any background from showing through.
Global media and rainbow can mix with alpha just as easily as they can 
with a real background.  

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.
Proudly not helping RIAA and SDMI steal my rights -- 
  http://www.eff.org/Misc/EFF/Newsletters/EFFector/HTML/effect13.08.html


Post a reply to this message

From: Peter Popov
Subject: Re: Making Background transparent...
Date: 27 Sep 2000 12:39:30
Message: <8c84tsgsvegdjnde12k3gpsi12p3bh98fg@4ax.com>
Rune, Ron, J. and any others I've forgotten.

Practice shows that "they can't all be wrong." I'll agree with you for
now and if, when I have more time to think over it, I come up with
arguments stronger than yours, I'll post them. Until then, you got me
convinced.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] usanet
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Pabs
Subject: Re: Making Background transparent...
Date: 28 Sep 2000 01:39:33
Message: <39D2D94F.82F436BB@hotmail.com>
"J. Grimbert" wrote:

> b) If sky_sphere is used, how can you have any alpha information ?
> I do not understand how it could happen (No ray reach infinity,
> they hit the sky_sphere first, hence, I suppose, no transparency
> in the alpha channel.)

Rays don't hit sky_spheres - they go to infinity where the sky_sphere is
Background & skysphere are the same thing.

--
Bye
Pabs


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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