A-Frame中文教程

雾(fog)

The fog component obscures entities in fog given distance from the camera. The fog component applies only to the <a-scene>element.

Example

            <a-scene fog="type: linear; color: #AAA"></a-scene>
          

属性

Given the fog distribution type, different properties will apply.

属性 描述 缺省值
type 雾气分布类型:(线性或者指数) linearexponential. linear
color 雾气颜色。例如,如果设置为黑色,则远处的对象将渲染为黑色。 #000

线性雾

线性雾随着距离的增加而线性增加。

属性 描述 缺省值
near 开始应用雾的最小距离。比这更近的物体不会受到雾的影响。 1
far 停止应用雾的最大距离。远于此的对象不会受到雾的影响。 1000

指数雾

指数雾的密度随距离呈指数增长。

属性 描述 缺省值
density 浓雾密度 0.00025

从雾中排除一个材质

若要不对某些实体应用雾,可以禁用某些材质的雾。

<a-entity material="fog: false"></a-entity>