Repository navigation
v0.0.7π Vulkan Terrain Renderer
π Initial Ocean System Implementation | 2026-08-25
This update introduces the first prototype of the ocean system for the Vulkan terrain project.
β¨ New Features
- π Added a basic ocean plane covering the current world area
- π Set the initial sea level to
Z = 0 - πΊ Created the water plane using 4 vertices and 6 indices
- πΊοΈ Automatically calculates the ocean size using
BlockNum Γ BlockDistance - π¨ Added color presets for shallow, medium, and deep water
- π§± Reused the existing depth buffer for basic terrain-water occlusion
- ποΈ Terrain above sea level remains visible, while lower areas are covered by water
- π§© Prepared the project structure for a future independent water mesh and rendering pipeline
π¨ Current Water Colors
const vec3 deepOceanColor = vec3(0.0, 0.1, 0.35);
const vec3 middleOceanColor = vec3(0.0, 0.4, 0.7);
const vec3 shallowOceanColor = vec3(0.1, 0.6, 0.6);The current prototype uses a constant water color. A future update will calculate water depth from the terrain below and smoothly blend between shallow, coastal, and deep-water colors.
π οΈ Current Implementation Status
This version primarily verifies:
- Correct water vertices and indices
- Successful ocean rendering
- Correct depth testing between terrain and water
- Proper alignment between terrain height and sea level
- Sufficient ocean coverage across the current map
The ocean system is still in an early prototype stage and does not yet include:
- Vertex-displaced waves
- Depth-based water colors
- Transparency and refraction
- Fresnel reflections
- Shoreline foam
- A coastline distance field
- A dedicated water rendering pipeline
- FFT ocean simulation
β οΈ Known Limitations
- The ocean currently contains only 4 vertices and cannot support geometric waves
- Some rendering resources are still shared with the terrain system
- Water is temporarily detected using a fixed sea-level condition
- The fragment shader cannot currently access the terrain height below each water fragment
- Water color does not yet react to coastline distance or actual water depth
π§ Planned Improvements
- Create an independent
LveWatermodule - Add a dedicated
WaterVertexstructure - Separate water vertex and index buffers from terrain buffers
- Create dedicated water vertex and fragment shaders
- Upgrade the ocean plane to a
128Γ128or256Γ256grid - Calculate water depth using the underlying terrain height
- Add smooth shallow, coastal, and deep-water color transitions
- Implement Gerstner waves
- Calculate dynamic normals from wave derivatives
- Add Fresnel reflections and transparent blending
- Implement shoreline foam and shallow-water effects
- Explore GPU-based FFT ocean simulation
π Summary
This update completes the first basic validation stage of the ocean system. The current goal is not final visual quality, but verifying that the water mesh, indices, depth testing, ocean coverage, and sea-level relationship work correctly.
Future updates will separate the ocean from the terrain system and gradually introduce dynamic waves, depth-based coloring, reflections, refraction, shoreline foam, and more advanced GPU ocean simulation. π