GFX
  • Docs
  • API
Search Results for

    Show / Hide Table of Contents
    • Genesis.Core
      • AssetManager
      • DirectionalLight
      • Game
      • GameElement
      • GameEventHandler
      • IGameBehavior
      • Input
      • Input.Keys
      • Layer
      • Light
      • Light2D
      • PointLight
      • Scene
      • Scene2D
      • Scene3D
      • SceneEventHandler
      • SceneSizeEvenHandler
      • Storage
      • Utils
      • Window
      • Window.WindowEventHandler
      • WindowUtilities
      • WindowUtilities.POINT
      • WindowUtilities.RECT
    • Genesis.Core.Behaviors
      • AnimationBehavior
      • CameraFlags
      • CharacterController2D
      • ControllerPreset
      • MoveDirection
      • MovementFlags
      • SpriteMovementController
    • Genesis.Core.Behaviors.Physics2D
      • BoxCollider
      • BoxRigidBody
      • BoxTrigger2D
      • BufferedSpriteCollider
      • PhysicsBox2D
      • PhysicsPolygon2D
      • Rigidbody2D
    • Genesis.Core.Behaviors.Physics3D
      • BoxCollider
      • BoxRigidBody
      • BoxTrigger
      • CapsuleCollider
      • CapsuleRigidBody
      • CompoundMeshCollider
      • ConvexHullBehavior
      • ConvexHullCollider
      • MeshCollider
      • QubeConvexHull
      • SphereCollider
      • SphereRigidBody
      • SphereTrigger
      • StaticMeshBehavior
    • Genesis.Core.Behaviors._3D
      • Stance
      • ThirdpersonCharacterController
    • Genesis.Core.GameElements
      • BufferedSprite
      • CameraElement
      • Element3D
      • Empty
      • FindPathAsynchResult
      • GridCell
      • Model
      • NavMesh
      • Obstacle
      • ParticleBuffers
      • ParticleDeffinition
      • ParticleEmitter
      • Qube
      • RectElement
      • Skybox
      • Sphere
      • Sprite
      • SpriteShapeDeffinition
      • Terrain2D
      • Terrain3D
      • TerrainData
      • Waypoint
    • Genesis.Graphics
      • Animation
      • AnimationCallback
      • AnimationCallback.AnimationEvent
      • Camera
      • CameraType
      • Face
      • Font
      • Framebuffer
      • Frustum
      • Glyphe
      • IRenderDevice
      • InstancedElement
      • InstancedMesh
      • Material
      • MaterialBuffer
      • Mesh
      • PerspectiveCamera
      • RenderInstanceContainer
      • RenderSettings
      • Shader
      • ShaderProgram
      • SpriteSheet
      • TexCoords
      • Texture
      • Viewport
    • Genesis.Graphics.Animation3D
      • Animation
      • Animator
      • AssimpNodeData
      • Bone
      • KeyPosition
      • KeyRotation
      • KeyScale
      • ModelMesh
      • boneinfo
      • vertex
    • Genesis.Graphics.Physics
      • BulletDebugRenderer
    • Genesis.Graphics.RenderDevice
      • GLRenderer
      • LegacyRenerer
    • Genesis.Graphics.Shaders.OpenGL
      • AnimatedModelShader
      • BasicShader
      • BorderCircleShader
      • DiffuseLightning
      • DiffuseNormalLightning
      • DiffuseNormalShader
      • DiffuseShader
      • DiffuseSolidShader
      • Element3DShader
      • FXScreenSpaceShadowShader
      • InstanceShader2D
      • InstancedShader
      • Light2DShader
      • LightmapShader
      • MVPRectShader
      • MVPShader
      • MVPSolidShader
      • ParticleShader
      • ScreenShader
      • SkyboxShader
      • SolidShapeShader
      • SpecularShader
      • SpriteShader
      • TerrainShader
      • WireframeShader
    • Genesis.Graphics.Shapes
      • BufferedSpriteShape
      • CircleShape
      • FrameShape
      • GlypheShape
      • Light2DShape
      • LineShape
      • PlaneShape
      • QubeShape
      • RectShape
      • Shape
      • SphereShape
      • SpriteShape
    • Genesis.Math
      • Matrix4x4
      • NoisePoint
      • PerlinNoise
      • Rect
      • Vec3
    • Genesis.Physics
      • Aabb
      • ColliderBehavior2D
      • ColliderBehavior3D
      • CollisionGroup
      • CollisionGroupExtensions
      • HitResult
      • HitResult2D
      • MatrixSet
      • MouseRay2
      • PhysicHandler
      • PhysicHandlerEvent
      • PhysicPropeterys
      • PhysicsBehavior
      • PhysicsBehaviorEvent
      • PhysicsHandler2D
      • PhysicsHandler3D
      • Ray2D
      • Raycast
      • Raycast2D
      • RigidBodyBehavior2D
      • RigidBodyBehavior3D
      • TriggerBehavior2D
      • TriggerBehavior3D
    • Genesis.UI
      • Button
      • Canvas
      • GridView
      • ImageButton
      • Label
      • ListItem
      • ListItemBehavior
      • ListSelector
      • ListSelectorBehavior
      • Panel
      • ProgressBar
      • UIEvent
      • UIParseHandler
      • UIParser
      • Widget
      • WidgetAnchor
    • Genesis.UI.Items
      • GridViewImageIcon
      • IItem

    Class Light

    Represents a light source in the Genesis framework.

    Inheritance
    object
    GameElement
    Light
    DirectionalLight
    PointLight
    Inherited Members
    GameElement.OnRender(Game, IRenderDevice)
    GameElement.OnUpdate(Game, IRenderDevice)
    GameElement.OnDestroy(Game)
    GameElement.AddBehavior<T>(T)
    GameElement.AddBehavior(IGameBehavior)
    GameElement.GetBehavior<T>()
    GameElement.GetBehaviors<T>()
    GameElement.AddChild(GameElement)
    GameElement.GetInstance(GameElement)
    GameElement.HasTag(string)
    GameElement.Name
    GameElement.Tag
    GameElement.Location
    GameElement.Rotation
    GameElement.Size
    GameElement.Behaviors
    GameElement.Scene
    GameElement.Enabled
    GameElement.Propertys
    GameElement.Children
    GameElement.Parent
    GameElement.UUID
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Genesis.Core
    Assembly: Genesis.dll
    Syntax
    public abstract class Light : GameElement

    Constructors

    Light(string, Vec3, bool)

    Creates a new instance of the Light class with the specified name and location.

    Declaration
    public Light(string name, Vec3 location, bool castShadows = true)
    Parameters
    Type Name Description
    string name

    The name of the light.

    Vec3 location

    The 3D location of the light.

    bool castShadows

    Light(string, Vec3, float, bool)

    Creates a new instance of the Light class with the specified name, location and intensity.

    Declaration
    public Light(string name, Vec3 location, float intensity, bool castShadows = true)
    Parameters
    Type Name Description
    string name

    The name of the light.

    Vec3 location

    The 3D location of the light.

    float intensity

    The intensity of the light.

    bool castShadows

    Properties

    CastShadows

    Gets or sets a value indicating whether the light should cast shadows.

    Declaration
    public bool CastShadows { get; set; }
    Property Value
    Type Description
    bool

    true if the light casts shadows; otherwise, false. This property controls whether shadows are rendered for this object during the shadow mapping process.

    Intensity

    Gets or sets the intensity of the light.

    Declaration
    public float Intensity { get; set; }
    Property Value
    Type Description
    float

    LightColor

    Gets or sets the color of the light.

    Declaration
    public Color LightColor { get; set; }
    Property Value
    Type Description
    Color

    ShadowResolution

    Gets or sets the resolution of the shadow map.

    Declaration
    public Vec3 ShadowResolution { get; set; }
    Property Value
    Type Description
    Vec3

    A Vec3 object specifying the width and height of the shadow map. Default resolution is 2048x2048.

    Shadowmap

    Gets or sets the shadow map for the light.

    Declaration
    public Framebuffer Shadowmap { get; set; }
    Property Value
    Type Description
    Framebuffer

    A Framebuffer object that stores the shadow map used for shadow calculations.

    Methods

    GetLightColor()

    Returns the light color in RGB values normalized between 0 and 1.

    Declaration
    public Vec3 GetLightColor()
    Returns
    Type Description
    Vec3

    A Vec3 representing the normalized RGB values of the light color.

    GetLightDirection(Camera)

    Returns the direction vector from the light to the camera.

    Declaration
    public Vec3 GetLightDirection(Camera camera)
    Parameters
    Type Name Description
    Camera camera

    The camera to which the direction is calculated.

    Returns
    Type Description
    Vec3

    The normalized vector representing the light direction.

    GetLightProjectionMatrix(PerspectiveCamera, Viewport)

    Gets the light projection matrix for the specified camera and viewport. This abstract method must be implemented in subclasses to return the appropriate light projection matrix.

    Declaration
    public abstract mat4 GetLightProjectionMatrix(PerspectiveCamera camera, Viewport viewport)
    Parameters
    Type Name Description
    PerspectiveCamera camera

    The perspective camera used for the calculation.

    Viewport viewport

    The viewport that defines the rendering area.

    Returns
    Type Description
    mat4

    A GlmSharp.mat4 representing the projection matrix for this light.

    GetLightViewMatrix()

    Gets the light view matrix for rendering. This abstract method must be implemented in subclasses to return the appropriate light view matrix.

    Declaration
    public abstract mat4 GetLightViewMatrix()
    Returns
    Type Description
    mat4

    A GlmSharp.mat4 representing the view matrix for this light.

    Init(Game, IRenderDevice)

    Initializes the light with the provided game and render device. This method prepares the shadow map for rendering.

    Declaration
    public override void Init(Game game, IRenderDevice renderDevice)
    Parameters
    Type Name Description
    Game game

    The game object that this light belongs to.

    IRenderDevice renderDevice

    The render device used to build the shadow map.

    Overrides
    GameElement.Init(Game, IRenderDevice)
    In this article
    Back to top Generated by DocFX