POV-Ray : Newsgroups : povray.binaries.animations : FOG with turbulence-- animation tests : FOG with turbulence-- animation tests Server Time
24 Apr 2024 19:52:57 EDT (-0400)
  FOG with turbulence-- animation tests  
From: Kenneth
Date: 8 Dec 2017 03:10:04
Message: <web.5a2a481bdc12900789df8d30@news.povray.org>
(Rendered in v3.7.1 beta 9, but I assume that v3.7.0 would be identical.)

This is a follow-up to the post, "problem with turbulence in fog"  at

http://news.povray.org/povray.general/thread/%3Cweb.5a2502e480800e7e89df8d30%40news.povray.org%3E/

I decided to test POV-Ray's current 'fog' code, with some animation
experiments-- various changes to the fog parameters, to see what's going on when
using its 'turbulence' feature and what limitations it has.  This multi-part
animation uses the 'mist.pov' demo file, which is itself just a static scene,
set up with ground fog. I would suggest rendering that scene first, simply to
see what it looks like.

IMO, the fog/turbulence parameters in that file are not what they should be--
perhaps due to some underlying 'fog' or 'turbulence' code-changes over the
years(?) after the mist file was written. This also applies to the other demo
scenes: foglayr.pov, foglyr2.pov, etc.

The main result from all this is that turbulence doesn't show the same effects
in FOG as it does in pigments, media, etc., although its default values appear
to be the same.

From what I can tell, fog/turbulence appears to be a kind of sophisticated
'camera-projection effect', onto object SURFACES-- not actual volumetric fog,
even though it looks very similar to media. This pseudo-3D effect depends on
where the camera is positioned relative to the 'static' fog and scene objects,
and if the camera is inside the fog or outside it. However, turbulence behavior
is strangely affected by the geometry of the objects; the animation examples
show the rather odd behavior of the fog 'conforming' to the particular geometry
its projected onto. (That's my theory from visual results, anyway.) On
reasonably flat surfaces facing the camera, it looks fine; otherwise, not so
fine. This seems to be a subtle flaw.

Fog/turbulence was apparently never designed with animation in mind, as there is
no way to translate it (other than changing the 'sky' vector.) Any movement of
the fog in these animated examples is due to its other parameters-- which are
limited and hard to control.

For most of the examples (except Part 1), I made the following changes to the
mist file, to get a  clearer visual result as the fog parameters change. The
scene itself will look quite strange, though:
* no lights
* all pigments are pure black
* finish {ambient 0 emission 0 diffuse 0}
* no normal or reflection for the 'floor' object
* lots of vertical cylinders randomly placed, to see how their appearance is
affected by any 'volumetric' fog effects

THE VIDEO:
PART 1:
This is a decent example of what the fog parameters *should* be in the normal
scene, to actually see the effect of turbulence. (A moving camera definitely
helps! )  I used...

fog{
    color Gray70
    fog_type 2
    fog_alt 0.1
    fog_offset 1.4
    distance 9.5
    turbulence 1.9
    turb_depth 0.9 // this parameter is missing from the mist file, and is
// an important one
   omega 0.4
   lambda 2.0
   octaves 6
   }

Two other minor changes to the file, only for visual clarity:
* no 'reflection' in the 'floor' object
* sky_sphere { pigment {color .1*MidnightBlue}} // to darken the sky

The only odd thing about this animation result is that some of the turbulent
'volumes' of fog (those that seemingly appear 'above' my particular fog_alt +
fog_offset level) disappear as the camera passes that level-- in fact, above
that demarcation line shows no turbulence effect at all, when the camera is also
above it. My own expectation has always been that this shouldn't be the case,
that the 'upper surface' of the fog should also show some turbulence. Fog isn't
MEDIA of course (AFAIU), but the effect looks odd nevertheless. Perhaps it's a
direct result of the 'projection' idea in some way: When the camera is above the
fog level, any turbulence effect 'outside' the fog disappears.

PART 2:
This uses the fog parameters *as they are* in the mist file, with only a
changing turbulence value.  Result: There is *almost* no visual difference that
I can see-- which is apparently not what the mist scene (or the documentation)
would suggest when using turbulence.

PART 3:
This is also a good example of fog parameters, again with only a changing
turbulence value. It does show 'volumetric' changes to the fog-- some areas
thick, some areas thin. What's odd is that the turbulence  effect is being
SCALED, and MOVED toward some central point. (I *think* that point is the
scene's origin, <0,0,0>. )  So this is not really a good way to animate the
movement of the fog, as there's no control over it. The squashed/stretched
shapes of the 'bright splotches' on objects are another example of the (flawed?)
'projection' idea. They also look overly-bright, given that the objects are all
black... but that's a minor quibble.

PART 4:
Only the TURB_DEPTH changes. This parameter appears to 'thin out' the fog-- that
is, it causes the many isolated 'high-fog' volumes to shrink and become more
defined (resulting in more clear space between those volumes.) But that behavior
seems to differ (?) somewhat from the docs' description of turb_depth: "...the
fog turbulence may be scaled along the direction of the viewing ray using the
turb_depth amount". IMO, 'scaling' should mean a *size* increase/decrease of the
overall effect and the many turbulent 'volumes' -- unless the scaling refers to
the observed effect. The docs aren't clear about this.

PART 5:
This has TWO changing parameters: fog_offset and turbulence.  Also, the
fog_offset and fog_alt values are kind of 'reversed' here, to get a sharp fog
cutoff at a certain height. From what I see, this also causes all the fog to
have the SAME density, with no fade-out in the +y direction. (An alternate test
with an orthographic camera seems to confirm this.) That's a nice discovery--
but the equation in the docs for determining density changes is only for heights
*above* fog_offset-- which is not the case here-- so I'm not sure about it.
BTW, the initial black cutoff in this example is naturally due to the absence of
lights and bright pigments in the scene-- and to the fact that the camera is
positioned higher than the fog. There's no fog above that height to brighten
things up, until fog_offset 'cimbs' to the mid-point of the camera view; then
the fog 'envelopes' the camera.  But the 'white splotches' on the background
object (the bridge) look incorrect again; they are not only following the bridge
contours, but the top of the fog layer doesn't reach anywhere near that height.
There *is* intervening fog between camera and object at that point in the
animation, so *something* should appear there, I admit; but those splotchy
shapes look wrong.


Post a reply to this message


Attachments:
Download 'mist_experiments.mp4.mpg' (3884 KB)

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