Single Histogram Filter
Pre-release
Pre-release
Release 0.6.0-Preview.1
STPSingleHistogramFilter
Implement a filter utility in SuperAlgorithm+Host library, which is now linked with SuperTerrain+.
Single histogram filter generates an analytical histogram for every pixel in Sample texture format within a given radius. This is useful for retrieving weights of all biomes presented in a given radius during biome edge interpolation.
More development details will be released along with finalised version.
Issues
The current implementation of STPSingleHistogramFilter has been tested to output correct result. However the output histogram is a flatten, jagged column-major matrix, and will cause problem if use in conjunction with other maps generated by out engine, which are all aligned in row-major. There're two alternatives:
- Transpose the output matrix. It's an easy solution but needs to loop through outputs and since the array is jagged, it might be difficult to optimise it.
- Perform two separable kernels in reverse order, i.e., do vertical pass first then horizontal. Require some structure overhauls, but does not require additional operations. One major drawback is the cache spatial locality is broken as we need to read row-major input sample map in column order.
General improvement and fixes
- Refine on
STPFreeSlipGeneratorsuch that it can generate global-local index table for host usage. - Make
STPFreeSlipManagertemplate so it can deal with different types of texture. STPFreeSlipGeneratornow pre-cachesSTPFreeSlipDatain host and device memory to reduce the amount of memory copy done.- Add
STPFreeSlipGenerator::STPFreeSlipManagerAdaptorwhich cache texture data inside and can be extracted in different memory space without exposingSTPFreeSlipGenerator. - Replace pointer type with reference type where applicable.
- Remove redundant configure file (
STPAlgorithmDefine.h), and include in the header include directory instead. - Simplify CMake include directory models, making them more consistent.
- Explicitly delete classes that are not supposed to use copy/move constructor/assignment operator.
- Explicitly delete constructor for classes that are only used statically.
- Improve exeception handling such that an execption instead of string is thrown.
- Replace C style cast with C++ style in CUDA kernel in
STPHeightfieldGenerator.