English中文

Fog

将大气与远离相机的几何体混合以获取地平线视图。通过渲染更少的几何图形和分派更少的地形请求,可以进一步提高性能。 Blends the atmosphere to geometry far from the camera for horizon views. Allows for additional performance improvements by rendering less geometry and dispatching less terrain requests.
演示: Demo:

成员 Members

确定雾密度的标量。完全雾中的地形被剔除。当该数字接近 1.0 时,雾的密度增加;当该数字接近 0 时,雾的密度变小。雾越浓,地形被剔除得越彻底。例如,如果相机位于椭球体上方 1000.0m 的高度,则将该值增加到 3.0e-3 将导致靠近观察者的许多图块被剔除。减小该值将使雾远离观察者,但随着渲染更多地形,性能会降低。 A scalar that determines the density of the fog. Terrain that is in full fog are culled. The density of the fog increases as this number approaches 1.0 and becomes less dense as it approaches zero. The more dense the fog is, the more aggressively the terrain is culled. For example, if the camera is a height of 1000.0m above the ellipsoid, increasing the value to 3.0e-3 will cause many tiles close to the viewer be culled. Decreasing the value will push the fog further from the viewer, but decrease performance as more of the terrain is rendered.
默认值: Default Value: 0.0006
示例: Example:
// Double the default fog density
viewer.scene.fog.density = 0.0012;

enabled : boolean

true 如果启用雾, if fog is enabled, false otherwise.
默认值: Default Value: true
示例: Example:
// Disable fog in the scene
viewer.scene.fog.enabled = false;

heightFalloff : number

函数中使用的指数因子,用于根据椭球体上方相机的高度调整密度的变化方式。随着相机高度的增加,较小的值会产生更渐进的过渡。值必须大于 0。 Exponent factor used in the function to adjust how density changes based on the height of the camera above the ellipsoid. Smaller values produce a more gradual transition as camera height increases. Value must be greater than 0.
默认值: Default Value: 0.59

heightScalar : number

函数中使用的标量,用于根据相机在地形上方的高度调整密度。 A scalar used in the function to adjust density based on the height of the camera above the terrain.
默认值: Default Value: 0.001

maxHeight : number

应用最大高度雾。如果相机高于此高度,雾将被禁用。 The maximum height fog is applied. If the camera is above this height fog will be disabled.
默认值: Default Value: 800000.0

minimumBrightness : number

照明产生的雾颜色的最小亮度。值为 0.0 会使雾变成全黑。值为 1.0 根本不会影响亮度。 The minimum brightness of the fog color from lighting. A value of 0.0 can cause the fog to be completely black. A value of 1.0 will not affect the brightness at all.
默认值: Default Value: 0.03

renderable : boolean

true 如果雾可以在着色器中渲染, if fog is renderable in shaders, false 否则。这允许受益于基于雾密度的优化图块加载策略,而无需实际的视觉渲染。 otherwise. This allows to benefits from optimized tile loading strategy based on fog density without the actual visual rendering.
默认值: Default Value: true
示例: Example:
// Use fog culling but don't render it
viewer.scene.fog.enabled = true;
viewer.scene.fog.renderable = false;

screenSpaceErrorFactor : number

当地形图块部分处于雾中时,用于增加地形图块屏幕空间误差的因素。效果是减少渲染请求的地形图块数量。如果设置为零,该功能将被禁用。如果山区的值增加,则需要更少的图块,但地平线附近的地形网格的分辨率可能会明显降低。如果该值在相对平坦的区域增加,那么地平线上几乎不会出现明显的变化。 A factor used to increase the screen space error of terrain tiles when they are partially in fog. The effect is to reduce the number of terrain tiles requested for rendering. If set to zero, the feature will be disabled. If the value is increased for mountainous regions, less tiles will need to be requested, but the terrain meshes near the horizon may be a noticeably lower resolution. If the value is increased in a relatively flat area, there will be little noticeable change on the horizon.
默认值: Default Value: 2.0

visualDensityScalar : number

影响雾的视觉密度的标量。该值不会影响地形的剔除。与 A scalar that impacts the visual density of fog. This value does not impact the culling of terrain. Use in combination with the Fog.density 使雾看起来更浓或更淡。 to make fog appear more or less dense.
默认值: Default Value: 0.15
示例: Example:
// Increase fog appearance effect
viewer.scene.fog.visualDensityScalar = 0.6;
实验性 Experimental

该标量的值可能不是最终的,并且可能会发生变化。 The value of this scalar may not be final and is subject to change.

需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.