- Joined
- Feb 6, 2008
- Messages
- 37,671
- Reaction score
- 2,401
- Points
- 203
- Location
- Wolfsburg
- Preferred Pronouns
- Sire
So what determines when clipping occurs? I know the distance is 2 meters. But how does it know it is 2 meters away from the surface?
The settings for the Z-buffer in the graphics card, as defined by the graphics engine you use.
A Z-Buffer is simply a system, that counts for every pixel in the image, how far the closest polygon is in the projection of this pixel. If you draw a pixel of a polygon, that is closer than the previous, you over write the Z-buffer distance and paint the pixel. If not, the painting operation is skipped.
Since even a 32 bit Z-Buffer has only 4 billion possible values and many similar Z-buffer entries cause rendering glitches (as you can often see), you need to find a compromise between covering a large distance and having a high accuracy in the distance.
This is finetuned by defining a minimum and a maximum Z-distance for the projection to the Z-buffer. If you use 1 mm steps, you could only cover 4,000 km distance in the Z-buffer, and would still be pretty coarse for a VC. 0.001 mm would result in maximal 4 km visible in the Z-buffer (too small for orbit), but you would get very good quality nearby.
And often, you can only use 16-bit Z-Buffers, which make things MUCH harder.
http://en.wikipedia.org/wiki/Z-Buffer
http://en.wikipedia.org/wiki/Z-fighting
Last edited: