group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
SMAASearchTex.h File Reference

SMAA Search Texture generator. More...

#include <cmath>
#include <cstring>
Include dependency graph for SMAASearchTex.h:
This graph shows which files directly or indirectly include this file:

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

Detailed Description

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).

Function Documentation

◆ generateSearchTex()

void generateSearchTex ( unsigned char * out)
inline

Generate the SMAA search texture into a caller-provided buffer.

Parameters
outmust point to at least SMAA_SEARCHTEX_WIDTH * SMAA_SEARCHTEX_HEIGHT bytes.
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ SMAA_SEARCHTEX_HEIGHT

int SMAA_SEARCHTEX_HEIGHT = 33
staticconstexpr

◆ SMAA_SEARCHTEX_PACKED_HEIGHT

int SMAA_SEARCHTEX_PACKED_HEIGHT = 16
staticconstexpr

◆ SMAA_SEARCHTEX_PACKED_WIDTH

int SMAA_SEARCHTEX_PACKED_WIDTH = 64
staticconstexpr

Packed texture dimensions used during bilinear sampling.

◆ SMAA_SEARCHTEX_PITCH

int SMAA_SEARCHTEX_PITCH = SMAA_SEARCHTEX_WIDTH
staticconstexpr

◆ SMAA_SEARCHTEX_WIDTH

int SMAA_SEARCHTEX_WIDTH = 66
staticconstexpr