2000-02-18 07:48:13 +08:00
|
|
|
#ifndef __LIGHTING_MAIN_H__
|
|
|
|
#define __LIGHTING_MAIN_H__
|
1998-06-11 14:04:59 +08:00
|
|
|
|
|
|
|
/* Defines and stuff */
|
|
|
|
/* ================= */
|
|
|
|
|
|
|
|
#define TILE_CACHE_SIZE 16
|
|
|
|
|
|
|
|
/* Typedefs */
|
|
|
|
/* ======== */
|
|
|
|
|
2000-02-18 07:48:13 +08:00
|
|
|
typedef enum
|
|
|
|
{
|
1998-06-11 14:04:59 +08:00
|
|
|
POINT_LIGHT,
|
|
|
|
DIRECTIONAL_LIGHT,
|
|
|
|
SPOT_LIGHT,
|
|
|
|
NO_LIGHT
|
|
|
|
} LightType;
|
|
|
|
|
2000-02-18 07:48:13 +08:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
LINEAR_MAP,
|
|
|
|
LOGARITHMIC_MAP,
|
|
|
|
SINUSOIDAL_MAP,
|
|
|
|
SPHERICAL_MAP
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
1998-06-11 14:04:59 +08:00
|
|
|
IMAGE_BUMP,
|
|
|
|
WAVES_BUMP
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
gdouble ambient_int;
|
|
|
|
gdouble diffuse_int;
|
|
|
|
gdouble diffuse_ref;
|
|
|
|
gdouble specular_ref;
|
|
|
|
gdouble highlight;
|
|
|
|
GckRGB color;
|
|
|
|
} MaterialSettings;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2000-02-18 07:48:13 +08:00
|
|
|
LightType type;
|
2000-02-15 00:29:41 +08:00
|
|
|
GimpVector3 position;
|
|
|
|
GimpVector3 direction;
|
2000-02-18 07:48:13 +08:00
|
|
|
GckRGB color;
|
|
|
|
gdouble intensity;
|
1998-06-11 14:04:59 +08:00
|
|
|
} LightSettings;
|
|
|
|
|
2000-02-18 07:48:13 +08:00
|
|
|
typedef struct
|
|
|
|
{
|
1998-06-11 14:04:59 +08:00
|
|
|
gint32 drawable_id;
|
|
|
|
gint32 bumpmap_id;
|
|
|
|
gint32 envmap_id;
|
|
|
|
|
|
|
|
/* Render variables */
|
|
|
|
/* ================ */
|
|
|
|
|
2000-02-18 07:48:13 +08:00
|
|
|
GimpVector3 viewpoint;
|
|
|
|
GimpVector3 planenormal;
|
1998-06-11 14:04:59 +08:00
|
|
|
LightSettings lightsource;
|
|
|
|
MaterialSettings material;
|
|
|
|
MaterialSettings ref_material;
|
|
|
|
|
|
|
|
gdouble pixel_treshold;
|
|
|
|
gdouble bumpmax,bumpmin;
|
|
|
|
/* gdouble wave_cx,wave_cy;
|
|
|
|
gdouble wave_lx,wave_ly;
|
|
|
|
gdouble wave_amp,wave_ph; */
|
|
|
|
gint max_depth;
|
|
|
|
gint bumpmaptype;
|
|
|
|
/* gint bumptype; */
|
|
|
|
|
|
|
|
/* Flags */
|
|
|
|
/* ===== */
|
2000-02-18 07:48:13 +08:00
|
|
|
|
1998-06-11 14:04:59 +08:00
|
|
|
gint antialiasing;
|
|
|
|
gint create_new_image;
|
|
|
|
gint transparent_background;
|
|
|
|
gint bump_mapped;
|
|
|
|
gint env_mapped;
|
|
|
|
gint ref_mapped;
|
|
|
|
gint bumpstretch;
|
|
|
|
gint previewquality;
|
|
|
|
|
|
|
|
/* Misc */
|
|
|
|
/* ==== */
|
|
|
|
|
|
|
|
gdouble preview_zoom_factor;
|
|
|
|
} LightingValues;
|
|
|
|
|
|
|
|
/* Externally visible variables */
|
|
|
|
/* ============================ */
|
|
|
|
|
|
|
|
extern LightingValues mapvals;
|
|
|
|
extern GckRGB background;
|
|
|
|
|
2000-02-18 21:59:18 +08:00
|
|
|
#endif /* __LIGHTING_MAIN_H__ */
|