TraditionalDeferredShading.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #pragma once
  6. #include <shaders/glsl_cpp_common/Common.h>
  7. ANKI_BEGIN_NAMESPACE
  8. struct DeferredPointLightUniforms
  9. {
  10. Vec4 m_inputTexUvScaleAndOffset; // Use this to get the correct face UVs
  11. Mat4 m_invViewProjMat;
  12. Vec4 m_camPosPad1;
  13. Vec4 m_fbSizePad2;
  14. // Light props
  15. Vec4 m_posRadius; // xyz: Light pos in world space. w: The -1/radius
  16. Vec4 m_diffuseColorPad1; // xyz: diff color
  17. };
  18. struct DeferredSpotLightUniforms
  19. {
  20. Vec4 m_inputTexUvScaleAndOffset; // Use this to get the correct face UVs
  21. Mat4 m_invViewProjMat;
  22. Vec4 m_camPosPad1;
  23. Vec4 m_fbSizePad2;
  24. // Light props
  25. Vec4 m_posRadius; // xyz: Light pos in world space. w: The -1/radius
  26. Vec4 m_diffuseColorOuterCos; // xyz: diff color, w: outer cosine of spot
  27. Vec4 m_lightDirInnerCos; // xyz: light dir, w: inner cosine of spot
  28. };
  29. struct DeferredVertexUniforms
  30. {
  31. Mat4 m_mvp;
  32. };
  33. const UVec2 GBUFFER_RT0_BINDING = UVec2(0, 0);
  34. const UVec2 GBUFFER_RT1_BINDING = UVec2(0, 1);
  35. const UVec2 GBUFFER_RT2_BINDING = UVec2(0, 2);
  36. const UVec2 GBUFFER_DEPTH_BINDING = UVec2(0, 3);
  37. ANKI_END_NAMESPACE