class LightComponent

Light component class.

File location: framework/cauldron/framework/inc/core/components/lightcomponent.h

Construction

Return type

Description

LightComponent ( Entity * pOwner, ComponentData * pData, LightComponentMgr * pManager )
Constructor.

Methods

Return type

Description

void

Update (double deltaTime)
Component update. Updates only execute when the light is marked as dirty. This occurs if the light moves, or has any of it’s core parameters changed.

LightComponentData &

Component data accessor.

const LightComponentData &

GetData () const

LightType

GetType () const
Gets the light type.

Vec3

GetColor () const
Gets the light color.

float

GetIntensity () const
Gets the light intensity.

float

GetRange () const
Gets the light range.

float

GetDepthBias () const
Gets the light depth bias.

float

GetInnerAngle () const
Gets the light inner cone angle.

float

GetOuterAngle () const
Gets the light outer cone angle.

int32_t

Gets the light shadow map resolution.

int

GetShadowMapIndex (int index = 0) const
Gets the light shadow map index.

int32_t

GetShadowMapCellIndex (int index = 0) const
Gets the light shadow map cell index.

Rect

GetShadowMapRect (int index = 0) const
Gets the light shadow map rect.

const Mat4 &

GetShadowProjection (int index = 0) const
Gets the light projection matrix for the shadow.

const Mat4 &

GetShadowViewProjection (int index = 0) const
Gets the light view projection matrix for the shadow.

int

Gets the light cascade count.

int

Gets the light shadow map count. This 1 for anything besides directional lights. The count for directional lights is dependent on the number of cascades configured.

Vec3

GetDirection () const
Gets the light direction.

void

Sets the light as dirty.

const Mat4 &

GetView () const
Gets the light view matrix.

const Mat4 &

GetProjection () const
Gets the light projection matrix.

const Mat4 &

Gets the light view projection matrix.

const Mat4 &

Gets the light inverse view matrix.

const Mat4 &

Gets the light inverse projection matrix.

const Mat4 &

Gets the light inverse view projection matrix.

void

SetupCascades ( int numCascades, const std::vector<float>& cascadeSplitPoints, bool moveLightTexelSize )
Sets up the light’s shadow map cascades.

Detailed description

Light component class. Implements lighting functionality for a given entity.

Construction

LightComponent

Copied!

LightComponent (
    Entity * pOwner,
    ComponentData * pData,
    LightComponentMgr * pManager
)

Constructor.


Methods

Update

Copied!

virtual void Update (double deltaTime)

Component update. Updates only execute when the light is marked as dirty. This occurs if the light moves, or has any of it’s core parameters changed.


GetData

Copied!

LightComponentData & GetData ()

Component data accessor.


GetType

Copied!

LightType  GetType () const

Gets the light type.


GetColor

Copied!

Vec3  GetColor () const

Gets the light color.


GetIntensity

Copied!

float GetIntensity () const

Gets the light intensity.


GetRange

Copied!

float GetRange () const

Gets the light range.


GetDepthBias

Copied!

float GetDepthBias () const

Gets the light depth bias.


GetInnerAngle

Copied!

float GetInnerAngle () const

Gets the light inner cone angle.


GetOuterAngle

Copied!

float GetOuterAngle () const

Gets the light outer cone angle.


GetShadowResolution

Copied!

int32_t GetShadowResolution () const

Gets the light shadow map resolution.


GetShadowMapIndex

Copied!

int GetShadowMapIndex (int index = 0) const

Gets the light shadow map index.


GetShadowMapCellIndex

Copied!

int32_t GetShadowMapCellIndex (int index = 0) const

Gets the light shadow map cell index.


GetShadowMapRect

Copied!

Rect  GetShadowMapRect (int index = 0) const

Gets the light shadow map rect.


GetShadowProjection

Copied!

const Mat4 & GetShadowProjection (int index = 0) const

Gets the light projection matrix for the shadow.


GetShadowViewProjection

Copied!

const Mat4 & GetShadowViewProjection (int index = 0) const

Gets the light view projection matrix for the shadow.


GetCascadesCount

Copied!

int GetCascadesCount () const

Gets the light cascade count.


GetShadowMapCount

Copied!

int GetShadowMapCount () const

Gets the light shadow map count. This 1 for anything besides directional lights. The count for directional lights is dependent on the number of cascades configured.


GetDirection

Copied!

Vec3  GetDirection () const

Gets the light direction.


SetDirty

Copied!

void SetDirty ()

Sets the light as dirty.


GetView

Copied!

const Mat4 & GetView () const

Gets the light view matrix.


GetProjection

Copied!

const Mat4 & GetProjection () const

Gets the light projection matrix.


GetViewProjection

Copied!

const Mat4 & GetViewProjection () const

Gets the light view projection matrix.


GetInverseView

Copied!

const Mat4 & GetInverseView () const

Gets the light inverse view matrix.


GetInverseProjection

Copied!

const Mat4 & GetInverseProjection () const

Gets the light inverse projection matrix.


GetInverseViewProjection

Copied!

const Mat4 & GetInverseViewProjection () const

Gets the light inverse view projection matrix.


SetupCascades

Copied!

void SetupCascades (
    int numCascades,
    const std::vector<float>& cascadeSplitPoints,
    bool moveLightTexelSize
)

Sets up the light’s shadow map cascades.


Related pages

  • Visit the FidelityFX SDK product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNAâ„¢ 2 GPUs, AMD Ryzenâ„¢ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!