Skip to content

Commit

Permalink
Merge pull request #10 from BioGeek/patch-1
Browse files Browse the repository at this point in the history
Fix typo
  • Loading branch information
kcconch authored Nov 11, 2023
2 parents e65816e + 0214b61 commit 4d00175
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/what-are-shaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ What you have been doing until now when you are drawing shapes in [**function dr
The CPU works by doing every calculation - every move of a pixel or shape you have been drawing until now - in sequence. If you look really closely at your screen you will see every tiny pixel it is made up of. When you are drawing using the CPU, the computer has to make each operation you tell it to do (for instance draw the color red, or increase the brightness), one pixel at a time. Think about it, one pixel at a time! If your screen is 2,560×1,600 pixels, that's 4,096,000 operations per frame. At 60 frames per second that's 245,760,000 operations per second. If your screen is 4k, double that number.
This is fine for basic programs, but you might have noticed, that the more complex your drawings become, the slower the whole program runs.

In contrast your GPU (Graphics Processing Unit) is capable of something called parallel processing by using shaders. This means that everything you draw in your sketch by using a shader is drawn all at once, all 4.000.096 operations! Therefor shaders are an incredible optimized way of making more complex drawings, without slowing your sketch down.
In contrast your GPU (Graphics Processing Unit) is capable of something called parallel processing by using shaders. This means that everything you draw in your sketch by using a shader is drawn all at once, all 4.096.000 operations! Therefor shaders are an incredible optimized way of making more complex drawings, without slowing your sketch down.

To understand what a shader does, imagine the CPU as a single pipe, where all of the pixels on your canvas must pass through, one at a time, to be told what color they should have. The GPU still handles the actual coloring, but the CPU handles all of the calculations. Now imagine instead, that each pixel has its own pipe, and we could just calculate and tell every pixels on your canvas what color it should have in parallel (at the same time). That is what a shader does.

Expand Down

0 comments on commit 4d00175

Please sign in to comment.