by cherryteastain · 2y ago · 0 comments
Also, in industrial CFD, where the Reynolds numbers are higher you'd never want something like counteracting artificial dissipation of the numerical method by trying to applying noise. In fact, quite often people want artificial dissipation to stabilize high Re simulations! Guess the requirements in computer graphics are more inclined towards making something that looks right instead of getting the physics right.
The first rule of real-time computer graphics has essentially always been "Cheat as much as you can get away with (and usually, even if you can't)." Also, it doesn't even have to look right, it just has to look cool! =)
Like, watch this video: https://www.youtube.com/watch?v=9XWxsJKpYYI
This is a whole story about how the liquids in the bottles ‘isn’t really there’ and how it’s not a ‘real physics simulation’ - all just completely ignoring that none of this is real.
There is a sense in which the bottles in half-life Alyx are ‘fake’ - that they sort of have a magic painting on the outside of them that makes them look like they’re full of liquid and that they’re transparent. But there’s also a sense in which the bottles are real and the world outside them is fake. And another sense in which it’s all just tricks to decide what pixels should be what color 90 times a second.
And, yes, I've gone way too far down this road in the past.
So the non-generated frames are the "fake frames".
The refrain is: Plausible. Not realistic.
Doesn't have to be correct. Just needs to lead the audience to accept it.
Yeah. And, cheat as much as you can. And, then just a little more ;)
The reason to cheat is that we currently don't have the hardware or software techniques to physically simulate a virtual world in real-time.
I'm not saying this just to be pedantic - my point is that some people do want some games to have very high levels of realism.
https://github.com/darklegion/tremulous/blob/master/src/game...
That is exactly correct. That said, as something of a physics nerd (it was a big part of the EE curriculum in school) people often chuckled at me in the arcade pointing out things which were violating various principles of physics :-). And one of the fun things was listening to a translated interview with the physicist who worked on Mario World at Nintendo who stressed that while the physics of Mario's world were not the same as "real" physics, they were consistent and had rules just like real physics did, and how that was important for players to understand what they could and could not do in the game (and how they might solve a puzzle in the game).
Reactions are an important part of this, it's not just how good an actor is, but how other character react to them. If they are ignored, it's like that character doesn't exist, has no effect, is inconsequential, doesn't matter... is not real.
In a fluid simulation, when water does not react to the shoreline, rocks in the water, columns supporting a pier etc, it is like the water (or the obstacles) don't exist. In this sense, the water (or the obstacles) "aren't real".
For example, the water in Sea of Thieves looks magnificent... but because it doesn't interact (it's procedural), it doesn't feel real. It isn't real.
A further problem here with water is that it's difficult to make a continuous fluid that is consistent and isn't realistic, because the basic principles of fluid are so very very simple: conservation of mass, conservation of momentum.
[ Of course, you can still vary density, gravity. There are other effects beyond these: viscosity, surface tension. Also, compressible fluids, different reynolds numbers, adiabatic effects, behaviour at non-everyday temperatures, pressures, scales, velocities, accelerations etc. ]
There are also simplifications, like depth-averaging (Shallow Water Equations aka St Venant), but again, it's hard to vary it and yet remain self-consistent.
Cellular methods - similar to conway's game of life but for fluid - maybe are an exception, because thet are self-consistent - but pretty far from "water", because not lack momentum (and aren't continuous).
The final issue is error: simulations are never perfectly self-consistent anyway, because they must discretize the continuous, which introduces error. In engineering, you can reduce this error with a finer grid, until it too small to matter for your specific application. For computer graphics, it only needs to be perceivably" self-consistent - and perhaps pixel size is one measure of this, for the appearance* of consistency, in area/volume, acceleration, velocity, displacement (...though, we can perceive sub-pixel displacement, e.g. an aliased line.)
I've used the basic idea from that paper to make a surprisingly decent program to create gas-giant planet textures: https://github.com/smcameron/gaseous-giganticus
We liked to call it “curly noise” when we first did it, and I used it on some shots and shared it with other effects animators at DreamWorks at the time. Actually the very first name we used was “curl of noise” because the implementation was literally curl(noise(x)), but curly noise sounded better/cuter. Curly noise is neat because it’s static and analytic, so you can do a fluid-like looking animation sequence with every frame independently. You don’t need to simulate frame 99 in order to render frame 100, you can send all your frames to the farm to render independently. On the other hand, one thing that’s funny about curly noise is that it’s way more expensive to evaluate at a point in space than a voxel grid fluid update step, at least when using Perlin noise which is what I started with. (Curly noise was cheaper than using PDI’s (Nick Foster’s) production fluid solver at the time, but I think the Stam semi-Lagrangian advection thing started making it’s way around and generally changed things soon after that.)
BTW gaseous giganticus looks really neat! I browsed the simplex noise code for a minute and it looks gnarly, maybe more expensive than Perlin even?
In 2014 when I wrote it, 3D Perlin noise was still patent encumbered. Luckily at the same time I was working on it, reddit user KdotJPG posted a Java implementation of his Open Simplex noise algorithm on r/proceduralgeneration (different than Ken Perlin's Simplex noise), and I ported that to C. But yeah, I think Perlin is a little faster to compute. I think the patent expired just last year.
Also Jan Wedekind recently implemented something pretty similar to gaseous-giganticus, except instead of doing it on the CPU like I did, managed to get it onto the GPU, described here: https://www.wedesoft.de/software/2023/03/20/procedural-globa...
it's a painting program where the paint can be moved around with a similar fluid simulation
https://en.wikipedia.org/wiki/John_Steinhoff
https://en.wikipedia.org/wiki/Vorticity_confinement
And some papers:
https://www.researchgate.net/publication/239547604_Modificat...
https://www.researchgate.net/publication/265066926_Computati...
The problem is my analysis is very weak. My knowledge about linear algebra, differential equations, numerical methods, and so on is approximately limited at the level of an introductory university course. What would you suggest as a good start?
I like reading, but I also like practical exercises. The books I tried to read before to get into CFD were lacking in practical exercises, and when I tried to invent my own exercises, I didn't manage to adapt them to my current level of knowledge, so they were either too hard or too easy. (Consequently, they didn't advance my understanding much.)
https://www.sciencedirect.com/book/9780750665940/numerical-c...
Or, via an amazon link: https://www.amazon.com/Numerical-Computation-Internal-Extern...
For me that's the hard part (which I still don't get).
You could start with Saint Venant equations, although they look complicated they're actually within reach. But you'll have to understand the physics behind first (conservation of mass, of quantity of movement, etc.)
With respect to 2, the standard industry practice is a mesh convergence study and comparing your solver's output to experimental data. Sadly, especially with Reynolds-averaged Navier Stokes, there is no guarantee you'll get a physically correct solution.
That said, never do a PhD for economic reasons alone. It's a period in your life where you are given an opportunity to build up any idea you would like. I enjoyed that aspect very much and hence do not regret it one bit.
On the other hand, I also found out that academia sucks so I now work in a completely different field. Unfortunately it's very difficult to find out whether you'll like academia short of doing a PhD, so you should always go into it with a plan B in the back of your head.
I also found that I don't want to be a good academic, but a good researcher. Most importantly, that these are two very different things.
The two sibling comments both mention the economics isn’t guaranteed - and of course nothing is guaranteed on a case by case basis. However, you should be aware that people with PhDs in the US earn an average of around 1.5x more than people with bachelor’s degrees, and the income average for advanced degrees is around 3x higher than people without a 4-year degree. Patents are pretty well dominated by people with PhDs. There’s lots of stats on all this, but I learned it specifically from a report by the St Louis Fed that examined both the incomes as well as the savings rates for people with different educational attainment levels, and also looked at the changing trends over the years, and the differences by race. Statistically speaking, the economics absolutely favor getting an advanced degree of some kind, whether it’s a PhD or MD or JD or whatever.
Oh no. It is also quite possible to do things, that will very firmly close doors, that were open before, or making sure some doors will never open ..
(quite some doors are also not worth going through)