HemisphereLight
小于 1 分钟组件文档组件HemisphereLight
HemisphereLight——半球光组件,直接放置在场景之上,光照颜色从天空光线颜色渐变到地面光线颜色。
注意
半球光不能投射阴影。
创建
import { HemisphereLight } from '@fantasy3d/core';
const { rootEntity } = scene;
// 在场景根实体上添加半球光组件
rootEntity.addComponent( HemisphereLight, {
skyColor: '#ffffbb', // 天空颜色
groundColor: '#080820', // 地面颜色
intensity: 0.25 * Math.PI // 强度
} );
提示
HemisphereLight 组件初始化参数,详见 HemisphereLightOptions。
属性
light - 获取 three.js 原生半球光对象(HemisphereLight),只读属性。
skyColor - 设置半球光天空部分颜色,只写属性。
groundColor - 设置半球光地面部分颜色,只写属性。
intensity - 设置半球光强度,只写属性。