{"id":209,"date":"2009-03-15T14:21:44","date_gmt":"2009-03-15T14:21:44","guid":{"rendered":"http:\/\/positech.co.uk\/cliffsblog\/?p=209"},"modified":"2009-03-15T14:21:44","modified_gmt":"2009-03-15T14:21:44","slug":"gratuitous-debris","status":"publish","type":"post","link":"https:\/\/www.positech.co.uk\/cliffsblog\/2009\/03\/15\/gratuitous-debris\/","title":{"rendered":"Gratuitous Debris"},"content":{"rendered":"<p>I got the wobbly cloak + damage textures stuff working in the end. I used a separate render target. Basically whenever a ship is cloaking it uses a separate texture to composite its damage and hull together, then renders from that. I&#8217;m not sure how slow SetRenderTarget() is, so I&#8217;m avoiding using it all the time.<br \/>\nToday I redid all the damage textures. I used a picture of an oil refinery at night, color-adjusted and light intensified, and use that to &#8216;paint&#8217; sparks in gaps in the damaged ships hulls.<br \/>\nI also added debris. I cut out some parts of the ship, and scattered some of the damage texture magic on them:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/www.positech.co.uk\/blog\/march15th2.jpg\" alt=\"\" \/><\/p>\n<p>I then emit some spinning bits of debris when a ship is hit or destroyed. The debris is all one texture and drawn collectively (on top of all the ships) so it&#8217;s a single vertex-buffered draw call and shouldn&#8217;t be too slow. I&#8217;m certainly getting awesome frame rates, even with tons of smoke trails, explosions, spaceships, debris and laser effects:<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" class=\"aligncenter\" src=\"http:\/\/www.positech.co.uk\/blog\/march15th.jpg\" alt=\"\" \/><\/p>\n<p>Tomorrow I&#8217;ll be doing some more of the AI behaviours for the ships.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I got the wobbly cloak + damage textures stuff working in the end. I used a separate render target. Basically whenever a ship is cloaking it uses a separate texture to composite its damage and hull together, then renders from that. I&#8217;m not sure how slow SetRenderTarget() is, so I&#8217;m avoiding using it all the<\/p>\n<p class=\"text-right\"><span class=\"screen-reader-text\">Continue Reading&#8230; Gratuitous Debris<\/span><a class=\"btn btn-secondary continue-reading\" href=\"https:\/\/www.positech.co.uk\/cliffsblog\/2009\/03\/15\/gratuitous-debris\/\">Continue Reading&#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105,4],"tags":[],"class_list":["post-209","post","type-post","status-publish","format-standard","hentry","category-gratuitous-space-battles","category-programming"],"_links":{"self":[{"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/comments?post=209"}],"version-history":[{"count":0,"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/posts\/209\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/media?parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/categories?post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/tags?post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}