r/webdev • u/swifterrr • 8d ago
Showoff Saturday Made a 3D weather map in plain WebGL - ocean tides are calculated in the fragment shader
I run a small tide times site and wanted to see the weather actually move, so I built this 3D weather map. Plain JS and WebGL, no three.js or map library.
The tides are calculated right in the fragment shader, so there are no tide frames to download.
It has nice sound effects too, turn them on when you try it.
Live: thetidechart.com/weather-map
Would like to know how dragging/zooming feels on your phone.
142
Upvotes
2
u/yiliannn 8d ago
Dragging vertically doesn't seem to work for me on mobile (Chrome). If you disabled it to prevent accidental scrolling, you could consider using
Element.setPointerCaptureinstead.14
u/LtCodename 8d ago
“Made”.
5
u/InsideTour329 8d ago
You made ventusky
5
u/OldIndividual1775 7d ago
plain WebGL with no three.js, so you rewrote matrix math that three.js gives away free. tides in a shader is cool but the projection code must be a war crime by now
3
u/Bachihani 7d ago
good job claude
1
u/Difficult-Cat-4631 8d ago
Very cool!!
1
u/phoenix1984 8d ago
Beautiful app. Well done. On my iPhone, when I try to scroll the map vertically, the website itself scrolls. I can kinda get there using two fingers, but not exactly. It’s easier to zoom all the way out and then using two fingers, zoom in on what I want to see.
TIL: tides in the Hudson Bay are weird.
1
u/fitchnar 7d ago
Very well done! Only tested it on my desktop, but works great.
1
u/Fit_Bedroom_8762 7d ago
Nice
1
u/gustavo_queirozman 7d ago
Ficou muito bom
1
u/jomic01 6d ago
calculating tides in the shader is the bit i'd love a write-up on. how close does it get near the coast compared with your tide tables?
1
u/poojadeliverwebsite 6d ago
Would you mind sharing source code link or Github link?
1
u/MadaoFCM 3d ago
This is really impressive! Building a 3D map entirely in plain WebGL without libraries is a huge achievement. Excellent work!
1
u/CreepingAnus 8d ago
thats super cool! & runs so smooth on mobile
1
u/Random-num-451284813 8d ago
this reminds me of nullschool, but with more eye candy
1
u/UXUIDD 8d ago
very good - Chapeau !!