Merge pull request #369 from Narcha/patch-1

Grammar fixes
pull/372/head
sotrh 2 years ago committed by GitHub
commit 35297142d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,11 +10,11 @@ There are two ways to solve this: sort the data from back to front, or use what'
## Sorting from back to front
This is the go-to method for 2d rendering as it's pretty easier to know what's supposed to go in front of what. You can just use the z order. In 3d rendering, it gets a little more tricky because the order of the objects changes based on the camera angle.
This is the go-to method for 2d rendering as it's pretty easy to know what's supposed to go in front of what. You can just use the z order. In 3d rendering, it gets a little trickier because the order of the objects changes based on the camera angle.
A simple way of doing this is to sort all the objects by their distance to the camera's position. There are flaws with this method though as when a large object is behind a small object, parts of the large object that should be in front of the small object will be rendered behind. We'll also run into issues with objects that overlap *themselves*.
A simple way of doing this is to sort all the objects by their distance to the camera's position. There are flaws with this method though as when a large object is behind a small object, parts of the large object that should be in front of the small object will be rendered behind it. We'll also run into issues with objects that overlap *themselves*.
If want to do this properly we need to have pixel-level precision. That's where a *depth buffer* comes in.
If we want to do this properly we need to have pixel-level precision. That's where a *depth buffer* comes in.
## A pixels depth

Loading…
Cancel
Save