Computing a World GI Cache

Here is how you can build a world GI cache:

// "win" is a pointer to a RED window.
// "viewpoint" is a pointer to a scene viewpoint.
RED::IWindow* iwin = win->As< RED::IWindow >();

// Publish the latest data modifications.
RC_TEST( iresmgr->EndState() );

// Render the world GI cache.
RED::Object* gi_cache;
RED::Vector< RED::Vector3 > nofilter;
RED::Vector< RED::Object* > noexclude, noblock;
bool complete = false;

while( !complete )
{
    RC_TEST( iwin->FrameTracingGICache( complete, gi_cache, viewpoint, RED::GICM_WORLD, nofilter, noexclude, noblock ) );
}

Note

The last parameter of the call to RED::IWindow::FrameTracingGICache above is an optional pointer to a list of locations in the scene from where the GI cache will be seen. It’s used during the cache creation to concentrate the computation effort on visible parts of the scene and is very helpful to filter parts of the scene which are never visible. It helps producing clean GI caches containing meaningful entries. For example, In the context of computing a cache for a camera animation, this list could include the positions of the camera along the animation path.