tag:blogger.com,1999:blog-3064325214589649535.post2894945537515206647..comments2024-03-28T06:52:15.545+01:00Comments on Joost's Dev Blog: Making an HD 2D game look good on an SD televisionJoost van Dongenhttp://www.blogger.com/profile/00569566310604620045noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-3064325214589649535.post-5168053797648307752011-11-29T20:54:55.550+01:002011-11-29T20:54:55.550+01:00This is a really cool. I've had similar proble...This is a really cool. I've had similar problems when taking a game designed for iPad down to iPhone or small Android phones. This might help alot.<br /><br />Do you do things differently when working on PAL vs NTSC resolutions?<br /><br />Also, are you filling the entire screen? It seems like it would be difficult to find a good way to fit everything on a 4:3 layout when it was designed to look great in widescreen mode.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-78169893722569881212011-11-27T21:32:30.365+01:002011-11-27T21:32:30.365+01:00Ah, in that sense! I guess when I would want to cr...Ah, in that sense! I guess when I would want to create lower resolution textures during loading, this could indeed be a nice optimisation to make it go faster. :)Joost van Dongenhttps://www.blogger.com/profile/00569566310604620045noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-89744295722077104562011-11-25T12:35:16.515+01:002011-11-25T12:35:16.515+01:00To resample the textures at load time, so that the...To resample the textures at load time, so that they match the screen resolution, you could render to texture using the hardware rather than decode the DDS format in software and sample it using software.<br /><br />What I am suggesting is that at load time, you render each 2d DDS file to an off screen texture, one by one. This way you use the hardware pipeline to do the sampling one at load time, rather than every frame.<br /><br />for_each(texture)<br />{<br />texture = load_dds(filename);<br />actual_texture_for_rendering_the_game = create_texture(x, y);<br />// set up render target, surface etc. here<br />set_render_target_texture(actual_texture_for_rendering_the_game);<br />// use your multisampling shader here to get good sampling<br />render_quad_with_texture(texture); <br />release(texture);<br />}<br /><br />Obviously, for the XBox, a waste of time where there is no problem with performance. It is also a lot of messing around at load time with render surfaces etc. and even on the PC where scalability may be an issue, 2d rendering probably isn't going to be the bottle neck.<br /><br />I only really mentioned this alternative to point out that I thought you were showing good practice in finding a solution and running with it, rather than falling into the trap of exploring every possibility.<br /><br />I think your posts are really valuable to a lot of people, keep blogging!Danhttps://www.blogger.com/profile/04942789327676568967noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-27458876896183394892011-11-24T23:59:32.563+01:002011-11-24T23:59:32.563+01:00I am not sure I understand what you mean? Of cours...I am not sure I understand what you mean? Of course I use a shader to do all the sampling, since this all happens on the GPU. What do you mean exactly?Joost van Dongenhttps://www.blogger.com/profile/00569566310604620045noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-48247748495660558552011-11-24T17:22:33.308+01:002011-11-24T17:22:33.308+01:00Yes i agree your approach is the correct one, espe...Yes i agree your approach is the correct one, especially for consoles. My only comment is that you could achieve (1) by rendering to texture with a simple multisampling shader rather than sample the textures in software. But i am not arguing, supersampling the entire scene makes sense, is simple, robust, and probably has other hidden advantages.Danhttps://www.blogger.com/profile/04942789327676568967noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-56305649400087477532011-11-22T16:53:50.603+01:002011-11-22T16:53:50.603+01:00Rescaling on load would work as well, but has thre...Rescaling on load would work as well, but has three rather serious problems:<br /><br />1. More work: textures are saved as DDS. To do this, I would have to decode DDS, rescale, and then encode as DDS again. Especially encoding DDS is pretty difficult (gotta choose the correct values), so I would have to include an additional library to do this.<br /><br />2. Lower quality: DDS works better if the amount of detail is low relative to the resolution. Halving the resolution thus doubles the problems with DDS compression. This is especially visible on animating characters.<br /><br />3. Loading time problems: we have 200mb of textures. Decoding all of those, then rescaling, and then encoding as DDS again, simply takes a lot of time.<br /><br />So rescaling on load is definitely worse than rescaling outside the game in the asset pipeline.<br /><br />Also, this would not win any relevant memory, since the game already fits in memory in HD, so reducing beyond that for SD is useless.<br /><br />And since SD wins performance versus HD already for the lower resolution, performance issues are no reason to not do the real-time rescaling.Joost van Dongenhttps://www.blogger.com/profile/00569566310604620045noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-34422269150305504392011-11-22T10:48:02.562+01:002011-11-22T10:48:02.562+01:00really interesting! This solution seems well suite...really interesting! This solution seems well suited to consoles where the hardware is standardized so you know what the performance will be.<br /><br />One point I have - why not re-sample the 2d graphics when you load them instead of the whole screen at run-time?<br /><br />Re-sampling at load time rather than render time would definitely use less memory and have higher frame rate, but the technical implementation would be a pain where the new texture sizes were funny numbers, etc.<br /><br />The full screen super-sampling is just easier to develop and has perfectly acceptable performance?<br /><br />One thing I really like about your posts is the focus on your real world experience - a lot of programmers would not be able to resist going overboard on an interesting problem on this, but your judgement seems to strike a great balance between solving the problem well but not letting yourself waste time.Danhttps://www.blogger.com/profile/04942789327676568967noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-11096564259877440422011-11-20T11:22:34.343+01:002011-11-20T11:22:34.343+01:00Haha, yeah, but compared to PC, they still are rea...Haha, yeah, but compared to PC, they still are really easy on the graphics side! :)Joost van Dongenhttps://www.blogger.com/profile/00569566310604620045noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-29282979098508236882011-11-20T01:12:14.199+01:002011-11-20T01:12:14.199+01:00Heh, and consoles are meant to be easy, because yo...Heh, and consoles are meant to be easy, because you only have one set of hardware to worry about, rather than testing on a million different CPU/GPU/OS combinations. Goes to show there's always *something* that will muck you up!Cam Jacksonhttps://www.blogger.com/profile/07639635515690222326noreply@blogger.com