[x3d-public] X3D Working Group meeting minutes, 27 July 2018: ISO, SIGGRAPH, Python, LocalFog, regexes

Michalis Kamburelis michalis.kambi at gmail.com
Fri Jul 27 17:28:58 PDT 2018

2018-07-27 18:49 GMT+02:00 Don Brutzman <brutzman at nps.edu>:
> 4. LocalFog work.  Sungmin Kwon and I have been considering how to use
> LocalFog for
> 24.4.4 LocalFog
> http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/enveffects.html#LocalFog
> states:
> "The LocalFog node provides a way to simulate atmospheric effects by
> blending objects with the colour specified by the color field based on the
> distances of the various objects from the viewer."
> This is incorrect.  LocalFog intensity doesn't consider the viewer distance.
> Rather the next sentence pertains:
> "The distances are calculated in the coordinate space of the LocalFog node."
> Recommended correction: change "from the viewer" to something like "from the
> local center of the LocalFog node's transformation heirarchy".

The change of LocalFog prose, as you propose, would break the way it
is implemented in view3dscene / Castle Game Engine. It would also
break my understanding, and use-cases, of the LocalFog node.

I see in http://www.web3d.org/x3d/content/examples/ConformanceNist/Miscellaneous/LocalFog/LocalFogEffectsPresentation.pdf
that you  made tests (with 2 browsers that support LocalFog). But I
tested X_ITE at
now, and I don't see your conclusions. In X_ITE, the visible intensity
of fog produced by "LocalFog" depends on the distance from the viewer.
X_ITE (at least on my browser, Firefox 60.0.1) behaves exactly like
X3D specification currently says, and exactly like view3dscene/CGE
already do. The fog amount depends on the distance from the viewer,
i.e. moving the camera makes the fog appear at objects closer to you.

For me (and for my implementation of view3dscene / Castle Game
Engine), LocalFog means that the fog is applied based on the distance
*from the viewer*, not from the "local center of the LocalFog node's
transformation hierarchy" as you propose to change. Various prose in the
specification makes it clear IMHO that it's the distance from the

- "...based on the distances of the various objects from the viewer"

- "Objects located outside the visibilityRange from the viewer are
drawn with a constant colour..."

>From http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/enveffects.html#LocalFog

The LocalFog calculation is much like global Fog calculation in this regard.

The only difference (and the reason for "Local" prefix) betwen
LocalFog and Fog is that LocalFog only affects a subset of the scene
(following " Local fog semantics",
). Only the things within the same parent as LocalFog are affected. In
contrast, global Fog affects everything, and is a "bindable" node.

While the X3D spec talks about the "local coordinate system" of
LocalFog, I always understood it to mean that one should apply the
scaling (from LocalFog parent transformations) to visibilityRange.
Nothing more. Exactly the same as the global Fog node is also in
"local coordinate system" (

My use-case for LocalFog is when you want to cover only specific nodes
with fog, while leaving the rest of the world un-fogged (or with
different fog settings). Like this (in classic encoding):

  Group { ... stuff that is unaffected by red fog ... }
  Group {
    children [
      LocalFog { color 1 0 0 }
      Group { ... stuff that is affected by red fog ... }

That being said, I support the idea of testing this on various X3D
browsers. If all the other X3D browsers interpret LocalFog as you
describe (calculating distance from local center, not viewer), then of
course we should adjust the specification, and I will adjust my

Maybe I misinterpret something in your mail and PDF, since your own
test (on X_ITE) contradicts your conclusions, as far as I can see.
X_ITE seems to measure the distance from the viewer, just like X3D
spec already says, and as view3dscene/CGE do.

Apologies in advance if this is just a big misunderstanding on my part:)

Best regards,

More information about the x3d-public mailing list