diff options
Diffstat (limited to 'filamented.cginc')
| -rw-r--r-- | filamented.cginc | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/filamented.cginc b/filamented.cginc index fb019cb..f6bd67a 100644 --- a/filamented.cginc +++ b/filamented.cginc @@ -213,30 +213,6 @@ #include "UnityCG.cginc" #include "UnityImageBasedLightingMinimal.cginc" -float normalFiltering(float perceptualRoughness, const float3 worldNormal) { - // Kaplanyan 2016, "Stable specular highlights" - // Tokuyoshi 2017, "Error Reduction and Simplification for Shading Anti-Aliasing" - // Tokuyoshi and Kaplanyan 2019, "Improved Geometric Specular Antialiasing" - - // This implementation is meant for deferred rendering in the original paper but - // we use it in forward rendering as well (as discussed in Tokuyoshi and Kaplanyan - // 2019). The main reason is that the forward version requires an expensive transform - // of the half vector by the tangent frame for every light. This is therefore an - // approximation but it works well enough for our needs and provides an improvement - // over our original implementation based on Vlachos 2015, "Advanced VR Rendering". - - float3 du = ddx(worldNormal); - float3 dv = ddy(worldNormal); - - float variance = _Specular_AA_Variance * (dot(du, du) + dot(dv, dv)); - - float roughness = perceptualRoughnessToRoughness(perceptualRoughness); - float kernelRoughness = min(2.0 * variance, _Specular_AA_Threshold); - float squareRoughness = saturate(roughness * roughness + kernelRoughness); - - return roughnessToPerceptualRoughness(sqrt(squareRoughness)); -} - half3 Unity_GlossyEnvironment_local (UNITY_ARGS_TEXCUBE(tex), half4 hdr, Unity_GlossyEnvironmentData glossIn) { half perceptualRoughness = glossIn.roughness /* perceptualRoughness */ ; |
