2
0

postProcess_optimized.frag 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #version 150
  2. out vec4 a_color;
  3. noperspective in vec2 v_texCoords;
  4. uniform sampler2D u_colorTexture;
  5. uniform sampler2D u_bloomTexture;
  6. uniform float u_bloomIntensity;
  7. uniform float u_exposure;
  8. uniform int u_useSSAO;
  9. uniform float u_ssaoExponent;
  10. uniform sampler2D u_ssao;
  11. void main ()
  12. {
  13. float ssaof_1;
  14. vec4 tmpvar_2;
  15. tmpvar_2 = texture (u_colorTexture, v_texCoords);
  16. ssaof_1 = 1.0;
  17. if ((u_useSSAO != 0)) {
  18. ssaof_1 = pow (texture (u_ssao, v_texCoords).x, u_ssaoExponent);
  19. } else {
  20. ssaof_1 = 1.0;
  21. };
  22. a_color.xyz = ((texture (u_bloomTexture, v_texCoords).xyz * u_bloomIntensity) + (tmpvar_2.xyz * ssaof_1));
  23. vec3 color_3;
  24. color_3 = (a_color.xyz * u_exposure);
  25. mat3 tmpvar_4;
  26. tmpvar_4[0].x = 0.59719;
  27. tmpvar_4[1].x = 0.35458;
  28. tmpvar_4[2].x = 0.04823;
  29. tmpvar_4[0].y = 0.076;
  30. tmpvar_4[1].y = 0.90834;
  31. tmpvar_4[2].y = 0.01566;
  32. tmpvar_4[0].z = 0.0284;
  33. tmpvar_4[1].z = 0.13383;
  34. tmpvar_4[2].z = 0.83777;
  35. color_3 = (tmpvar_4 * color_3);
  36. mat3 tmpvar_5;
  37. tmpvar_5[0].x = 1.60475;
  38. tmpvar_5[1].x = -0.53108;
  39. tmpvar_5[2].x = -0.07367;
  40. tmpvar_5[0].y = -0.10208;
  41. tmpvar_5[1].y = 1.10813;
  42. tmpvar_5[2].y = -0.00605;
  43. tmpvar_5[0].z = -0.00327;
  44. tmpvar_5[1].z = -0.07276;
  45. tmpvar_5[2].z = 1.07602;
  46. color_3 = (tmpvar_5 * ((
  47. (color_3 * (color_3 + 0.0245786))
  48. - 9.0537e-5) / (
  49. (color_3 * ((0.983729 * color_3) + 0.432951))
  50. + 0.238081)));
  51. vec3 tmpvar_6;
  52. tmpvar_6 = clamp (color_3, 0.0, 1.0);
  53. color_3 = tmpvar_6;
  54. a_color.xyz = pow (tmpvar_6, vec3(0.4545454, 0.4545454, 0.4545454));
  55. a_color.w = tmpvar_2.w;
  56. }