Common.glsl 975 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright (C) 2009-2015, Panagiotis Christopoulos Charitos.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. // This file contains common code for all shaders. It's optional but it's
  6. // recomended to include it
  7. #ifndef ANKI_SHADERS_COMMON_GLSL
  8. #define ANKI_SHADERS_COMMON_GLSL
  9. // Default precision
  10. #ifndef DEFAULT_FLOAT_PRECISION
  11. #define DEFAULT_FLOAT_PRECISION highp
  12. #endif
  13. #ifndef DEFAULT_INT_PRECISION
  14. #define DEFAULT_INT_PRECISION highp
  15. #endif
  16. precision DEFAULT_FLOAT_PRECISION float;
  17. precision DEFAULT_FLOAT_PRECISION int;
  18. // Read from a render target texture
  19. //#define textureRt(tex_, texc_) texture(tex_, texc_)
  20. #define textureRt(tex_, texc_) textureLod(tex_, texc_, 0.0)
  21. // Common locations
  22. #define POSITION_LOCATION 0
  23. #define NORMAL_LOCATION 1
  24. #define TANGENT_LOCATION 2
  25. #define TEXTURE_COORDINATE_LOCATION 3
  26. #define TEXTURE_COORDINATE_LOCATION_1 4
  27. #define SCALE_LOCATION 6
  28. #define ALPHA_LOCATION 7
  29. #endif