POV-Ray : Newsgroups : povray.general : transparency gradient? : Re: transparency gradient? Server Time
12 Aug 2024 11:20:48 EDT (-0400)
  Re: transparency gradient?  
From: Spider
Date: 15 Feb 1999 21:40:25
Message: <36C8D94F.A0AC8191@bahnhof.se>
Ken wrote:
> 
> 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
> 

> 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.
Yes, I understand and agree with you, but I thought your example was so
good at adressing the use of multiple entries in a colour_map that I
don't needed to add those(forgot is abetter explination)

as for the turbulence, it was mostly a joke, but with a more serious
tone to it.

I've taken the right to render an example with both our variants.
I'll convert to jpg. and upload to binaries.images.

Here is the source.
look here in the beginning. I haven't made an attempt to make my code
look like ken's, notr the results.


#version 3.1;
#declare SpidMap =
color_map { 
  [00/10 color rgbt <1,0,0,1> ]
  [01/10 color rgbt <1,0,0,1> ]
  [09/10 color rgbt <1,0,0,0> ] 
  [10/10 color rgbt <1,0,0,0> ] 
}
#declare KenMap =
color_map{
  [00/10 rgbf<1,0,0,1.0>]
  [01/10 rgbf<1,0,0,1.0>]
  [01/10 rgbf<1,0,0,1.0>]
  [02/10 rgbf<1,0,0,0.9>]
  [03/10 rgbf<1,0,0,0.8>]
  [04/10 rgbf<1,0,0,0.7>]
  [05/10 rgbf<1,0,0,0.6>]
  [06/10 rgbf<1,0,0,0.5>]
  [07/10 rgbf<1,0,0,0.4>]
  [08/10 rgbf<1,0,0,0.3>]
  [09/10 rgbf<1,0,0,0.2>]
  [10/10 rgbf<1,0,0,0.0>]
}


global_settings { assumed_gamma 1.0 }
camera {
  location  <0.0, 0.5, -4.0>
  direction 1.5*z
  right     4/3*x
  look_at   <0.0, 0.0,  0.0>
}

sky_sphere {
  pigment {
    gradient y
    color_map { [0.0 color blue 0.6] [1.0 color rgb 1] }
  }
}

light_source { <-30, 30, -30>,color rgb 1 }
plane { y, -1 pigment {color rgb 1} finish{ambient 0 }}

//Top left
cylinder { 
  <0,1,0>,<0,0,0>, 0.6
  texture {
    pigment {
      gradient y
      color_map { SpidMap }
    }
    finish{ specular .2 }
  }
  translate -0.7*x
  translate 0.1*y
}

//lowLeft
cylinder { 
  <0,1,0>,<0,0,0>, 0.6
  texture {
    pigment {
      gradient y
      turbulence <0.3,1.2,0.2>/100
      octaves 3600 //ou _are_ patient, aren't you *smile*
      omega 1/24
      lambda 0.2
      color_map { SpidMap }
    }
    finish{ specular .2 }
  }
  translate -0.7*x
  translate -0.99999*y
}
//low right, Ken's method
cylinder { 
  <0,1,0>,<0,0,0>, 0.6
  texture {
    pigment {
      gradient y
      color_map{ KenMap }
    }
    finish{ specular .2 }
  }
  translate 0.7*x
  translate -0.99999*y
}

//top right, Ken's method
cylinder { 
  <0,1,0>,<0,0,0>, 0.6
  texture {
    pigment {
      gradient y
      turbulence <0.3,1.2,0.2>/100
      octaves 3600 //ou _are_ patient, aren't you *smile*
      omega 1/24
      lambda 0.2
      color_map{ KenMap }
    }
    finish{ specular .2 }
  }
  translate 0.7*x
  translate 0.1*y
}


Post a reply to this message

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