{"id":299,"date":"2019-03-23T13:44:32","date_gmt":"2019-03-23T13:44:32","guid":{"rendered":"https:\/\/www.maxcanvas.org\/?page_id=299"},"modified":"2019-03-23T14:01:59","modified_gmt":"2019-03-23T14:01:59","slug":"unity-graph-shaders","status":"publish","type":"page","link":"https:\/\/www.maxcanvas.org\/?page_id=299","title":{"rendered":"Unity Graph Shaders"},"content":{"rendered":"\n<p>A couple of exercises to experiment with the new Unity Lightweight Rendering Pipeline (LWRP) and the Unity Graph Shaders.  At this time, this visual programming tool is a developing technology.  It is still rather buggy (as I found), but when refined will be a great asset in the Unity toolkit.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Planet and Moon Shader<\/h4>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"878\" height=\"587\" src=\"https:\/\/www.maxcanvas.org\/wp-content\/uploads\/2019\/03\/Shaders_Moon.png\" alt=\"\" class=\"wp-image-303\" srcset=\"https:\/\/www.maxcanvas.org\/wp-content\/uploads\/2019\/03\/Shaders_Moon.png 878w, https:\/\/www.maxcanvas.org\/wp-content\/uploads\/2019\/03\/Shaders_Moon-500x334.png 500w\" sizes=\"auto, (max-width: 878px) 100vw, 878px\" \/><\/figure>\n\n\n\n<p>Unity make it really easy to generate &#8220;standard&#8221; planets like Mars on the left.  However, the Moon is a tricky body to write a shader for, as it&#8217;s a fairly reflective body, so the bright side is reflecting sunshine AND (in some conditions) the dark side is partially illuminated by light reflecting off the earth.  For this shader, a number of uniforms are compared to the surface normals to establish the emission and albedo.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/www.maxcanvas.org\/wp-content\/uploads\/2019\/03\/Planets_Demo_Video.mp4\"><\/video><figcaption>Unity Inspector View of the Moon shader in operation<\/figcaption><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Car Paint Shader<\/h4>\n\n\n\n<p>Also using the Unity Graphs Shaders, a model was downloaded from (<a href=\"https:\/\/assetstore.unity.com\/packages\/3d\/vehicles\/land\/3d-low-poly-car-for-games-tocus-101652\">THIS LINK<\/a>) and a number of shaders applied to different materials (glass, plastics, etc).  The most complex being the Car Paint Shader, which used Fresnel reflections and a 2D colour map.   The before and after are shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"565\" height=\"289\" src=\"https:\/\/www.maxcanvas.org\/wp-content\/uploads\/2019\/03\/Shaders_Car_Original.png\" alt=\"\" class=\"wp-image-302\" srcset=\"https:\/\/www.maxcanvas.org\/wp-content\/uploads\/2019\/03\/Shaders_Car_Original.png 565w, https:\/\/www.maxcanvas.org\/wp-content\/uploads\/2019\/03\/Shaders_Car_Original-500x256.png 500w\" sizes=\"auto, (max-width: 565px) 100vw, 565px\" \/><figcaption>Car Model : Before<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"647\" height=\"413\" src=\"https:\/\/www.maxcanvas.org\/wp-content\/uploads\/2019\/03\/Shaders_Car_Graph_Shaded.png\" alt=\"\" class=\"wp-image-301\" srcset=\"https:\/\/www.maxcanvas.org\/wp-content\/uploads\/2019\/03\/Shaders_Car_Graph_Shaded.png 647w, https:\/\/www.maxcanvas.org\/wp-content\/uploads\/2019\/03\/Shaders_Car_Graph_Shaded-500x319.png 500w\" sizes=\"auto, (max-width: 647px) 100vw, 647px\" \/><figcaption>Car Model: After<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A couple of exercises to experiment with the new Unity Lightweight Rendering Pipeline (LWRP) and the Unity Graph Shaders. At this time, this visual programming tool is a developing technology. It is still rather buggy (as I found), but when refined will be a great asset in the Unity toolkit. Planet and Moon Shader Unity [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_oct_exclude_from_cache":false,"footnotes":""},"class_list":["post-299","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/www.maxcanvas.org\/index.php?rest_route=\/wp\/v2\/pages\/299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.maxcanvas.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.maxcanvas.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.maxcanvas.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.maxcanvas.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=299"}],"version-history":[{"count":6,"href":"https:\/\/www.maxcanvas.org\/index.php?rest_route=\/wp\/v2\/pages\/299\/revisions"}],"predecessor-version":[{"id":311,"href":"https:\/\/www.maxcanvas.org\/index.php?rest_route=\/wp\/v2\/pages\/299\/revisions\/311"}],"wp:attachment":[{"href":"https:\/\/www.maxcanvas.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}