{"id":597,"date":"2013-02-28T11:29:14","date_gmt":"2013-02-28T11:29:14","guid":{"rendered":"http:\/\/lousodrome.net\/blog\/light\/?p=597"},"modified":"2013-02-28T11:29:14","modified_gmt":"2013-02-28T11:29:14","slug":"simple-fragment-shader-based-wireframe-display","status":"publish","type":"post","link":"https:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/","title":{"rendered":"Simple fragment shader based wireframe display"},"content":{"rendered":"<p>On his blog, Florian Boesch introduces to a clever <a href=\"http:\/\/codeflow.org\/entries\/2012\/aug\/02\/easy-wireframe-display-with-barycentric-coordinates\/\">technique to render wireframe polygons<\/a> using fragment shading, along with\u00a0a <a href=\"http:\/\/codeflow.org\/webgl\/barycentric-wireframe\/www\/\">live demo<\/a>. The <a href=\"http:\/\/cgg-journal.com\/2008-2\/06\/index.html\">full explanation is presented in this paper<\/a>. For convex polygons, just add as an attribute (or compute in the geometry shader?) the distance between the vertex and the other edges, and use the minimum distance in the fragment shader. Simple, easy to implement, and a nice anti-aliased result. (the paper also presents a second technique for non-convex polygons).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On his blog, Florian Boesch introduces to a clever technique to render wireframe polygons using fragment shading, along with\u00a0a live demo. The full explanation is presented in this paper. For convex polygons, just add as an attribute (or compute in &hellip; <a href=\"https:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17],"tags":[253,338,337,339,340,335,341,336],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.13 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Simple fragment shader based wireframe display &ndash; Light is beautiful<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Simple fragment shader based wireframe display &ndash; Light is beautiful\" \/>\n<meta property=\"og:description\" content=\"On his blog, Florian Boesch introduces to a clever technique to render wireframe polygons using fragment shading, along with\u00a0a live demo. The full explanation is presented in this paper. For convex polygons, just add as an attribute (or compute in &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/\" \/>\n<meta property=\"og:site_name\" content=\"Light is beautiful\" \/>\n<meta property=\"article:published_time\" content=\"2013-02-28T11:29:14+00:00\" \/>\n<meta name=\"author\" content=\"Julien Guertault\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Zavie\" \/>\n<meta name=\"twitter:site\" content=\"@Zavie\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Julien Guertault\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/\"},\"author\":{\"name\":\"Julien Guertault\",\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f\"},\"headline\":\"Simple fragment shader based wireframe display\",\"datePublished\":\"2013-02-28T11:29:14+00:00\",\"dateModified\":\"2013-02-28T11:29:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/\"},\"wordCount\":87,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f\"},\"keywords\":[\"anti-aliasing\",\"barycentric coordinates\",\"edge\",\"fragment shader\",\"geometry shader\",\"trick\",\"vertex attribute\",\"wireframe\"],\"articleSection\":[\"Rendering\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/\",\"url\":\"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/\",\"name\":\"Simple fragment shader based wireframe display &ndash; Light is beautiful\",\"isPartOf\":{\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#website\"},\"datePublished\":\"2013-02-28T11:29:14+00:00\",\"dateModified\":\"2013-02-28T11:29:14+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/lousodrome.net\/blog\/light\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Simple fragment shader based wireframe display\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#website\",\"url\":\"https:\/\/lousodrome.net\/blog\/light\/\",\"name\":\"Light is beautiful\",\"description\":\"Thoughts of a graphics programmer, demoscener and spare time photographer\",\"publisher\":{\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/lousodrome.net\/blog\/light\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f\",\"name\":\"Julien Guertault\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2e5fc7a18e1701e1bb61a5da0ef35cf7?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2e5fc7a18e1701e1bb61a5da0ef35cf7?s=96&d=identicon&r=g\",\"caption\":\"Julien Guertault\"},\"logo\":{\"@id\":\"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/lousodrome.net\/blog\/light\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Simple fragment shader based wireframe display &ndash; Light is beautiful","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/","og_locale":"en_US","og_type":"article","og_title":"Simple fragment shader based wireframe display &ndash; Light is beautiful","og_description":"On his blog, Florian Boesch introduces to a clever technique to render wireframe polygons using fragment shading, along with\u00a0a live demo. The full explanation is presented in this paper. For convex polygons, just add as an attribute (or compute in &hellip; Continue reading &rarr;","og_url":"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/","og_site_name":"Light is beautiful","article_published_time":"2013-02-28T11:29:14+00:00","author":"Julien Guertault","twitter_card":"summary_large_image","twitter_creator":"@Zavie","twitter_site":"@Zavie","twitter_misc":{"Written by":"Julien Guertault"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/#article","isPartOf":{"@id":"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/"},"author":{"name":"Julien Guertault","@id":"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f"},"headline":"Simple fragment shader based wireframe display","datePublished":"2013-02-28T11:29:14+00:00","dateModified":"2013-02-28T11:29:14+00:00","mainEntityOfPage":{"@id":"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/"},"wordCount":87,"commentCount":0,"publisher":{"@id":"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f"},"keywords":["anti-aliasing","barycentric coordinates","edge","fragment shader","geometry shader","trick","vertex attribute","wireframe"],"articleSection":["Rendering"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/","url":"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/","name":"Simple fragment shader based wireframe display &ndash; Light is beautiful","isPartOf":{"@id":"https:\/\/lousodrome.net\/blog\/light\/#website"},"datePublished":"2013-02-28T11:29:14+00:00","dateModified":"2013-02-28T11:29:14+00:00","breadcrumb":{"@id":"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/lousodrome.net\/blog\/light\/2013\/02\/28\/simple-fragment-shader-based-wireframe-display\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/lousodrome.net\/blog\/light\/"},{"@type":"ListItem","position":2,"name":"Simple fragment shader based wireframe display"}]},{"@type":"WebSite","@id":"https:\/\/lousodrome.net\/blog\/light\/#website","url":"https:\/\/lousodrome.net\/blog\/light\/","name":"Light is beautiful","description":"Thoughts of a graphics programmer, demoscener and spare time photographer","publisher":{"@id":"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lousodrome.net\/blog\/light\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/a16a2a69d73eca763ffdf125c49eaa2f","name":"Julien Guertault","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2e5fc7a18e1701e1bb61a5da0ef35cf7?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2e5fc7a18e1701e1bb61a5da0ef35cf7?s=96&d=identicon&r=g","caption":"Julien Guertault"},"logo":{"@id":"https:\/\/lousodrome.net\/blog\/light\/#\/schema\/person\/image\/"},"url":"https:\/\/lousodrome.net\/blog\/light\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/posts\/597"}],"collection":[{"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/comments?post=597"}],"version-history":[{"count":0,"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/posts\/597\/revisions"}],"wp:attachment":[{"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/media?parent=597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/categories?post=597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lousodrome.net\/blog\/light\/wp-json\/wp\/v2\/tags?post=597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}