paysages3d/lib_paysages/water.h

72 lines
1.8 KiB
C
Raw Normal View History

#ifndef _PAYSAGES_WATER_H_
#define _PAYSAGES_WATER_H_
#include "tools/color.h"
#include "tools/euclid.h"
#include "tools/lighting.h"
#include "tools/pack.h"
#include "renderer.h"
#include "noise.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum
{
WATER_PRESET_LAKE,
WATER_PRESET_SEA
} WaterPreset;
typedef struct
{
double height;
double transparency;
double reflection;
SurfaceMaterial material;
Color depth_color;
double transparency_depth;
double lighting_depth;
double scaling;
double turbulence;
double waves_height;
double detail_height;
double foam_coverage;
SurfaceMaterial foam_material;
NoiseGenerator* _waves_noise;
} WaterDefinition;
typedef struct
{
Vector3 location;
Color base;
Color reflected;
Color refracted;
Color foam;
Color final;
} WaterResult;
void waterSave(PackStream* stream, WaterDefinition* definition);
void waterLoad(PackStream* stream, WaterDefinition* definition);
WaterDefinition waterCreateDefinition();
void waterDeleteDefinition(WaterDefinition* definition);
void waterAutoPreset(WaterDefinition* definition, WaterPreset preset);
void waterCopyDefinition(WaterDefinition* source, WaterDefinition* destination);
void waterValidateDefinition(WaterDefinition* definition);
HeightInfo waterGetHeightInfo(WaterDefinition* definition);
Color waterLightFilter(WaterDefinition* definition, Renderer* renderer, Color light, Vector3 location, Vector3 light_location, Vector3 direction_to_light);
WaterResult waterGetColorDetail(WaterDefinition* definition, Renderer* renderer, Vector3 location, Vector3 look);
Color waterGetColor(WaterDefinition* definition, Renderer* renderer, Vector3 location, Vector3 look);
void waterRender(WaterDefinition* definition, Renderer* renderer);
#ifdef __cplusplus
}
#endif
#endif