![Ozown](/img/default-banner.jpg)
- Видео 2
- Просмотров 44 523
Ozown
Добавлен 27 окт 2021
Learning for the fun of it
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...
svo... 💀 проклятое слово... 💀
I hope its available on mobile
Not well made enough for that 😅
Please share it
this has been criminally forgotten.
Thanks, appreciate that!
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 👍
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.
@@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 :')
Kd-Tree are better 😎
Maybe 😔✊
СВО ))
True...?
@@Ozown nevermind, it is a local meme
Лол
@@Ozown svo is how russians call their invasion to ukraine. extremely funny joke huh?
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.
Thank you!
Man, really cool video! How do you create the animations and the voiceover? Is the source code for the animations open source?
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!
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?
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!
Where are you rushing so much?... You vocal ability is not capable of pronouncing words properly at such speeds.
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!
@@Ozown I really thought I had it set to 1.5. Honestly, you gotta try rapping.
🇳🇴🇳🇴
ʸᵉˢʸᵉˢ
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.
That sounds interesting, I will give it a shot, thanks!
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
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!
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.
Yet we may not engage. For Ic am creating we may.
No clue what you are saying but agree
@@Ozown <3
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?
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!
Thank you for your super quick response! I will try my best to find an answer.
That struct packing though, cringe!
It be like that😔
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?
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.
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?
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.
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
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!
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
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!
"if you've been around the voxel dev SPHERE", pun chance missed
wasted potential 😞
Try Rust with the Bevy Engine!
Never given Rust a proper shot but I am interested. What do you like about that ecosystem? Thanks for watching!
@@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!
voxel is pixel in 3d
True!
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 :)
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!
Bools in structs?
Yeah, to keep track of the status of a node!
nice, thanks ! but how to traverse the octree ?
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
@@Ozown this is hard
@@sedenion9524 Unfortunately yeah, however I do intend on making a video on this so that might help out
Another storage optimization you could take is to only store the outer "shell" of the voxel object, and generate inner voxels as needed.
Yep, I also did that for my project!
@@OzownYou still track whether a node is inside or not?
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!
Thanks, I'm happy that you enjoyed!
AO was the most annoying part for me also. And theres always paranoia that something might be wrong with it.
100% - It took me countless times before it at least looked like nothing was wrong
Your theme looks nice, which theme do you use?
I use the monochrome theme, hope that helps!
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.
That is the style I like so I tried to replicate it in my own videos. Glad that you enjoyed!
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.
That sounds interesting actually, might take you up on that offer!
subscribed holy shit
also you got on my recommended so it seems your effort on this may be paying off
Thanks! happy that you liked it!
Love this video. Was looking for this. To the point, crystal clear, excellent work.
Glad you enjoyed it!
Very nice!
Thanks!
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!
Wow, thanks! Glad that you enjoyed it!
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!
Thanks, that means a lot! I am new to this and still trying to figure things out.
Nice video! Never new about the difference between the two algorithms. Nice animations, but the explenations are a bit fast.
Thanks! I realized in post how fast the video went 😅 I will keep that in mind for the next!
First time I’ve ever set playback to 0.75x 😂
Fantastic explanation though
65th sub desevre a more than 10,000 subs
Thanks 🙏 Glad that you enjoyed it!
oh
its crazy you have under 100 subs i hope your vid pushes through the algorithm good job man keep it up
Thanks man, appericate it a lot!
do u watched tutorials for getting logic like blocks should be active snd and other stuff u r telling?
I used a lot of different resources, most being written. I have them all in the description if you are interested!
@@Ozown thank you so much
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?
Still working on how to format the videos. In total it took me around a year but I quit working on it multiple times.
Dude, this clone is amazing! I'm waiting for your next projects cuz that's a great first video
Thanks a ton!
So few subs? Have another one!
Thanks for the sub!