Turning on Adaptive Sampling
To enable adaptive sampling, the application must:
Change the sampler in use on the resource manager
Set some adaptation threshold (or set an amount of time to spend on calculating the image)
Set some software anti-aliasing
// Access the resource manager to set the sampler to the HM sampler:
RED::Object* resmgr = RED::Factory::CreateInstance( CID_REDResourceManager );
if( !resmgr )
RC_TEST( RED_FAIL );
RED::IResourceManager* iresmgr = resmgr->As< RED::IResourceManager >();
RED::IOptions* iresopt = resmgr->As< RED::IOptions >();
RC_TEST( iresopt->SetOptionValue( RED::OPTIONS_SAMPLER, 1, iresmgr->GetState() ) );
// Then, access to the scene viewpoint 'camera' and set the amount of adaptation to use:
RED::IOptions* icamopt = camera->As< RED::IOptions >();
RC_TEST( icamopt->SetOptionValue( RED::OPTIONS_RAY_ADAPTIVE_SAMPLING_THRESHOLD, 0.005, iresmgr->GetState() ) );
// Don't forget to have some anti-aliasing enabled on your 'vrl', otherwise, adaptation won't work:
RED::IViewpointRenderList* ivrl = vrl->As< RED::IViewpointRenderList >();
RC_TEST( ivrl->SetSoftAntiAlias( 4, iresmgr->GetState() ) );
Please refer to the page here for all details: Adaptive Sampling.