citro3d
|
Generate lighting lookup tables. More...
Go to the source code of this file.
Data Structures | |
struct | C3D_LightLut |
struct | C3D_LightLutDA |
Macros | |
#define | LightLut_Phong(lut, shininess) LightLut_FromFunc((lut), powf, (shininess), false) |
Generates lighting lookup table using powf function (phong lighting). | |
#define | LightLut_Spotlight(lut, angle) LightLut_FromFunc((lut), spot_step, cosf(angle), true) |
Generates lighting lookup table for spotlights. | |
#define | LightLutDA_Quadratic(lut, from, to, linear, quad) LightLutDA_Create((lut), quadratic_dist_attn, (from), (to), (linear), (quad)) |
Generates distance attenuation lookup table. | |
Typedefs | |
typedef float(* | C3D_LightLutFunc) (float x, float param) |
typedef float(* | C3D_LightLutFuncDA) (float dist, float arg0, float arg1) |
Functions | |
static float | quadratic_dist_attn (float dist, float linear, float quad) |
static float | spot_step (float angle, float cutoff) |
void | LightLut_FromArray (C3D_LightLut *lut, float *data) |
Generates lighting lookup table from pre-computed float array. | |
void | LightLut_FromFunc (C3D_LightLut *lut, C3D_LightLutFunc func, float param, bool negative) |
Generates lighting lookup table using specified callback function. | |
void | LightLutDA_Create (C3D_LightLutDA *lut, C3D_LightLutFuncDA func, float from, float to, float arg0, float arg1) |
Generates distance attenuation lookup table using specified callback function. | |
Generate lighting lookup tables.
#define LightLut_Phong | ( | lut, | |
shininess | |||
) | LightLut_FromFunc((lut), powf, (shininess), false) |
Generates lighting lookup table using powf function (phong lighting).
[out] | lut | Pointer to light environment structure. |
[in] | shininess | Shininess value of specular highlights (pow function exponent). |
#define LightLut_Spotlight | ( | lut, | |
angle | |||
) | LightLut_FromFunc((lut), spot_step, cosf(angle), true) |
Generates lighting lookup table for spotlights.
[out] | lut | Pointer to light environment structure. |
[in] | angle | Beam angle of the spotlight. |
#define LightLutDA_Quadratic | ( | lut, | |
from, | |||
to, | |||
linear, | |||
quad | |||
) | LightLutDA_Create((lut), quadratic_dist_attn, (from), (to), (linear), (quad)) |
Generates distance attenuation lookup table.
[out] | lut | Pointer to light environment structure. |
[in] | from | Minimum distance from light source. |
[in] | to | Maximum distance from light source. |
[in] | linear | Linear coefficient. |
[in] | quad | Quadratic coefficient. |
void LightLut_FromArray | ( | C3D_LightLut * | lut, |
float * | data | ||
) |
Generates lighting lookup table from pre-computed float array.
[out] | lut | Pointer to lighting lookup table structure. |
[in] | data | Pointer to pre-computed float array. |
void LightLut_FromFunc | ( | C3D_LightLut * | lut, |
C3D_LightLutFunc | func, | ||
float | param, | ||
bool | negative | ||
) |
Generates lighting lookup table using specified callback function.
[out] | lut | Pointer to light environment structure. |
[in] | func | Callback function. |
[in] | param | User-specified parameter to callback function. |
[in] | negative | If false, x argument of callback function will be in range [0,256]. If true, x argument will be in range [-128,128]. |
void LightLutDA_Create | ( | C3D_LightLutDA * | lut, |
C3D_LightLutFuncDA | func, | ||
float | from, | ||
float | to, | ||
float | arg0, | ||
float | arg1 | ||
) |
Generates distance attenuation lookup table using specified callback function.
[out] | lut | Pointer to light environment structure. |
[in] | func | Callback function. |
[in] | from | Starting distance of lighting. |
[in] | to | Ending distance of lighting. |
[in] | arg0 | User-specified parameter to callback function. |
[in] | arg1 | User-specified parameter to callback function. |