{"id":4280,"date":"2016-07-03T00:03:19","date_gmt":"2016-07-02T16:03:19","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=4280"},"modified":"2016-07-03T18:39:43","modified_gmt":"2016-07-03T10:39:43","slug":"fake-tube-light-shader","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2016\/07\/03\/fake-tube-light-shader\/","title":{"rendered":"Fake Tube Light Shader"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4282\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2016\/07\/03\/fake-tube-light-shader\/fakelinelight\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/07\/fakelinelight.gif?fit=326%2C216&amp;ssl=1\" data-orig-size=\"326,216\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"fakelinelight\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/07\/fakelinelight.gif?fit=326%2C216&amp;ssl=1\" class=\"alignnone size-full wp-image-4282\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/07\/fakelinelight.gif?resize=326%2C216\" alt=\"fakelinelight\" width=\"326\" height=\"216\" \/><\/p>\n<p>Tried to test idea about tube lights (or &#8220;line light&#8221;), by using custom lighting in shader,<br \/>\nyou could sample the light several times from different positions\/angles,<br \/>\nso that it looks like the light is not just a single point. (not really working here properly yet, but kind of gives the effect, so it might be possible)<\/p>\n<p><strong>Source:<\/strong> *Light direction is animated in shader to show the effect<\/p>\n<style>.gist table { margin-bottom: 0; }<\/style>\n<div style=\"tab-size: 8\" id=\"gist37388649\" class=\"gist\">\n<div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n<div class=\"gist-data\">\n<div class=\"js-gist-file-update-container js-task-list-container\">\n<div id=\"file-faketubeishlight-shader\" class=\"file my-2\">\n<div itemprop=\"text\"\n      class=\"Box-body p-0 blob-wrapper data type-shaderlab  \"\n      style=\"overflow: auto\" tabindex=\"0\" role=\"region\"\n      aria-label=\"FakeTubeishLight.shader content, created by unitycoder on 03:57PM on July 02, 2016.\"\n    ><\/p>\n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n<p>  <template class=\"js-file-alert-template\"><\/p>\n<div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" data-component=\"Octicon\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n    <span><br \/>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.<br \/>\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a><br \/>\n    <\/span><\/p>\n<div data-view-component=\"true\" class=\"flash-action\">        <a href=\"{{ revealButtonHref }}\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters<br \/>\n<\/a>\n<\/div>\n<\/div>\n<p><\/template><br \/>\n<template class=\"js-line-alert-template\"><br \/>\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\"><br \/>\n    <svg aria-hidden=\"true\" data-component=\"Octicon\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n<\/span><\/template><\/p>\n<table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"FakeTubeishLight.shader\">\n<tr>\n<td id=\"file-faketubeishlight-shader-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC1\" class=\"blob-code blob-code-inner js-file-line\">Shader &quot;Custom\/FakeTubeishLight&quot;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC2\" class=\"blob-code blob-code-inner js-file-line\">{<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC3\" class=\"blob-code blob-code-inner js-file-line\">\tProperties<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC4\" class=\"blob-code blob-code-inner js-file-line\">\t{<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC5\" class=\"blob-code blob-code-inner js-file-line\">\t\t_MainTex (&quot;Texture&quot;, 2D) = &quot;white&quot; {}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC6\" class=\"blob-code blob-code-inner js-file-line\">\t}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L7\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC7\" class=\"blob-code blob-code-inner js-file-line\">\tSubShader<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L8\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC8\" class=\"blob-code blob-code-inner js-file-line\">\t{<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L9\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"9\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC9\" class=\"blob-code blob-code-inner js-file-line\">\t\tTags { &quot;RenderType&quot;=&quot;Opaque&quot; }<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L10\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"10\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC10\" class=\"blob-code blob-code-inner js-file-line\">\t\tLOD 100<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L11\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"11\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC11\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tCGPROGRAM<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L12\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"12\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC12\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t#pragma surface surf SimpleSpecular<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L13\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"13\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC13\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L14\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"14\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC14\" class=\"blob-code blob-code-inner js-file-line\">\t\t\thalf4 LightingSimpleSpecular (SurfaceOutput s, half3 lightDir, half3 viewDir, half atten) {<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L15\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"15\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC15\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L16\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"16\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC16\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\thalf4 c = half4(0,0,0,0);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L17\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"17\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC17\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L18\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"18\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC18\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tint steps = 16;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L19\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"19\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC19\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L20\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"20\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC20\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\/\/ sample light many times with different values<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L21\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"21\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC21\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfor(int i=0;i&lt;steps;i++)<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L22\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"22\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC22\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t{<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L23\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"23\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC23\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L24\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"24\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC24\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\thalf3 l = lerp(half3(1,1,i),half3(i,1,1),fmod(_Time.x*10,1));<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L25\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"25\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC25\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\thalf3 h = normalize (lightDir*l + viewDir);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L26\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"26\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC26\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\thalf diff = max (0, dot (s.Normal, lightDir*l));<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L27\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"27\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC27\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\tfloat nh = max (0, dot (s.Normal, h));<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L28\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"28\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC28\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\tfloat spec = pow (nh, 10.0);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L29\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"29\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC29\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L30\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"30\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC30\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\tc.rgb += (s.Albedo * _LightColor0.rgb * diff + _LightColor0.rgb * spec) * atten;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L31\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"31\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC31\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L32\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"32\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC32\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L33\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"33\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC33\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tc.rgb \/=steps;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L34\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"34\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC34\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L35\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"35\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC35\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tc.a = s.Alpha;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L36\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"36\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC36\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\treturn c;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L37\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"37\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC37\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L38\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"38\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC38\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L39\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"39\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC39\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L40\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"40\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC40\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tstruct Input {<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L41\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"41\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC41\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat2 uv_MainTex;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L42\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"42\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC42\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t};<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L43\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"43\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC43\" class=\"blob-code blob-code-inner js-file-line\">    <\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L44\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"44\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC44\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tsampler2D _MainTex;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L45\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"45\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC45\" class=\"blob-code blob-code-inner js-file-line\">    <\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L46\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"46\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC46\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tvoid surf (Input IN, inout SurfaceOutput o) {<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L47\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"47\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC47\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\to.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L48\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"48\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC48\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L49\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"49\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC49\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tENDCG<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L50\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"50\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC50\" class=\"blob-code blob-code-inner js-file-line\">\t}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-faketubeishlight-shader-L51\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"51\"><\/td>\n<td id=\"file-faketubeishlight-shader-LC51\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n<\/tr>\n<\/table>\n<\/div><\/div>\n<\/p><\/div>\n<\/div><\/div>\n<div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/unitycoder\/a4ffdf0437de63b4bdbfcd28f3c0cd35\/raw\/6983407ceb216baff555ee4916dd28a45a43b103\/FakeTubeishLight.shader\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a><br \/>\n        <a href=\"https:\/\/gist.github.com\/unitycoder\/a4ffdf0437de63b4bdbfcd28f3c0cd35#file-faketubeishlight-shader\" class=\"Link--inTextBlock\"><br \/>\n          FakeTubeishLight.shader<br \/>\n        <\/a><br \/>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n<\/p><\/div>\n<\/div>\n<p>If you want real Area Lights, check:<br \/>\n&#8211; UnityLabs : <a href=\"https:\/\/labs.unity.com\/article\/real-time-polygonal-light-shading-linearly-transformed-cosines\">https:\/\/labs.unity.com\/article\/real-time-polygonal-light-shading-linearly-transformed-cosines<\/a><br \/>\n&#8211; Lux : <a href=\"http:\/\/forum.unity3d.com\/threads\/lux-an-open-source-physically-based-shading-framework.235027\/page-23#post-2618971\">http:\/\/forum.unity3d.com\/threads\/lux-an-open-source-physically-based-shading-framework.235027\/page-23#post-2618971<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tried to test idea about tube lights (or &#8220;line light&#8221;), by using custom lighting in shader, you could sample the light several times from different positions\/angles, so that it looks like the light is not just a single point. (not really working here properly yet, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4283,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Fake Tube Light Shader","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[13,3],"tags":[331,7,52,76,14,881,880],"class_list":["post-4280","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shaders","category-unity3d","tag-area","tag-fake","tag-light","tag-line","tag-shader","tag-shape","tag-tube"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/07\/line-light.jpg?fit=331%2C245&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-172","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=4280"}],"version-history":[{"count":3,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4280\/revisions"}],"predecessor-version":[{"id":4286,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4280\/revisions\/4286"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/4283"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=4280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=4280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=4280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}