fs_bokeh_dof_single_pass.sc 568 B

12345678910111213141516171819202122232425
  1. $input v_texcoord0
  2. /*
  3. * Copyright 2021 elven cache. All rights reserved.
  4. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
  5. */
  6. #include "../common/common.sh"
  7. #include "parameters.sh"
  8. #include "bokeh_dof.sh"
  9. SAMPLER2D(s_color, 0);
  10. SAMPLER2D(s_depth, 1);
  11. void main()
  12. {
  13. vec2 texCoord = v_texcoord0.xy;
  14. vec3 outColor = DepthOfField(s_color, s_depth, texCoord, u_focusPoint, u_focusScale).xyz;
  15. // this pass is writing directly out to backbuffer, convert from linear to gamma
  16. outColor = toGamma(outColor);
  17. gl_FragColor = vec4(outColor, 1.0);
  18. }