TraditionalDeferredShading.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Copyright (C) 2009-2020, 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. // Use these to get the correct face UVs
  11. Vec2 m_inputTexUvScale;
  12. Vec2 m_inputTexUvBias;
  13. Vec2 m_fbUvScale;
  14. Vec2 m_fbUvBias;
  15. Mat4 m_invViewProjMat;
  16. Vec3 m_camPos;
  17. F32 m_padding;
  18. // Light props
  19. Vec3 m_position;
  20. F32 m_oneOverSquareRadius; // 1/radius^2
  21. Vec3 m_diffuseColor;
  22. F32 m_padding2;
  23. };
  24. struct DeferredSpotLightUniforms
  25. {
  26. // Use these to get the correct face UVs
  27. Vec2 m_inputTexUvScale;
  28. Vec2 m_inputTexUvBias;
  29. Vec2 m_fbUvScale;
  30. Vec2 m_fbUvBias;
  31. Mat4 m_invViewProjMat;
  32. Vec3 m_camPos;
  33. F32 m_padding;
  34. // Light props
  35. Vec3 m_position;
  36. F32 m_oneOverSquareRadius; // 1/radius^2
  37. Vec3 m_diffuseColor;
  38. F32 m_outerCos;
  39. Vec3 m_lightDir;
  40. F32 m_innerCos;
  41. };
  42. struct DeferredDirectionalLightUniforms
  43. {
  44. // Use these to get the correct face UVs
  45. Vec2 m_inputTexUvScale;
  46. Vec2 m_inputTexUvBias;
  47. Vec2 m_fbUvScale;
  48. Vec2 m_fbUvBias;
  49. Mat4 m_invViewProjMat;
  50. Vec3 m_camPos;
  51. F32 m_near;
  52. // Light props
  53. Vec3 m_diffuseColor;
  54. F32 m_far;
  55. Vec3 m_lightDir;
  56. F32 m_effectiveShadowDistance;
  57. Mat4 m_lightMatrix;
  58. };
  59. struct DeferredVertexUniforms
  60. {
  61. Mat4 m_mvp;
  62. };
  63. ANKI_END_NAMESPACE