 
             /*!
              * @brief Fragment shader function.
-             * @param [in] i  Input data from vertex shader
-             * @return Output of each texels (pout).
-             */
-            pout frag(v2f i)
-            {
-                // The start position of the ray is the local coordinate of the camera.
-                const float3 localSpaceCameraPos = mul(unity_WorldToObject, float4(_WorldSpaceCameraPos, 1.0)).xyz;
+             * @param [in] fi  Input data from vertex shader
+             * @return Output of each texels (fout).
+             */
+            fout frag(v2f fi)
+            {
                 // Define ray direction by finding the direction of the local coordinates
                 // of the mesh from the local coordinates of the viewpoint.
-                const float3 rayDir = normalize(i.pos.xyz - localSpaceCameraPos);
+                const float3 rayDir = normalize(fi.pos.xyz - fi.localSpaceCameraPos);
                 const float invScale = 1.0 / _Scale;
 
                 // Distance.

                // Discard if it is determined that the ray is not in collision.
                clip(_MinRayDist - d);

                const float finalPos = localSpaceCameraPos + rayDir * t;

                // Normal.
                const float3 normal = getNormal(finalPos);
                // Directional light angles to local coordinates.
                const float3 lightDir = normalize(mul(unity_WorldToObject, _WorldSpaceLightPos0).xyz);
                // View direction.
                const float3 viewDir = normalize(localSpacaCameraPos - finalPos);

                // Lambertian reflectance.
                const float3 lightCol = _LightColor0.rgb * LIGHT_ATTENUATION(i);
                const float nDotL = saturate(dot(normal, lightDir));

#if defined(_DIFFUSEMODE_SQURED_HALF_LEMBERT)
                const float3 diffuse = lightCol * sq(nDotL * 0.5 + 0.5);
#elif defined(_DIFFUSEMODE_HALF_LEMBERT)
                const float3 diffuse = lightCol * (nDotL * 0.5 + 0.5);
#elif defined(_DIFFUSEMODE_LEMBERT)
                const float3 diffuse = lightCol * nDotL;
#else
                const float3 diffuse = float3(1.0, 1.0, 1.0);
#endif  // defined(_DIFFUSEMODE_SQURED_HALF_LEMBERT)

                // Specular reflection.
#ifdef _SPECULARMODE_HALF_VECTOR
                const float3 specular = pow(max(0.0, dot(normalize(lightDir + viewDir), normal)), _SpecularPower) * _SpecularColor.xyz * lightCol;
#elif _SPECULARMODE_ORIGINAL
                const float3 specular = pow(max(0.0, dot(reflect(-lightDir, normal), viewDir)), _SpecularPower) * _SpecularColor.xyz * lightCol;
#else
                const float3 specular = float3(0.0, 0.0, 0.0);
#endif  // _SPECULARMODE_HALF_VECTOR

                // Loop of Ray Marching.
                for (int i = 0; i < _MaxLoop; i++) {
                    // Position of the tip of the ray.
                    const float3 p = fi.localSpaceCameraPos + rayDir * t;
                    d = sdf(p * _Scale) * invScale;

                    // Break this loop if the ray goes too far or collides.
