fs_shadowmaps_packdepth.sc 294 B

1234567891011121314
  1. $input v_position
  2. /*
  3. * Copyright 2013-2014 Dario Manesku. All rights reserved.
  4. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
  5. */
  6. #include "../common/common.sh"
  7. void main()
  8. {
  9. float depth = v_position.z/v_position.w * 0.5 + 0.5;
  10. gl_FragColor = packFloatToRgba(depth);
  11. }