Tool object used for sampling screen tiles according to estimated pixel variance (used in path tracing engine). To improve GPU thread coherency, rendering window is split into pixel blocks or tiles. The important feature of this approach is that it is possible to keep the same number of tiles for any screen resolution (e.g. 256 tiles can be used for both 512 x 512 window and 1920 x 1080 window). So, a smaller number of tiles allows to increase interactivity (FPS), but at the cost of higher per-frame variance ('noise'). On the contrary a larger number of tiles decrease interactivity, but leads to lower per-frame variance. Note that the total time needed to produce final final image is the same for both cases.
More...
#include <OpenGl_TileSampler.hxx>
|
float | Tile (const int theX, const int theY) const |
| Returns tile value (estimated error). More...
|
|
float & | ChangeTile (const int theX, const int theY) |
| Returns tile value (estimated error). More...
|
|
Tool object used for sampling screen tiles according to estimated pixel variance (used in path tracing engine). To improve GPU thread coherency, rendering window is split into pixel blocks or tiles. The important feature of this approach is that it is possible to keep the same number of tiles for any screen resolution (e.g. 256 tiles can be used for both 512 x 512 window and 1920 x 1080 window). So, a smaller number of tiles allows to increase interactivity (FPS), but at the cost of higher per-frame variance ('noise'). On the contrary a larger number of tiles decrease interactivity, but leads to lower per-frame variance. Note that the total time needed to produce final final image is the same for both cases.
◆ OpenGl_TileSampler()
OpenGl_TileSampler::OpenGl_TileSampler |
( |
| ) |
|
Creates new tile sampler.
◆ ChangeTile()
float& OpenGl_TileSampler::ChangeTile |
( |
const int |
theX, |
|
|
const int |
theY |
|
) |
| |
|
inlineprotected |
Returns tile value (estimated error).
◆ GrabVarianceMap()
Fetches current error estimation from the GPU and builds 2D discrete distribution for tile sampling.
◆ NbTiles()
int OpenGl_TileSampler::NbTiles |
( |
| ) |
const |
|
inline |
Returns total number of tiles in viewport.
◆ NbTilesX()
int OpenGl_TileSampler::NbTilesX |
( |
| ) |
const |
|
inline |
Returns number of tiles in X dimension.
◆ NbTilesY()
int OpenGl_TileSampler::NbTilesY |
( |
| ) |
const |
|
inline |
Returns number of tiles in Y dimension.
◆ Reset()
void OpenGl_TileSampler::Reset |
( |
void |
| ) |
|
|
inline |
Resets tile sampler to initial state.
◆ Sample()
void OpenGl_TileSampler::Sample |
( |
int & |
theOffsetX, |
|
|
int & |
theOffsetY |
|
) |
| |
Samples tile location according to estimated error.
◆ SetSize()
void OpenGl_TileSampler::SetSize |
( |
const int |
theSizeX, |
|
|
const int |
theSizeY |
|
) |
| |
Specifies size of ray-tracing viewport.
◆ SizeX()
int OpenGl_TileSampler::SizeX |
( |
| ) |
const |
|
inline |
Returns width of ray-tracing viewport.
◆ SizeY()
int OpenGl_TileSampler::SizeY |
( |
| ) |
const |
|
inline |
Returns height of ray-tracing viewport.
◆ Tile()
float OpenGl_TileSampler::Tile |
( |
const int |
theX, |
|
|
const int |
theY |
|
) |
| const |
|
inlineprotected |
Returns tile value (estimated error).
◆ TileArea()
int OpenGl_TileSampler::TileArea |
( |
const int |
theX, |
|
|
const int |
theY |
|
) |
| const |
|
inline |
Returns number of pixels in the given tile.
◆ TileSize()
static int OpenGl_TileSampler::TileSize |
( |
| ) |
|
|
inlinestatic |
Size of individual tile in pixels.
◆ Upload()
Uploads offsets of sampled tiles to the given OpenGL texture.
◆ myMarginalMap
std::vector<float> OpenGl_TileSampler::myMarginalMap |
|
protected |
Marginal distribution of 2D error map.
◆ mySample
int OpenGl_TileSampler::mySample |
|
protected |
Index of generated sample.
◆ mySampler
Halton sequence generator.
◆ mySizeX
int OpenGl_TileSampler::mySizeX |
|
protected |
Width of ray-tracing viewport.
◆ mySizeY
int OpenGl_TileSampler::mySizeY |
|
protected |
Height of ray-tracing viewport.
◆ myTilesX
int OpenGl_TileSampler::myTilesX |
|
protected |
Number of tiles in X dimension.
◆ myTilesY
int OpenGl_TileSampler::myTilesY |
|
protected |
Number of tiles in Y dimension.
◆ myVarianceMap
std::vector<float> OpenGl_TileSampler::myVarianceMap |
|
protected |
Estimation of visual error per tile.
The documentation for this class was generated from the following file: