Nebula
|
#include <lightcontext.h>
Inherits Graphics::GraphicsContext.
Classes | |
struct | ConstantBufferSet |
Public Types | |
enum class | LightType { DirectionalLightType , PointLightType , SpotLightType , AreaLightType } |
enum class | AreaLightShape { Disk , Rectangle , Tube } |
Public Member Functions | |
LightContext () | |
constructor | |
virtual | ~LightContext () |
destructor | |
Public Member Functions inherited from Graphics::GraphicsContext | |
GraphicsContext () | |
constructor | |
virtual | ~GraphicsContext () |
destructor | |
Static Public Member Functions | |
static void | Create () |
setup light context | |
static void | Discard () |
discard light context | |
static void | SetupGlobalLight (const Graphics::GraphicsEntityId id, const Math::vec3 &color, const float intensity, const Math::vec3 &ambient, const Math::vec3 &backlight, const float backlightFactor, const float zenith, const float azimuth, bool castShadows=false) |
setup entity as global light | |
static void | SetupPointLight (const Graphics::GraphicsEntityId id, const Math::vec3 &color, const float intensity, const float range, bool castShadows=false, const CoreGraphics::TextureId projection=CoreGraphics::InvalidTextureId) |
Setup entity as point light source. | |
static void | SetupSpotLight (const Graphics::GraphicsEntityId id, const Math::vec3 &color, const float intensity, const float innerConeAngle, const float outerConeAngle, const float range, bool castShadows=false, const CoreGraphics::TextureId projection=CoreGraphics::InvalidTextureId) |
Setup entity as spot light. | |
static void | SetupAreaLight (const Graphics::GraphicsEntityId id, const AreaLightShape shape, const Math::vec3 &color, const float intensity, const float range, bool twoSided=false, bool castShadows=false) |
Setup entity as area light. | |
static void | SetColor (const Graphics::GraphicsEntityId id, const Math::vec3 &color) |
set color of light | |
static Math::vec3 | GetColor (const Graphics::GraphicsEntityId id) |
static void | SetRange (const Graphics::GraphicsEntityId id, const float range) |
set range of light | |
static void | SetIntensity (const Graphics::GraphicsEntityId id, const float intensity) |
set intensity of light | |
static float | GetIntensity (const Graphics::GraphicsEntityId id) |
static void | SetTransform (const Graphics::GraphicsEntityId id, const float azimuth, const float zenith) |
Set transform as angles. | |
static const Math::mat4 | GetTransform (const Graphics::GraphicsEntityId id) |
get transform | |
static const Math::mat4 | GetObserverTransform (const Graphics::GraphicsEntityId id) |
get the view transform including projections | |
static const void | SetPosition (const Graphics::GraphicsEntityId id, const Math::point &position) |
Set light position. | |
static const Math::point | GetPosition (const Graphics::GraphicsEntityId id) |
Get light position. | |
static const void | SetRotation (const Graphics::GraphicsEntityId id, const Math::quat &rotation) |
Set light rotation. | |
static const Math::quat | GetRotation (const Graphics::GraphicsEntityId id) |
Get light rotation. | |
static const void | SetScale (const Graphics::GraphicsEntityId id, const Math::vec3 &scale) |
Set light scale. | |
static const Math::vec3 | GetScale (const Graphics::GraphicsEntityId id) |
Get light scale. | |
static Math::vec3 | GetAmbient (const Graphics::GraphicsEntityId id) |
static void | SetAmbient (const Graphics::GraphicsEntityId id, Math::vec3 &ambient) |
static LightType | GetType (const Graphics::GraphicsEntityId id) |
get the light type | |
static void | GetInnerOuterAngle (const Graphics::GraphicsEntityId id, float &inner, float &outer) |
get inner and outer angle for spotlights | |
static void | SetInnerOuterAngle (const Graphics::GraphicsEntityId id, float inner, float outer) |
set inner and outer angle for spotlights | |
static void | OnPrepareView (const Ptr< Graphics::View > &view, const Graphics::FrameContext &ctx) |
prepare light visibility | |
static void | UpdateViewDependentResources (const Ptr< Graphics::View > &view, const Graphics::FrameContext &ctx) |
prepare light lists | |
static void | RunFrameScriptJobs (const Graphics::FrameContext &ctx) |
run framescript when visibility is done | |
static void | WindowResized (const CoreGraphics::WindowId windowId, SizeT width, SizeT height) |
React to window resize event. | |
static void | OnRenderDebug (uint32_t flags) |
render debug | |
static void | SetupTerrainShadows (const CoreGraphics::TextureId terrainShadowMap, const uint worldSize) |
Setup terrain shadows. | |
static const CoreGraphics::BufferId | GetLightIndexBuffer () |
get light index lists buffer | |
static const CoreGraphics::BufferId | GetLightsBuffer () |
get light lists buffer | |
Private Member Functions | |
__DeclareContext () | |
Static Private Member Functions | |
static void | SetGlobalLightTransform (const Graphics::ContextEntityId id, const Math::mat4 &transform, const Math::vector &direction) |
Set global light transform. | |
static void | SetGlobalLightViewProjTransform (const Graphics::ContextEntityId id, const Math::mat4 &transform) |
Set global light shadow transform. | |
static Graphics::ContextEntityId | Alloc () |
allocate a new slice for this context | |
static void | Dealloc (Graphics::ContextEntityId id) |
deallocate a slice | |
Static Private Attributes | |
static GenericLightAllocator | genericLightAllocator |
static PointLightAllocator | pointLightAllocator |
static SpotLightAllocator | spotLightAllocator |
static AreaLightAllocator | areaLightAllocator |
static DirectionalLightAllocator | directionalLightAllocator |
static ShadowCasterAllocator | shadowCasterAllocator |
static Util::HashTable< Graphics::GraphicsEntityId, uint, 16, 1 > | shadowCasterSliceMap |
Additional Inherited Members | |
Static Protected Member Functions inherited from Graphics::GraphicsContext | |
static void | InternalRegisterEntity (const Graphics::GraphicsEntityId id, Graphics::GraphicsContextState &&state) |
static void | InternalDeregisterEntity (const Graphics::GraphicsEntityId id, Graphics::GraphicsContextState &&state) |
template<class ID_ALLOCATOR > | |
static void | InternalDefragment (ID_ALLOCATOR &allocator, Graphics::GraphicsContextState &&state) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
strong |
|
strong |
Lighting::LightContext::LightContext | ( | ) |
constructor
|
virtual |
destructor
|
private |
|
staticprivate |
allocate a new slice for this context
|
static |
setup light context
|
staticprivate |
deallocate a slice
|
static |
discard light context
|
static |
|
static |
|
static |
get inner and outer angle for spotlights
|
static |
|
static |
get light index lists buffer
|
static |
get light lists buffer
|
static |
get the view transform including projections
|
static |
Get light position.
|
static |
Get light rotation.
|
static |
Get light scale.
|
static |
get transform
|
static |
get the light type
|
static |
prepare light visibility
|
static |
render debug
|
static |
run framescript when visibility is done
|
static |
|
static |
set color of light
|
staticprivate |
Set global light transform.
|
staticprivate |
Set global light shadow transform.
|
static |
set inner and outer angle for spotlights
|
static |
set intensity of light
|
static |
Set light position.
|
static |
set range of light
|
static |
Set light rotation.
|
static |
Set light scale.
|
static |
Set transform as angles.
|
static |
Setup entity as area light.
|
static |
setup entity as global light
|
static |
Setup entity as point light source.
|
static |
Setup entity as spot light.
|
static |
Setup terrain shadows.
|
static |
prepare light lists
|
static |
React to window resize event.
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |