Retained mode

Short description: Graphics libraries API design pattern

Retained mode in computer graphics is a major pattern of API design in graphics libraries,[1] in which

* the graphics library, instead of the client, retains the scene (complete object model of the rendering primitives) to be rendered and
* the client calls into the graphics library do not directly cause actual rendering, but make use of extensive indirection to resources, managed - thus retained - by the graphics library.[2] It does not preclude the use of double-buffering.[3]

Immediate mode is an alternative approach. Historically, retained mode has been the dominant style in GUI libraries;[4] however, both can coexist in the same library and are not necessarily exclusionary in practice.[5]

## Overview

Schematic explanation of a retained mode graphics API

In retained mode the client calls do not directly cause actual rendering, but instead update an abstract internal model (typically a list of objects) which is maintained within the library's data space. This allows the library to optimize when actual rendering takes place along with the processing of related objects.[2]

Some techniques to optimize rendering include:

* managing double buffering[6][7]
* treatment of hidden surfaces by backface culling[8]/occlusion culling (Z-buffering)[9]
* only transferring data that has changed from one frame to the next from the application to the library

Example of coexistence with immediate mode in the same library is OpenGL.[dubious - discuss][failed verification][10] OpenGL has immediate mode functions that can use previously defined server side objects (textures, vertex buffers and index buffers, shaders, etc.) without resending unchanged data.[11][12]

Examples of retained mode rendering systems include Windows Presentation Foundation,[2] SceneKit on macOS,[13] and PHIGS.

Schematic explanation of an immediate mode graphics API in contrast

## See also

* Compositing window manager
* Scene graph

## References

1. ↑ Jin, Zhefan (May 2006). "Retained-Mode Parallel Graphics Rendering for Cooperative Design Environments". 2006 10th International Conference on Computer Supported Cooperative Work in Design. pp. 1–6. doi:10.1109/CSCWD.2006.253142. ISBN 1-4244-0164-X. https://ieeexplore.ieee.org/document/4019178?section=abstract.
2. ↑ 2.0 2.1 2.2 Quinn Radich (May 30, 2018). "Retained Mode Versus Immediate Mode". Win32 apps. Microsoft. https://docs.microsoft.com/en-us/windows/win32/learnwin32/retained-mode-versus-immediate-mode.
3. ↑ stevewhims. "Predication queries - Win32 apps" (in en-us). https://learn.microsoft.com/en-us/windows/win32/direct3d12/predication-queries.
4. ↑ Feldmeier, Alex (October 12, 2013). "GUI Programming". UWP Computer Science and Software Engineering Technical Report. http://people.uwplatt.edu/~yangq/CSSE411/csse411-materials/f13/feldmeiera-gui _programming.doc. "Retained mode has been the standard for years. Just about every GUI is in retained mode."
5. ↑ QuinnRadich. "Retained Mode Versus Immediate Mode - Win32 apps" (in en-us). https://docs.microsoft.com/en-us/windows/win32/learnwin32/retained-mode-versus-immediate-mode.
6. ↑ "OpenGL double buffering". https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glXSwapBuffers.xml.
7. ↑ "DirectX double buffering". https://docs.microsoft.com/en-us/windows-hardware/drivers/display/flipping.
8. ↑ "OpenGL face culling". https://www.khronos.org/opengl/wiki/Face_Culling.
9. ↑ "DirectX occlusion culling". https://docs.microsoft.com/en-us/windows/win32/direct3d12/predication-queries.
10. ↑ "OpenGL". https://www.opengl.org/.
11. ↑ "OpenGL Driver Support" (in en). 2013-08-19. https://developer.nvidia.com/opengl-driver.
12. ↑ "OpenGL - The Industry's Foundation for High Performance Graphics" (in en). 2011-07-19. https://www.khronos.org/opengl/.
13. ↑ Weiher, Marcel (Feb 24, 2017). iOS and macOS Performance Tuning: Cocoa, Cocoa Touch, Objective-C, and Swift. Addison-Wesley Professional. ISBN 9780133085532. https://books.google.com/books?id=1kY2DgAAQBAJ&q=retained mode APIs. Retrieved 22 December 2019. "SceneKit and SpriteKit on the other hand are retained-mode APIs"

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Retained mode. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Retained_mode&oldid=207548"