
eBook - ePub
Computer Graphics
From Pixels to Programmable Graphics Hardware
- 568 pages
- English
- ePUB (mobile friendly)
- Available on iOS & Android
eBook - ePub
About this book
Complete Coverage of the Current Practice of Computer GraphicsComputer Graphics: From Pixels to Programmable Graphics Hardware explores all major areas of modern computer graphics, starting from basic mathematics and algorithms and concluding with OpenGL and real-time graphics. It gives students a firm foundation in today's high-performance graphic
Frequently asked questions
Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
- Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
- Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Computer Graphics by Alexey Boreskov,Evgeniy Shikin in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Graphics. We have over one million books available in our catalogue for you to explore.
Information
Chapter 1
Introduction: Basic concepts
1.1 Coordinate spaces, transformations
1.2 Graphics pipeline
1.3 Working with the windowing system
1.4 Colors: Color models
1.5 Raster algorithms
1.6 Hidden surface removal
1.7 Lighting models and shading
There are some basic mathematical and programming notions and concepts important for understanding the potentials of computer graphics. In this chapter we will just briefly review them and show what we need in order to write OpenGL rendering code. They will be covered in subsequent chapters.
In the beginning of this book we will be writing a program which renders a torus and allows the user to rotate it with the mouse. Initially it be rendered just in one color (see Figure 1.1).

FIGURE 1.1 (See color insert.): Simple torus rendered in one color.
Later we will step-by-step add texture, lighting and bumpmapping (see Figure 1.2). Using this example as our goal we will look at what we need to write corresponding code adding one feature after another.

FIGURE 1.2 (See color insert.): Textured and lit torus.
In Chapter 16 we will cover the creation of various special effects such as bumpmapping, parallax, depth of field and many others.
1.1 Coordinate spaces, transformations
In order to render various objects we need a way to represent these objects and transformations to be applied to them so that they can be directly used by a computer. All the geometric objects are specified by the means of coordinates. Coordinates provide a way to represent geometric objects with numbers which can be easily processed on a computer. How many numbers we need to uniquely identify a point defines a dimension.
We can uniquely specify a position of any point on a line with a number x in the following way: we have selected two points on the line, point O as a coordinate origin and another point E (with coordinate x = 1) to define direction and scale on it (see Figure 1.3).

FIGURE 1.3: 1D-coordinate system.
A coordinate of any point A is equal to the distance between it and coordinate origin O if the direction from O to A coincides with the chosen direction OE, or the distance multiplied by minus one otherwise. Coordinates of points O and E equal to zero, x = 0, and unit, x = 1, respectively.
The set of all points of the line together with the origin O and a chosen point E (which defines both a direction on the line and distance scale) form a one-dimensional (or 1D) coordinate space. The space is 1-dimensional because we need only one number to uniquely identify every point of the line. The choice is not unique – we can choose any point O′ as a coordinate origin and any other point E′ as the unit direction. Hence, on the line there exist many different coordinate systems and the same point A will have different coordinates in different coordinate systems.
A plane is a 2-dimensional space because we need the pair of numbers (x, y) to identify a point on the plane. To make a coordinate space we need two usually perpendicular coordinate axes intersecting in coordinate origin O (see Figure 1.4).

FIGURE 1.4: 2D-coordinate system.
The most common space to us is a three-dimensional or 3D-space; to identify a point we need the three numbers (coordinates) x, y and z. As in the previous examples we identify a point relative to some coordinate system. In a 3D-space a coordinate system is formed by tree axes intersecting at one point (a coordinate origin). The axes are usually perpendicular to each other (see Figure 1.5).

FIGURE 1.5: 3D-coordinate system.
To operate with geometric objects we need to use coordinates, coordinate systems and various transformations. Usually coordinates are represented as vectors; transforms are represented as matrices. So we need vector and matrix algebra to provide a simple and effective mechanism for dealing with them. Chapters 3 and 5 cover 2D- and 3D-coordinate spaces, various transforms and projections.
Also we need some simple geometric algorithms, which will be covered in Chapter 4.
1.2 Graphics pipeline
In order to obtain a rendered image from the source 3-dimensional models, light sources and other parameters, the input data undergoes a series of steps (or stages) called a graphics pipeline.
A graphics pipeline determines the steps and order of their execution to get a two-dimensional (2D) image from a given camera model, set of three-dimensional (3D) objects, light sources, textures, lighting equations and many other data.
A camera models the human vision system (or a real digital or analog camera) used to get two-dimensional images. Usually computer graphics uses the simple pinhole camera model, corresponding to a single lens with an infinitesimal diameter.
In the following chapters we will describe the OpenGL pipeline in detail. Here we will look at it from a more broader point of view. We can select several major stages:
- application stage;
- geometry stage;
- raster (fragment) stage.
The application stage is a part outside the graphics APIs (Application Programming Interface) such as OpenGL or Direct3D. From game architecture it is what is best described as a graphics engine. It can include complex object processing by the CPU (Central Processing Unit), various optimization techniques and algorithms, such as rejecting invisible objects, managing Level-of-Detail (LOD), interactions of objects with each other, complex lighting and shadowing algorithms, and many others. This stage may be very complex, as it includes many operations running in parallel on several CPU cores.
The geometry processing is usually done on specialized hardware, Graphics Processing Unit (GPU). It consists of many sub-stages working in parallel and processing big amounts of data. Some of these stages are hardcoded into hardware, while others are controlled by special user programs, called shaders, which are executed on the GPU.
The fragment stage also runs on the GPU and consists of several sub-stages. In this stage the geometry primitives are scan-converted to the pixels (picture elements), and a special shader along with some non-shader parts processes these pixels in to form a 2D-image.
The geometry and fragment stages now run entirely on a GPU and include many different substages.
In order to use graphics hardware for rendering an image we need a special API (such as OpenGL or Direct3D) that allows us to write device-independent code. Despite the differences in such APIs the hardware below them is the same and corresponding stages have much in common.
In this book we will be using the third version of OpenGL and for rendering various objects.
1.3 Working with the windowing system
The chosen OpenGL API is a pure rendering API – it does not have code for creating windows for rendering and processing user input (from the mouse and keyboard).
W...
Table of contents
- Cover
- Half Title
- Series Page
- Title Page
- Copyright Page
- Contents
- Foreword
- List of Figures
- List of Tables
- 1 Introduction: Basic concepts
- 2 Transforms in 2D
- 3 Geometric algorithms in 2D
- 4 Transformations in 3D, projections, quaternions
- 5 Basic raster algorithms
- 6 Color and color models
- 7 Basics freeglut and GLEW for OpenGL rendering
- 8 Hidden surface removal
- 9 Modern OpenGL: The beginning
- 10 Working with large 2D/3D data sets
- 11 Curves and surfaces: Geometric modeling
- 12 Basics of animation
- 13 Lighting models
- 14 Advanced OpenGL
- 15 GPU image processing
- 16 Special effects in OpenGL
- 17 Basics of GPGPU
- 18 Elements of procedural texturing and modeling
- 19 Non-Photorealistic Rendering (NPR)
- Index