当前位置: 首页 > 文档资料 > A-Frame 中文文档 >

雾(fog)

优质
小牛编辑
119浏览
2023-12-01

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>