Well, after a bit of experimentation, I'd say this is probably not going to
work. POV-Ray assumes that you are IN the fog yourself, looking around. So
everything in a scene is foggy. There is no way around that. Certainly
fog_type=2 (ground fog) is not a solution.

Jmol uses a very different idea -- you are looking at the model, and it is
partially obscurred by fog. This is much more dramatic, and much more
useful. The key setting is zSlab, which is assumed to be about 300 in
POV-Ray but is critically important to be around 50 for Jmol. (I just
checked in a bug fix that was setting zSlab to 0 by default in Jmol.)

If you want something that is about the same in both, try this:

in Jmol:

background white
set zSlab 300
set zDepth -1000
set zShadePower 3
set zShade

Then in POV-Ray use:

fog {
  distance 1500
  color rgb <1,1,1>
  fog_type 1
}



Bob


ps. For the record....

The algorithm for fog in Jmol is this, applied to each pixel:

    f = (zDepth - z) / (zDepth - zSlab)  // fraction of depth, from zDepth
(0) to  zSlab(1)

    p = f^zShadePower   // default:  f^3

    pixel_color = background_color + p * (object_color - background_color)

                        = p * object_color + (1 - p) * background_color

Comparing that to POV-Ray:

*    PIXEL_COLOR = exp(-d/D) * OBJECT_COLOR + (1-exp(-d/D)) * FOG_COLOR*

 where d is the pixel depth from the camera and D is the "fog distance
parameter"

Note that these would be identical if

  FOG_COLOR = background_color
  p = exp(-d/D)

Of course, that's not what p is. The main difference here is that it is
quite possible in Jmol to have an object disappear. That is intentional. In
Jmol, we absolutely allow that, for good reason -- for good effect.
zShadePower was developed for the infinite crystal view in the Epcot
Touch-A-Molecule display. We need that, because we only have a certain
number of unit cells in actuality, and it is very effective. In contrast,
it's not possible in POV-Ray to get full merging with background color,
probably because that is more realistic, and the POV-Ray formula results in
the color being 1/e of pixel_color "at depth" (0.368) instead of 0 *
pixel_color, as in Jmol.

Both of these algorithms result in a fog that gets stronger further from
you, allowing objects closer to the viewer to be less affected than distant
objects. The power of that effect is more adjustable in Jmol than in
POV-Ray, and the formula is different, because I needed full disappearance
within a finite distance, which I suppose is not realistic so is not
modeled by POV-Ray, and I needed to have the observer and possibly part of
the model outside of the fog.




-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to