blurF.glsl
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:1k
源码类别:

游戏引擎

开发平台:

C++ Builder

  1. /**
  2.  * @file blurf.glsl
  3.  *
  4.  * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
  5.  * $License$
  6.  */
  7. uniform sampler2DRect RenderTexture;
  8. uniform float bloomStrength;
  9. varying vec4 gl_TexCoord[gl_MaxTextureCoords];
  10. void main(void) 
  11. {
  12. float blurWeights[7];
  13. blurWeights[0] = 0.05;
  14. blurWeights[1] = 0.1;
  15. blurWeights[2] = 0.2;
  16. blurWeights[3] = 0.3;
  17. blurWeights[4] = 0.2;
  18. blurWeights[5] = 0.1;
  19. blurWeights[6] = 0.05;
  20. vec3 color = vec3(0,0,0);
  21. for (int i = 0; i < 7; i++){
  22. color += vec3(texture2DRect(RenderTexture, gl_TexCoord[i].st)) * blurWeights[i];
  23. }
  24. color *= bloomStrength;
  25. gl_FragColor = vec4(color, 1.0);
  26. }