Creating and Accessing an Auxiliary VRL’s Render Image

// Assuming that 'window' is a valid HOOPS Luminate window object:
RED::IWindow* iwindow = window->As< RED::IWindow >();

// Creating an auxiliary VRL that render to a HD half float buffer:
RED::Object* auxvrl;
RC_TEST( iwindow->CreateVRL( auxvrl, 1920, 1080, RED::FMT_HALF_FLOAT_RGBA, true, iresmgr->GetState() ) );

// Retrieve the VRL interface:
RED::IViewpointRenderList* iauxvrl = auxvrl->As< RED::IViewpointRenderList >();

// Add data to visualize.

// Render the window:
RC_TEST( iwindow->FrameDrawing() );

// Access the built-in VRL image:
RED::Object* image = iauxvrl->GetRenderImage();
RED::IImage2D* iimage2D = image->As< RED::IImage2D >();

// For instance, read-back the VRL pixels to CPU:
RC_TEST( iimage2D->GetPixels() );

A viewpoint render list (VRL) is either corresponding to an off-screen buffer if it’s an auxiliary VRL or to an on-screen buffer if it’s the default VRL of a window. A VRL has two built-in render images that provide an access to its contents:

  • RED::IViewpointRenderList::GetRenderImage: access the color buffer image with the contents of the VRL after it has been drawn.

  • RED::IViewpointRenderList::GetRenderDepthImage: access the depth buffer image of the contents of the VRL after it has been drawn.

These methods return ready-to-use, GPU uploaded, 2D images, using the RED::TGT_TEX_RECT target. Note that the application may also specify other images for accessing a VRLs contents, using RED::IImage2D::SetRenderImage or RED::IImage2D::SetRenderDepthImage.