No video

Making voxels MOVE with the separating axis test [Voxel Devlog #11]

  Рет қаралды 15,017

Douglas

Douglas

Күн бұрын

Пікірлер: 85
@GabeRundlett
@GabeRundlett Жыл бұрын
Awesome! I may take some inspiration from the continuous collision detection 😉
@DouglasDwyer
@DouglasDwyer Жыл бұрын
I would positively love to see a solely-GPU physics engine! Many things, like the separating axis test, would lend themselves well to parallelization.
@TheRaticide
@TheRaticide Жыл бұрын
Those transparent voxels look great. I wonder if you could use the pixels of the transparent objects as a mask to distort the solid pixels, allowing you to make a wobbly underwater effect.
@DouglasDwyer
@DouglasDwyer Жыл бұрын
That's a great idea! Because transparency happens in a separate render pass, I should be able to sample from the solid render target. This could allow for screen-space reflections or underwater refraction :)
@Tyradius
@Tyradius 2 ай бұрын
Heat waves too I'd think. 🤔
@Gwilo
@Gwilo Жыл бұрын
Douglas, the progress you've made with these videos is actually really inspiring and your progress makes me proud Please, whatever you're doing to keep yourself motivated, keep it up!
@AlienXtream1
@AlienXtream1 7 ай бұрын
thankyou youtube for this hidden gem! on the note of the transparency, i've not heard of it before but it sounds really useful. im wondering if there may be some extra steps you can do to improve the transparency stuff. depending on performance cost you may be able to achieve a sort of middle ground. using the order independent method as a base and passing in some extra info to account for edge cases. maybe some sort of Z-buffer pass that can be used to get some crude ordering. or if there is enough information to imply order from computationally cheep checks you might be able to use a 3D LUT for RGB values. then you could use something like a ray traced transparency to precompute the LUT and bake that in. that'd also mean you (or someone else) could overwrite it too for some potentially cool effects!
@mark_makes
@mark_makes Жыл бұрын
Very exciting to see more progress! Keep the videos coming! 🙌
@shinobudev
@shinobudev Жыл бұрын
I found success in optimizing my octree raymarcher by reducing the number of octree subdivisions to step into when traversing with a ray by caching the bounding box and index of the octree node you last searched. Given D as the depth of your octree, normally you would: origin -> search D octree subdivisions -> move forward -> search D octree subdivisions -> move forward But you can just: origin -> search D octree subdivisions and save the D/2 box -> move forward -> if still inside the last D/2 box then just start out there and save D/2 depth searches. This way you can additionally set the starting D/2 box as the one the camera is in, calculated in CPU and passing it to the GPU as a uniform. You now guarantee that your rays will save less octree subdivision searches.
@darkengine5931
@darkengine5931 Жыл бұрын
Makes sense to avoid having to start all over again from the root of the tree. Have you tried ray packets by any chance? I'm used to using them for raytracers but never tried for volume ray marchers. It seems a bit tricky to use them combined with your optimization since each ray in the packet might want to resume from a different node in the tree.
@shinobudev
@shinobudev Жыл бұрын
@@darkengine5931 have not but I'll be looking into that now
@jonathandowns282
@jonathandowns282 Жыл бұрын
Great video as always! I've been watching your videos since you started this series, and I use you to inspire myself to work on my own engine. You're doing amazing work, you have the best engine I've seen since John Lin, and I'm really happy to see this engine progress and each of the features get added. I'm glad you're so passionate about this, and I'm glad I found this channel!
@DouglasDwyer
@DouglasDwyer Жыл бұрын
Thanks for your kind words :)
@AIShipped
@AIShipped Жыл бұрын
I spent 2 hours bingeing all your videos so far. Amazing content!
@GreenDave113
@GreenDave113 Жыл бұрын
An absolutely wonderful video. I loved the thinking style and the features as well!
@jsierra88
@jsierra88 Жыл бұрын
Things get harder when you have to rotate them. Otherwise, physics are much easier. Thank you for keeping up updated!
@ttj_
@ttj_ Жыл бұрын
amazing. loved every second of this
@jordanserres-gonzalez9634
@jordanserres-gonzalez9634 Жыл бұрын
Awesome dedication been subscribed since 3rd episode and still love the great work keep it up!
@benrex777productions9
@benrex777productions9 Жыл бұрын
Now I'm up to date. Thank you for your videos.
@bengt-goranpersson5125
@bengt-goranpersson5125 Жыл бұрын
Your work is so inspiring.
@grevel1376
@grevel1376 Жыл бұрын
You are a big inspiration for me.
@hemerythrin
@hemerythrin Жыл бұрын
Interesting that your transparency treats objects as hollow shells (so the intensity of the color only depends on the number of overlapping outer surfaces) rather than as "physically correct" volumes (making the color stronger the more voxels it is deep). Could you tell us why you decided to go that route? Was it better for performance?
@DouglasDwyer
@DouglasDwyer Жыл бұрын
There are two main reasons for this. First and foremost, it was an "artistic choice" to mirror the style of Minecraft transparency. I want to allow people to create thicker glass windows and sculptures, which I fear would appear noisy and majority-opaque if I used volumetric transparency. With the shell approach, users still have the option to create volumetric transparency by layering different materials, which will both appear even on inner surfaces - but by default, it's easy to create thick glass windows. Second, it does help with performance, because there are typically less details to draw :)
@hemerythrin
@hemerythrin Жыл бұрын
@@DouglasDwyer That makes sense. Thanks for the response!
@dominicstocker5144
@dominicstocker5144 Жыл бұрын
Great work! Thanks for the video!
@jarredeagley1748
@jarredeagley1748 Жыл бұрын
Great work! Transparency rendering can be a real pain to get working well. Did you look into other techniques like depth-peeling too?
@DouglasDwyer
@DouglasDwyer Жыл бұрын
Depth-peeling is an intriguing technique, since it allows for exact results without triangle sorting. However, it places a very heavy load on the GPU (requiring multiple extra render passes and textures). As I want to target lower-end GPUs, this fact made me choose against it.
@TheQxY
@TheQxY 11 ай бұрын
Would be cool if you could add some fake scattering effect, so less light passes through thicker layers of blocks, this would also allow for realistic looking water, where the shade gets darker with depth.
@redstonerti9918
@redstonerti9918 Жыл бұрын
Subscription earned.
@ZealanTanner
@ZealanTanner Жыл бұрын
Incredible job. You know there’s something that has both physics and transparency… are you planning to add water to your game?
@christopherbroms2508
@christopherbroms2508 Жыл бұрын
he said that he would
@ZealanTanner
@ZealanTanner Жыл бұрын
@@christopherbroms2508 epic
@NotAFoe
@NotAFoe Жыл бұрын
Soooo impressive!
@-keimurikxe2252
@-keimurikxe2252 Жыл бұрын
I have a few questions. 1. Are you still using Vulkan? 2. What will happen to performance if you decide to increase the number of voxels, for example, by 8 times, meaning that each voxel will turn into 8 new ones?Will this have critical consequences? 3. Have you thought about creating a Discord server?"
@DouglasDwyer
@DouglasDwyer Жыл бұрын
Thanks for watching the video! Let me give you the details: 1. No, I switched to targeting OpenGL about a year ago, in Episode 4. This was because I wanted to make my project usable in a web browser, and playable on a wider variety of hardware. It was a tradeoff for portability that I made for my specific design goals. I still do miss Vulkan and its modern features, though. 2. Performance would definitely decrease. For projects like this, achieving good performance means fine-tuning to one's specific use case. As I've designed my engine to work at the scale shown in the video, I fear that it wouldn't run well with larger quantities of voxels onscreen. That's not to say rendering more voxels is impossible - it would just require more engineering and special use of LODs. Dealing with that much data voxel data has consequences beyond rendering, though - I also need to sync voxel objects over the network and store them in-memory, so it's a delicate balancing act :) 3. I don't have a Discord server - unfortunately, I simply don't have the time and willpower to manage one. However, there's another voxel KZfaq called Gabe Rundlett who's working on some really cool tech. He has a Discord server where myself and a number of other people talk about voxels, so you can reach me there if you'd like!
@thertc204
@thertc204 Жыл бұрын
Impressive.
@-keimurikxe2252
@-keimurikxe2252 Жыл бұрын
Sorry, just a couple more... Are there any alternatives to your engine at the moment? Are there any KZfaqrs or videos that have helped you? I also want to dive into learning what you're doing, but your project is the first thing I saw on the internet that seems to align with my views on this idea. And of course, very useful links like the ones you leave in the description, such as the link to Nick's Blog.
@DouglasDwyer
@DouglasDwyer Жыл бұрын
No problem - I love answering these questions, it's why I make videos! 1. Yes, there are some other people working on voxel engines. One such individual is Gabe Rundlett - definitely check out his channel if you haven't! His voxel engine is open-source, unlike mine. John Lin, Voxelbee, and some other KZfaqrs are developing engines as well. I'm not aware of anything that's been completed, though. That's part of my motivation for working on the engine! 2. While many of the above-mentioned KZfaqrs provide inspiration, I don't have as many resources to provide regarding technical help. Do you have any specific areas of voxel engine design that you'd like to learn? There are so many topics - rendering, networking, audio, storage, and the like - which is part of what makes engine development so fun. If you're interested in rendering voxels, the first place to start is probably learnopengl.com. The website provides a stellar introduction to computer graphics :)
@-keimurikxe2252
@-keimurikxe2252 Жыл бұрын
@@DouglasDwyer I can't believe it, I never expected such a detailed response, thank you so much! You went above and beyond my expectations, and now I'll start exploring the channels and resources you recommended. I already joined the Discord server! I'm absolutely convinced of the success of your project, and I really don't want your idea to die at the stage of creating a game engine, as it happens so often
@nullp0inter
@nullp0inter Жыл бұрын
u deserve more
@user-xd4nb8wm5l
@user-xd4nb8wm5l Жыл бұрын
do you hear of sign distance field ray marching rendering?
@dimitrisgkofas7787
@dimitrisgkofas7787 Жыл бұрын
If you had a ray shooting from your camera and every time that It hitted an object It could pass through or not. If the ray doesn't pass you give at the camera pixel this color. No if it pass It will give to the pixel the value of it multiplied with the coeficient of transparency. Lets say 1 is zero transparency and 0 is full transparency.For exapmle If you have your first object with color red and transparency 0.9 then the number for this ray is for now 229. Now the next object that the ray hits it will add to that number by a factor of (255-229)/255*newcolor*newtransparency and the output color will continue the gerney until it will hit a wall with transparency 1that will set the end for your ray.
@dimitrisgkofas7787
@dimitrisgkofas7787 Жыл бұрын
It may give an nice ray tracing touch!
@shohamtzubery8456
@shohamtzubery8456 Жыл бұрын
The transparency is great but I feel like something is missing. Usually for transparent objects, the thicker the object is the less transparent it becomes. This effect is most commonly used to makes it harder to see the ocean floor the deeper the water is. Would something like this be possible to implement with your transparency solution?
@DouglasDwyer
@DouglasDwyer Жыл бұрын
Thanks for the question! Another commenter asked something similar, about why I chose to make transparency be "hollow." This was my response: First and foremost, it was an "artistic choice" to mirror the style of Minecraft transparency. I want to allow people to create thicker glass windows and sculptures, which I fear would appear noisy and majority-opaque if I used volumetric transparency. With the shell approach, users still have the option to create volumetric transparency by layering different materials, which will both appear even on inner surfaces - but by default, it's easy to create thick glass windows. Second, it does help with performance, because there are typically less details to draw :) Regarding whether it would be possible, it probably would take some additional work. I wouldn't implement it for normal voxels, for the reasons above. But I would like that kind of effect for water!
@augustvctjuh8423
@augustvctjuh8423 Жыл бұрын
Very interesting. Btw I think you might be confusing the pronunciation of axis (not plural) and axes (plural)
@wirththewait144
@wirththewait144 Жыл бұрын
you should add a water system like john lins sandbox
@brunowallner1670
@brunowallner1670 Жыл бұрын
Can you explain how you implemented the per-voxel lighting?
@DouglasDwyer
@DouglasDwyer Жыл бұрын
Sure! The lighting is a standard shadowmap, as described on learnopengl.com/. To make the lighting appear per-voxel rather than per-pixel, I just round the position at which I sample the shadowmap to the nearest voxel.
@brunowallner1670
@brunowallner1670 Жыл бұрын
Ah i see, I want everything to be per voxel including reflections, but I cannot get any good working method.
@chucksneedmoreland
@chucksneedmoreland Жыл бұрын
@@DouglasDwyer real smart, utilizing what gpus accel at (rasterization) and combining that with existing techniques with a twist
@NikZapp
@NikZapp Жыл бұрын
The progress is amazing, however I strongly disagree about the way transparency looks. In my opinion it really looks vastly different, but since the transparency you used isn't volumetric in the first place I shouldn't compare it like its physically accurate.
@user-tm1iq6il7i
@user-tm1iq6il7i Жыл бұрын
exelent work
@Nolanyoyo
@Nolanyoyo Жыл бұрын
Iv tried to do voxel, witch i had multiplayer working, but at some point something started causing lag and I don't have a back up of it before it started happening without going way to far back. I used unity since it would do shadows and a lot of other effects (I add lighting to the blocks with vertex color and add shadows ontop of that). Do you think unity is bad for voxel? I dont know what alternative I could use, I dont really want to learn a new game engine(or new language).
@DouglasDwyer
@DouglasDwyer Жыл бұрын
I think that it depends upon your goals! If you're looking to make a game with a voxel art style (or even a game with editable, Minecraft-style terrain) then Unity is an excellent choice. Its batteries-included engine makes it easy to develop gameplay and other fun concepts. This is at the expense of flexibility, though - if you're looking to create a highly-detailed voxel environment (like myself or some other KZfaqrs), then it's probably necessary to build your own engine. However, that takes a great deal of time and dedication, and it's a lot harder to make a feature-complete game. So choose whatever best fits your aspirations :)
@Nolanyoyo
@Nolanyoyo Жыл бұрын
@@DouglasDwyer Thanks, ya unity definitely struggles when you make the voxels smaller then minecraft
@bluesillybeard
@bluesillybeard Жыл бұрын
Unity allows you to create custom meshes, so you can probably use a greedy-meshing algorithm to speed things up.
@Nolanyoyo
@Nolanyoyo Жыл бұрын
@@bluesillybeard i just dont think i would have the time to learn greedy meshes and deal with all the bugs from it
@banditbloodwyndevs8782
@banditbloodwyndevs8782 Жыл бұрын
I hope it wasn't asked or shown before: What graphics API do you use? OpenGL? DirectX? Vulkan? I'm asking because maybe I will try to write my own engine just for fun and I'm looking for some examples how others tackle this.
@DouglasDwyer
@DouglasDwyer Жыл бұрын
I target OpenGL and WebGL 2.0 so that my engine can run in a web browser. However, I am hoping to switch to WebGPU soon - it is a more modern and ergonomic API that will soon be a browser standard.
@banditbloodwyndevs8782
@banditbloodwyndevs8782 Жыл бұрын
​@@DouglasDwyer and the CPU code is Rust as far as I can see :) So you have some experience in writing a rendering engine. What would you say if someone (not me haha) wanted to write his engine in C#? Notice that he tries to make everything manually disposable (via the IDisposable interface), so he can avoid the automatic garbage collection, which can cause stuttering) as good as possible.
@DouglasDwyer
@DouglasDwyer Жыл бұрын
@@banditbloodwyndevs8782 I think C# is a fine choice - in fact, my engine started out in C# (see devlogs 1-3). You'll never be able to achieve the performance of a native language, unfortunately - in my testing, I've found that Rust and C++ are about twice as fast. This, coupled with the fact that C# doesn't run well on the web, was why I switched to Rust. That being said, C# is a great backend language and very good for writing business logic. So if your primary goal is to create a scalable application with many features, C# should be fine. For any heavy calculations, though, you might need to offload to native code or the GPU. Regarding optimizations, I think the biggest thing is avoiding heap allocations entirely. So your primary goal should be to use structs, not classes, wherever possible. If I recall, you can implement interfaces on structs - so using IDisposable with structs might be a powerful idiom. But C# is not at the point of being as fast as a native language.
@banditbloodwyndevs8782
@banditbloodwyndevs8782 Жыл бұрын
@@DouglasDwyer good points. So one last question: In C# we have projects to organize large solutions. Let's say I switch to C++. There we don't have projects. Do you know an easy and elegant way to organize the code in a similar way beside of simple namespaces?
@DouglasDwyer
@DouglasDwyer Жыл бұрын
Depending upon your build system, you can still have separate projects with dependencies - I believe that MSVC allows for this, at least. That said, C++ build systems are a nightmare, and I would recommend against them for productivity's sake. Much better to use Rust and its package manager Cargo - which allow you to easily separate your workspace (solution) into multiple crates (projects).
@Alexey_Pe
@Alexey_Pe Жыл бұрын
Do you have liquid in your plans? Water?
@DouglasDwyer
@DouglasDwyer Жыл бұрын
I would love to have fluids in the game at some point. However, I have some other priorities - such as rigidbody physics, multiplayer, and gameplay - on which I want to focus first.
@spr_
@spr_ Жыл бұрын
have you considered implementing something similar to "cubic chunks" mod from minecraft? i feel like it could improve performance with more detailed worlds but im no dev (and possibly allow for faster and more view distance)
@DouglasDwyer
@DouglasDwyer Жыл бұрын
Yes - in fact, chunks are positioned in a 3D coordinate system already! There's no build height limit.
@geko2867
@geko2867 Жыл бұрын
Your project look's very cool! But I'd love to know if you're ever going to invest in a better mic, it may help keep people's attention ^^
@DouglasDwyer
@DouglasDwyer Жыл бұрын
Hey, thanks for watching! I appreciate your honest feedback. If I could ask, what exactly is bothersome to you about the mic? Granted, it definitely sounds bad in my earlier episodes. In the latest few, though, I've managed to eliminate noticeable artifacts like clipping. Truly, it sounds fine to me. What should I improve?
@geko2867
@geko2867 Жыл бұрын
@@DouglasDwyer Your audio seems a little echoey, and a bit distant. I'm going to assume it's a standalone mic and not inside a phone or laptop. If you want to make the most of your mic, first you'll want to stay within 2 feet of it. Next, you'll want to prevent your voice from bouncing around the room, the best way is to have something soft like a blanket surround your setup. This is why some people record in a closet with lots of cloth in there. You can also try comparing your audio to a clip of someone testing their studio quality mic and see how close you can match theirs. I hope any of this can result in some improvement, but your audio has gotten better recently, but your current audio quality doesn't subtract from the videos or your project! Good luck ^^
@Nazo224
@Nazo224 Жыл бұрын
How small can voxels be?
@DouglasDwyer
@DouglasDwyer Жыл бұрын
Right now, I'm aiming for the scale that Minecraft *would have* if every single voxel were editable. This would mean a scale of 16-20 voxels per meter, since in Minecraft there are 16^3 voxels per block :)
@stablemind
@stablemind Жыл бұрын
nice
@alessioolivieri5460
@alessioolivieri5460 Жыл бұрын
Is this project public?
@DouglasDwyer
@DouglasDwyer Жыл бұрын
While there is a public demo, the project isn't open-source at present. I'm still working on refining the technology and turning it into a playable game :)
@UnofficialFoneE
@UnofficialFoneE Жыл бұрын
Noice
@djaccount5458
@djaccount5458 Жыл бұрын
Hello, is not true voxels? Its look like 3d cubes not voxels.
@aspidinton
@aspidinton Жыл бұрын
not baaad
@oliverreader2954
@oliverreader2954 7 ай бұрын
Light theme? You make me sick!
@dandymcgee
@dandymcgee Жыл бұрын
Your videos have so much potential, but your audio setup is holding you back. If you want more viewers, stop recording videos with a cheap mic in a hella echoey room. It would make your channel blow up so fast.
@st20332
@st20332 7 ай бұрын
i personally don't mind, im here for the info, and its not distractingly bad
@UltimatePerfection
@UltimatePerfection 7 ай бұрын
Your voxels are too big. Less Minecraft, more John Lin, please.
@vinay0arts
@vinay0arts Жыл бұрын
Amazing work sir, I am a voxealrtist and feel free to contact me if you need any help with models
OPTIMIZING my physics engine [Voxel Devlog #13]
9:30
Douglas
Рет қаралды 25 М.
Кадр сыртындағы қызықтар | Келінжан
00:16
Can This Bubble Save My Life? 😱
00:55
Topper Guild
Рет қаралды 85 МЛН
Zombie Boy Saved My Life 💚
00:29
Alan Chikin Chow
Рет қаралды 27 МЛН
Making a Voxel Engine from SCRATCH (w/ Destruction)
14:31
MaxMakesGames
Рет қаралды 33 М.
Developer Log #0.5 - Infix voxel engine
5:39
capslpop
Рет қаралды 3,2 М.
Emissive voxels and fancy lighting [Voxel Devlog #19]
13:08
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,5 МЛН
Voxel Doom Tested: id Software Classic Gets A Voxelised 3D Upgrade!
11:44
The Formula for Replayable Games
18:44
Blargis
Рет қаралды 253 М.
What has changed in my Voxel Engine? | Voxels Weekend update #18
9:32
I Made a Voxel Engine
10:33
Zyger
Рет қаралды 49 М.
Кадр сыртындағы қызықтар | Келінжан
00:16