ArticleslgStudy

computer science

Immediate mode (computer graphics)

Immediate mode (computer graphics) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Immediate mode (computer graphics) rather than just read about it. In short: Immediate mode is an API design pattern in computer graphics libraries, in which the client calls directly cause rendering of graphics objects to the display, or in which the data to describe rendering primitives is inserted frame by frame directly from the client into a command list (in the case of immediate mode primitive rendering), without the use of extensive indirection – thus immediate – to retained resources…

Immediate mode (computer graphics) — main illustration
Immediate mode (computer graphics) — illustration

Key takeaways

  • Immediate mode (computer graphics) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Immediate mode (computer graphics) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Immediate mode (computer graphics) from memory before moving on to harder problems.

Reference excerpt

Immediate mode is an API design pattern in computer graphics libraries, in which

the client calls directly cause rendering of graphics objects to the display, or in which the data to describe rendering primitives is inserted frame by frame directly from the client into a command list (in the case of immediate mode primitive rendering), without the use of extensive indirection – thus immediate – to retained resources. It does not preclude the use of double-buffering. Retained mode is an alternative approach. Historically, retained mode has been the dominant style in GUI libraries; however, both can coexist in the same library and are not necessarily exclusive in practice.

Overview

In immediate mode, the scene (complete object model of the rendering primitives) is retained in the memory space of the client, instead of the graphics library. This implies that in an immediate mode application, the lists of graphical objects to be rendered are kept by the client and are not saved by the graphics library API. The application must re-issue all drawing commands required to describe the entire scene each time a new frame is required, regardless of actual changes. This method provides on the one hand a maximum of control and flexibility to the application program, but on the other hand it also generates continuous work load on the CPU.

Examples of immediate mode rendering systems include Direct2D, OpenGL and Quartz. There are some immediate mode GUIs that are particularly suitable when used in conjunction with immediate mode rendering systems.

Immediate mode primitive rendering Primitive vertex attribute data may be inserted frame by frame into a command buffer by a rendering API. This involves significant bandwidth and processor time (especially if the graphics processing unit is on a separate bus), but may be advantageous for data generated dynamically by the CPU. It is less common since the advent of increasingly versatile shaders, with which a graphics processing unit may generate increasingly complex effects without the need for CPU intervention.

Immediate mode rendering with vertex buffers Although drawing commands have to be re-issued for each new frame, modern systems using this method are generally able to avoid the unnecessary duplication of more memory-intensive display data by referring to that unchanging data (via indirection) (e.g. textures and vertex buffers) in the drawing commands.

Immediate mode GUI Graphical user interfaces traditionally use retained mode-style API design, but immediate mode GUIs instead use an immediate mode-style API design, in which user code directly specifies the GUI elements to draw in the user input loop. For example, rather than having a CreateButton() function that a user would call once to instantiate a button, an immediate-mode GUI API may have a DoButton() function which should be called whenever the button should be on screen. The technique was developed by Casey Muratori in 2002. Prominent implementations include Omar Cornut's Dear ImGui in C++, Nic Barker's Clay in C and Micha Mettke's Nuklear in C.

See also Display list Retained mode, usually contrasted with immediate mode Scene graph

References

Illustrations

Immediate mode (computer graphics): Schematic explanation of a retained mode graphics API in contrast
Schematic explanation of a retained mode graphics API in contrast

Worked examples

Example 1 — a first encounter with Immediate mode (computer graphics)

Start with the simplest possible case. Write down what Immediate mode (computer graphics) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Immediate mode (computer graphics) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Immediate mode (computer graphics) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Immediate mode (computer graphics)

In research
Immediate mode (computer graphics) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Immediate mode (computer graphics) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Immediate mode (computer graphics) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer graphics, DirectX, OpenGL, so understanding it makes those chapters shorter.
In everyday life
Look for Immediate mode (computer graphics) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Immediate mode (computer graphics) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Immediate mode (computer graphics) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Immediate mode (computer graphics) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Immediate mode (computer graphics) in simple terms?

Immediate mode is an API design pattern in computer graphics libraries, in which the client calls directly cause rendering of graphics objects to the display, or in which the data to describe rendering primitives is inserted frame by frame directly from the client into a command list (in the case o…

Why does Immediate mode (computer graphics) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Immediate mode (computer graphics)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Immediate mode (computer graphics).

Tags

  • Computer graphics
  • DirectX
  • OpenGL

Keep exploring