@vis-three/module-light
TypeScript icon, indicating that this package has built-in type declarations

0.7.1 • Public • Published

@vis-three/module-light

最新版本

version

license

NPM

模块信息

module.type

  • : light

module.object

  • : true

module.lifeOrder

  • : SUPPORT_LIFE_CYCLE.THREE - 300

提供配置

灯光-Light

  • 类型Light
  • 配置类型:
export interface LightConifg extends ObjectConfig {
  color: string;
  intensity: number;
}
  • 默认配置:
{
   color: "rgb(255, 255, 255)",
   intensity: 1,
}

:::tip 此配置为内部使用 :::

环境光-AmbientLight

export type AmbientLightConfig = LightConifg;
  • 默认配置:
{
   color: "rgb(255, 255, 255)",
   intensity: 1,
}

点光-PointLight

export interface PointLightConfig extends LightConifg {
  distance: number;
  decay: number;
}
  • 默认配置:
{
   color: "rgb(255, 255, 255)",
   intensity: 1,
}

聚光-SpotLight

export interface SpotLightConfig extends LightConifg {
  distance: number;
  angle: number;
  penumbra: number;
  decay: number;
}
  • 默认配置:
{
   distance: 30,
   angle: (Math.PI / 180) * 45,
   penumbra: 0.01,
   decay: 0.01,
}

平行光-DirectionalLight

export interface DirectionalLightConfig extends LightConifg {
  shadow: {
    mapSize: {
      width: number;
      height: number;
    };
    camera: {
      near: number;
      far: number;
    };
  };
}
  • 默认配置:
{
   shadow: {
      mapSize: {
         width: 512,
         height: 512,
      },
      camera: {
         near: 0.5,
         far: 500,
      },
   },
}

半球光-HemisphereLight

export interface HemisphereLightConfig extends LightConifg {
  groundColor: string;
}
  • 默认配置:
{
   color: "rgb(255, 255, 255)",
   groundColor: "rgb(0, 0, 0)",
}

平面光-RectAreaLight

export interface RectAreaLightConfig extends LightConifg {
  width: number;
  height: number;
}
  • 默认配置:
{
   width: 10,
   height: 10,
}

Readme

Keywords

none

Package Sidebar

Install

npm i @vis-three/module-light

Weekly Downloads

2

Version

0.7.1

License

MPL-2.0

Unpacked Size

61 kB

Total Files

16

Last publish

Collaborators

  • shiotsuki_