POV-Ray : Newsgroups : povray.general : transparency gradient? : Re: transparency gradient? Server Time
12 Aug 2024 11:17:16 EDT (-0400)
  Re: transparency gradient?  
From: Ken
Date: 15 Feb 1999 20:36:45
Message: <36C8CB58.D0297D84@pacbell.net>
Marc Schimmler wrote:
> 
> I'm just wondering if it is possible to make an object which
> transparency that changes with it's height?
> Imagine a cylinder which is nearly total transparent at it's bottom and
> and fully opaque at the top.
> 
> Any help appreciated from indenters as well as from non-indenters!!! ;-)
> 
> Thanks in advance,
> Marc
> --
> Marc Schimmler

  After Spiders comments I felt compelled to prove, to myself anyway, that my
example was indeed an accurate representation of the requested pigment pattern.
I met those requirements quite well thank you. As for my comments in my other
reply to this thread about extending the color map entries so each map entry
is more the it's predecessor I went ahead and adjusted the map for you plus
corrected a couple of scaling issues. The example below should easily satisfy
your requirements. From what I saw the pigment is indeed clear at the bottom and
goes completely solid at the top. You may wish to still have some transparent
value even at the top and may accomplish this by extending the filter values
to the end of the color map.

Note to Spider:
  While your example was both a creative and fanciful example of
blending solid and transparent pigments it really didn't address
Marc's requirements for a gradual transition from clear to solid.
Marc may well take note of your example as it does show one of the
often under used and powerful features of creative texturing. The
one main fault with your example is that it is difficult at best
to get a totally transparent blend from one end of an object to the
other with only two entries in your color map (not to mention the
large amounts of turbulence used). Three pallet entries are almost
mandatory and four of more offer considerably greater control of the
patterns function.



  // #Ken       = 1
  // #indenting = 0

  cylinder{<0,-1,0>,<0,1,0>,1
  pigment{gradient y color_map{
  [0.1 rgbf<1,1,1,1.0>]
  [0.1 rgbf<1,1,1,1.0>]
  [0.2 rgbf<1,1,1,0.9>]
  [0.3 rgbf<1,1,1,0.8>]
  [0.4 rgbf<1,1,1,0.7>]
  [0.5 rgbf<1,1,1,0.6>]
  [0.6 rgbf<1,1,1,0.5>]
  [0.7 rgbf<1,1,1,0.4>]
  [0.8 rgbf<1,1,1,0.3>]
  [0.9 rgbf<1,1,1,0.2>]
  [1.0 rgbf<1,1,1,0.0>]}
  translate -.5 scale 2}
  scale<1,2,1>}

-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

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