what does a graphics card actually do

Member
Posts: 749
Joined: 2003.01
Post: #1
I was wondering what was actually the purpouse of a graphics card, and also have other questions on graphics in general.

From what I understand, every frame, the backbuffer pixmap is copied onto the screen. Every pixel is defined by the rgb components. For instance, when I "clearscreen", then there is some code that does

for every pixel in the backbuffer
pixel color=[0,0,0]
next

(is this what it actually does?)

And to draw a circle, it probably restricts the set of points it checks to a small square that contains it, and then checks that the distance of a point from the center is less than r, and if so it changes it's color.

(is this correct?)

I think I understood the basic pixel operations for transparency and lighting.

What I was wondering is what does the graphic card actually help for?
Is it optimized to work with the rgb vectors fast?
Most operations are math operations that should be one easily by the CPU?
What about scaling?
Does the graphics card also help to copy the backbuffer onto the screen faster?

Links also appreciated ("for dummies" stuff plz)

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Moderator
Posts: 529
Joined: 2003.03
Post: #2
Najdorf Wrote:And to draw a circle, it probably restricts the set of points it checks to a small square that contains it, and then checks that the distance of a point from the center is less than r, and if so it changes it's color.

(is this correct?)

It probably uses Bressenham's(sp?) circle algorithm which I think (don't quote me) calculates 1 quadrant of the circle then mirrors it 3 x.

"Yes, well, that's the sort of blinkered, Philistine pig-ignorance I've come to expect from you non-creative garbage."
Quote this message in a reply
Oldtimer
Posts: 834
Joined: 2002.09
Post: #3
Actually, a modern graphics card does a lot of things.
Let's start at the very base: it keeps the framebuffer in its own little RAM (Video RAM, VRAM), so that is essentially the RGB pixels you're talking about. When the monitor wants to display something, it grabs all those pixels and throws them onscreen.

So, that's the basics. However, nowadays graphic cards are accelerator cards, which means they kick ass when it comes to drawing. I'll use OpenGL as an example, because that's what you should use, but DirectX does the same thing. (Note that this is extremely simplified, but it is what happens) The programmer sends drawing commands (like: these are the three corners of a triangle, draw it in blue) to the OpenGL library, which passes them on to the driver, which passes it on to the graphics card. The graphics card takes these drawing commands, and performs them, i.e. drawing them onto its own VRAM.

So, yes, a graphics card does contain all the frame buffers and stuff, but also is responsible for doing the actual drawing, and a lot of other cool things.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #4
Ahhhh, I thought so but didnt want to say incase I was wrong.
Is fillrate the amount of pixels you draw each frame, regardless of overlapping?
or in fact just what is fillrate?

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Member
Posts: 198
Joined: 2005.01
Post: #5
Many modern graphics cards also take care of some geometry and lighting processing on-board. I'm not sure how much of that goes on in the Mac side of things, but I know it's used pretty extensively in high-end PC games.

In addition to simple drawing commands like placing points to make triangles, the "filling" also involves texture mapping, perspective correction (for actual 3D usage), Z-buffering (to avoid overlap), and on newer cards, shader fragments (programs that run on the video card to affect texture mapping).

Then you have newer cards that have half a gig of VRAM and dual processors, etc...

Many video cards these days are more complex and do more processing than the CPU they're attached to Smile

Cryptic Allusion Games / Cryptic Allusion, LLC
http://www.cagames.com/
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #6
unknown Wrote:Ahhhh, I thought so but didnt want to say incase I was wrong.
Is fillrate the amount of pixels you draw each frame, regardless of overlapping?
or in fact just what is fillrate?

Fill rate is the amount of pixels you are drawing including overlap. You can reduce the amount of fill rate you are using by using the four tests: Scissor, Alpha, Stencil, Depth. A fragment is not drawn only if eliminated by one of these (potential or partial pixel) can be eliminated by one of these.

Back to the main question though. The modern video card is pretty much a computer that is only good at working with math used in graphics. Working with colors, and transforming vertexes, etc. It does other things too, like holding and clearing the framebuffer for the screen, video cards have always at least done this.
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #7
That im sure will be very useful for me in the future for speeding up 3d graphics. thanks.

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
Member
Posts: 749
Joined: 2003.01
Post: #8
Thx for the neat answers.

©h€ck øut µy stuƒƒ åt ragdollsoft.com
New game in development Rubber Ninjas - Mac Games Downloads
Quote this message in a reply
Post Reply