How it works...
Depth bias is used to offset a depth value of a given fragment (or rather, all fragments generated from a given polygon). Commonly, it is used when we want to draw objects that are very near other objects; for example, pictures or posters on walls. Due to the nature of depth calculations, such objects may be incorrectly drawn (partially hidden) when viewed from a distance. This issue is known as depth-fighting or Z-fighting.
Depth bias modifies the calculated depth value--the value used during the depth test and stored in a depth attachment--but does not affect the rendered image in any way (that is, it does not increase the visible distance between the poster and the wall it is attached to). Modifications are performed based ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access