slightly faster bilinear interpolation #33

Merged
embeddedt merged 4 commits from rdh/celeritas:ao-better into stonecutter 2026-08-18 20:00:03 -04:00
Showing only changes of commit e3b2a2b810 - Show all commits
@@ -60,8 +60,9 @@ void main() {
vec4 m_color = v_Color;
// Apply correction factor to make the resulting color very close to what true bilinear interpolation would obtain
// min(x, y) * (1 - max(x, y)) == min(x, y) - (x * y)
float correctionWeight = min(v_QuadCoord.x, v_QuadCoord.y)
* (1.0 - max(v_QuadCoord.x, v_QuadCoord.y));
- (v_QuadCoord.x * v_QuadCoord.y);
m_color += v_RdhFactor * correctionWeight;
#ifdef USE_VANILLA_COLOR_FORMAT