Fix save_generator_output not working in VoxelLodTerrain.#728
Fix save_generator_output not working in VoxelLodTerrain.#728SiriusRP wants to merge 1 commit intoZylann:masterfrom
Conversation
|
It is not written to because I wanted to investigate and test before introducing it in this terrain type, meaning that feature is indeed not officially supported here at the moment. I don't remember right now all the details that this implies, but I know it might have some edge cases. Note that this boolean is not directly about saving, it is about caching. Saving indeed only occurs if you also enable that option on the stream. There could be ways to save without caching, which would have to happen in the meshing task, but that seems weird. If you make it default to true, you are also not fixing the fact that nothing sets it. You'll just make the terrain cache everything all the time and use more memory (assuming it works), which some projects might not want. Basically, this option isn't really ready to be exposed or changed yet. |
|
Do you have any suggestions for this should be implemented? I have a custom generator that reads GIS data into VoxelLodTerrain. Currently it is very slow and I was hoping to speed up this process by writing the generated blocks to disk and then streaming them on subsequent loads. |
Not currently. My free time is currently blocked by something else so I can't work on my projects much.
If you want to save this into a stream, you could consider doing this process ahead of time maybe. You could even consider implementing a custom stream directly, or figuring how to optimize what is slow. If this is slow because you're doing web requests though, you might be taking the wrong approach IMO, since you would end up with all task threads blocked waiting for requests, not doing actual work, the system isn't optimized for that. |
b12cadf to
dbe0bcb
Compare
7b15242 to
e94948f
Compare
|
I pushed an experimental property that exposes the variable in bfc72a9 |
cache_generated_blocks is passed to LoadBlockDataTask where it is used to check if a block should be generated and saved if not found by the stream. However, it default constructs to false and is never written to. Meaning this check will always fail.
godot_voxel/streams/load_block_data_task.cpp
Lines 67 to 97 in f79a29f
Setting this to construct as true fixes the issue and better aligns with how VoxelTerrain is written. But if there is a better option for fixing this I'm happy to change it.