POV-Ray : Newsgroups : povray.animations : Can fog be animated? Server Time
17 May 2024 07:48:10 EDT (-0400)
  Can fog be animated? (Message 1 to 4 of 4)  
From: RusHHouR
Subject: Can fog be animated?
Date: 2 Mar 2006 12:45:01
Message: <web.44072db2e8c9929547d3ae5e0@news.povray.org>
Howdy ho again!
After a semi-successful 44 hour render regarding my previous post, I've
decided I'd like to work on the next part in the animation for a while.
My question is, as quite distinctly hinted in subject line, can fog be
animated?

If so, where should I put the clock value in this fog definition, if I
wanted it to move more or less inte the x direction?

fog {
  fog_type   1
  distance   200
 color      rgb 0.6
 fog_offset 0.05
  fog_alt    0.5
  turbulence 0.2
}


And dont confirm my greatest fears; that it has to be media... for I cannot
grasp that function yet.. 8(

Tim, if you happen to read this, you had some smoke/fog/media moving in your
Chasm teaser. That's what I wanna do, but with ground fog!

(Almost) Any answer is highly respected and
heavily appreciated. ( <-- or sumthing )


Post a reply to this message

From: RusHHouR
Subject: Re: Can fog be animated?
Date: 2 Mar 2006 13:00:00
Message: <web.4407320279e2c68a47d3ae5e0@news.povray.org>
I guess one way would be to move the entire scene,
including camera, but not the fog.

But it's supposed to be a 2 minute animation... and continously moving the
scene and simultaniously doing the other animations in it seems awkward...
to say the least...


Post a reply to this message

From: Tim Nikias
Subject: Re: Can fog be animated?
Date: 2 Mar 2006 14:32:08
Message: <44074838@news.povray.org>
> And dont confirm my greatest fears; that it has to be media... for I
cannot
> grasp that function yet.. 8(

Well... Confirmed. Sorry.

> Tim, if you happen to read this, you had some smoke/fog/media moving in
your
> Chasm teaser. That's what I wanna do, but with ground fog!

That was media.

> (Almost) Any answer is highly respected and
> heavily appreciated. ( <-- or sumthing )

So, here's the code for the fog in the Chasm Teaser:

#declare Keylight_Pos = vrotate(<9,8,-2>,y*8*Clock);
#declare Black_Fade = 1;
#declare Animation_Time = 1;
#declare Clock = clock;

light_group{
  //Key-Light
  light_source{
    Keylight_Pos rgb 1*Black_Fade
    spotlight point_at <0,2.5,0> radius 15 falloff 30
    media_interaction on
  }

  box{
    <-50,-30,-5>,<20,10,55>
    hollow pigment{rgbt 1}
    interior{
      media{
        scattering{3,.025 extinction 0}
        method 3 intervals 1 samples 35,65
        density{
          bozo color_map{[0 rgb .3][.8 rgb 1][1 rgb 1]}
          scale <2.5,1,2.5> turbulence .1
          translate <-.15,.75,.4>*Animation_Time*Clock
        }
      }
    }
  }
  global_lights off
}

I'll explain it: the light-group is there to ensure that only the one single
light-source illuminates the media (hence also the global_lights off at the
end of the light_group). In the Teaser, I fade the light to fade the fog
shots, was much more intuitive to me.

The fog itself is a box filled with scattering media. Note extintion is set
0, so that the fog doesn't swallow light and thus darken objects that are
behind or in it. I animate the density to move the less thick areas around.
Animation_Time actually is the time in seconds, so you might have to adjust
that for your animation.
In order to turn that fog into ground-fog, you'd simply have to add another
density block:

density{planar color_map{[0 rgb 0][1 rgb 1]}

At y=0 the fog will be thick, at y=1 and -1 the fog will be invisible,
everything in between fades from thick to invisible unless you change the
color_map. Anything above and below y=1 and y=-1 isn't fogged as well. Scale
that density statement, and you also scale the height at which the fog
stops.

It's not that complicated once you read about it and start playing with
code. Getting good settings for artifact-free rendering requires a little
patience and you have to accumulate some experience over time, but media is
a beast worth learning. :-)

Regards,
Tim
-- 
aka "Tim Nikias v2.0"
Homepage: <http://www.nolights.de>


Post a reply to this message

From: RusHHouR
Subject: Re: Can fog be animated?
Date: 2 Mar 2006 23:15:00
Message: <web.4407c24479e2c68a47d3ae5e0@news.povray.org>
Superb! Thank you very, very much.
Will try it later! Render_Time sounds like a good thing to use too.
Gotta rush to my truck now though...
Another day another dollar..


Post a reply to this message

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