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.
Constructor & Destructor Documentation
csShadowBitmap::csShadowBitmap (
int lm_w,
int lm_h,
int quality,
int default_light )
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.
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.
lightcell_shift is the shift to scale lightmap space to texture space (with texture space meaning 0 to real texture size).
The shf_u, shf_v, mul_u, and mul_v fields define how to translate the previous texture space to uv space (where uv goes between 0 and 1 for a single texture).
m_t2w and v_t2w transform uv space to world space coordinates.
light is the light and lightpos is the position of that light (which can be different from the position of the light given by 'light' itself because we can have space warping).
lightcolor can also be different from the color of the light because it could in principle be modified by portals.
Take a light and update the shadowmap using the information in this shadow-bitmap.
lightcell_shift is the shift to scale lightmap space to texture space (with texture space meaning 0 to real texture size).
The shf_u, shf_v, mul_u, and mul_v fields define how to translate the previous texture space to uv space (where uv goes between 0 and 1 for a single texture).
m_t2w and v_t2w transform uv space to world space coordinates.
light is the light and lightpos is the position of that light (which can be different from the position of the light given by 'light' itself because we can have space warping).
The documentation for this class was generated from the following file: