Retained mode
Retained mode (literally translated: stored mode ) is a design pattern in computer graphics for the design of the programming interface (API) in graphics libraries , where
- the scene to be rendered (the complete object model of the graphic primitives ) is stored in the memory area of the graphics library instead of in the memory area of the client and where
- the client calls to the graphics library is not just the rendering effect of graphic objects on the screen
but use extensive diversions to the resources managed - i.e. stored - by the graphics library . This does not preclude the use of double buffering .
The immediate mode is an alternative approach. Historically, retained mode is the predominant style in program libraries for graphical user interfaces (GUI); however, both modes can coexist in one and the same program library and do not necessarily exclude each other in practice.
Overview
In retained mode, client calls to the graphics library do not cause immediate rendering , but instead update an abstract internal model (typically a list of objects) that is managed in the memory area of the graphics library. This allows the library to optimize the actual rendering along with the processing of related objects.
Some techniques for optimizing rendering are:
- Manage double buffering
- Treatment of the visibility problem through backface culling / removal of hidden objects (Z-buffering)
- Only those data are transferred from the client to the graphics library that has changed from one picture to the next
An example of coexistence with Immediate Mode in the same graphics library is OpenGL . OpenGL has immediate mode functions that can use previously defined server-side objects (textures, vertex buffers and index buffers , shaders , etc.) without the client sending unchanged data back to the graphics library.
Examples of rendering systems with retained mode are Windows Presentation Foundation , SceneKit in macOS, and PHIGS .
There is another significant design pattern for the programming interface (API) in graphics libraries - the immediate mode.
See also
Individual evidence
- ↑ a b c Quinn Radich: Retained Mode Versus Immediate Mode . In: Win32 apps . Microsoft. May 30, 2018. Retrieved December 21, 2019.
- ↑ Alex Feldmeier: GUI Programming . In: UWP Computer Science and Software Engineering Technical Report . October 12, 2013. Retrieved December 22, 2019: “Retained mode has been the standard for years. Just about every GUI is in retained mode. "
- ↑ OpenGL double buffering . Retrieved May 7, 2020.
- ↑ DirectX double buffering . Retrieved May 7, 2020.
- ↑ OpenGL face culling . Retrieved May 7, 2020.
- ↑ DirectX occlusion culling . Retrieved May 7, 2020.
- ↑ OpenGL . Retrieved May 4, 2020.
- ↑ Marcel Weiher: iOS and macOS Performance Tuning: Cocoa, Cocoa Touch, Objective-C, and Swift . Addison-Wesley Professional, Feb 24, 2017, ISBN 9780133085532 (Retrieved 22 December 2019): "SceneKit and SpriteKit on the other hand are retained-mode APIs"