Comments on: The road to hell is paved with ATTR_poly_os https:/2006/09/the-road-to-hell-is-paved-with-attr_poly_os/ Developer resources for the X-Plane flight simulator Tue, 01 Feb 2011 00:31:07 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: Benjamin Supnik https:/2006/09/the-road-to-hell-is-paved-with-attr_poly_os/#comment-1465 Sun, 01 Oct 2006 01:13:00 +0000 http://www.x-plane.com/dev_blog/?p=546#comment-1465 Two problems with offsetting the ground -1 or -2:

The actual effect of the offset is a function of the geometry of the particular triangle – it’s not uniform. So the relative depth placement of different triangles with the same non-zero offset is not correct. Only the relative depth of the same triangle with different offsets is predictable.

This brings us to the second issue: you never really want to write non-zero offsets back to the framebuffer, because they aren’t consistent across multiple triangles.

So the real issue with roads is not that polygon offset produces artifacts, but that we can’t both test against an offset value _and_ write back the original value. If we could do this, we could solve the road problem perfectly.

(Pixel shader? I’m not sure yet…when I last tried to write Z-buffer values with a pixel shader I hit a bunch of weird behavior that I haven’t had time to investigate.)

]]>
By: Anonymous https:/2006/09/the-road-to-hell-is-paved-with-attr_poly_os/#comment-1466 Sun, 01 Oct 2006 00:03:00 +0000 http://www.x-plane.com/dev_blog/?p=546#comment-1466 It seems like your offsetting a lot of objects (runways, roads, bridges, airport scenery). I guess you can’t just offset the ground by -1 or -2, eh?

]]>
By: StrmRnr https:/2006/09/the-road-to-hell-is-paved-with-attr_poly_os/#comment-1467 Sun, 24 Sep 2006 20:55:00 +0000 http://www.x-plane.com/dev_blog/?p=546#comment-1467 I know the math you speak of. It is evil. Woe to those who have to deal with hardware accellerated floating point rounding errors.

]]>
By: Anonymous https:/2006/09/the-road-to-hell-is-paved-with-attr_poly_os/#comment-1468 Thu, 21 Sep 2006 14:11:00 +0000 http://www.x-plane.com/dev_blog/?p=546#comment-1468 That was one helluwa long post – but great! 🙂 Thank you.

]]>