common.sh 371 B

12345678910111213141516
  1. /*
  2. * Copyright 2011-2017 Branimir Karadzic. All rights reserved.
  3. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
  4. */
  5. #include <bgfx_shader.sh>
  6. uniform vec4 u_params;
  7. #define u_textureLod u_params.x
  8. #define u_textureLayer u_params.y
  9. #define u_ev u_params.w
  10. vec4 toEv(vec4 _color)
  11. {
  12. return vec4(_color.xyz * pow(2.0, u_ev), _color.w);
  13. }