Fix foveation center calculation

This commit is contained in:
Patrick Nicolas
2023-12-14 23:39:26 +01:00
parent 60c97e0e7b
commit a8c8e7f4b9
2 changed files with 22 additions and 55 deletions
+3 -3
View File
@@ -69,17 +69,17 @@ void main()
if (use_foveation_x && use_foveation_y)
{
uv = ubo.xc + ubo.lambda * atan((uv - ubo.b) / ubo.a);
uv = atan(ubo.lambda * (uv - ubo.xc)) / ubo.a - ubo.b;
}
else
{
if (use_foveation_x)
{
uv.x = (ubo.xc + ubo.lambda * atan((uv - ubo.b) / ubo.a)).x;
uv.x = (atan(ubo.lambda * (uv - ubo.xc)) / ubo.a - ubo.b).x;
}
if (use_foveation_y)
{
uv.y = (ubo.xc + ubo.lambda * atan((uv - ubo.b) / ubo.a)).y;
uv.y = (atan(ubo.lambda * (uv - ubo.xc)) / ubo.a - ubo.b).y;
}
}