OpenQMC API
Loading...
Searching...
No Matches
bntables.h File Reference
#include "encode.h"
#include "gpu.h"
#include <cstdint>
#include "data/pmj/keys.txt"
#include "data/pmj/ranks.txt"
#include "data/sobol/keys.txt"
#include "data/sobol/ranks.txt"
#include "data/lattice/keys.txt"
#include "data/lattice/ranks.txt"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  oqmc::bntables::TableReturnValue
 Return type for table value. More...
 

Functions

template<int XBits, int YBits, int ZBits>
constexpr TableReturnValue oqmc::bntables::tableValue (std::uint16_t pixel, std::uint16_t shift, const std::uint32_t keyTable[], const std::uint32_t rankTable[])
 Lookup value pair from table.
 

Variables

constexpr auto oqmc::bntables::xBits = 8
 256 pixels in x.
 
constexpr auto oqmc::bntables::yBits = 8
 256 pixels in y.
 
constexpr auto oqmc::bntables::size = 1 << (xBits + yBits)
 2^16 table size.
 
constexpr std::uint32_t oqmc::bntables::pmj::keyTable []
 Optimised blue noise key table for pmj.
 
constexpr std::uint32_t oqmc::bntables::pmj::rankTable []
 Optimised blue noise rank table for pmj.
 
constexpr std::uint32_t oqmc::bntables::sobol::keyTable []
 Optimised blue noise key table for sobol.
 
constexpr std::uint32_t oqmc::bntables::sobol::rankTable []
 Optimised blue noise rank table for sobol.
 
constexpr std::uint32_t oqmc::bntables::lattice::keyTable []
 Optimised blue noise key table for lattice.
 
constexpr std::uint32_t oqmc::bntables::lattice::rankTable []
 Optimised blue noise rank table for lattice.
 

Detailed Description

Pre-computed and optimised blue noise tables used to decorrelate between pixels, and extend the base sampler implementations with blue noise properties. A generalised method extending 'Lessons Learned and Improvements when Building Screen-Space Samplers with Blue-Noise Error Distribution.' by Laurent Belcour and Eric Heitz was used to optimise the tables. Lookups for the table can apply constant random shifts for different domains, allowing a single table to be re-used for N domains.

Function Documentation

◆ tableValue()

template<int XBits, int YBits, int ZBits>
constexpr TableReturnValue oqmc::bntables::tableValue ( std::uint16_t  pixel,
std::uint16_t  shift,
const std::uint32_t  keyTable[],
const std::uint32_t  rankTable[] 
)
constexpr

Given an encoded pixel coordinate and an encoded pixel shift, decode the values and add the shift to the coordinate to compute an index. Using the index lookup a key and rank value pair from the input tables.

Template Parameters
XBitsPrecision along the X axis used for encoding.
YBitsPrecision along the Y axis used for encoding.
ZBitsPrecision along the Z axis used for encoding.
Parameters
[in]pixelEncoded pixel coordinate for lookup.
[in]shiftEncoded pixel shift for lookup.
[in]keyTableTable of key values.
[in]rankTableTable of rank values.
Returns
Key and rank pair from lookup.
Here is the caller graph for this function:

Variable Documentation

◆ keyTable [1/3]

constexpr std::uint32_t oqmc::bntables::pmj::keyTable[]
inlineconstexpr
Initial value:
= {
}

◆ rankTable [1/3]

constexpr std::uint32_t oqmc::bntables::pmj::rankTable[]
inlineconstexpr
Initial value:
= {
}

◆ keyTable [2/3]

constexpr std::uint32_t oqmc::bntables::sobol::keyTable[]
inlineconstexpr
Initial value:
= {
}

◆ rankTable [2/3]

constexpr std::uint32_t oqmc::bntables::sobol::rankTable[]
inlineconstexpr
Initial value:
= {
}

◆ keyTable [3/3]

constexpr std::uint32_t oqmc::bntables::lattice::keyTable[]
inlineconstexpr
Initial value:
= {
}

◆ rankTable [3/3]

constexpr std::uint32_t oqmc::bntables::lattice::rankTable[]
inlineconstexpr
Initial value:
= {
}