tag:blogger.com,1999:blog-8648559575280961442.post1736398767827896343..comments2024-03-04T02:44:24.197-08:00Comments on Clipping Space: Single-Pass Wireframe Renderingstrattonbrazilhttp://www.blogger.com/profile/00840168161538775436noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-8648559575280961442.post-45471376161880278482018-07-15T06:44:51.554-07:002018-07-15T06:44:51.554-07:00I know this is an old post, but I've been bash...I know this is an old post, but I've been bashing my head against this for a few days now, and thought someone might also need this. :)<br />If you the geometry shader above, you will end up with incorrect distance values in some cases, as you can see here: https://gamedev.stackexchange.com/questions/136915/geometry-shader-wireframe-not-rendering-correctly-glsl-opengl-c<br />This is because the transformation from world to screen space (vec2 p0 = WIN_SCALE * gl_PositionIn[0].xy/gl_PositionIn[0].w;) is wrong. You need to multiply by HALF of the size of your viewport, because (0;0) is in the middle. Technically to get screen coordinates you'd also have to add vec2(1,1) to them first and also translate them based on the viewport location, but in this case only the scale matters.Anonymoushttps://www.blogger.com/profile/04922708151668803338noreply@blogger.comtag:blogger.com,1999:blog-8648559575280961442.post-19638145265479567262015-04-14T03:35:44.824-07:002015-04-14T03:35:44.824-07:00Thank you!
I used this in my university assignment...Thank you!<br />I used this in my university assignment, and it works great!<br />https://www.dropbox.com/s/10j2q2l40xz4ctm/CessnaWireframe.png?dl=0Anonymoushttps://www.blogger.com/profile/18257040812805106637noreply@blogger.comtag:blogger.com,1999:blog-8648559575280961442.post-49773890932075895432013-10-28T18:16:03.637-07:002013-10-28T18:16:03.637-07:00This comment has been removed by the author.jodaghttps://www.blogger.com/profile/07589328674706776609noreply@blogger.com