POV-Ray : Newsgroups : povray.general : How to make object be transparent with alpha channel in the final image? : Re: How to make object be transparent with alpha channel in the final image? Server Time
31 Jul 2024 12:27:08 EDT (-0400)
  Re: How to make object be transparent with alpha channel in the final image?  
From: Zeger Knaepen
Date: 11 Sep 2007 16:32:09
Message: <46e6fb49$1@news.povray.org>
I believe it can be done with MegaPOV's camera_view pigment:
make the scene without any transparency, and define camera location and 
look_at (do not add a camera yet.
Next make a copy of the entire scene, including the camera-attributes and 
place it somewhere out of view for the first scene (for example, rotate it 
y*180 around the first camera location), this is your "mask-scene".  The 
textures for the mask-scene have to be altered: they have to be black and 
white, representing the transparency-levels: the objects that should be 
visible should be white, and the objects that should be transparent, should 
be black (don't forget to add finish {ambient 1 diffuse 0})

Now, again, somewhere out of view for both scenes, add a plane and a 
orthographic camera looking directly at that plane.  Create a texture for 
the plane, like this:
texture {
    pigment {
        camera_view{[mask-scene camera settings]}
        pigment_map {
            [0 rgbt 1]
            [1 camera_view{[original camera settings]}
        }
    }
    finish {ambient 1 diffuse 0}
}

(on second thought, a polygon instead of a plane might be a better idea: it 
would be easier to keep out of view of the other scenes)

Of course, it would be easier if POV-Ray had the ability to define multiple 
scenes in one file: you wouldn't have to worry about putting every scene out 
of view of every other scene :)

cu!
-- 
#macro G(b,e)b+(e-b)*C/50#end#macro _(b,e,k,l)#local C=0;#while(C<50)
sphere{G(b,e)+3*z.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1;
#end#end _(y-x,y,x,x+y)_(y,-x-y,x+y,y)_(-x-y,-y,y,y+z)_(-y,y,y+z,x+y)
_(0x+y.5+y/2x)_(0x-y.5+y/2x)            // ZK http://www.povplace.com


Post a reply to this message

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