Computer Graphics or CG deals with making drawings and animations on the web, often interactive such as in games. This article will give you a brief introduction into the techniques involved and link you to useful resources.
CG can be broadly divided into two categories:
Good examples are your computer or mobile screen that you are using to read this. The science of Computer Graphics at some point in history has evolved techniques such that it can load a sequence of images on your screen really fast, and allow you to interact with it. It is worthy to keep in mind that each pixel is denoted by 3 floating point numbers (RGB), which means 12 bytes of data every pixel, and if you have a screen with a 1280x720 resolution, as most laptops today do, you have 12x1280x720 bytes of data every frame. A usual GUI rendering is 60 fps, which means your computer or mobile device is processing 12x60x1280x720 = 620 MB of data every second, just to display you the output. Does that amaze you?
Games are another example of real-time computer graphics. They involve further processing, as they have to calculate the effect of all the player-environment-AI interaction.
Even though it seems that real-time graphics require loads of processing, rendered graphics such as in advertisement or news animations, animated movies, and CGI in movies break records of computing hours used every year. Dreamworks invented the term Shrek's law to refer to the fact that despite an increase in computing power, each Shrek movie has taken twice as much time to render as the previous one. To quote some figures from the Wikipedia article,
In 2001, Shrek required approximately 5 million CPU render hours. In 2004, Shrek 2 required over 10 million CPU render hours. In 2007, Shrek the Third required over 20 million CPU render hours, and the 2010 3D release of Shrek Forever After demanded more than 50 million CPU render hours on account of rendering double amount of frames. Puss in Boots, which was released only one year after the previous Shrek film, utilized 63 million render hours.
Now how do you get started with learning how to make those cool animations, and video games involving good graphics?
There are more than one libraries available in multiple languages and platforms that help you start. As you start to understand the field better, you'll realize that Computer Graphics is more about the concepts, which all frameworks will follow. But to begin with, we'd recommend you code in C using a library known as OpenGL.
- OGL Dev - These are a series of tutorials which will drive you through various aspects of graphics programming, ranging from basic to advanced.
There is however another component involved to making good graphics, your artistic and aesthetic sense. You can often achieve a lot using limited tools if you are creative on how you use them. A decent example is the following image. This image has been drawn using a program which could only draw lines and triangles, in whichever colour you desire, but it still achieves a good amount of details like shadows and reflections.