Introduce Water
Release 0.13.0
Please refer to pull request #40 for more development discussions.
Water system
The major highlight in this release is the simple water rendering system with procedural animation and basic reflection / refraction. STPWater is added as a new rendering component for rendering water geometry. STPBidirectionalScattering is also added as a new rendering component for rendering water visual effects using bidirectional scattering distribution function. The current implementation is far from being photorealistic, though.
We may decide to use global illumination in the future for improving rendering quality of water, such as adding caustics and underwater effect, as screen-space reflection produces underwhelming quality.
Water shader shares a lot in common with the terrain shader so all vertex-related shaders co-exist with the terrain one.
- Add
STPWaterSettingto configure the behaviour of water renderer. - Add
STPMaterialLibraryto configure material properties for water geometry. It assumes that the water has uniform material to reduce memory cost.
Free-slip logic
We have also improved the very old system introduced in #15 and bring significant performance improvement to the particle-based hydraulic erosion. Due to the fact that the old index lookup table degrades performance dramatically, we ended up removing this entirely from the engine.
To ensure data safety, modification to the heightmap is made to be atomic during erosion. For performance consideration this is not enabled in debug mode as atomics perform poorly without turning on optimisation.
General fixes and improvement
STPAlphaCullingnow supports using double culling expressions.- Add a new G-Buffer to
STPScenePipelinefor storing material ID. - Improve
STPPlaneGeometryto fully utilise the power of index buffer and remove all repeated vertices. - Simplify terrain shader. Remove redundant pass-through of normal vector. Remove useless geometry shader during regular rendering. Remove unused stuff from the shader.
- Improve terrain tessellation control shader to fully exploit the power of invocation parallelism.
- Separate
STPTessellationSettingfromSTPMeshSetting. - Remove texture type Specular.
- Fix some bugs in the HBAO implementation which causes the occlusion to be weaken.
- Fix an error related to use of
char*on string literal in a number of places likeSTPWorldManagerin the demo program andSTPDebugCallbackin the rendering engine. - Make argument
std::stringtoconst std::string&for a number of functions inSTPRuntimeCompilable. - Make include directory template file STPAlgorithmDeviceInfo.h.in to use
std::string_viewinstead ofconst char[]. STPCommonCompilerin the demo program now generates include directory in compile-time.