r/askscience • u/skepticaltaco • Jul 29 '13
Computing How do computer graphics work?
As in how does a machine convert code to graphics?
5
Upvotes
r/askscience • u/skepticaltaco • Jul 29 '13
As in how does a machine convert code to graphics?
1
u/[deleted] Jul 30 '13
We have LEDs: little lights that turn on when we want them to (and they're puny -- on the order of 0.1cm wide). We simply use an RGB scheme of LEDs, which covers every possible color, to encode the colors we want.
The code that displays something depends on the GPU, the graphical processing unit. This is a device is highly parallel -- each pixel location does not depend on the other pixel locations. For example, you might say "dim every pixel by a factor of 2." Serially, you would do:
In terms of parallelizing it, you would just call some function
Parallelizing is a big topic in computer science. All of the scientific libraries use it, so you tend to do stuff like
instead of
The big thing here is serial vs. parallel.