Physically Based Rendering | Voxel Physics Devlog #5

  Рет қаралды 17,239

Grant Kot

Grant Kot

Күн бұрын

Пікірлер: 94
@unfunnyhumor1573
@unfunnyhumor1573 4 жыл бұрын
Best ad ever. I rate it 10/10
@droptini
@droptini 4 жыл бұрын
What everyone else thinks: wow this is very cool! What i think: *J E L L O*
@CATHERINE-rx8ov
@CATHERINE-rx8ov 4 жыл бұрын
Same
@hottomm-k5j
@hottomm-k5j 8 ай бұрын
schloop
@DogsWithPurpose
@DogsWithPurpose 4 жыл бұрын
This is like “oddly satisfying things” but for programmers.
@somecriticaldude4830
@somecriticaldude4830 4 жыл бұрын
I gotta admit, I love how fluent your engine is. Im subscribing and looking forward to more updates!
@laughingbeans7715
@laughingbeans7715 4 жыл бұрын
The only ad I’ve ever clicked on because I was actually interested. Keep up the good work.
@LMT1414
@LMT1414 4 жыл бұрын
Wow this is just complete eye candy!
@JesseStiller
@JesseStiller 4 жыл бұрын
It's amazing that you're one of the only people pushing for realtime fluid simulation (and everything else that MPM allows for) :D What integration scheme are you using (ie, jacobian, gauss seidel, etc)?
@GrantKot
@GrantKot 4 жыл бұрын
I'm using the default integration as described in MPM and APIC papers. I think things are going to heat up in the real-time physics industry this year. AMD and Nvidia and Intel battling it out is good for this kind of stuff. My CPU is actually considered low-end these days. Hoping to upgrade to Threadripper once the new Nvidia cards come out.
@Vollkornaffe
@Vollkornaffe 4 жыл бұрын
@@GrantKot Default integration means explicit I'm guessing. Then no system solving (jacobian ... ) is required at all.
@GrantKot
@GrantKot 4 жыл бұрын
@@Vollkornaffe Yeah, explicit. I'm also not using substeps.
@chobyriley417
@chobyriley417 4 жыл бұрын
Your ad worked : )
@GrantKot
@GrantKot 4 жыл бұрын
Thanks! Working way better than I expected.
@midgetman4206
@midgetman4206 4 жыл бұрын
So you got it too, the strangest ads are the ones that work
@degenerate6109
@degenerate6109 4 жыл бұрын
You had my curiosity, now you have my attention
@TMracer73
@TMracer73 7 ай бұрын
This is breathtaking
@Vollkornaffe
@Vollkornaffe 4 жыл бұрын
Dude... I love it :D
@astraldragon5483
@astraldragon5483 4 жыл бұрын
If only a minecraft-like game had these physics. All the freedom/creativity of Minecraft, with a realistic physical/destructible world that actually has realistic physics for solid objects and liquids/etc.
@GrantKot
@GrantKot 4 жыл бұрын
Hi, I fully intend to support community created content and modding. I am now working on MagicaVoxel support (check latest vid) and will also have some basic in game construction.
@Alex-ft8bs
@Alex-ft8bs 4 жыл бұрын
You took playing with your food to another level
@Sploky
@Sploky 3 жыл бұрын
This is the greatest thing ever.
@yummygummy3416
@yummygummy3416 4 жыл бұрын
so gorgeous looking (edit: im def gonna be watchng ur stuff as u post its really cool
@banymany7444
@banymany7444 4 жыл бұрын
How the pool looks when your dad gets in...
@sirbirbton
@sirbirbton 4 жыл бұрын
This looks super nice, I've never seen fluid simulation quite like this.
@GrantKot
@GrantKot 4 жыл бұрын
Thanks! Make sure you check out my latest video which has even more advanced rendering :)
@lewaxer2407
@lewaxer2407 4 жыл бұрын
Bro this is awesome keep up the good work! 😄
@RagdollRocket
@RagdollRocket 4 жыл бұрын
That's so cool!
@red-2895
@red-2895 4 жыл бұрын
IM TRIPPING BALLS
@ghostflesh2449
@ghostflesh2449 4 жыл бұрын
So dope looking! Keep up the good work.
@SchmiblorFlumbo
@SchmiblorFlumbo 4 жыл бұрын
This looks great! Keep up the good work, I'm positive that this could turn into something awesome!
@Vollkornaffe
@Vollkornaffe 4 жыл бұрын
How tough can you make your material? Do you have Young's modulus and Poisson's ratio? Edit: 3 typos, smh
@GrantKot
@GrantKot 4 жыл бұрын
The deformation gradient in MPM can be thought of as a parallelipiped and each of the matrix columns is an axis. To keep things stable you can limit things like length of each column.
@Vollkornaffe
@Vollkornaffe 4 жыл бұрын
@@GrantKot My bad, typo. How *tough* can you make your material? As in, can it also be more rigid?
@GrantKot
@GrantKot 4 жыл бұрын
@@Vollkornaffe This is about the most rigid I can get without additional springs, like my fibers experiments which used Position Based Dynamics, or there are papers on using Lagrangian springs with MPM. I use a density summation and pressure equation of state based on density, which is more common in SPH sims. I think for long running simulations you have to use density summation and not integration over time. I'm not too sure about the constants, because I have various limiters for stability reasons.
@rod5065
@rod5065 4 жыл бұрын
This is really nice, good job
@dlk7777i
@dlk7777i 4 жыл бұрын
The inside of my washing machine be like
@GrantKot
@GrantKot 4 жыл бұрын
Demo available at: kotsoft.itch.io/mpm-tech-demo Windows 64-bit only for now. This is the first release so I'm not completely sure on the minimum system requirements. Please let me know if you have any issues running it. Also, feel free to post your CPU model and what FPS you are getting.
@VioletPrism
@VioletPrism 4 жыл бұрын
This is like ASMR 🥵
@imsonoided
@imsonoided 4 жыл бұрын
Reminds me of my last acid trip
@Theawesomeking4444
@Theawesomeking4444 3 жыл бұрын
thats pretty cool are you using opengl,opencl, vulkan or other?
@GrantKot
@GrantKot 3 жыл бұрын
Thanks, I’m using DirectX here. It’s less cross platform but easier to develop on if you only want to target PC/Xbox
@Theawesomeking4444
@Theawesomeking4444 3 жыл бұрын
@@GrantKot yeah ive heard directx is good but its only for windows and xbox unfortunately, ive been trying to do this with opengl tho are you doing the fluid physics on the CPU or the GPU? i tried doing it on both i managed to run 100000 particles on a quad core cpu at 60 fps but only 50000 on an intel hd GPU (i think some of the code that works on the cpu doesnt work very well on the gpu ive heard branching is evil on the gpu) do you have some recommendations on how i can improve the instace (particle) count or make the simulation more stable and use less timesteps (rn i use 120fps)?
@GrantKot
@GrantKot 3 жыл бұрын
I'm doing the physics on the CPU. I think the era of doing every computational thing on the GPU is over, with GPU being in short supply, as well as multicore CPUs seeing major improvements thanks to AMD (and Intel is fighting hard to comeback as well). And especially with integrated graphics, I would assume most of the focus went to the CPU portion, so that could explain why you see better performance with your CPU than the iGPU. Achieving perfect multithreaded scaling with MPM can be tough, and if you have other things you want to have in your game like rigid body physics, I would recommend maybe 1 core for MPM, 1 core for rigid bodies, 1 core for AI, etc. Otherwise, my main suggestion would be to bin/partition the particles so you get more locality. Hopefully each core is writing to only a portion of the grid, and not doing scattered reads/writes across the whole domain. Try tiling your grid, or do your scatters to a core-local cache, then do a copy of that to the global grid. This is a paper I recommend which includes a wide variety of techniques. Many of these concepts will also work well when transferred to CPUs: sites.google.com/view/siggraph2020-multigpu
@Theawesomeking4444
@Theawesomeking4444 3 жыл бұрын
@@GrantKot i removed some stuff on the gpu code and now it runs 300000 particles at 20 fps(40 fps substepped) but now the water is all turbulent. wait so each core has to get a portion of the grid instead of scanning the grid per particle? wouldnt that bottleneck the simulation if there are lots of particles concentrated on one place leaving most cores idling with empty grids while the ones with the full grid are busy? ill give it a try anyways thanks also i saw that you can run up to 600000 particles in your cpu is that in a single thread or using all cores? because right now i can run 30000 single threaded and 100000 in all cores (quad core) since you have an 8 core with 600000 particles this means that my cpu should be able to handle 300000, dang i need to optimize my simulation.
@GrantKot
@GrantKot 3 жыл бұрын
I'm not just dividing the grid into N sections for N cores. It's a little finer grained than that, dividing the grid into tiles, and then binning the particles into the tiles. The cores go over each tile of particles via work stealing which allows more even load balancing. Static partitions is also not terrible as sometimes CPUs automatically balance things out because if only 1 core is doing work it turbo boosts a bit more. How are you avoiding data race conditions if you're not binning/partitioning your particles? Are you using atomics?
@cyanoure
@cyanoure 2 жыл бұрын
Imagine this on a stable quantum computer in the future. :D
@VoxelMusic
@VoxelMusic 3 жыл бұрын
Game listed in description: Minecraft
@GrantKot
@GrantKot 3 жыл бұрын
Yeah... that's KZbin itself doing weird stuff. I don't mention Minecraft anywhere in the title or description but it's automatically adding this link and there's no way for me to remove it.
@dragoons_net
@dragoons_net 8 ай бұрын
Amazing! Using mesh shaders? If so, can you use textutres?
@GrantKot
@GrantKot 8 ай бұрын
This was pre-mesh shaders, and my recent demos have also been using just vertex shaders as I optimize a little for older gens. But yeah, I could support textures with or without mesh shaders. I do kind of like a more geometric style though, e.g. material per triangle. Mesh shaders are really useful if you want different geometry per particle.
@dragoons_net
@dragoons_net 8 ай бұрын
@@GrantKot Thanks! I played with mesh sahders until I found out that their main interest resides in occlusion culling, and thought (saw) that textures could not be used with them. Not surprised that you came back to the good old vertex shader! Very impressive work. Thanks for the emotion!
@grantlauzon5237
@grantlauzon5237 4 жыл бұрын
Looks tasty.
@jamessever8936
@jamessever8936 3 жыл бұрын
in order to create the flexible material does the size of the voxels change or just the space between them?
@GrantKot
@GrantKot 3 жыл бұрын
The voxels are able to scale rotate and shear so that can help keep things more connected. If you pull things too far apart gaps do show or it might fracture.
@angelo9915
@angelo9915 4 жыл бұрын
This is truly amazing, how did you learn to make stuff like this?
@GrantKot
@GrantKot 4 жыл бұрын
Thanks! Do you know the channel Two Minute Papers? I don't learn directly from there but it might help introduce you to the concepts if you're interested in coding your own simulations. Other useful pages: kesen.realtimerendering.com/ www.physicsbasedanimation.com/ Or if you just want to make 3D animations via Blender or something, check out Flip Fluids and Embergen and RealFlow
@jamessever8936
@jamessever8936 3 жыл бұрын
this could actually be used fo research simulations
@TwitchingShark
@TwitchingShark 4 жыл бұрын
Looks like you are on the same path. Amazing work! Do you enjoy getting lost in physics too? what gpu api are you using or is it completely custom?
@GrantKot
@GrantKot 4 жыл бұрын
Twitching Shark thanks! Yes physics is a lot of fun! I used to focus a lot on mechanics but this year have started expanding into optics and acoustics. Engine/framework I’m using is DirectXTK.
@Bleenderhead
@Bleenderhead 4 жыл бұрын
I wonder what kind of adaptive meshing approaches would be viable as an alternative to deformed cubes... it doesn't translate readily to marching cubes since this simulation isn't volumetric. Even RTX acceleration structures can't handle an undulating fluid, so ditching triangles and ray tracing metaballs doesn't seem viable either. On the subject of acceleration, is there any way to cull geometry on the interior of the "boundary" of the fluid? Rendering a soup of volume elements presents a scale problem regardless of how pretty they are, and I guess this is a challenge for similar reasons, i.e. no way to partition the scene into an acceleration structure without rebuilding it every frame.
@GrantKot
@GrantKot 4 жыл бұрын
I've only followed some very basic RTX tutorials so far, so my knowledge is very limited. I think the deformable cubes are actually quite friendly to raytracing as they are basically just instance transform matrices. Metaballs shouldn't be too difficult either. As for acceleration structures, I don't think that should be to difficult, as physics simulators rebuild their "acceleration structures" every frame all the time for collision optimization. I think what would be useful is a different type of structure for particle simulations than what they currently have which I think is a K-D tree. Something more of a grid hash type, maybe blocked for sparseness, like SPGrid. Also, rasterization also seems pretty cheap as modern GPUs can early exit on fragments based on depth. Also when you're having mixtures of many materials, I think there is no huge reason to worry about geometry culling. I don't possess the skills yet, but hope to in the future. For now, I'm going to be doing some screen space refractions and reflections.
@Vollkornaffe
@Vollkornaffe 4 жыл бұрын
>[..] it doesn't translate readily to marching cubes since this simulation isn't volumetric. I am very confused by this. You can just use the mass on the gridnodes for marching cubes?
@GrantKot
@GrantKot 4 жыл бұрын
@@Vollkornaffe Yeah, it can be used, but I feel like it loses a lot of detail. One of the advantages of MPM is the ability to simulate sub-grid details and have multiple particles per grid cell. I feel like it's hard to tell the flow with marching cubes.
@Vollkornaffe
@Vollkornaffe 4 жыл бұрын
@@GrantKot I also think that the cubes you have now are looking just fine... but its a matter of taste :P
@GrantKot
@GrantKot 4 жыл бұрын
Check out newest video for some volumetric raytracing :).
@WDGSWhatDoesGodSay
@WDGSWhatDoesGodSay 3 жыл бұрын
Wow!
@KingofKings351
@KingofKings351 4 жыл бұрын
2x speed makes this sooooo much more fun to watch 😂
@GrantKot
@GrantKot 4 жыл бұрын
Thanks for the suggestion! I will be optimizing it better for high core counts so the 12 core threadripper should be able to hit 60fps for this particle count. Currently my friend tested and it’s at 48fps, but cpu usage only at 70% (so room for improvement). On my 6 core with screen capture it’s about 35fps.
@KingofKings351
@KingofKings351 4 жыл бұрын
Anyway you can make a slime from Dragon quest? 🤔
@GrantKot
@GrantKot 4 жыл бұрын
Sure can! I’ll try to include one in my next video. I’m working on supporting magica voxel files so you can draw anything in there and then drag and drop in the window to add it to the scene.
@GrantKot
@GrantKot 4 жыл бұрын
Check out the latest vid! I had limited resolution to work with but did my best :)
@dontsubscribetothischannel9684
@dontsubscribetothischannel9684 4 жыл бұрын
#bigbrain
@iamlordstarbuilder5595
@iamlordstarbuilder5595 4 жыл бұрын
What kind of hardware is running this? Also why’s it an ad?
@GrantKot
@GrantKot 4 жыл бұрын
CPU is i7-8700K 6-core 3.7GHz (not overclocked). GPU is RTX 2080 (base, not Super or TI). System can be bought prebuilt for $1000 or less these days. I got some free ad credit from Google so finally decided to try it out and I'm really glad I did. I started with the video right before this. These 2 videos would probably have taken years to reach the views they have now, and I've gotten new subscribers and people commenting and interested in my engine. This has really helped with motivation and I'm going to try to start doing weekly updates.
@iamlordstarbuilder5595
@iamlordstarbuilder5595 4 жыл бұрын
Grant Kot that’s great dude. I’m hoping I can get to this level of skill soon, as I’m actually working on an engine of my own. I’m calling mine Chaos, does this thing have a name?
@GrantKot
@GrantKot 4 жыл бұрын
@@iamlordstarbuilder5595 I haven't settled on a name quite yet, a lot of the good ones are taken. Currently I just call it MPM Sandbox. MPM or Material Point Method is the physics algorithm this stuff is based off of. I wish you luck on your engine as well!
@dbgwins
@dbgwins 4 жыл бұрын
please relise demo for lowend pc (4cor CPU, GTX gpu)
@GrantKot
@GrantKot 4 жыл бұрын
Sorry for the delay, I will be releasing a demo on Steam soon. I did briefly release the previous version but when I was having trouble getting downloads I figured I needed to up the quality a bit. Btw, it should work ok on your computer.
@GrantKot
@GrantKot 4 жыл бұрын
I have republished a demo at: kotsoft.itch.io/mpm-tech-demo
@julianemery718
@julianemery718 3 жыл бұрын
I want to eat those voxels...
@GrantKot
@GrantKot 3 жыл бұрын
Same lol, sometimes I wonder if I should be making a culinary/baking/dessert simulator.
@bloodeleine
@bloodeleine 4 жыл бұрын
i hope you didnt pour your life savings into that ad
@GrantKot
@GrantKot 4 жыл бұрын
I put in $150, the campaign has used $100 so far, and Google will be matching my spend up to $150. I didn't really make this video with the intention of making an ad, but when I got a promo code from Google I decided to try this experiment. I've gotten far more views, likes, and subscribes from this than usual, so quite worth it. I am of course also working to improve the quality of my videos so that I can get more organic traffic as well.
@ZAXT0N
@ZAXT0N 4 жыл бұрын
I want to eat it.
@GrantKot
@GrantKot 4 жыл бұрын
:) had the exact same thoughts when I was making this
@luckylepercon4188
@luckylepercon4188 4 жыл бұрын
How get
@GrantKot
@GrantKot 4 жыл бұрын
I currently have it on itch.io: kotsoft.itch.io/mpm-tech-demo Will try to get it onto something more legitimate like Steam or Epic Games Store once I polish it up a bit more.
@TBTaco64
@TBTaco64 4 жыл бұрын
JELLO
@senditt0themoon199
@senditt0themoon199 4 жыл бұрын
0:09 *AND DO YOU REALLY WANT TO SEE HUNDREDS OF OCTOGONS HURDLING AT YOU AT THOUSANDS OF MILES SN HOUR!?!?*
@luckylepercon4188
@luckylepercon4188 4 жыл бұрын
Let me play
4K, 6 Months of Voxel Physics Engine Optimizations
8:17
Grant Kot
Рет қаралды 14 М.
How Games Fake Water
22:52
Acerola
Рет қаралды 226 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 44 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,2 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 651 М.
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
The most fun I've had working with voxels
4:52
John Lin
Рет қаралды 70 М.
Making my Voxel Engine Really Fast
5:41
Tooley1998
Рет қаралды 139 М.
I Remade Avatar Water VFX in 100 Hours
11:38
ErikDoesVFX
Рет қаралды 2,4 МЛН
Why Unreal Engine 5.5 is a BIG Deal
12:11
Unreal Sensei
Рет қаралды 1,5 МЛН
Voxel Water Physics - Waterfalls, Rivers and Tunnels
2:21
John Lin
Рет қаралды 104 М.
Coding Adventure: Simulating Fluids
47:52
Sebastian Lague
Рет қаралды 2 МЛН
I Tried Making A Fully Ray Traced Game
26:17
Acerola
Рет қаралды 214 М.
Voxel Ray Tracing
5:16
7 Bits Per Byte
Рет қаралды 270 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 44 МЛН