Immediate Mode (computer graphics)
Immediate Mode (literally translated: Immediate mode ) is a design pattern in computer graphics for the design of the programming interface (API) in graphics libraries , where
- the client invocations directly the rendering effect of graphic objects on the screen or where
- the data for the description of graphical primitives (in the case of rendering graphical primitives in immediate mode ) are inserted directly into a graphics pipeline by the client, image by image ,
without using - i.e. immediately - extensive redirects to stored resources. This does not preclude the use of double buffering .
The retained mode is an alternative approach. Historically, retained mode is the predominant style in program libraries for graphical user interfaces (GUI); however, both modes can also coexist in one and the same program library and in practice are not necessarily mutually exclusive.
Overview
In immediate mode the scene (the complete object model of the graphic primitives ) is saved in the client's memory area instead of the graphics library . This implies that with an application in immediate mode, the lists of graphic objects to be rendered are saved by the client and not by the programming interface (API) of the graphics library. Every time a new image is needed, the application has to provide all drawing commands to describe the entire scene, regardless of the actual changes. On the one hand, this method offers a high degree of control and flexibility for the application program, on the other hand, it also creates a continuous workload on the CPU .
Examples of immediate mode rendering systems are Direct2D , OpenGL and Quartz . There are several immediate mode GUIs that are particularly suitable for use in conjunction with immediate mode rendering systems.
There is another significant design pattern of the programming interface in graphics libraries - retained mode .
Rendering of graphic primitives in immediate mode
Simple vertex properties can be inserted into a command buffer frame by frame using a renderer API . This involves significant bandwidth and processor time (especially if the graphics processor is on a separate bus ), but can be beneficial for data that is dynamically generated by the CPU . With the advent of ever more versatile shaders , with which a graphics processor can create increasingly complex effects without the need for intervention by the CPU, this has become less common.
Render with vertex buffers in immediate mode
Although drawing commands must be redeployed for each image , modern systems that use this method can generally avoid unnecessary duplication of more memory-intensive display data by referring to this immutable data (via indirect addressing ) (e.g. textures and Vertex buffer ).
Use with graphical user interfaces
Individual evidence
- ↑ a b 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 . 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 December 22, 2019): "The primary graphics API Quartz and OpenGL are both immediate-mode APIs"