LightsprintSDK 2021.08.08
|
#include <RRIllumination.h>
Public Member Functions | |
RRObjectIllumination () | |
~RRObjectIllumination () | |
RRBuffer *& | getLayer (unsigned layerNumber) |
RRBuffer * | getLayer (unsigned layerNumber) const |
Public Member Functions inherited from rr::RRUniformlyAllocated | |
void * | operator new (std::size_t n) |
void * | operator new[] (std::size_t n) |
void | operator delete (void *p, std::size_t n) |
void | operator delete[] (void *p, std::size_t n) |
Public Attributes | |
RRVec3 | envMapWorldCenter |
RRReal | envMapWorldRadius |
RRVec3 | cachedCenter |
unsigned short | cachedGatherSize |
unsigned short | cachedNumTriangles |
unsigned * | cachedTriangleNumbers |
Protected Attributes | |
class LayersMap * | layersMap |
Additional Inherited Members | |
Protected Member Functions inherited from rr::RRUniformlyAllocatedNonCopyable | |
RRUniformlyAllocatedNonCopyable () | |
~RRUniformlyAllocatedNonCopyable () | |
Data structure with object's illumination and more.
This is collection of various buffers that may contain lightmaps, bent normals, reflection cube maps, ambient occlusion. This collection belongs to one object in your scene.
Buffers are created by you and deleted by destructor (unless you delete them manually).
RRSolver::updateXxx() functions store calculated illumination in buffers. They usually preserve buffer properties you selected while creating buffer: BufferType, BufferFormat and scale. So you are free to select between per-pixel and per-vertex lighting etc.
Renderer renders illumination from these buffers.
rr::RRObjectIllumination::RRObjectIllumination | ( | ) |
rr::RRObjectIllumination::~RRObjectIllumination | ( | ) |
RRBuffer *& rr::RRObjectIllumination::getLayer | ( | unsigned | layerNumber | ) |
Returns illumination buffer from given layer.
Illumination can be stored in various types of buffers
At the beginning, all layers are empty, buffers are nullptr. To initialize layer, do one of
To update buffers in layer, do one of
Multiple layers (e.g. one layer per light source) can be mixed by renderer.
Assigned buffers will be deleted automatically in ~RRObjectIllumination.
layerNumber | Index of illumination buffer you would like to get. Arbitrary unsigned number. |
RRBuffer * rr::RRObjectIllumination::getLayer | ( | unsigned | layerNumber | ) | const |
RRVec3 rr::RRObjectIllumination::envMapWorldCenter |
World coordinate of object center.
To be updated by you when object moves. You can use RRObject::updateIlluminationEnvMapCenter() to update it.
RRReal rr::RRObjectIllumination::envMapWorldRadius |
World radius of object's bounding sphere.
To be updated by you when object changes/scales. You can use RRObject::updateIlluminationEnvMapCenter() to update it. When rr_gl::RRSolverGL::updateEnvironmentMap() renders into envmap in envmap layer, this is used as a camera near setting, to prevent rendering what's inside object.
RRVec3 rr::RRObjectIllumination::cachedCenter |
unsigned short rr::RRObjectIllumination::cachedGatherSize |
unsigned short rr::RRObjectIllumination::cachedNumTriangles |
unsigned* rr::RRObjectIllumination::cachedTriangleNumbers |
|
protected |
Container with all layers.