{"id":208,"date":"2009-03-13T11:11:06","date_gmt":"2009-03-13T11:11:06","guid":{"rendered":"http:\/\/positech.co.uk\/cliffsblog\/?p=208"},"modified":"2009-03-13T11:11:06","modified_gmt":"2009-03-13T11:11:06","slug":"graphics-problem","status":"publish","type":"post","link":"https:\/\/www.positech.co.uk\/cliffsblog\/2009\/03\/13\/graphics-problem\/","title":{"rendered":"Graphics problem"},"content":{"rendered":"<p>I&#8217;ve just encountered a bit of a dilemma.<\/p>\n<p>I have this wibbly wobbly &#8216;not a cloaking device&#8217; effect on the ships in GSB. The thing is, it wobbles the original ship sprite, and when I&#8217;m drawing ships, I&#8217;m also attaching some extra sprites for stuff like damage textures etc. Not to mention flashing lights etc.<\/p>\n<p>When the ship cloaks, this means all those extra sprites effectively disappear, which is very jarring, and breaks the sense of &#8216;realism&#8217; of it all. I&#8217;m not sure yet how to handle it. One idea would be to fade out all of those sprites over the few frames before the ship starts to wobble, so it&#8217;s less sudden, but that still makes no sense. Ideally, I would apply the exact same distortion to each sprite as I amd doing to the ship sprite, but that is problematic and complex (to put it mildly).<\/p>\n<p>I could just wobble them &#8216;out of synch&#8217; with the underlying sprite, but that would lead to some artifacts which would look crap. There is a video which i think shows it a bit below.<\/p>\n<p><object width=\"445\" height=\"364\"><param name=\"movie\" value=\"http:\/\/www.youtube.com\/v\/fSw1hCZ9Ook&#038;hl=en&#038;fs=1&#038;rel=0&#038;border=1\"><\/param><param name=\"allowFullScreen\" value=\"true\"><\/param><param name=\"allowscriptaccess\" value=\"always\"><\/param><embed src=\"http:\/\/www.youtube.com\/v\/fSw1hCZ9Ook&#038;hl=en&#038;fs=1&#038;rel=0&#038;border=1\" type=\"application\/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"445\" height=\"364\"><\/embed><\/object><\/p>\n<p>The way I wobble the ship is to basically split it into a grid and then wobble each point on the grid out of synch, the sprite is then drawn like a flat mesh grid, with bits of it stretched all over the place. If the damage sprites sat at exact grid intervals, this would be easy, but they do not.<\/p>\n<p>It might make sense to actually burn the damage texture onto the ship texture. This would make things very easy, but suddenly if I have 10 frigates on screen, I have 10 times the texture memory (worst case).<\/p>\n<p>Even as i type this, I realise the answer is likely to always align the damage textures themselves at grid wobble boundaries, and then to wobble them in synch. That doesn&#8217;t solve the issue of flashing lights though.<\/p>\n<p>What A nightmare. i hope people use the wibbly wobbly effect a LOT.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve just encountered a bit of a dilemma. I have this wibbly wobbly &#8216;not a cloaking device&#8217; effect on the ships in GSB. The thing is, it wobbles the original ship sprite, and when I&#8217;m drawing ships, I&#8217;m also attaching some extra sprites for stuff like damage textures etc. Not to mention flashing lights etc.<\/p>\n<p class=\"text-right\"><span class=\"screen-reader-text\">Continue Reading&#8230; Graphics problem<\/span><a class=\"btn btn-secondary continue-reading\" href=\"https:\/\/www.positech.co.uk\/cliffsblog\/2009\/03\/13\/graphics-problem\/\">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-208","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\/208","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=208"}],"version-history":[{"count":0,"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/posts\/208\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/media?parent=208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/categories?post=208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.positech.co.uk\/cliffsblog\/wp-json\/wp\/v2\/tags?post=208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}