What does "frustum.lodScale" mean? #1083
-
Hello, I'm trying to understand computations of LOD visibility. In RecondTraverval there is a call: auto lodDistance = _state->lodDistance(sphere); what checks if sphere is in frustum and then do some math: const auto& lodScale = frustum.lodScale;
return std::abs(lodScale[0] * s.x + lodScale[1] * s.y + lodScale[2] * s.z + lodScale[3]); What does this compute? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I wouldn't recommend trying to understand the maths used internally, and it's awkward and long winded to explain so I'm not about to attempt to. It's essentially a computational short hand to make things more efficient when computing whether a LOD should be culled or not. Thankfully you don't need to know all these internal implementation details for your purposes. ScreenHeightRatio is simply the ratio of screen height that the bounding sphere that is projected into the viewport will occupy. A ratio of 0.5 will mean that a bounding sphere will be culled when it's smaller than half the window height when projected into the viewport. If you know the vertical field of view projection then you can compute the distance that the bounding sphere radius would map too. I chose the non dimensional screen ratio rather than distances for LOD cull tests as it works for orthographic and perspective projections and isn't affected by scaling/units. |
Beta Was this translation helpful? Give feedback.
I wouldn't recommend trying to understand the maths used internally, and it's awkward and long winded to explain so I'm not about to attempt to. It's essentially a computational short hand to make things more efficient when computing whether a LOD should be culled or not.
Thankfully you don't need to know all these internal implementation details for your purposes. ScreenHeightRatio is simply the ratio of screen height that the bounding sphere that is projected into the viewport will occupy. A ratio of 0.5 will mean that a bounding sphere will be culled when it's smaller than half the window height when projected into the viewport. If you know the vertical field of view projection then yo…