当前位置:   article > 正文

[UE4]径向模糊--后期处理材质(附加给camera)_模型边缘虚化

模型边缘虚化

custom代码

  1. const float2 ScreenMult = View.ViewSizeAndInvSize.xy * View.BufferSizeAndInvSize.zw;
  2. const int TexIndex = 14;
  3. const float Samples[11] = {-0.08,-0.05,-0.03,-0.02,-0.01,0,0.01,0.02,0.03,0.05,0.08};
  4. float2 dir = float2(0.5,0.5) - ViewportUV;
  5. float4 sum = float4(0.0, 0.0, 0.0, 0.0);
  6. for(int i = 0; i<11; i++)
  7. {
  8. float2 pos = ViewportUV + dir * Samples[i] * BlurDist;
  9. pos = clamp(pos, float2(0.0,0.0), float2(1.0, 1.0));
  10. sum += SceneTextureLookup(pos * ScreenMult, TexIndex, false);
  11. }
  12. return sum / 11.0;

使用的话找到相机细节里配置一下就行

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/107483
推荐阅读
相关标签
  

闽ICP备14008679号