SuperTuxKart
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SphericalHarmonics Class Reference

Public Member Functions

 SphericalHarmonics (const std::vector< irr::video::IImage * > &spherical_harmonics_textures)
 
 SphericalHarmonics (const irr::video::SColor &ambient)
 
void setTextures (const std::vector< irr::video::IImage * > &spherical_harmonics_textures)
 Compute spherical harmonics coefficients from 6 textures.
 
void setAmbientLight (const irr::video::SColor &ambient)
 Compute spherical harmonics coefficients from ambient light.
 
const SHCoefficients * getCoefficients () const
 
bool has6Textures () const
 
void printCoeff ()
 Print spherical harmonics coefficients (debug)
 
void unprojectSH (unsigned int width, unsigned int height, float *Y00[], float *Y1minus1[], float *Y10[], float *Y11[], float *Y2minus2[], float *Y2minus1[], float *Y20[], float *Y21[], float *Y22[], float *output[])
 Compute the the environment map from the spherical harmonics coefficients. More...
 

Private Member Functions

void generateSphericalHarmonics (unsigned char *sh_rgba[6], unsigned int edge_size)
 Compute m_SH_coeff->red_SH_coeff, m_SH_coeff->green_SH_coeff and m_SH_coeff->blue_SH_coeff from Yml values. More...
 

Private Attributes

std::vector< irr::video::IImage * > m_spherical_harmonics_textures
 The 6 spherical harmonics textures.
 
irr::video::SColor m_ambient
 Ambient light is used for tracks without spherical harmonics textures.
 
SHCoefficients * m_SH_coeff
 The spherical harmonics coefficients.
 

Member Function Documentation

◆ generateSphericalHarmonics()

void SphericalHarmonics::generateSphericalHarmonics ( unsigned char *  sh_rgba[6],
unsigned int  edge_size 
)
private

Compute m_SH_coeff->red_SH_coeff, m_SH_coeff->green_SH_coeff and m_SH_coeff->blue_SH_coeff from Yml values.

Parameters
sh_rgbaThe 6 cubemap faces (sRGB byte textures)
edge_sizeSize of the cubemap face

◆ unprojectSH()

void SphericalHarmonics::unprojectSH ( unsigned int  width,
unsigned int  height,
float *  Y00[],
float *  Y1minus1[],
float *  Y10[],
float *  Y11[],
float *  Y2minus2[],
float *  Y2minus1[],
float *  Y20[],
float *  Y21[],
float *  Y22[],
float *  output[] 
)

Compute the the environment map from the spherical harmonics coefficients.

Parameters
widthThe texture width
heightThe texture height
YmlThe sphericals harmonics functions values
[out]outputThe environment map texels values

The documentation for this class was generated from the following files: