POV-Ray : Newsgroups : povray.general : alpha masking (again?) Server Time
17 Nov 2024 01:12:48 EST (-0500)
  alpha masking (again?) (Message 1 to 5 of 5)  
From: Michael Sobers
Subject: alpha masking (again?)
Date: 16 Jul 2003 20:43:22
Message: <3f15f12a$1@news.povray.org>
In an earlier post, Scott Gammans asked a question regarding masking out
objects using something he described as an "alpha_only" property (search
general for "alpha masking").  After a verbal pummeling on why this would be
useless to speed up rendering, someone made the (somewhat helpful)
suggestion of using different colors to "key out" parts of the picture.

This is exactly the scenario that would benefit from using an "alpha_only"
object.  For instance, I am adding animated objects to a live video, and I
need a way to mask out sections of the video foreground so that the CG
objects can go "behind" objects in the video.  I have used color keying
(placing bright green objects in the foreground to mask regions out) but
this causes some artifacts along antialiased edges and causes problems with
reflective surfaces.  An "alpha_only" object would be most helpful here.
Since that feature probably won't be available soon, is there an easy way to
"fake" it using bounding or some kind of surface checking?  For instance, if
a ray hits the masking object, the pixel is automatically set to
transparent?  I have thought about using CSG difference to "remove" portions
of the background objects at the appropriate spots, but I haven't tried it
yet (seems like it might be time consuming getting all the angles to line up
right with the camera).

Any suggestions?  Thanks!

-------------------------
text{ttf "crystal.ttf", "Mike", 0.01, 0 pigment {blue 10}translate
<-1,-0.2,2>}


Post a reply to this message

From: PoD
Subject: Re: alpha masking (again?)
Date: 17 Jul 2003 07:02:13
Message: <pan.2003.07.17.11.02.10.473216@internode.on.net>
On Wed, 16 Jul 2003 18:43:28 -0600, Michael Sobers wrote:

> In an earlier post, Scott Gammans asked a question regarding masking out
> objects using something he described as an "alpha_only" property (search
> general for "alpha masking").  After a verbal pummeling on why this would be
> useless to speed up rendering, someone made the (somewhat helpful)
> suggestion of using different colors to "key out" parts of the picture.
> 
> This is exactly the scenario that would benefit from using an "alpha_only"
> object.  For instance, I am adding animated objects to a live video, and I
> need a way to mask out sections of the video foreground so that the CG
> objects can go "behind" objects in the video.  I have used color keying
> (placing bright green objects in the foreground to mask regions out) but
> this causes some artifacts along antialiased edges and causes problems with
> reflective surfaces.  An "alpha_only" object would be most helpful here.
> Since that feature probably won't be available soon, is there an easy way to
> "fake" it using bounding or some kind of surface checking?  For instance, if
> a ray hits the masking object, the pixel is automatically set to
> transparent?  I have thought about using CSG difference to "remove" portions
> of the background objects at the appropriate spots, but I haven't tried it
> yet (seems like it might be time consuming getting all the angles to line up
> right with the camera).
> 
> Any suggestions?  Thanks!
> 
> -------------------------
> text{ttf "crystal.ttf", "Mike", 0.01, 0 pigment {blue 10}translate
> <-1,-0.2,2>}

One idea you could try is clipping your whole scene with an inverse
object. i.e.

union{
   put your whole scene here
   
   clipped_by{
   object{blah inverse}
}

This should not render any rays that hit the clipping object.
It will probable play hell with your render times and may not work as
expected...


Post a reply to this message

From: Michael Sobers
Subject: Re: alpha masking (again?)
Date: 17 Jul 2003 22:52:33
Message: <3f1760f1$1@news.povray.org>
----- Original Message ----- 
From: "PoD" <pod### [at] internodeonnet>
Newsgroups: povray.general
Sent: Thursday, July 17, 2003 5:02 AM
Subject: Re: alpha masking (again?)


> >
> > Any suggestions?  Thanks!
> >
>
> One idea you could try is clipping your whole scene with an inverse
> object. i.e.
>
> union{
>    put your whole scene here
>
>    clipped_by{
>    object{blah inverse}
> }
>
> This should not render any rays that hit the clipping object.
> It will probable play hell with your render times and may not work as
> expected...
>

I tried this, but it seemed to have no effect at all.  Anyone else out there
have some clever ideas?

-------------------------------
text{ttf "crystal.ttf","Mike",0.1,0 pigment{gradient y color_map
{[0 rgb <6,7,10>] [.95 rgb <1,2,10>] [.96 rgb <10,2,8>]}
turbulence 4}rotate-15*y translate<-0.8,-0.3,1.6>}


Post a reply to this message

From: Breton Slivka
Subject: Re: alpha masking (again?)
Date: 17 Jul 2003 23:35:22
Message: <Xns93BBDC0FBF31DZenPsychoyahoocom@204.213.191.226>
I'm not sure, but last time I checked, an object with pigment{color rgbt
<0,0,0,1>}    renders as white on the alpha channel. maybe play with that, 
and add an ambient 1 finish if you must.


Post a reply to this message

From: Tony LaVigne
Subject: Re: alpha masking (again?)
Date: 18 Jul 2003 00:35:01
Message: <web.3f17780c99e8fcb7a6cd6ab90@news.povray.org>
Michael,
I know what you mean when you set the back ground to an unnatural color
(like [0 1 0]  ) in the hopes of filtering it out later only to find it
bled into the sides of your aliased images.
   One method that worked for me was  to double or triple the lengths and
widths
of the image size and not use anti-aliasing (is that a double negative?).
This does yield a much larger image (4 or 9 times larger) but with
anti-aliasing off it's surprisingly fast.  I then filtered out the
background and averaged 4 (if lengths and width doubled) adjacent pixels to
give me one useable pixel for my image.  If one or more pixels is part of
the background you can use your new background instead or leave it out in
your averaging or do some other creative processing for it.  This will
reduce the image length and width down to your originally targeted size.
The down size is your post processing your POVRAY rendered images but it
sounds like you were doing that already.
Just a thought. If you find another solution please let us know.
Tony

xen### [at] xenomechanicscom


Post a reply to this message

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