Animated Water Geometry
Pre-release
Pre-release
Release 0.13.0-Preview.2
STPWater
In this release we have added a rendering target for water. The water plane is placed as defined by user using biome map and a lookup table that returns water height given biome ID.
- Add a new type of scene object
STPTransparentObjectfor objects with reflective and refractive materials. - Implement water tessellation shader on top of the current heightfield terrain shader.
- Water plane culling allows water to be placed only when necessary.
- Water plane is also procedurally animated to give a wavy visual effect.
- Implement water fragment shader for computing water surface normal.
- Add
STPWaterSetting.
General fixes and improvement
- Refactor
render()function for base scene objects into a new base classSTPRenderable. STPTessellationSettingis separated out fromSTPMeshSetting.- Refactor shader built-in struct into a separable common source header
STPSeparableShaderPredefine.glsl. - Make
splatmapGeneratorfunction inSTPWorldPipelinereturns a const reference. STPScenePipelineno longer manages memory for each renderinig component. User is responsible for retaining the lifetime of components added to the scene.- Remove Specular texture type because it is useless in PBR model.
initScreenShader()function inSTPScreennow takes aSTPShaderManagerrather thanSTPShaderManager::STPShaderSourceas input for logical consistency.STPProgramManagernow detaches all shaders upon successful program linking.
STPHeightfieldTerrain
- Separate terrain vertex shader into a standalone program so it can be shared with water shader.
- Remove biomemap binding because it is not used.
- Remove pass-through of normal vector in the shader because it is a constant vector facing upward for every vertex.
- Remove geometry shader stage for regular terrain rendering because it is useless and GS is slow. Now geometry shader is only used for shadow pass.
- Camera space conversion from world to clip is now performed in the tessellation evaluation shader.
- Improve level-of-detail computation in tessellation control shader to exploit invocation parallelism.
STPPlaneGeometry
- Improve plane generation algorithm such that no vertex overlaps.
- Remove Y component from the position vector because it is a constant.
- With both optimisations, the memory usage has reduced to only 1/5 of the original.