All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----dnx.util.DNXObject | +----dnx.lr.Node | +----dnx.lr.LeafNode | +----dnx.lr.BindableNode | +----dnx.lr.node.FogNode
Fog { exposedField SFColor color 1 1 1 exposedField SFString fogType "LINEAR" exposedField SFFloat visibilityRange 0 eventIn SFBool set_bind eventOut SFBool isBound }
The Fog node provides a way to simulate atmospheric effects by blending objects with the color specified by the color field based on the objects' distances from the viewer. The distances are calculated in the coordinate space of the Fog node. The visibilityRange specifies the distance (in the Fog node's coordinate space) at which objects are totally obscured by the fog. Objects located visibilityRange meters or more away from the viewer are drawn with a constant color of color. Objects very close to the viewer are blended very little with the fog color. A visibilityRange of 0.0 or less disables the Fog node. Note that visibilityRange is affected by the scaling transformations of the Fog node's parents - translations and rotations have no affect on visibilityRange.
Fog nodes are "Concepts - Bindable Children Nodes" and thus there exists a Fog stack, in which the top-most Fog node on the stack is currently active. To push a Fog node onto the top of the stack, a TRUE value is sent to the set_bind eventIn. Once active, the Fog is then bound to the browsers view. A FALSE value of set_bind, pops the Fog from the stack and unbinds it from the browser viewer. See "Concepts - Bindable Children Nodes" for more details on the the Fog stack.
The fogType field controls how much of the fog color is blended with the object as a function of distance. If fogType is "LINEAR" (the default), then the amount of blending is a linear function of the distance, resulting in a depth cuing effect. If fogType is "EXPONENTIAL" then an exponential increase in blending should be used, resulting in a more natural fog appearance.
For best visual results, the Background node (which is unaffected by the Fog node) should be the same color as the fog node. The Fog node can also be used in conjunction with the visibilityLimit field of NavigationInfo node to provide a smooth fade out of objects as they approach the far clipping plane.
See the section "Concepts - Lighting Model" for details on lighting calculations.
public SFColor color
public SFString fogType
public SFFloat visibilityRange
public SFBool isBound
public FogNode()
protected void createNodeDefinition(NodeDefinition def)
protected void initFields()
public Fog getFog()
protected void handleFieldChange(Field f)
protected void handleEvent(SceneEvent ev)
public void postIsBoundEvent()
public void postIsUnboundEvent()
All Packages Class Hierarchy This Package Previous Next Index