ShaderLab syntax: Fog
Fog parameters are controlled with Fog command.
Fog 命令控制霧化參數
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.
霧化混合產生像素的顏色是依據於常量顏色(這個常量顏色是基於網路攝影機的距離的)。霧化不會改變像素的alpha值,僅僅是改變它的rgb分量。
指導:霧化是一種類比自然界中霧氣對情境物體視覺效果產生影響的圖形繪製技術。此技術從視點到物體逐漸將物體的繪製顏色淡化,直至背景色。通過霧化處理可較好的表現出物體到視點的距離感。(根據物體距離視點的遠近對其進行恰當的模糊處理)
Syntax
-
Fog {
Fog Commands
}
-
Specify fog commands inside curly braces.
在大括弧內指定fog命令
Mode Off | 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.
定義個fog模式,預設的是全域,它轉換為關閉或EXP2取決於是否開啟渲染設定中的霧。
指導:Linear | Exp | Exp2 對應OpenGL中的GL_LINEAR(線性)、GL_EXP(指數)和GL_EXP2(指數平方)
-
-
Color
ColorValue
-
Sets fog color.
-
設定霧的顏色
-
-
Density
FloatValue
-
Sets density for exponential fog.
設定霧的強度
-
-
Range
FloatValue
,
FloatValue
-
Sets near & far range for linear fog.
設定線性霧的最近和最遠值
Details詳情
Default fog settings are based on Render
Settings: fog mode is either Exp2 or Off; density & color taken from settings as well.
預設的霧的設定時基於渲染設定:霧的模式是Exp2或者off;強度和顏色也是從設定中擷取
Note that if you use fragment 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.
請注意,如果您使用片斷編程,著色器的霧設定將仍然適用。Unity3d的平台上,那裡是沒有固定功能霧的功能,Unity3d將在運行時修補著色器請求支援的霧模式。
由www.J2meGame.com原創,轉載請說明。