Aureliengmz
clearwater
Real-time, photoreal shallow water in a single HTML file. WebGL2, no libraries, no build step.
Documentation snapshot
README 快照
翻译暂时拿不到。
机器翻译的项目简介,仅供参考。原文在下方,也可以直接用浏览器自带的整页翻译 (Chrome / Edge 点地址栏右侧的翻译图标,或用右键菜单里的「翻译成中文」)。
下面正文是项目自己的英文 README。想读全文就用浏览器自带的整页翻译: Chrome / Edge 点地址栏右侧的翻译图标,或用右键菜单里的「翻译成中文」; 手机浏览器一般在菜单里。
本页保存的是公开项目资料快照,阅读过程不需要连接 GitHub。
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 option | Effect |
|---|---|
?debug | Frame rate, resolution, quality level |
?noglare | Disable lens-diffraction glare |
?t=5 | Freeze time at 5 s (screenshots) |
?yaw=0.5&pitch=-0.4 | Initial camera direction, radians |
?view=caus | Show the raw caustics texture |
Code map
Everything lives in index.html, in sections marked /* ---- Name ---- */:
| Section | What to tweak |
|---|---|
| Ocean spectrum (FFT) | L patch size, DEPTH, TARGET_SLOPE wave steepness |
| Interactive ripples | RN, RSIZE simulation grid |
| Caustics | G ray grid, C caustics resolution, IORS per-channel refraction |
| Main water shader | Fresnel, absorption, seabed shading (GLSL) |
| Post / Lens diffraction glare | Bloom, glare, tone curve, grain |
| Camera & input | SUN_EL, SUN_AZ sun position, VFOV |
| Loop | Frame loop, adaptive quality |
The seabed texture is base64 in “ 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
MIT License, see LICENSE.
Official distribution
获取与安装
暂未发现可确认的官方软件包地址
当前 README 快照没有出现 npm、PyPI、Crates.io、pub.dev 等官方包页链接。本站不会根据仓库名称猜测下载地址。
本站不托管项目文件;需要安装时,请以项目维护者发布的官方文档为准。
Before installing
使用前核验
本站保存公开资料用于阅读,不代表安全审计或功能背书。安装前请核对许可证、依赖来源和发布签名,不要直接运行来源不明的二进制文件或高权限脚本。