[x3d-public] Fog and Background

Andreas Plesch andreasplesch at gmail.com
Thu Sep 28 08:26:34 PDT 2023


The question came up if global Fog should affect the background sky
and ground, in addition to scene  objects/shapes.

The spec. talks about Fog only in relation to objects with a defined
distance to the avatar:

https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-IS.proof/Part01/components/environmentalEffects.html

So I think most browsers ignore global Fog for rendering Background.

Of course, in reality fog would exist in any direction, not just in
front of scene objects.

So global Fog, in principle, should apply in any look direction even
if there are no Shapes, it appears.

One problem is that background would need to be considered to be
placed at a very large distance with the effect that blending in the
Fog color means effectively replacing all of the Background with the
Fog color. For real, dense fog this is probably the desired effect but
for light fog, one still would likely want to see through the fog even
at large distances.

Would it make sense to introduce a maximum fog intensity/opacity at
the range field distance ?

But given that perhaps the main purpose of fog is to hide distant
objects so that they do not need to be rendered, perhaps just
accepting that the fog color becomes the background color in scenes
with Fog is acceptable as well. This seems currently to be not
inconsistent with spec. as well but it is not how most browsers apply
Fog.

In any case, a clarifying sentence in the spec. on how Fog should
affect Background seems to be needed:

Options:

A) "Fog only affects rendering of Shapes." May boil down "only" in the
appropriate place.
B) "A Background node is considered to be at a distance larger than range."
C) "Fog color replaces any Background for background rendering."
D) "The intensity field can be used to limit the maximum fog
intensity." and updates to the fog equations (replace 1.0 with
intensity).

Any thoughts or ideas on how to address Fog and Background interaction
very welcome. Since these nodes exist for a very long time, there
probably was an earlier discussion also.

Thanks, Andreas

-- 
Andreas Plesch
Waltham, MA 02453



More information about the x3d-public mailing list