[Lecture 2 - Basic Computer Graphics]
Ok so we have reached the SECOND lecture. Since it is the SECOND lecture, it should follow a FIRST, therefore a recap for those who weren't listening in the FIRST lecture.
Recap
was in the lecture. xD
We start off the lecture looking at what seems to be a black and white chess board. Above the board was a terrifying statement - "The square marked 'A' and 'B' are the same shade of Grey". What in the world could this mean?! A is obviously black and B is obviously white with a shadow over it making it darker!
Now calm down, we are educated people, let's not get too worked up over something that SEEMS ridiculous. In the next slide, the truth was revealed, that both of them ARE the same, it was just the lighting that made them look different. This is Perception of Color. Next we see the electromagnetic spectrum...O levels...
Anyway, now for something cool.
[Trichromatic Theory of Color Vision]
Each of our eyes contain Rods and Cones, cool eh? We are able to see color because of these rods and cones in our eyes. Rods govern brightness while Cones govern color. There are 3 different types of Cones, which are Red, Green & Blue. Since Cones govern color, people who are color blind to red colors are probably missing the Red Cone, likewise for the others. Also since Rods govern brightness, I suppose having missing Rods have something to do with going blind.
Next we have a CIE Chromaticity Diagram.
- It covers the WHOLE color spectrum. WOW.
- Used as basis to define supported color range.
And then, something to jeer at that Diagram. The RGB Color Model!
- It was introduced because CIE primaries are difficult to work with.
- It is also called the Additive Color Model.
Now something important about describing colors!
Terms that describe Color :
HSB( Hue , Saturation , Brightness)
Hue is basically......the color!
Saturation is how VIBRANT the color is!E.g.LightBlue is more saturated than DarkBlue
Brightness is how BRIGHT the color is!(obviously)E.g. White is brightest!
[To test out how Saturation works by yourself, Open Paint, Go to Colors > Edit Colors > Define Custom Colors and then pick a color and play around with the Sat value.
Example : I picked Yellow with a Sat of 240. When I changed it to 200, it turned into a darker Yellow, like as if it had a transparent grey sheet over it. When I changed it to 100, it became grey.]
Now...Raster Devices!
-Equipments that have a display surface on which an image is presented.
E.g Monitors, Printers, Film Recorders.
[Display Surface on a Monitor]
Display Surface = no.of rows * no.of columns (basically your 1280*1024 resolution)
A 1280*1024 resolution can present 1280*1024*1 pixels simultaneously.
More on Raster Display, like the Frame Buffer, is seen in the lecture in pictures.
Ok next is something VERY IMPORTANT!!!!! Unless you don't care about SIZE.
[Precision of Color Representation]
The number of unique colors a pixel can represent depends on the number of bits per pixel, which in other words, the color depth.
Suppose I have a color depth of 8.
Each pixel of mine can represent up to 2^8 = 256 colors.
Color Look Up Table a.k.a CLUT
CLUT = Color Look Up Table or palette.
8bits.
Colors are looked up from a palette.
Tells which color to choose16 over million colors to be displayed.
Each pixel takes up 1 byte.
Then we did some calculations to help us understand this more.
Question 1 -I want my game to run at 800 x 600 on 32 bits. How much VRAM do I need?
Each pixel takes up 1 byte hence the resolution alone takes up 800*600 bytes.
As for the 32 bits. 32 bits means 4 colors. Each color is 8bits = 1byte. Hence a screen of 800*600 pixels where each pixel has 4 colors = 800*600*4 bytes.
Crazy Question
Question 2 -My artist are told they have a maximum of 32MB to use for textures. How many textures can they use if they are limit to 256 x 256, with a 24bits palette of 8bits color depth?
Firstly, let's calculate how much memory is available for use.
32 MB = 32*1024 KB = 32*1024*1024 bytes = 33554432 bytes
Secondly, let's calculate how many pixels and how much memory they would take up.
256*256 pixels = 256*256*1 bytes = 65536 bytes
Thirdly, let's calculate how much memory each texture's palette will take up.
bits per pixel = color depth
color depth = 8
Total no.of colors in 1 pixel = 2^color depth = 2^8 = 256 bytes
A 24 bits palette has R G and B hence, 256*3 = 768 bytes
Fourth, let's calculate how much memory each TEXTURE takes up in total.
65536 + 768 = 66304 bytes
Finally, let's calculate the total amount of TEXTURES that can be used.
33554432/66304 = 506.069 textures
Round up = 507 textures
Round down = 506 textures
Round off to nearest whole number = 506 textures
Hence approximately 506 textures can be used.
[Graphical File Format]
Some comparisons –
JPG --Does not store alphas.
TGA --Supports alpha.
GIF --Supports transparency, animation & 8 bits color depth.
Finally, the lecture ends with 2D Rendering and what it is.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment