GpuParticles.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. // Particle emitter properties
  9. struct GpuParticleEmitterProperties
  10. {
  11. Vec3 m_minGravity;
  12. F32 m_minMass;
  13. Vec3 m_maxGravity;
  14. F32 m_maxMass;
  15. Vec3 m_minForce;
  16. F32 m_minLife;
  17. Vec3 m_maxForce;
  18. F32 m_maxLife;
  19. Vec3 m_minStartingPosition;
  20. F32 m_padding0;
  21. Vec3 m_maxStartingPosition;
  22. U32 m_particleCount;
  23. };
  24. // GPU particle state
  25. struct GpuParticle
  26. {
  27. Vec3 m_oldWorldPosition;
  28. F32 m_mass;
  29. Vec3 m_newWorldPosition;
  30. F32 m_life;
  31. Vec3 m_acceleration;
  32. F32 m_startingLife; // The original max life
  33. Vec3 m_velocity;
  34. F32 m_padding1;
  35. };
  36. struct GpuParticleSimulationState
  37. {
  38. Mat4 m_viewProjMat;
  39. Vec4 m_unprojectionParams;
  40. Vec2 m_padding0;
  41. U32 m_randomIndex;
  42. F32 m_dt;
  43. Vec3 m_emitterPosition;
  44. F32 m_padding1;
  45. #if defined(__cplusplus)
  46. Mat3x4 m_emitterRotation;
  47. #else
  48. Mat3 m_emitterRotation;
  49. #endif
  50. #if defined(__cplusplus)
  51. Mat3x4 m_invViewRotation;
  52. #else
  53. Mat3 m_invViewRotation;
  54. #endif
  55. };
  56. ANKI_END_NAMESPACE