{"id":11,"date":"2007-08-10T23:02:22","date_gmt":"2007-08-10T21:02:22","guid":{"rendered":"http:\/\/blogs.igalia.com\/apinheiro\/2007\/08\/10\/reviving-glsl\/"},"modified":"2007-08-10T23:02:22","modified_gmt":"2007-08-10T21:02:22","slug":"reviving-glsl","status":"publish","type":"post","link":"https:\/\/blogs.igalia.com\/apinheiro\/2007\/08\/reviving-glsl\/","title":{"rendered":"Reviving GLSL"},"content":{"rendered":"<p>The other day, looking at <a href=\"planet.gnome.org\">planet Gnome<\/a>, I found one more interesting that the others. This was writen by <a href=\"http:\/\/www.mdk.org.pl\">MDK<\/a>, and its titled <a href=\"http:\/\/www.mdk.org.pl\/articles\/2007\/08\/06\/vector-drawing-opengl-shaders-and-cairo\">Vector drawing: OpenGL shaders and cairo<\/a>.<\/p>\n<p>This post continues, in some way, a post written by <a href=\"http:\/\/blogs.gnome.org\/timj\/2007\/07\/17\/17072007-opengl-for-gdkgtk\/\">Tim Janick on his blog<\/a>, about OpenGL for Gdk\/Gtk+, that summarizes some of problems about using OpenGL with Gdk\/Gtk+.<\/p>\n<p>MDK made some tests to compare one an another, I had a little curiosity and check the code. The shader version was written in Cg, and as there are a lot of time that I doesn&#8217;t write nothing related to shaders, I decided to waste the little free time I have making the GLSL version of this test this afternoon. <\/p>\n<p>I same the sames tests, except by environment:<\/p>\n<ul>\n<li>AMD 1800+ 784MB RAM <\/li>\n<li>Geforce 5900FX 128 MB RAM <\/li>\n<li> <a target=\"_blank\" title=\"source code\" href=\"http:\/\/people.igalia.com\/apinheiro\/files\/bezier_modified.tar.gz\">modified source code<\/a>  (you&#8217;ll dont require Cg Toolkit, instead you&#8217;ll require <a href=\"http:\/\/glew.sourceforge.net\/\">Glew<\/a>) <\/li>\n<\/ul>\n<p>And the visual results:<\/p>\n<p><a href=\"http:\/\/people.igalia.com\/apinheiro\/files\/bezier-cairo.png\"><br \/>\n <img decoding=\"async\" src=\"http:\/\/people.igalia.com\/apinheiro\/files\/bezier-cairo-thumb.png\" alt=\"Cairo bezier\" \/><\/a><\/p>\n<p>\n<a href=\"http:\/\/people.igalia.com\/apinheiro\/files\/bezier-cg.png\"><br \/>\n <img decoding=\"async\" src=\"http:\/\/people.igalia.com\/apinheiro\/files\/bezier-cg-thumb.png\" alt=\"Cg bezier\" \/><\/p>\n<p><\/a><a href=\"http:\/\/people.igalia.com\/apinheiro\/files\/bezier-GLSL.png\"> <img decoding=\"async\" src=\"http:\/\/people.igalia.com\/apinheiro\/files\/bezier-GLSL-thumb.png\" alt=\"GLSL bezier\" \/><\/a>  <\/p>\n<p>But the most curious was about the times (sorry, not chart this time);<\/p>\n<ul>\n<li><strong>cairo:<\/strong> 0,18494 s<\/li>\n<li><strong>cg: <\/strong>  0.01927 s<\/li>\n<li><strong>GLSL:<\/strong> 0.00155 s<\/li>\n<\/ul>\n<p>GLSL better than cg? I suppose that this is the easy answer but:<\/p>\n<ul>\n<li> First at all: its too much difference, it has no sense<\/li>\n<li> AFAIK GLSL driver compiler its almost the Cg compiler (they use a <a href=\"http:\/\/developer.download.nvidia.com\/opengl\/glsl\/glsl_release_notes.pdf\">Unified Arquitecture<\/a>), you only need to see the extension EXT_Cg_Shader (use Cg code to define a shader object)\n<li> OpenGL works asynchronously<\/li>\n<li> The profile: Cg implementation uses a concrete profile (CG_PROFILE_ARBVP1), GLSL hasn&#8217;t got this concept, it tries allways to search the bext vertex\/fragment program extension to use.<\/li>\n<li> So: the time of only draw some curves its not a accurate  (we knowed it before) measure, it is only a guide\n<\/ul>\n<p>Conclusion: it is good to revive some time GLSL, I need to do this more often, thanks to MDK to give us some code to play !<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The other day, looking at planet Gnome, I found one more interesting that the others. This was writen by MDK, and its titled Vector drawing: OpenGL shaders and cairo. This post continues, in some way, a post written by Tim Janick on his blog, about OpenGL for Gdk\/Gtk+, that summarizes some of problems about using &hellip; <a href=\"https:\/\/blogs.igalia.com\/apinheiro\/2007\/08\/reviving-glsl\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Reviving GLSL&#8221;<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,13,15],"tags":[],"class_list":["post-11","post","type-post","status-publish","format-standard","hentry","category-gnome","category-igalia","category-opengl"],"_links":{"self":[{"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/posts\/11","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":0,"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/posts\/11\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/media?parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/categories?post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.igalia.com\/apinheiro\/wp-json\/wp\/v2\/tags?post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}