Update readme with new docs

This commit is contained in:
Marc Gilleron 2021-01-21 19:04:28 +00:00
parent dc7550114f
commit 8a0d2983c4
4 changed files with 12 additions and 211 deletions

View File

@ -1,137 +0,0 @@
Changelog
==============
This is a high-level changelog for what has been worked on so far.
At the moment, this module doesn't have a distinct release schedule, so this changelog follows Godot's version numbers and binary releases. Each version mentionned here should have an associated Git branch containing features at the time of the version. Backports aren't usually done so far, but PRs are welcome if it's necessary.
Semver is not yet in place, so each version can have breaking changes, although it shouldn't happen often.
`master`
--------
- General
- Introduction of Voxel Server, which shares threaded tasks among all voxel nodes
- Voxel data is no longer copied when sent to processing threads, reducing high memory spikes in some scenarios
- Added a utility class to load `.vox` files created with MagicaVoxel (scripts only)
- Voxel nodes can be moved, scaled and rotated
- Voxel nodes can be limited to specific bounds, rather than being infinitely paging volumes (multiples of block size).
- Meshers are now resources so you can choose and configure them per terrain
- Added [FastNoiseLite](https://github.com/Auburn/FastNoise) for a wider variety of noises
- Generators are no longer limited to a single background thread
- Editor
- Streaming/LOD can be set to follow the editor camera instead of being centered on world origin. Use with caution, fast big movements and zooms can cause lag
- The amount of pending background tasks is now indicated when the node is selected
- Added About window
- Smooth voxels
- Shaders now have access to the transform of each block, useful for triplanar mapping on moving volumes
- Transvoxel runs faster (almost x2 speedup)
- The SDF channel is now 16-bit by default instead of 8-bit, which reduces terracing in big terrains
- Optimized `VoxelGeneratorGraph` by making it detect empty blocks more accurately and process by buffers
- Added `SdfSphereHeightmap` and `Normalize` nodes to voxel graph, which can help making planets
- Blocky voxels
- Introduced a second blocky mesher dedicated to colored cubes, with greedy meshing and palette support
- Replaced `transparent` property with `transparency_index` for more control on the culling of transparent faces
- The TYPE channel is now 16-bit by default instead of 8-bit, allowing to store up to 65,536 types (part of this channel might actually be used to store rotation in the future)
- Breaking changes
- `VoxelViewer` now replaces the `viewer_path` property on `VoxelTerrain`, and allows multiple loading points
- Defined `COLOR` channel in `VoxelBuffer`, previously known as `DATA3`
- `VoxelGenerator` is no longer the base for script-based generators, use `VoxelGeneratorScript` instead
- `VoxelGenerator` no longer inherits `VoxelStream`
- `VoxelStream` is no longer the base for script-based streams, use `VoxelStreamScript` instead
- Generators and streams have been split. Streams are more dedicated to files and use a single background thread. Generators are dedicated to generation and can be used by more than one background thread. Terrains have one property for each.
- The meshing system no longer "guesses" how voxels will look like. Instead it uses the mesher assigned to the terrain.
- SDF and TYPE channels have different default depth, so if you relied on 8-bit depth, you may have to explicitely set that format in your generator, to avoid mismatch with existing savegames
- Fixes
- C# should be able to properly implement generator/stream functions
- Known issues
- `VoxelLodTerrain` does not entirely support `VoxelViewer`, but a refactoring pass is planned for it.
08/09/2020 - `godot3.2.3`
--------------------------
- General
- Added per-voxel and per-block metadata, which are saved by file streams along with voxel data
- `StringName` is now used when possible to call script functions, to reduce overhead
- Exposed block serializer to allow encoding voxels for network or files from script
- Added terrain methods to trigger saves explicitely
- The module only prints debug logs if the engine is in verbose mode
- `VoxelTerrain` now emit signals when blocks are loaded and unloaded
- Editor
- Terrain nodes now render in the editor, unless scripts are involved (can be changed with an option)
- Blocky voxels
- Added collision masks to blocky voxels, which takes effect with `VoxelBoxMover` and voxel raycasts
- Added random tick API for blocky terrains
- Blocky mesh collision shapes now take all surfaces into account
- Smooth voxels
- Added a graph-based generator, dedicated to SDF data for now
- Fixes
- Fixed crash when `VoxelTerrain` is used without a stream
- Fixed `Voxel.duplicate()` not implemented properly
- Fixed collision shapes only being generated for the first mesh surface
- Fixed `VoxelTool` truncating 64-bit values
27/03/2020 - (no branch) - Tokisan Games binary version
--------------------------------------------------------
- General
- Optimized `VoxelBuffer` memory allocation with a pool (best when sizes are often the same)
- Optimized block visibility by removing meshes from the world rather than setting the `visible` property
- Added customizable bit depth to `VoxelBuffer` (8, 16, 32 and 64 bits)
- Added node configuration warnings in case terrain nodes are wrongly setup
- Implemented VoxelTool for VoxelBuffers
- Added `VoxelStreamNoise2D`
- Added blur option in `VoxelGeneratorImage`
- Generators now all inherit `VoxelGenerator`
- Blocky voxels
- Blocky voxels can be defined with a custom mesh, sides get culled automatically even when not a cube
- Blocky voxels can have custom collision AABBs for use with `VoxelBoxMover`
- The 3D noise generator now works in blocky mode with `VoxelTerrain`
- Blocky voxels support 8 bit and 16 bit depths
- Smooth voxels
- Implemented Transvoxel mesher, supporting transition meshes for seamless LOD. It now replaces DMC by default.
- Heightmap generators now have an `iso_scale` tuning property which helps reducing terracing
- Fixes
- Fixed dark normals occasionally appearing on smooth terrains
- Fixed Transvoxel mesher being offset compared to other meshers
- Fixed stuttering caused by `ShaderMaterial` creation, now they are pooled
- Fixed cases where `VoxelLodTerrain` was getting stuck when teleporting far away
- Fixed a few bugs with `VoxelStreamBlockFiles` and `VoxelStreamRegionFiles`
- Breaking changes
- Removed channel enum from `Voxel`, it was redundant with `VoxelBuffer`
- Renamed `VoxelBuffer.CHANNEL_ISOLEVEL` => `CHANNEL_SDF`
- Removed `VoxelIsoSurfaceTool`, superseded by `VoxelTool`
- Removed `VoxelMesherMC`, superseded by `VoxelMesherTransvoxel`
- Replaced `VoxelGeneratorTest` by `VoxelGeneratorWaves` and `VoxelGeneratorFlat`
03/10/2019 - `godot3.1`
------------------------
Initial reference version.
- Support for blocky, dual marching cubes and simple marching cubes meshers
- Terrain with constant LOD paging, or variable LOD (smooth voxels only)
- Voxels editable in game (limited to LOD0)
- Various simple streams to generate, save and load voxel terrain data
- Meshers and storage primitives available to use by scripts
...
- 01/05/2016 - Creation of the module, using Godot 3.0 beta

View File

@ -1,66 +0,0 @@
Code guidelines
=====================
For the most part, follow Godot conventions.
Syntax
--------
- Class and struct names `PascalCase`
- Constants, enums and macros `CAPSLOCK_CASE`
- Other names `snake_case`
- Globals prefixed with `g_`
- Parameters prefixed with `p_`, but not really enforced so far. Matters for big functions.
- Private and protected fields prefixed with `_`
- Some private functions start with `_`, either to mimic Godot API, or if it's a re-used function that performs no checks
- Enums prefixed by their name. Example: `enum Type { TYPE_ONE, TYPE_TWO }`
- Open braces at the end of line, close them next line
- Never omit braces
- Space between binary operators and control flow: `if (a + b == 42)`
- Indent with tabs
- Use Clang-format to automate most of these rules (the one included in Godot should do it)
- Constructors and destructors go on top
- Bindings go at the bottom. Private wrapper functions can be used to adapt to the script API and are prefixed with `_b_`.
- Avoid long lines. Preferred ruler is 100 characters. Don't fit too many operations on the same line, use locals.
C++ features
-------------
- Don't use `auto` unless the type is impossible to express or a horrible template (like STL ones). IDEs aren't granted (Github reviews and diffs)
- STL is ok if it measurably performs better than Godot alternatives.
- Initialize variables next to declaration
- Avoid using macros to define logic or constants. Prefer `static const`, `constexpr` and `inline` functions.
- Prefer adding `const` to variables that won't change after being initialized
- Don't exploit booleanization. Example: use `if (a == nullptr)` instead of `if (a)`
- If possible, avoid plain arrays like `int a[42]`. Debuggers don't catch overruns on them. Prefer using wrappers such as `FixedArray` and `ArraySlice` (or `std::array` and `std::span` once [this](https://github.com/godotengine/godot/issues/31608) is fixed)
Error handling
---------------
- No exceptions
- Check invariants, fail early. Use `CRASH_COND` in debug mode to make sure states are as expected even if they don't cause immediate harm.
- Crashes aren't nice to users, so in those cases use `ERR_FAIL_COND` macros for code that can recover from error
Performance
-------------
In performance-critical areas which run a lot:
- Avoid allocations. Re-use memory with memory pools, `ObjectPool`, fixed-size arrays or use `std::vector` capacity.
- Avoid `virtual`, `Ref<T>`, `String`
- Don't resize `PoolVectors` or `Vector<T>`, or do it in one go if needed
- Careful about what is thread-safe and what isn't. Some major areas of this module work within threads.
- Reduce mutex locking to a minimum, and avoid locking for long periods.
- Use data structures that are fit to the most frequent use over time (will often be either array, vector or hash map).
- Consider statistics if their impact is negligible. It helps users to monitor how well the module performs even in release builds.
- Profile your code, in release mode. This module is Tracy-friendly, see `util/profiling.hpp`.
Godot API
----------
- Use the most direct APIs for the job. Especially, don't use nodes. See `VisualServer` and `PhysicsServer`.
- Always use `Read` and `Write` when modifying `PoolVector`.
- Only expose a function to the script API if it is safe to use and guaranteed to remain present for a while
- use `memnew`, `memdelete`, `memalloc` and `memfree` so memory usage is counted within Godot monitors
- Don't leave random prints. For verbose mode you may also use `PRINT_VERBOSE()` instead of `print_verbose()`.

View File

@ -3,9 +3,9 @@ Voxel Tools for Godot
A C++ module for creating volumetric worlds in Godot Engine.
<img src="doc/images/blocky_screenshot.png" width="800" />
<img src="doc/images/smooth_screenshot.png" width="800" />
<img src="doc/images/textured-terrain.jpg" width="800" />
![Blocky screenshot](doc/docs/images/blocky_screenshot.png)
![Smooth screenshot](doc/docs/images/smooth_screenshot.png)
![Textured screenshot](doc/docs/images/textured-terrain.jpg)
Features
---------------------------
@ -17,7 +17,7 @@ Features
- Minecraft-style blocky voxel terrain, with multiple materials and baked ambient occlusion
- Smooth terrain using Transvoxel
- Levels of detail for smooth terrain
- Voxel storage using 8-bit channels for any general purpose
- Voxel storage using 8-bit or 16-bit channels for any general purpose
What This Module Doesn't Provide
@ -50,12 +50,13 @@ Ready-to-use versions of Godot including the module exist, though they might not
### Compiling
Compiling the source yourself is the best way to get your own version and export template.
Please see the [Getting Started Guide](doc/01_get-started.md) for instructions.
Please see the [documentation](https://voxel-tools.readthedocs.io/en/latest/getting_the_module/) for instructions.
### Examples
### Documentation
- [Main documentation](https://voxel-tools.readthedocs.io/en/latest/)
- Documentation: [Getting Started Guide](doc/01_get-started.md)
- Zylann's demos: [Zylann's demos](https://github.com/Zylann/voxelgame)
- TinmanJuggernaut's demos: [TinmanJuggernaut's demo](https://github.com/tinmanjuggernaut/voxelgame)
@ -65,6 +66,7 @@ Roadmap
These are some ideas that may or may not be implemented in the future:
* Instancing for foliage and rocks
* Texturing on smooth terrain
* Editor preview and authoring
* Improving LOD performance
@ -87,5 +89,6 @@ Jonas (NoFr1ends)
lenis0012
Phyronnaz
RonanZe
furtherorbit
```

View File

@ -48,7 +48,8 @@ VoxelAboutWindow::VoxelAboutWindow() {
"Jonas (NoFr1ends)\n"
"lenis0012\n"
"Phyronnaz\n"
"RonanZe\n";
"RonanZe\n"
"furtherorbit\n";
{
Dictionary d;
// TODO Take version from somewhere unique