2011-12-17 10:55:37 +00:00
|
|
|
#ifndef _PAYSAGES_SKY_H_
|
|
|
|
#define _PAYSAGES_SKY_H_
|
|
|
|
|
|
|
|
#include "shared/types.h"
|
2012-03-08 15:10:25 +00:00
|
|
|
#include "color.h"
|
2012-01-22 22:06:11 +00:00
|
|
|
#include "lighting.h"
|
2012-04-22 17:12:39 +00:00
|
|
|
#include "pack.h"
|
2011-12-17 10:55:37 +00:00
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2012-06-22 22:13:55 +00:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
SKY_MODEL_CUSTOM = 0,
|
2012-06-24 12:33:59 +00:00
|
|
|
SKY_MODEL_RAYLEIGH_MIE = 1,
|
|
|
|
SKY_MODEL_PREETHAM = 2
|
2012-06-22 22:13:55 +00:00
|
|
|
} SkyModel;
|
2011-12-23 22:58:50 +00:00
|
|
|
|
2011-12-17 10:55:37 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2012-06-22 22:13:55 +00:00
|
|
|
SkyModel model;
|
2012-06-17 09:40:40 +00:00
|
|
|
double daytime;
|
2012-06-22 22:13:55 +00:00
|
|
|
Color sun_color;
|
2012-06-17 09:40:40 +00:00
|
|
|
double sun_radius;
|
|
|
|
double sun_halo_size;
|
2012-06-07 19:26:23 +00:00
|
|
|
Curve* sun_halo_profile;
|
2012-06-24 16:04:01 +00:00
|
|
|
double dome_lighting;
|
2012-06-22 22:13:55 +00:00
|
|
|
struct {
|
|
|
|
int auto_from_daytime;
|
|
|
|
Color zenith_color;
|
|
|
|
Color haze_color;
|
|
|
|
double haze_height;
|
|
|
|
double haze_smoothing;
|
|
|
|
ColorGradation* _sky_gradation;
|
|
|
|
} model_custom;
|
|
|
|
struct {
|
|
|
|
double turbidity;
|
|
|
|
} model_preetham;
|
2011-12-17 10:55:37 +00:00
|
|
|
} SkyDefinition;
|
|
|
|
|
2012-04-22 17:12:39 +00:00
|
|
|
void skySave(PackStream* stream, SkyDefinition* definition);
|
|
|
|
void skyLoad(PackStream* stream, SkyDefinition* definition);
|
2011-12-17 10:55:37 +00:00
|
|
|
|
|
|
|
SkyDefinition skyCreateDefinition();
|
2012-01-23 23:45:33 +00:00
|
|
|
void skyDeleteDefinition(SkyDefinition* definition);
|
|
|
|
void skyCopyDefinition(SkyDefinition* source, SkyDefinition* destination);
|
2011-12-17 10:55:37 +00:00
|
|
|
void skyValidateDefinition(SkyDefinition* definition);
|
|
|
|
|
2012-06-24 16:04:01 +00:00
|
|
|
int skyGetLights(SkyDefinition* sky, Renderer* renderer, LightDefinition* lights, int max_lights);
|
2012-01-23 23:45:33 +00:00
|
|
|
Color skyGetColor(SkyDefinition* definition, Renderer* renderer, Vector3 eye, Vector3 look);
|
2012-01-29 21:45:58 +00:00
|
|
|
void skyRender(SkyDefinition* definition, Renderer* renderer);
|
2012-05-08 14:07:47 +00:00
|
|
|
Vector3 skyGetSunDirection(SkyDefinition* definition);
|
|
|
|
Color skyGetSunColor(SkyDefinition* definition);
|
|
|
|
Color skyGetZenithColor(SkyDefinition* definition);
|
2012-06-24 12:33:59 +00:00
|
|
|
Color skyGetHorizonColor(SkyDefinition* definition);
|
2011-12-17 10:55:37 +00:00
|
|
|
|
2011-12-23 22:58:50 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2011-12-17 10:55:37 +00:00
|
|
|
#endif
|