bad_bloom.glsl 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. uniform sampler2D samp9;
  2. out vec4 ocol0;
  3. in vec2 uv0;
  4. uniform vec4 resolution;
  5. void main()
  6. {
  7. float4 c_center = texture(samp9, uv0);
  8. float4 bloom_sum = float4(0.0, 0.0, 0.0, 0.0);
  9. vec2 pos = uv0 + float2(0.3, 0.3) * resolution.zw;
  10. float2 radius1 = 1.3 * resolution.zw;
  11. bloom_sum += texture(samp9, pos + float2(-1.5, -1.5) * radius1);
  12. bloom_sum += texture(samp9, pos + float2(-2.5, 0) * radius1);
  13. bloom_sum += texture(samp9, pos + float2(-1.5, 1.5) * radius1);
  14. bloom_sum += texture(samp9, pos + float2(0, 2.5) * radius1);
  15. bloom_sum += texture(samp9, pos + float2(1.5, 1.5) * radius1);
  16. bloom_sum += texture(samp9, pos + float2(2.5, 0) * radius1);
  17. bloom_sum += texture(samp9, pos + float2(1.5, -1.5) * radius1);
  18. bloom_sum += texture(samp9, pos + float2(0, -2.5) * radius1);
  19. float2 radius2 = 4.6 * resolution.zw;
  20. bloom_sum += texture(samp9, pos + float2(-1.5, -1.5) * radius2);
  21. bloom_sum += texture(samp9, pos + float2(-2.5, 0) * radius2);
  22. bloom_sum += texture(samp9, pos + float2(-1.5, 1.5) * radius2);
  23. bloom_sum += texture(samp9, pos + float2(0, 2.5) * radius2);
  24. bloom_sum += texture(samp9, pos + float2(1.5, 1.5) * radius2);
  25. bloom_sum += texture(samp9, pos + float2(2.5, 0) * radius2);
  26. bloom_sum += texture(samp9, pos + float2(1.5, -1.5) * radius2);
  27. bloom_sum += texture(samp9, pos + float2(0, -2.5) * radius2);
  28. bloom_sum *= 0.07;
  29. bloom_sum -= float4(0.3, 0.3, 0.3, 0.3);
  30. bloom_sum = max(bloom_sum, float4(0,0,0,0));
  31. float2 vpos = (uv0 - float2(.5, .5)) * 2;
  32. float dist = (dot(vpos, vpos));
  33. dist = 1 - 0.4*dist;
  34. ocol0 = (c_center * 0.7 + bloom_sum) * dist;
  35. }