# Atmospheric Attenuation

Also referred to as fog or depth cueing, “atmospheric attenuation” causes the scene to be rendered such that objects appear to fade into the distance (into the fog). It is implemented via a linear interpolation model. In the linear model, the color at each vertex of a primitive is dependent on it’s position relative to two reference planes perpendicular to the viewing axis. Given hither and yon plane values, the color is calculated as:

    atmospheric attenuation = (z - yon) / (hither - yon)

    final color = atmospheric attenuation * input color + (1 - atmospheric attenuation) * background color

It is enabled by calling:

    HC_Set_Rendering_Options("atmospheric attenuation [= (hither = x.x, yon = x.x)]");

In general, the hither and yon planes should reflect the extent of the objects in camera space (see `Compute_Coordinates` and `Compute_Circumsphere` for conversions to this coordinate system). (HOOPS/3dGS does not currently provide user control of hither and yon planes for use by the z-buffer.)

A bridge on the left and atmospheric attenuation applied to the bridge image on the right to give a foggy effect.

The sample program depthcue.c shows how to use atmospheric attenuation.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Visualize 3DF in your own language, or choose a sample question below to start a conversation:

What is HOOPS Visualize 3DF?
What are the latest release notes for HOOPS Visualize 3DF?
How do I start evaluating HOOPS Visualize 3DF?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...