
{"id":82,"date":"2021-02-06T16:01:29","date_gmt":"2021-02-06T16:01:29","guid":{"rendered":"http:\/\/crashedcreativity.pl\/?p=82"},"modified":"2022-06-22T20:02:04","modified_gmt":"2022-06-22T20:02:04","slug":"meet-shaders-part-2-water-from-the-rock-blending-with-background","status":"publish","type":"post","link":"https:\/\/crashedcreativity.pl\/index.php\/2021\/02\/06\/meet-shaders-part-2-water-from-the-rock-blending-with-background\/","title":{"rendered":"Meet shaders (part 2) &#8211; Water from the rock. Blending with background."},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"459\" src=\"http:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-13_58_40-1024x459.png\" alt=\"\" class=\"wp-image-85\" srcset=\"https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-13_58_40-1024x459.png 1024w, https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-13_58_40-300x134.png 300w, https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-13_58_40-768x344.png 768w, https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-13_58_40-1536x688.png 1536w, https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-13_58_40.png 1897w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Hi everybody. I was burnout so I had to stop working for a week. I hope You care of yourself and do not overwhelm you health with game developing.<\/p>\n\n\n\n<p>Today I want to show You water effect  using particle system and renering to texture. This  is a finall effect:<\/p>\n\n\n\n<figure class=\"wp-block-embed-youtube wp-block-embed is-type-video is-provider-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"water efect\" width=\"590\" height=\"332\" src=\"https:\/\/www.youtube.com\/embed\/oKkb4obNBkU?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>I have used Universal Render Pipeline. Requirements and Installations You can find in previous post: <a href=\"http:\/\/crashedcreativity.pl\/index.php\/2021\/01\/30\/meet-shaders-part-1-luna-the-shadow-dust-effect\/\">Meet shaders (part 1) \u2013 Luna The shadow dust effect \u2013 Crashed Creativity Studio<\/a><\/p>\n\n\n\n<ol><li>First i have added a second camera to the scene and set its rendering to texture. <\/li><li> Second i have created new Unlit Sprite Shader graph. Its good to use unlit shaders for particle systems. It increase performance.<\/li><li>I dragged a texture created in (1) to  shader graph. Next I have created graph below:<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"549\" src=\"http:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_31_03-1024x549.png\" alt=\"\" class=\"wp-image-89\" srcset=\"https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_31_03-1024x549.png 1024w, https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_31_03-300x161.png 300w, https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_31_03-768x412.png 768w, https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_31_03-1536x824.png 1536w, https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_31_03.png 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Camera&#8217;s texture is connected to Sample Texture Node, position of sample is taken from Sreen Positon Node. Output from Sample Texture is connected to Blend Node. This node blends background with Vrtex Color Node (Taken from particle color set in particle system) I have used blending Mode Linear light with Opacity 0.25. I have noticed that for small opacity i have noticed different look of game rendering comparing to editor view.<\/p>\n\n\n\n<p>Next step is create a new material and assigng shader with just created.<\/p>\n\n\n\n<p>This is time for build our particle system. Particles System emmits each particle with some lifetime after which particle disapears. Rate and many others properties of particles can be set in particle system  inspector.<\/p>\n\n\n\n<p>First , we change material in rendering tab. We use material created in this tutorial.<\/p>\n\n\n\n<p>All settings used in this tutorial can be viewed below:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"618\" height=\"690\" src=\"http:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_44_07.png\" alt=\"\" class=\"wp-image-90\" srcset=\"https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_44_07.png 618w, https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_44_07-269x300.png 269w\" sizes=\"(max-width: 618px) 100vw, 618px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"626\" height=\"478\" src=\"http:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_47_38.png\" alt=\"\" class=\"wp-image-91\" srcset=\"https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_47_38.png 626w, https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_47_38-300x229.png 300w, https:\/\/crashedcreativity.pl\/wp-content\/uploads\/2021\/02\/shader_test2-SampleScene-PC-Mac-Linux-Standalone-Unity-2020.2.2f1-Personal_-_DX11_-06.02.2021-16_47_38-175x133.png 175w\" sizes=\"(max-width: 626px) 100vw, 626px\" \/><\/figure>\n\n\n\n<p>Be careful. Stop particle system before You go to sleep If  You don&#8217;t want to wakeup in flooded room ;)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi everybody. I was burnout so I had to stop working for a week. I hope You care of yourself<\/p>\n<div class=\"read-button read_more_btn_text\"><a class=\"read_more\" href=\"https:\/\/crashedcreativity.pl\/index.php\/2021\/02\/06\/meet-shaders-part-2-water-from-the-rock-blending-with-background\/\">Read Now<span class=\"arrow_readm\"> &#x25BA;<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":85,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/crashedcreativity.pl\/index.php\/wp-json\/wp\/v2\/posts\/82"}],"collection":[{"href":"https:\/\/crashedcreativity.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crashedcreativity.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crashedcreativity.pl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crashedcreativity.pl\/index.php\/wp-json\/wp\/v2\/comments?post=82"}],"version-history":[{"count":11,"href":"https:\/\/crashedcreativity.pl\/index.php\/wp-json\/wp\/v2\/posts\/82\/revisions"}],"predecessor-version":[{"id":98,"href":"https:\/\/crashedcreativity.pl\/index.php\/wp-json\/wp\/v2\/posts\/82\/revisions\/98"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/crashedcreativity.pl\/index.php\/wp-json\/wp\/v2\/media\/85"}],"wp:attachment":[{"href":"https:\/\/crashedcreativity.pl\/index.php\/wp-json\/wp\/v2\/media?parent=82"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crashedcreativity.pl\/index.php\/wp-json\/wp\/v2\/categories?post=82"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crashedcreativity.pl\/index.php\/wp-json\/wp\/v2\/tags?post=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}