s&
About
The Project
info
About s&box
map
Roadmap
monitoring
Metrics
Engine startup and usage numbers
Updates
newspaper
Latest News
published_with_changes
Changes
Release-by-release changelog
Games
Browse Games
Discover Games
gamejams
Workshop
Playable
sports_esports
Games
Standalone games and gamemodes
Assets
landscape
Maps
view_in_ar
Models
texture
Materials
apparel
Clothing
apps
Everything
Every asset type in one list
Forum
Learn
Documentation
rocket_launch
Getting Started
docs
Documentation
api
API Reference
Resources
school
Tutorials
manage_search
Code Search
Get s&box
Sign in with Steam
Api
Classes
Fog
chevron_left
Classes
class
Fog
Constructors
functions
Fog
Properties
data_object
AttenuationDistance
data_object
Color
data_object
ColorSource
data_object
ComponentVersion
data_object
DistanceEnabled
data_object
DistanceRange
data_object
FalloffExponent
data_object
FogEnabled
data_object
HeightColor
data_object
HeightColorSource
data_object
HeightEnabled
data_object
HeightExponent
data_object
HeightGradientLength
data_object
HeightOffset
data_object
HeightSky
data_object
HeightSkyBlur
data_object
IsCameraEffect
data_object
MaxDistance
data_object
MaximumOpacity
data_object
Mode
data_object
Sky
data_object
SkyAffect
data_object
SkyBlur
data_object
SkyBlurDistanceEnabled
data_object
SkyBlurDistanceRange
data_object
SkyBlurFar
data_object
StartDistance
data_object
SunFadeDistance
data_object
SunIntensity
data_object
SunLightingEnabled
data_object
SunLobeWidth
data_object
SunSaturation
data_object
SunStartDistance
Methods
functions
Render
Fog
Authors a fog layer's distance, height and colour settings, with optional directional colour from a sky material. Settings are resolved separately for each camera so scene sky colours follow that camera's visibility.
class
Sandbox
.
account_tree
extends
BasePostProcess
<
T
>
sealed
Sandbox.Engine
build
Constructors
1
Fog
(
)
data_object
Properties
33
AttenuationDistance
float
Distance removing approximately 63 percent of background light, in engine units.
Color
Color
Fog colour, or tint applied to the sky colour. Alpha does not control opacity.
ColorSource
FogColorSource
Constant colour, or directional colour sampled from a sky material.
ComponentVersion
int
DistanceEnabled
bool
Whether distance fog contributes. Height fog can remain enabled independently.
DistanceRange
Vector2
Start and end distances of the artistic fog ramp, in engine units.
FalloffExponent
float
Exponent of the artistic distance ramp.
FogEnabled
bool
Whether this layer draws fog. False explicitly suppresses fog; disabling the component instead inherits surrounding fog.
HeightColor
Color
Height fog color or sky tint. Alpha sets its maximum opacity independently of distance fog.
HeightColorSource
FogColorSource
Constant color, or directional color sampled from a sky independently of distance fog.
HeightEnabled
bool
Draw a height gradient independently of distance fog.
HeightExponent
float
Curve applied to the height gradient, independently of the distance curve.
HeightGradientLength
float
World distance from full fog to clear. Positive fades upward; negative fades downward. Zero creates a hard boundary at HeightOffset.
HeightOffset
float
Offset above the GameObject's world Z position where height fog reaches full opacity.
HeightSky
Material
Sky material used by height fog's Custom Sky source. Missing textures use the constant color.
HeightSkyBlur
float
Blur applied to the height fog sky source, independently of distance fog.
IsCameraEffect
bool
Fog supplies material settings during camera preparation without drawing a fullscreen pass.
MaxDistance
float
Distance used to evaluate background fog where the sky has no finite surface depth.
MaximumOpacity
float
Upper limit on distance fog opacity, independent of the colour's alpha.
Mode
FogMode
Distance uses an artistic start/end ramp; exponential uses a physically defined attenuation distance.
Sky
Material
Sky material used by Custom Sky. Missing textures fall back to the constant colour.
SkyAffect
float
How strongly fog covers the sky, independently of using sky colours for fog.
SkyBlur
float
Blur applied when sampling sky colours, or the near blur when the distance ramp is enabled.
SkyBlurDistanceEnabled
bool
Vary sky blur with distance instead of using a fixed value.
SkyBlurDistanceRange
Vector2
Distances where sky blur starts and finishes changing, in world units.
SkyBlurFar
float
Sky blur at the end of the ramp. Values below SkyBlur sharpen with distance; values above it blur with distance.
StartDistance
float
Distance from the camera before exponential fog starts, in engine units. Distance is measured in three dimensions.
SunFadeDistance
float
Distance over which sun lighting smoothly fades in. Zero gives a hard start; negative values reverse the fade.
SunIntensity
float
Multiplier for the dominant sun's color. Reduce this when the sky texture already contains a bright sun.
SunLightingEnabled
bool
Add an unshadowed sun-facing glow to distance fog, independently of volumetric lighting.
SunLobeWidth
float
Angle from the sun where the glow reaches half intensity, in degrees. Larger angles give a broader glow.
SunSaturation
float
Sun glow saturation. Zero is greyscale, one preserves the light's color, and higher values strengthen it.
SunStartDistance
float
Distance from the camera where the sun glow starts fading in, in world units.
functions
Methods
1
Render
(
)
Blend each owner's complete settings once, preserving the unresolved legacy fog share.
Inheritance
Component
BasePostProcess
BasePostProcess<T>
Fog
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.