|
group2 0.1.0
CSE 125 Group 2
|
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. | |
|
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:
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.
| e1 | left/top edge pixel value (0 or 1) |
| e2 | right/bottom edge pixel value (0 or 1) |
| bias | bilinear interpolation bias (0.0 to 1.0) |