What "blit" mode do?

What vtkOpenGLRenderWindow::SetFrameBlitModeToBlitToCurrent do?

The documentation https://vtk.org/doc/nightly/html/classvtkOpenGLRenderWindow.html#abf6febada3d0b609614866e0f0f220f9 looks rather short to me!..

Can somebody shed some light on what “blit” is, what is does and when one may need it?

“blit” means to copy something (pixels) from one region in memory to another. This is a common OpenGL operation and you’ll find more documentation there

VTK OpenGL rasterizes 3D/2D geometry into color/depth attachments of an in-memory framebuffer. In the graphics world, this is called offscreen rendering and let’s VTK post-processing work its magic. This “offscreen rendering” is different from the sense in which ParaView uses OSMesa. Read more about OpenGL offscreen rendering here and here.

BlitToHardware
The FrameBlitMode tells VTK where to copy the offscreen buffer. Either the default hardware framebuffer or the currently bound framebuffer. When VTK is used through one of the platform renderwindows (with vtkRenderWindow), the default blit mode is BlitToHardware.

BlitToCurrent
The currently bound framebuffer is basically when an external framebuffer is bound just before the vtkRenderWindow::Frame() call. You’ll need this when integrating VTK with Qt/other UI frameworks because these UI frameworks create/have their own framebuffers.

@jaswantp: Thanks! Helpful answer, I really think these infos should be detailed in VTK doc

Now that you have a better understanding, it would be great if you could make a merge request to the documentation to help other people in the future. A lot of work is required to keep open source communities going and it’s great if everyone can chip in. :

1 Like

@jaswantp: I understand using blit mode is in connection with using SetOffScreenRendering, right? But is it also with using SwapBufferOff/On? In other words, when using BlitToCurrent, I understand I need SetOffScreenRendering(true), but, does SwapBuffer impacted by theses settings and if yes how and why?

@pieper: sure I can do that. Once I have a better understanding on this I’ll propose a MR in the gitlab.

I tried a very-very first MR in the vtk gitlab: https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10341

@pieper, @jaswantp: do not hesitate to improve the proposed doc!

Thank you for the contribution!

Thank you for providing VTK! :wink: Feel free to improve the doc if possible: my understanding is that BlitToCurrent should be used with UseOffScreenBuffersOn and SwapBuffersOff but I saw examples doing the other way!?.. I guess they are right even if I am not sure to get why