Ozown
Ozown
  • Видео 2
  • Просмотров 44 523
Sparse Voxel Octrees
In this video I will give a quick overview of what a sparse voxel octree is. This is a concept that is brought up a lot in voxel development and I wanted to shed some light on it.
Просмотров: 39 564

Видео

Creating Minecraft From Scratch (No Engine)
Просмотров 5 тыс.Год назад
In this video I create a minecraft clone from scratch using C and OpenGL. These are the resources I used to learn how to make this: For learning python (Skip this if you already know a programming language): automatetheboringstuff.com/ www.py4e.com/lessons For learning C : ruclips.net/video/BySDfVNljG8/видео.html ruclips.net/p/PLlrATfBNZ98dudnM48yfGUldqGD0S4FFb For OpenGL: learnopengl.com/ rucl...

Комментарии

  • @user-ruraruparu
    @user-ruraruparu 16 дней назад

    svo... 💀 проклятое слово... 💀

  • @user-mf9jo7tj6g
    @user-mf9jo7tj6g Месяц назад

    I hope its available on mobile

    • @Ozown
      @Ozown Месяц назад

      Not well made enough for that 😅

  • @user-mf9jo7tj6g
    @user-mf9jo7tj6g Месяц назад

    Please share it

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

    this has been criminally forgotten.

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

      Thanks, appreciate that!

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

    Nice, this video inspires me to make my own voxel engine, but I'm too dumb and too tired in life to attempt such a task. However it's good to know the concepts. Helps you understand how it works. Thanks 👍

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

      Really happy that the video could help! I would also like to add that I am definitely not qualified either, I was just really interested in the topic so I pushed through the difficulty.

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

      ​@@Ozown I think for everybody they start off feeling not qualified, and then one day you're trying to optimize memory or something similar in your voxel engine and you realize you've just invented some new efficient algorithm :')

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

    Kd-Tree are better 😎

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

      Maybe 😔✊

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

    СВО ))

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

      True...?

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

      @@Ozown nevermind, it is a local meme

    • @user-kw9cu
      @user-kw9cu 2 месяца назад

      Лол

    • @rozt107
      @rozt107 Месяц назад

      @@Ozown svo is how russians call their invasion to ukraine. extremely funny joke huh?

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

    An excellent video! Short and full of all the information one may need while looking for the solution! Especially liked the end when you said what it isn't good for.

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

      Thank you!

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

    Man, really cool video! How do you create the animations and the voiceover? Is the source code for the animations open source?

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

      For the animation I use 3b1b's math animation library. Here is the GitHub link: github.com/3b1b/manim. For the voice I use a blue yeti as the microphone and audacity as the software. Hope that helps!

  • @korigamik
    @korigamik 5 месяцев назад

    Broo! I really like this video. Can you dhare the source code you used to create the animations? Can you tell us what tools you used to create this video as well?

    • @Ozown
      @Ozown 5 месяцев назад

      Here is the code for the final project: github.com/OzownYT/SVO-Raycaster.git Although I do warn you that it isn't well written. Hope that helps!

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

    Where are you rushing so much?... You vocal ability is not capable of pronouncing words properly at such speeds.

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

      I watch all RUclips videos on 1.5x speed, so I naturally gravitated towards it. I usually talk fast in real life too but English isn't my native language so not used to speaking it. Will most likely get better with time though. I do appreciate the feedback though, I will try to speak in a more comfortable speed for the next one!

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

      @@Ozown I really thought I had it set to 1.5. Honestly, you gotta try rapping.

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

    🇳🇴🇳🇴

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

      ʸᵉˢʸᵉˢ

  • @joeldavis8444
    @joeldavis8444 8 месяцев назад

    Nice video! The next step is "brickmaps" where you store a small, dense voxel grid at each leaf instead of a single voxels, such as 8x8x8 or 32x32x32. Since surface details tend to exist around the same boundary, this can get you a lot more detail without as much overhead from the tree structure.

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

      That sounds interesting, I will give it a shot, thanks!

  • @GeorgiKrastevMusic
    @GeorgiKrastevMusic 8 месяцев назад

    Damn. Wish one day we'd have advanced our hardware to the point where you can make a game with a high-resolution grid without octrees

    • @Ozown
      @Ozown 8 месяцев назад

      Yeah it would be really cool. The project that motivated me to try out voxels was john lin's. Seems like games made with voxels would be really interesting!

  • @opliik
    @opliik 8 месяцев назад

    Minor clarification: SVO's work pretty well for collision detection, but it depends what exactly you need. Checking a point is a tree simple traversal. There are algorithms to do efficient ray traversal in an SVO such that you walk the leaf nodes while sweeping the ray. The algorithm is not simple, but it is doable. I suspect you can sweep a box efficiently as well, but I've not done it myself.

  • @aleksitjvladica.
    @aleksitjvladica. 9 месяцев назад

    Yet we may not engage. For Ic am creating we may.

    • @Ozown
      @Ozown 9 месяцев назад

      No clue what you are saying but agree

    • @aleksitjvladica.
      @aleksitjvladica. 9 месяцев назад

      @@Ozown <3

  • @makyuri154
    @makyuri154 9 месяцев назад

    I thought about exactly this without knowing it is an existing technique. The only thing I am curious about is how we should check if a node is intersecting with a mesh. Do we just do a collision check with the node against the mesh you want to base this SVO of? I am using UE5 where they have a box collision check, but it requires a lot of variables to be set for each operation, which seems expensive if we have to do it for each node. I don't know what software you are using but how would you go and do this check in a performant way?

    • @Ozown
      @Ozown 9 месяцев назад

      That's really cool that you came up with it on your own! For the collision checks - to be honest I did it the sub optimal way of just checking against the mesh. The process of making a mesh into a SVO is called voxelization and it is whole complex topic on its own - if you search "mesh voxelization" you will find many different approaches to the problem. Hope that helps!

    • @makyuri154
      @makyuri154 9 месяцев назад

      Thank you for your super quick response! I will try my best to find an answer.

  • @josiahjack455
    @josiahjack455 9 месяцев назад

    That struct packing though, cringe!

    • @Ozown
      @Ozown 9 месяцев назад

      It be like that😔

  • @Enter_channel_name
    @Enter_channel_name 10 месяцев назад

    I didn't understand the part about not always dividing into 8 octants. By definition, doesn't an octree node always have either exactly 0 or exactly 8 children?

    • @Ozown
      @Ozown 10 месяцев назад

      You are correct in the fact that there is always 8 children. Every node technically has 8 children because you still keep track of the octants that does not exist. However those octants without points in them do not have any memory allocated for them.

  • @tadeohepperle7514
    @tadeohepperle7514 11 месяцев назад

    I have a question: Where are all these nodes allocated in memory? Are all the child nodes heap allocated in different places somewhere? Or do we do one big arena allocation upfront that has enough space for the entire oct-tree if it was completely filled with voxels?

    • @Ozown
      @Ozown 11 месяцев назад

      I went with a dynamic array route. Everything is stored in a 32 bit int vector where different bits represent different parts of the node data. For example the first 8 bits represent the 8 different children nodes and whether they exist or not. I did however start with dynamically allocating everything in the heap and then changed it over to a dynamic array after getting that to work.

  • @harrytsang1501
    @harrytsang1501 11 месяцев назад

    So basically the 3D version of how maps are stored first you assume the map is flat, divide into 4 quadrants until each quadrants has less than n number of points of interests or details in the sector

    • @Ozown
      @Ozown 11 месяцев назад

      Close but a bit different if I am not mistaken on the data-structure you are describing. An Octree has a fixed depth, which means that how many subdivisions that will be done is decided before hand. The information is only stored at the lowest depth. Hope that helps and thanks for watching!

  • @Furkan-ll4gy
    @Furkan-ll4gy 11 месяцев назад

    Great video I really liked your explanation but I can't figure out how to render them. You cant just use dda on them also gpu s usually dont like branching and complex code how can this be more optimized

    • @Ozown
      @Ozown 11 месяцев назад

      Ngl it is kinda complicated. I did something based on the research paper "Efficient Sparse Voxel Octrees - Analysis, Extensions, and Implementation" by NVIDIA. Basically you shoot a ray onto the SVO in the GPU and based on ray - box intersection you go down the tree in correct order. This website explains the collision well: www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-box-intersection.html Here is the github repo if you want to look at it: github.com/OzownYT/SVO-Raycaster.git Hope that helps!

  • @mochou-p
    @mochou-p 11 месяцев назад

    "if you've been around the voxel dev SPHERE", pun chance missed

    • @Ozown
      @Ozown 11 месяцев назад

      wasted potential 😞

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

    Try Rust with the Bevy Engine!

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

      Never given Rust a proper shot but I am interested. What do you like about that ecosystem? Thanks for watching!

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

      @@Ozown I like how Rust has a really easy to use package management system for dependencies, I like how it is one simple command to compile it with no weird flags (cargo build --release), it is memory safe, so no memory leaks. It has the best syntax I have ever used! Bevy has game engine features like PBR, but still is programmed in raw code with no GUI. Rust has actually helpful error messages! Like the language literally tells you how to fix your code!

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

    voxel is pixel in 3d

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

      True!

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

    Nice video! Is the code you displayed in the video available anywhere online? I'm working on my own SVO implementation and having that would be very helpful :)

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

      Hi, wasn't posted anywhere but I've made it available here: github.com/OzownYT/SVO-Raycaster.git Although I do warn you, it is messy. Hope it helps!

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

    Bools in structs?

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

      Yeah, to keep track of the status of a node!

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

    nice, thanks ! but how to traverse the octree ?

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

      It depends, if you want to traverse it normally you can go down the tree as usual by calling a traversal function recursively on exisiting children. For traversing it with raycasting which is what you usually do for rendering it is a lot more complicated. For the raycasting traversal I used this paper: research.nvidia.com/sites/default/files/pubs/2010-02_Efficient-Sparse-Voxel/laine2010tr1_paper.pdf

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

      @@Ozown this is hard

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

      @@sedenion9524 Unfortunately yeah, however I do intend on making a video on this so that might help out

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

    Another storage optimization you could take is to only store the outer "shell" of the voxel object, and generate inner voxels as needed.

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

      Yep, I also did that for my project!

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

      ​@@OzownYou still track whether a node is inside or not?

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

    Very nice work. The animations are very smooth and the explanations are very clean. Some people would take 20 minutes to explain the concept so this is amazing!

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

      Thanks, I'm happy that you enjoyed!

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

    AO was the most annoying part for me also. And theres always paranoia that something might be wrong with it.

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

      100% - It took me countless times before it at least looked like nothing was wrong

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

    Your theme looks nice, which theme do you use?

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

      I use the monochrome theme, hope that helps!

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

    Great video Ozown! I wish this explanation style was more common. Since childhood I always felt my mind had a fast CPU but limited RAM, so I prefer _fast & repetitive_ over _slow & elaborate._ Alas, all school systems adhere to the latter, which never worked for me.

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

      That is the style I like so I tried to replicate it in my own videos. Glad that you enjoyed!

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

    Ayo, you should make a light propagation system using flood fill in your Minecraft Clone and make a video about it haha. Been trying to implement lighting system in my own clone but I can't make a proper flood fill system for lighting, tried my best.

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

      That sounds interesting actually, might take you up on that offer!

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

    subscribed holy shit

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

      also you got on my recommended so it seems your effort on this may be paying off

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

      Thanks! happy that you liked it!

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

    Love this video. Was looking for this. To the point, crystal clear, excellent work.

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

      Glad you enjoyed it!

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

    Very nice!

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

      Thanks!

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

    Great video! Good quality, good explanation, good stuff :) It's probably going to blow up with a few thousand views in the following days and you deserve it!

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

      Wow, thanks! Glad that you enjoyed it!

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

    Duude this is great! - No 2 minutes long intro - No 2 minutes long outro - Gets straight to the point - Explains code clearly and concisely - Great visuals + animation - Not too fast - Not too slow Love it! Keep it up!

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

      Thanks, that means a lot! I am new to this and still trying to figure things out.

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

    Nice video! Never new about the difference between the two algorithms. Nice animations, but the explenations are a bit fast.

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

      Thanks! I realized in post how fast the video went 😅 I will keep that in mind for the next!

    • @ConfusedNDazed
      @ConfusedNDazed 11 месяцев назад

      First time I’ve ever set playback to 0.75x 😂

    • @ConfusedNDazed
      @ConfusedNDazed 11 месяцев назад

      Fantastic explanation though

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

    65th sub desevre a more than 10,000 subs

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

      Thanks 🙏 Glad that you enjoyed it!

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

    oh

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

    its crazy you have under 100 subs i hope your vid pushes through the algorithm good job man keep it up

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

      Thanks man, appericate it a lot!

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

    do u watched tutorials for getting logic like blocks should be active snd and other stuff u r telling?

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

      I used a lot of different resources, most being written. I have them all in the description if you are interested!

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

      @@Ozown thank you so much

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

    I thought you were going to tell me the plan and show me the footage Even tho this is not what I expected, very good Btw how long did it take?

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

      Still working on how to format the videos. In total it took me around a year but I quit working on it multiple times.

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

    Dude, this clone is amazing! I'm waiting for your next projects cuz that's a great first video

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

      Thanks a ton!

  • @BM-if3lc
    @BM-if3lc Год назад

    So few subs? Have another one!

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

      Thanks for the sub!