slightly faster bilinear interpolation #33
@@ -60,8 +60,9 @@ void main() {
|
|||||||
|
|
||||||
vec4 m_color = v_Color;
|
vec4 m_color = v_Color;
|
||||||
// Apply correction factor to make the resulting color very close to what true bilinear interpolation would obtain
|
// 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)
|
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;
|
m_color += v_RdhFactor * correctionWeight;
|
||||||
|
|
||||||
#ifdef USE_VANILLA_COLOR_FORMAT
|
#ifdef USE_VANILLA_COLOR_FORMAT
|
||||||
|
|||||||
Reference in new issue
Block a user