Search topics and sections

Computer graphics is the use of computers to create and change images.[1] Its pictures can be flat (2D), such as icons, charts and printed designs, or built from 3D models, as in video games, animated films and engineering design.[1][2] The windows and icons on a computer screen are also products of computer graphics.[2]

Most of the field works on three tasks: describing the shape and look of objects, turning those descriptions into pictures, and making things move.[1] The methods draw on geometry, linear algebra and the physics of light. Much of the work runs on special chips that can draw images fast enough to answer a player or user with no visible delay.[2]

What the field covers

Peter Shirley and Steve Marschner's textbook names three core areas of computer graphics.[1]

  • Modeling describes the shape and look of objects in a form a computer can store.
  • Rendering makes shaded images from those 3D models. The word comes from art.
  • Animation makes the illusion of motion from a sequence of images. It uses modeling and rendering and adds change over time.

Several nearby areas also use graphics methods, though whether they count as core graphics "is a matter of opinion".[1] They include user interaction, virtual reality, visualization, image processing, 3D scanning and computational photography.[1] Images can be fully synthetic or made by changing photographs.[1]

Where it is used

How pictures are stored

A computer can store a picture in two main ways. It can store the color of every dot in a grid, or it can store the shapes that make up the picture.[2]

Raster images

A raster image is a grid of tiny colored dots called pixels.[2] Each pixel is stored as one or more bits. One bit per pixel is enough for black and white, and 24 bits per pixel ("true color") gives more than 16 million colors, since 224=16,777,2162^{24} = 16{,}777{,}216.[2]

Raster images use a lot of memory, and a full screen at true color needs several megabytes.[2] For example, a screen of 1920 by 1080 pixels holds 2,073,600 pixels, and at 3 bytes each that is about 6.2 million bytes.

Raster displays came from television technology. They spread in the late 1970s and 1980s and have been the norm since the 1990s.[2]

Vector images

A vector image stores shapes instead of dots. Early systems of the 1960s built pictures from straight line segments, each stored as just the coordinates of its two endpoints.[2] This saves memory, but curved edges drawn with straight lines show a visible "stair-step" look, so vector systems were poor at realistic images.[2]

Vector and raster storage of a circle Vector Raster (x1, y1) (x2, y2) stored: endpoint coordinates of each segment pixel: one stored color stored: a color for every pixel
A vector image stores a circle as straight segments, each given by endpoint coordinates such as (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2). A raster image stores the same circle as a color for every pixel of a 16 by 16 grid, so its edge forms stair steps.

Modeling shapes

To draw a 3D scene, the computer first needs a model of each object. A model gives the shape and also how light should interact with the surface.[1] For example, a coffee mug might be stored as a set of 3D points, a rule for joining them, and a reflection model for its glaze.[1]

Polygon meshes

The most common shape model is a polygon mesh, a surface made of many small flat polygons, usually triangles. The Utah teapot, made at the University of Utah in 1975 and still used as a test model, is built from many small polygons.[2] Even with hundreds of polygons, such a surface does not look fully smooth.[2]

Curves and smooth surfaces

Smooth shapes can be described with curves instead. A cubic Bézier curve is set by four points, and two such curves join smoothly when they have the same slope where they meet.[2] Bézier curves and the related B-splines were brought into computer-aided design to model car bodies.[2]

A subdivision surface gives a smooth surface from a coarse polygon mesh. The Catmull-Clark subdivision surface, by Edwin Catmull and James H. Clark, is widely used in animation and film effects.[3]

Two ways to model shape: a polygon mesh and a cubic Bézier curve Polygon mesh vertex edge face (triangle) Cubic Bézier curve P₀ P₁ P₂ P₃ four points set the curve
Two common ways to model shape. A sphere is approximated by a polygon mesh of 60 flat triangles built from vertices and edges, and a cubic Bézier curve is set by four control points P0P_0 to P3P_3: it starts at P0P_0, ends at P3P_3, and is only pulled toward P1P_1 and P2P_2.

Rendering a scene

Rendering turns a 3D model into a 2D image. It has two main jobs: visibility (which surfaces the camera can see at each pixel) and shading (what color each visible point should be).[4]

Moving and projecting points

Every object is placed in the scene by moving, turning and scaling its points. The camera's position is then undone so that all points are measured from the camera, and finally the points are projected onto a flat image.[5]

These steps are written as matrices. To make moving (translation) a matrix product like the others, graphics uses homogeneous coordinates, which add a fourth number w=1w = 1 to each point (x,y,z)(x, y, z).[5] A translation by (Tx,Ty,Tz)(T_x, T_y, T_z) then becomes

(100Tx010Ty001Tz0001)(xyz1)=(x+Txy+Tyz+Tz1)\begin{pmatrix} 1 & 0 & 0 & T_x \\ 0 & 1 & 0 & T_y \\ 0 & 0 & 1 & T_z \\ 0 & 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \\ z \\ 1 \end{pmatrix} = \begin{pmatrix} x + T_x \\ y + T_y \\ z + T_z \\ 1 \end{pmatrix}

Because every step is now a matrix, the whole chain can be multiplied into one matrix before any point is processed.[5]

F=Mprojection⋅Mcamera⋅MmodelF = M_{\text{projection}} \cdot M_{\text{camera}} \cdot M_{\text{model}}

Here MmodelM_{\text{model}} places the object in the scene, McameraM_{\text{camera}} undoes the camera's position and rotation, and MprojectionM_{\text{projection}} projects onto the image and scales to pixels.[5] Since matrix multiplication is associative, the parts that do not change can be reused for every point.[5] The mathematics of computer graphics covers these tools in more depth.

Perspective projection makes far objects look smaller. With the camera at the origin looking along the zz axis and the image plane at distance dd, a point (x,y,z)(x, y, z) lands on the image at

x′=x dz,y′=y dzx' = \frac{x \, d}{z}, \qquad y' = \frac{y \, d}{z}

This holds for points in front of the camera (z>0z > 0). Dividing by zz is what shrinks distant objects.[5]

Perspective projection, side view camera y z (depth) image plane d z y P = (y, z) farther, so smaller P′ y′ = y·d / z
Side view of perspective projection: a point PP at height yy and depth zz projects onto the image plane at distance dd with height y′=y d/zy' = y\,d / z, from the similar triangles. A second point of the same height that is farther away projects lower, so distant objects look smaller.

Visibility: rasterization and ray tracing

There are two main ways to find which surface is visible at each pixel. They do the same job with their two loops swapped.[4]

  • Rasterization loops over the triangles. It projects each triangle's corners onto the image, then fills in the pixels the flat triangle covers.[4]
  • Ray tracing loops over the pixels. It sends a ray from the camera through each pixel and finds the closest object the ray hits.[4]
Rasterization Ray tracing
Outer loop Triangles in the scene Pixels in the image
Inner loop Pixels in the image Objects in the scene
Starts from The geometry ("object-centric") The image
Hard part Simple: projection and a point-in-triangle test Finding where rays hit geometry
Main use The method GPUs use to draw 3D objects Reflections, refraction, film-quality images

Sources: Scratchapixel[4] and Britannica.[2]

Rasterization compared with ray tracing Rasterization for each triangle, find covered pixels Eye Image plane Triangle Ray tracing for each pixel, find the nearest hit Eye Pixel Closest hit (kept) Farther hit (ignored)
Rasterization loops over triangles. It projects each triangle's corners through the image plane toward the eye and fills the pixels the projected triangle covers. Ray tracing loops over pixels. It sends a ray through each pixel and keeps only the nearest surface the ray hits.

Rasterization must still decide which triangle is in front where they overlap, a task called hidden-surface removal.[2] The usual answer is z-buffering: each pixel stores the depth of the nearest surface drawn so far, and a new surface point for that pixel is kept only if it is nearer.[2][6] Edwin Catmull introduced z-buffering in his 1974 PhD thesis, and Wolfgang Strasser described it at the same time.[3]

Z-buffer depth testDepth 7Depth 3Each pixel keeps the smallestdepth (nearest surface)
In the depth test, a z-buffer stores one depth value per pixel. Where the blue surface at depth 3 overlaps the orange surface at depth 7, each pixel keeps the smaller depth, so the nearer blue surface is drawn.

Shading

Shading sets the color of each visible point from its material and the lights. The look depends on surface finish (matte, satin or glossy) and on whether light comes from one source, from all around, or both.[2] Three classic methods trade speed for quality on polygon meshes.[7]

Method Where lighting is computed Result
Flat shading Once per triangle Faceted look on curved objects
Gouraud shading At the three corners, then blended across Smooth, but can miss highlights inside a triangle
Phong shading At every pixel, using a surface direction blended from the corners Best quality, slowest

The surface direction used in Phong shading is the normal, an arrow pointing straight out of the surface.[7]

Henri Gouraud proposed his method in 1971, and Bui Tuong Phong his in 1973.[7] Phong's family name was Bùi Tường, so "Phong shading" uses his given name.[8]

Flat, Gouraud and Phong shading of the same polygon sphere Light Flat Gouraud Phong one color per triangle color at corners, blended normal blended, lit per pixel
The same coarse polygon sphere, lit from the upper left, rendered with flat, Gouraud and Phong shading. Flat shading gives each facet one tone. Gouraud blends colors computed at the vertices, so its highlight spreads out. Phong lights each pixel and gives a small, sharp highlight.

Texture mapping wraps a 2D image around a 3D object to add detail such as wood grain or printed labels.[3] Catmull's 1974 thesis showed that photographs could be "mapped" onto curved patches this way.[9]

Jagged edges

Raster images often show jagged edges and small details that flicker or vanish. In 1977 Franklin C. Crow explained these defects as aliasing, an effect of sampling a signal at separate points.[10] He proposed filtering the image before sampling as the cure, which is the basis of anti-aliasing.[10]

The graphics pipeline and GPUs

Real-time graphics breaks rendering into a fixed series of stages called the graphics pipeline. Each stage can work on one piece of data while the next stage works on another.[2]

Pipeline stages

Two of the stages run a shader, a small program that runs on the GPU.[11] In OpenGL, a common programming interface, the main stages run in this order.[6]

  1. Vertex specification: the program sends lists of vertices (corner points) to the GPU.
  2. Vertex shader: a shader transforms each vertex, usually with the matrices above.
  3. Vertex post-processing: vertices are grouped into triangles, clipped to the view, divided by ww for perspective, and mapped to window coordinates.
  4. Rasterization: each triangle is turned into fragments, one per pixel sample it covers, with values blended from its corners.
  5. Fragment shader: a shader computes each fragment's color.
  6. Per-sample operations: tests such as the depth test, then blending into the final image.

Optional stages that add or change triangles, such as tessellation and geometry shaders, are left out of this list.[6] Pipelines mix these programmable stages with fixed-function stages built into the chip.[11]

Rasterization graphics pipeline Image Vertex data corner points Vertex shader transform each vertex Primitive assembly, clipping, viewport build triangles, divide by w Rasterization triangles to fragments Fragment shader compute color Per-sample tests depth test, blending programmable (shader) fixed-function optional stages (tessellation, geometry shader) not shown
The rasterization graphics pipeline runs through six stages, from vertex data to a finished image. The vertex shader and fragment shader are programmable, and the other stages are fixed-function.

Graphics hardware

A graphics processing unit (GPU) is a chip built to run this pipeline. High-performance graphics processors use two kinds of parallel work: many rays or pixels processed at once, and different pipeline stages working on different images at once.[2]

The 3Dlabs Glint Gamma of 1997 was the first programmable engine for transform and lighting (moving vertices into place and computing their lighting), and 3Dlabs used the term GPU for "geometry processor unit".[12] In 1999 Nvidia marketed the GeForce 256 as "the world's first GPU", a single chip that did transform and lighting as well as building, clipping and drawing triangles.[12]

GPUs later became fully programmable. Pat Hanrahan and his students extended the RenderMan shading language to run in real time on GPUs, work that led to commercial languages such as the OpenGL Shading Language.[3] Their Brook language for GPUs led to Nvidia's CUDA, and GPUs are now also used for general-purpose computing, including training machine learning models.[3]

Programming interfaces

Programs reach the GPU through a graphics API (application programming interface), a standard set of drawing routines.[1]

  • OpenGL specifies a standard set of graphics routines callable from languages such as C or Java.[2]
  • Vulkan, from the Khronos Group, is a cross-platform standard for 3D graphics.[13]
  • Direct3D is Microsoft's graphics API. The GeForce 256 supported both Direct3D 7.0 and OpenGL 1.2.1.[12]
  • WebGPU exposes GPU hardware to web pages and is designed to map well onto modern native GPU APIs.[11]

Realistic light

In the real world, objects are lit both directly by lamps or the Sun and by light bounced off other objects.[2] A brightly colored object, for instance, casts a faint glow of its color onto nearby surfaces.[2] Methods that model this bounced light are called global illumination.

Recursive ray tracing

In 1968 Arthur Appel at IBM sent a line of sight from the eye through each spot of the picture, found the first surface it hit, and checked whether that point could see the light source.[14] This idea is now called ray casting.

Turner Whitted extended it in 1980 so that a hit does not end the search.[15] In his words, each visible intersection "produces more rays in the reflection direction, the refraction direction, and in the direction of each light source".[15] Rays toward the lights, called shadow rays, test whether a point is in shadow.[15]

Whitted-style recursive ray tracing Traced ray Shadow ray Eye Image plane Pixel Primary ray P1 Reflection ray Refraction ray Glass sphere Light P2 Diffuse floor
In Whitted-style ray tracing, a primary ray from the eye passes through one pixel and strikes a glass sphere at P1P_1. There it splits into a reflection ray and a refraction ray, and the refraction ray exits the sphere and lands on the floor at P2P_2. Shadow rays from P1P_1 and P2P_2 test whether each point can see the light.

Every transparent surface spawns two new rays, so the ray count can double at each bounce. Renderers therefore stop after a set maximum depth.[15] Ray tracing a complex scene could take minutes or hours.[2]

Radiosity

Radiosity methods model light as energy shared among all the surfaces of a scene, not as rays.[2] They capture soft light bounced between surfaces. Like ray tracing, radiosity is costly to compute.[2]

The rendering equation

In 1986 Jim Kajiya published the rendering equation, a single integral equation that includes many earlier rendering methods as special cases.[16] It is usually written as follows.[17]

Lo(x,ωo)=Le(x,ωo)+∫Ωfr(x,ωi,ωo) Li(x,ωi) (ωi⋅n) dωiL_o(\mathbf{x}, \omega_o) = L_e(\mathbf{x}, \omega_o) + \int_{\Omega} f_r(\mathbf{x}, \omega_i, \omega_o)\, L_i(\mathbf{x}, \omega_i)\, (\omega_i \cdot \mathbf{n})\, d\omega_i
  • Lo(x,ωo)L_o(\mathbf{x}, \omega_o) is the radiance leaving point x\mathbf{x} in direction ωo\omega_o, for example toward the camera.
  • LeL_e is the light the surface emits itself, which is zero unless it is a light source.
  • Li(x,ωi)L_i(\mathbf{x}, \omega_i) is the radiance arriving at x\mathbf{x} from direction ωi\omega_i.
  • frf_r is the bidirectional reflectance distribution function (BRDF), which says how much light from ωi\omega_i the surface scatters toward ωo\omega_o.
  • ωi⋅n\omega_i \cdot \mathbf{n} is the cosine between the incoming direction and the surface normal n\mathbf{n}, which weakens light that arrives at a slant.
  • Ω\Omega is the hemisphere of directions above the surface.

In words, the light leaving a point equals the light it emits plus all the light it reflects.[17] The equation is recursive, since the light arriving at one point is the light leaving some other point.[17]

Terms of the rendering equation n Ω (all incoming directions) ωi Li (incoming) weight cos θ = ωi · n θ x ωo Lo (outgoing) Le (emitted) fr: how the surface scatters light from ωi to ωo
The rendering equation gives the outgoing radiance LoL_o at a point xx toward the viewer along ωo\omega_o. It is the emitted light LeL_e plus incoming light LiL_i from every direction ωi\omega_i in the hemisphere Ω\Omega, weighted by cos⁡θ=ωi⋅n\cos\theta = \omega_i \cdot n and scattered by the BRDF frf_r.

Kajiya noted that the idea was not new, since radiative heat transfer had studied it for years, but that his form suited computer graphics.[16] His equation leaves out wave effects such as diffraction, assumes nothing between surfaces scatters light, and does not track wavelength or polarization.[16]

Path tracing

The rendering equation can rarely be solved exactly, so renderers estimate it with random sampling, a Monte Carlo method. In 1984 Robert L. Cook and colleagues introduced distributed ray tracing, which used Monte Carlo-like sampling to model blurry reflections.[16]

Kajiya's 1986 paper also introduced path tracing. Instead of branching a tree of rays at each surface, it follows a single randomly chosen branch, giving one path per sample, and averages many paths for each pixel.[16] For scenes with much reflection and refraction, this greatly cuts the number of ray tests per pixel.[16]

Real-time ray tracing

For decades ray tracing was too slow for interactive use. Rendering the frames of an animated film can take days, even on "farms" of many computers.[2]

In 2018 Nvidia's Turing GPUs added RT Cores, hardware units for ray tracing.[18] They speed up two expensive steps: walking a bounding volume hierarchy (a tree of nested boxes around the geometry) and testing rays against triangles. Without such hardware, these steps take thousands of instructions per ray.[18]

Even so, games cast few rays per pixel, and Nvidia's own documents say not to expect hundreds of rays per pixel in real time. Denoising filters clean up the image instead, and Nvidia expected many developers to mix rasterization and ray tracing in one frame.[18] See real-time ray tracing and real-time computer graphics.

Animation

Animation adds the key problem of movement over time to modeling and rendering.[1] Film studios built much of the technology. Researchers at Pixar published foundational methods such as image compositing, motion blur and cloth simulation.[3]

RenderMan, a rendering system built around programmable shaders, was used in 1995 to make Toy Story, the first full-length 3D computer-animated film.[3] RenderMan kept surface shape separate from how the surface reflects light, and computed color, transparency and texture at points on each shape.[3]

Machine learning in graphics

Machine learning now plays a growing part in rendering. Nvidia's Deep Learning Super Sampling (DLSS) renders each frame at a lower resolution and uses a trained neural network, with data from earlier frames and motion vectors, to rebuild a sharper image.[2] This raises frame rates in games without rendering every pixel directly.[2]

Other methods learn a whole scene from photographs. A 2020 paper on neural radiance fields (NeRF) stored a scene in a neural network that maps a 3D position and viewing direction to density and color, then rendered new views from it.[19] A 2023 method, 3D Gaussian splatting, represents the scene with many 3D Gaussian blobs and renders new views in real time, at 30 or more frames per second at 1080p resolution.[20]

History

The term "computer graphics" was coined in 1960 at Boeing by William Fetter and his supervisor Vern Hudson, to describe drawings made by a computer-controlled plotter.[21] Fetter used it to draw human figures for designing aircraft cockpits.[21] For a fuller account, see history of computer graphics.

Year Milestone People or group
1960 Term "computer graphics" coined at Boeing[21] William Fetter, Vern Hudson
1963 Sketchpad lets a user draw on a screen with a light pen in real time, on MIT's TX-2 computer[22] Ivan Sutherland
1968 Ray casting for visible surfaces and shadows[14] Arthur Appel
1971 Gouraud shading[7] Henri Gouraud
1973 Phong shading, in a PhD thesis; journal paper 1975[8] Bui Tuong Phong
1974 Z-buffering and texture mapping in a PhD thesis[3] Edwin Catmull
1974 First SIGGRAPH conference, in Boulder, Colorado[23] ACM SIGGRAPH
1975 Utah teapot model created[2] University of Utah
1977 Jagged edges explained as aliasing[10] Franklin C. Crow
1978 Shadows computed with a z-buffer, the basis of shadow mapping[24] Lance Williams
1980 Recursive ray tracing[15] Turner Whitted
1982 Tron, an early feature film with long computer-generated sequences[25] Several graphics firms for Disney
1984 Distributed ray tracing[16] Robert L. Cook and colleagues
1986 Rendering equation and path tracing[16] Jim Kajiya
1995 Toy Story, first full-length 3D computer-animated film[3] Pixar
1999 GeForce 256 marketed as the first GPU[12] Nvidia
2018 GPUs with ray tracing hardware[18] Nvidia
2020 Neural radiance fields[19] Academic researchers
2023 3D Gaussian splatting[20] Academic researchers

Sutherland received the 1988 Turing Award, and Catmull and Hanrahan shared the 2019 award for their work on 3D computer graphics.[3]

Research community

ACM SIGGRAPH is the main professional society. It began as an ACM committee organized by Sam Matsa of IBM and Andries van Dam of Brown University, and held its first conference in 1974.[23] It now runs two conferences a year.[23] The second, SIGGRAPH Asia, was first held in Singapore in 2008.[26]

Eurographics is the Europe-wide graphics association. It runs two major annual conferences, Eurographics and EuroVis.[27] ACM Transactions on Graphics (TOG) calls itself the foremost peer-reviewed journal in the field.[28]

References

  1. Fundamentals of Computer Graphics, 3rd ed. (Shirley and Marschner), chapter 1, A K Peters, 2009.
  2. Computer graphics (David Hemmendinger), Encyclopaedia Britannica, 2026.
  3. Pioneers of Modern Computer Graphics Recognized with ACM A.M. Turing Award (2019), Association for Computing Machinery, 2020.
  4. An Overview of the Rasterization Algorithm, Scratchapixel.
  5. Describing and Rendering a Scene, Computer Graphics from Scratch (Gabriel Gambetta), No Starch Press, 2021.
  6. Rendering Pipeline Overview, Khronos OpenGL Wiki.
  7. Shading, Computer Graphics from Scratch (Gabriel Gambetta), No Starch Press, 2021.
  8. The Life and Legacy of Bui Tuong Phong, arXiv, 2024.
  9. A Subdivision Algorithm for Computer Display of Curved Surfaces (Edwin Catmull), University of Utah, 1974.
  10. The aliasing problem in computer-generated shaded images (Franklin C. Crow), Communications of the ACM, 1977.
  11. WebGPU, W3C.
  12. Famous Graphics Chips: Nvidia's GeForce 256 (Jon Peddie), IEEE Computer Society.
  13. Vulkan: Cross platform 3D Graphics, Khronos Group.
  14. Some techniques for shading machine renderings of solids (Arthur Appel), AFIPS Spring Joint Computer Conference, 1968.
  15. Light Transport Algorithms and Ray-Tracing: Whitted Ray-Tracing, Scratchapixel.
  16. The Rendering Equation (James T. Kajiya), SIGGRAPH Computer Graphics, 1986.
  17. Rendering equation and path tracing, lecture 11, 15-468 Physics-based Rendering, Carnegie Mellon University, 2022.
  18. NVIDIA Turing GPU Architecture whitepaper, Nvidia, 2018.
  19. NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis, arXiv, 2020.
  20. 3D Gaussian Splatting for Real-Time Radiance Field Rendering, arXiv, 2023.
  21. William Fetter, E.A.T., and 1960s Computer Graphics Collaborations in Seattle, HistoryLink.org.
  22. The Remarkable Ivan Sutherland, Computer History Museum, 2023.
  23. History, ACM SIGGRAPH.
  24. Casting curved shadows on curved surfaces (Lance Williams), SIGGRAPH '78, ACM, 1978.
  25. The Tron Technical Challenge: History of Visual Effects and Computer Graphics, Information Display, Society for Information Display.
  26. SIGGRAPH Debuts in Asia, Communications of the ACM, 2009.
  27. About EG, Eurographics.
  28. ACM Transactions on Graphics, ACM Digital Library.

Figure