![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcFiDoSHif1roGeeETF1NTqIcXCEf7ryyWupVr-LMxnBm_POeOH5uKHYJhy1lTHSRy03fGenZ-hkpfAolbr94K7bFP1PZfmAg4BXUbm_fb71meKKoCcmaSUJUrreyfJ4qxG_yuQw/s400/bla.jpg)
As the engine grows up, I refactor some routine. Cleaner code allows me to use some higher level function, like a 3Ds objects loader. And here appears a well-know issue:
z-fighting.Even on a surface closest to the light source, you will always discover minor differences in the values associated with the R texture coordinate(...). This can result in "surface acne"(...). You can mitigate this problem by applying a depth offset when rendering in the shadow map:
...
glEnable (GL_POLYGON_OFFSET_FILL);
glPolygonOffset (factor, 0.0f);
...
(...)A balance need to be struck when it comes to polygon offset usage.
from OpenGL superbible 4th edition by Richard Wright (Wesley).
That
balance is not so easy to achieve; as Nvidia says in its papers, it's really matter of
art.
No comments:
Post a Comment