Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::component::Lighting Class Reference

Lighting component. More...

#include <OxygenEngine/scene/component/lighting.h>

Inheritance diagram for oe::component::Lighting:
[legend]
Collaboration diagram for oe::component::Lighting:
[legend]

Public Member Functions

 Lighting (oe::scene::Manager &, oe::render::TextureManager &texture_manager)
 Create the component.
 
virtual void onUpdate (const double, const int8_t) override
 Update lighting.
 
void fillShader (oe::render::ShaderBase &shader) const noexcept
 Send All lights data to the shader.
 
void fillReflectionsShader (oe::render::ShaderBase &shader) const noexcept
 Send Reflection probes data to the shader.
 
void fillTransparencyShader (oe::render::ShaderBase &shader) const noexcept
 Send Transparency data (ie refractive buffer) to the shader.
 
void setRefractionTexture (const std::shared_ptr< oe::render::Texture > &refraction_texture)
 Set texture that will be used as source for refractive surfaces.
 
const std::vector< glm::mat4 > getAreaLights () const
 Get Area lights Each one packed as a matrix where each xyz rows are the light edges, last component w1 is "double sided" and w2, w3, w4 are "light color".
 
void setDefaultReflectionProbe (std::shared_ptr< oe::render::Cubemap > cubemap)
 Set Default reflection source.
 
- Public Member Functions inherited from oe::scene::SceneComponent
 SceneComponent (Manager &entity)
 Constructor.
 
ManagergetSceneManager ()
 Get Scene bound to this component.
 
const ManagergetSceneManager () const
 Get Scene bound to this component.
 
virtual void onNodeAdd (Node &)
 Run actions after a node is added.
 
virtual void onNodeRemove (Node &)
 Run actions before a node is removed.
 
- Public Member Functions inherited from oe::component::EntityComponent< Manager >
const std::string & getName () const
 

Public Attributes

int8_t match_flags = 0
 Do not update lighting unless flags is same as this value.
 
- Public Attributes inherited from oe::component::Component
bool is_active = true
 Toggle to check if the Component is active, actual meaning heavily depends of the component type.
 

Protected Attributes

std::vector< std::pair< PointLight *, oe::scene::Node * > > _point_lights
 
std::vector< std::pair< AreaLight *, oe::scene::Node * > > _area_lights
 
std::vector< glm::vec3 > _point_light_positions
 
std::vector< glm::vec3 > _point_light_colors
 
std::vector< glm::mat4 > _area_light_matrices
 
ReflectionProbe _default_reflection_probe
 
oe::render::TextureManager_texture_manager
 
oe::render::Pbr _pbr
 
std::shared_ptr< oe::render::Texture_brdf_texture
 
std::shared_ptr< oe::render::Texture_refraction_texture
 
friend PointLight
 
friend AreaLight
 
- Protected Attributes inherited from oe::component::EntityComponent< Manager >
Manager & _entity
 

Additional Inherited Members

- Protected Member Functions inherited from oe::component::EntityComponent< Manager >
 EntityComponent (Manager &entity)
 

Detailed Description

Lighting component.

Handles lighting + reflections of the scene

Constructor & Destructor Documentation

◆ Lighting()

oe::component::Lighting::Lighting ( oe::scene::Manager ,
oe::render::TextureManager texture_manager 
)

Create the component.

Member Function Documentation

◆ fillReflectionsShader()

void oe::component::Lighting::fillReflectionsShader ( oe::render::ShaderBase shader) const
noexcept

Send Reflection probes data to the shader.

Parameters
shader

◆ fillShader()

void oe::component::Lighting::fillShader ( oe::render::ShaderBase shader) const
noexcept

Send All lights data to the shader.

Parameters
shader

◆ fillTransparencyShader()

void oe::component::Lighting::fillTransparencyShader ( oe::render::ShaderBase shader) const
noexcept

Send Transparency data (ie refractive buffer) to the shader.

Parameters
shader

◆ onUpdate()

virtual void oe::component::Lighting::onUpdate ( const double  ,
const int8_t   
)
overridevirtual

Update lighting.

Parameters
deltaseconds since last call of update
flagscustom flags

Reimplemented from oe::component::Component.

◆ setRefractionTexture()

void oe::component::Lighting::setRefractionTexture ( const std::shared_ptr< oe::render::Texture > &  refraction_texture)
inline

Set texture that will be used as source for refractive surfaces.

Note
If you use the pipeline, this texture is already set to use the output from lighting pass
Parameters
shader

The documentation for this class was generated from the following file: