plant_gpu.h 837 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <QVector3D>
  3. #include <QVector4D>
  4. namespace Render::GL {
  5. struct PlantInstanceGpu {
  6. QVector4D pos_scale;
  7. QVector4D color_sway;
  8. QVector4D type_params;
  9. };
  10. struct PlantBatchParams {
  11. static constexpr float kDefaultLightDirX = 0.35F;
  12. static constexpr float kDefaultLightDirY = 0.8F;
  13. static constexpr float kDefaultLightDirZ = 0.45F;
  14. static constexpr float kDefaultWindStrength = 0.25F;
  15. static constexpr float kDefaultWindSpeed = 1.4F;
  16. static auto default_light_direction() -> QVector3D {
  17. return {kDefaultLightDirX, kDefaultLightDirY, kDefaultLightDirZ};
  18. }
  19. QVector3D light_direction = default_light_direction();
  20. float time = 0.0F;
  21. float wind_strength = kDefaultWindStrength;
  22. float wind_speed = kDefaultWindSpeed;
  23. float pad0 = 0.0F;
  24. float pad1 = 0.0F;
  25. };
  26. } // namespace Render::GL