P.S. I might have forgotten to take into account the camera roll when offsetting the horizon. I need to run but I’ll get back to you with a correction.
Have you tried it? It changes the height based on the camera’s vertical angle.
Here is an updated version but the math gets hairy pretty fast. I’m almost sure that this is the way the camera projection works but I think the FoV angle is incorrect. Anyway, this is as close as I can get you for now. Try it out and try to understand the trigonometry behind it.