{"id":45,"date":"2012-01-26T15:00:36","date_gmt":"2012-01-26T12:00:36","guid":{"rendered":"http:\/\/divide-studio.co.uk\/blogs\/ionutcava\/?p=45"},"modified":"2012-01-28T00:56:11","modified_gmt":"2012-01-27T21:56:11","slug":"new-a-i-system-physx-3-1-1-and-fixed-that-damned-water-transparency-and-depth-sorting-issue","status":"publish","type":"post","link":"https:\/\/divide-studio.co.uk\/blogs\/ionutcava\/new-a-i-system-physx-3-1-1-and-fixed-that-damned-water-transparency-and-depth-sorting-issue\/","title":{"rendered":"New A.I. system, PhysX 3.1.1 and fixed that damned water transparency and depth sorting issue"},"content":{"rendered":"<h3><strong>The A.I. part:<\/strong><\/h3>\n<p>For a final&#8217;s exam this semester, I had to develop a multi-agent system that could play team-based 2-on-2 tenis (with a soccer ball) and came up with this:<\/p>\n<p style=\"text-align: center;\">\n<div class=\"embed-container\"><iframe loading=\"lazy\" title=\"Multi-Agent Framework Test 1\" width=\"750\" height=\"563\" src=\"https:\/\/www.youtube.com\/embed\/r5PlSCVZQnA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/div>\n<\/p>\n<p>It&#8217;s just the first test of the AI Framework used to create multiple agents for single or team-based interactions. Just a test of visual sensors, communication, coordination and stuff like that.<\/p>\n<p>Also a test of thread safety for the SceneGraph as each entity&#8217;s local transformation matrix is modified by the AI thread and rendered in a separate thread. 3 threads, one pointer \ud83d\ude42<\/p>\n<p>Some shadow artifacts occur during mid-video, but that&#8217;s due to the not yet finished PSSM system I&#8217;m working on. Also. don&#8217;t mind the complete lack of animations :)) I have better things to code for now.<\/p>\n<p>Performance is choppy due to the Profiler from VS2010, Fraps, the code being compiled as a debug build, shader failing on the ball. Also, the quality is low as this video is used to pass my AI exam, and I don&#8217;t have a lot of time to waste on compression.<\/p>\n<h3><strong>The PhysX part:<\/strong><\/h3>\n<p>nVidia released the 3.x iteration of it&#8217;s PhysX SDK which you can read about\u00a0<a title=\"PhysX 3.1\" href=\"http:\/\/physxinfo.com\/news\/6312\/physx-3-1-is-ready-for-download-introduces-public-binary-sdk-for-android\/\" target=\"_blank\"> &gt;&gt;here&lt;&lt;<\/a> so I thought of adding it to the framework. Specifically the 3.1.1 iteration (info <a title=\"PhysX 3.1.1\" href=\"http:\/\/physxinfo.com\/news\/6943\/updated-physx-sdk-3-1-1-is-available\/\" target=\"_blank\">&gt;&gt;here&lt;&lt;<\/a> )<\/p>\n<p>After some long coding sessions, the API was up and running, driverless and really fast. Only simple box-collisions for now, but it proves that the API is syncing data with the SceneGraph nicely and in a thread-safe manner:<\/p>\n<p><a title=\"Facebook location\" href=\"https:\/\/www.facebook.com\/photo.php?fbid=293086240741111&amp;set=a.293081160741619.62014.170021163047620&amp;type=1&amp;theater\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/fbcdn-sphotos-a.akamaihd.net\/hphotos-ak-snc7\/402097_293086240741111_170021163047620_750529_1777031355_n.jpg\" alt=\"\" \/><\/a><\/p>\n<h3><strong>The water transparency stuff:<\/strong><\/h3>\n<p>Water wasn&#8217;t really transparent, because 2 very important states, culling = off, blending = on, weren&#8217;t set correctly while rendering. This was due to the absence of a Render State Manager and a Render Queue. Everything was rendered via a recursive callback on the SceneGraph. Adding a Render Queue sorting method and some minor changes to the State Manager, I finally managed to properly switch states and render transparent objects in a back-to-front order. The result? Well, semi-transparent water:<\/p>\n<p><a title=\"Facebook location\" href=\"https:\/\/www.facebook.com\/photo.php?fbid=293086387407763&amp;set=a.293081160741619.62014.170021163047620&amp;type=1&amp;theater\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/fbcdn-sphotos-a.akamaihd.net\/hphotos-ak-ash4\/420407_293086387407763_170021163047620_750533_1150730757_n.jpg\" alt=\"\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.facebook.com\/photo.php?fbid=294021190647616&amp;set=a.293081160741619.62014.170021163047620&amp;type=3&amp;theater\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"Underwater transparency fixed ... finally\" src=\"https:\/\/fbcdn-sphotos-a.akamaihd.net\/hphotos-ak-snc7\/420018_294021190647616_170021163047620_752072_70030536_n.jpg\" alt=\"Underwater transparency\" width=\"960\" height=\"739\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The A.I. part: For a final&#8217;s exam this semester, I had to develop a multi-agent system that could play team-based 2-on-2 tenis (with a soccer ball) and came up with this: It&#8217;s just the first test of the AI Framework used to create multiple agents for single or team-based interactions. Just a test of visual &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/divide-studio.co.uk\/blogs\/ionutcava\/new-a-i-system-physx-3-1-1-and-fixed-that-damned-water-transparency-and-depth-sorting-issue\/\">Continue reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-45","post","type-post","status-publish","format-standard","hentry","category-general-stuff","item-wrap"],"_links":{"self":[{"href":"https:\/\/divide-studio.co.uk\/blogs\/ionutcava\/wp-json\/wp\/v2\/posts\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/divide-studio.co.uk\/blogs\/ionutcava\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/divide-studio.co.uk\/blogs\/ionutcava\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/divide-studio.co.uk\/blogs\/ionutcava\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/divide-studio.co.uk\/blogs\/ionutcava\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":17,"href":"https:\/\/divide-studio.co.uk\/blogs\/ionutcava\/wp-json\/wp\/v2\/posts\/45\/revisions"}],"predecessor-version":[{"id":59,"href":"https:\/\/divide-studio.co.uk\/blogs\/ionutcava\/wp-json\/wp\/v2\/posts\/45\/revisions\/59"}],"wp:attachment":[{"href":"https:\/\/divide-studio.co.uk\/blogs\/ionutcava\/wp-json\/wp\/v2\/media?parent=45"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/divide-studio.co.uk\/blogs\/ionutcava\/wp-json\/wp\/v2\/categories?post=45"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/divide-studio.co.uk\/blogs\/ionutcava\/wp-json\/wp\/v2\/tags?post=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}