Since exported index buffer always point to their vertex buffer like it starts at 0, we have to increment all indices of LODs to match their base vertex location in the vertex buffer. To avoid this we could use the graphics API to specify the base vertex location directly during the draw call, but it's not supported on GL before version 3.2. Another solution would be to change how we export HMD.
Each time we compute the screen ratio of a mesh, we recompute the camera axis. It could be added directly to the camera and computed once during the camera update.
We could cull mesh during the emit stage if the screen ratio is too small for any LOD.
First draft for LODs intergration.
Some possible optimization :
Since exported index buffer always point to their vertex buffer like it starts at 0, we have to increment all indices of LODs to match their base vertex location in the vertex buffer. To avoid this we could use the graphics API to specify the base vertex location directly during the draw call, but it's not supported on GL before version 3.2. Another solution would be to change how we export HMD.
Each time we compute the screen ratio of a mesh, we recompute the camera axis. It could be added directly to the camera and computed once during the camera update.
We could cull mesh during the emit stage if the screen ratio is too small for any LOD.