半透效果皮肤 (Aproximate Subserface-Scattering)


开发测试环境:Unity, Android (小米Max2)

主要看GDC2011这篇演讲
原理很简单,用光源反方向点乘视线方向,配合厚度图模拟半透效果

下面vLT的这个 0.2* normal 作者称之为 Subsurface Distortion

1
half3 vLT = normalize (lightDir + 0.2* normal);

其实没什么用不如去掉,实际使用时只用了-L·V

1
half fLTDot = pow(saturate(dot(viewDir, -lightDir)), _SSSPower) * _SSSScale;

1
half3 sss = thickness * (((_LightColor0.xyz * (fLTDot) + _SSSAmbient));

参考

GDC 2011 – Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look
Fast Subsurface Scattering in Unity

分享