Coding Adventure: Marching Cubes

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 พ.ย. 2024

ความคิดเห็น • 1K

  • @SebastianLague
    @SebastianLague  5 ปีที่แล้ว +831

    Hi everyone, if you want to learn more about this topic, I have a list of the resources I used in the description.
    I'd also love to hear if there any topics you'd be interested in seeing covered in the future.
    If you're enjoying these videos and would like to support me in creating more of them, I'd be tremendously grateful if you'd consider becoming a patron: www.patreon.com/SebastianLague

    • @kizz4life
      @kizz4life 5 ปีที่แล้ว +6

      Is there a way to add collision with good performance? Especially for the last experiment.
      An interesting topic for the future for me would be reflections, for example on a noisy low poly water surface.

    • @StigDesign
      @StigDesign 5 ปีที่แล้ว +1

      i will when i can :) , i cant right now thoe :( Video tip: Maby make a video on how to make a menu system that has select charakter/Car and then select Level/Track and it then start`s with that Car&Track or Charakter/level, i can think of boolean, but in my game i think it will be alott of performance hit since i have 3 camera`s on eatch car so if i need to have all cars in every scene but hidden and then via menu it cheks for what car is set to true and track that is true it then load the correct scene and show correct car, if you understand :) ps norwegian and dyslexia so am bad at typing and english. :) btw you videos are allways funny and infomatic i learn alott from them on how to code and put things to getther. :) currently am working ona car game so i struggle with the select car and select track and then start with the selcted car&track :D

    • @DarkKnight-ke5bx
      @DarkKnight-ke5bx 5 ปีที่แล้ว +2

      What about colliders is there good way to add them without slowdown?

    • @stevenhoey9089
      @stevenhoey9089 5 ปีที่แล้ว +6

      Would be possible to add gravity so that the free floating "chunks" can fall to the surface.

    • @batman85057
      @batman85057 5 ปีที่แล้ว

      How would you fix the floaty bits in the end mesh?

  • @Ratchet4647
    @Ratchet4647 5 ปีที่แล้ว +3983

    I personally quite liked the cubes marching at the start of the video and would have been quite satisfied if that was all the video consisted of.

    • @lukeduncumb9858
      @lukeduncumb9858 5 ปีที่แล้ว +59

      I'd like the code behind it.

    • @ArnoldsKtm
      @ArnoldsKtm 5 ปีที่แล้ว +31

      @@lukeduncumb9858 seriously? It's just an added force that makes it jump to an angle forwards synced with all cubes or the whole group at once.

    • @lukeduncumb9858
      @lukeduncumb9858 5 ปีที่แล้ว +182

      @@ArnoldsKtm This is Sebastian we're talking about. It probably is a raycast collision system that has a dynamic comand interface with the options of adding a delay between each cube to cause a cascade look.

    • @codingtunes840
      @codingtunes840 5 ปีที่แล้ว +33

      @@lukeduncumb9858 foreach(Cube cube in cubes) { cube.March(); }

    • @lukeduncumb9858
      @lukeduncumb9858 5 ปีที่แล้ว +34

      @@codingtunes840 more like:
      foreach(Cube cube in cubes)
      {
      cube.ParadeMovement.March(fl_marchStep, fl_SillyWalkPCent);
      }

  • @elythas128
    @elythas128 5 ปีที่แล้ว +1963

    *Randomly makes terrain editor*
    Yup, happens to me every day

    • @zenthepig404
      @zenthepig404 4 ปีที่แล้ว +4

      Why are there no comments

    • @grunch346
      @grunch346 4 ปีที่แล้ว +12

      ZenThePig
      Because nobody had anything to comment

    • @elythas128
      @elythas128 4 ปีที่แล้ว +9

      @@grunch346 I didn't even know this had any likes, let alone 750 of 'em, but it is quite weird

    • @robbeandredstone7344
      @robbeandredstone7344 4 ปีที่แล้ว +4

      @@elythas128 Now your comment has a like too, ;)

    • @andrewherrera7735
      @andrewherrera7735 3 ปีที่แล้ว +2

      The people who do know how to do this sell the code on the asset store for like $50.

  • @profc3027
    @profc3027 4 ปีที่แล้ว +910

    Sebastian: The physical feasibility is questionable...
    Mojang: Wait, that's not supposed to happen?

  • @tomasabrams7234
    @tomasabrams7234 5 ปีที่แล้ว +1543

    As he just casually creates a terrain editor that allows for caves and overhangs, Ok Sebastian lol. This is awesome!

    • @drevfx_
      @drevfx_ 5 ปีที่แล้ว +64

      Yeah this guy is amazing, imagine if he works on improving Houdini and World Engine's terrain tools :o

    • @tyleralmquist7606
      @tyleralmquist7606 3 ปีที่แล้ว +10

      Now He’s used these cubes to implement terraforming on planets!

    • @tomasabrams7234
      @tomasabrams7234 3 ปีที่แล้ว +6

      @@tyleralmquist7606 holy crap my comment was 2 years ago lol, and ikr!! I love his new video

    • @dripnx6381
      @dripnx6381 2 ปีที่แล้ว +3

      bro made minecraft terrain generation but better

  • @SurnameName
    @SurnameName 5 ปีที่แล้ว +641

    "I'm afraid that's what passes for humour on this channel"
    Gosh, you say it like it's a bad thing

    • @theafr0842
      @theafr0842 4 ปีที่แล้ว +19

      I thought it was funny.

    • @Songfugel
      @Songfugel 4 ปีที่แล้ว +25

      That line honestly cracked me up big time... mainly because I was already impressed by the literally marching cubes xD

    • @richardmeyer418
      @richardmeyer418 3 ปีที่แล้ว +3

      Took me straight to some of the old Monty python cartoons ...

  • @espera_2192
    @espera_2192 4 ปีที่แล้ว +305

    0:06 here we can see an army of angry deleted Blender default cubes joining forces for their counter attack

    • @DnBastard
      @DnBastard 3 ปีที่แล้ว +28

      "WE ARE NOT PLACEHOLDERS! WE HAVE RIGHTS! WE SHALL NOT BE DEFEATED!"

    • @711pizzaslice
      @711pizzaslice 2 ปีที่แล้ว +17

      @@DnBastard DELETED!*

    • @chaotickreg7024
      @chaotickreg7024 2 ปีที่แล้ว +8

      They have turned FF0000 with anger

    • @CrushedAsian255
      @CrushedAsian255 2 ปีที่แล้ว +2

      @@711pizzaslice both

    • @CrushedAsian255
      @CrushedAsian255 2 ปีที่แล้ว +2

      @@chaotickreg7024 oh I get it

  • @burningflurber
    @burningflurber 4 ปีที่แล้ว +110

    the funniest part of that opening joke was that you put the time in to make them not in perfect sync. adorable...

    • @lamenwatch1877
      @lamenwatch1877 3 ปีที่แล้ว +19

      ...
      I actually didn't realize that. Sure gives me a whole new appreciation for that part of the video.

    • @rlhugh
      @rlhugh ปีที่แล้ว +3

      Wow, you're right. Omg. What a God he is. That's amazing. So subtle, and yet, in hindsight, contributes to the feeling that they're organic. People.

    • @burgerfanman
      @burgerfanman 7 หลายเดือนก่อน

      I love how this one cube (third from the front, fourth from the right), is especially out of sync. Poor guy didn't get enough pratice

  • @bhaskar08
    @bhaskar08 5 ปีที่แล้ว +540

    Each videos fills me up with joy and creativity!

  • @Stonium
    @Stonium 5 ปีที่แล้ว +423

    You're quickly becoming my new programming muse!

  • @Chickenkeeper
    @Chickenkeeper 5 ปีที่แล้ว +105

    I'm loving the format of Coding Adventures, and I'm so glad you've discovered compute shaders, can't wait to see what you do with them next :D

  • @MrHannatas
    @MrHannatas 5 ปีที่แล้ว +147

    I was just thinking that this combined with the erosion algorithm would bee cool then you said that exact thing at the end of the vid! Can't wait to see this done! :)

  • @fukodafufu6662
    @fukodafufu6662 5 ปีที่แล้ว +26

    Wasn't expecting a end video that good!
    Truly awesome as always Sebastian, it makes me wish you were actually working on a fully game.

  • @Drascylla
    @Drascylla 5 ปีที่แล้ว +215

    I'd love to get a lengthy in depth tutorial series on this from you at some point, even perhaps a method to apply marching cube terrain to a sphere.

    • @frostden
      @frostden 5 ปีที่แล้ว +22

      Applying a sphere is pretty straight forward.
      Pick a coordinate for the centre of your sphere. Pick a radius for your sphere.
      For each cube corner, if the distance from the corner to the centre of the sphere is less than the radius of the sphere, then that corner is inside our solid sphere shape (black, from Sebastian's example). Otherwise it's white.

    • @Drascylla
      @Drascylla 5 ปีที่แล้ว +6

      @@frostden I appreciate the explanation, unfortunately however I tend to follow visual cue instructions a lot better, though if you happen to know of any video tutorials and would like to share them please feel free as it will greatly help me out.

    • @Drascylla
      @Drascylla 5 ปีที่แล้ว +44

      @@monsterkillerxzx8766 Is being degrading towards an individual who merely asked for help also your mental deficiency ? Seriously tough there was no need to act like your the holy massier of knowledge, either way I am still relatively new to coding so giving me some lip about the concept of radius doesn't make any sort of statement to take serious nor are you in the position to speak for the likes of Sebastian himself as to whether a video series is something he'd want to do or not if requested.

    • @johndeleon8741
      @johndeleon8741 5 ปีที่แล้ว +11

      ​@@monsterkillerxzx8766 Seriously, It must suck to be you. Hope your personal problems get sorted out soon.

    • @roko567
      @roko567 5 ปีที่แล้ว +23

      @@Drascylla you're asking to be spoon fed with a video tutorial. Beginner programmers do it all the time and it's extremely irritating, hence the harsh response by monsterkillerxzx. Also, if you're that new to coding, maybe you should start with a little less complicated topic? Either way, learning how to learn should be your priority. There aren't gonna be video tutorials for everything you need

  • @GiannyDev
    @GiannyDev 5 ปีที่แล้ว +8

    Hey Sebastian, thanks to your videos I'm only a few days left to release my game. Your content is truly inspirational. Best wishes to you and looking forward to a new Creating a game series.

    • @SebastianLague
      @SebastianLague  5 ปีที่แล้ว +1

      Thanks, and congratulations on completing a game! Best of luck with the release :)

  • @jomative169
    @jomative169 5 ปีที่แล้ว +20

    I think Sebastian Lague is one of the smartest coders in the world!

  • @albarnie1168
    @albarnie1168 5 ปีที่แล้ว +49

    Holy crap. Every time you upload one of these vids, its it's something ive just done or am about to do. Our interests align. Love your vids man.

    • @SebastianLague
      @SebastianLague  5 ปีที่แล้ว +10

      Well I'm not sure what to do next, so let me know if you have any ideas :P Glad you're enjoying the videos!

    • @cavalier4789
      @cavalier4789 5 ปีที่แล้ว +1

      @@SebastianLague You should try compute shader particle systems or physics, you can get some ridiculous performance!

    • @KyranFindlater
      @KyranFindlater 5 ปีที่แล้ว +1

      @@SebastianLague add 'fish' as particle effects with random dithering/directions

    • @maximecloutier-gravel8908
      @maximecloutier-gravel8908 5 ปีที่แล้ว

      Same for me ! This series is awesome. You could make a second episode on ray marching by covering volumetric clouds.

    • @tylerguitar75
      @tylerguitar75 5 ปีที่แล้ว +1

      @@SebastianLague make an MMO :P

  • @Confuseddave
    @Confuseddave 5 ปีที่แล้ว +1

    I once spent a few days trying (and failing) to implement a marching cubes algorithm from scratch. "A tremendous headache that I did not want to undertake" is probably the most succinct and accurate description of that process I have yet come across.

  • @TheR971
    @TheR971 5 ปีที่แล้ว +9

    Laughed at the intro, cried at Fira Code. What a roller coaster of emotions programming can be!

  • @varnonzero
    @varnonzero 5 ปีที่แล้ว +1

    Hi Sebastian. Something about your visual presentation of signed distance fields really clicked for me. This really helped me address a long running problem in my surface nets terrain generation. I went from accidentally terraced shapes to the perfectly smooth shapes I've been wanting forever! Thanks so much for your work on this and other videos.

  • @apancakewithabs632
    @apancakewithabs632 5 ปีที่แล้ว +8

    I love how even though theeres no fish or anything, its just rock structures, its still awesome to look at xD

  • @knomstudios4134
    @knomstudios4134 ปีที่แล้ว +1

    THIS, is what I w2as looking for. Thank you so much!

  • @alexchomiak
    @alexchomiak ปีที่แล้ว +4

    Watching this after the titanic submarine hits different 😳

  • @ewwitsantonio
    @ewwitsantonio 5 ปีที่แล้ว +1

    The way you document your experience and thought process is excellent!! It's like a mini story, and I find it inspiring! Thanks for sharing this with all of us!

  • @auxometer
    @auxometer 4 ปีที่แล้ว +5

    4:58 an exploration game with that aesthetic would be *radical* and *gnarly*

    • @biggieyackboi
      @biggieyackboi 4 ปีที่แล้ว +2

      Scanner Sombre is pretty close to what you described

  • @fazalali2894
    @fazalali2894 5 ปีที่แล้ว +1

    This is one of the best videos I have ever seen. That includes all the movies I have watched. That scene at the end where you're just driving around in a world YOU created is so powerful yet calming.

  • @peterdodds2694
    @peterdodds2694 5 ปีที่แล้ว +1675

    Oh look he just made No Man's Sky with 90% of the content

    • @pako_powr
      @pako_powr 5 ปีที่แล้ว +252

      Can't we let that game off the hook now, with all the work the team put into improving the game?

    • @rodrijopo
      @rodrijopo 5 ปีที่แล้ว +143

      @@pako_powr No

    • @---capybara---
      @---capybara--- 5 ปีที่แล้ว +52

      @@rodrijopo I guess, but they added vr support! Frankly, that's all I need to rate it highly.

    • @Yamyatos
      @Yamyatos 5 ปีที่แล้ว +121

      That joke is a couple years late to being funny. Also, as others said they basically deliver what they promised now. Even if they are a few years late :P

    • @falcon5178
      @falcon5178 5 ปีที่แล้ว +74

      yeah, because selling a buggy, incomplete game for 60 USD then taking years to actually develop the game into what it originally promised is perfectly fine right

  • @FelixHelixihare
    @FelixHelixihare 5 ปีที่แล้ว +2

    This is cute. I like the marching cubes at the beginning. The atmospheric submarine adventure at the end has character.

  • @Snowballfred
    @Snowballfred 5 ปีที่แล้ว +15

    MORE , needs more , slap a discord together so we can come banter about these things and share ideas or questions ,
    top stuff

    • @Yamyatos
      @Yamyatos 5 ปีที่แล้ว +1

      Not my cup of tea, but some guy actually posted a discord link in one of the discussions above for people to chat / comment on these algorithms and stuff.

  • @druidofpies
    @druidofpies 5 ปีที่แล้ว +1

    I think calling these "coding adventures" perfectly describes the content and how I feel towards it. It's so interesting, creative, and abstract, all within the logical confines of programming. Can't wait for the next video!

  • @technobabble7702
    @technobabble7702 5 ปีที่แล้ว +3

    Oh my God you are a life saver I have been banging my head against this algorithm for days!

  • @monmonstartv5159
    @monmonstartv5159 5 ปีที่แล้ว +2

    Wow, Seb I've been waiting for something like this from all over the Internet for ages! And you're even kind enough to give the source code for us to freely explore and learn from! Thanks!

  • @xMrMiagix
    @xMrMiagix 5 ปีที่แล้ว +74

    "So i wanted to explore...."
    *creates no mans sky 0.9*

  • @veizour
    @veizour 5 ปีที่แล้ว +1

    By 0:56 - I've been hearing about marching cubes for so long and kept pushing myself to learn more. You just blew my mind. I had no idea till you demonstrated this. (I'd been dealing with noise+voxel gen). THANK YOU!
    Oh, and I appreciated your joke :D

  • @INeatFreak
    @INeatFreak 5 ปีที่แล้ว +21

    3:40 why did u not include this on project :(

  • @dam-ib9fs
    @dam-ib9fs 2 ปีที่แล้ว +2

    wow almost recreated astroneer with that terrain editor, hats off to you my friend

  • @fabioazevedo2048
    @fabioazevedo2048 2 ปีที่แล้ว +1

    Congratulations, Sebastian! Thank you for this detailed and clear explanation and for this so beautiful application of the marching cubes algorithm. What a nice job!

  • @minecraftermad
    @minecraftermad 5 ปีที่แล้ว +4

    i'm currently smashing this together with your erosion code :)

  • @animeshkarnewar3
    @animeshkarnewar3 4 ปีที่แล้ว +1

    I have to admit that this is the coolest video on marching cubes I have seen till now. Just sprinkle real-time ray tracing on it and you have an indie game already.

  • @NGCHunter2
    @NGCHunter2 5 ปีที่แล้ว +28

    Wouldn't it be theoretically possible to eradicate the "questionable physically feasibility" parts by having the terrain generator check for mesh elements which vertices have less than xyz connections (from what I've seen, the physically questionable elements all had only a bunch of vertex connections)? Just asking, for the underwater terrain looks really good otherwise!

    • @TMtheScratcher
      @TMtheScratcher 5 ปีที่แล้ว +9

      It would eliminate all small floating mountains, but big floating mountains will still exist. However it is still a good idea, because without it you would have both :D you have to find the perfect middle for the treshhold: Too small and you have a lot of flying stuff. Too big and you will have noticable decrease in performance

    • @EpicestGamer
      @EpicestGamer 5 ปีที่แล้ว +5

      It maybe more thorough to check from a base point (somewhere in the ground) and make sure you can get everywhere, there'd still be weird overhangs, and it would be *much* heavier, but it would be more thorough.
      Although from the footage there weren't really any large floating mountains, so I think the first one would be just fine.

    • @npip99
      @npip99 5 ปีที่แล้ว +2

      @@EpicestGamer Actually, your recommendation is much easier to compute than going to each coordinate and checking for example 8 coordinates in each direction. Since 8*8=64, the tiny island algo does 64*N operations, where N is the total number of coordinates. Your algorithm would do a+6b operations, where a is the number of coordinates that are actually part of the final ground terrain, and b is the # of coordinates adjacent to the final ground terrain, both of which avoiding N which includes coordinates in the air itself. This is a much much smaller number. (Explanation, being that you start at your base point and check all 6 adjacent locations until you find a new vertex to go to, so "a" is all possible new coordinates, while each "b" which is part of the surface area will be visited at most 6 times, one for each neighbor. This algorithm would be maximally efficient)
      Actually, I'm not even sure how you'd check 8 coordinates in each direction without simply picking a base point and going from there anyway.

    • @therealsemechki
      @therealsemechki 2 ปีที่แล้ว

      @@EpicestGamer That's the flood-fill operation he initially mentioned, but that's still quite non-performant.

  • @JesseBourretGheysen
    @JesseBourretGheysen 3 ปีที่แล้ว +1

    I've watched almost all of the coding adventure series now. Great videos, love em

  • @artem_hilia
    @artem_hilia 5 ปีที่แล้ว +14

    Petition to hire this guy for Subnautica development

    • @KryptLynx
      @KryptLynx 5 ปีที่แล้ว +3

      But seriously. Already in style and working on Unity :D

  • @tentakul120
    @tentakul120 5 ปีที่แล้ว +1

    Great video as always! It helped me understand marching cubes much better than most other tutorials!
    I would LOVE to see you tackle naive surface nets! I feel like it offers an interesting alternative to marching cubes.

  • @TheGuyWithTheLemon
    @TheGuyWithTheLemon 5 ปีที่แล้ว +31

    Is it bad that i thought this video was actually about how to get cubes marching like in the beginning LOL? And great video man, keep it up!

    • @luis96xd
      @luis96xd 5 ปีที่แล้ว +1

      I thought the same! And We almost got it xDDD

  • @porrasm
    @porrasm 4 ปีที่แล้ว +1

    I'm writing my bachelors thesis on procedural generation and now I'm interested to try what I've learnt in action. This project helped me get started with that.

  • @softandsgame4874
    @softandsgame4874 5 ปีที่แล้ว +3

    It's a prototype for Subnautica game-like :D
    Good Job !

  • @DJTimeLock
    @DJTimeLock 5 ปีที่แล้ว +1

    I always loved messing with vertices and terrain generation, sadly i'm not much of a math person, but i'm glad i can just watch your video's instead while i just watch and you do all the work :D love it!

  • @Juicefoozle
    @Juicefoozle 5 ปีที่แล้ว +4

    awesome video. and such a good presentation!

  • @zambi1239
    @zambi1239 5 ปีที่แล้ว

    I just finished a course in OpenGL where we made crude 3D shapes by mapping vertices... this video really helped to bridge the gap between those concepts and creating more complex models... the explanation for how you developed the terrain editing absolutely blew my mind!

  • @countinglampposts
    @countinglampposts 5 ปีที่แล้ว +8

    Holy shit your terrain generator has gotten advanced. This is so impressive! Is there any chance you could explain all of this much slower like your original procedural terrain tutorial?

  • @drsimons
    @drsimons 4 ปีที่แล้ว +1

    Burst out laughing at the dramatic music at 4:02. God I love this channel. Edit: finally pulled the trigger on Patreon. Your work is some of the most inspirational stuff on the entire internet, yet you make it seem totally within reach.

    • @SharathThe1
      @SharathThe1 3 ปีที่แล้ว

      same, except I had my mouthful **wipes the monitors** :sigh:

  • @cateyestudios6592
    @cateyestudios6592 5 ปีที่แล้ว +4

    So i liked the idea of literal cubes marching and one thing led to another and i now have a full scale platoon cube war

  • @jeffreycordova9082
    @jeffreycordova9082 5 ปีที่แล้ว +1

    Hey Sebastian, I've been watching your videos here and there for a couple years now. You're getting pretty good, the sound effects really add value! Keep it up dude.

  • @Clairvoyant81
    @Clairvoyant81 5 ปีที่แล้ว +23

    Thank you for this video and the accompanying project files. Really helpful.
    I have a question, though: At around 3:40 you show a "simple" editor for these density fields / terrain editor. I didn't find that in the project files. Would it be possible to have a look at how you did that?

    • @xxzippyzachxx
      @xxzippyzachxx 5 ปีที่แล้ว +1

      I'm also interested In the terrain editor tools!

    • @prototy
      @prototy 4 ปีที่แล้ว +2

      @@xxzippyzachxx I assume it's just adding to the grayscale value that determines the surfaces

  • @sanyammalhotra58
    @sanyammalhotra58 2 ปีที่แล้ว

    The simplicity is incredible. I would love to learn a lot more about how much effort really went into implementing marching cubes. The one at the start of the video I mean, obviously. Rest was easy.

  • @Nightmare-or2yd
    @Nightmare-or2yd 5 ปีที่แล้ว +3

    PLEASE make a tutorial for this. You may not be the most experienced in the field but you are so good at explaining things and I think a lot of people would be interested.

  • @williamchamberlain2263
    @williamchamberlain2263 5 ปีที่แล้ว

    0:24-0:55 is the clearest, simplest explanation of marching cubes I've ever heard

  • @redstonebear7_342
    @redstonebear7_342 5 ปีที่แล้ว +4

    Up next on coding adventures: One person makes Subnautica with random terrain.

  • @JJDSG
    @JJDSG 5 ปีที่แล้ว +1

    Sorry i was a bit late. But man i loved this one immensely. Wow nice work. I hope you use this in your long abandoned procedural world's series. Thanks

  • @gabrielsanchez8408
    @gabrielsanchez8408 4 ปีที่แล้ว +7

    Hey guys, any ideas of how to add a collider so that the submarine can't go through the land that is generated?

  • @bryanwoods456
    @bryanwoods456 5 ปีที่แล้ว +2

    I'd do a patreon sub just for a tutorial series on recreating this code adventure. I think it has so much interesting potential for procedural worlds, and there are not a lot of quality tutorials out there that explain the inner workings of how these things are created. No one seems to have connected the dots and then documented that process in a succinct video tutorial. Just random white papers and broad explanations of very deep technical subjects that make up this process.

  • @jufaceambrisar8808
    @jufaceambrisar8808 5 ปีที่แล้ว +5

    0:58 I think that's what the fourth dimension looks like

  • @FedericoLancerin
    @FedericoLancerin 5 ปีที่แล้ว +2

    Holy crap, this is amazing! Kudos to you for showing us this super cool underwater world you discovered :D

  • @digitalArtform
    @digitalArtform 5 ปีที่แล้ว +3

    If you do this in 2D you get the algorithm Adobe Illustrator uses to turn pixels into vector tracings.

    • @satibel
      @satibel 5 ปีที่แล้ว +1

      I used that algorithm to turn a picture into g-code (which is basically vectorisation), and also to make a map out of 2D sprites (like rpg maker).

  • @u0432865
    @u0432865 5 ปีที่แล้ว

    the happy accident with the shader makes for a really cool looking alien underwater world. like diving through a cave of a really strange crystalline mineral rock formation

  • @Hilko26
    @Hilko26 5 ปีที่แล้ว +5

    This all reminds me of the volumetric caves in Deep Rock Galactic, I'd suggest you check it out.

  • @feralpapertiger
    @feralpapertiger 5 ปีที่แล้ว

    Great work! And your explanation of the mathematical relationship between granular cubes (cube marching) was very cogent.

  • @tiagotaquelim1776
    @tiagotaquelim1776 5 ปีที่แล้ว +12

    The infinite underwater game would actually be such a cool idea.

    • @EpicestGamer
      @EpicestGamer 5 ปีที่แล้ว +3

      Boy do I have the game for you!

    • @tiagotaquelim1776
      @tiagotaquelim1776 5 ปีที่แล้ว

      @@EpicestGamer i require more information :3

    • @MarkWiemer
      @MarkWiemer 5 ปีที่แล้ว

      Subnautica!

    • @philippbrogli779
      @philippbrogli779 4 ปีที่แล้ว

      @@EpicestGamer I love how you didn't even bother with answering since everyone knew what your answer is.

  • @moraez5904
    @moraez5904 ปีที่แล้ว

    I would love to see you continue on this and make the ecosystem more complex

  • @norricommander
    @norricommander 5 ปีที่แล้ว +5

    The joke went over my head, at the end I was still waiting to see cubes lol

  • @HunternifArt
    @HunternifArt 5 ปีที่แล้ว +1

    The terrain generation tool looks like it could be an awesome general-purpose sculpting tool as well!

  • @augustowang2417
    @augustowang2417 4 ปีที่แล้ว +11

    When you accidentally create astroneer with a terrain editor...

  • @thehandleiwantedwasntavailable
    @thehandleiwantedwasntavailable 5 ปีที่แล้ว

    This is awesome! 15 years ago I wrote a primitive raytracer in a C scripting language. I always wanted to extend it to handling fractal landscape generation, which is what you’re doing here. I love it!
    Ryan Geiss is someone who’s done a lot of work in this area too.

  • @longbowman2306
    @longbowman2306 5 ปีที่แล้ว +125

    anyone else who's completely lost while watching this vid?
    great video but im scratching my head over here 😂

    • @ausderluft4850
      @ausderluft4850 5 ปีที่แล้ว +29

      Still trying to figure Out what a marching cube is and how the hell it becomes a terrain Generator.

    • @DriitzzCabal
      @DriitzzCabal 5 ปีที่แล้ว

      what got me is the CubeIndex |= 1

    • @finian2
      @finian2 5 ปีที่แล้ว

      @@DriitzzCabal The = with the / inside it is the same as 'Not equal to', and it kinda depends on the software you're using. Some used !=, while others use .

    • @mileswaugh
      @mileswaugh 5 ปีที่แล้ว

      DriitzzCabal I am pretty sure that just converts the ID from binary to base 10.

    • @jeffwells641
      @jeffwells641 5 ปีที่แล้ว +1

      He uses marching squares in his cave generation video. That's basically a simpler version of marching cubes.

  • @Scarletraven87
    @Scarletraven87 5 ปีที่แล้ว

    This is ... beauty.
    It is on a level that is clearly far beyond my skills, and yet so beautiful it doesn't scare me. That's so rare.

  • @SonicMasterLB
    @SonicMasterLB 5 ปีที่แล้ว +6

    Holy shiet dud, you are smart af. I like that.

  • @sirflimflam
    @sirflimflam 5 ปีที่แล้ว +1

    This is definitely one of the videos I'd like to see a proper in depth tutorial on.

  • @mantasvaiciulis3657
    @mantasvaiciulis3657 5 ปีที่แล้ว +7

    Those marching cubes at the beginning had me dying on the floor xDD. Great video!

  • @David-fe1qz
    @David-fe1qz 2 ปีที่แล้ว

    1:33 For anyone curious, you have the usual symmetries of a cube (e.g. mirroring and any 90 degree rotation) plus the unusual inversion symmetry of changing all black vertices to white and all white vertices to black. It looks like Sabastian made a little mistake here by showing one of these twice (10 and 12), and left out the case of all black or all white (which would be an empty cell).

  • @CaptainJeoy
    @CaptainJeoy 5 ปีที่แล้ว +4

    Sebastian makes me remember why I wanted to do game development in the first place

    • @Wylie288
      @Wylie288 5 ปีที่แล้ว +1

      Gamers are shitty people these days. Don't recommend it.

    • @CaptainJeoy
      @CaptainJeoy 3 ปีที่แล้ว

      @@Wylie288 Oh, hahaha. i forgot to reply this. I had already been a game developer when i made that comment, i was just reminiscing on the first love i had on the medium.

  • @DragonHeart000
    @DragonHeart000 4 ปีที่แล้ว

    I'm trying to learn about marching cubes to start a side project game that will use it and this was a really good starting point!

  • @willd773
    @willd773 5 ปีที่แล้ว +3

    What if you use a non-linear interpolation, like say cubic interpolation?

  • @sosig6445
    @sosig6445 5 ปีที่แล้ว

    holy shit these videos open up so much potential and ideas for level design or map generation

  • @wssdude
    @wssdude 5 ปีที่แล้ว +4

    Best intro ever :D

  • @OsvaldoRodriguezTorres
    @OsvaldoRodriguezTorres 5 ปีที่แล้ว

    Super awesome! Can't wait for the tutorial! I was able to make a "marching cubes" styled planet by putting together code from different tutorials but I feel it was very unstable and not fit for real use. Great job. Please do a series on this.

  • @ClydeCraft
    @ClydeCraft 5 ปีที่แล้ว +3

    I'd imagine this is very similar to how minecraft generates its terrain.

    • @MrGranddy
      @MrGranddy 5 ปีที่แล้ว +2

      Yes, it is almost exactly the same, they use the coordinate parameters to also determine if there will be an ore, etc. So each time you step into a new chunk the chunk will be loaded at that exact time which saves a lot of spaces when saving your world, you can notice this if you travel long distances that is because when a chunk is loaded the data of the chunk will be kept to guarantee not losing any progress, even if you don't change anything.

  • @PakkaponPhongtawee
    @PakkaponPhongtawee 3 ปีที่แล้ว

    Thank you for provide easy understandable visualisation.
    I go across the internet and it very confusing until found this video

  • @KuraIthys
    @KuraIthys 5 ปีที่แล้ว +3

    Huh. I've heard about the marching cubes algorithm many times, and what it's for, but this is the first time I've actually seen an explanation for what it IS, and why it has that name.
    I always thought it meant something different, but no, makes perfect sense.
    Go figure. XD

  • @r_A_ven
    @r_A_ven 5 ปีที่แล้ว +1

    i'm gonna have to rewatch this a couple times because i'm not sure i understood the method correctly. But the outcome is extremely fascinating! especially the procedural underwater world and of course your mini zBrush-application xD

  • @r1pfake521
    @r1pfake521 5 ปีที่แล้ว +6

    Did you delete/hide some of your older videos? Im sure you had a video about a object/camera following a path/spline, but I can't find it anymore :(

  • @legotechnicmastery
    @legotechnicmastery 5 ปีที่แล้ว +1

    You never cease to amaze me!
    It gives plenty of game developpement ideas !
    Are you working on a game implementing all the nice code you create ? Or just enjoying your self, trying out plenty of fun stuff !?

    • @SebastianLague
      @SebastianLague  5 ปีที่แล้ว +1

      Just messing about for fun at the moment :)

  • @Kirton1541
    @Kirton1541 4 ปีที่แล้ว +6

    Which script is the line of code in to change from a 2d terrain to a planet? (i.e value = radius - ...) be grateful if anyone can let me know. Edit: nvm after playing around i found out you have to create an empty object in the left hand menu, then drag the SphereDensity script in Scripts->Density onto the object, then set the density generator in the mesh generator to sphere density

    • @fisthacker1325
      @fisthacker1325 4 ปีที่แล้ว

      hi, i did this and i am just getting a round sphere not a terrain sphere/ planetary terrain. can you explain please.

  • @beyondlwm
    @beyondlwm 5 ปีที่แล้ว

    this is the most clear explanation of matching cube I've ever seen, thank you!

  • @giggleghost3751
    @giggleghost3751 5 ปีที่แล้ว +6

    Damn, you are a coding wizard. xD 💖

  • @redpie907
    @redpie907 3 ปีที่แล้ว

    gosh what am i looking... this guy is wow mind blowing knowledge
    the way he use his knowledge and brain... ahhh i love it

  • @AtomkeySinclair
    @AtomkeySinclair 5 ปีที่แล้ว +15

    I'm sure this has been asked and answered. What graphics library are you using to represent your data with?

    • @AtomkeySinclair
      @AtomkeySinclair 5 ปีที่แล้ว

      Well dangit. At least 6 folks agree with me wondering by now. So I assume by the thumbs up. Wishing for an answer still.

    • @nickrooker6368
      @nickrooker6368 5 ปีที่แล้ว +5

      I just looked through the project on github.. It appears he's using unity, but I might be incorrect.

    • @Yamyatos
      @Yamyatos 5 ปีที่แล้ว +6

      He works with Unity. And in his 2D Terrain Generation series he wrote everything from scratch, building a mesh and coloring triangles based on their height and so on. So i highly doubt he uses anything other than Unity in this example either. If that does not answer your question, he posted the entire project in the description so you can simply download and import it and see for yourself how he did all the things.

  • @charlesmatlock2177
    @charlesmatlock2177 2 ปีที่แล้ว

    I enjoyed seeing your pain with those cubes and finding those planes as a materials engineer who had to do A LOT of that at my university

  • @Magnogen
    @Magnogen 5 ปีที่แล้ว +4

    Could you also do a type of hydraulic erosion on this kind of thing to make the terrain a bit more natural?

    • @Yamyatos
      @Yamyatos 5 ปีที่แล้ว +2

      I highly doubt that this plus erosion would be manageable in realtime, considering his erosion example took nearly a second to generate. Even if you sped that up multiple times and cache / save chunks after their first time being generated, i believe walking into a new area and forcing new content to be generated would either cause a noticable latency between frames, or a pop-in on chunks depending on threading. Nontheless, if this is possible it would surely look amazing!

    • @Magnogen
      @Magnogen 5 ปีที่แล้ว +1

      @@Yamyatos Ok, that makes sense. I wonder if there is a more efficient way to do erosion that can be done with this kind of generating... Like some sort of pseudo-erosion.

  • @Kugelschrei
    @Kugelschrei 5 ปีที่แล้ว

    Hey! Your solution is correct. You always need to update the full triangle at once, otherwise you run into race conditions, because each thread updates one vertex at the time it is not given that all three corners get written to the buffer in sequence, meaning another triangles vertex can get into the buffer first. This is expected behavior. Other than that, nice project! You could look into creating a solution for collision detection for these meshes.

  • @Parzival0152
    @Parzival0152 5 ปีที่แล้ว +4

    are you going to continue the neural networs series?? it has been a really good one at that