|
group2 0.1.0
CSE 125 Group 2
|
SMAA Search Texture generator. More...
#include <cmath>#include <cstring>Go to the source code of this file.
Namespaces | |
| namespace | smaa_search_detail |
Functions | |
| unsigned char | smaa_search_detail::calcSearchValue (int e1, int e2, float bias) |
| Encode two edge values (e1, e2 in {0,1}) and their bilinear position into a search texture value. | |
| void | generateSearchTex (unsigned char *out) |
| Generate the SMAA search texture into a caller-provided buffer. | |
Variables | |
| static constexpr int | SMAA_SEARCHTEX_WIDTH = 66 |
| static constexpr int | SMAA_SEARCHTEX_HEIGHT = 33 |
| static constexpr int | SMAA_SEARCHTEX_PITCH = SMAA_SEARCHTEX_WIDTH |
| static constexpr int | SMAA_SEARCHTEX_PACKED_WIDTH = 64 |
| Packed texture dimensions used during bilinear sampling. | |
| static constexpr int | SMAA_SEARCHTEX_PACKED_HEIGHT = 16 |
SMAA Search Texture generator.
Generates the 66x33 R8 UNORM search lookup texture used by the SMAA blending weight calculation pass.
Based on the SMAA reference implementation by Jorge Jimenez et al. (MIT License).
The search texture is used for bilinear-filtering acceleration of edge endpoint detection. Each texel encodes whether a particular bilinear combination of two horizontally/vertically adjacent edge pixels indicates "continue searching" or "endpoint found".
The key insight is that bilinear filtering of two edge pixels yields a specific set of values depending on the (left, right) or (top, bottom) edge configuration. The search texture maps each bilinear result to a sub-pixel-accurate endpoint position.
Total size: 66 x 33 pixels, R8 format (2178 bytes).
|
inline |
Generate the SMAA search texture into a caller-provided buffer.
| out | must point to at least SMAA_SEARCHTEX_WIDTH * SMAA_SEARCHTEX_HEIGHT bytes. |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Packed texture dimensions used during bilinear sampling.
|
staticconstexpr |
|
staticconstexpr |