{"id":1998,"date":"2015-01-29T20:55:00","date_gmt":"2015-01-29T20:55:00","guid":{"rendered":"http:\/\/www.spellcasterstudios.com\/?p=1998"},"modified":"2015-01-24T17:12:23","modified_gmt":"2015-01-24T17:12:23","slug":"tweaking","status":"publish","type":"post","link":"https:\/\/www.spellcasterstudios.com\/?p=1998","title":{"rendered":"Tweaking"},"content":{"rendered":"<p align=\"justify\">Today I didn\u2019t have much time to work on the game, so I basically just tweaked the ambient occlusion parameters and saw where they went\u2026<\/p>\n<p align=\"justify\">First experiment was to see if better filtering would help the algorithm\u2026 Of course, the filtering improves the effect, but visually it doesn\u2019t add anything, so I\u2019ll keep the low-cost 4&#215;4 box filter for now, instead of the 49 taps gaussian I experimented with\u2026<\/p>\n<p align=\"justify\">Second experiment, I increased the sampling radius to ridiculous levels (1.5 meters, instead of the 0.5 I was using)\u2026<\/p>\n<p align=\"justify\">The results were frankly better for this cartoonish, lo-fi visuals I have (before\/after):<\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen406.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen406\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen406\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen406_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen407.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen407\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen407\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen407_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p align=\"justify\">You can really tell on the shadow below the console near the player, so I\u2019m keeping this change\u2026<\/p>\n<p align=\"justify\">Also played around with using a \u201ccurve\u201d to modify the AO, trying to make the darker areas to show up better (more dramatically, even if less realistic). I played around with a sigma curve, but I ended up using a square curve (x=x^2) instead, since the difference was almost negligible and the cost is way lower:<\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen408.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen408\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen408\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen408_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen409.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen409\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen409\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen409_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen410.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen410\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen410\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen410_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p align=\"justify\">Much more dramatic shadow, which helps flesh out the scene\u2026<\/p>\n<p align=\"justify\">Finally, I decided to use the ambient occlusion term to modulate the direct lighting\u2026 This is silly from a realism perspective, since ambient occlusion simulates how the ambient light, the lose photons in the world interact with surfaces, and direct light is all about the direct photons\u2026<\/p>\n<p align=\"justify\">The end result ended up being much better than I expected\u2026 Not realistic, but a bit more impactful and more suitable to the game\u2019s aesthetic:<\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen411.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen411\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen411\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen411_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p align=\"justify\">I\u2019ve even removed the \u201cblob-shadow\u201d from the sprites, and it doesn\u2019t look bad with just the shadow from the ambient occlusion term\u2026<\/p>\n<p align=\"justify\">In a planet, with the normal render and without the blob shadow:<\/p>\n<p align=\"justify\"><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen412.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen412\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen412\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen412_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p>Everything flat and you the player character even seems to be floating\u2026 <\/p>\n<p>Now, with ambient occlusion with the current parameters:<\/p>\n<p><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen413.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen413\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen413\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen413_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p>Much better, everything seems more fleshed out\u2026 The player still doesn\u2019t feel in the ground, I think, but still it looks much better, things just seem to have more volume\u2026<\/p>\n<p>So, even thought yesterday was disapointed with the ambient occlusion, today I\u2019m much happier\u2026 It was a good option all in all\u2026 Now I need to implement this in OpenGL (should be just a matter of porting the shaders), and think if direct lighting shadows is a good use of my development time, or if I should just move on the other things, like decals or glows, the dozens of small bugs or the new UI work\u2026<\/p>\n<p><em>Now listening to \u201cLindsey Stirling\u201d by \u201cLindsey Stirling\u201d<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I didn\u2019t have much time to work on the game, so I basically just tweaked the ambient occlusion parameters and saw where they went\u2026 First experiment was to see if better filtering would help the algorithm\u2026 Of course, the filtering improves the effect, but visually it doesn\u2019t add anything, so I\u2019ll keep the low-cost [&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":[254,255,253],"class_list":["post-1998","post","type-post","status-publish","format-standard","hentry","category-development","category-chrome-hunter","category-technology","tag-ambient","tag-occlusion","tag-ssao"],"_links":{"self":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/1998","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=1998"}],"version-history":[{"count":1,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/1998\/revisions"}],"predecessor-version":[{"id":1999,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/1998\/revisions\/1999"}],"wp:attachment":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}