POV-Ray : Newsgroups : povray.binaries.scene-files : Fade in a complex mesh Server Time: 19 Dec 2018 11:21:38 GMT
  Fade in a complex mesh (Message 1 to 2 of 2)  
From: SecondCup
Subject: Fade in a complex mesh
Date: 27 Oct 2016 23:40:01
Message: <web.58128fbe543e276ef0b3ab370@news.povray.org>
Hi,

Any idea where I'm going wrong with this fade in? I want the CGL_band to be
transparent then fade in gradually with each animated shot. Ive got it to fade
to the gray un-textured solid, or Ive got it to fade into the texture from a
black silhouette but cant figure out how to fade in the whole thing from
transparent to fully visible...

Here is the code and the "CGL_solid.inc" is attached

#declare Sandy = color rgbt <1, .9, .35>;

#declare Transmit = .8;
#declare CM_Sandstone =

colour_map{
  [0.3 rgbt <1, 1, 1, 1.2*Transmit*(clock)>]
  [0.4 rgbt <1, 0, 0, Transmit*(clock)>]
  [0.41 rgbt <0.5, 0.3, 0.1, .5*Transmit*(clock)>]
  [0.42 rgbt <1, 0, 0, .75*Transmit*(clock)>]
  [0.6 rgbt <1, 0.5, 0, Transmit*(clock)>]
  [0.7 rgbt <1, 1, 1, .5*Transmit*(clock)>]


}

#declare FSandstone =
finish{
  diffuse 0.35 ambient 0.05
}

#declare TSandstone =
texture{
  pigment {Sandy
  turbulence 0.99}
  finish{FSandstone}
  normal {granite 5 scale 500}
}

#declare TStain = texture{
  pigment{
    //agate
    gradient <.3, 2, .1>//2
    turbulence 0.15
    colour_map{CM_Sandstone}
    scale 1000
  }
  finish{FSandstone}
}

#declare TSandstone1 =
texture{TSandstone}
texture{TStain}


//*********************************************
//
//               Include the solid from an external file
//
//*********************************************

#include "CGL_solid.inc"

object {CGLband
        texture {TSandstone1}
        translate <-723750,-422.035,-9092750>}


Post a reply to this message


Attachments:
Download 'cgl_solid.inc.txt' (99 KB)

From: Alain
Subject: Re: Fade in a complex mesh
Date: 28 Oct 2016 00:04:04
Message: <581295f4$1@news.povray.org>
Le 16-10-27 à 19:37, SecondCup a écrit :
> Hi,
>
> Any idea where I'm going wrong with this fade in? I want the CGL_band to be
> transparent then fade in gradually with each animated shot. Ive got it to fade
> to the gray un-textured solid, or Ive got it to fade into the texture from a
> black silhouette but cant figure out how to fade in the whole thing from
> transparent to fully visible...
>
> Here is the code and the "CGL_solid.inc" is attached
>
> #declare Sandy = color rgbt <1, .9, .35>;
>
> #declare Transmit = .8;
> #declare CM_Sandstone =
>
> colour_map{
>   [0.3 rgbt <1, 1, 1, 1.2*Transmit*(clock)>]
>   [0.4 rgbt <1, 0, 0, Transmit*(clock)>]
>   [0.41 rgbt <0.5, 0.3, 0.1, .5*Transmit*(clock)>]
>   [0.42 rgbt <1, 0, 0, .75*Transmit*(clock)>]
>   [0.6 rgbt <1, 0.5, 0, Transmit*(clock)>]
>   [0.7 rgbt <1, 1, 1, .5*Transmit*(clock)>]
>
>
> }
>
You want everything to have transmit 1 when clock reatch the value of 1. 
In your actual code, this can NEVER appen. At most, it tops at 0.96 for 
the first entry of your colour_map, and as low as 0.4 in the worst case.

Your «Sandy» don't have any transparency. It get expanded to rgbt<1, 
0.9, 0.35, 0>

You need your transmit to go from zero to one, or from one to zero.
This may work beter for a fade out:
colour_map{
   [0.3 rgbt <1, 1, 1, clock>]
   [0.4 rgbt <1, 0, 0, clock>]
   [0.41 rgbt <0.5, 0.3, 0.1, clock>]
   [0.42 rgbt <1, 0, 0, clock>]
   [0.6 rgbt <1, 0.5, 0, clock>]
   [0.7 rgbt <1, 1, 1, clock>]
}

For a fade in, try this:
colour_map{
   [0.3 rgbt <1, 1, 1, 1-clock>]
   [0.4 rgbt <1, 0, 0, 1-clock>]
   [0.41 rgbt <0.5, 0.3, 0.1, 1-clock>]
   [0.42 rgbt <1, 0, 0, 1-clock>]
   [0.6 rgbt <1, 0.5, 0, 1-clock>]
   [0.7 rgbt <1, 1, 1, 1-clock>]
}

If any texture need to have any transmiting transparency when fully 
visible, you need to restrict the range of your transmit accordingly.
Like this:
rgbt<1, 1, 1, 0.5+ 0.5*Transmit*clock>

If you have a filtering pigment, the filter need to drop to zero as the 
transmit reatch one.
Sample:
rgbft<1, 0.5, 0.12, 1*(1-clock), clock>
This is the only case where you need the parantesis.


Alain


Post a reply to this message

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