group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
smaa_search_detail Namespace Reference

Functions

unsigned char 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.

Function Documentation

◆ calcSearchValue()

unsigned char smaa_search_detail::calcSearchValue ( int e1,
int e2,
float bias )
inline

Encode two edge values (e1, e2 in {0,1}) and their bilinear position into a search texture value.

When the GPU bilinear-samples two adjacent edge texels, the result encodes both texels' values. The search texture pre-computes for every possible bilinear result:

  • 0 (0.0): no edge found => stop searching
  • 127 (0.5): partial match => keep searching
  • 255 (1.0): exact match => endpoint found

The texture is indexed by: u = bilinear(e.g) * 0.5 (horizontal: edge green channel) v = e.r * 0.5 (perpendicular crossing edge)

For the left/up search direction, uvs are offset differently than for right/down. Compute the search texture value for a given edge configuration.

Parameters
e1left/top edge pixel value (0 or 1)
e2right/bottom edge pixel value (0 or 1)
biasbilinear interpolation bias (0.0 to 1.0)
Returns
search result: 0=stop, 127=continue, 255=found
Here is the caller graph for this function: