TonemappingResources.glsl 939 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright (C) 2009-2018, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. // Tonemapping resources
  6. #ifndef ANKI_SHADERS_TONEMAPPING_RESOURCES_GLSL
  7. #define ANKI_SHADERS_TONEMAPPING_RESOURCES_GLSL
  8. #include "shaders/Common.glsl"
  9. #ifndef TONEMAPPING_SET
  10. # define TONEMAPPING_SET 0
  11. #endif
  12. #ifndef TONEMAPPING_BINDING
  13. # define TONEMAPPING_BINDING 0
  14. #endif
  15. #ifndef TONEMAPPING_RESOURCE_AS_BUFFER
  16. # define TONEMAPPING_RESOURCE_AS_BUFFER 0
  17. #endif
  18. #if TONEMAPPING_RESOURCE_AS_BUFFER
  19. layout(std140, ANKI_SS_BINDING(TONEMAPPING_SET, TONEMAPPING_BINDING)) buffer tmss0_
  20. #else
  21. layout(std140, ANKI_UBO_BINDING(TONEMAPPING_SET, TONEMAPPING_BINDING)) uniform tmu0_
  22. #endif
  23. {
  24. vec4 u_averageLuminanceExposurePad2;
  25. };
  26. #define u_averageLuminance u_averageLuminanceExposurePad2.x
  27. #define u_exposureThreshold0 u_averageLuminanceExposurePad2.y
  28. #endif