{"id":2059,"date":"2015-02-07T16:45:00","date_gmt":"2015-02-07T16:45:00","guid":{"rendered":"http:\/\/www.spellcasterstudios.com\/?p=2059"},"modified":"2015-02-03T16:50:22","modified_gmt":"2015-02-03T16:50:22","slug":"refactoring-the-rendering","status":"publish","type":"post","link":"https:\/\/www.spellcasterstudios.com\/?p=2059","title":{"rendered":"Refactoring the rendering&hellip;"},"content":{"rendered":"<p align=\"justify\">Yep, that\u2019s what I\u2019m doing\u2026 It will be a bit painful and I\u2019ll get a lot of bugs in the process, but I think it\u2019s the best thing at this moment\u2026<\/p>\n<p align=\"justify\">Currently, the rendering is working in a per-pass\/per-object basis\u2026<\/p>\n<p align=\"justify\">So, first we get the solid pass, iterate objects, render all of them (and they will check if they should be render in the current pass), then go to the alpha pass, etc, etc\u2026<\/p>\n<p align=\"justify\">What I want to do is a \u201cobject pre-pass\u201d\u2026 So I gather all the objects\/meshes\/render elements in a single array, with some metadata on their usage, conditions and rules (I don\u2019t want lighting on this object, I don\u2019t want to do decals on this one, etc), and then on the render pass I\u2019ll iterate this array and should be drawn or not, rendering as intended\u2026<\/p>\n<p align=\"justify\">The idea on this is to save some CPU power (not much, I expect), but mainly so I can organize the render data according to my criteria, for example, to sort alpha objects back to front, and solid objects front to back, to exclude dynamic objects from decal rendering, draw these special effect objects after the decals are done, exclude objects from the depth\/normal stage, etc\u2026<\/p>\n<p align=\"justify\">It\u2019s going to be a lot of work, but in the long run it will be fairly positive!<\/p>\n<p align=\"justify\"><em>Now listening to \u201cSunset of the Golden Age\u201d by Alestorm<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yep, that\u2019s what I\u2019m doing\u2026 It will be a bit painful and I\u2019ll get a lot of bugs in the process, but I think it\u2019s the best thing at this moment\u2026 Currently, the rendering is working in a per-pass\/per-object basis\u2026 So, first we get the solid pass, iterate objects, render all of them (and they [&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":[108],"class_list":["post-2059","post","type-post","status-publish","format-standard","hentry","category-development","category-chrome-hunter","category-technology","tag-refactor"],"_links":{"self":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/2059","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=2059"}],"version-history":[{"count":1,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/2059\/revisions"}],"predecessor-version":[{"id":2060,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/2059\/revisions\/2060"}],"wp:attachment":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}