Adding ray tracing (back) to my game engine [Voxel Devlog #17]

  Переглядів 71,821

Douglas

Douglas

День тому

Online demo: github.com/DouglasDwyer/octo-...
Additional voxel models: drive.google.com/drive/folder...
It's time for another devlog, and the engine has undergone a ground-up rewrite! In this video, I showcase the new ray marched graphics. I discuss the drawbacks of rasterization and the importance of two attributes in voxel engines: per-voxel colors and per-voxel normals. Then, I explain the performance improvements in this iteration of the engine over my initial attempts two years ago.
Music used in the video:
Karl Casey @ White Bat Audio - The Saga
Chris Doerksen - Chase
Karl Casey @ White Bat Audio - End Credits

КОМЕНТАРІ: 401
@DouglasDwyer
@DouglasDwyer Місяць тому
Want to learn how to write powerful, high-performance code? Then be sure to check out CodeCrafters using the link below, and help support my channel: app.codecrafters.io/join?via=DouglasDwyer They have one project which is completely free to complete during their beta, and you can begin any of their projects for free! Get 40% off if you upgrade to a paid account within three days.
@eszdman
@eszdman Місяць тому
Great video, please try using frame interpolation based on ground-truth motion maps generated by GPU and then apply this map to previous frame multiple times
@timmygilbert4102
@timmygilbert4102 Місяць тому
Bro I made that tetrahexaconta tree joke before 😢 no credit 😂 joke aside, you are wrong about rasterisation vs marching, use a GBuffer to resolve the lighting, independent of the rendering type. Also light probe might help as a light cache, which would open gather as scatter global illumination. Look at hddgi too, you basically have the structure to do it by default. You can also have nlogn ray update with hierarchical segment tracing cache in hierarchical lightprobe.
@jktech2117
@jktech2117 Місяць тому
bro why dont u make voxels that represent vertices instead of cubes? u will have less faces for a smoother look. but u might need to instead of doing culling u need to decide the shape of the voxel based on its neighbours, so depending on the situation if it cant be a vertex it will be like a lowpoly sphere if theres no neighbours, or something like this ynow? edit: this is exactly my plan for my game called pretend, but rn im working on more basic projects on irrlicht to get used to it and then progress using only irrlicht (since its faster and more compatible than godot)
@ArthurWolf
@ArthurWolf Місяць тому
I had a dream. That every one of the "I made a voxel engine" youtubers came together to code an open-source voxel engine and put it on github under an open-source license, and it was so awesome and slick and efficient that the open-source community came together and rebuilt minecraft and hundreds of other games/mods on top of it. Then I woke up and I had to go to work :( Great video.
@DouglasDwyer
@DouglasDwyer Місяць тому
Sometimes I do wish that I could team up with another voxel UKpostsr or two. We would be able to accomplish more, faster, than by working on our own.
@NerferCo
@NerferCo Місяць тому
The Smoothieboard guy?? This is not a crossover I was expecting lol :)
@ArthurWolf
@ArthurWolf Місяць тому
@@NerferCoAHAHA First time in 10 years I'm "recognized in public" :) I'm famous \o/ Did you use the board? We're working hard on v2, we'll be done shipping the kickstarter boards soon, I promise !
@ArthurWolf
@ArthurWolf Місяць тому
@@DouglasDwyerMaybe ask? In my experience, that works much more often than people expect.
@timmygilbert4102
@timmygilbert4102 Місяць тому
Given how they influence each other, by taking inspiration, that's working together in my book... Also I literally invented as a joke the word tetracontahexaconta for 1bit voxel, and guess who took large inspiration from it because I commented it? 😂 I know the literature on the subject, nobody else use that word, well now it's enshrined in his engine 😂
@boyinjuly1
@boyinjuly1 Місяць тому
This small niche of voxel engine ytubers is so comfy
@DouglasDwyer
@DouglasDwyer Місяць тому
We've become a remarkable little community, haven't we? :)
@80sVectorz
@80sVectorz Місяць тому
Not only have you gotten better on the technical side of things, but you have also improved a lot in video quality! Keep going man, love your stuff!
@prltqdf9
@prltqdf9 Місяць тому
I wanted to make a comment like this but you already stole the show.
@st20332
@st20332 Місяць тому
ok​@@prltqdf9
@plokki456
@plokki456 Місяць тому
The data structure you're describing is called an N^3-tree which generalize octrees. Since you use a branching factor of 4, that would be a 4^3 tree. As you noted, it's possible to efficiently traverse this structure thanks to the bitmask trick. A very efficient algorithm for traversal is called hierarchical DDA (digital differential analyser), which is more commonly used for dense voxel grids but can also be applied in a hierarchical fashion on each level. Note that you may use a different branching factor on each level in order to reduce the depth of the structure while still retaining good sparsity. There is a paper describing all of this called "VDB: High-Resolution Sparse Volumes with Dynamic Topology" in case you need a reference. In my own work, I use a 3 level hierarchy where the first level is dense and the following two use a branching factor of 4. Hope this helps :)
@GabeRundlett
@GabeRundlett Місяць тому
THC Tree 😅. I've heard it referred to before as a 64-tree
@punchster289
@punchster289 Місяць тому
what about kd quaternary tree?
@cvabds
@cvabds Місяць тому
​@@punchster289what about CBD tree?
@punchster289
@punchster289 Місяць тому
@@cvabds yes i like that one
@goobus_floobus
@goobus_floobus Місяць тому
THC Tree is definitely sticking for me 🤣
@frozein
@frozein Місяць тому
Welcome back to raytracing! I’m really excited to see where you take this engine.
@DouglasDwyer
@DouglasDwyer Місяць тому
Thanks frozein! It seems like all of our engines are headed in that direction, huh?
@frozein
@frozein Місяць тому
@@DouglasDwyer Yeah there's been some amazing progress from everyone lately!
@TobiG4mer
@TobiG4mer Місяць тому
DUDE! 10:49 This reminds me of the old "Ace of Spades" game. Basically a voxel fps that could run on anything when I was a kid. I would love a sandbox game or anything really in a retro style like this! Keep going I got really excited while watching this video :D
@stevy2
@stevy2 Місяць тому
That game was so good.
@bigblackchode9628
@bigblackchode9628 Місяць тому
fun fact! to this day it is still playable and quite enjoyable. The 2 most used client implementations are OpenSpades and BetterSpades, the server list can be found on the build&shoot website
@thephoenixsystem6765
@thephoenixsystem6765 20 днів тому
I was so sad when it died
@bobby_tablez
@bobby_tablez Місяць тому
The low-res style is sick! I think it would suit a horror game very well.
@Stormmblade
@Stormmblade Місяць тому
It's got an interesting charm to it, like an old retro game except 3D and using voxels
@dmaz123
@dmaz123 Місяць тому
GPU memory isn't slow, it's way way faster than standard system memory. GPUs aren't designed though to be programmed like CPUs you need to take into account the architectural differences and leverage the GPUs huge advantages when designing memory structures to be run on them.
@RJiiFin
@RJiiFin 22 дні тому
This so much.
@eugenevarbanets3898
@eugenevarbanets3898 Місяць тому
Lower resolution looks perfectly fine. imo it will create better result if used well
@TheDroidsb
@TheDroidsb Місяць тому
Holy crap that church looked amazing
@goobus_floobus
@goobus_floobus Місяць тому
baked voxel lighting looks awesome - you can see it in Ethan Gore's demo too
@TheDroidsb
@TheDroidsb Місяць тому
@@goobus_floobus yea I follow him as well 😂
@goobus_floobus
@goobus_floobus Місяць тому
@@TheDroidsb Every time I see the scale of the world in his demo my brain explodes 😂
@vitulus_
@vitulus_ Місяць тому
Awesome! It's incredible that you had the motivation to re-write all of that.
@GabeRundlett
@GabeRundlett Місяць тому
Lets go!
@TheBestNameEverMade
@TheBestNameEverMade Місяць тому
Also known as a multi-layer grid, I have used these a lot. You can actually make it a little more efficient memory wise for spatially by hashing multiple values in the same nodes. The first low resolution grid is sometimes also called a bloom filter. You can use a processor's vector instructions like SIMD, openvc or cuda to skip many empty bits at once.
@xima1
@xima1 Місяць тому
Amazing progress, I love your devlogs! :)
@DouglasDwyer
@DouglasDwyer Місяць тому
Thanks for watching, Xima! Your engine is very inspiring. I'm excited to see where we can take web-based voxel graphics now that WebGPU is maturing.
@ZYZZinVR
@ZYZZinVR 2 дні тому
just started my data structure/algorithms course and seeing why the efficiency can be so important even on personal projects is motivating
@dannyhallo195
@dannyhallo195 Місяць тому
Well DonE! I absolutely love the new vid style! Please keep up your good work!
@EqualToBen
@EqualToBen Місяць тому
Loved the video! also thanks for linking Gabe's channel that one's new to me
@harriehausenman8623
@harriehausenman8623 21 день тому
Really beautiful! And the performance is insane 😲
@Caylonix
@Caylonix Місяць тому
I think it is amazing what you were able to achieve with the surface normals. Not using polygons frees you of building the chunks with this geometry to render the voxels. Nice idea, really amazing !
@MyKaosLife
@MyKaosLife 11 днів тому
Love this! I saw some other comments on further ways to optimize traversal & memory usage, but from now on the common term for the 4^3-tree models should obviously be the THC-tree model 😄
@cblair1353
@cblair1353 Місяць тому
The low resolution has a really cool old-school feeling to it; you should play around with a CRT post-processing pass, could look awesome with the right resolution settings!
@vast634
@vast634 Місяць тому
I tried the demo, I was quicker than expected. Good work.
@capslpop
@capslpop Місяць тому
That church looks oddly familiar 🤔
@DouglasDwyer
@DouglasDwyer Місяць тому
Hey capslpop! Nice to see you here - I've actually been watching your channel since your first uploads two years ago. The Church of St. Sophia really is a nice test model, isn't it? Your channel was the first place that I saw it :)
@capslpop
@capslpop Місяць тому
Thanks for watching! Can't wait to see what you do in your next video :)!
@RiverReeves23
@RiverReeves23 28 днів тому
I've always loved voxels, since Ken Silverman's Voxlap engine. I love the destructibility in particular, since polygons can't really do this. I think you have the rare opportunity to push the medium. So if we take the concept of destruction and voxel physics. What other cool things can we do that is only achievable with voxels? What are the limitations with polygons? I really feel like the future of game dev will be in a medium similar to voxels but something like gaussian splatting. Where the engine works with atoms. Maybe it's best to think of voxels as atoms. It's really an exciting area that has been so neglected by developers. You're very lucky to be working in an area that is yet to be fully explored creatively.
@TheDroidsb
@TheDroidsb Місяць тому
Super awesome! It is pretty funny how many dev log videos start with. “I decided to reprogram it from scratch” 😂 I am also guilty of doing this tho so can’t say much
@2dozen22s
@2dozen22s Місяць тому
The resolution and resource scaling is perfect on this lol. 100% gpu and cpu usage across 32 threads, and 1100fps default window size to 280 at 1440p. Looking forward to seeing how this project progresses, great job on it!
@trashman1358
@trashman1358 13 днів тому
First time I've come across your channel. I've always felt voxels are like a computer making graphics like (checks notes) a Post-Impressionist oil painter. The church and village at the end of the vid? Both facinate and excite my brain for reasons I simply can't fathom. Love, love, love voxels and if that's your engine? You've absolutely cracked it visual wise. Subscribed.
@YoloRealm
@YoloRealm Місяць тому
This has to be the most immersive voxel engine I’ve seen so far
@strefalinux
@strefalinux 18 днів тому
10k UKpostsrs - "I'll optimize this engine, even with the cost of rewriting 11 thousand lines of code." Multimillion companies hiring hundreds of programmers - "It reaches 48 FPS on RTX 4090, that should be enough!" Thank you for the video, it's very informative. Great job!
@cho4d
@cho4d 22 дні тому
real scan environment looks so sick. with a little bit of hand finishing it would be an amazing level generation tool
@harriehausenman8623
@harriehausenman8623 21 день тому
Absolutely 🤗
@gabrielbeaudin3546
@gabrielbeaudin3546 Місяць тому
That's a very nice acheivment. Congrat
@henkdesjaak9650
@henkdesjaak9650 Місяць тому
Absolutely love the photoscans!!! Also, i think the formal term for a tree with 8^3 sized nodes is a B+tree, B as in binary, + as in more than two children.
@RiverReeves23
@RiverReeves23 28 днів тому
Excellent work. I'm happy you went back to ray tracing. It does look much better. I love the idea of using photogrammetry to build out levels. I think this would make a really interesting almost PS1 looking game.
@DouglasDwyer
@DouglasDwyer 28 днів тому
The one frustrating thing with the photogrammetric models is that they are hollow on the inside. It would be really nice to preprocess them so that they are solid (and also have proper normals).
@LegoDinoMan
@LegoDinoMan Місяць тому
Easily my favourite UKpostsr, another great upload!
@SubzeroBlack68
@SubzeroBlack68 Місяць тому
Oh also wanted to say that I found your channel (which has been great by the way). Because of a random video "You can Parry Nukes" for that V.A. Proxy game. I thought, Man it would be cool if that slash or explosion could slice a mountain in half as it traveled forward. Then I started thinking of Voxel destruction and how Voxel art would be pretty good for showcasing that kind of destruction. (Even that game looks like it be transformed into a Voxel art style. Then ended up down a rabbit hole of Voxel plugins for Unreal then custom Voxel engines and such which led me here.
@ewertonls_
@ewertonls_ Місяць тому
this looks so good, i find the low resolution version charming
@USBEN.
@USBEN. Місяць тому
Beautiful work.
@marcorademan8433
@marcorademan8433 20 днів тому
I believe the "higher levels" of searching through the voxels is some form of spatial hashing (you "hash" the ray positions to a coarser grid, which is then used to iterate through smaller grids).
@sixmillionaccountssilenced6721
@sixmillionaccountssilenced6721 16 днів тому
Imagine Magic Carpet remake with this tech!!!! Destructable castles, volcanos, tremors, everything. :DD
@delko000
@delko000 29 днів тому
This is amazing, continue your good work
@looksintolasers
@looksintolasers Місяць тому
One of the things I always wanted in AoS was vehicles. Imagine driving around a map in a Jeep, or driving a self-propelled artillery to a strategic high point? I could never figure out how a vechicle would navigate voxel terrain, but this idea of "normals for each voxel" could make it work.
@stormyy_ow
@stormyy_ow Місяць тому
considering how fast these engines are at lower window resolutions, exploring upscaling options similar to DLSS might be a valuable win for lower end hardware. i think the nature of voxel scenes could lend themselves extremely well to certain upscaling techniques (or look ugly idk). would be fun to expiriment
@pandemik0
@pandemik0 Місяць тому
Love your work. Voxel engines have a nostalgic place for me. Games like the original Outcast or Comanche (this dates me) had astonishing visuals for their time. That a voxel engine was possible on 1992 when barely any games were 3D at all is testment to their potential. There's a certain charm and art style to low res combined with a blocky world that is worth exploring. Bonus if that means it can run on a potato or a very old machine. Great potential there.
@DouglasDwyer
@DouglasDwyer Місяць тому
Glad you enjoyed the video, and I agree about the nostalgic aesthetic :)
@connorsheehan1944
@connorsheehan1944 Місяць тому
This is so awesome!! The game looks amazing keep going!
@DouglasDwyer
@DouglasDwyer Місяць тому
Thanks for watching :)
@guylemmer7707
@guylemmer7707 Місяць тому
Your brick tree is similar to cone marching just in grid aligned space, and could also be thought of as a sort of acceleration structure.
@jorge69696
@jorge69696 Місяць тому
The low resolution gives me 90s vibes in a good way.
@silentvoidx9267
@silentvoidx9267 Місяць тому
I really like the low res look, especially if you add moody lighting and fog
@SuperLlama88888
@SuperLlama88888 Місяць тому
Wow, great job! Hope you can also implement reflection and refraction!
@DouglasDwyer
@DouglasDwyer Місяць тому
Yep! Reflection, refraction, and volumetrics are all stuff that I want to try!
@mmiisshhaa
@mmiisshhaa 22 дні тому
damn dude, this is the coolest stuff in CS in my opinion. Such a good combination of math and algorithms/data structures, to make something that looks so cool, and if it wasn't for job prospects, I'd totally go for it. I'm in second year uni, in cs and physics, and I'm so split in what area I want to go in. I worked on my own shitty, completely entry level 3D rendering/physics engine, and it was so much fun. But the game industry is going through so much layoffs right now, and if I want to work on other physics simulations like robotics or autopilots, it seems like I'd need a masters, which idk if I'd go for. I'm so torn on what I should work on this summer, if I should continue working on my game engine, or get into AI which is probably the more employable path, but doesn't seem as interesting as this. Also from what I hear game devs don't earn as much as other software engineers, but I wouldn't call this type of thing "game dev", more like engine designer, right? does it pay adequately to how much work you have to put in? maybe I care about the pay too much...
@DouglasDwyer
@DouglasDwyer 22 дні тому
I think that your concerns about money are understandable. There definitely are game engine and GPU-related jobs out there, but they are competitive to obtain and the games industry doesn't pay quite as well. I'm not sure what advice to give you, other than that I personally would not go into AI. The area is overhyped right now, especially since the field has a low skill floor. Anyway, maybe consider software jobs in other areas related to low-level programming? In addition to games industry jobs, there are positions at companies like Qualcomm and AMD for developing new GPU drivers and tech.
@AndrewTSq
@AndrewTSq 14 днів тому
that looks amazing!
@yegorwienski1236
@yegorwienski1236 Місяць тому
I love how the game looks on the IC, maybe even better than on the GTX.
@MrAngryWh1te
@MrAngryWh1te Місяць тому
Very intresting to watch, thank you
@Maxjoker98
@Maxjoker98 Місяць тому
I think global illumination could really make your engine look *even* better. I recently learned about an interesting technique for global illumination from a channel called xima. In his voxel engine he is using a cellular-automata based global illumination model that runs in a compute shader(to great effect).
@DouglasDwyer
@DouglasDwyer Місяць тому
I just learned about Xima's cellular automata GI, and it looks revolutionary! But I'm not sure how it would scale to scenes with more voxels. That said, GI is definitely something that I would like to learn about. I agree that it could take the graphics to the next level on high-end GPUs.
@Maxjoker98
@Maxjoker98 Місяць тому
​@@DouglasDwyer I don't think the performance impact is as big as you might imagine for this technique. The cellular automata only needs updates when the light conditions change, probably works well with octree-like structures, and lends itself well to caching. Plus, there is really no need to tie the light updates to the framerate, or at any fixed rate. You could just GI-update a small region at a lower rate for lower-end GPUs - due to the cached results for the non-updated chunks performance might should be ok? Really I'm just guessing here, maybe ask him for help? He seemed really nice in the comments where I already asked him some questions along those lines earlier :P
@DouglasDwyer
@DouglasDwyer Місяць тому
I definitely will reach out to him in the future. What I meant in terms of scale was more referring to memory consumption. Every time you double the size of your scene, it consumes 8x the memory, since the cellular automata requires storing per-voxel data, right? So I wonder how the memory is compressed. But maybe Xima has a solution :)
@VesSaphia
@VesSaphia Місяць тому
11:10 Looks even more nostalgic really.
@ChubbaBubba2
@ChubbaBubba2 Місяць тому
The lower resolution + voxel style together looks very nice. Perfect for lower end GPUs as well like you said.
@zblurth855
@zblurth855 Місяць тому
just here to say I love the low res look, look like one of those "demake" but with its own style and not just PS1/2 look
@iplet
@iplet Місяць тому
Woooo! He's back at it again with the rewrite! This guy is gonna be the next Notch!
@DouglasDwyer
@DouglasDwyer Місяць тому
That's the goal!
@davidhuculak1099
@davidhuculak1099 29 днів тому
Wait a sec.. i recognize you. I used your fork of cpal for getting audio to work on the web in my game engine. Thanks and keep it up with the rust graphics content!!
@DouglasDwyer
@DouglasDwyer 29 днів тому
Yep, that's me! One day I will add audio to my own engine with it too.
@therealpeter2267
@therealpeter2267 Місяць тому
I get around 8 fps on integrated graphics in the church which is 8 more than I expected, good work! (laptop defaults to IGPU with chrome)
@Bruiserjoe
@Bruiserjoe Місяць тому
Video quality is great!
@Jonas-Seiler
@Jonas-Seiler 22 дні тому
Honestly, the low resolution example at the end looks much more interesting in my opinion. The high resolution shots, especially of the mediterranean cityscape, look sort of uncanny and moreover kind of lifeless. Could be sublime for horror games though I suppose.
@ytHUNTR
@ytHUNTR 26 днів тому
wow this looks amazing
@torq21
@torq21 28 днів тому
The photoscan stuff is the best reminds me of Vagrant Story on PS1, some of the best lo-fi graphics ever made!
@Arctan95
@Arctan95 23 дні тому
Fantastic! Is there a game / project in mind for the engine, or are you planning to release the engine itself? Either way, great work and I enjoyed hearing about the more granular GPU challenges and solutions you encountered - thanks for sharing!
@DouglasDwyer
@DouglasDwyer 22 дні тому
My goal is turn to the engine into a multiplayer platform where users can create their own experiences with mods/plugins. The rough project roadmap for me involves three steps. First, I want to finish the core engine. Then, I intend to build a small proof-of-concept game with it, and release that. Finally, I'll release the suite of modding tools and related stuff so that people can build and extend the engine.
@Arctan95
@Arctan95 22 дні тому
@@DouglasDwyer Sounds ambitious! Though you're clearly a very proficient GPU programmer, good luck to you!
@xXTrack394Xx
@xXTrack394Xx Місяць тому
Great video! I am curious if you plan on tweaking the shadows and lighting to make it more realistic? I noticed that there is a lot of ambient light being used. Any plans to use a raytracing/phong lighting system in the future?
@DouglasDwyer
@DouglasDwyer Місяць тому
Yes, I want to experiment with different kinds of lighting in the future. At the very least, I would want to support ambient occlusion and point lights. But having some kind of global illumination or other system would be cool too.
@lumivesper
@lumivesper 22 дні тому
Try and add FSR 3 for lower resolutions on integrated video cards. You might end up gaining quality, even with high-end specs for this specific engine. You can also consider exchanging the language to Zig, as benchmarks show it can be up to almost 10x faster than C.
@TwoThreeFour
@TwoThreeFour 26 днів тому
That low res version reminding me of a game called Carpet or is it Magic Carpet released in late 90s or early 2000-ish I think.
@TR-707
@TR-707 18 днів тому
awesome demo!
@DouglasDwyer
@DouglasDwyer 18 днів тому
Glad you liked it!
@Magnymbus
@Magnymbus Місяць тому
Now I really wanna see it with multiple ray bounces. Deeper shadows would go a long way in bringing out the details.
@natecraver6362
@natecraver6362 Місяць тому
I'm curious if you have ever tried the BrickMap data structure, which is very similar to yours, but its 8x8x8 instead of 4x4x4, though, I don't believe its organized in a tree structure. Great video as always!
@chris-pee
@chris-pee Місяць тому
Reportedly a brickmap of individual 64x64x64 octrees can also give great results.
@Caellyan
@Caellyan Місяць тому
Problem with higher subdivisions is that the bitmask he's using to traverse the tree becomes longer. 8^3 requires that many bits (1024), which is 8x64-bit ints. There's a tradeoff there when it comes to complexity, and it's somewhat hard to try out all the different trees because they all require custom CPU and GPU code so switching between them takes a bit of time.
@DouglasDwyer
@DouglasDwyer Місяць тому
@Caellyan puts it perfectly here. The 64-tree structure is the optimal size for register usage and empty space skipping, from my experience so far.
@NyanCoder
@NyanCoder 13 днів тому
Wow, that "low resolution" looks very interesting IMO. Idk why, but it reminds me ps1, and it's fascinating that it's all voxels. I think there would be a lot of cases of making use a such style. And it's true pixel-art (without shifting and rotating pixels)
@lubomirkurcak
@lubomirkurcak Місяць тому
This is incredible!
@kennethsmith5383
@kennethsmith5383 Місяць тому
Duuuuuuuuuuuuuude this is awesome. All these voxel games 😊
@iLEZ
@iLEZ 29 днів тому
Fantastic! Why oh why don't we see more retro-style games using voxels? I guess the engine programming is difficult and non-standard, but old games like Outcast and even older games like Ecstatica were fantastic, and the low-rez example in the end of this video reminds me a lot of Ecstatica for example. More! More!
@caleboleary182
@caleboleary182 Місяць тому
Wow, this is so cool!
@CYON4D
@CYON4D Місяць тому
I think the low res looks really good. Reminds me of an Windows 98 game called Outcast which used voxels for the terrain.
@jerkofalltrades
@jerkofalltrades Місяць тому
It all looks really good. Will other things, like transparency or volumetrics, be easier with this new method?
@DouglasDwyer
@DouglasDwyer Місяць тому
Volumetrics will absolutely be easier, since volumetrics involves accumulating the amount of light along a ray! I anticipate that transparency will be equally annoying to implement as in rasterization, just in a different way lol
@user-vi7kp6re2l
@user-vi7kp6re2l Місяць тому
Incredible! 😮
@nielsdaemen
@nielsdaemen Місяць тому
Amazing work! I think you might have found the method Euclideon unlimited detail uses...
@Lazauya
@Lazauya Місяць тому
Another optimization I've seen for ray marching is "cone marching". It's an obscure term but there's a fairly understandable Powerpoint presentation that comes up when you Google it. It relies on having an actual signed distance function, so I don't know if you're using one/it's well defined enough for the method. Neat project, anyway!
@DouglasDwyer
@DouglasDwyer Місяць тому
There are definitely related optimizations that I could do, but sadly I don't build an SDF (too slow and memory intensive) so not sure if the approach could work here.
@cheydinal5401
@cheydinal5401 23 дні тому
You should also sometimes give each of the edges of a voxel a color. Otherwise surfaces often look like just a single color with no 3D dimension to it, not even like it's a 2D surface in a 3D world but like it's just some color added on top of the screen (like the wood of the well at 5:54). A voxel shouldn't ***have*** to have special color for the edge (to boost performance when it doesn't), but should be able to. When it does, it should maybe even be able to have different colors for different edges, thereby creating less uniform textures with irregular short stripes
@Tideroo
@Tideroo 24 дні тому
Looks great ! I'm not an english native and not a dev by any mean so I might have missed something in the video, but I was wondering after toying with your mod if you would be able to make a "scale factor" that increases the further a voxel is from the camera, instead of doing the entire screen ? So that tiny voxel cubes we can barely see can be regrouped with other voxels nearby, to make a bigger cube. Hopefully this can allow less calculation to be done afterwards for lighting, "painting the scene" :) Maybe even simplifying physics if the calculations uses big cubes instead of doing it voxel by voxel. Or a combination of both (rendering tiny voxel cubes while doing all the calculation with cubes 2/4/8 times biggers) ? I honestly dont know, like I said I'm not a dev so it's just wild guesses. But that's what I'd personally do if I wanted to improve performance :D
@DouglasDwyer
@DouglasDwyer 23 дні тому
Yes, your idea is an excellent one! This is called a level-of-detail (LOD) system and I actually did implement one in the renderer (if you look at the montage about 30 seconds into the video I think that you can see it working). But I haven't hooked up the LOD system to the world generator/manager yet, meaning it doesn't work in-game. I am currently adding that feature now!
@Tideroo
@Tideroo 21 день тому
@@DouglasDwyer Nice ! Thanks for the info. Can't wait for the next video to see more about it :)
@oliversargison1262
@oliversargison1262 Місяць тому
You know the rust BTree is actually split into sixteen at each level instead of 2 for speed. That's fascinating to see the same kind of memory speed dynamics play out on the GPU. Also maybe you could look into using something like AMD fsr for low end GPU's. Amazing work!
@DouglasDwyer
@DouglasDwyer Місяць тому
I didn't know that! Yet again Rust proves that it is the best language, haha
@pwouik9784
@pwouik9784 Місяць тому
The point of a btree actually is being wide, b doesn't stand for binary tree
@e3.14c4
@e3.14c4 25 днів тому
11:08 super cute, love it
@francescobigblak
@francescobigblak Місяць тому
Man keep It up! The best voxel engine will be the one that gets published
@DouglasDwyer
@DouglasDwyer Місяць тому
Haha definitely
@IAMTHEARMAGEDON
@IAMTHEARMAGEDON Місяць тому
I'd definitely appreciate being able to set the resolution if my GPU can handle it. Look beautiful either way
@DouglasDwyer
@DouglasDwyer Місяць тому
Thanks!
@tonygamer4310
@tonygamer4310 Місяць тому
Something to consider (if you haven't already) for the tree structure you're using, a way to potentially be even more efficient might be to use a BVH BVHs are commonly used in many raytracing programs already because of their efficiency. It's basically LoD, but for the raytracing algorithm itself
@cvabds
@cvabds Місяць тому
Lie
@tonygamer4310
@tonygamer4310 Місяць тому
@@cvabds ?
@DouglasDwyer
@DouglasDwyer Місяць тому
BVHs would not be as efficient for my use case because my data is completely grid aligned. BVHs are designed to handle many overlapping objects with arbitrary transforms scattered throughout space. However, my voxels are on a fixed grid without overlap, so the BVH structure would just introduce extra overhead. Using a BVH on the top level when I am ray tracing against multiple voxel objects is something to consider, though.
@alan83251
@alan83251 Місяць тому
Always enjoy watching yours and Gabe's progress. I've been wondering how one might implement soft body physics in a voxel engine. The material point method en.wikipedia.org/wiki/Material_point_method (demonstrated in youtuber Grant Kot videos) seems to be a way to get really interesting physics that can include melting, sublimation, cracking, bending, fluids, etc. I'm wondering if a voxel grid could have a few voxels that serve the fixed "background calculator grid" purpose, and also select some voxels to become "particles" and undergo simulation. I'm not smart enough to know if this is possible with any kind of acceptable real-time performance, but it sounds like there may be some promise there.
@DouglasDwyer
@DouglasDwyer Місяць тому
I think that building a soft-body engine with particles is a very different beast than what I've done here. You probably would need a different rendering technique, since ray marching is optimal for a small number of large voxel volumes - not many small voxel particles (although it's absolutely possible to add particles with a rasterization pass, like Gabe does). I would want to learn more about fluid simulation (which seems like it uses a simplified version of the concepts from MPM) before getting starting on soft-body physics.
@bytesandbikes
@bytesandbikes Місяць тому
Looks really good 😊 I wonder if you could get the empty space traversal even more memory compact with something like a Bloom query
@DouglasDwyer
@DouglasDwyer Місяць тому
Thanks for watching! What's a Bloom query? Usually, the best traversal data structures are those which directly encode the positions of the objects into the structure itself. Trees are a great example of this because the position of a node in memory is directly related to its position in 3D space.
@bytesandbikes
@bytesandbikes Місяць тому
@@DouglasDwyer Like a Bloom Filter, but using a compact lossy encoding of the vector entering the block- giving a fast no-hit/maybe-hit first test. No idea if that would end up better or worse. Would probably help most near large flat areas.
@ThyTrueNightmare
@ThyTrueNightmare Місяць тому
ok, you've conviced me to look harder into making my own engine. I am an unreal engine programmer so my current knowledge set is locked within that engine. need to expand man, but feels like there is little out there
@DouglasDwyer
@DouglasDwyer Місяць тому
Good luck!
@JosephGleespen
@JosephGleespen Місяць тому
This is so impressive dude! Is the brick tree only a 2 level tree? How do you handle off grid voxels and all that? At a high level obviously.
@DouglasDwyer
@DouglasDwyer Місяць тому
Here is a rough diagram of my rendering data structure: imgur.com/a/P5cldl2 It's a bit outdated - I now use linear arrays rather than linked lists to store objects. In short, my voxels are organized into 256³ chunks - so each chunk is a 4-level 64-tree. Non-grid-aligned objects are stored as a list of indices on each chunk, and are ray marched independently before ray marching the main chunk :)
@JosephGleespen
@JosephGleespen Місяць тому
@@DouglasDwyer Man thank you for this, I love seeing how other people imagine solutions for these problems, very cool!
@PersonManManManMan
@PersonManManManMan Місяць тому
This looks cool
@web_dev_cz
@web_dev_cz 26 днів тому
Amazing :) What do you think could be done to prevent the low res version from "flickering"? Also, how do you calculate the voxel normal? From what I've seen you color the whole voxel one color instead per voxel face, no?
@Xaymar
@Xaymar 21 день тому
Damn, this is impressive.
@Oho_o
@Oho_o Місяць тому
This is nice!
@stormyy_ow
@stormyy_ow Місяць тому
a crazy idea i had to optimize my raycaster was to do a fairly low poly mesh generation that essentially “shrink wrapped” every single voxel chunk, as if you saran wrapped the entire world convexly. then that mesh would have the fragment shader applied with the triangle location data. even wrapping each non-empty chunk with quads might work starting the fragment at a position that was MUCH closer to voxel data should save a lot of iterations on empty space. most non collision rays into the sky would be skipped. was wondering if you think that would work? i haven’t even began discovery on this technique to see if it was doable yet. i think fragment shaders on meshes provide world coordinates in the invocation function? in which case this would definitely be doable i think
@DouglasDwyer
@DouglasDwyer Місяць тому
Absolutely! This is what I was referring to at 9:30 when I mentioned a "depth prepass." I will eventually implement something like this. I'll probably split the world into 16³ blocks and generate a tight AABB around each 16³ block (guessing that 16 is a good size because it will put the AABBs on par with Minecraft blocks size-wise). Then, I'll rasterize the AABBs and use that information to determine where to start the primary rays.
@stormyy_ow
@stormyy_ow Місяць тому
cool! i look forward to what you settle on with future optimizations. :) forgive me for not being as well versed as you with graphics terminology 😅.
@arphaxadarphaxad1592
@arphaxadarphaxad1592 Місяць тому
Wow! (11:00) a multiplayer map for Gears [ War
@arphaxadarphaxad1592
@arphaxadarphaxad1592 Місяць тому
Or Tomb Raider Death Maych/Free for All
@phylliida
@phylliida Місяць тому
This video was great
Doubling the speed of my game's graphics [Voxel Devlog #18]
13:01
How Ray Tracing (Modern CGI) Works And How To Do It 600x Faster
32:06
Josh's Channel
Переглядів 531 тис.
😨Новая Война в GTA 5 Online #shorts
00:40
King Dm
Переглядів 1,7 млн
ISSEI funny story😂😂😂Strange World | Magic Lips💋
00:36
ISSEI / いっせい
Переглядів 98 млн
The Formula for Replayable Games
18:44
Blargis
Переглядів 155 тис.
I Made A Fully Ray Traced Game
26:17
Acerola
Переглядів 148 тис.
Achieving True Photorealism With Lens Simulation
58:51
Zircron45
Переглядів 49 тис.
Blazingly Fast Greedy Mesher - Voxel Engine Optimizations
23:35
DAY 1 First Look at this STUNNING New Island Survival Game!
45:05
PartiallyRoyal
Переглядів 19 тис.
Optimizing my Game so it Runs on a Potato
19:02
Blargis
Переглядів 256 тис.
I Learned Blender in 30 Days
14:24
OverPhil Dev
Переглядів 34 тис.
How Quake Failed their way to Success
21:51
SimonDev
Переглядів 124 тис.
7 DEVS Make a GAME without COMMUNICATING! (500 IQ edition)
17:39
Blackthornprod
Переглядів 326 тис.
ЛУЧШАЯ ПАРА ДЛЯ ДУО ШД
0:41
Янер
Переглядів 1,6 млн
Увидели вертолет | меллстрой
0:13
fedyaoch
Переглядів 642 тис.
Lp. Последняя Реальность #67 НАСТОЯЩИЙ МИР [День: Первый] • Майнкрафт
34:13