Ships, Deep Water | Voxel Physics Engine

Поделиться
HTML-код
  • Опубликовано: 2 окт 2024
  • Re-enabling coarse pressure for my ships scene, allowing for much deeper water.

Комментарии • 69

  • @a445fa6sd
    @a445fa6sd 4 месяца назад +76

    this runs at realtime framerates but visual studio still takes like 5 seconds to open lol

    • @GrantKot
      @GrantKot  4 месяца назад +38

      Maybe someday a redstone computer in my simulator will open Visual Studio faster lol

    • @instrate4307
      @instrate4307 4 месяца назад

      @@GrantKot review the settings. There might be the features VS spends resources on, but you don't actually need that. Might be like separate linter or whatever

    • @dahahaka
      @dahahaka 4 месяца назад +2

      Honestly microsoft really needs to do smth with VS performance lol it's incredible how they have such amazing engineers yet they didn't just redo the whole application at this point xD and yes I'm well aware this isn't trivial

    • @fangelo2006
      @fangelo2006 4 месяца назад

      @@dahahaka they did, it's called visual studio code 🙂

  • @Officialjadenwilliams
    @Officialjadenwilliams 4 месяца назад +3

    A true inspiration

  • @Mark_Rober
    @Mark_Rober 4 месяца назад +8

    It would be really cool if you had a shot where you were standing on the ship and then a big wave came crashing over it!

    • @GrantKot
      @GrantKot  4 месяца назад +3

      Yeah, great idea! Need to add my first person stuff back in there.

  • @mister_r447
    @mister_r447 4 месяца назад

    Imagine Minecraft, or other sandbox survival game, with phisics like these!

  • @amaryllis0
    @amaryllis0 4 месяца назад +6

    So cool....
    If you can't get larger worlds performant, you could maybe lean into a "worlds in a bottle" theme, maybe a lil bit like spelljammer

    • @GrantKot
      @GrantKot  4 месяца назад +4

      Thanks, I like that idea. I find it nice to look at the water from the sides. I also have been thinking maybe little planets like Super Mario Galaxy style and each might have different sets of materials interacting with each other.

    • @MidBoss
      @MidBoss 4 месяца назад

      Great idea!

  • @23lkjdfjsdlfj
    @23lkjdfjsdlfj 4 месяца назад +4

    So mesmerizing!!!

  • @TackerTacker
    @TackerTacker 4 месяца назад +2

    Wait this could scale to planet size?
    I thought this is close to the limit in terms of scale.

    • @GrantKot
      @GrantKot  4 месяца назад +1

      I said a little jokingly, but technically, it may be possible to extend into some sort "fractal fluids" system with some adaptivity improvements to the particles and the grid.

  • @dragoons_net
    @dragoons_net 4 месяца назад

    Amazing!

  • @WyrdieBeardie
    @WyrdieBeardie 4 месяца назад +1

    This is amazing! (Again)
    Do you find that you're more GPU limited or CPU limited (currently)?
    And what do you plan on doing with this?

    • @GrantKot
      @GrantKot  4 месяца назад +1

      Thanks! I am aiming for a pretty even CPU+GPU division of work. I feel like CPUs have gotten much cheaper and if you factor in that it lets you do more flexible branchy algorithms for multi-material mixtures, and sparse and adaptive resolution, they might be pretty much even with GPUs on a price to computation ratio. Plus, there are plenty of settings that can eventually use the GPU more fully, such as turning on more raytracing, or using mesh shaders to draw geometric particles instead of just cubes. I think sandbox/game and maybe a vfx tool.

  • @toxiccan175
    @toxiccan175 4 месяца назад +4

    Have you considered creating the equivalent of portals or looping boundaries to create a planet or region that players can circumnavigate?

    • @GrantKot
      @GrantKot  4 месяца назад +2

      Nice idea! I think I should be able to do looping boundaries and it would look pretty cool.

    • @toxiccan175
      @toxiccan175 4 месяца назад +2

      @@GrantKot I’ve really enjoyed watching your dev logs and I look forward to seeing where this project goes!

  • @wdkpwr6586
    @wdkpwr6586 4 месяца назад

    You should join JangaFX Liquigen developement looks cool af

  • @HumanGamer
    @HumanGamer 4 месяца назад +3

    this is really cool! can you explain how the fluid simulation works or share the code?

    • @GrantKot
      @GrantKot  4 месяца назад +1

      I’m using MLS-MPM (moving least squares material point method). It uses particle-grid-particle instead of particle-particle interactions to make things a bit cheaper to compute.

    • @HumanGamer
      @HumanGamer 4 месяца назад +1

      @@GrantKot interesting, not that I really understand. Can you recommend any resources to get started learning this sort of fluid/physics sim?

    • @GrantKot
      @GrantKot  4 месяца назад +1

      @@HumanGamer The two papers that got me started in physics sim are: Advanced Character Physics - Thomas Jakobsen, Particle-based Viscoelastic Fluid Simulation - Simon Clavet et al. Both of these have a lot of pseudo/code so are very friendly to implement.

  • @theashbot4097
    @theashbot4097 4 месяца назад +3

    I am just curious, why are are all the voxels not in a grid? I Have never seen a voxel engine like this before, and it looks soo cool!

    • @GrantKot
      @GrantKot  4 месяца назад +3

      Behind the scenes, I guess it is more like a particle-based world being rendered in a voxel style. For liquids, I think it is important for the players to be able to see the flow, and for my elastic/materials, I also show shear deformation in addition to rotation for each particle. Also, technically, with the particle system, they don't have to be grid aligned, but it is just easier to create content for with voxel editors.

    • @theashbot4097
      @theashbot4097 4 месяца назад +3

      @@GrantKot oh. That is cool! Have fun improving this! it looks so cool!

    • @GrantKot
      @GrantKot  4 месяца назад +1

      Yes, I should be close to that, adding joints, motors between parts in the structures, etc.

  • @MidBoss
    @MidBoss 4 месяца назад +4

    Always great to see an update from you! It's looking good, I just wish my PC was a bit more powerful...

    • @GrantKot
      @GrantKot  4 месяца назад +4

      Thanks! There are still a lot of possible optimizations so don't count your PC out yet. So much non-SIMD/multithreaded code with the multigrid part because I need to keep it flexible to update as I add features. On iGPU I can pretty much remove the light volumes to reach a very similar look with just the ambient occlusion. A lot of unnecessary data transfers linger

    • @MidBoss
      @MidBoss 4 месяца назад

      @@GrantKot Having followed your progress for a couple of years I have no doubts about your skills. This is incredible and you're a wizard 🪄

  • @capyfan
    @capyfan 4 месяца назад +2

    amazing, really amazing stuff! can't wait to see more

  • @ThomasCsere
    @ThomasCsere 4 месяца назад +1

    The work you're doing is really cool! If you get everything multi threaded, how big of an area do you think you could run?

    • @GrantKot
      @GrantKot  4 месяца назад +1

      With the sparse grid now implemented (and if I also sparsify the coarse grid), technically I could do a very large world size. Mostly it depends on the number of particles, so I've been keeping the world at a size where you can get a decent amount of material pile-up. Streaming chunks is also a possibility. Not a lot of textures involved, all lighting is dynamic, should be very fast load times.

    • @ThomasCsere
      @ThomasCsere 4 месяца назад

      @@GrantKot that would look so cool

  • @nutzeeer
    @nutzeeer 4 месяца назад +13

    This looks like it could work well with a physically accurate remake of the game from dust!
    cool simulation!

    • @JoeTheis
      @JoeTheis 4 месяца назад

      From Dust was cool but no one ever did anything further with the idea. Sad!

    • @nutzeeer
      @nutzeeer 4 месяца назад +1

      @@JoeTheis yea! The game as it is also felt a bit short. A lot of untapped potential! I really liked it. It could do well as a city simulation for example.

  • @ChipboardDev
    @ChipboardDev 4 месяца назад +2

    This is really cool!!! Noita but 3D?

    • @GrantKot
      @GrantKot  4 месяца назад

      Thanks! I’ll try my best to get chem reactions in soon

  • @meetsoneji3830
    @meetsoneji3830 4 месяца назад

    looks sick

  • @tiagotiagot
    @tiagotiagot 3 месяца назад

    Imagine if this tech was already available when they were creating Teardown...

  • @PedroGarcia-fl1fu
    @PedroGarcia-fl1fu 4 месяца назад +1

    So cool!!! A dumb question, it is possible when you're going to make the multi-threads support, using each CPU to make more specific things, for e.g., one core for deep water that demands less computing (I believe that engine has something that make particles underwater bigger than the superficial), 3 cores for superficial water because has more particles, one core for solid ships and solid things, one core for glue together this interaction of each core...

    • @GrantKot
      @GrantKot  4 месяца назад +1

      Thanks! I think because of the particle-grid transfers, it is more important that the particle tiles get iterated through more based on locality. I rely on the "work-stealing" aspect of the multithreading library I use (Taskflow) to balance things out. Sometimes during splashy times many of the tiles can be on the finest resolution, so the balance between fine and coarser particles changes a lot. With the structures though, yeah, it could be beneficial to lock each ship (structure) to a different core (also improve cache), and have the particle materials balance on top of that.

    • @PedroGarcia-fl1fu
      @PedroGarcia-fl1fu 4 месяца назад

      @@GrantKot You are doing something unbeliever with this engine! Sorry if this idea is dumb, but... could you use A.I. or deep-learning method to teach the engine how water flows to try to make it uses less CPU? Something like a fake simulation, maybe on regions that are less perceptive, maybe far way from camera or under deep water?

    • @GrantKot
      @GrantKot  4 месяца назад +1

      I haven't added adaptive grid resolution yet, which might be the next step. I worry about the robustness of AI in handling materials it has not seen in training yet. From my 2023 demo, the materials are unified and all the parameters like compressibility, viscosity, elasticity, density can be changed. I think the multigrid setup I have is probably in some ways similar to what a deep neural net would do, the MPM kernel similar to convolution.

  • @nangld
    @nangld 4 месяца назад

    Amazing! You can make millions with a 3d Noita clone.

  • @lankim3164
    @lankim3164 4 месяца назад

    Amazing as always!! Is the viscosity between water particles(or voxels) statically set by a single global constant? or is it recalculated by other factors(like velocity or temperature or etc.) for each particle or region in real-time?

    • @GrantKot
      @GrantKot  4 месяца назад +1

      Thanks! Currently, I have these parameters uniform across a single physics material. Would definitely be cool to vary viscosity based on temp though. I do have things somewhat set up, so the physics models can be swapped out for more advanced/accurate ones. Like currently I run a more advanced model for the dirt/elastic (keeps track of deformation gradient and shear forces) than liquid.

  • @tiagotiagot
    @tiagotiagot 3 месяца назад

    Long time ago I saw something about a technique where liquids were simulated as layers of particles near the surface, and as voxel-grid celular-automata style simulations inside the volumes, with the interface between the two types talking with each other to transfer forces and densities and stuff, and particles being created and destroyed as needed, and the voxel grids adjusted to fit inside as the surface layers changed shape, and stuff like that. Would that be something that could help you get deeper water working better?

    • @GrantKot
      @GrantKot  3 месяца назад

      Yes this is definitely something I need to look into. It gets a bit difficult in my case I think because I have many objects interacting with and poking into the water, sometimes thin objects too like the demo with the bamboo. And then there is the multimaterial aspect of things.

  • @poisonshroom64
    @poisonshroom64 22 дня назад

    my jaw is in the basement

  • @jonatanlind5408
    @jonatanlind5408 4 месяца назад

    Did you make those ships yourself or do you by chance have a reference to where I can find them?

    • @GrantKot
      @GrantKot  4 месяца назад +1

      I purchased this & some other voxel models from Niklas Mackle (@knosvoxel) a couple years ago.

  • @MyEarsHurts
    @MyEarsHurts 4 месяца назад +1

    cant wait for this to be released as a demo

  • @fazin85
    @fazin85 4 месяца назад

    this is awesome man!

  • @antonsimkin
    @antonsimkin 4 месяца назад +1

    magic man

  • @Nekrovski
    @Nekrovski 2 месяца назад

    DEEPAH !!

  • @AnalogueAbsynth
    @AnalogueAbsynth 4 месяца назад +1

    Amazing progress on this

  • @perz1val
    @perz1val 4 месяца назад

    It needs foam - fast water becoming white

    • @GrantKot
      @GrantKot  4 месяца назад +1

      I will try to add foam back soon.

  • @Postmilstill
    @Postmilstill 4 месяца назад

    ahem...👀planet scale??

    • @GrantKot
      @GrantKot  4 месяца назад

      There might be a possibility if I start tracking coarse particles on the coarse grid.

  • @TR-707
    @TR-707 4 месяца назад

    are you also recording on the same computer?

    • @GrantKot
      @GrantKot  4 месяца назад +1

      Yes, just using the Nvidia app to capture. This is the speed it currently runs at, I don't speed up my clips, and there are many possible optimizations. 13900HX+4080

    • @TR-707
      @TR-707 4 месяца назад

      @@GrantKot doesnt it impact the simulation pefformance a lot?

    • @GrantKot
      @GrantKot  4 месяца назад +1

      Not super much. I think they have at least 1 builtin HW encoder. And I'm not fully utilizing the 4080 yet.