                 static const float2 kh = k * 0.0001;
 
                 return normalize(
-                    k.xyy * dist(p + kh.xyy)
-                        + k.yyx * dist(p + kh.yyx)
-                        + k.yxy * dist(p + kh.yxy)
-                        + k.xxx * dist(p + kh.xxx));
+                    k.xyy * sdf(p + kh.xyy)
+                        + k.yyx * sdf(p + kh.yyx)
+                        + k.yxy * sdf(p + kh.yxy)
+                        + k.xxx * sdf(p + kh.xxx));
 
 #else
                 // Naive normal calculation.


        [Enum(UnityEngine.Rendering.CullMode)]
        _Cull ("Culling Mode", Int) = 1  // Default: Front

        [Enum(Off, 0, On, 1)]
        _AlphaToMask ("Alpha To Mask", Int) = 0  // Default: Off

                // 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

                // Ambient color.
#ifdef _AMBIENTMODE_SH9
                const float3 ambient = ShadeSH9(half4(UnityObjectToWorldNormal(normal), 1.0));
#elif _AMBIENTMODE_LEGACY
                const float3 ambient = UNITY_LIGHTMODEL_AMBIENT.rgb;
#else
                const float3 ambient = float3(0.0, 0.0, 0.0);
#endif  // _AMBIENTMODE_SH9

#ifdef _ENABLE_REFLECTION_PROBE
                const half4 refColor = getRefProbeColor(UnityObjectToWorldNormal(reflect(-viewDir, normal)));
                const float4 col = float4((diffuse + ambient) * lerp(_Color.rgb, refColor.rgb, _RefProbeBlendCoeff) + specular, _Color.a);
#else
                // Output color.
