LightsprintSDK 2021.08.08
|
#include <RRIllumination.h>
Public Member Functions | |
virtual void | captureLighting (class RRSolver *solver, unsigned timeSlot)=0 |
virtual unsigned | updateEnvironmentMap (RRObjectIllumination *illumination, unsigned layerEnvironment, RRReal time) const =0 |
virtual | ~RRLightField () |
virtual bool | save (const char *filename) 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) |
Static Public Member Functions | |
static RRLightField * | create (RRVec4 aabbMin, RRVec4 aabbSize, RRReal spacing=1, unsigned envMapSize=8, unsigned numTimeSlots=1) |
static RRLightField * | load (const char *filename) |
Additional Inherited Members | |
Protected Member Functions inherited from rr::RRUniformlyAllocatedNonCopyable | |
RRUniformlyAllocatedNonCopyable () | |
~RRUniformlyAllocatedNonCopyable () | |
GI precomputed in space.
Light field contains precomputed indirect part of global illumination. It is designed for scenarios with static lights and dynamic objects - precompute lightmaps for static objects and lightfield for dynamic objects. When rendering dynamic objects in game, use your usual direct lighting together with indirect lighting from lightfield. You can use multiple lightfields for different locations in game level.
Typical use:
|
inlinevirtual |
|
static |
Creates light field.
Empty lightfield is created, use captureLighting() to fill it.
aabbMin | Lower corner of axis aligned bounding box of space/time where light field is to be computed. Fourth coordinate is time in your units. |
aabbSize | Size of axis aligned bounding box of space/time where light field is to be computed. Fourth coordinate is time in your units. |
spacing | Distance between sampling points. Smaller = higher quality, but larger structure. |
envMapSize | Size of reflection envmaps. 8 or 16 is usually sufficient. |
numTimeSlots | Number of time slots in lightfield. Time slots are used for dynamic lights, you can capture lighting in space for several moments in time. Use 1 slot for static lighting. |
|
pure virtual |
Captures lighting in space into lightfield. Call it for all time slots, otherwise content of lightfield will be undefined.
solver | Solver, source of information about scene and its illumination. |
timeSlot | Lighting in scene will be stored to given slot. Time slot numbers are 0..numTimeSlots-1 where numTimeSlots was specified by create(). |
|
pure virtual |
Updates diffuse and/or specular environment maps in object illumination.
Unlike all other buffer update function in Lightsprint SDK, this one changes type/size/format of buffer (to RGB cubemap of size you entered to RRSolver::buildLightField()).
illumination | Illumination you want to update. |
layerEnvironment | Number of layer with environment map, it is addressed by illumination->getLayer(layerEnvironment). |
time | Illumination at given time is computed. (Lightfield may store dynamic lighting for time period specified at lightfield build.) Use the same time units you used in create(). |
|
inlinevirtual |
Saves instance to disk.
filename | File to be created. Mandatory, it is not autogenerated. |
|
static |
Loads instance from disk.
filename | File to be loaded. Mandatory, it is not autogenerated. |