Enfusion Script API
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
LightHandle Interface Reference
Inheritance diagram for LightHandle:
[legend]

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.
 

Member Function Documentation

◆ AddDynamicLight()

static proto LightHandle LightHandle.AddDynamicLight ( notnull IEntity  owner,
LightType  type,
LightFlags  flags,
float  radius,
notnull Color  color,
float  LV 
)
static

Create new dynamic light.

Parameters
ownerOwner entity
typeType of light
flagsCreation flags. See enf::LightFlags
radiusRadius
colorColor in RGB form
LVLV value of a light, final light color is combined from color and LV properties (color * LV^2)
Returns
LightHandle

◆ AddStaticLight()

static proto LightHandle LightHandle.AddStaticLight ( notnull BaseWorld  world,
LightType  type,
LightFlags  flags,
float  radius,
notnull Color  color,
float  LV,
vector  origin,
vector  direction = vector.Zero 
)
static

Create new static light by type.

Parameters
typeType of light
flagsCreation flags.
radiusRadius
colorColor in RGB form
LVLV value of a light, final light color is combined from color and LV properties (color * LV^2)
originOrigin coordinates
directionDirection of spot-vector (used for spotlights)
Returns
LightHandle

◆ ClearFlags()

proto external int LightHandle.ClearFlags ( LightFlags  flags)

clear light flags

Parameters
flagsflags to be cleared
Returns
currently set flags

◆ RemoveLight()

proto external void LightHandle.RemoveLight ( notnull BaseWorld  world)

removes light

◆ Set()

proto external void LightHandle.Set ( notnull BaseWorld  world,
float  radius,
notnull Color  color,
float  LV 
)

set light's new parameters

Parameters
radiuslight radius
colorcolor of a light
LVLV value of a light, final light color is combined from color and LV properties (color * LV^2)

◆ SetCone()

proto external void LightHandle.SetCone ( notnull BaseWorld  world,
float  cone 
)

Sets light cone in degrees (useful for LightType.SPOT only)

◆ SetDirection()

proto external void LightHandle.SetDirection ( notnull BaseWorld  world,
vector  direction 
)

Sets direction of light.

It's meaningful for LT_SPOT/LT_DIRECTIONAL only!

Parameters
directionDirection of light

◆ SetFlags()

proto external int LightHandle.SetFlags ( LightFlags  flags)

set light flags

Parameters
flagsnew flags combined internally with older flags
Returns
currently set flags

◆ SetIntensityEVClip()

proto external void LightHandle.SetIntensityEVClip ( notnull BaseWorld  world,
float  clipEV 
)

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

Parameters
clipEVNegative values make the test less strict, useful e.g. for lights with low intensities lying near geometry

◆ SetLensFlareIndex()

proto external void LightHandle.SetLensFlareIndex ( notnull BaseWorld  world,
int  index 
)

Sets lens flare index of a light.

Use value < 0 to disable lens flare

Parameters
indexIndex of the lens flare in the world lens flare config

◆ SetLensFlareOffset()

proto external void LightHandle.SetLensFlareOffset ( notnull BaseWorld  world,
vector  offset 
)

Sets lens flare offset for a light.

Parameters
offsetOffset from the light original position: vector(offset, offsetUp, offsetSide)

◆ SetLensFlareScale()

proto external void LightHandle.SetLensFlareScale ( notnull BaseWorld  world,
float  scale 
)

Sets lens flare scale for a light.

Parameters
scaleScale of the lens flare

◆ SetLensFlareType()

proto external void LightHandle.SetLensFlareType ( notnull BaseWorld  world,
LightLensFlareType  type 
)

Sets lens flare type of a light.

Parameters
typeLens flare type (Automatic = lens flare is determined by light type, Manual = use index, Disabled = lens flare disabled)

◆ SetLightDistanceAtt()

proto external void LightHandle.SetLightDistanceAtt ( notnull BaseWorld  world,
float  cone 
)

Set light distance attenuation -> power function, default is 2 corresponding to light without any other internal reflector.

Parameters
attattenuation

◆ SetNearPlane()

proto external void LightHandle.SetNearPlane ( notnull BaseWorld  world,
float  nearPlane 
)

Sets near plane of a light.

It's meaningful for shadow casting LT_SPOT/LT_POINT lights only!

Parameters
nearPlanenear plane when casting shadows

◆ SetPosition()

proto external void LightHandle.SetPosition ( notnull BaseWorld  world,
vector  position 
)

Sets position of light.

It's meaningful for LT_SPOT/LT_DIRECTIONAL only!

Parameters
positionPosition of light

◆ SetTexture()

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)

◆ SetTransform()

proto external void LightHandle.SetTransform ( notnull BaseWorld  world,
vector[]  transform 
)

Sets transform of light.

It's meaningful for static LT_SPOT/LT_DIRECTIONAL only!

Parameters
transformTransform matrix of light

◆ SetVolumeEffect()

proto external void LightHandle.SetVolumeEffect ( notnull BaseWorld  world,
float  intensity,
float  offset,
float  scale 
)

Sets light volumetric effect.

Parameters
intensityvol light intensity
offsetsigned offset of light volume effect according base light
scalescale of light (mainly for optimization)

The documentation for this interface was generated from the following file: