VOXEL Rendering And Traversal Algorithms | Devlog #7

Поделиться
HTML-код
  • Опубликовано: 17 авг 2024
  • Join The Discord Server - / discord
    If you like the video and want to see more, please give it a thumbs up and share. More devlogs coming every month so subscribe to be notified.
    This has been a long month! I've been working on lots of different voxel traversal algorithms such as the DDA algorithm and also looking into signed distance fields to store the voxels.
    This custom c++ engine is using Vulkan to do voxel octree ray casting to render the scene. This allows complex LOD systems to be used to optimise rendering. My goal is to create an open world game based of voxels at a scale never seen before!
    Links to discord challenge games:
    thibsworkshop....
    mrsharkgames.i...
    Thibs Workshop channel:
    / @thibsworkshop
    Fast voxel traversal algorithm:
    citeseerx.ist....
    ♫ - Music:
    "Lukrembo" - "Wine"
    / wine
    "Lukrembo" - "Night"
    / night

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

  • @Sharpman76
    @Sharpman76 3 года назад +131

    As a mechanical engineering major, I still have basically no clue what's happening here, but you say fun coding words and you make fun colors appear onscreen so I'm enjoying this regardless, definitely cool to see someone progress on a project they're passionate about

  • @zhixingzhang563
    @zhixingzhang563 3 года назад +73

    The Efficient Sparse Voxel Octree paper proposed a great stack-based traversal algorithm for sparse octrees. If traversing a sparse data structure is a problem for you, just implement that.

    • @voxelbee
      @voxelbee  3 года назад +17

      That is very similar to what I previously used. Also I want to not use a stack if possible as that mean the we can run more threads per work group on the GPU

    • @kerzhemanov
      @kerzhemanov 3 года назад

      @@voxelbee How do you use stack on GPU without CUDA? As far as I know there is no stack in HLSL and GLSL.

    • @anonymousanonymous1934
      @anonymousanonymous1934 2 года назад

      @@kerzhemanov stack can be basically fixed sized array plus integer that points to the top of this stack

    • @kerzhemanov
      @kerzhemanov 2 года назад

      ​@@anonymousanonymous1934I understand that. That wasn't what I asked. It was a technical question, not theoretical. Though I agree that I should make it more clear.
      Using stack on such architecture often leads to lower performance because of higher thread divergence. It seems that algorithms which always start from root and so do not use stack, work better. Also I suspect that CUDA does some optimizations for stack based code, but I may be wrong here.

  • @manuelvillalba9644
    @manuelvillalba9644 3 года назад +47

    Voxelbee: I'm limited by the technology of my time

  • @aXYZGaming
    @aXYZGaming 3 года назад +38

    Yes, just need to see if there's a hyper-detail spud.

    • @voxelbee
      @voxelbee  3 года назад +6

      Haha I have to do this at some point now!

    • @theburgerbox9576
      @theburgerbox9576 3 года назад +2

      Potato.
      YES.

    • @nou4898
      @nou4898 3 года назад

      and a hyper-detail cannon

  • @delphicdescant
    @delphicdescant 3 года назад +7

    Nice, this is pretty similar to some of my favorite Shadertoy demos.
    I've also got a similar thing going in my own C++/Vulkan engine I want to eventually make into something.

  • @Radian628
    @Radian628 3 года назад +4

    2:09 "DISTANCE FEILD" lol

    • @voxelbee
      @voxelbee  3 года назад +4

      I just realized! lol

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

    This is exactly the kind of coding video I like. 🎉 interested in continuing to hear more about the unique challenges you face and how you decided to move through or solve them.

  • @Daniel-ij3ks
    @Daniel-ij3ks 3 года назад +8

    I think it may be worth mentioning that GPUs already use some kind of tiling or curve (like morton codes) in their texture memory layout to increase cache coherence.

    • @voxelbee
      @voxelbee  3 года назад +3

      Yeah that's true!

  • @olivestamma
    @olivestamma 3 года назад +5

    I’m honestly so confused, why in the world don’t these have more views??

  • @Skeffles
    @Skeffles 3 года назад +1

    Great video! It's interesting to hear your approach on this.

  • @jonathanz9057
    @jonathanz9057 3 года назад +1

    woot! well done dude, keep it up

  • @ThibsWorkshop
    @ThibsWorkshop 3 года назад

    Nice video and very interesting algorithms! Thanks for the shout-out!

  • @BL0B5TER
    @BL0B5TER 3 года назад +9

    What I'm wondering is how you'll do dynamic scenes with your datastructure? Or are you mostly aiming at implementing static voxel scenes

  • @flammableduck7015
    @flammableduck7015 3 года назад +1

    Fascinating stuff, keep it up!

  • @EmmanuelMessulam
    @EmmanuelMessulam 3 года назад +3

    Nice!

  • @Rossilaz58
    @Rossilaz58 3 года назад +2

    4:42 you invented a quantum physics simulation without realising

  • @YYYValentine
    @YYYValentine 3 года назад

    I learn a lot from these devlogs!

  • @amb1gduc886
    @amb1gduc886 3 года назад

    Great vid! I can’t wait for the next one

  • @DolphinDev
    @DolphinDev 3 года назад

    Tbh I was pretty confused when I read the title haha but I really liked the video great job

  • @tekz541
    @tekz541 2 года назад

    I work full-time as an app developer and at least understand what an array is and buffers etc. But as soon as you talk about graphical stuff I don't understand anything anymore but it's still very interesting.

  • @olivander5171
    @olivander5171 3 года назад +1

    keep it up man!

  • @SemiMono
    @SemiMono 3 года назад +3

    SDFs seem really efficient, but wouldn't updating the shape and hence also updating the SDF be rather slow?

  • @benrex777productions9
    @benrex777productions9 3 года назад

    At first it looked so nice and then everything came to a halt. But it looks like you start to solve the problem. I'm looking forward to the video where you explain what solution you picked.

  • @AndrewBrownK
    @AndrewBrownK 3 года назад +5

    If you like Morton Codes, you might like k-d trees. (Octrees might be a red herring for your sparse data model)

  • @galladebutcooler8645
    @galladebutcooler8645 2 года назад +1

    What if instead of giving each voxel a coordinate system you give to each voxel an information that says wheter it has a near voxel? Like, imagine a 8x8x8 chunk of voxels... You'll need three coordinates of 3 bits to identify each voxel inside the chunk (an effective total of 9 bits for voxel). What if you change completely the way voxels are stored and you create a data structure where only ONE voxel in the chunk has coordinates and then each other voxel starts from that one like a chain? Immagine a 2D example of this: You have an 8x8 grid and you wanna create an "L" character, which is 4 pixel tall and 3 pixel wide. You identify the voxel neighbor position with 2 bits (00 up, 01 right, 10 down, 11 left). Now, you give the coordinates of the first voxel and then you build the chain:
    first voxel: (000,000). Then you start the chain: (10),(10),(10),(10),(01),(01),(01). In real life direction that means "down,down,down,down,down,right,right,right,right".
    Now, an 8x8 grid requires at lest 3 digits for the X and 3 for the Y, so you have a total of 8 bits for each voxel. So a traditional model would be:
    (000,000)
    (000,001)
    (000,010)
    (000,011)
    (000,100)
    (001,100)
    (010,100)
    (011,100)
    And this gets bigger if your grid becames larger, and WAY bigger if your grid becames tridimensional. But Identifying a neighbor voxel will ALWAYS require 2 bits (3 at most, with a three dimensional grid). So this model is WAY heavier, compared to a chain model, which is just:
    (000,000)
    (10)
    (10)
    (10)
    (10)
    (01)
    (01)
    (01)
    And the difference only gets bigger with bigger voxels. Hope you can find this useful (:

  • @niuage
    @niuage Год назад

    You're a pretty smart bee.

  • @ThylineTheGay
    @ThylineTheGay 3 года назад

    Voxels are the future.

  • @geekonarium
    @geekonarium 3 года назад +2

    Cool :-)
    Every voxel saves a reference to next visible voxel with degrees? From center to center? When a voxel moves this needs to be recalculated. Maybe than the next voxel is matchable with the pixelbeam?
    Could be alot of references. Maybe a hybrid of herachie and references in some ways. Also an max step definition for a pixel beam should be applyed and for the beams for recalculating near by voxels for the moved voxel. Maybe if you have intelligent datastructure for the degrees than you also dont need to check every angle.
    Just a theory. Maybe overconstructed :D

    • @oystercatcher943
      @oystercatcher943 3 года назад

      Check out the gigavoxels paper. I think a references a similar idea to store neighbours bit gigavoxels doesn’t to keep memory lower

    • @geekonarium
      @geekonarium 3 года назад

      @@oystercatcher943 thank you

    • @geekonarium
      @geekonarium 3 года назад

      @@oystercatcher943 Hmmm still think voxel grouping is much more easy/effective.

  • @zyansheep
    @zyansheep 3 года назад +11

    Second!
    Edit: oh yeah SDFs are cool!
    Edit2: i wonder how he's going to use Octtrees with SDFs...
    Edit3: i knew he was going to mention Shadertoy
    Edit4: dealing with floats is annoying
    Edit5: this is why I gave up on graphics programming...
    Edit6: noice games and noice video!

  • @goldwinstewart6590
    @goldwinstewart6590 7 месяцев назад +1

    WARNING TO VIEWERS: I don’t think the author of this video understands the sparse voxel oct tree concept properly, and that is the reason there is no supercover/DDA algorithm for a sparse grid. You traverse the Oct tree to determine if you have a hit, and contact is already encoded in that data structure. It looks like what happened here is mix up the concepts so there’s grid traversal on an oct tree-like setup. If you understand why SVOs are a powerful technique for ray casting, then one would never make this mistake, and certainly not reintroduce complexity to the algorithm. I recommend reading some paper by Nvidia on the topic. You can find them for free.

  • @jaiv
    @jaiv 3 года назад

    KEEP GOING

  • @albertaillet9117
    @albertaillet9117 7 месяцев назад

    just fyi, the link to the paper seems to be broken

  • @mihailazar2487
    @mihailazar2487 2 года назад

    02:09 Distance Field

  • @airman122469
    @airman122469 Год назад

    CPU instruction calls are substantially cheaper than fetching memory. Be not afraid of more CPU calls if it means reducing the amount of memory accesses you need to do. Obviously, there is a tipping point and you should benchmark, but avoiding a data structure because it requires more instructions is a little silly.

  • @jumbledfox2098
    @jumbledfox2098 3 года назад +2

    Imagine if this voxel engine is so advanced, you cant tell things are made of voxels until you look REALLY closely

  • @closingtheloop2593
    @closingtheloop2593 Год назад

    As a mechanical engineer, I am now a software engineer.

  • @Error-pb6ee
    @Error-pb6ee Год назад

    where is the shader link?

  • @Jkauppa
    @Jkauppa 3 года назад

    plugin algorithms, separate "complex" from "take care"

    • @Jkauppa
      @Jkauppa 3 года назад

      assume you have falling leaves or snow all over the scene, to choose proper optimization/algorithm, the grid is the best in most cases, on average

    • @Jkauppa
      @Jkauppa 3 года назад

      worst case scenario rendering algorithm considerations, best for that case, acceptable for all

    • @Jkauppa
      @Jkauppa 3 года назад

      if you dont care about "second" intersections, then the octree is the best for all cases

  • @xmorse
    @xmorse 3 года назад

    Remember to not over engineer too much