Class Light

Definition

Namespace:
Tizen.NUI.Scene3D
Assembly:
Tizen.NUI.Scene3D.dll

This class is to define 3D Light source. Currently this Light class supports Directional Light that lights every position from the same direction. (e.g, Sun light) If a Light object is added on SceneView, the 3D objects in the SceneView are shined the Light. NUI Scene3D limits the maximum enabled light count per each SceneView. Currently the maximum number is set to 5, and it can be retrieved by using MaximumActivatedLightCount. If more than 5 enabled Light objects are added on SceneView, SceneView turns on only 5 lights in the order the lights were added. This Light can be added to SceneView directly but also it can be added on other View. When a parent actor is added to a SceneView, its Light behaves in the SceneView the same as if it were added directly to the SceneView.

C#
Copy
public class Light : View, IDynamicResourceHandler, IElement, INameScope, IElementController, System.IDisposable, IResourcesProvider
Inheritance
Implements
Remarks

Light inherits View, so Light color and direction can be controlled by setting View's Color and Orientation Property. LookAt(Vector3, Vector3, Vector3, Vector3) method can be used to set light direction easily.

Examples
Copy
SceneView sceneView = new SceneView(); Light light = new Light(); light.Color = Color.Brown; light.LookAt(new Vector3(1.0f, 1.0f, 1.0f)); sceneView.Add(light);

Constructors

View Source

Light()

Create an initialized Light.

Declaration
C#
Copy
public Light()
View Source

Light(Light)

Copy constructor.

Declaration
C#
Copy
public Light(Light light)
Parameters
Type Name Description
Light light

Source object to copy.

Properties

View Source

IsLightEnabled

The Light is turned on when the Light object is added on SceneView and enabled. And checks whether this light is enabled or not.

Declaration
C#
Copy
public bool IsLightEnabled { get; set; }
Property Value
Type Description
Boolean
Remarks

SceneView can turn on only up to maximum enabled light count that can be retrieved by GetMaximumEnabledLightCount().

View Source

IsShadowEnabled

Make the light enable shadow for this light or not. NUI.Scene3D generates shadow by using shadow map. For the Directional Light, the shadow map is created to cover view frustum of current selected camera. This means that if the distance between the near and far planes is too large, the shadow map has to cover an unnecessarily large area. This results in lower shadow quality.

Declaration
C#
Copy
public bool IsShadowEnabled { get; set; }
Property Value
Type Description
Boolean
Remarks

This light should be already turned on in the SceneView. (When true) If there is previous light already enabled shadow in the SceneView, this function call is ignored. (When false, and this light is currently used for shader) If there are other lights those are turned on and shadow enabled, one of the light will be used for shadow automatically.

View Source

IsShadowSoftFilteringEnabled

Make the shadow edge soften or not. Basically the shadow is hard shadow that has sharp edge. This method enables soft filtering to make the sharp edge to smoothing.

Declaration
C#
Copy
public bool IsShadowSoftFilteringEnabled { get; set; }
Property Value
Type Description
Boolean
Remarks

This soft filtering requires expensive computation power.

View Source

MaximumActivatedLightCount

Maximum Activated Light Count. It is possible to add more Lights to the SceneView than the Maximum Activated Light Count, but only up to the Maximum Activated Light Count Lights will work.

Declaration
C#
Copy
public uint MaximumActivatedLightCount { get; }
Property Value
Type Description
UInt32
Remarks

This property is read only.

View Source

ShadowBias

Sets and gets shadow bias. Shadow bias is an offset value to remove shadow acne that is a visual artifact can be shown on the Shadow Default value is 0.001

Declaration
C#
Copy
public float ShadowBias { get; set; }
Property Value
Type Description
Single
View Source

ShadowIntensity

Sets and gets shadow intensity. If the intensity is larger, the shadow area will be darker. The intensity value is between [0, 1]. Default value is 0.5

Declaration
C#
Copy
public float ShadowIntensity { get; set; }
Property Value
Type Description
Single

Implements

Extension Methods