{"id":14153,"date":"2009-12-22T02:47:32","date_gmt":"2009-12-22T02:47:32","guid":{"rendered":"http:\/\/alienbabeltech.com\/main\/?p=14153"},"modified":"2009-12-22T04:08:41","modified_gmt":"2009-12-22T04:08:41","slug":"cryengine-3-to-lack-anti-aliasing-i-strongly-think-so","status":"publish","type":"post","link":"http:\/\/alienbabeltech.com\/main\/cryengine-3-to-lack-anti-aliasing-i-strongly-think-so\/","title":{"rendered":"Updated: CryEngine 3 to lack Anti-Aliasing ? Maybe"},"content":{"rendered":"<p>So there I was, spending my peaceful evening wandering around the internet when I came across an interview with <strong>Carl Jones<\/strong> from Crytek about the upcoming CryENGINE 3 which will power the next generation Crysis games on PC, Playstation 3 and Xbox 360. Like any other PC enthusiast, I am very excited about the prospect of a new Crysis game with even better graphics than the first one to bring current and future generation of hardware to its knees. So I promptly jumped over to <a href=\"http:\/\/www.pcplay.hr\/modules.php?r=23&amp;id=915\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/www.pcplay.hr\/modules.php?r=23&amp;id=915', 'PC Play']);\" target=\"_blank\">PC Play<\/a>, reading through the interview I came across a very interesting answer.<\/p>\n<p>When asked about what new technologies were implemented in CryENGINE 3, Mr Jones answered:<\/p>\n<blockquote><p>We have implemented more multi-core support, streaming, a new rendering technique: <strong>Deferred Lighting<\/strong>, which allows for a huge number of dynamic lights in a scene, without requiring a high amount of processing power, we have real-time global illumination in the engine, plus a host of smaller, yet important improvements to all our technologies and features.<\/p><\/blockquote>\n<p>Pay close attention to the bolded text above. As soon as I read that, BAAM. It hit me. I thought to myself, wasn\u2019t this \u201cDeferred Lighting or Shading\u201d the reason behind lack of Anti-Aliasing <em>(almost expected from every PC game these days) <\/em>in <em>S.T.A.L.K.E.R. : Shadow of Chernobyl<\/em> and Dead Space<em>.<\/em> Now I\u2019m no game coder, so I don\u2019t know what this technique is or how it works. So I did what a normal end-user would do when things don\u2019t work like expected. I searched on Wikipedia first about this technique, and then searched on Google for something concrete from maybe a game developer on why Anti-Aliasing is not supported with \u201cDeferred Lighting\u201d.<\/p>\n<p>Here is what Wikipedia has to say:<\/p>\n<blockquote><p>In <a href=\"http:\/\/en.wikipedia.org\/wiki\/Computer_graphics\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/en.wikipedia.org\/wiki\/Computer_graphics', 'computer graphics']);\" >computer graphics<\/a>, <strong>deferred shading<\/strong> is a <a href=\"http:\/\/en.wikipedia.org\/wiki\/3D_computer_graphics\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/en.wikipedia.org\/wiki\/3D_computer_graphics', 'three dimensional']);\" >three dimensional<\/a> <a href=\"http:\/\/en.wikipedia.org\/wiki\/Shading\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/en.wikipedia.org\/wiki\/Shading', 'shading']);\" >shading<\/a> technique in which the result of a shading algorithm is calculated by dividing it into smaller parts that are written to intermediate buffer storage to be combined later, instead of immediately writing the shader result to the color framebuffer. Implementations on modern hardware tend to use multiple render targets (<a href=\"http:\/\/en.wikipedia.org\/w\/index.php?title=Multiple_Render_Targets&amp;action=edit&amp;redlink=1\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/en.wikipedia.org\/w\/index.php?title=Multiple_Render_Targets&amp;action=edit&amp;redlink=1', 'MRT']);\" >MRT<\/a>) to avoid redundant vertex transformations. Usually once all the needed buffers are built they are then read (usually as input textures) from a shading algorithm (for example a lighting equation) and combined to produce the final result. In this way the computation and memory bandwidth required to shade a scene is reduced to those visible portions, thereby reducing the shaded depth complexity.<\/p><\/blockquote>\n<p>Don\u2019t worry if you are overwhelmed by all the technicality above, pay close attention to the quote below as I had confirmed my suspicion. Wikipedia states:<\/p>\n<blockquote><p>Another rather important disadvantage is that, due to separating the lighting stage from the geometric stage, hardware <a href=\"http:\/\/en.wikipedia.org\/wiki\/Anti_alias\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/en.wikipedia.org\/wiki\/Anti_alias', 'anti alias']);\" >anti alias<\/a> does not produce correct results any more: although the first pass used when rendering the basic properties (diffuse, normal etc.) can use <a href=\"http:\/\/en.wikipedia.org\/wiki\/Anti_alias\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/en.wikipedia.org\/wiki\/Anti_alias', 'anti alias']);\" >anti alias<\/a>, it&#8217;s not until full lighting has been applied that <a href=\"http:\/\/en.wikipedia.org\/wiki\/Anti_alias\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/en.wikipedia.org\/wiki\/Anti_alias', 'anti alias']);\" >anti alias<\/a> is needed. One of the usual techniques to overcome this limitation is using <a href=\"http:\/\/en.wikipedia.org\/wiki\/Edge_detection\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/en.wikipedia.org\/wiki\/Edge_detection', 'edge detection']);\" >edge detection<\/a> on the final image and then applying blur over the edges.<\/p><\/blockquote>\n<p>This means that when using \u201cDeferred Shading\u201d, traditional hardware assisted Anti-Aliasing does not work. However as a workaround to this, a blur is applied to the jagged edges in the image.<\/p>\n<p>Next piece of evidence comes from a book published by Nvidia on their developer site titled \u201cGPU Gems 2 : Programming Techniques for High-Performance Graphics and General-Purpose Computation\u201d. Oles Shishkovtsov from GSC Game World in \u201cChapter 9. Deferred Shading in <em>S.T.A.L.K.E.R.\u201d <\/em>of this book explains<\/p>\n<blockquote><p>A deferred renderer is just incompatible with current hardware-assisted antialiasing, unfortunately (Hargreaves and Harris 2004). Thus, antialiasing becomes solely the responsibility of the application and the shader; we cannot rely on the GPU alone. Because aliasing itself arises from the mismatched frequencies of the source signal and of the destination discrete representation, a good approximation of an antialiasing filter is just a low-pass filter, which is simple blurring.<\/p><\/blockquote>\n<p>Along with <em>S.T.A.L.K.E.R., <\/em>Dead Space is another game that uses &#8220;Deferred Shading.&#8221; So I loaded up Dead Space to see how much blur is added to the edges, and sure enough there was the difference right in front of me. The Anti-Aliasing option in the advanced visual settings in Dead Space turns on this edgeAA blur method of Anti-Aliasing. Below are the 100% crop PNG images from the screens. The game was running at 1920&#215;1200 with maximum possible settings.<\/p>\n<p>Images with in-game Anti-Aliasing option enabled are on the left.<\/p>\n<p><a href=\"http:\/\/i2.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/blur-1.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14154\" title=\"Blur 1\" src=\"http:\/\/i2.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/blur-1.png?resize=277%2C251\" alt=\"Blur 1\" srcset=\"http:\/\/i2.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/blur-1.png?resize=277%2C251 395w, http:\/\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/blur-1-300x272.png 300w\" sizes=\"auto, (max-width: 277px) 100vw, 277px\" data-recalc-dims=\"1\" \/><\/a> <a href=\"http:\/\/i0.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/sharp-1.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14157\" title=\"Sharp 1\" src=\"http:\/\/i0.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/sharp-1.png?resize=278%2C251\" alt=\"Sharp 1\" srcset=\"http:\/\/i0.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/sharp-1.png?resize=278%2C251 394w, http:\/\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/sharp-1-300x271.png 300w\" sizes=\"auto, (max-width: 278px) 100vw, 278px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>Notice how blurry the face looks. Also notice the blurry text \u201cSchofield Tools\u201d in the background.<\/p>\n<p><a href=\"http:\/\/i1.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/blur-2.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14155\" title=\"Blur 2\" src=\"http:\/\/i1.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/blur-2.png?resize=275%2C358\" alt=\"Blur 2\" srcset=\"http:\/\/i1.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/blur-2.png?resize=275%2C358 344w, http:\/\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/blur-2-230x300.png 230w\" sizes=\"auto, (max-width: 275px) 100vw, 275px\" data-recalc-dims=\"1\" \/> <\/a><a href=\"http:\/\/i2.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/sharp-2.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14158\" title=\"Sharp 2\" src=\"http:\/\/i2.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/sharp-2.png?resize=275%2C358\" alt=\"Sharp 2\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>The floor looks blurred in the above comparison, although everything else looks almost the same.<\/p>\n<p><a href=\"http:\/\/i1.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/blur-3.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14156\" title=\"Blur 3\" src=\"http:\/\/i1.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/blur-3.png?resize=265%2C180\" alt=\"Blur 3\" srcset=\"http:\/\/i1.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/blur-3.png?resize=265%2C180 497w, http:\/\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/blur-3-300x204.png 300w\" sizes=\"auto, (max-width: 265px) 100vw, 265px\" data-recalc-dims=\"1\" \/><\/a><a href=\"http:\/\/i1.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/sharp-3.png\" target=\"_blank\"> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-14159\" title=\"Sharp 3\" src=\"http:\/\/i1.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/sharp-3.png?resize=288%2C180\" alt=\"Sharp 3\" srcset=\"http:\/\/i1.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/sharp-3.png?resize=288%2C180 535w, http:\/\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/sharp-3-300x187.png 300w\" sizes=\"auto, (max-width: 288px) 100vw, 288px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>Notice the blurry text in the background.<\/p>\n<p>Although the difference in game play does not jump out at you, but it is kind of blasphemous to think that the next Crysis, of all games, might not support a technique such as Anti-Aliasing. I know how inflamed the PC gamers get over the word \u201cport\u201d but Mr Jones explains:<\/p>\n<p>With CryENGINE\u00ae 3 \u2013 you don\u2019t really port to each supported platform \u2013 you build your game to run on CryENGINE\u00ae 3 and it will run on PS\u00ae3, Xbox 360\u2122 and PC. Your lead platform is now simply a matter of design \u2013 not a requirement to favour one development approach over another due to technical limitations.<\/p>\n<p>Hopefully, PC gamers will get a game with tailored to take advantage of all the latest hardware from Intel, AMD and Nvidia at the time of release, even though there might be a certain blurring around the edges.<\/p>\n<p>Update: Digging around some more, it appears that Anti-Aliasing can be enabled with &#8220;Deferred Shading&#8221; in DX10 mode. Nvidia published a tech paper titled &#8220;DirectX 10: The Next Generation Graphics API&#8221; which explains:<\/p>\n<blockquote><p>Access to Multisampling Subsamples The current method of resolving multisample antialiasing (MSAA) is done at a very late stage in the graphics pipeline called scan out. At this stage, the subsamples cannot<br \/>\nbe recorded in memory for subsequent use. This limitation means MSAA cannot be used in deferred shading graphics engines.\u00a0 In DirectX 10 it is possible to bind an MSAA render target as a texture, where each<br \/>\nsubsample can be accessed individually. This gives the programmer much better control over how subsamples are used. Deferred rendering can now benefit from MSAA. Custom resolves can also be computed.<\/p><\/blockquote>\n<p>So you would think that all is fine and dandy now, and the upcoming Crysis would feature Anti-Aliasing. Well, I thought so too, until I came across this<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/i2.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/crytek-deferred-shading.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14167 aligncenter\" title=\"Crytek-deferred-shading\" src=\"http:\/\/i2.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/crytek-deferred-shading.png?resize=512%2C385\" alt=\"Crytek-deferred-shading\" srcset=\"http:\/\/i2.wp.com\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/crytek-deferred-shading.png?resize=512%2C385 640w, http:\/\/alienbabeltech.com\/main\/wp-content\/uploads\/2009\/12\/crytek-deferred-shading-300x225.png 300w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>The above slide is directly from Crytek, talking about the design goals of CryENGINE 3. So it looks like they might be using EdgeAA (the blurry method of removing jaggies) in DirectX9 and they end with &#8220;&#8230;.we work on it&#8221;. I can only assume that they might implement Anti-Aliasing in DX10 mode.<\/p>\n<p><strong>Supporting Evidence:<\/strong><\/p>\n<p><a href=\"http:\/\/en.wikipedia.org\/wiki\/Deferred_shading\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/en.wikipedia.org\/wiki\/Deferred_shading', 'Wikipedia link to Deferred Shading']);\" target=\"_blank\">Wikipedia link to Deferred Shading<\/a><\/p>\n<p><a href=\"http:\/\/http.developer.nvidia.com\/GPUGems2\/gpugems2_chapter09.html\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/http.developer.nvidia.com\/GPUGems2\/gpugems2_chapter09.html', 'Nvidia GPU Gems Book ']);\" target=\"_blank\">Nvidia GPU Gems Book <\/a><\/p>\n<p><a href=\"http:\/\/www.nvidia.com\/object\/IO_37099.html\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/www.nvidia.com\/object\/IO_37099.html', 'Nvidia &#8220;DirectX 10: The Next Generation Graphics API&#8221;']);\" target=\"_blank\">Nvidia &#8220;DirectX 10: The Next Generation Graphics API&#8221;<\/a> (PDF Download)<\/p>\n<p><a href=\"http:\/\/www.slideshare.net\/guest11b095\/a-bit-more-deferred-cry-engine3\" onclick=\"_gaq.push(['_trackEvent', 'outbound-article', 'http:\/\/www.slideshare.net\/guest11b095\/a-bit-more-deferred-cry-engine3', '&#8220;A Bit More Deferred&#8221; Slide Deck by Crytek']);\" target=\"_blank\">&#8220;A Bit More Deferred&#8221; Slide Deck by Crytek<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So there I was, spending my peaceful evening wandering around the internet when I came across an interview with Carl Jones from Crytek about the upcoming CryENGINE 3 which will power the next generation&#46;&#46;&#46;<\/p>\n","protected":false},"author":3,"featured_media":14167,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2533,5,7,2535],"tags":[505,605,198,2934,88,121,161],"class_list":["post-14153","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-abt-news","category-gaming","category-technology","category-web-news","tag-cryengine","tag-cryengine-3","tag-crysis","tag-dead-space","tag-game","tag-nvidia","tag-stalker"],"_links":{"self":[{"href":"http:\/\/alienbabeltech.com\/main\/wp-json\/wp\/v2\/posts\/14153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/alienbabeltech.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/alienbabeltech.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/alienbabeltech.com\/main\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/alienbabeltech.com\/main\/wp-json\/wp\/v2\/comments?post=14153"}],"version-history":[{"count":0,"href":"http:\/\/alienbabeltech.com\/main\/wp-json\/wp\/v2\/posts\/14153\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/alienbabeltech.com\/main\/wp-json\/wp\/v2\/media\/14167"}],"wp:attachment":[{"href":"http:\/\/alienbabeltech.com\/main\/wp-json\/wp\/v2\/media?parent=14153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/alienbabeltech.com\/main\/wp-json\/wp\/v2\/categories?post=14153"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/alienbabeltech.com\/main\/wp-json\/wp\/v2\/tags?post=14153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}