Skip to content

Mayur Reddy

Software Engineer

Menu

Projects / Sailing Renderer

Sailing Renderer

2023-2026

C++20/OpenGL real-time renderer with adaptive tessellation, Gerstner ocean, PBR water, and GPU timing.

GitHub ↗Demo ↗

Two sailboats on a tessellated Gerstner ocean rendered by the Sailing Renderer.

Sailing Renderer is a C++20 / OpenGL 4.4 real-time graphics project. It began as University of Florida graduate coursework. The current tree adds scene/renderer separation, adaptive Gerstner water, PBR, PN surfaces, tessellated shadows, and GPU timestamp profiling.

Implemented

  • Adaptive screen-space GPU tessellation on an 8×8 authored ocean mesh.
  • Nine-wave Gerstner displacement and analytic normals in the tessellation-evaluation stage.
  • Cook-Torrance / GGX water shading, dielectric Fresnel, cubemap reflection, ACES tone mapping.
  • PN triangle hulls and PN quad sails.
  • Tessellated directional and omnidirectional shadow passes.
  • Normal, wireframe, and tessellation-LOD debug views.
  • GPU timestamp queries and a --benchmark mode that writes JSON.
  • Coarse world-XZ convex-hull SAT with CTest. Not 3D mesh collision and not rigid-body physics.

Architecture

Scene update (once)

directional shadow → point shadow → boats / sails / rig → ocean

Application owns the window, camera, scene, and renderer. Render passes only read transforms. Visual boat height samples the same Gerstner function the water TES uses. Collision stays on a fixed-Y hull so SAT does not inherit wave motion.

Benchmarks

Committed benchmarks/latest.json on an RTX 4080 SUPER at 1920×1080, VSync off:

Mode Ocean GPU mean Total GPU mean Est. tris
Fixed 16 0.094 ms 0.186 ms 25088
Adaptive 24 px/seg 0.095 ms 0.188 ms 19405

Adaptive mode drops estimated water triangles. Total GPU time stays around 0.19 ms. Triangle counts are CPU estimates (inner_tess² per patch), not hardware primitive counters.

Limits

  • Collision is a coarse 2D convex-hull test in world XZ.
  • Boat pitch/roll is a light visual sit on the Gerstner surface, not buoyancy.
  • Interactive boat-to-boat latch has not been visually confirmed. Tests cover the SAT function.
  • Environment reflection is one cubemap sample, not prefiltered IBL.
  • The cloud skybox still has no recorded original license. See the repo THIRD_PARTY.md.

The older GitHub slug OpenGL-Sailing resolves to the same repository.

Figures

Close-up of Gerstner water shading from the Sailing Renderer.
Close-up of Gerstner water shading from the Sailing Renderer.
Tessellation LOD debug coloring on the ocean mesh.
Tessellation LOD debug coloring on the ocean mesh.
Adaptive wireframe view of the tessellated ocean.
Adaptive wireframe view of the tessellated ocean.