Light probes are objects that store SH illumination. These SH values are baked from environmental texture maps, such as a skybox or skydome.
More...
|
| virtual void | initComponent () |
| virtual void | updateComponent () |
| virtual CObjectSerializable * | createSerializable () |
| virtual void | loadSerializable (CObjectSerializable *object) |
| virtual CEntity * | spawn () |
|
CEntity * | addLightProbe (const core::vector3df &position) |
|
int | getPositions (std::vector< core::vector3df > &positions) |
|
void | setSH (std::vector< core::vector3df > &sh) |
| Public Member Functions inherited from Skylicht::CEntityHandler |
| virtual void | onUpdateCullingLayer (u32 mask) |
|
CEntity * | searchEntityByID (const char *id) |
|
virtual CEntity * | createEntity () |
|
virtual CEntity * | createEntity (CEntity *parent) |
|
virtual void | removeEntity (CEntity *entity) |
|
virtual void | removeAllEntities () |
|
void | regenerateEntityId () |
|
core::array< CEntity * > & | getEntities () |
|
int | getEntityCount () |
|
void | getEntitiesTransforms (core::array< core::matrix4 > &result) |
|
void | setShadowCasting (bool b) |
|
bool | isShadowCasting () |
|
const char * | getName () |
| virtual void | reset () |
| virtual void | startComponent () |
| virtual void | endUpdate () |
|
virtual void | onEnable (bool b) |
|
void | setEnable (bool b) |
|
bool | isEnable () |
|
CGameObject * | getGameObject () |
|
void | setEnableSerializable (bool b) |
|
bool | isSerializable () |
|
void | addLinkComponent (CComponentSystem *comp) |
|
void | removeAllLink () |
|
virtual | ~IActivatorObject () |
| | Virtual destructor for polymorphic activator objects.
|
Light probes are objects that store SH illumination. These SH values are baked from environmental texture maps, such as a skybox or skydome.
You can use Lightmapper::CLightmapper to bake light into CLightProbes, or you can also bake it directly from Skylicht-Editor once you have set up the Sky environment.
The ambient light that shines on objects is influenced by light probes and the environment
The baking process recalculates the colors and stores them in CLightProbeData. This value is then mapped to the nearest objects with CIndirectLightingData. This SH value will eventually be passed to the Shader during the drawing step.
When the environment changes, you need to rebake the light probes
CLightProbes* probesComponent = object->getComponent<CLightProbes>();
...
...
std::vector<core::vector3df> positions;
std::vector<Lightmapper::CSH9> probes;
std::vector<core::vector3df> results;
scene->update();
if (probesComponent->getPositions(positions) > 0)
{
Lightmapper::CLightmapper::getInstance()->initBaker(32);
Lightmapper::CLightmapper::getInstance()->bakeProbes(
positions,
probes,
bakeCamera,
renderPipeline,
entityMgr
);
{
core::vector3df r[9];
sh.copyTo(r);
for (int i = 0; i < 9; i++)
results.push_back(r[i]);
}
probesComponent->setSH(results);
}
This object class manages all entities within a scene.
Definition CEntityManager.h:89
- See also
- Lightmapper::CLightmapper