UE4 径向模糊radiu blur

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;

 

相关文章:

  • 2021-12-01
  • 2021-09-13
  • 2022-03-02
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2021-07-11
猜你喜欢
  • 2021-09-13
  • 2022-12-23
  • 2021-09-22
  • 2021-08-08
  • 2021-06-22
  • 2021-07-16
  • 2021-05-04
相关资源
相似解决方案