POV-Ray : Newsgroups : povray.general : transparency gradient? Server Time
12 Aug 2024 09:24:57 EDT (-0400)
  transparency gradient? (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Marc Schimmler
Subject: transparency gradient?
Date: 15 Feb 1999 18:35:00
Message: <36C8AFC1.F51E1374@ica.uni-stuttgart.de>
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


Post a reply to this message

From: Ken
Subject: Re: transparency gradient?
Date: 15 Feb 1999 18:57:22
Message: <36C8B40C.90E30E9E@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

Note: for the purpose of this response I am going to refer to
transperancy as clear just because it's easier to type :)

You are on the right track with the gradient idea. The thing you
have to watch out for with mixing solid pigments with clear pigments
is that the pattern function will blend the solids in with the clear
parts making them much less clear. TO get around this you have to
carefully design you color map around this limitation.

An untested example:

                              cylinder{
                             <0,-1,0>,
                            <0,1,0>,
                           1
                          pigment{
                         gradient y
                       color_map{
           [0.0 rgbf<1,1,1,1.0>]
           [0.0 rgbf<1,1,1,1.0>]
           [0.2 rgbf<1,1,1,0.8>]
           [0.2 rgbf<1,1,1,0.8>]
           [0.4 rgbf<1,1,1,0.6>]
           [0.4 rgbf<1,1,1,0.6>]
           [0.6 rgbf<1,1,1,0.4>]
           [0.6 rgbf<1,1,1,0.4>]
           [0.8 rgbf<1,1,1,0.2>]
           [1.8 rgbf<1,1,1,0.2>]
           [1.0 rgbf<1,1,1,0.0>]
                                 }
                      translate -.5
                                    }
                                      }


How is my indenting now people ?

Anyway if you study the example you will see that I have bracketed each
map entry with a duplicate entry. This causes a sharp demarcation of
pigment color, clearness, and stops the bleeding from adjacent entries.
This example may be too sharp in it's cutoff points for what you want.
To correct this let each value in the color map entry extend a bit
higher than the one before it. If that doesn't work for you then just
start randomly playing with values and see what happens. Exploration
is a mighty powerfull teacher and there are few substitutions that will
replace it.


-- 
Ken Tyler

mailto://tylereng@pacbell.net


Post a reply to this message

From: Spider
Subject: Re: transparency gradient?
Date: 15 Feb 1999 19:13:21
Message: <36C8B6D8.23C34458@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
> 
> Note: for the purpose of this response I am going to refer to
> transperancy as clear just because it's easier to type :)
> 
> You are on the right track with the gradient idea. The thing you
> have to watch out for with mixing solid pigments with clear pigments
> is that the pattern function will blend the solids in with the clear
> parts making them much less clear. TO get around this you have to
> carefully design you color map around this limitation.
> 
> An untested example:
> 
>                               cylinder{
>                              <0,-1,0>,
>                             <0,1,0>,
>                            1
>                           pigment{
>                          gradient y
>                        color_map{
>            [0.0 rgbf<1,1,1,1.0>]
>            [0.0 rgbf<1,1,1,1.0>]
>            [0.2 rgbf<1,1,1,0.8>]
>            [0.2 rgbf<1,1,1,0.8>]
>            [0.4 rgbf<1,1,1,0.6>]
>            [0.4 rgbf<1,1,1,0.6>]
>            [0.6 rgbf<1,1,1,0.4>]
>            [0.6 rgbf<1,1,1,0.4>]
>            [0.8 rgbf<1,1,1,0.2>]
>            [1.8 rgbf<1,1,1,0.2>]
>            [1.0 rgbf<1,1,1,0.0>]
>                                  }
>                       translate -.5
>                                     }
>                                       }
> 
> How is my indenting now people ?
interesting. it's.... Different.


> 
> Anyway if you study the example you will see that I have bracketed each
> map entry with a duplicate entry. This causes a sharp demarcation of
> pigment color, clearness, and stops the bleeding from adjacent entries.
> This example may be too sharp in it's cutoff points for what you want.
> To correct this let each value in the color map entry extend a bit
> higher than the one before it. If that doesn't work for you then just
> start randomly playing with values and see what happens. Exploration
> is a mighty powerfull teacher and there are few substitutions that will
> replace it.

Well, that is if you want it to be filtering the light.

Easier would be transparent.(transmit)
pigment { 
  gradient y
  tubulence <0.3,1.2,0.2>
  octaves 3600 //ou _are_ patient, aren't you *smile*
  omega 1/24
  lambda 0.4
  colour_map {
    [0.0 colour rgbt <0.7,0.7,1,0>]
    [1.0 colour rgbt <0.7,0.7,1,1>]
  }
}

//Spider
"42"
http://www.bahnhof.se/~spider/


Post a reply to this message

From: John M  Dlugosz
Subject: Re: transparency gradient?
Date: 15 Feb 1999 19:48:12
Message: <36c8c04c.0@news.povray.org>
>
>How is my indenting now people ?
>


Creative, yet still functional.  Go with it!


Post a reply to this message

From: Ken
Subject: Re: transparency gradient?
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

From: Spider
Subject: Re: transparency gradient?
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

From: Marc Schimmler
Subject: Re: transparency gradient?
Date: 16 Feb 1999 02:52:24
Message: <36C923B8.3D29DB9F@ica.uni-stuttgart.de>
Thank you Mr. Tyler thank you Spider!

Your advice is a real great help for me!

Povingly,

Marc
-- 
Marc Schimmler


Post a reply to this message

From: Lars W 
Subject: Re: transparency gradient?
Date: 16 Feb 1999 05:22:04
Message: <36C9471B.AB1B4B8D@snafu.de>
Hi

I think it the Ken Map would work better if you are not just fading from red to
transparent red.
Try to fade to transparent White.

I mean the following


color_map {
    [0 color rgbf <1,0,0,0>]
                ...                            <- i still don't know why it is
nesscesary to make multiple entrys ?
    [1 color rgbf <1,1,1,1>]
    }

Spider schrieb:

> 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

From: Nieminen Mika
Subject: Re: transparency gradient?
Date: 16 Feb 1999 05:55:44
Message: <36c94eb0.0@news.povray.org>
The simplistic version:

cylinder
{ 0,y,1
  pigment
  { gradient y color_map
    { [0 rgb 1]
      [1 rgbf 1]
    }
  }
}

-- 
main(i){char*_="BdsyFBThhHFBThhHFRz]NFTITQF|DJIFHQhhF";while(i=
*_++)for(;i>1;printf("%s",i-70?i&1?"[]":" ":(i=0,"\n")),i/=2);} /*- Warp -*/


Post a reply to this message

From: Marc Schimmler
Subject: Re: transparency gradient?
Date: 16 Feb 1999 06:27:43
Message: <36C9562E.3386C025@ica.uni-stuttgart.de>
Hi Warp1

Thank you for your answer!

I checked your solution and changed it in two ways.

First a height of 1 for the cylinder leads to the repeating of the
gradient so that both ends are opaque. By using y*0.999 I avoided this.

Second, the effect I was looking for is more the solution spider had
given using the rgbt instead of the rgbf.

I will post at binaries.images two cylinders that show the difference.

Again, thank you

Marc
-- 
Marc Schimmler


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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