Quick rendering math lesson (common trap):
Filippo Tarpini
Auf X besuchen@FilippoTarpini1889 Follower
10.585 Aufrufe
Quick rendering math lesson (common trap):
FoV in Unreal Engine isn't interpolated correctly when blending between two cameras
The current code does:
FoV = lerp(FoVA, FoVB, Weight)
however, that's not how you interpolate FoV!
To be "perceptually" linear and also correct under aspect ratio scaling, FoV needs to be lerped in tangent space:
FoV = atan(lerp(tan(FoVA*0.5), tan(FoVB*0.5), Weight)) * 2
First video showcasing the problem.
Blending between a 32:9 camera with 98.21° FoV and a 16:9 camera with 60° FoV.
Viewport is 32:9. Due to FoV scaling being Hor+ by default in UE, at 32:9 they should look identical.
But during blends, they don't (the FoV isn't stable)!
The relationship between FoV and aspect ratio isn’t linear, because FoV is angular
In practice, it also means camera interps aren't as smooth as they could be, second video shows that.
PR to fix the problem:
hopefully it gets merged!
Kommentare
Kommentare aus dem Originalbeitrag auf X (Twitter)
Noch keine Kommentare
