{"id":2635,"date":"2014-01-28T20:20:30","date_gmt":"2014-01-28T17:20:30","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=2635"},"modified":"2014-07-25T02:04:41","modified_gmt":"2014-07-24T23:04:41","slug":"ray-traced-fake-soft-shadows-shader","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2014\/01\/28\/ray-traced-fake-soft-shadows-shader\/","title":{"rendered":"Ray-traced Fake Soft Shadows (Shader)"},"content":{"rendered":"<p><a title=\"http:\/\/unitycoder.com\/upload\/demos\/RaytracedShadowShader\/\" href=\"http:\/\/unitycoder.com\/upload\/demos\/RaytracedShadowShader\/\" target=\"_blank\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2636\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/01\/28\/ray-traced-fake-soft-shadows-shader\/raytrace_pointlight_shadows_unity_indie_1\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/raytrace_pointlight_shadows_unity_indie_1.jpg?fit=680%2C416&amp;ssl=1\" data-orig-size=\"680,416\" 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;}\" data-image-title=\"raytrace_pointlight_shadows_unity_indie_1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/raytrace_pointlight_shadows_unity_indie_1.jpg?fit=680%2C416&amp;ssl=1\" class=\"alignnone size-full wp-image-2636\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/raytrace_pointlight_shadows_unity_indie_1.jpg?resize=680%2C416\" alt=\"raytrace_pointlight_shadows_unity_indie_1\" width=\"680\" height=\"416\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/raytrace_pointlight_shadows_unity_indie_1.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/raytrace_pointlight_shadows_unity_indie_1.jpg?resize=300%2C183&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<p>Mooore fake shadows testing! (based on direct3D shaders)<\/p>\n<p><strong>Info:<\/strong><br \/>\n&#8211; Works with unity indie\/free!<br \/>\n&#8211; Just a shader with sphere intersect function (so it basically only works with spheres..)<br \/>\n&#8211; Point light &amp; sphere positions are sent to the shader<br \/>\n&#8211; Each sphere requires invidual shadow collector flat plane (they are combined with blend modes)<br \/>\n&#8211; Options for: Soft shadows, Hard Shadows, Tinted shadows<br \/>\n&#8211; 1 or more spotlight positions<\/p>\n<p>Maybe small bug, sphere radius should be half in shader, seems that the shadows is too big..<\/p>\n<p><strong>Webplayer:<br \/>\n<\/strong><a title=\"http:\/\/unitycoder.com\/upload\/demos\/RaytracedShadowShader\/\" href=\"http:\/\/unitycoder.com\/upload\/demos\/RaytracedShadowShader\/\" target=\"_blank\">http:\/\/unitycoder.com\/upload\/demos\/RaytracedShadowShader\/<\/a> (1 spotlight, 3 shader variations )<br \/>\n<a title=\"http:\/\/unitycoder.com\/upload\/demos\/RaytracedShadowShader2\/\" href=\"http:\/\/unitycoder.com\/upload\/demos\/RaytracedShadowShader2\/\" target=\"_blank\">http:\/\/unitycoder.com\/upload\/demos\/RaytracedShadowShader2\/<\/a> (2 spotlights)<a title=\"http:\/\/unitycoder.com\/upload\/demos\/RaytracedShadowShader\/\" href=\"http:\/\/unitycoder.com\/upload\/demos\/RaytracedShadowShader\/\" target=\"_blank\"><strong><br \/>\n<\/strong><\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Shader source:<\/strong><\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\r\n\/\/ original source: http:\/\/content.gpwiki.org\/D3DBook:Ray-traced_Shadows\r\n\r\nShader &quot;Custom\/RaytraceMultiShadowsHard&quot; {\r\n\r\n\u00a0\u00a0\u00a0 Properties \r\n\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0_Color (&quot;Main Color&quot;, Color) = (0,1,0,1)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _BallPos(&quot;BallPos&quot;, Vector) = (0, 0, 0, 0)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _LightPos(&quot;lightPos&quot;, Vector) = (1, 10, 0, 0)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _LightPos2(&quot;lightPos2&quot;, Vector) = (1, 10, 0, 0)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 _BallRadius(&quot;ballRadius&quot;, Float) = 1.0\r\n\u00a0\u00a0\u00a0 }\r\n\r\n\u00a0\u00a0 \u00a0SubShader {\r\n\u00a0\u00a0 \u00a0Tags {&quot;Queue&quot;=&quot;Transparent&quot; &quot;RenderType&quot;=&quot;Transparent&quot;} \/\/Change this\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0Pass {\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\/\/Blend DstColor SrcColor \r\n\/\/Blend SrcAlpha OneMinusSrcAlpha\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0Blend SrcAlpha OneMinusSrcAlpha \/\/Add This\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0CGPROGRAM\r\n\/\/ Upgrade NOTE: excluded shader from DX11 and Xbox360; has structs without semantics (struct v2f members wpos)\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0#pragma exclude_renderers d3d11 xbox360\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0#pragma vertex vert\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0#pragma fragment frag alpha\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #pragma fragmentoption ARB_precision_hint_fastest\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/#pragma target 3.0\r\n\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0#include &quot;UnityCG.cginc&quot;\r\n\r\n\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0float4 _Color;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0float4 _BallPos;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0float4 _LightPos;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0float4 _LightPos2;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0float _BallRadius;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\r\n\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\/\/this function returns the distance of a point to a line:\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0float dist_p2l(float3 pnt, float3 l0, float3 l1)\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0{\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 float3 v = l1 - l0;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 float3 w = pnt - l0;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 \/\/determine the relations of the dot products of a triangle\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 \/\/formed by the vectors\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 float c1 = dot(w,v);\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 float c2 = dot(v,v);\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 float b = c1\/c2;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 \/\/and use them to calculate the distance.\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 float3 pb = l0 + b * v;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 return distance (pnt, pb);\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0}\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0float getSphereIntersect(float3 lightPos, float3 pixelPos, float3 ballPos, float ballRadius, out bool hit)\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0{\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 hit = true;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 float dist = dist_p2l(ballPos, pixelPos, lightPos);\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 if (dist &gt; ballRadius) \r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0hit=false; return 0;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 }else\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/prepare the shadow intensity here.\r\n\/\/\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return 1-cos(1.0-(dist\/ballRadius));\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return dist\/ballRadius;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0}\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 struct a2v {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 float4 vertex : POSITION;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/float4 texcoord : TEXCOORD0;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 };\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 struct v2f {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 float4 pos : SV_POSITION;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Shader warning in 'Custom\/RaytraceShadows': Program 'vert', 'vert': function return value missing semantics (compiling for d3d11_9x) at line 22\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Shader warning in 'Custom\/RaytraceShadows': Program 'vert', 'getSphereIntersect': implicit truncation of vector type (compiling for d3d11_9x) at line 87\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/float4 wpos;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 float3 wpos;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/float2 uv : TEXCOORD0;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 };\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 v2f vert(a2v v) {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 v2f o;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 o.pos = mul(UNITY_MATRIX_MVP, v.vertex);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 o.wpos = mul(_Object2World, v.vertex);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\/\/o.uv = v.texcoord.xy;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 return o;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0float4 frag(v2f i) : COLOR \r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0{\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0bool hit;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0float shadowIntensity=10;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 shadowIntensity = getSphereIntersect(_LightPos,i.wpos, _BallPos, _BallRadius, hit);\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \r\n\/\/\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 float4 ret = _Color;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 float4 ret = float4(0,0,0,0);\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 float a=0;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 if (hit)\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 {\r\n\/\/\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ret.rgb *= shadowIntensity;\r\n\/\/\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ret.a = 1-shadowIntensity;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 a = 0.5f;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 }\r\n\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 shadowIntensity = getSphereIntersect(_LightPos2,i.wpos, _BallPos, _BallRadius, hit);\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 if (hit)\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 {\r\n\/\/\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ret.rgb *= shadowIntensity;\r\n\/\/\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ret.a = 1-shadowIntensity;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 a += 0.25f;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 \u00a0ret.a = a;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0 \r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0 return ret;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\/\/\u00a0\u00a0 \u00a0fixed4 c = fixed4(1,0,0,1);\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\/\/\u00a0\u00a0 \u00a0return c;\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0}\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0ENDCG\r\n\u00a0\u00a0 \u00a0\u00a0\u00a0 \u00a0}\r\n\u00a0\u00a0 \u00a0}\r\n}\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mooore fake shadows testing! (based on direct3D shaders) Info: &#8211; Works with unity indie\/free! &#8211; Just a shader with sphere intersect function (so it basically only works with spheres..) &#8211; Point light &amp; sphere positions are sent to the shader &#8211; Each sphere requires invidual [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2636,"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":"","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":[4,3],"tags":[7,426,317,586,14,40,385],"class_list":["post-2635","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-demos","category-unity3d","tag-fake","tag-material","tag-ray","tag-raytrace","tag-shader","tag-shadow","tag-soft"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/01\/raytrace_pointlight_shadows_unity_indie_1.jpg?fit=680%2C416&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-Gv","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2635","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=2635"}],"version-history":[{"count":14,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2635\/revisions"}],"predecessor-version":[{"id":3126,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2635\/revisions\/3126"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/2636"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=2635"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=2635"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=2635"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}