码迷,mamicode.com
首页 > 其他好文 > 详细

UE4 径向模糊radiu blur

时间:2017-05-03 17:20:09      阅读:1669      评论:0      收藏:0      [点我收藏+]

标签:技术分享   nbsp   alt   ima   bsp   分享   return   style   sam   

技术分享

hlsl代码为:

 

  

 1 float2 ScreenMult = 1;
 2 int TexIndex = 14;
 3 float samples[10] = {-0.08,-0.05,-0.03,-0.02,-0.01,0.01,0.02,0.03,0.05,0.08};
 4 float2 dir = ScreenMult * float2(0.5,0.5) - UV; 
 5 float4 sum = SceneTextureLookup(UV, TexIndex, false);
 6 float2 pos = float2(0.0,0.0);
 7 for(int i = 0; i<10; i++)
 8 {
 9     pos = UV + dir * samples[i] * sampleDist;
10     max(min(pos, ScreenMult * float2(1.0, 1.0)), float2(0.0,0.0));
11     sum += SceneTextureLookup(pos, TexIndex, false);
12 }
13 sum *= 1.0/11.0;
14 return sum;

 

UE4 径向模糊radiu blur

标签:技术分享   nbsp   alt   ima   bsp   分享   return   style   sam   

原文地址:http://www.cnblogs.com/litmin/p/6744024.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!