Tune mip levels selection

This commit is contained in:
Patrick Nicolas
2024-09-11 23:41:10 +02:00
parent 50747d8fd4
commit 9344c6c012
3 changed files with 7 additions and 5 deletions
+2 -1
View File
@@ -90,7 +90,8 @@ static double foveate(double a, double b, double λ, double c, double x)
static double foveate_lod(double a, double b, double /*λ*/, double /*c*/, double x)
{
// derivate of foveate * scale
return std::max(0., log2(1 / (cos(a * x + b) * cos(a * x + b))));
// bias it to favor sharper image
return std::max(0., log2(1 / (cos(a * x + b) * cos(a * x + b)) - 0.5));
}
static std::tuple<float, float> solve_foveation(float λ, float c)