fs_bokeh_dof_second_pass.sc 547 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. #define USE_PACKED_COLOR_AND_BLUR 1
  9. #include "bokeh_dof.sh"
  10. SAMPLER2D(s_color, 0);
  11. void main()
  12. {
  13. vec2 texCoord = v_texcoord0.xy;
  14. vec4 outColor = DepthOfField(s_color, s_color, texCoord, u_focusPoint, u_focusScale);
  15. // this pass isn't writing final output, leave in linear space for combining with scene color
  16. gl_FragColor = outColor;
  17. }