GI Generation Modes
HOOPS Luminate provides several GI cache generation modes for more flexibility. This enables you to render still images, spherical panoramas as well as full scene animations.
Note
GI caches can be saved to .red files in order to be later reused. See Saving and Loading a GI Cache for details.
Camera
This is the default generation mode. The GI cache is computed for the current view and therefore, can’t be used to render the scene from another viewpoint. It’s the suitable mode for still images or animations with moving objects rendering (see GI and Animation under the section Rendering GI with Moving Objects).
Computing a View-Dependent GI Cache
Here is how you can build a view-dependent 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_CAMERA_VIEW, nofilter, noexclude, noblock ) );
}
Computing a View-Dependent 360° GI Cache
Here is how you can build a view-dependent 360° GI cache suitable to render panoramas:
// "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_CAMERA_SPHERICAL, nofilter, noexclude, noblock ) );
}
World
World GI caches contain information about GI everywhere in the scene. Such caches are not view-dependent any more and can be used to render moving camera animations (see see GI and Animation under the section Rendering GI with Moving Camera).
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.