Shaderlab Syntax: fog
Fog parameters are controlled with fog command.
Fog command to control atomization Parameters
Fogging blends the color of the generated pixels down towards a constant color based on distance from camera. fogging does not modify a blended pixel's Alpha value, only its RGB components.
The color of pixels produced by atomization mixing is based on constant colors (this constant color is based on the camera distance ). Atomization does not change the Alpha value of a pixel, but only changes its RGB component.
Tutorial: atomization is a graphic rendering technology that simulates the effects of fog in the natural world on the visual effects of scene objects. This technology gradually fades the color of the object from the viewpoint to the background color. Through atomization, it can better show the distance from the object to the viewpoint. (Perform fuzzy processing based on the distance from the object to the viewpoint)
Syntax
-
Fog {
Fog commands
}
-
Specify fog commands inside curly braces.
Specify the fog command in braces
ModeOff | global | linear | exp | exp2
Defines fog mode. Default is global, which translates to off or exp2 depending whether fog is turned on in render settings.
Defines a fog mode. The default mode is global. converting it to off or exp2 depends on whether the fog in the rendering settings is enabled.
Tutorial: Linear | exp | exp2 corresponds to gl_linear (linear), gl_exp (exponential), and gl_exp2 (exponential square) in OpenGL)
-
-
Color
Colorvalue
-
Sets fog color.
-
Set the fog color
-
-
Density
Floatvalue
-
Sets density for exponential fog.
Set the fog intensity
-
-
Range
Floatvalue
,
Floatvalue
-
Sets near & far range for linear fog.
Set the nearest and farthest values of linear fog
Details details
Default fog settings are based onRender
Settings: Fog mode is either exp2 or off; density & Color taken from settings as well.
The default fog setting is based on the rendering settings: The Fog mode is exp2 or off, and the intensity and color are also obtained from the settings.
Note that if you useFragment programs,
Fog settings of the shader will still be applied. on platforms where there is no fixed function fog functionality, unity will patch shaders at runtime to support the requested fog mode.
Note that if you use fragment programming, the shadow settings will still apply. On the unity3d platform, there is no fixed function fog function, and unity3d will fix the fog Mode Supported by the shader request at runtime.
Original at www.j2megame.com. For more information, see.