tag:blogger.com,1999:blog-19727408.post115886217756822307..comments2016-07-20T09:43:51.417-04:00Comments on X-Plane Scenery Blog: The road to hell is paved with ATTR_poly_osBenjamin Supnikhttp://www.blogger.com/profile/04886313844644521178noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-19727408.post-1159679610853332472006-10-01T01:13:00.000-04:002006-10-01T01:13:00.000-04:00Two problems with offsetting the ground -1 or -2:T...Two problems with offsetting the ground -1 or -2:<BR/><BR/>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.<BR/><BR/>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.<BR/><BR/>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.<BR/><BR/>(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.)Benjamin Supnikhttps://www.blogger.com/profile/04886313844644521178noreply@blogger.comtag:blogger.com,1999:blog-19727408.post-1159675414761094152006-10-01T00:03:00.000-04:002006-10-01T00:03:00.000-04:00It seems like your offsetting a lot of objects (ru...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?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-19727408.post-1159145756311255952006-09-24T20:55:00.000-04:002006-09-24T20:55:00.000-04:00I know the math you speak of. It is evil. Woe to t...I know the math you speak of. It is evil. Woe to those who have to deal with hardware accellerated floating point rounding errors.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-19727408.post-1158862314636348452006-09-21T14:11:00.000-04:002006-09-21T14:11:00.000-04:00That was one helluwa long post - but great! :) Tha...That was one helluwa long post - but great! :) Thank you.Anonymousnoreply@blogger.com