#include <polytext.h>
Public Methods | |
csShadowBitmap (int lm_w, int lm_h, int quality, int default_light) | |
Make a new shadow bitmap of the given lightmap size and quality. More... | |
~csShadowBitmap () | |
Destroy the shadow bitmap. | |
void | RenderPolygon (csVector2 *poly, int num_vertices, int val) |
Render a polygon on this bitmap. More... | |
void | RenderTotal (int val) |
Set the entire area of this bitmap to either completely shadowed (val==1) or fully lit (val==0). | |
void | UpdateLightMap (csRGBpixel *lightmap, int lightcell_shift, float shf_u, float shf_v, float mul_u, float mul_v, const csMatrix3 &m_t2w, const csVector3 &v_t2w, csLight *light, const csVector3 &lightpos, const csColor &lightcolor, const csVector3 &poly_normal, float cosfact) |
Take a light and update the lightmap using the information in this shadow-bitmap. More... | |
void | UpdateShadowMap (unsigned char *shadowmap, int lightcell_shift, float shf_u, float shf_v, float mul_u, float mul_v, const csMatrix3 &m_t2w, const csVector3 &v_t2w, csLight *light, const csVector3 &lightpos, const csVector3 &poly_normal, float cosfact) |
Take a light and update the shadowmap using the information in this shadow-bitmap. More... | |
bool | IsFullyShadowed () const |
Return true if this bitmap is fully shadowed. | |
bool | IsFullyUnlit () const |
Return true if this bitmap is fully unlit. | |
bool | IsFullyLit () const |
Return true if this bitmap is fully lit. |
It is used while calculating lighting for one light on a polygon. First shadows are collected on this bitmap. Later the bitmap will be used to update the lightmap.
|
Make a new shadow bitmap of the given lightmap size and quality. Quality will be a number indicating how much we want to enhance or reduce size of this bitmap compared to the lightmap size. A quality of 0 means no change (i.e. the bitmap will hold as many shadow-points as lumels). A quality of -1 means that for every 2x2 lumels there will be one shadow-point. A quality of 1 means that one lumel corresponds with 2x2 shadow-points. |
|
Render a polygon on this bitmap. The coordinates of this polygon are given in lightmap coordinates. WARNING the given polygon will be modified by this function! 'val' can be 0 or 1 and will be used to fill the polygon. To render a shadow you would use 1 and for light you would use 0. |
|
Take a light and update the lightmap using the information in this shadow-bitmap.
|
|
Take a light and update the shadowmap using the information in this shadow-bitmap.
|