POV-Ray : Newsgroups : povray.general : Transparent : Re: Transparent Server Time
11 Aug 2024 17:17:09 EDT (-0400)
  Re: Transparent  
From: Jeff Lee
Date: 2 Jun 1999 12:36:51
Message: <37554f93.0@news.povray.org>
Remco de Korte <rem### [at] xs4allnl> wrote:
> Peter Popov wrote:
>> On 1 Jun 1999 16:39:01 -0500, par### [at] fwicom (Ron Parker) wrote:
>> 
>> >Use an image format that supports an alpha channel (PNG
>> >does) and put the +UA switch on the command line or in
>> >your ini file.
>> 
>> ...and don't use a sky sphere nor afloor plane.
>
> ... but use background{}.

Actually, you *can* use a sky_sphere, which is nice if you want a
metallic object to reflect the sky.  Here's what I did when I wanted
this effect:

#declare P_Cloudy = pigment {  bozo               // (based on P_Cloud3)
  colour_map {
    [0.0   rgb <0.850, 0.850, 0.850> ]
    [0.1   rgb <0.550, 0.600, 0.650> ]
    [0.5   rgb <0.184, 0.184, 0.309> ]
    [1.001 rgb <0.100, 0.100, 0.200>]
  }
  turbulence 0.65  octaves 6  omega 0.707  lambda 2  scale <6,4,6>
}


#declare S_HalfSky = sky_sphere {
  pigment { gradient y
    pigment_map {
      [0.500 rgbt <0.5,0.5,0.5,1>]
      [0.500 rgb <0.184, 0.184, 0.309> ]
      [0.575 P_Cloudy scale <0.05, 0.40, 0.05> rotate z*30 ]
      [0.725 P_Cloudy scale <0.25, 0.15, 0.50> ]
    }
    translate y*-0.5
    scale 2
  }
}

This puts clouds in the top half of the sky sphere, but a 50% grey with
full transparency in the bottom half.  (I've found that 50% grey works
better than pure black or white when compositing the sprite over a
variety of differently-coloured background images.)

The only caveat I've discovered about creating sprites by this method is
that the alpha channel is derived from the first surface POV-Ray
encounters -- if you have a glass sphere with an opaque object inside
it, the alpha channel will *not* reflect the presence of the opaque
object; the background will show through the opaque object.


month ago, in the povray.bugreports group:

> Here's my solution: I create another scene with the same camera and
> objects. You remove the light_source.  And: the background is black,
> the opaque objects are white, and transparent objects vary from
> rgbt<1,1,1,0> (transmit=0 in the original scene) to rgbt<1,1,1,1>
> (transmit=1 in the original scene).  Of course, don't forget to set
> finish { ambient 1 diffuse 0 }.
>
> POV-Ray will directly render a 256-gray picture: the alpha channel
> you need.
>
> It works, but it needs more work than automatic alpha-channel
> rendering.


-- 
Jeff Lee         shi### [at] gatenet         http://www.gate.net/~shipbrk/


Post a reply to this message

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