Fix formatting
This commit is contained in:
parent
100b6d1816
commit
a74ea392fa
@ -74,6 +74,7 @@ This section explains in more detail how multithreading is implemented with voxe
|
||||
Up to version `godot3.2.3` of the module, reading and writing to voxels did not care about multithreading. It was possible to access them without locking, because all the threaded operations using them (saving and meshing) were given copies of the voxels, made on the main thread.
|
||||
|
||||
This made things simple, however it causes several issues.
|
||||
|
||||
- If threads are unable to consume tasks faster than they are issued, copies of voxel data will keep accumulating rapidly and make the game run out of memory.
|
||||
- Copying blocks and their neighbors takes time and is potentially wasteful because it's not guaranteed to be used.
|
||||
- It assumes the threaded task will only need to access a specific block at a fixed LOD, which is not always the case in other voxel engines (such as UE4 Voxel Plugin by Phyronnaz). For example, Transvoxel running on a big block may attempt to access higher-resolution blocks to better approximate the isosurface, which is not possible with the current approach.
|
||||
@ -94,7 +95,7 @@ It is possible that more changes happen in the future, in particular with nodes
|
||||
|
||||
This matters for scripters.
|
||||
|
||||
If you use `VoxelTool`, all locking mechanisms are handled for you automatically. However, you must be aware that it doesn't come for free: if you want to access voxels randomly and modify them randomly, you will pretty much get the worst overhead. If you want to access a well-defined region and you know where to read, and where to write, then optimizing becomes possible.
|
||||
If you use `VoxelTool`, all locking mechanisms are handled for you automatically. However, you must be aware that it doesn't come for free: if you want to access voxels randomly and modify them randomly, you will pretty much get the worst overhead. If you want to access a well-defined region and you know where to read, and where to write ahead of time, then optimizing becomes possible.
|
||||
|
||||
For example, *on a terrain node*, `VoxelTool.get_voxel` or `set_voxel` are the simplest, yet the slowest way to modify voxels. This is not only because of locking, but also because the engine has to go all the way through several data structures to access the voxel. This is perfectly fine for small isolated edits, like the player digging or building piece by piece.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user