Release 0.16.7
Map type refactor
Instead of using primitive type like unsigned short, use fixed-size integer type such as std::uint16_t for terrain maps such as biomemap and heightmap. This provides a stronger guarantee when exchanging data between OpenGL (which specifies data in exact bit-width like GL_R16) and host.
This release adds the following map types to STPWorldMapPixelFormat:
- STPHeightFloat_t
- STPHeightFixed_t
- STPSample_t
- STPRegion_t
- STPSeed_t
STPDeviceLaunchSetup
This release adds a device launch configuration utility. This helps refactor calculation of device grid and block size during device launch, and calculate the thread index in kernel. The launch configuration can determine the best grid and block size to minimise the number of idling thread, although some justifications are required to prove that the calculation yields the optimal configuration.
General fixes and improvement
- Add
STPPlatform.hwith platform detection and compiler warning utilities. - Fix a UB in
STPWorldPipelinethat reinterpret castingstd::unique_ptr<void*[]>to arbitrary type, such asfloat**without lifetime startup. - Replace
unsigned long longwithSTPSeed_twhenever applicable, i.e., when the variable is used as a 64-bit seed value. - For
SuperTest+, remove use ofusing namespaceto bring all SuperTerrain+ names into scope, and only dousingfor names needed in the current test source code. - Improve CUDA compiler flags, make sure all host flags are forwarded correctly to NVCC.
- Fix some compiler warning about structure padding in
STPSimplexNoise. - Make creator in
STPObjectPoolpublic. - Remove test for
STPSmartDeviceMemorybecause of triviality. - Add a few more TODOs for C++20.
- The test reporter now prints the random seed used to run the test.
- Remove unused compiler warning suppression. Fix some warning rather than suppressing.
- Reorder fields for
STPFractalSimplexInformationinSTPSimplexNoiseto avoid padding.
- Reorder fields for
- Change validation for
STPAtmosphereSetting: view altitude does not have to always be greater than planet radius.
Placement new
Use placement new instead of cast in the following places to avoid undefined behaviour.
- Distribute erosion brush shared memory in
STPRainDrop - STPCamera
- STPCascadedShadowMap
- STPScenePipeline
- STPSceneLight
- STPMaterialLibrary
Generator
- Merge
STPHeightfieldSettingwithSTPRainDropSetting. - Simplify shared memory loading in
STPRainDrop.- Remove use of shared memory to compute base and range index of hydraulic erosion boundary; this is premature optimisation.
- Refactor renamed some types in
STPHeightfieldKernel.
STPRealism
- Refactor
STPRandomTextureGeneratorand put generation utilities inside this source rather thanSTPHeightfieldGenerator. - Use 64-bit seed instead of 32-bit for
STPStarfield. - Move seed from
STPStarfieldSettingtoSTPStarfieldfunction.