POV-Ray : Newsgroups : povray.binaries.images : Adding an alpha gradient to an image_map? Server Time
30 Jul 2024 12:19:57 EDT (-0400)
  Adding an alpha gradient to an image_map? (Message 11 to 11 of 11)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Tek
Subject: Re: Adding an alpha gradient to an image_map?
Date: 15 May 2012 05:50:00
Message: <web.4fb2264d22e1e625a7bdb6910@news.povray.org>
It's simpler to do it like this:

texture {
    pigment_pattern {
        gradient z
        // transform gradient without affecting patterns in the texture_map
        scale 2
        translate -z
    }
    texture_map {
        [0.45 T_Earth_Day]
        [0.55 T_Earth_Night]
    }
}

That way you don't need to work out how to undo the transformation.

--
Tek

clipka <ano### [at] anonymousorg> wrote:

>
> > texture
> > {
> > gradient z
> > texture_map
> > {
> > [0 T_Earth_Day]
> > [0.45 T_Earth_Day]
> > [0.55 T_Earth_Night]
> > [1 T_Earth_Night]
> > }
> > scale 2
> > translate <0, 0, -1>
> > }
>
> Note that this also scales & translates the individual textures in the
> map; you'd need to do something like:
>
>    texture
>    {
>      gradient z
>      texture_map
>      {
>        [0.45 T_Earth_Day   translate z*1 scale 0.5]
>        [0.55 T_Earth_Night translate z*1 scale 0.5]
>      }
>      scale 2
>      translate z*-1
>    }
>
> (Also note that I removed the texture map entries for 0 and 1, as
> they're not needed if they're identical to their respective "neighbor"
> entries.)


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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