Pirracas
11-13-2007, 11:05 AM
I am implementing hidden line removal as explained in chapter 14 of the red book Hidden-Line Removal with Polygon Offset (http://www.glprogramming.com/red/chapter14.html#name16)
I have a moving camera. Initially it works fine, but when I move the camera so the object is closer to it, it starts to behave very strange, with even some polygons and lines start to dissapear or have artifacts (the near clipping plane is okay, because when I disable the polygon offset everything is alright).
Do you have an idea of what can be wrong?
Maybe it has to be with this comment at the end of the polygon offset chapter:
Also, since depth values are unevenly transformed into window coordinates when using perspective projection (see "The Transformed Depth Coordinate" in Chapter 3), less offset is needed for polygons that are closer to the near clipping plane, and more offset is needed for polygons that are further away.
but I don't know very well how to fix that.
I have a moving camera. Initially it works fine, but when I move the camera so the object is closer to it, it starts to behave very strange, with even some polygons and lines start to dissapear or have artifacts (the near clipping plane is okay, because when I disable the polygon offset everything is alright).
Do you have an idea of what can be wrong?
Maybe it has to be with this comment at the end of the polygon offset chapter:
Also, since depth values are unevenly transformed into window coordinates when using perspective projection (see "The Transformed Depth Coordinate" in Chapter 3), less offset is needed for polygons that are closer to the near clipping plane, and more offset is needed for polygons that are further away.
but I don't know very well how to fix that.