transparent shadow caster unity

https://forum.unity.com/threads/semitransparent-shadows.276490/

semitransparent shadows

dither 类似alpha to coverage

half alphaRef = tex3D(_DitherMaskLOD, float3(vpos.xy*0.25,alpha*0.9375)).a;

和传统shadowmap一样 半透明物体也写入shadowmap只是写的时候用ditherTex决定像素写多少来体现透明程度,之后再用pcf糊一下

那种技术 在这里有讲

http://gad.qq.com/program/translateview/7200861

先用alpha做discard 在shadow caster 并依赖alpha

最后做模糊

 这样camera移动会产生抖动的问题,解决方法 增加sm精度 高pcf 或者换实现 或者把camera对dither采样结果发生改变的那部分抵消掉

还有个简单方法是 再画套假的 

这个解决方案 具体问题具体分析了

猜你喜欢

转载自www.cnblogs.com/minggoddess/p/9240595.html
今日推荐