Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Functions
BRDF Estimation

Precompute BRDF-related data for real-time rendering.

Perform cubemap GGX convolution, irradiance SH coefficients computation, and linearized BRDF look-up table precomputation.

See also
GPU::Frag::Cubemap_convo
GPU::Frag::Brdf_sampler
GPU::Frag::Skybox_shcoeffs
DeferredRendering

Functions

void loadCubemap (const std::string &inputPath, Texture &cubemapInfos)
 
void computeCubemapConvolution (const Texture &cubemapInfos, int levelsCount, int outputSide, int samplesCount, std::vector< Texture > &cubeLevels)
 
void exportCubemapConvolution (std::vector< Texture > &cubeLevels, const std::string &outputPath)
 
void computeAndExportLookupTable (const int outputSide, const std::string &outputPath)
 
int main (int argc, char **argv)
 

Function Documentation

◆ computeAndExportLookupTable()

void computeAndExportLookupTable ( const int  outputSide,
const std::string &  outputPath 
)

Compute and export a linearized BRDF look-up table.

Parameters
outputSidethe side size of the 2D output map
outputPaththe destination path

◆ computeCubemapConvolution()

void computeCubemapConvolution ( const Texture cubemapInfos,
int  levelsCount,
int  outputSide,
int  samplesCount,
std::vector< Texture > &  cubeLevels 
)

Compute a series of cubemaps convolved with a BRDF using increasing roughness values. The cubemaps form a mipmap pyramid.

Note
We choose to keep the levels in separate textures for easier visualisation. This could be revisited.
Parameters
cubemapInfosthe source HDR cubemap
levelsCountthe number of mipmap levels to generate
outputSidethe side size of the lvel 0 cubemap faces
samplesCountthe number of samples to use in the convolution
cubeLevelswill contain the texture infos for each level

◆ exportCubemapConvolution()

void exportCubemapConvolution ( std::vector< Texture > &  cubeLevels,
const std::string &  outputPath 
)

Export the pre-convolved cubemap levels.

Parameters
cubeLevelsthe textures to export as mipmap levels
outputPaththe based destination path

◆ loadCubemap()

void loadCubemap ( const std::string &  inputPath,
Texture cubemapInfos 
)

Load a cubemap on both the CPU and GPU from an input path.

Parameters
inputPaththe base path on disk
cubemapInfoswill contain the cubemap infos once sent to the GPU

◆ main()

int main ( int  argc,
char **  argv 
)

Compute either a series of cubemaps convolved with a BRDF using increasing roughness values, irradiance spherical harmonics coefficients, or generate a linearized BRDF look-up table.

Parameters
argcthe number of input arguments.
argva pointer to the raw input arguments.
Returns
a general error code.

Loading section.

Computations section.

Export section.

Visualisation section.

Rendering.