4K, 6 Months of Voxel Physics Engine Optimizations

  Рет қаралды 14,045

Grant Kot

Grant Kot

Күн бұрын

Пікірлер: 100
@Specht77
@Specht77 7 ай бұрын
Thank you, KZbin compression destroyed the 1080p one, this is MUCH better
@GrantKot
@GrantKot 7 ай бұрын
Thanks! It was more my fault. Because of the long timespan my clips covered, I had to redownload old clips from YT. So that caused them to be triple/quadruple compressed. It took some time but I got freshly recorded 4K clips for this.
@AndrewBrownK
@AndrewBrownK 7 ай бұрын
@@GrantKot definitely worth it
@WyrdieBeardie
@WyrdieBeardie 7 ай бұрын
Uhh... This is INCREDIBLE!!
@timmygilbert4102
@timmygilbert4102 6 ай бұрын
Sand that's coarse and get everywhere, perfection
@illustriouschin
@illustriouschin 7 ай бұрын
I'm dumb but an idea that might be good is if when a droplet becomes isolated, the single object becomes rendered as a spreading cloud of particles that eventually despawn.
@GrantKot
@GrantKot 7 ай бұрын
I think it's a good idea. This could save CPU by not activating node tiles with too few particles. I have considered something similar for rain, if the tiles have too few particles with low chance of collision, don't waste resources doing MPM on those tiles.
@Pockeywn
@Pockeywn 7 ай бұрын
@@GrantKoti mean rain really doesnt need collision until it lands so it could be the opposite and only become physical after landing
@joa1401
@joa1401 7 ай бұрын
@@GrantKoti’m glad that an idea like this might be feasible. something i’m really hoping overall for this technology is that it will leave room for stylisation and art direction beyond just the voxel ‘look’. one beautiful feature of water is the way the otherwise cohesive surface of an ocean can break up into a spray of droplets so small that, from afar, we just see mist. i’m also curious if something like dithering could be used to give powders like sand a finer, grainier look without too much of a performance hit
@GrantKot
@GrantKot 7 ай бұрын
Oh yeah, something like this would be great for mist! I didn't actually realize that was the use case OP was probably referring to and not purely a computation saver.
@joa1401
@joa1401 7 ай бұрын
@@GrantKot also, i’m not sure if you’ve already tried/implemented this, but a nice touch could be slightly darkening the colour of the sand when it gets wet, to represent the ‘total internal reflection’ effect (where rough surfaces refract less light when water permeates them). you’re doing amazing stuff here. thank you so much for sharing your journey in such an informative and accessible way! : )
@bnug242
@bnug242 7 ай бұрын
I've been following this project for a few years, just wanted to show extra support with this comment!! 😄
@bnug242
@bnug242 7 ай бұрын
side note, i downloaded the demo and have been playing around with it, its so fun
@GrantKot
@GrantKot 7 ай бұрын
Thanks! I'm really glad to hear you like it!
@basiliotornado
@basiliotornado 7 ай бұрын
Saw your post on reddit a few days ago and didn't notice it was the same person who made liquid crystal! happy to see you're still working on it :D love the updates
@AndrewBrownK
@AndrewBrownK 7 ай бұрын
this engine is seriously amazing and pretty
@pangolin7398
@pangolin7398 7 ай бұрын
Cant wait to see where this goes
@PchlaPddy
@PchlaPddy 7 ай бұрын
Amazing video. This proves how big the rabbit hole of water simulations is, so many ways to optimize and finetune it...
@TankorSmash
@TankorSmash 7 ай бұрын
This is eyewatering, amazing!
@Gwilo
@Gwilo 7 ай бұрын
this is wonderful
@bitmau5
@bitmau5 7 ай бұрын
Thanks for the re-up!
@illustriouschin
@illustriouschin 7 ай бұрын
That slushy stuff looks good to eat.
@jean-philippegrenier120
@jean-philippegrenier120 Ай бұрын
super interesting video. Amazing work
@Aqua_Turneur
@Aqua_Turneur 7 ай бұрын
this game looks soooo relaxing! i can't wait to see the final result
@mrmaniac9905
@mrmaniac9905 5 ай бұрын
So much potential here.....
@GrantKot
@GrantKot 5 ай бұрын
Hi, if you're worried about the status of the 3D project don't worry, I'm just trying to do some rapid prototyping in 2D to find fun interactions etc.
@GeorgiKrastevMusic
@GeorgiKrastevMusic 7 ай бұрын
Man, imagine a game like Empire Earth with this engine
@GeorgiKrastevMusic
@GeorgiKrastevMusic 7 ай бұрын
revolutionary
@PeterMyler
@PeterMyler 7 ай бұрын
wow this is so much better, thanks for the 4k!
@zaidbahssali4791
@zaidbahssali4791 7 ай бұрын
You were sharing one of your demos on Parsec Arcade a while back, right? I was mesmerized by it. This is really awesome work and I can't wait to see where this project of yours goes!
@GrantKot
@GrantKot 7 ай бұрын
Thanks! Yes, Liquid Crystal. There is also a demo of it on kotsoft.itch.io with local split screen.
@SynthByte_
@SynthByte_ 7 ай бұрын
that water would look great in a lego type of game
@lordmarum
@lordmarum 7 ай бұрын
I understood nothing, but its so beautiful!
@k.w.6626
@k.w.6626 7 ай бұрын
I was here! But seriously, wow, amazing stuff. Will the engine itself be open source at some point, or are you gonna license it out like teardown?
@GrantKot
@GrantKot 7 ай бұрын
I think first I want to make some products with it. That way I can fund further development. At this point it's not just a basic MPM simulation anymore (which I do have opensource of but kind of outdated and might even have bad multithreading/SIMD habits), but getting close to products. Sandbox, then game as well as possible VFX simulator.
@k.w.6626
@k.w.6626 7 ай бұрын
@@GrantKot I completely understand, I'm just happy to hear that it isn't off the table in the long term. Not like I'm gonna use it anyway, my brain smooth as a marble. The Doom engine wasn't released the day the game came out, after all. I don't even understand how people begin to learn all this stuff.
@sumofat4994
@sumofat4994 7 ай бұрын
Stop asking people to give away for FREE their very hard work. That has to stop especially in the gaming industry which is already tight.
@k.w.6626
@k.w.6626 7 ай бұрын
@@sumofat4994 I don't understand, I never asked anyone to give away anything. I only asked if it would be open source eventually, out of curiousity. I could never do anything with the engine, and I know of people who charge a price to anybody for access to their source code.
@jb14_99
@jb14_99 7 ай бұрын
wow this is amazing : ) awesome work
@fryser007
@fryser007 7 ай бұрын
I always found fluid simulation hypnotizing @_@
@christojojo4433
@christojojo4433 5 ай бұрын
Feel like high poly count in the fluid makeing it lot more polygonal looking could make it more satisfying and cpu friendly
@christojojo4433
@christojojo4433 5 ай бұрын
Like fluid in the game - instruments of destruction
@aw_dev
@aw_dev 7 ай бұрын
Gotta love the jello sticks 😂
@dingusbrule5756
@dingusbrule5756 7 ай бұрын
Idk why i find boats sinking so fascinating, but we are getting there with this Lets get the titanic on it 😤
@AndrewLeConte
@AndrewLeConte 7 ай бұрын
It would be really nice to have things like, if cold water is in contact with an ice block then a water particle can move itself to the ice object grid and become more ice, or fast water against dirt has a chance to make a mud particle and cause erosion.
@GrantKot
@GrantKot 7 ай бұрын
Yeah, definitely. With the dirt, there is some of that mud behavior when it mixes with water. The material properties and effects are blended a bit through MPM.
@slurmworm666
@slurmworm666 7 ай бұрын
Amazing, bravo
@RobShmit
@RobShmit 7 ай бұрын
Amazing how far its come in a short while! How many simulation steps & substeps are you performing per second? I moved away from MPM because it wasn't stable enough for me with fewer steps...
@GrantKot
@GrantKot 7 ай бұрын
On the clips with FPS counters, the simulation rate is the same as the render rate. I’m not using any substeps. The coarse pressure (only added one 1/8 level so far) helps with that.
@PedroGarcia-fl1fu
@PedroGarcia-fl1fu 7 ай бұрын
AMAZING!!!!
@atlasua2021
@atlasua2021 Ай бұрын
amazing
@lankim3164
@lankim3164 7 ай бұрын
This looks amazing!! Can I ask you why 5900x performed poorer than i5-8600k? Was it related to the memory latency or bandwidth?
@GrantKot
@GrantKot 7 ай бұрын
Thanks! I think at 12 cores and 2 CCDs and maybe the PC builder skimping a little on memory latency (CL18) all contributed to amplified my poor multithreading practices. Initially there was some trouble with non-temporal stores on one thread being slowed down by atomics going on another thread, because I think atomics will cause the write combine buffer to flush. I also had an interleaved like pattern for updating particle tiles so I could write to the global grid because I thought not having a copy would be better. In the end, using thread local scratch memory was the way to go.
@lankim3164
@lankim3164 7 ай бұрын
@@GrantKot Oh wow! Thanks so much for the detailed explanation. To me, the fact this can be done is a little mind-blowing. Have you run the revised multithreading routines on 5900x and see a drastic improvement over 8600k? When you ran it on your new laptop, did you have to rearrange the tasks and distribute them over P and E cores manually in your program for the new Intel CPU, like heavy loads to P cores and others to E cores? Or does the CPU do that for you somehow even if you run the same code(as the code you wrote for the CPU with homogenous cores)?
@GrantKot
@GrantKot 7 ай бұрын
At the time when I did the Liquid Heating demo, when I merged the G2P and P2G (and other optimizations), for the same particle count performance was 2x faster on 8700K and the 5900X went close to the theoretical of being 2x faster than the 8700K. But then I got a bit demotivated because that whole thing about not knowing how to do the structures. I don’t differentiate what I send to the cores, just use taskflow which does work stealing
@Polygarden
@Polygarden 7 ай бұрын
Very impressive work! Is the simulation running on cpu or gpu?
@GrantKot
@GrantKot 7 ай бұрын
I have the simulation running on CPU and the rendering on GPU. The game renders at 4K, might even try for multiple screens. Also targeting handhelds with iGPU.
@luigi.0533
@luigi.0533 7 ай бұрын
I want to drink the voxel water
@ハェフィシェフ
@ハェフィシェフ 7 ай бұрын
The simulations are magical, are you gonna open source it at some point? I totally understand if you wanna keep the hard work for yourself but was just curious
@GrantKot
@GrantKot 7 ай бұрын
First I will work on my own products sandbox/game/vfxsim with it and try to use them to fund further development and even accelerate the pace of development by forming a studio.
@ハェフィシェフ
@ハェフィシェフ 7 ай бұрын
@@GrantKot sounds great! Good luck man!
@roundtabledetails3307
@roundtabledetails3307 7 ай бұрын
could you make a ai overlay? there is a video of gta5 with a ai filter that makes the game seen almost realistic with no fps cost, couldn't you do the same with water?
@GrantKot
@GrantKot 7 ай бұрын
Yeah it might be something I could try. I wonder if the water could be point rendered so the NN could see what is behind the water and refract it accordingly.
@yashsaxena9
@yashsaxena9 7 ай бұрын
Hello sir, is it possible to get codebase of this? or a similar voxel particle system? Please 👉👈
@GrantKot
@GrantKot 7 ай бұрын
I first want to give a go at releasing my own sandbox/game/vfxsim. If it is successful, then I could start a studio and further accelerate development into this.
@GrantKot
@GrantKot 7 ай бұрын
Oh and there is the OS gvox system by Gabe Rundlett
@jsierra88
@jsierra88 7 ай бұрын
Hi! Where could we start learning about this method?
@GrantKot
@GrantKot 7 ай бұрын
The main one here is MPM, or the MLS-MPM/APIC variant of it. I also take in some stuff from SPH (I think I was responsible for making the usage of density summation rather than integration over time more popular in MPM, it was common in SPH) and PBD (shape matching). For MPM, there is a Chenfanfu Jiang who is involved in a lot of MPM papers. So his publications page is a good list. Utah CSAFE also seemed to be very into MPM. MPM: Material Point Method MLS-MPM: Moving Least Squares MPM APIC: Affine Particle in Cell SPH: Smoothed Particle Hydrodynamics PBD: Position Based Dynamics
@jsierra88
@jsierra88 7 ай бұрын
@@GrantKot thank you for answering! That's good info. Density summations instead of integration over time? Is that why your system is that stable?
@incription
@incription 7 ай бұрын
what if u save results of particle collisions in a hash table then use it as a cache to precompute particle collisions when the initial positions are "close" together
@GrantKot
@GrantKot 7 ай бұрын
Yeah, that is a possibility. I think though the data of this hash table would have to fit within L1 or L2 cache for it to work well. If any larger (these days CPUs are very memory-bound), and you will have issues with cache coherence. The thing is, it can get pretty large, especially if you have different materials with different properties. It is something perhaps Machine Learning physics is trying to solve, actually now that I think about it, are there any successful multiphase ML fluid simulations out there? I'm going to do some digging.
@MrCreepsGaming
@MrCreepsGaming 7 ай бұрын
this man still only got 5k subs
@mr.gummie3472
@mr.gummie3472 7 ай бұрын
possible to make a game inside of?
@GrantKot
@GrantKot 7 ай бұрын
Yup, that's the plan!
@AngeloXification
@AngeloXification 7 ай бұрын
😍
@sjoerdev
@sjoerdev 7 ай бұрын
which graphics api is this?
@GrantKot
@GrantKot 7 ай бұрын
Nowadays I usually build on DX12 to take advantage of async compute, where I run things like Intel XeGTAO and FSR.
@sjoerdev
@sjoerdev 7 ай бұрын
@@GrantKot which build system do you use? cmake? msbuild? other?
@GrantKot
@GrantKot 7 ай бұрын
Yeah, now I use cmake with MSVC clang. I find the clang vector extensions to work well for writing cross platform SIMD code.
@sjoerdev
@sjoerdev 7 ай бұрын
@@GrantKot cool, and which code editor are you using? and which os?
@GrantKot
@GrantKot 7 ай бұрын
i'm usually using vscode on windows
@J.A.R.V.I.S-MK43
@J.A.R.V.I.S-MK43 Ай бұрын
How do I play this?
@GrantKot
@GrantKot Ай бұрын
I have a link to my itch io page in the description for this demo (first one there) and some other demos I've shown on my channel.
@MyEarsHurts
@MyEarsHurts 6 ай бұрын
you should make some car crashing with this new system
@GrantKot
@GrantKot 6 ай бұрын
Yeah, I will try to do cars soon. There is a slight issue with wheels but I will try to figure it out and improve the game's structure system.
@ocean3323
@ocean3323 7 ай бұрын
Is that reupload?
@GrantKot
@GrantKot 7 ай бұрын
Yes, it is a 4K60 reupload. The previous one had major compression issues so there were many requests to redo it in 4K. There are some new 4K clips used as I had to recapture any footage that I no longer have originals for. In the future I plan to always upload 4K the first time.
@EngineerNick
@EngineerNick 7 ай бұрын
:O
@coreywilliams6118
@coreywilliams6118 7 ай бұрын
So minecraft but better? Is that the plan?
@kellymoses8566
@kellymoses8566 5 ай бұрын
multithreaded programing is so freaking annoying
Jello and Water Real-time Physics & Ray Tracing
5:47
Grant Kot
Рет қаралды 13 М.
I Added RAYTRACING To My Voxel Engine ! ( From SCRATCH )
13:39
MaxMakesGames
Рет қаралды 10 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,2 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 44 МЛН
6 Months of Voxel Physics Engine Optimizations
8:17
Grant Kot
Рет қаралды 48 М.
Teardown is Dead.
7:39
Loafz
Рет қаралды 203 М.
Non-Euclidean Worlds Engine
5:15
CodeParade
Рет қаралды 11 МЛН
bepuphysics 2.4: the fastest physics yet!
3:26
bepuentertainment
Рет қаралды 13 М.
Improving My Game With Tester Feedback
17:49
AngeTheGreat
Рет қаралды 187 М.
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 6 МЛН
Winning My First Ever Game Jam? | Godot Devlog
10:25
mz_eth
Рет қаралды 326 М.
The Problem With Procedural Generation
17:57
Acerola
Рет қаралды 246 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,2 МЛН