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.

    public class Light : View, IDynamicResourceHandler, INameScope, System.IDisposable, IResourcesProvider
    Inheritance
    object
    BindableObject
    Element
    BaseHandle
    Animatable
    Container
    View
    Light
    Implements
    IDynamicResourceHandler
    INameScope
    System.IDisposable
    IResourcesProvider
    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
    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
    public Light()
    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.

    View Source

    Light(Light)

    Copy constructor.

    Declaration
    public Light(Light light)
    Parameters
    Type Name Description
    Light light

    Source object to copy.

    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.

    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
    public bool IsLightEnabled { get; set; }
    Property Value
    Type Description
    bool
    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
    public bool IsShadowEnabled { get; set; }
    Property Value
    Type Description
    bool
    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
    public bool IsShadowSoftFilteringEnabled { get; set; }
    Property Value
    Type Description
    bool
    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
    public uint MaximumActivatedLightCount { get; }
    Property Value
    Type Description
    uint
    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
    public float ShadowBias { get; set; }
    Property Value
    Type Description
    float
    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.

    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
    public float ShadowIntensity { get; set; }
    Property Value
    Type Description
    float
    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.

    Implements

    IDynamicResourceHandler
    INameScope
    System.IDisposable
    IResourcesProvider

    Extension Methods

    ViewExtensions.BackgroundColor(View)
    ViewExtensions.BorderlineColor(View)
    ViewExtensions.BoxShadow(View)
    ViewExtensions.Color(View)
    ViewExtensions.CornerRadius(View)
    EXamlExtensions.LoadFromEXamlByRelativePath<T>(T, string)
    ViewExtensions.BackgroundColor<T>(T, float, float, float, float)
    ViewExtensions.BackgroundColor<T>(T, uint, float)
    ViewExtensions.BackgroundColor<T>(T, UIColor)
    ViewExtensions.BackgroundImage<T>(T, string)
    ViewExtensions.Borderline<T>(T, float, UIColor, float)
    ViewExtensions.BorderlineColor<T>(T, float, float, float, float)
    ViewExtensions.BorderlineColor<T>(T, uint, float)
    ViewExtensions.BorderlineColor<T>(T, UIColor)
    ViewExtensions.BorderlineOffset<T>(T, float)
    ViewExtensions.BorderlineWidth<T>(T, float)
    ViewExtensions.BoxShadow<T>(T, float, float, float)
    ViewExtensions.BoxShadow<T>(T, float, UIColor, float, float)
    ViewExtensions.BoxShadow<T>(T, UIShadow)
    ViewExtensions.ClippingMode<T>(T, ClippingModeType)
    ViewExtensions.Color<T>(T, float, float, float, float)
    ViewExtensions.Color<T>(T, uint, float)
    ViewExtensions.Color<T>(T, UIColor)
    ViewExtensions.CornerRadius<T>(T, float, bool)
    ViewExtensions.CornerRadius<T>(T, float, float, float, float, bool)
    ViewExtensions.CornerRadius<T>(T, UICorner)
    ViewExtensions.Focusable<T>(T, bool)
    ViewExtensions.FocusableChildren<T>(T, bool)
    ViewExtensions.FocusableInTouch<T>(T, bool)
    ViewExtensions.ImageShadow<T>(T, ImageShadow)
    ViewExtensions.IsEnabled<T>(T, bool)
    ViewExtensions.Layout<T>(T, LayoutItem)
    ViewExtensions.Opacity<T>(T, float)
    ViewExtensions.Position<T>(T, float, float)
    ViewExtensions.PositionX<T>(T, float)
    ViewExtensions.PositionY<T>(T, float)
    ViewExtensions.Scale<T>(T, float, float)
    ViewExtensions.ScaleX<T>(T, float)
    ViewExtensions.ScaleY<T>(T, float)
    ViewExtensions.Sensitive<T>(T, bool)
    ViewExtensions.Size<T>(T, float, float)
    ViewExtensions.SizeHeight<T>(T, float)
    ViewExtensions.SizeWidth<T>(T, float)
    ViewExtensions.Visibility<T>(T, bool)
    ViewExtensions.VoiceInteractionName<T>(T, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, string)
    Extensions.LoadFromXaml<TXaml>(TXaml, Type)
    Extensions.LoadFromXamlFile<TXaml>(TXaml, string)
    • View Source
    Back to top Copyright © 2016-2025 Samsung
    Generated by DocFX