{"id":1124,"date":"2013-12-30T23:20:43","date_gmt":"2013-12-30T22:20:43","guid":{"rendered":"http:\/\/www.cornflex.org\/?p=1124"},"modified":"2023-12-13T00:17:30","modified_gmt":"2023-12-13T00:17:30","slug":"katana-particle-system","status":"publish","type":"post","link":"https:\/\/quentinlengele.com\/index.php\/2013\/12\/30\/katana-particle-system\/","title":{"rendered":"Katana Particle System"},"content":{"rendered":"<p>Here is a short demo of an accelerated GPU Particle System for Unity. <!--more--><\/p>\n<div class=\"videoWrapper\"><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/zoIpOPt4Tas?vq=HD720&amp;controls=1&amp;showinfo=0&amp;rel=0\" width=\"300\" height=\"150\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n<h2>SCREEN SPACE RENDERING<\/h2>\n<p>I found many techniques on the web but here is <a href=\"https:\/\/developer.download.nvidia.com\/presentations\/2010\/gdc\/Direct3D_Effects.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">the document<\/a> from Nvidia that brought me light on this subject. Based on it, I created all the rendering steps (point sprite, depth to normal, blurring, bilateral filter&#8230;). Caustics render pass isn&#8217;t done at this stage and the physics kernels have to be refactored.<\/p>\n<p>Particles aren&#8217;t interacting each other but only interacting with the collision data buffer from the scene.<\/p>\n<div class=\"videoWrapper\"><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/w6Q4TuNTbcA?vq=HD720&amp;controls=1&amp;showinfo=0&amp;rel=0\" width=\"300\" height=\"150\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n<h2>CURRENT FEATURES<\/h2>\n<ul>\n<li>Emitter rate and radius<\/li>\n<li>Forces and angular forces<\/li>\n<li>Size over time<\/li>\n<li>Particle Age<\/li>\n<li>Enable\/Disable gravity (values from the Unity physic engine)<\/li>\n<li>Noise on velocities<\/li>\n<li>Change color over time<\/li>\n<li>Bounce and impact parameters<\/li>\n<li>Soft particles rendering<\/li>\n<li>GPU Collision Detection based on Unity colliders (bufferize scene colliders to interact with particles)<\/li>\n<li>Screen Space Rendering for Fluids (experimental)<\/li>\n<\/ul>\n<h2>COMING FEATURES<\/h2>\n<ul>\n<li>Complex Mesh and Terrain Collision on GPU side<\/li>\n<li>Attract and Repel Force Areas<\/li>\n<li>All kind of Blend mode for rendering<\/li>\n<\/ul>\n<h2>MARCHING CUBE APPROACH<\/h2>\n<p>Compute shader metaball approach to render a real-time fluid:<\/p>\n<div class=\"videoWrapper\">\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/1HqCZgMjCuE?vq=HD720&amp;controls=1&amp;showinfo=0&amp;rel=0\" width=\"300\" height=\"150\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<\/div>\n<p>The result is not bad, still heavy with a high definition lattice but it can be managed in a small area with at a good framerate (120-150 here).<\/p>\n<p>Isosurface and Marching Cube algorithms are not an easy subject but I found interesting articles and I ported some C++ sources (DirectX10) from Nvidia to Unity (DirectX11).<\/p>\n<p>Here are some links:<\/p>\n<p>GDC2006<br \/>\n<a href=\"http:\/\/http.download.nvidia.com\/developer\/presentations\/2006\/gdc\/2006-GDC-DX10-Practical-Metaballs.pdf\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/http.download.nvidia.com\/developer\/presentations\/2006\/gdc\/2006-GDC-DX10-Practical-Metaballs.pdf<\/a><\/p>\n<p>CPU approach<br \/>\n<a href=\"http:\/\/wiki.unity3d.com\/index.php?title=MetaBalls\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/wiki.unity3d.com\/index.php?title=MetaBalls<\/a><\/p>\n<p>GPU Gems<br \/>\n<a href=\"https:\/\/developer.nvidia.com\/gpugems\/GPUGems3\/gpugems3_ch01.html\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/developer.nvidia.com\/gpugems\/GPUGems3\/gpugems3_ch01.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is a short demo of an accelerated GPU Particle System for Unity.<\/p>\n","protected":false},"author":1,"featured_media":18941,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,8],"tags":[],"class_list":["post-1124","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gpu","category-unity"],"_links":{"self":[{"href":"https:\/\/quentinlengele.com\/index.php\/wp-json\/wp\/v2\/posts\/1124","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/quentinlengele.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/quentinlengele.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/quentinlengele.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/quentinlengele.com\/index.php\/wp-json\/wp\/v2\/comments?post=1124"}],"version-history":[{"count":6,"href":"https:\/\/quentinlengele.com\/index.php\/wp-json\/wp\/v2\/posts\/1124\/revisions"}],"predecessor-version":[{"id":19735,"href":"https:\/\/quentinlengele.com\/index.php\/wp-json\/wp\/v2\/posts\/1124\/revisions\/19735"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/quentinlengele.com\/index.php\/wp-json\/wp\/v2\/media\/18941"}],"wp:attachment":[{"href":"https:\/\/quentinlengele.com\/index.php\/wp-json\/wp\/v2\/media?parent=1124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/quentinlengele.com\/index.php\/wp-json\/wp\/v2\/categories?post=1124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/quentinlengele.com\/index.php\/wp-json\/wp\/v2\/tags?post=1124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}