Enfusion Script API
|
Public Member Functions | |
proto external int | SetFlags (LightFlags flags) |
set light flags | |
proto external int | ClearFlags (LightFlags flags) |
clear light flags | |
proto external void | RemoveLight (notnull BaseWorld world) |
removes light | |
proto external void | Set (notnull BaseWorld world, float radius, notnull Color color, float LV) |
set light's new parameters | |
proto external void | SetIntensityEVClip (notnull BaseWorld world, float clipEV) |
Sets light intensity clip in EV. | |
proto external void | SetCone (notnull BaseWorld world, float cone) |
Sets light cone in degrees (useful for LightType.SPOT only) | |
proto external void | SetLightDistanceAtt (notnull BaseWorld world, float cone) |
Set light distance attenuation -> power function, default is 2 corresponding to light without any other internal reflector. | |
proto external void | SetTexture (notnull BaseWorld world, ResourceName textureName) |
Sets color-lookup texture, light color with LV is multiplied by the texture point lights -> texture must be cube map spot lights, 2D texture -> the texture serves as projector texture spot light, 1D texture of <someWidth, 1> size -> texture serves is angle lookup texture (parametrized by cos^2 angle from spot direction and pixel world pos, IES profile, but not supported fully now as we don't have IES converter) | |
proto external void | SetNearPlane (notnull BaseWorld world, float nearPlane) |
Sets near plane of a light. | |
proto external void | SetVolumeEffect (notnull BaseWorld world, float intensity, float offset, float scale) |
Sets light volumetric effect. | |
proto external void | SetLensFlareType (notnull BaseWorld world, LightLensFlareType type) |
Sets lens flare type of a light. | |
proto external void | SetLensFlareIndex (notnull BaseWorld world, int index) |
Sets lens flare index of a light. | |
proto external void | SetLensFlareScale (notnull BaseWorld world, float scale) |
Sets lens flare scale for a light. | |
proto external void | SetLensFlareOffset (notnull BaseWorld world, vector offset) |
Sets lens flare offset for a light. | |
proto external void | SetPosition (notnull BaseWorld world, vector position) |
Sets position of light. | |
proto external void | SetDirection (notnull BaseWorld world, vector direction) |
Sets direction of light. | |
proto external void | SetTransform (notnull BaseWorld world, vector[] transform) |
Sets transform of light. | |
Public Member Functions inherited from pointer | |
proto string | ToString () |
Static Public Member Functions | |
static proto LightHandle | AddStaticLight (notnull BaseWorld world, LightType type, LightFlags flags, float radius, notnull Color color, float LV, vector origin, vector direction=vector.Zero) |
Create new static light by type. | |
static proto LightHandle | AddDynamicLight (notnull IEntity owner, LightType type, LightFlags flags, float radius, notnull Color color, float LV) |
Create new dynamic light. | |
|
static |
Create new dynamic light.
owner | Owner entity |
type | Type of light |
flags | Creation flags. See enf::LightFlags |
radius | Radius |
color | Color in RGB form |
LV | LV value of a light, final light color is combined from color and LV properties (color * LV^2) |
|
static |
Create new static light by type.
type | Type of light |
flags | Creation flags. |
radius | Radius |
color | Color in RGB form |
LV | LV value of a light, final light color is combined from color and LV properties (color * LV^2) |
origin | Origin coordinates |
direction | Direction of spot-vector (used for spotlights) |
proto external int LightHandle.ClearFlags | ( | LightFlags | flags | ) |
clear light flags
flags | flags to be cleared |
proto external void LightHandle.RemoveLight | ( | notnull BaseWorld | world | ) |
removes light
proto external void LightHandle.Set | ( | notnull BaseWorld | world, |
float | radius, | ||
notnull Color | color, | ||
float | LV | ||
) |
set light's new parameters
radius | light radius |
color | color of a light |
LV | LV value of a light, final light color is combined from color and LV properties (color * LV^2) |
Sets light cone in degrees (useful for LightType.SPOT only)
Sets direction of light.
It's meaningful for LT_SPOT/LT_DIRECTIONAL only!
direction | Direction of light |
proto external int LightHandle.SetFlags | ( | LightFlags | flags | ) |
set light flags
flags | new flags combined internally with older flags |
Sets light intensity clip in EV.
Lights is clipped when its intensity is low but this could be too early for some lights. This value is bias to move the intensity clip test. The value is in EV thus 1 unit means double of light
clipEV | Negative values make the test less strict, useful e.g. for lights with low intensities lying near geometry |
Sets lens flare index of a light.
Use value < 0 to disable lens flare
index | Index of the lens flare in the world lens flare config |
Sets lens flare offset for a light.
offset | Offset from the light original position: vector(offset, offsetUp, offsetSide) |
Sets lens flare scale for a light.
scale | Scale of the lens flare |
proto external void LightHandle.SetLensFlareType | ( | notnull BaseWorld | world, |
LightLensFlareType | type | ||
) |
Sets lens flare type of a light.
type | Lens flare type (Automatic = lens flare is determined by light type, Manual = use index, Disabled = lens flare disabled) |
Set light distance attenuation -> power function, default is 2 corresponding to light without any other internal reflector.
att | attenuation |
Sets near plane of a light.
It's meaningful for shadow casting LT_SPOT/LT_POINT lights only!
nearPlane | near plane when casting shadows |
Sets position of light.
It's meaningful for LT_SPOT/LT_DIRECTIONAL only!
position | Position of light |
proto external void LightHandle.SetTexture | ( | notnull BaseWorld | world, |
ResourceName | textureName | ||
) |
Sets color-lookup texture, light color with LV is multiplied by the texture point lights -> texture must be cube map spot lights, 2D texture -> the texture serves as projector texture spot light, 1D texture of <someWidth, 1> size -> texture serves is angle lookup texture (parametrized by cos^2 angle from spot direction and pixel world pos, IES profile, but not supported fully now as we don't have IES converter)
Sets transform of light.
It's meaningful for static LT_SPOT/LT_DIRECTIONAL only!
transform | Transform matrix of light |
proto external void LightHandle.SetVolumeEffect | ( | notnull BaseWorld | world, |
float | intensity, | ||
float | offset, | ||
float | scale | ||
) |
Sets light volumetric effect.
intensity | vol light intensity |
offset | signed offset of light volume effect according base light |
scale | scale of light (mainly for optimization) |