POV-Ray : Newsgroups : povray.newusers : transparent background : transparent background Server Time
29 Jul 2024 00:23:41 EDT (-0400)
  transparent background  
From: Shawn
Date: 11 Mar 2007 00:55:00
Message: <web.45f398ac1ac5cb4eaf07da010@news.povray.org>
Hi,

I'm trying to render a scene with mac megapov in which I want the output to
be a PNG with transparency.  I set the output file option by checking the
box labeled 'Add Alpha Channel', which presumably is equivalent to "+ua" on
the command line.  However, I always end up with a black background, rather
than a transparent one.

Any suggestions would be appreciated.

Thanks,
Shawn

---

#version 3.5;

camera {
location <0, 0, 10>
look_at <0, 0, 0>
}

#declare cam_pos = <0, 0, 10>;
#declare dist = 1.03;
#declare thick1 = 0.05;
#declare linetex = texture {pigment {rgb 0} finish {ambient 1}}
#declare trans = transform {rotate 90*clock*y}

#macro scalepoint(center,amt)
        transform {trans}
        translate -center scale amt translate center
#end

#macro atom(center,rad,thick)
        union {
                sphere {center,rad transform {trans}}
                sphere {center,(rad+thick1) texture {linetex}
scalepoint(cam_pos,dist)}
                }
#end

#declare ATM_FINISH = finish {ambient rgb <1,1,1> }
#declare textgrey = texture {pigment {slope {vnormalize(<1000,1000,1000>)}
color_map{[0.625 color rgb <.45,.45,.45>][0.626 color rgb <.5,.5,.5>]}}
finish {ATM_FINISH}}
#declare textred = texture {pigment {slope {vnormalize(<1000,1000,1000>)}
color_map{[0.625 color rgb <.8,0,0>][0.626 color rgb <.95,0,0>]}} finish
{ATM_FINISH}}
#declare textgreen = texture {pigment {slope {vnormalize(<1000,1000,1000>)}
color_map{[0.625 color rgb <0,.8,0>][0.626 color rgb <0,.95,0>]}} finish
{ATM_FINISH}}
#declare textblue = texture {pigment {slope {vnormalize(<1000,1000,1000>)}
color_map{[0.625 color rgb <0,0,.8>][0.626 color rgb <0,0,.95>]}} finish
{ATM_FINISH}}

background { color rgb <10,10,10> }

fog {
  fog_type   2
  distance   4
  color      rgbt <0,0,0,.1>
  fog_offset 1
  fog_alt    .0001
  up <0,0,1>
}

object {atom(<-2,-2,0> .4, thick1) texture {textgrey}}
object {atom(<-2,2,0> .4, thick1) texture {textred}}
object {atom(<2,-2,0> .4, thick1) texture {textgreen}}
object {atom(<2,2,0> .4, thick1) texture {textblue}}


Post a reply to this message

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