11 ms·
FFT-based ocean-wave rendering, implemented in Godot
- shireboy 2y agoNice, but may need to adjust the limits: https://news.ycombinator.com/item?id=41631177 https://news.ycombinator.com/item?id=41631177
- eps 2y agoDon't have any substantial comments, but I must say that the result is really impressive. Just wow.
- kroolik 2y agoThat's some National Geographic clip. Now, show us the demo!
- Mattish 2y ago2 of the linked references have full implementations of very similar things, with some shared references. Is there something here which godot is enabling which wasn't previously possible? It seems to be entirely GPU compute workload with particles which are available as part of all mature rendering engines
- arminiusreturns 2y agoGodot itself is open source, which I think has brought a strong community of people to it. My mega-big-ultra project I've been working on since 2013 would be nowhere near as close to where it is now (close to launching crowdfunding/alpha) if I hadn't transitioned to Godot! (I was fighting the UE4 system from the days when it was $20/mo, we linux people really got dealt dirty by Tim Sweeny, with lots of empty promises for linux support)
- tsurba 2y agoShadertoy also has nice ones https://www.shadertoy.com/view/Ms2SD1 https://www.shadertoy.com/view/Ms2SD1
- chhs 2y agoLooks incredible!
- viraptor 2y agoDifferent approaches, but if someone's interested in waves/ocean simulation, Acerola published some awesome (as always) videos on this topic. https://youtu.be/PH9q0HNBjT4 https://youtu.be/PH9q0HNBjT4 and https://youtu.be/yPfagLeUa7k https://youtu.be/yPfagLeUa7k (edit: just realised one is linked in the references, just under the real name rather than nick)
- rkagerer 2y agoThe sample video is really impressive, it's worth a peek.
- jesperwe 2y ago20 years ago I could spend months tweaking ocean surface in renders and not get even close to that. Amazing how good this is!! Although the demo clip feels a bit exaggerated (saying this having over 50k Nm open water ocean sailing in my logbook). Waves that sharp and high would need the wind blowing a lot stronger. But I am sure that is just a parameter adjustment away! Since it is in Godot I assume the rendering is real time? Does it need a monster GPU?
- ryanjshaw 2y agoThere's 2 demo clips, the second one shows quite a number of parameters you can adjust.
- pixelatedindex 2y agoI think the point is that these parameters you adjust are being rendered near real-time, whereas back in their days you’ll have to enter these values, and add custom tweaking because the hardware just wasn’t powerful enough to do the things we can do now at many times the speed. Not to mention the vast improvement in mileage for your time.
- dylan604 2y agoyeah, the "in real time" is what kills me. the old joke of blue bar races, rendering, buffering, and any of the other things us gray beards had to put up with is just unimaginable to the whippersnappers of today.
- pjmlp 2y agoBack when I graduated, doing particle engines, with marching cubes and stuff like that, was a graduation thesis project. Nowadays it is a check box on a game engine, one of many. People don't imagine how good they have it with modern engines. Not to take any value out of this work, this is a great achievement and kudos to the author, only making the point how good we have nowadays.
- 2y ago
- deleted 2y ago[deleted]
- Archelaos 2y agoThe demo looks unrealistic. The waves never break. Increasinlgy steeper slops with pointy peaks travel from left to right until they just sink down towards the left.
- AlunAlun 2y agoThis is explicitly a simulation of ocean waves, and ocean waves do not break.
- Archelaos 2y agoOkay. That makes sense. What about the steep elevation? Shouldn't it be smoother at the top?
- eniwnenahg 2y agoit should curve at the top, its too pointy. this example looks like mountain peaks and not wave peaks. also the color should be patchier somehow when zoomed out, with darker blue gradient. otherwise I like it/ its almost convincing
- _yb2s 2y agoAs someone who has done offshore sailing… the waves also look unnaturally steep/tall/pointy to me. It’s very cool, but needs some tweaking still.
- tomcam 2y agoI spent years living on the beach. When you live on the beach, you watch the ocean for hours at a time because it’s mesmerizing and feels sensational. I wouldn’t guess for a second this was a render.
- eniwnenahg 2y agoI live on the beach now and I have a view about 14 stories above the water also- and somehow its clear to me its fake. Its missing the dark patches from wind gusts and the white parts are going straight up instead of curling even lightly. otherwise it seems pretty real
- deleted 2y ago[deleted]
- saxelsen 2y agoHave you actually looked at waves and how they move, though? If you've spent years living on the beach you'd be able to spot in a heartbeat that the formation of foam and movement of the wave is not natural.
- tomcam 2y agoOther observers said the same thing so apparently I didn’t look as carefully as I thought I did! > If you’ve spent years living on the beach, blah blah blah I wish I gave a flying fuck about your not very subtle accusation. Feel free to believe what you want. I’m retired and I still don’t have as much free time as you do. You are not very good at mind reading, but I’m glad you’re giving the old college dropout try.
- cenamus 2y ago20k hacker news karma says quite a lot more free time than a couple hundred though
- tomcam 2y agoYet somehow I held down multiple jobs simultaneously, care for a severely handicapped child, support an extended family, and keep up my technical skills even in retirement while other people are staring at TikTok in line at Starbucks. Maybe it says something about time management. Stay classy
- deleted 2y ago[deleted]
- ReptileMan 2y agoThat looks wet. And honestly it is the best compliment I can give.
- eniwnenah 2y ago[dead]
- eniwnenahg 2y agoi live by the sea and have a sea view. when a gust comes through to stir seadogs the color is darker in patches where there is wind in small areas. You cant havr choppy weather without some of this patchy color. also the white chop never goes straight up as in the videos, but it curls at least slightly.
- bnegreve 2y agoIt is very impressive, and better than anything I've seen before but think something is bit off with the swell. If I had to explain I would say that high frequency waves don't travel on top of low frequency waves the way they do in the video.
- cheschire 2y agoWhile I appreciate ever more realistic water bodies, the part that game makers really struggle with is where the water encounters an obstacle. I did not see any mention of this in the description. Conceivably though, this is not a huge conceptual leap right? A game maker would simply need to add logic to impact the frequencies near objects, no?
- deleted 2y ago[deleted]
- magicalhippo 2y agoThe referenced paper "Simulating Ocean Water" talks about this in section 5. Indeed the FFT approach makes this difficult, where a different approach[1] for waves reflecting off obstacles. That approach uses convolution, however you can perform convolution using FFTs[2], so perhaps there's some nice way to combine the two approaches. edit: I just skimmed the papers, and it seems[1] does indeed mention combining the FFT approach with the convolution approach in the section on Ambient Waves. [1]: https://people.computing.clemson.edu/~jtessen/reports/papers_files/Interactive_Water_Surfaces.pdf https://people.computing.clemson.edu/~jtessen/reports/papers... [2]: https://phys.uri.edu/nigh/NumRec/bookfpdf/f13-1.pdf https://phys.uri.edu/nigh/NumRec/bookfpdf/f13-1.pdf
- thom 2y agoTo an extent you can get away with just sampling the output of the water shader to work out the water's effective height at any given point. Big changes in height, or buoyancy for non-static objects, indicate bigger angles hitting the waves and you can fake some splashes with particles while the wave itself just gets occluded. Apply forces at just three or four points and you can make a boat rock pretty believably on top of this kind of water.
- deleted 2y ago[deleted]
- lukko 2y agoOh my - this is great! Does it mention what the density of the mesh is, or is it a flat plane with no displacement? Also, I wonder if there's a way to optimise the foam particles in some way. It does seem very wasteful to generate them across the whole plane, when most are culled. I wonder if the particle emission / creation could be linked to foam density?
- nkrisc 2y agoI didn’t see a mention of the mesh density, but peeking at the main scene file (I assume the one seen in the video), this appears to be the mesh used: https://github.com/2Retr0/GodotOceanWaves/blob/main/assets/water/clipmap_high.obj https://github.com/2Retr0/GodotOceanWaves/blob/main/assets/w...
- lukko 2y agoah amazing, thanks - looks like 330k vertices
- HL33tibCe7 2y agoThis is beautiful, I'd love to have this as a lockscreen or even a screen panel on a wall somewhere
- kamranjon 2y agoThe other two Godot repos by this person are very interesting as well. I love the level of detail they add to explaining their repos. This one is particularly interesting: https://github.com/2Retr0/GodotGaussianSplatting https://github.com/2Retr0/GodotGaussianSplatting Wonder if they are a student, they seem to cite other work frequently and have a strong grasp on recently published materials.
- codetrotter 2y ago> Wonder if they are a student Seems like they might be. One of their repos has this title and description: > ENGR96A-coursework > Relevant coursework for ENGR 96A Introduction to Engineering Design F23 And F23, judging by the dates of the commits in that repo means Fall 2023. Of course, it could be that this and other UCLA courses referenced in the repos are open for everyone. So maybe you don’t have to be enrolled as a traditional student at UCLA to take them.
- fcatalan 2y agoThings like this brought me into computers, but along the way I fell for the easy and boring life of glueing libraries, endpoints and corporate bullshit that leads to burnout. Perhaps some day...
- kevindamm 2y agoSomeday could be today...
- maaaaattttt 2y agoThere are only two good moments to plant a tree: 20 years ago and today.
- Aeolun 2y agoIsn’t it like: the best time to plant a tree is 20 years ago. The next best time is today.
- epaga 2y agoThough I never understood why 19 years ago wouldn’t be the second best…
- plasticchris 2y agoBecause the statement is meant to motivate the reader.
- rbetts 2y agoThat would make today the worst day to plant a tree?
- phn 2y agoThe worst so far, and the best when compared to all of your remaining days.
- aetherspawn 2y agoI think the downside of this approach is you can’t ie split the waves with a ship.
- coldcode 2y agoYeah I wondered how that could be done, otherwise this would only be good for backgrounds.
- wslh 2y agoGreat! I've shared this with every physicist I know who's not directly involved in animations. Quick question from my swimming class yesterday: We know that professional swimmers use a range of technologies, both old and new, in their training. Is there currently a model that fully simulates the physics of swimming across different styles? If not, this seems like a great project idea!
- convivialdingo 2y agoFourier was measuring tidal waves when he came up with wave frequency transforms - so in a way this is almost a full circle. Very impressed!
- pmarreck 2y agoHow do I get this masterpiece running locally to play with? I don't even know what Godot is (but I've used makefiles and such)
- jimmySixDOF 2y agoIf you have a Quest VR device Godot just released an editor with live scene updates I am bookmarking this to try see what it looks like in there.
- eaglefield 2y agoThe github repository is a godot project. Godot is a game engine. The quickest way is to download godot. Clone the repository and open the folder as a project in godot.
- krapp 2y agoGodot is an open source game framework: https://godotengine.org/ https://godotengine.org/ You would presumably need to download the Godot framework and open it in the framework.
- nkrisc 2y ago1. Download Godot: https://godotengine.org/download/windows/ https://godotengine.org/download/windows/ (this project uses an addon for GUI that requires C# so you’ll need the C# version of Godot 4.3) 2. Clone the repository 3. Open Godot and import the project by navigating to the directory containing the project.godot file. Then open the project and away you go.
- pmarreck 2y agoI did it on Mac. HOLY CRAP! Amazing!
- julosflb 2y agoVery neat! I'm hydrodynamics by background and I wondered a long time ago why this kind of approach was not used as I always found ocean waves to look awful in movies. Once you describe ocean sea state in frequency domain, it is quite easy to give to floating objects like ships realistic motions using what we called RAO in this field (linear operator). You can also model sea disturbance (diffracted and radiated waves) caused by an object in a similar fashion.
- Eddy_Viscosity2 2y agoThis is great, but this approach will break down a bit for REALLY big waves as they become non-linear. Water waves are not sinusoidal, but are close enough for small and medium wave heights that these methods work really well. The big big waves are not only much farther from sinusoidal but the waves start interacting with each in a non-linear way that can't be captured by the linear superposition approach used here. So for most sea states, this is fantastic. But if you want to do the 'perfect storm' wave or something like that, you need to use a different approach for realism.
- bobim 2y agoI would like a Silent Hunter III remake with this.
- lambdaone 2y agoThis is astoundingly good work; even though, as other commenters have said, it could still be improved on, the fact that it achieves such a level of realism with such a simple and elegant framework is truly impressive.
- jkmegtu 2y agoFree fire
- bee_rider 2y agoIt looks really good. Out of curiosity, I’m sure everybody has heard of the FFT. They are quite general and used all over the place, and I imagine they’d be the first thing somebody would reach for if they had to describe waves. But I’d never heard of Gerstner waves. This leads me to believe that Gerstner waves are a more specialized thing. Since lots of work has already gone into rendering water, I tend to assume the method with a name I’ve never heard of was only reached for after very clever people rejected Fourier transforms for some reason. But, the results look better than most of what I see elsewhere. Has something changed to enable the more conventional solution?
- teamonkey 2y agoGerstner Waves are less computationally-expensive than FFT-based waves and are comparatively easy to understand and implement. https://en.wikipedia.org/wiki/Trochoidal_wave https://en.wikipedia.org/wiki/Trochoidal_wave
- btbuildem 2y agoIt's interesting how hard this problem is. We've been trying for decades, and we're still in the uncanny valley with it. If you freeze-frame this, the peaking waves look like snow-capped mountains. It feels unrealistic because for water to have features this sharp, it would have to be quite windy -- and the wind would never be blowing straight up. Here, the sharp features would need to be directional. The simulation has the swell nature of the waves down pretty well though. There isn't as much horizontal movement, as more up-and-down, which is what you'd expect to see in open water.
- zamalek 2y ago> uncanny valley I've been playing Nightingale and, oh boy, is the ocean water something special there. To be clear, they don't tackle spray and such by keeping the waves calm, which has allowed them to focus on other things. Whatever it is they are doing to simulate light transmission is working. The light shining through the waves at sunrise or sunset looks great and really sells the effect for me. It could maybe be accused of being a bit painterly, but it doesn't look wrong.
- btbuildem 2y agoI checked out some gampleay videos -- they do a good job with the swell too, and I really like the way ambient light interacts with the water (daytime you can see in, nighttime you can not) -- but again, the water texture quality is a bit uncanny. It looks like they're just scrolling a bumpmap over a wavy surface, with the final effect of too much horizontal motion for the little surface ripples/wavelets. It makes it look like there's a current, more like a moving river than a ocean/lake body of water. It's a stunning-looking game oveall, wow. I had no idea :)
- arminiusreturns 2y agoThis is awesome to see! Much more progress than I have made on my gplv3 version for my system. (the original intention was to replicate Blackwake style ship combat) For what it's worth, the real difficulty in gameplay is getting physics objects to interact with the waves properly.
- kelseyfrog 2y agoAny other resources on empirically derived rendering/animation methods? A lot of hobbyist gamedevs can think of tutorials where we "slap noise" on various things. While a good temporary use, there's an pedagogical gap between beginner and advanced methods. Another that comes to mind is vegetation animation. Like ocean waves, we often see animators throw a few octaves of sin/cos on plants to simulate wind, but because it doesn't spectrally match what we see in the real world, it looks off.
- bschmidt1 2y agoLooks awesome. Is it from a fixed perspective only? If not should show the camera rotation in the video demos so it's clear how it could be used. Would be curious to see how it looks from different angles etc. as the light changes.
- deleted 2y ago[deleted]
- nox101 2y agoReminds me of Sea of Thieves https://youtu.be/aGogFt4bhTM?t=12 https://youtu.be/aGogFt4bhTM?t=12
- teamonkey 2y agoSea of Thieves also uses a FFT-based algorithm for their water. https://www.researchgate.net/publication/326906476_The_technical_art_of_sea_of_thieves https://www.researchgate.net/publication/326906476_The_techn...
- tonetegeatinst 2y agoWhat level of math is this? I struggled in calculus over the summer but passed and am currently taking discrete math but recognized basically none of the math equations in the github project readme.
- szvsw 2y agoIt general falls into the category of signal processing - you will want to start with reviewing the Fourier transform, which requires a bit of calculus and a little bit of linear algebra. It helps to know Euler’s formula and how it gets used. There are lots of great visualizations online. The main thing that will really help with this though is developing a decent understanding of the concepts of the frequency domain and time domain as starting points. Good luck.
- goode 2y agoI was a bit confused what use an FFT had here since I was only familiar with the Fourier transform in the _forward_ direction (compute the component frequencies of a signal given samples). But this uses the _inverse_ Fourier transform, which effectively lets you take samples of a signal given its component frequencies. Here, those component frequencies are generated by mathematical functions developed (by other researchers) to model ocean waves, which are explained in https://github.com/2Retr0/GodotOceanWaves#ocean-wave-spectra https://github.com/2Retr0/GodotOceanWaves#ocean-wave-spectra.
- purple-leafy 2y agoThis is a really fascinating graphical piece!
- deleted 2y ago[deleted]