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>
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.
◆ dumpMap()
void OpenGl_TileSampler::dumpMap |
( |
std::ostream & |
theStream, |
|
|
const Image_PixMapTypedData< int > & |
theMap, |
|
|
const char * |
theTitle |
|
) |
| const |
|
protected |
Auxiliary method for dumping 2D image map into stream (e.g. for debugging).
◆ GrabVarianceMap()
Fetches current error estimation from the GPU and builds 2D discrete distribution for tile sampling.
◆ MaxTileSamples()
int OpenGl_TileSampler::MaxTileSamples |
( |
| ) |
const |
|
inline |
Return maximum number of samples per tile.
◆ NbOffsetTiles()
Graphic3d_Vec2i OpenGl_TileSampler::NbOffsetTiles |
( |
bool |
theAdaptive | ) |
const |
|
inline |
Number of tiles within offsets texture.
◆ NbOffsetTilesMax()
Maximum number of tiles within offsets texture.
◆ 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.
◆ nextTileToSample()
Samples tile location according to estimated error.
◆ OffsetTilesViewport()
Graphic3d_Vec2i OpenGl_TileSampler::OffsetTilesViewport |
( |
bool |
theAdaptive | ) |
const |
|
inline |
Viewport for rendering using offsets texture.
◆ OffsetTilesViewportMax()
Maximum viewport for rendering using offsets texture.
◆ Reset()
void OpenGl_TileSampler::Reset |
( |
void |
| ) |
|
|
inline |
Resets (restart) tile sampler to initial state.
◆ SetSize()
Specifies size of ray-tracing viewport and recomputes tile size.
◆ tileArea()
int OpenGl_TileSampler::tileArea |
( |
int |
theX, |
|
|
int |
theY |
|
) |
| const |
|
inlineprotected |
Returns number of pixels in the given tile.
◆ TileSize()
Size of individual tile in pixels.
◆ upload()
Uploads offsets of sampled tiles to the given OpenGL texture.
◆ UploadOffsets()
Uploads offsets of sampled tiles to the given OpenGL texture.
◆ UploadSamples()
Uploads tile samples to the given OpenGL texture.
◆ VarianceScaleFactor()
float OpenGl_TileSampler::VarianceScaleFactor |
( |
| ) |
const |
|
inline |
Scale factor for quantization of visual error (float) into signed integer.
◆ ViewSize()
Returns ray-tracing viewport.
◆ myLastSample
unsigned int OpenGl_TileSampler::myLastSample |
|
protected |
Index of generated sample.
◆ myMarginalMap
std::vector<float> OpenGl_TileSampler::myMarginalMap |
|
protected |
Marginal distribution of 2D error map.
◆ myOffsets
2D array of tiles redirecting to another tile
◆ myOffsetsShrunk
2D array of tiles redirecting to another tile (shrunk)
◆ mySampler
Halton sequence generator.
◆ myScaleFactor
float OpenGl_TileSampler::myScaleFactor |
|
protected |
scale factor for quantization of visual error (float) into signed integer
◆ myTiles
number of samples per tile (initially all 1)
◆ myTileSamples
number of samples for all pixels within the tile (initially equals to Tile area)
◆ myTileSize
int OpenGl_TileSampler::myTileSize |
|
protected |
◆ myVarianceMap
Estimation of visual error per tile.
◆ myVarianceRaw
Estimation of visual error per tile (raw data)
◆ myViewSize
The documentation for this class was generated from the following file: