paysages3d/lib_paysages/clouds.h
Michaël Lemaire 943cc9418e paysages : Added cloud hardness to lights.
New displacement mode for textures (perpendicular to ground).

git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@312 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
2012-04-30 19:04:39 +00:00

70 lines
2.3 KiB
C

#ifndef _PAYSAGES_CLOUDS_H_
#define _PAYSAGES_CLOUDS_H_
#include "shared/types.h"
#include "noise.h"
#include "renderer.h"
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
#define CLOUDS_MAX_LAYERS 6
typedef struct CloudsLayerDefinition CloudsLayerDefinition;
typedef double (*CloudCoverageFunc)(CloudsLayerDefinition* definition, Vector3 position);
struct CloudsLayerDefinition
{
double ycenter;
double ymin;
double ymax;
NoiseGenerator* noise;
SurfaceMaterial material;
double hardness;
double transparencydepth;
double lighttraversal;
double minimumlight;
double scaling;
double coverage;
CloudCoverageFunc customcoverage;
};
typedef struct
{
int nblayers;
CloudsLayerDefinition layers[CLOUDS_MAX_LAYERS];
} CloudsDefinition;
void cloudsInit();
void cloudsQuit();
void cloudsSave(PackStream* stream, CloudsDefinition* definition);
void cloudsLoad(PackStream* stream, CloudsDefinition* definition);
CloudsDefinition cloudsCreateDefinition();
void cloudsDeleteDefinition(CloudsDefinition* definition);
void cloudsCopyDefinition(CloudsDefinition* source, CloudsDefinition* destination);
void cloudsValidateDefinition(CloudsDefinition* definition);
CloudsLayerDefinition cloudsLayerCreateDefinition();
void cloudsLayerDeleteDefinition(CloudsLayerDefinition* definition);
void cloudsLayerCopyDefinition(CloudsLayerDefinition* source, CloudsLayerDefinition* destination);
void cloudsLayerValidateDefinition(CloudsLayerDefinition* definition);
int cloudsGetLayerCount(CloudsDefinition* definition);
CloudsLayerDefinition* cloudsGetLayer(CloudsDefinition* definition, int layer);
int cloudsAddLayer(CloudsDefinition* definition);
void cloudsDeleteLayer(CloudsDefinition* definition, int layer);
Color cloudsGetLayerColor(CloudsLayerDefinition* definition, Renderer* renderer, Vector3 start, Vector3 end);
Color cloudsGetColor(CloudsDefinition* definition, Renderer* renderer, Vector3 start, Vector3 end);
Color cloudsLayerFilterLight(CloudsLayerDefinition* definition, Renderer* renderer, Color light, Vector3 location, Vector3 light_location, Vector3 direction_to_light);
Color cloudsFilterLight(CloudsDefinition* definition, Renderer* renderer, Color light, Vector3 location, Vector3 light_location, Vector3 direction_to_light);
#ifdef __cplusplus
}
#endif
#endif