I Tried Simulating The Entire Ocean
ฝัง
- เผยแพร่เมื่อ 4 พ.ย. 2024
- Get a free 30 day trial and 20% off an annual plan at
brilliant.org/... ! #ad
Games like No Man's Sky, Black Flag, and Sea of Thieves boast some very beautiful water! But, how does it work? Can I do better with current hardware?
Topics covered include: Fourier series, fourier transform, frequency and time domain, oceanographic spectra, discrete fourier transform, fast fourier transform, approximate subsurface scattering, simulating foam, leveraging multiple frequency bands
Check out Jump Trajectory's channel!
/ @jumptrajectory
Support me on Patreon!
/ acerola_t
Socials:
Twitter: / acerola_t
Twitch: / acerola_t
Discord: / discord
Code: github.com/Gar...
References:
There are way too many references please just go to the code link above and scroll to the bottom of the readme for all my references there
Music:
Afternoon Break - Persona 3 OST
This Mysterious Feeling - Persona 3 OST
Midori Eyes - Paradise Killer OST
During The Test - Persona 3 OST
Junes Theme - Persona 4 OST
New Game - WORLD OF HORROR OST
In A Moment's Time - Skullgirls OST
A New Frontier - VA-11 Hall-A OST
Climactic Reasoning - Danganronpa 2 OST
Every Day Is Night - VA-11 Hall-A OST
Those Who Dwell In The Shadows - VA-11 Hall-A OST
Empty Ocean - Loop Hero OST
Joy - Persona 3 OST
Underground Club - VA-11 Hall-A OST
Your Love Is A Drug - VA-11 Hall-A OST
GO!GO!STYLE - Paradise Killer OST
Like A Dream Come True - Persona 4 OST
Thanks for watching!
This video is dedicated to my friend, Alotryx.
#acerola #graphics #gamedev #unity3d #graphics #shaders
Get a free 30 day trial and 20% off an annual plan at brilliant.org/acerola #ad
The Unity Awards nomination voting is live! It'd make me super happy if you submitted my name (if you think I am deserving).
unity.com/awards?
Wooo! My boy Acerola got. that. sponsorship. Lets gooooooo
thanks, employed "_t" Acerola, you brilliant goblin
is that the real Dan Salvato at 25:02?
@@NotGabe001 yeah we are moots on twt
@@Acerola_t done, thanks for the tutorial, I'll try to implement this myself!
99% of graphics programmers quit right before a 0.001% increase in performance
LOL
literally me except I quit when I get an opengl error before starting
release quote
@@NILLANEAB Or with vulkan/dx12, when you get a fatal memory error before you've even initialized the gpu device object.
I use the same logic for gambling.
It’s kind of ironic how Fourier actually invented his famous formula to predict when/how the tides of the ocean would occur and now in recent times people rediscovered that it could be used to simulate the very same thing it was meant to describe all along
Edit: What I meant to say was that one of the very first uses of the Fourier Series was to predict tidal motion (Sir Kelvin was the one who actually did the thing alongside the mechanical integrator! It's a very cool story too! )
My understanding is that Fourier created the method for solving the differential equations involved in modelling heat diffusion in metal plates? I don't think this is correct :/
Citation: Mémoire sur la propagation de la chaleur dans les corps solides (1807)
I think it was Kelvin that used the formula to predict waves
Well of course it could that's just basic correlation isn't it? Many mathematical formulas can work the same
@@_zedsdead_ Yes, Fourier invented the Fourier series to develop an equation for how heat diffuses through a metal plate, then for a general heat equation.
The Fourier transform is pretty ubiquitous in any situation dealing with waves, and a LOT of things can be broken down by describing them as waves.
I don't understand 95% of the things you say but I always find it fascinating.
Chilling with Persona songs and hard math
i like your funny words magic man
I understand maybe 75% of what he’s saying and I am still amazed by this guy’s creativity
I don't really care about any of this, my monkey brain just clicks on random videos.
@@DemoniteBL vibe
FFT really is like magic. I spent like two months understanding it a few years ago and now I've completely forgotten
Fr same as an electric engineering student
I've gotta hand it to you. You have some of the best shader content anywhere on the internet. It's digestible, entertaining, and informative.
not to mention his aesthetic
absolutely love his video style
@@stevenmathews7621_Black Scene_
Right!? I wish I had this when I was first getting into computer graphics in highschool.
The meme way of learning!
oh yes, digestible
Honestly, 2 things I very recently learned upon doing 3D are just how weak computers are compared to what I had in my mind (which was at the level of "just generate noise in real time and it will take 0.1% of CPU kek") and at the same time just how insanely optimized any game is and how many smart solutions have to be built in order to get gorgeous visuals while maintaining performance!
we need organic computers NOW! xD
donate your brains@@prismalglue
At the same time, computer game graphics had become realistic and lifelike drastically in the short time frame since the dawn of PC gaming. Only shortfall for most games are mostly physic like realistic object collision and voxel that makes objects "solid" since many game objects are just textured empty "box" or shell if that make sense? And lastly the AI or bots logic like npc that doesn't relied on developer's influences which has a long way to come yet imo.
You can apply almost the same FFT for waves for grass blowing in the wind without obvious tiling.
I can not thank you enough for your contributions to the Unity shader coding scene. I have been wanting to add more water/flooded areas to my game, but have been avoiding it due to the performance impact/obvious tiling issues that existing water simulations on the marketplace have.
I can't imagine how validating it must be to have your opinion backed by the Oceanographic Literature.
Another banger from the funniest technical artist on TH-cam. You do such a great job telling a story and providing dense info in a super digestible manner.
I am so ready for that principled BRDF video!
using Jack Quaid as the onscreen representation for Richard Feynman made me laugh harder than it had any right to
I know who neither of these people are 👍💯‼️💯
@@paninisauce6949 Richard Feynman was a physicist. Jack Quaid played him in Oppenheimer (albeit briefly) but is more known for playing Hughie in The Boys
@@jbritain Richard Feynman was such a guy. I'd recommend reading his memoir where he details breaking into classified desks at Los Alamos and leaving silly notes for fun, being obsessed with the bongos, and much more.
@@purple-flowers my physics teacher used to tell us stories about some of the funnier stuff he did, will look into that
came to say the same. I laughed way too much from it :D
It would be cool to have this as a live wallpaper, with the wave parameters slowly changing over time (or perhaps using weather data?) so the ocean looks somewhat different every time you get to see it.
Nice wallpaper engine idea
That's absolutely doable, if I ever get around to installing Unity, maybe I could modify the project to pull weather data and package it up into a Wallpaper Engine wallpaper.
@@YdenPL is it done?
@@YdenPL is it done?
@@YdenPL is it done?
17:15 This image and the line "in truth, this is because our lighting model forgot how light works" Is making me laugh a lot
This video (and the previous) COMPLETELY sold me on Fourier Transforms and FFT. I'm going to Uni so I hope I'll have the opportunity to learn more about them (and maybe make an ocean a quarter as good as yours)
i just finished a class on numerical methods a few days ago and already i am getting flashbacks
also the way you "removed" tiling at the end was really impressive
it was quite clear what needed to be done to everyone who understood the topic.
@@stanleyyyyyyyyyyyGet off your high horse. There's no reason to put down other people's understanding, especially when the one in question was still learning.
@@stanleyyyyyyyyyyy no processor can efficiently calculate the size of the stick up your ass
I love how all the math I learned in my Physics studies shows up in unexpected places like real time rendering. Never thought I'd hear about the Jacobian outisde of my simulations and modeling course.
Excellent video as always!
It looks so impressive in the end and honestly working with enterprise software (that takes 45 second to load a single page of 20 customer requests) I tend to forget that computers can do this kind of magic! Your videos kinda make me motivated towards programming
On another note, that transition to sponsor is very good
Working in backend did that to you, but also I think acerola said in his pixel sorting algorithm video that a CPU, which you and I used everyday in enterprise software is Smarter Slower, but a GPU which he uses in the shader program is Stupid Faster (and yet it can still do a mind blowing approximation of an entire ocean waves in real time)
And then you have entreprise software which is Stupid Slower.
Really, running on the CPU is no excuse for modern software being slow.
@@yan-amarits probably due partly to network requests, which realistically is not something that can be solved. Many times even the server you make network requests to have to make other network/api request. But yes some software is just terrible as well
Especially since on a higher-range laptop's CPU, you can run a rough equivalent of a local ChatGPT now, and still have resources for other stuff. It's crazy what our chips are capable of when programs are optimized for them.
It’s so cool seeing these otherwise abstract tools of vector calculus and differential equations I’ve learned about or heard about throughout college in such a creative and artistic context. Never stop!
Your videos became a lot easier to understand after going to college for a few semesters.
I think you should continue to use your 1660 to benchmark your projects to prevent the rebound effect on optimization caused by newer and faster hardware
when i get a new pc yeah i'll keep the 1660 around hopefully
You're by far the most entertaining resource on how complex shaders and simulations work but you still maintain a very professional quality in results. There are others who make the same kind of content but you have knowledge and skills on par with AAA devs when it comes to what you do.
To be fair it's cause I was a AAA dev
@@Acerola_t I know, I just wanted to say that you're giving people free education on things that take years of school and industry experience. It's a real talent to make graphics optimization and math as entertaining as you do. 👍
this is the hardest my minor in applied math has ever had to work, and I'm not even trying to implement it myself yet...at least I actually recognized 90% of the terms you said without having to look them up! amazing video!
i think this counts as the best follow up video of all time
0:01 sorry i pe 2 much 😊
2 much lemanades
@@Shabaz430 im drinkes 2 mush pee
possibly the best comment ever made
are you fkn 12?
this comment is so stupidly funny
Babe wake up, acerola released a new video
I was looking if someone already said this, but I wasn't expecting it within *3 minutes* you're insane (in a good way)
This got me good
that was fast
why is bros name areola
its insane how much better it looks while also improving the performance
as a music producer its really interesting to me how working in the frequency domain is so much better than the time domain as when working with music you have to sample the waveform in time before you can start working in frequency, so i would have initially assumed the exact opposite. thinking about it now though, it definitely makes sense why its so powerful since any conceivable wave can be represented by a set of frequencies and phases
i'd love to see more like this, its really interesting to see how waves can be used in graphics and not just audio
Your vids are genuinely great for falling asleep
only a little insulting!
@@Acerola_t ill be honest im using it to fall asleep rn but it seems interesting enough that i might rewatch it after i wake up and pay attention
2:30
You can’t just say, “a normal person” and then show jerma, arguably the least normal person
was about to post this same thing.
Thank you for being a technical artist to all of us!
What you're doing will enable the rest of us to make MUCH better games!
FFT's are still continues to amaze me, seriously. Our life would be very different without them. Also your channel amazes me too! Your use of math with Unity is insane. There are few questions i want to ask, how did you learn all of this? At school or all by yourself? If at school what was your major?
I have a bachelors in computer science but I taught myself most of this stuff
@@Acerola_t Thanks for the reply! Your channel is really amazing, so much to learn.
2:46 Thanks for putting that text there. You’d be surprised at the number of times I’ve thought I was having issues when it was really just an intentionally-blank screen
Okay, the notification Acerola: Simulating the Entire Ocean
definitely looked to me at a glance like 'Stimulating the entire Areola'
i need that tutorial
On the comment about the conventional math summing notation being inclusive, I usually write `sum{k = 0;
someone once said, "If you want to simulate every particle in the ocean, you must have a computer the size of the ocean."
I love you mentioned Euler's formula, because you also took the reference from Monogatari Series as your brand and Euler was mentioned in Zoku Owarimonogatari too. Cool video btw, I like it (despite I studied in food technology field lmao)
All I want is a nice ocean to render in the background of a scene, but I failed algebra 😢
This whole wave simulation series and channel as a whole has gotten me super interested in shaders when I'd never given it much of any thought before. The way you outline all of the math behind the graphics along with the humor in your presentation just makes for great edutainment. I also super appreciate all of the sources so those who want to see the nitty-gritty math can do so!
WOW this is beautiful.
thanks king
The Va-11 Hall-A music in the background was a nice touch.
Amazing video acerola! Every video I watch makes me want to learn more about shader programming!
I like the monogatari type of intro
It’s been like ten years since I first heard about Fourier Transforms and because of you I finally know what they are ❤
The cat video to maintain engagement over the ad read is absolutely ELITE
Black Flag had the first ocean in a videogame that felt believeable to me
Very cool Mr. Rola. Even if I usually don't understand the nitty gritty details, I appreciate how your videos always make it easy for someone like me to at least understand the basic idea of how these things work and the thought process behind it.
25:08 I feel personally attacked by ”I have had like one hundred tabs open this whole month for this project alone”. Can relate.
This is absolutely amazing. GG Acerola. You go into just the right amount of detail to introduce topics and be entertaining. And you're just really funny. Thanks for making this video!
so much of this happens to line up with what i'm learning in my digital audio theory class
2 WEEKS?!? This shit would take me like 2 years to fucking read, understand, and implement. Wow. Amazing work. Subscription added!
putting a cat video to the side of an ad is genius
Super interesting video! Very detailed, on topic, and the humor and analogies really help pull it together. Very happy to have found your channel. Thank you for the content!
Great video Rōra Hime
if you could do river water flow shader stuff in the future that would be epic!
and maybe even how to have it flow seamlessly into oceans
Idk when I discovered your channel but I've been watching for a pretty decent time.
I think what got me hooked at first was the Persona 2 music in one of your videos. Then the Monogatari styled editing pulled me in even further. What sealed the deal was the topics you talked about. Hope you keep it up, Acerola. Frfr
I appreciate the effort you put into your videos Acerola
Tell them to simulate the whole ocean!
Tell them to simulate the whole ocean!
Tell them to simulate the whole ocean!
TELL EM TO SIMULATE THE WHOLE OCEAN
Very impressive and fascinating. And it explaines why oceans in movies and games always look so fundamentally wrong. I have been sailing for my entire life and leanred how to read waves. True waves are curved from above too and have directional waves in different regions all of which you can see from pretty far away to the smallest detail.
Just wanted to say that this is one of the most interesting videos on solving complex problems in game dev I've seen on youtube! subbed and i'm curious for your next videos
Yes another acerola video
i haven't watched the video completely yet, but you caould look into single tile tessalation. It was recently proved that you can, using only one tile, create a non-recurring surface.
I'm really curious how good the new built-in water system is in Unity HDRP. It seems to do ....most of what you showed.
7:01 love how timed this music is to the graph
Seen a comment that said “ 0:01 sorry I pe too much” bro what 💀
i love pe
first of all, thank you for being awesome. you help break down complex subjects that i'd need a semester of college to understand otherwise and i'm endlessly grateful for that
secondly, i'd like to request some topics! #1 a summary of common optimization techniques, or #2 mobile GPUs/APIs/mobile gfx in general
Now do fire.
This style of video editing with a new image for like every single word in the script is exhausting to watch
Warning : Adult Mathematics
(That's some tasty water right there)
im so happy for you to finally go ballistic with the view counts! you are the best! im learning so much useful stuff directly applicable to my field, and im not even a game dev but a data scientist
24:12, you could dig a little deeper on the frequencies used here. If you use prime numbers for frequencies, they will tile on a much larger square, because prime numbers have the biggest LCM (Least Common Multiple). I use this trick for procedurally generate huge tiling textures from tiny samples.
the tiling is actually gated by the resolution of the textures, since all of this is being precomputed into textures that the ocean mesh then samples.
If GPUs are ever fast enough to calculate the fft per vertex, then yeah this would be applicable knowledge, but we'll probably die first.
@@Acerola_t No, you got it wrong. There's no need for FFT. If you sample the textures, such that for each vertex v, for each texture t, the height of the vertex, or color of the pixel, is equal to the sum of t_i mod t_i_len, the size of the "tiles" is equal to LCM(t_1, ..., t_n). If the sizes of the textures are prime number length, which is the optimal length for this technique, you can get huge tiles with tiny textures. It's a well known technique.
he really used jerma as a photo example of a "normal person"
Bro took “bring out the whole ocean” a little too literally 😂
This video is very much appreciated. I like looking at videos that show working concepts such as this, the amount of research and application that goes into this has to be astronomical. Citing your sources and sharing your code is top notch, much respect. This video is absolutely beautiful, lots of knowledge and tons of information compilation, stunning results. Well done.
Tell 'em to bring out the whole ocean
Incredible work!
Most of the math of shaders goes right over my head, but the end result here was damn impressive.
If you do continue this project I would love to see you push the limits of a CPU based underwater ecosystem - that would be quite an addition!
Earned a subscriber in me cheers.
Your explanation of the Fourier Transform is super good and definetly effectively conveys the idea and purpose without getting into the (somewhat) complicated math 👍
I’m rewatching this with the experience of more game dev knowledge. I appreciate the attempts to translate the complex (ha) math topics into something more legible to a wider audience.
Great work on foreshadowing the evolution of technique. I’m happy you create content on these subjects. Looking forward to the next vid :3
the forest creators really worked on the ocean. even at that time you can see many little parts of it but one small problem is it locked at some frame rate so if you have 60 fps water will look like a slide show
Thought it said “I tried STIMULATING the entire ocean”
i'm not freaky like that
12:45 That’s a really good way to describe a lot of things where complex functions are used to produce real results (at least for people who have heard of Plato’s Cave).
Bro the fact that you got people to sit through the advertisement by putting that video on the side like a tiktok would do it is genius. I see you.
Thank you ever so much! I found myself in the position of needing to write my own water math, and was feeling apprehensive... I feel encouraged & so much better now! :D
I really love when you're teaching us that we can only see on books or even paid lecture with this high level. But we're ape brain so I really appreciate the style of the video very bite size but feels not really complicated. Good stuff 👌
that is insanely impressive. I didn't realize it was feasable to push the detail THAT high.
Forget everything that he was talking about for a moment. The most genius thing in this video is that he bated the viewer into watching the ad by placing a video of a cat trying to jump onto a vertical mattress.
Ready for a greater challenge?
Take a Fourier transform of a heightmap and then recreate the style as a procedurally generated infinite map. Imagine an infinite BOTW map that has the signature of the original.
That’s super impressive! Loved how you explained it, especially the touches like foam
Whenever someone compliments me about (supposed) intelligence, I stop them and explain to them that people like you exist, lol. Amazing video. instant sub.
lol I have the same response to the compliments, thanks!
12:20 "Richard Feynman..." *proceedes to show Jack Quaid*
surely there's a joke here somewhere
@@Acerola_t >:)
Allegory of the Cave and $14.32 at a 5-star restaurant but you get $1 more every two years.
I have 0 ability to comprehend anything remotely in the ballpark of these lessons but Im still fascinated by it.
11:19 the use of that picture is CRAZY
I gotta say I really enjoy your monogatari style editing, it's very satisfying and fun
TELL EM’ TO BRING OUT THE WHOLE OCEAN 🔥🔥🗣️🗣️
Acetrola definitely cameo'd this video, at the end specifically. I still want to see my mountain dew simulation, you suggested it at one point but the opportunity was lost!
LETS GOOOO ANOTHER INSTALMENT OF ACEROLA TALKS ABOUT THE OCEAN FOR HALF AN HOUR
I love how he had his (or a) cat as the attention keeper during the sponsor
3:58 Audio software engineer here. This is a fantastic example, though practically, it's a little more difficult than that. You can certainly remove pure sine tones with this technique, but every tone that isn't just a sine tone contains possibly hundreds of harmonics, which are sine tones at integer multiples of the piano key's frequency. These are practically impossible to isolate for a single note when you have a whole bunch of notes, especially since some notes are already integer multiples of other notes, and there are usually a huge number of harmonics that are identical across different notes.
We do use Fourier analysis quite often though, and we use it to do things that are only possible when manipulating the signal in the frequency domain. One great example of this is autotune. In the time domain, you can't change the pitch of a signal without speeding it up or slowing it down (think fast forwarding a tape or playing a record too fast - you speed it up but everything sounds high pitched as well). However, in the frequency domain, you can just take all the tones and shift them up or down individually before converting it back into a time domain signal. This allows you to change the pitch without changing the time, which allows for things like autotune.
This was a superb piece of work, and brilliantly explained!
I followed the maths fine, but I physically twitched when we got to the bit about Jacobian determinants, as apparently I still have PTSD from doing those at university, and that was 35 years ago.
Wow you’re doing so well now you’ve just got to simulate a glass of water on the quantum scale
I like the title "I Tried Simulating The Entire Ocean" much more than "Here's How Much Smarter I Am Than You" 😆
Nah.. all joking aside, this is quite amazing.
You did an amazing job w/ tackling this material, and even explaining it all in an easy-to-understand manner.