Skip to content

Animated Water Geometry

Pre-release
Pre-release

Choose a tag to compare

@stephen-hqxu stephen-hqxu released this 20 Apr 22:36

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 STPTransparentObject for 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 class STPRenderable.
  • STPTessellationSetting is separated out from STPMeshSetting.
  • Refactor shader built-in struct into a separable common source header STPSeparableShaderPredefine.glsl.
  • Make splatmapGenerator function in STPWorldPipeline returns a const reference.
  • STPScenePipeline no 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 in STPScreen now takes a STPShaderManager rather than STPShaderManager::STPShaderSource as input for logical consistency.
  • STPProgramManager now 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.