sky.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef sky_h
  2. #define sky_h
  3. #include "cengine.h"
  4. #include "casset.h"
  5. static const float TIME_SUNRISE = 0.00;
  6. static const float TIME_MORNING = 0.10;
  7. static const float TIME_MIDDAY = 0.25;
  8. static const float TIME_EVENING = 0.40;
  9. static const float TIME_SUNSET = 0.50;
  10. static const float TIME_MIDNIGHT = 0.75;
  11. typedef struct {
  12. float time;
  13. uint32_t seed;
  14. asset_hndl cloud_mesh[14];
  15. asset_hndl cloud_tex[14];
  16. float cloud_opacity[14];
  17. asset_hndl sun_sprite;
  18. asset_hndl sun_tex;
  19. asset_hndl moon_sprite;
  20. asset_hndl moon_tex;
  21. asset_hndl stars_sprite;
  22. asset_hndl stars_tex;
  23. bool is_day;
  24. vec3 wind;
  25. mat4 world_sun;
  26. mat4 world_moon;
  27. mat4 world_stars;
  28. float moon_power;
  29. vec3 moon_direction;
  30. vec3 moon_diffuse;
  31. vec3 moon_ambient;
  32. vec3 moon_specular;
  33. float sun_power;
  34. vec3 sun_direction;
  35. vec3 sun_diffuse;
  36. vec3 sun_ambient;
  37. vec3 sun_specular;
  38. float sky_power;
  39. vec3 sky_direction;
  40. vec3 sky_diffuse;
  41. vec3 sky_ambient;
  42. vec3 sky_specular;
  43. float ground_power;
  44. vec3 ground_direction;
  45. vec3 ground_diffuse;
  46. vec3 ground_ambient;
  47. vec3 ground_specular;
  48. } sky;
  49. sky* sky_new();
  50. void sky_delete(sky* s);
  51. void sky_update(sky* s, float t, uint32_t seed);
  52. #endif