Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

Clearwater

Real-time, photoreal shallow water in a single HTML file. WebGL2, no libraries, no build step, no external assets.

Live demo · drag to look around · tap the water

Clearwater

Run

Open index.html in a browser, from disk or any static host. Nothing to install.

Needs WebGL2 with float render targets (EXT_color_buffer_float). Resolution adapts to keep the frame rate up.

URL optionEffect
?debugFrame rate, resolution, quality level
?noglareDisable lens-diffraction glare
?t=5Freeze time at 5 s (screenshots)
?yaw=0.5&pitch=-0.4Initial camera direction, radians
?view=causShow the raw caustics texture

Code map

Everything lives in index.html, in sections marked /* ---- Name ---- */:

SectionWhat to tweak
Ocean spectrum (FFT)L patch size, DEPTH, TARGET_SLOPE wave steepness
Interactive ripplesRN, RSIZE simulation grid
CausticsG ray grid, C caustics resolution, IORS per-channel refraction
Main water shaderFresnel, absorption, seabed shading (GLSL)
Post / Lens diffraction glareBloom, glare, tone curve, grain
Camera & inputSUN_EL, SUN_AZ sun position, VFOV
LoopFrame loop, adaptive quality

The seabed texture is base64 in <script id="pebbles-texture"> at the end of the file. To regenerate it: python tools/make_pebbles.py (numpy, scipy, pillow), then paste the base64 JPEG into that block.

References

  • Jerry Tessendorf, Simulating Ocean Water: FFT waves
  • Evan Wallace, WebGL Water: refracted-grid caustics
  • Inigo Quilez, Texture repetition: seabed tiling
  • Marc Olano & Dan Baker, LEAN Mapping: distant highlights

Credits

Made by Aurélien at Lumaris.

MIT License, see LICENSE.

关于 About

Real-time, photoreal shallow water in a single HTML file. WebGL2, no libraries, no build step.
causticsfftrealtime-renderingshaderssingle-filewaterwebgl2

语言 Languages

HTML98.9%
Python1.1%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
1
Total Commits
峰值: 1次/周
Less
More

核心贡献者 Contributors