The pending VBO code
Once upon a time (namely 5 days ago) there was a discussion about improving performance in Minetest. celeron55 mentioned the mapblock data is constantly streamed from the CPU to the GPU, which would be fixed by enabling Vertex Buffer Objects in Irrlicht (storing models on the GPU). Several people including myself tested it and noticed huge performance improvements... as far as 2 - 3 times more FPS in some areas.
However, VBO was disabled for a reason: It causes huge memory leaks, and minetest rockets up to over 1GB of RAM usage. The problem was partly fixed by clearing unneeded hardware buffers, which brought the leaks down to half. We soon we discovered the remaining leaks are due to Minetest intentionally storing mapblocks into memory for as long as 10 minutes (so the server doesn't re-send them if you return to an explored area). Reducing client_unload_unused_data_timeout to as much as 60 seconds fixes the RAM usage and makes VBO usable.
Sadly, this isn't the nicest way to fix it, although it does work and there's a comment in place on how to set it up. The correct way would be to cache mapblock data client-side (possibly on the drive) and have the video card only maintain what's being rendered. But since that's difficult to do and no one who can is around, the code to enable VBO is currently on hold. Not because it doesn't work as is, but because of the philosophy that "if we add it now no one will care to implement client caching later".
TLDR; There's a huge performance improvement but it causes memory leaks. Although ways to solve the leaks were found, they aren't the best, so the devs would rather not add the feature and wait for someone to implement client caching (rather unlikely).
Ok... so I'm all for good code and doing everything the right way. But I can't help being upset that there's a huge improvement which does work, but it's not merged to motivate people to implement it even better. I don't think this is going to force anyone to add client caching earlier than someone with the knowledge will be able to. Besides... client caching is a needed feature for other reasons too, such as storing chunks from servers and allowing a server to only send modified areas each time you log in. Anyway, the two purposes of this thread are:
- If anyone has the knowledge to implement client caching, and make the client send only what's being rendered to the GPU, please give it a try. My knowledge in C++ and Minetest code is way below what I'd need for something this advanced.
- Asking the developers to please not use the VBO code as bait to get this done sooner. Those of us with modern GPU's could really use twice more FPS. If it works, is disabled by default, and there's a note on how to enable it without the memory issue, let us have this improvement please. Someone will add client caching eventually, but until then we're sitting with a huge optimization under our noses.
If anyone's interested in the working VBO code, here is PilzAdam's commit which we're hoping to see upstream.
However, VBO was disabled for a reason: It causes huge memory leaks, and minetest rockets up to over 1GB of RAM usage. The problem was partly fixed by clearing unneeded hardware buffers, which brought the leaks down to half. We soon we discovered the remaining leaks are due to Minetest intentionally storing mapblocks into memory for as long as 10 minutes (so the server doesn't re-send them if you return to an explored area). Reducing client_unload_unused_data_timeout to as much as 60 seconds fixes the RAM usage and makes VBO usable.
Sadly, this isn't the nicest way to fix it, although it does work and there's a comment in place on how to set it up. The correct way would be to cache mapblock data client-side (possibly on the drive) and have the video card only maintain what's being rendered. But since that's difficult to do and no one who can is around, the code to enable VBO is currently on hold. Not because it doesn't work as is, but because of the philosophy that "if we add it now no one will care to implement client caching later".
TLDR; There's a huge performance improvement but it causes memory leaks. Although ways to solve the leaks were found, they aren't the best, so the devs would rather not add the feature and wait for someone to implement client caching (rather unlikely).
Ok... so I'm all for good code and doing everything the right way. But I can't help being upset that there's a huge improvement which does work, but it's not merged to motivate people to implement it even better. I don't think this is going to force anyone to add client caching earlier than someone with the knowledge will be able to. Besides... client caching is a needed feature for other reasons too, such as storing chunks from servers and allowing a server to only send modified areas each time you log in. Anyway, the two purposes of this thread are:
- If anyone has the knowledge to implement client caching, and make the client send only what's being rendered to the GPU, please give it a try. My knowledge in C++ and Minetest code is way below what I'd need for something this advanced.
- Asking the developers to please not use the VBO code as bait to get this done sooner. Those of us with modern GPU's could really use twice more FPS. If it works, is disabled by default, and there's a note on how to enable it without the memory issue, let us have this improvement please. Someone will add client caching eventually, but until then we're sitting with a huge optimization under our noses.
If anyone's interested in the working VBO code, here is PilzAdam's commit which we're hoping to see upstream.