メインコンテンツまでスキップ

<pc-light>

The <pc-light> tag is used to define a light component.

注記

Attributes

属性 (Attribute)説明
colorThe color of the light. Can be a space-separated list of R, G, B values, a hex color code, or a named color. If not specified, 1 1 1 is used.
cast-shadowsValueless attribute. If present, the light casts shadows.
inner-cone-angleThe angle of the light's inner cone. If not specified, 40 is used.
intensityThe intensity of the light. If not specified, 1 is used.
normal-offset-biasThe bias of the light's normal offset. If not specified, 0.05 is used.
outer-cone-angleThe angle of the light's outer cone. If not specified, 45 is used.
rangeThe range of the light. If not specified, 10 is used.
shadow-biasThe bias of the light's shadows. If not specified, 0.2 is used.
shadow-distanceThe distance at which the light's shadows are no longer rendered. If not specified, 16 is used.
shadow-resolutionThe resolution of the light's shadow map. If not specified, 1024 is used.
shadow-typeThe type of shadow map. Can be pcf1-16f, pcf1-32f, pcf3-16f, pcf3-32f, pcf5-16f, pcf5-32f, vsm-16f, vsm-32f or pcss-32f. If not specified, pcf3-32f is used.
typeThe type of light. Can be directional, point or omni. If not specified, directional is used.
vsm-biasThe bias used for VSM shadows. If not specified, 0.01 is used.

<pc-entity>
<pc-light type="directional" intensity="10" color="red" cast-shadows></pc-light>
</pc-entity>

JavaScript Interface

You can programmatically create and manipulate <pc-light> elements using the LightComponentElement API.