Skip to content

Bug Fix and Improvement

Latest

Choose a tag to compare

@stephen-hqxu stephen-hqxu released this 06 Apr 11:35
4827240

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.h with platform detection and compiler warning utilities.
  • Fix a UB in STPWorldPipeline that reinterpret casting std::unique_ptr<void*[]> to arbitrary type, such as float** without lifetime startup.
  • Replace unsigned long long with STPSeed_t whenever applicable, i.e., when the variable is used as a 64-bit seed value.
  • For SuperTest+, remove use of using namespace to bring all SuperTerrain+ names into scope, and only do using for 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 STPObjectPool public.
  • Remove test for STPSmartDeviceMemory because 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 STPFractalSimplexInformation in STPSimplexNoise to avoid padding.
  • 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 STPHeightfieldSetting with STPRainDropSetting.
  • 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 STPRandomTextureGenerator and put generation utilities inside this source rather than STPHeightfieldGenerator.
  • Use 64-bit seed instead of 32-bit for STPStarfield.
  • Move seed from STPStarfieldSetting to STPStarfield function.