{"id":1722,"date":"2014-12-11T21:10:00","date_gmt":"2014-12-11T21:10:00","guid":{"rendered":"http:\/\/www.spellcasterstudios.com\/?p=1722"},"modified":"2014-11-29T19:21:32","modified_gmt":"2014-11-29T19:21:32","slug":"vbo-and-alpha","status":"publish","type":"post","link":"https:\/\/www.spellcasterstudios.com\/?p=1722","title":{"rendered":"VBO and Alpha"},"content":{"rendered":"<p align=\"justify\">Spent sometime today working with interleaved VBOs and indexed primitives in OpenGL\u2026 <\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2014\/11\/screen335.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen335\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen335\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2014\/11\/screen335_thumb.jpg\" width=\"830\" height=\"486\" \/><\/a><\/p>\n<p align=\"justify\">The way OpenGL seems to handle the VBOs is weird for me\u2026 <\/p>\n<p align=\"justify\">For example, in D3D, I can say when I create a vertex buffer that I don\u2019t care about the actual contents of the data I\u2019m loading\u2026 That means I can write to a VB, render it, and while the GPU is busy rendering it, lock it again and fill it with some more data and ask it to re-render.<\/p>\n<p align=\"justify\">In OpenGL, this seems to cause a pipeline stall\u2026 I understand why it happens and how D3D avoids it (because there\u2019s an abstraction layer between the actual VB in VRAM and the data I\u2019m using), but it seems more \u201cexplicit\u201d in D3D (although it actually isn\u2019t)\u2026<\/p>\n<p align=\"justify\">This means that my abstraction is in the wrong place for the porting, which sucks big time! <img decoding=\"async\" class=\"wlEmoticon wlEmoticon-sadsmile\" style=\"border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none\" alt=\"Sad smile\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2014\/11\/wlEmoticon-sadsmile.png\" \/> I always assumed that OpenGL would treat VBOs in the same way\u2026<\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2014\/11\/screen336.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen336\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen336\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2014\/11\/screen336_thumb.jpg\" width=\"830\" height=\"487\" \/><\/a><\/p>\n<p>On the bright side, alpha-blending works exactly as I expected it to, which is great! <img decoding=\"async\" class=\"wlEmoticon wlEmoticon-smile\" style=\"border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none\" alt=\"Smile\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2014\/11\/wlEmoticon-smile15.png\" \/><\/p>\n<p>Also looked at some tutorials on render to texture, but I\u2019ll implement directly on my system, since it requires a lot of boilerplate that I don\u2019t want to do on my sample application!<\/p>\n<p>Next step is to load a HLSL shader into OpenGL (using hlsl2glsl, if all goes well), and see how well that behaves\u2026 I dislike the syntax of GLSL (the declaration part), so writing shaders in HLSL would be great!<\/p>\n<p><em>Now listening to \u201cBlade OST\u201d<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Spent sometime today working with interleaved VBOs and indexed primitives in OpenGL\u2026 The way OpenGL seems to handle the VBOs is weird for me\u2026 For example, in D3D, I can say when I create a vertex buffer that I don\u2019t care about the actual contents of the data I\u2019m loading\u2026 That means I can write [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,147,8],"tags":[245],"class_list":["post-1722","post","type-post","status-publish","format-standard","hentry","category-development","category-chrome-hunter","category-technology","tag-opengl"],"_links":{"self":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/1722","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1722"}],"version-history":[{"count":1,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/1722\/revisions"}],"predecessor-version":[{"id":1723,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/1722\/revisions\/1723"}],"wp:attachment":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1722"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1722"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1722"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}