11-24-2017, 06:17 PM
DirectX by itself does not support Level of detail. It is up to the user to decide what details he wants to show and when he wants to change from one level to another.
Also when you are using DXEngine, you can prepare a few versions of 3D models and then show them based on the distance from the camera.
With LOD system it is important that the change from one version of the object to another is immediate. This means that both versions of the object need to be fully initialized before they are shown so that when you decide to show high detailed object its data are already on the graphics card.
The same can be used for showing pixels. There it is also possible to create one vertex buffer with all the positions and multiple index buffers - one for each LOD. Index buffer contains indexes to the positions - so one index buffer can have indexes to all even positions, the other to every 5th positions and so on. Then you send the whole vertex buffer to the graphics card and only switch index buffers (or do not provide any to show all positions).
Such approach is also used in the OptimizedPointMesh object that will be available in the next version of DXEngine (v2.3). This object will be able to dynamically adjust the number of shown positions based on the size of Viewport, size of one pixel and camera data. The OptimizedPointMesh object divides all positions into multiple subsets and shows only those that are visible in the current camera. What is more, all positions are analyzed and those that are close together in 3D space can be combined into one position (when the camera is far away and positions are rendered to the same 2D coordinates on the screen).
How to efficiently prepare 3D models or 3D positions with DXEngine is probably not very easy task. Therefore in the following days, I will prepare a new sample on how to do that. I will also publish the source code here.
Also when you are using DXEngine, you can prepare a few versions of 3D models and then show them based on the distance from the camera.
With LOD system it is important that the change from one version of the object to another is immediate. This means that both versions of the object need to be fully initialized before they are shown so that when you decide to show high detailed object its data are already on the graphics card.
The same can be used for showing pixels. There it is also possible to create one vertex buffer with all the positions and multiple index buffers - one for each LOD. Index buffer contains indexes to the positions - so one index buffer can have indexes to all even positions, the other to every 5th positions and so on. Then you send the whole vertex buffer to the graphics card and only switch index buffers (or do not provide any to show all positions).
Such approach is also used in the OptimizedPointMesh object that will be available in the next version of DXEngine (v2.3). This object will be able to dynamically adjust the number of shown positions based on the size of Viewport, size of one pixel and camera data. The OptimizedPointMesh object divides all positions into multiple subsets and shows only those that are visible in the current camera. What is more, all positions are analyzed and those that are close together in 3D space can be combined into one position (when the camera is far away and positions are rendered to the same 2D coordinates on the screen).
How to efficiently prepare 3D models or 3D positions with DXEngine is probably not very easy task. Therefore in the following days, I will prepare a new sample on how to do that. I will also publish the source code here.
Andrej Benedik

