How I tripled the render distance in my game engine [Voxel Devlog #16]

Ойындар

Try CodeCrafters for free today: app.codecrafters.io/join?via=...
Online demo: github.com/DouglasDwyer/octo-...
How do games render such vast swaths of the world? This video showcases the level-of-detail (LOD) system that I implemented in my voxel engine. The LOD system ensures that far-away objects are rendered using simplified meshes, allowing the graphics card to quickly churn through them. I address some of the challenges of using LODs, including how to generate them and account for user edits. Then, I show off my new procedural skybox and revamped transparency!
Music used in the video:
Glaciaere - I'm Getting Over You (Or At Least I'm Trying To)
HOME - Tides
HOME - Native
HOME - Release (W.I.P.)

Пікірлер: 186

  • @dottedboxguy
    @dottedboxguy4 ай бұрын

    that's super cool ! it's amazing to see how far you're pushing your voxel engine, it's one of the most impressive ones out there :) (especially since i think you're the only one i've seen who actually invents new graphics techniques, that's genuinely so cool)

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Thanks Dotted!

  • @ragdude7323
    @ragdude73234 ай бұрын

    I love that you featured Ethan, he’s one of my favourite indie voxel devs

  • @StiekemeHenk
    @StiekemeHenk4 ай бұрын

    Man casually shows Nuke without any mention 😮 I don't remember seeing anything interesting other than the terrain with trees so far...

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Haha, I upgraded my model loader and wanted to show off how a larger model looked with the new render distance.

  • @NaughtyKlaus
    @NaughtyKlaus4 ай бұрын

    Seeing de_nuke at the end is truly surprising. It works so well with voxels.

  • @Mittzys
    @Mittzys4 ай бұрын

    Ethan Gore's engine is crazy

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    real

  • @10bokaj
    @10bokaj4 ай бұрын

    you could trace though the transparent material. It seems to have a bright color on the edges. You could combat this by making the color contributed by the transparent voxels dependent of the "distance" to the backface (by raytracing or just rendering again with the backfaces).

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    For performance reasons, I don't plan to use ray marching or backface rendering right now. But those are assuredly good suggestions :)

  • @RAndrewNeal
    @RAndrewNeal4 ай бұрын

    Awesome as always! As soon as you mentioned using the seed/world generation data to generate LODs, I thought "what about player generated structures!?" I like your solution. Much more seamless than the LOD Minecraft mods I've seen, which only generate LODs on the client side, and can become out of sync with the server. It's coming along great!

  • @JoshuaBarretto
    @JoshuaBarretto3 ай бұрын

    Veloren Easter Egg at 7:05? FWIW that model uses our 'index replacement' system: to properly render it into the world, you'll need to swap out voxels with the inner block's index with an empty voxel. Regardless, great changes. It seems to me that you should be able to store not just the whole edited chunk, but only the diff: and then automatically save LoD versions of that diff so that they can be applied live without the downsampling step, meaning that you don't revert to pessimistic behaviour for worlds with many player edits.

  • @AndrewPetersonGameDev
    @AndrewPetersonGameDev4 ай бұрын

    Cool :D I was curious how to handle player-created structures in a LOD system, and your explanation made a lot of sense.

  • @jad-gh
    @jad-gh3 ай бұрын

    Just wanted to say this is *astounding* work! Really, really, *really* impressive stuff!

  • @JoseRomagueraM
    @JoseRomagueraM4 ай бұрын

    I've been following this series since the beginning and the project is getting better and better every time. Would be cool to see epic biomes and buildings using this engine!

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Thanks! I do feel that some better art (more detailed terrain and assets) would really take things to the next level.

  • @isse9251
    @isse92514 ай бұрын

    Saw the tower at 7:06 and was like wait a second... (I'm a veloren coredev)

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Oh, is the model from Veloren? I really had no idea haha, it was just a random file called mage_tower.vox that one of my viewers sent to me. (I think that I recognize you from Tantan's game jam video, by the way - nice to meet you!)

  • @isse9251

    @isse9251

    3 ай бұрын

    Oh yeah, but feel free to use it. Keep in mind though that those assets are licensed under GPL3. The blocks sticking out from the door at the tower etc, are turned into air blocks in veloren and override terrain when placed. And hi!

  • @Zlwx
    @Zlwx3 ай бұрын

    This is a really cool and exciting project! It's definitely one of the most impressive indie voxel engines out there.

  • @Zac8668
    @Zac86684 ай бұрын

    Man this project is amazing, can't wait to see more updates!

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Glad that you enjoyed it!

  • @yaarrghmematey
    @yaarrghmematey4 ай бұрын

    Awesome Work! keep those voxels rockin!

  • @noeyedwonder1447
    @noeyedwonder14474 ай бұрын

    love these videos, thanks for spending the time putting them together

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Thanks for appreciating!

  • @phylliida
    @phylliida3 ай бұрын

    Just wanted to say I really enjoy your videos :)

  • @dominicstocker5144
    @dominicstocker51443 ай бұрын

    Amazing work!

  • @unwrdo
    @unwrdo2 ай бұрын

    You should do a collab with ethan gore, his game has very good render distance, it's like seeing 50 thousand earths at the same time no joke!

  • @PiccaviStudios-is8zr
    @PiccaviStudios-is8zr3 ай бұрын

    I forget what method 7 Days to Die uses Voxely - Octree type destructive environments... But once players hit that level and are able to go ham building wise and what not. I'm always seeing this where a building wont show up till your really close or some building that has been totally torn down shows up as you get further away from it. Great stuff you got going on here!!

  • @dude2542
    @dude25423 ай бұрын

    I started learning rust because of you. I was skeptical of how will this project be useful, but now seeing the economy, and that this engine runs in the browser near native speeds, it's safe to say this could be an engine that a new runescape game uses - or something that made even more money and ran in the browser.

  • @quantumdeveloper2733
    @quantumdeveloper27334 ай бұрын

    I think you are forgetting about another problem with LOD and editable terrain. From what you said you only send out updated versions of LOD data when another player requests those chunks (which is definitely a great choice for performance). But what if they don't? What if they stand still, never requesting new data from the server? Also great to see, that you finally fixed your weighted transparency. It looks a lot better now. But honestly I still prefer the things you can do with ordered transparency ;)

  • @punchster289

    @punchster289

    4 ай бұрын

    ah true. the server should send lods of distant chunks modified by other players when they are updated

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Ordered transparency lends more flexibility. The volumetric fog effects in Cubyz are amazing :) Anyway, that's a detail that I glossed over. @punchster289 is correct; when a chunk is dirtied all nearby clients are notified. This causes the clients to discard those old LODs and re-request them from the server. This ensures that LODs always remain properly up-to-date.

  • @punchster289

    @punchster289

    4 ай бұрын

    ​@@DouglasDwyerhonesty following your engine development has been really enjoyable. your solutions are extremely clean and logical, and your videos are high quality. once the engines done, i hope you enjoy making what will inevitebly be an extremely unique and intriguing game.

  • @baconsandwich1887

    @baconsandwich1887

    4 ай бұрын

    @@DouglasDwyer Do you think it's possible to defer these updates so they don't happen every time an edit is made? I can see that being a bit of an issue if multiple players are building near you, forcing your client to recompile the LODs constantly. Sorry if you've already considered this/don't need it, it was just a question that popped into my head during the LOD section.

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    @punchster289 Those words mean more to me than you can imagine, my friend :)

  • @Finding_Fortune
    @Finding_Fortune4 ай бұрын

    Looks great!

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Thank you!

  • @sundaemon
    @sundaemon4 ай бұрын

    I recently drop game dev temporarily to focus on other things I want to learn but this kind of videos really make me want to get back to it, even if I can't finish the game, wich is almost always the case

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Motivation is a big factor in finishing a project for me, too. Focus on your passions; that's where you will excel and be happy :)

  • @sundaemon

    @sundaemon

    Ай бұрын

    @@DouglasDwyer After some experimentation my conclussion is that... yep you're right. Your answer was simple but made me rethink some stuff at the time and now I'm back 👍

  • @alexjay8867
    @alexjay88674 ай бұрын

    Seems like you made your own voxel nanites solutions that's cool

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Nanite and my LOD system serve similar purposes. But LODs are a much older technique than Nanite! Nanite does some very innovative things (like GPU data streaming and software rasterization) in order to achieve performance on high-end graphics cards. It's cool, but I would say different than this :)

  • @alexjay8867

    @alexjay8867

    3 ай бұрын

    @@DouglasDwyer it's still a cool technique non the less definitely similar to nanites though, im a gameplay programmer and game designer so I don't deal with the lower level issues like rendering, however I've always admired people how can do the lower level stuff, for me I don't even know where to start learning that type of stuff, was hard enough learning how unreal and godot works

  • @streetware-games
    @streetware-games4 ай бұрын

    Blowing the competition out of the water

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Haha, I'm just trying to keep up with everyone! Your voxel project seems pretty cool too - the non-Euclidean rendering is quite different than any other engine out there.

  • @gmanster_ster
    @gmanster_ster4 ай бұрын

    great work!

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Thank you!

  • @USBEN.
    @USBEN.4 ай бұрын

    Very interesting engine, i would love to make some short games on this.

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    My end goal is for users to be able to build things with the engine!

  • @aaronmark3930
    @aaronmark39304 ай бұрын

    congrats on the sponsorship that's awesome

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    It's definitely a nice opportunity.

  • @nicocroteau-perreault192
    @nicocroteau-perreault1922 ай бұрын

    Great video as always! Out of curiosity what rendering method are you using? Are you still doing parallax ray marching or have you switched over to greedy meshing?

  • @DouglasDwyer

    @DouglasDwyer

    2 ай бұрын

    In this video, I was using fully greedy meshing. However, if you check out my latest video, you'll see that I've switched my rendering technique once again :)

  • @ClassyWolf
    @ClassyWolf4 ай бұрын

    Cool stuff.

  • @natecraver6362
    @natecraver63624 ай бұрын

    That looks insane! Im goint to have to look at order independent transparency for my engine, definitely goong to make things a whole lot easier. One question i had was will you publish the engine source code as open source?

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    I eventually hope to turn the project into a publishable game or service, so I don't plan on open-sourcing the complete engine in the near future. However, many custom components of the engine (like the event library, networking library, etc.) are available and open-source on my GitHub!

  • @raptordad6653
    @raptordad66532 ай бұрын

    Hi Douglas! Great work as always. I began following your channel about a month ago and have binge-watched all of your videos. I’m fascinated by your work but there is something I don’t understand and wondered if you could explain to me: I get that SVOs are compact, but your voxels are quite a bit smaller than those of - say - Minecraft and so it follows that you must have many *more* voxels than Minecraft for the same area (as each increase in voxel resolution, cubes the number of voxels required). So I’m wondering how on earth you manage to increase the voxel resolution as much as you have and yet still be able to store that many voxels in memory. My understanding of SVOs is that each child node is a single bit of an 8 bit parent and subsequent children are themselves single bits of 8 bit nodes…but the *type* of voxel has to be stored somewhere (otherwise all voxels would be the same type, right?!) and so that voxel id has to be stored somewhere, increasing the amount of memory required to store the voxels…and as you have *so many voxels* in your higher voxel resolution set up…it’s mind boggling to me how you’ve achieved it! Maybe I’m being dumb but however I run the numbers, storing the visible part of a Minecraft like world (high voxel resolution equivalent of 32minecraft “chunks”) quickly enters the hundreds of gigabytes realm…

  • @DouglasDwyer

    @DouglasDwyer

    2 ай бұрын

    Hey, thanks for your interest! The idea of a sparse voxel octree is very general, and they may be structured in different ways (including using bitmasks, offsets to children, or pointers to children). In my implementation, I store 16-bit material IDs in my octrees. I may, however, iterate and switch to another data structure in the future to better support per-voxel colors and normals. I think the key part that you may be missing is the "sparse" in sparse voxel octrees. If a node in an SVO is completely homogenous, then the children of that node are not stored. As such, large regions of empty space, grass, dirt, and the like don't take up much memory. Really, it's only surface voxels (or any voxels on the border between regions of differing ID) that take up appreciable memory, since there are far more of them than non-leaf nodes. As a simple example, let's imagine that we had a 32^2 world with chunks of 256^3. As a rough estimate, let's assume that there are 6*256 surface-visible voxels in each chunk (about the number of voxels that would be visible if the chunk were a solid cube). Then the amount of memory required is about (32^2 chunks) * (6 * 256^2 voxels per chunk) * (2 bytes per voxel) = 805 MB, a very reasonable size. This is neglecting the extra data necessary for the non-leaf nodes, but those could not increase the size by any more than 1/7 or 14%. For more information on SVOs, maybe this video will explain them: kzread.info/dash/bejne/mYKO1tpsmc3QoNI.html

  • @Immortal2022
    @Immortal20224 ай бұрын

    I've been meaning to start on a voxel game pretty soon, and I have been thinking of a way to do this and I am curious what others might think. I was thinking that the best way to do this would be to create a chunk loading system similar to minecraft with 16x16 chunks, but each block within a chunk can be optionally divided into 16x16x16 sub chunks. Each block can have a divisior variable that decides how many sub voxels to use. That way I don't need to code all those blocks in areas that are solid material and materials like stairs don't need to use all 16x16x16 voxels, maybe just divide it into 3x3x3 for all the steps. When loading chunks near the player, I would like the game to first load the 16x16 chunks, then add the sub chunks near the player. Chunks that get further away would only allow smaller divisor values to create this level of detail and as the player gets closer, the full divisor can be requiried. I worry that reloading variables like this may not be the most efficient way to do things though and things in the distance may look too blocky.

  • @Immortal2022

    @Immortal2022

    4 ай бұрын

    One more thing about the divisor, I intended to have full solid blocks have a divisor value of 1, and the full 16 voxels would have a value of 16. In the event that a player is looking at a chunk made up of blocks with a divisor of 16, but the game only allows a divisor of 4 at that distance, every fourth block in that subchunk would be stored into memory and as the max divisor value increases as the player gets closer, every second block would be stored into memory, unless another player has updated the chunk, but only alternating second blocks would be queried because half those blocks are already in memory. Feel free to use this idea if it sounds like it would work.

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    I think that this is a great idea, since it skips processing redundant data (i.e. for normal blocks, you only process the entire block, nothing smaller). Most voxel data representations employ a compression scheme like this, in one way or another!

  • @kevin.malone
    @kevin.malone4 ай бұрын

    An interesting solution for physics could be to have each voxel have a density value. So when a tree falls, its trunk has a density of 1.0, but the leaves have a density of 0.25, and voxels of lower density can combine on collision up to a maximum value of 1.0. So it would look like the leaves are compressing together when the tree falls. If you restrict it to only compressing with other voxels of the same material, it would be easily reversible. Leaves have a density of 0.25, and will revert to that when no forces are applied, but forces applied can increase that density to 1.0 It could allow for some interesting effects

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    That's an excellent idea! For performance reasons, I don't plan on supporting something quite like this - it would probably require some kind of per-voxel simulation, which can be pretty taxing on the CPU.

  • @ragdude7323
    @ragdude73234 ай бұрын

    I feel like you need to use transparency voxels in structures instead of sphears to really test how it looks

  • @NotAFoe
    @NotAFoe4 ай бұрын

    Crazy!

  • @SymbolCymbals2356
    @SymbolCymbals23564 ай бұрын

    Really cool, small nitpick is the clouds look really flat

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Adding an atmosphere and volumetric clouds would be nice, but I'm going to leave those tasks to a real artist haha. I need to focus on functionality first!

  • @SymbolCymbals2356

    @SymbolCymbals2356

    3 ай бұрын

    @@DouglasDwyer Volumetric clouds would be a little overkill, I was thinking maybe a second layer of clouds that are the same as the bottom layer but slightly smaller and a lighter color to imply thickness. But yeah it's a nitpick and definitely shouldn't take priority

  • @petriell0anima
    @petriell0anima3 ай бұрын

    3:10, randomize trees, orientation and make more variations !

  • @random7618
    @random76184 ай бұрын

    Cool vid

  • @vitulus_
    @vitulus_4 ай бұрын

    Awesome progress! However, I'd like to mention something about the chunked LOD approach. There are much better alternatives to octrees. Octrees are a very slow data structure, reading and writing. Especially if most simulation stuff occurs at the highest detail level. They're also a lot more annoying for multithreading, potentially causing a lot more contention. Furthermore, they're not very flexible. At any given spot you can only have ONE LOD type loaded. This is problematic... e.g., for your dirty approach, if you could just keep certain LODs loaded into memory anyways (as needed), then you can very quickly update them (in conjunction with the dirty approach). Among other issues like having to make significant changes to the octree just by moving, you get the point. The most simple data structure that solves this is literally just do what you did before but duplicate it for each LOD level. So either a flat array (good for client-side) or hashmap (good for server-side) in each level. In such approach, simulation stuff at the normal LOD has no performance impact, obviously much less contention too. They're much more flexible, you don't *need* to have a single LOD loaded in any given location. The only time you need to ensure this invariant is for rendering -- which is easy. In my engine, I actually use this potential overlap as a very natural way to transition between the LOD levels. Although, I'd say the best thing about this approach is that it's simple! Less moving parts.

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Thanks for the suggestion! I concur. The octree explanation was mainly to highlight the way that LODs are organized into a cubic hierarchy. Internally, I do use hashmaps to store the LODs that are loaded. Although, I don't store any LODs that aren't currently meant to be shown. That's an interesting idea :)

  • @vitulus_

    @vitulus_

    3 ай бұрын

    @@DouglasDwyer That's great to hear! Also, you may want to clarify that somewhere. Doubtless a new voxel developer would be inspired by your videos and may implement octrees instead (It doesn't help that chunked octrees are often recommended online).

  • @DouglasDwyer

    @DouglasDwyer

    3 ай бұрын

    Haha, well I actually do use octrees for the representation of the voxel data itself! My voxel octrees are very battle-tested and robust at this point, and so I'll be keeping them for now. But I won't try to argue that they are ideal. I want to experiment with other formats in the future, so that I can support per-voxel color and normal data.

  • @vitulus_

    @vitulus_

    3 ай бұрын

    @@DouglasDwyer Ah, that's fine. To clarify I meant specifically using octrees for the chunk structure.

  • @Chaos0verlord
    @Chaos0verlord3 ай бұрын

    My man, what was that ad at 1:20 ?

  • @voxelamateur
    @voxelamateur3 ай бұрын

    Beautiful! But won't thin voxel walls disappear at coarse LoDs?

  • @DouglasDwyer

    @DouglasDwyer

    3 ай бұрын

    The LOD system is designed to always select opaque voxels while downscaling. So it's impossible for walls to disappear, although if you had a wall built of thin layers of different material, those inner materials might show through.

  • @quantumdeveloper2733
    @quantumdeveloper27334 ай бұрын

    Also, do you intend to update the online demo? I would really like to try out those newfound performance improvements on my hardware.

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Since the graphics rewrite I am still missing some keys things (namely entities). Once those features are added in, I am going to post a new version of the demo. Probably next video.

  • @omegaside12345
    @omegaside123454 ай бұрын

    Another improvement to solve is grouping voxels next to other voxels with same material and make a mesh with the same border, that should draw less triangles than all its visible voxels faces.

  • @omegaside12345

    @omegaside12345

    4 ай бұрын

    Is hard to implement that on complex shapes but easier on flat surfaces

  • @vitulus_

    @vitulus_

    4 ай бұрын

    So greedy meshing?

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    I have a greedy meshing scheme which does this. It's part of the reason that I can rasterize these scenes efficiently!

  • @mattgoldsworthy3278
    @mattgoldsworthy32784 ай бұрын

    Hey man! Very cool video! I have a question. I'm developing a game, I've been working so hard on it for the past two years. My vision is to make a voxel world, which is a recent decision. I've been using Zbrush to sculpt all of my models so far which I've put so much time into and I have a good workflow going. I've been using blender to convert my models into voxelized models and I've been testing the world I have built into unreal engine. My problem is that the world I have made is 26 mil poly's when it's converted into voxels and it just won't load into unreal engine 5... It always crashes. So I used a less detailed world, but it looks like minecraft which I really don't like. I was also going to do pose to pose animation to achieve a certain look. I guess my question is: Is it possible to create a voxel engine so I can have a super detailed world in which I can import OBJ files and the program (Or engine I should say) would convert them into voxelized models? I want to build my own engine too because I just think it would be cool to have only my logo, not unreal, pop up on the startup of the game. I also want a specific feel to the gameplay and I worry about using unreal, I know you can control that, but I wonder how much control you actually have over how the game feels to play.... Also I want to keep all the voxels uniform.

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    It sounds like you want to create a game utilizing voxels mainly for the art style? If so, have you considered using a shader or post-processing effect to turn models into voxels? Such solutions do exist, and that would allow you to continue the same workflow with ZBrush and Unreal while achieving that voxel look :)

  • @shooterdefronvrps2
    @shooterdefronvrps24 ай бұрын

    I wonder if a nanite like approach would also work, where a object seens to get greddy remeshed when you get further from it

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Nanite is a very specialized and hyper-optimized form of LODs, so they're certainly similar :)

  • @shooterdefronvrps2

    @shooterdefronvrps2

    4 ай бұрын

    @@DouglasDwyer may have commit missunderstanding but it sounded like if a chunk is altered in any way the game skip it and all its octree neibors in lod pass

  • @Btomaek
    @Btomaek3 ай бұрын

    does it have gpu instancing? i might have missed if you added that in but gpu instancing is verry cool

  • @DouglasDwyer

    @DouglasDwyer

    3 ай бұрын

    GPU instancing is a useful technique for certain scenes, but all voxel data is unique here. As such, I don't think that there is a place to apply instancing (which requires having multiple models with the same vertex data).

  • @Btomaek

    @Btomaek

    3 ай бұрын

    @@DouglasDwyer oh ok

  • @TacoGuy
    @TacoGuy4 ай бұрын

    hey, it looks like you've made clouds out of a single plane with a noise shader. you can try using shell texturing to make clouds look much nicer!

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Adding an atmosphere and volumetric clouds would be nice, but I'm going to leave those tasks to a real artist haha. I need to focus on functionality first! Great suggestion :)

  • @speedrider3145
    @speedrider31454 ай бұрын

    voxel clouds would be cool

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Adding an atmosphere and volumetric clouds would be nice, but I'm going to leave those tasks to a real artist haha. I need to focus on functionality first!

  • @4R8YnTH3CH33F
    @4R8YnTH3CH33F4 ай бұрын

    Hey Douglas, does Webgpu support mesh shaders? The Nvidium rendering engine for Minecraft has achieved some crazy results with the technique, (it only works on Nvidia because only Nvidia supports mesh shaders on OpenGL.) Could be something to look into, I know you said at the end you were done with optimization for now but this could be a tempting route, haha.

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    WebGPU doesn't support mesh shaders, unfortunately. I think that when I do make another voxel renderer, it will probably be using ray marching again - so mesh shaders wouldn't be directly applicable :)

  • @noidea5597
    @noidea55973 ай бұрын

    Now make it nice to look at!

  • @user-qm4ev6jb7d
    @user-qm4ev6jb7d4 ай бұрын

    How does the downsampling itself work? How do 8 voxels turn into 1? Or are you doing downsampling on something other than voxels, some intermediate format? What would happen, for example, if I built a wall in a checkerboard pattern, where every other block is air? What would be the LOD representation?

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Excellent questions. I am downsampling the voxels directly, so there may be some information loss. The system is just programmed to pick one voxel of the eight (preferring non-air voxels if possible) and use that as the representation. So, if you built a checkerboard, it would turn into a flat, opaque plane in the LOD representation.

  • @user-qm4ev6jb7d

    @user-qm4ev6jb7d

    3 ай бұрын

    @@DouglasDwyer Sometimes I wonder whether it is possible to make an LOD system from *pictures* instead of voxels. As in, the game takes a hundred pictures of the chunks in question from different angles, then JPEG-compresses them into pretty much nothing (the WORST compression quality) and displays to you a billboarded picture, chosen according to the angle you're looking from.

  • @user-qm4ev6jb7d

    @user-qm4ev6jb7d

    3 ай бұрын

    @@DouglasDwyer Come to think of it, another question: are "partial" voxels completely forbidden in your system? You know, like Minecraft's slabs/stairs/panes? And what about transparently textured ones, like leaves?

  • @DouglasDwyer

    @DouglasDwyer

    3 ай бұрын

    You're not the first person to suggest pre-rendered images as an LOD system. However, I think that it would be difficult to integrate changing sunlight shadows into them; you would need to re-render each time. Yes, the system does not have support for partial voxels of any kind. I could support transparently-textured ones easily, but I don't plan to do so. My goal is for the voxels to be small enough that detailed models can be created with them.

  • @speakersr-lyefaudio6830
    @speakersr-lyefaudio68302 ай бұрын

    Subbed

  • @BRLN1
    @BRLN14 ай бұрын

    will you/would you release your engine (whenever) as pure engine? ... like minetest leans more into being an engine than minecraft? I am insanely impressed of what your engine is capable of.

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Thanks for the kind words. My dream is to release the engine as a platform (like Roblox or Fortnite) where users can code their own experiences. This choice is compounded by the fact that the engine is quite special-purpose; for example, it only supports voxel volumes with 16-bit material IDs (no other kind of per-voxel data right now). Maybe someday I'll work on creating a more "general-purpose" voxel engine with the knowledge that I've gained, and release it as a pure engine.

  • @mogambro
    @mogambro2 ай бұрын

    Oh man, how I wish that this code were open source... I am so interested in how you do the meshing, as I understand you're not doing raytracing/raymarching but greedy meshing. It's so incredible impressive and sadly there is no open source implementation to peek at (I am a completely different dev by day, so I start from scratch with games)

  • @DouglasDwyer

    @DouglasDwyer

    2 ай бұрын

    Thanks for your interest! I would love to share the code with the world, but my ultimate dream with this project is to turn it into a game or product that I can work on professionally. The only way I can imagine this ever becoming my full-time job is if I keep the code proprietary.

  • @mogambro

    @mogambro

    2 ай бұрын

    @@DouglasDwyerI understand that sentiment, but I still hope you can open source some chunks... I am not trying to convince you, you've set your mind and it's your decision to make, but I personally think that while open sourcing has some risks (and it does!) you could use a license you could theoretically enforce in Court. But nobody but judges and maybe lawyers wants to go to court, so I guess my main argument would be: You're making that game. Even if you open source the technology (or parts) behind it, nobody can take your game from you, your special idea. An engine doesn't make a fun game, so even if you open sourced and some people made some cute demos, unless someone really puts in the ground work for making an actual game, it wont hurt you. But again: You've made up your mind and that is fine, I just wanted to share my perspective, because over the years I've seen too many great ideas never being finished and not open source, so nobody even had any chance to complete them or give them new life.

  • @JimBimBum
    @JimBimBumАй бұрын

    this game engine i'd imagine would be amazingly fun to mod. well and maybe suffer.

  • @GamerSaga
    @GamerSaga4 ай бұрын

    what tutorials did you use to learn about voxel rendering and physics for it? i can not find any resources on the subject matter.

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Excellent question. Voxel engines are a complex topic, and I've built my knowledge from experience, looking at other engines, and talking to the community. A good place to start if you're looking to learn 3D rendering is to follow the learnopengl.com tutorial series, or watch some online videos about how to make a Minecraft clone. Once you feel ready to tackle something more advanced, the voxel.wiki website looks like it has some good links to resources. As for physics, I still have a lot to learn in that department. I'm planning to read Millington's "Game Physics Engine Development" since I want to integrate a constraint-based solver for my engine. Overall, the best teacher is experience! Pick a project or goal that you'd like to achieve, and pursue it at all costs :)

  • @GamerSaga

    @GamerSaga

    4 ай бұрын

    @@DouglasDwyer any good minecraft clone tutorials you know of?

  • @GamerSaga

    @GamerSaga

    4 ай бұрын

    @@DouglasDwyer also have you seen the voxel videos from youtuber john lin? I would like to make something similar to that with.

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    It depends upon the language/tools that you want to use, but the tutorials by Low Level Game Dev, b3agz, and obiwac all look good! As for John Lin, indeed, you would be hard-pressed to find someone in the voxel community who **hasn't** heard of him. His work was an inspiration to me and many others! If you want to create something as visually involved as Lin, you'll definitely need to use ray tracing, so I would recommend looking more into that.

  • @GamerSaga

    @GamerSaga

    4 ай бұрын

    @@DouglasDwyer thanks for the replies! does he share his voxel project on his github? and is there a difference in voxel size that he uses compared to what your doing? like with making the trees and grass?

  • @timmygilbert4102
    @timmygilbert41024 ай бұрын

    As someone interested in making 2m x 2m voxel World, this is of great interest to me because with my scale that's basically infinite distance 😂

  • @dkaraush
    @dkaraush4 ай бұрын

    octree goes brrrr

  • @alacritysucrose
    @alacritysucrose4 ай бұрын

    my god hes gods prophet of voxel engines...

  • @ThatTrueCJ201
    @ThatTrueCJ2014 ай бұрын

    You can consider using something like Marching Cubes to make LODs render with even less triangles. At a distance, this effect should not be noticeable. But I understand if you'd want to stay away from this, as the LODs would technically no longer qualify as voxels. Maybe something like this: kzread.info/dash/bejne/ZZt5q7eaipObdcY.html The benefit being that you could increase the render distance further.

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    It's a good thought. I don't plan on doing this right now, however, since it would require adding a completely different rendering pipeline for the triangular meshes :)

  • @navarrejonathan4193
    @navarrejonathan419314 күн бұрын

    So you edit the lods when rendering ? I'm afraid it might cause lag spikes. If the player builds a whole city, and then teleports away to look at it from a distance, the engine will have to calculate all the changes at once. Instead, you could have your engine calculate the changes to lods while editing. It unfortunately means some changes will go back and forth (player unhappy with the result -> destroy their build and make something slightly different...), but the work of the engine will be smoothed over the time it takes to the player to edit, which should be long enough, right ? Also, if a specific lod receives no change, lower resolution lods don't either, I guess ?

  • @DouglasDwyer

    @DouglasDwyer

    14 күн бұрын

    Not quite. The LODs are recalculated on the server thread (which is not tied to the game's framerate) when the client requests changed LODs, and the work is spread over the course of multiple server ticks. As such, there is no lag!

  • @Fuq_you
    @Fuq_you4 ай бұрын

    It’s amazing what you can do out of jealousy.

  • @VNR_qiqi
    @VNR_qiqi4 ай бұрын

    "meet gorgeous latina women", ahh yes, just what i was looking for 1:28

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Next video idea: adding gorgeous latina women to my voxel engine

  • @VNR_qiqi

    @VNR_qiqi

    4 ай бұрын

    @@DouglasDwyer yeeeesssssss

  • @VNR_qiqi

    @VNR_qiqi

    4 ай бұрын

    @@DouglasDwyer 10/10 originality

  • @MineNOROfficial
    @MineNOROfficialАй бұрын

    “The renderer is almost done”

  • @DouglasDwyer

    @DouglasDwyer

    Ай бұрын

    Haha. In a sense, it was true - I had hit the limits of what felt possible with rasterization. To overcome those limits, I had to start a new renderer :)

  • @thomasmcbride2287
    @thomasmcbride22874 ай бұрын

    EPIC

  • @TitanLordofPizza
    @TitanLordofPizza4 ай бұрын

    Nifty

  • @goobus_floobus
    @goobus_floobus4 ай бұрын

    I watch a lot of voxel engine devlogs, and every time LOD is brought up, I have the question: wouldn't it be better to render polygonal LOD's than voxel LOD's? When far away, a voxelized hill will appear to be smooth. With voxel LOD's, voxels get bigger as they get further from the camera. Doesn't this mess with the player's perception of the distance to faraway objects?

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    You have a point. Technically, with "perfect" voxel LODs you should only switch once a single voxel is smaller than a pixel onscreen - this ensures that the user cannot see any difference in quality. But in practice, this is not feasible (at least in my engine) and the LODs need to appear sooner. I don't think that the perception of distance is damaged, since the faraway voxels are still textured normally (so a single voxel in a 1:2 LOD will look like it is composed of eight individual 1:1 voxels). But using polygonal LODs could perhaps yield better visuals in this case. The implementation would be complicated in that it would require a completely different rendering path for the LODs, which is why I opted for blocky LODs.

  • @goobus_floobus

    @goobus_floobus

    4 ай бұрын

    @@DouglasDwyer I figured it would add a lot of complexity. Thanks for responding!

  • @JoshuaBarretto

    @JoshuaBarretto

    3 ай бұрын

    The approach we take in Veloren is to use a shader that emulates the behaviour of voxels on LoD objects. It can be quite convincing, even relatively close to the camera.

  • @GabeRundlett
    @GabeRundlett4 ай бұрын

    Let's gooo

  • @ClassyWolf
    @ClassyWolf4 ай бұрын

    Hey that is de_nuke.

  • @icesentry
    @icesentry4 ай бұрын

    Are you switching to webgpu or wgpu? Because those aren't exactly the same thing.

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Switching to WGPU, so kind of both in a way. On desktop I am using just WGPU, on web it is WGPU + WebGPU.

  • @homelikebrick42

    @homelikebrick42

    4 ай бұрын

    they are pretty much the same thing, firefox actually uses wgpu for its WebGPU backend

  • @apersimmon
    @apersimmon4 ай бұрын

    Where can I pay for you to continue making this?

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    That's very kind of you! But I am not yet ready to promise anything regarding this project, so I am not accepting donations. You can support me right now by subscribing and continuing to follow my work.

  • @apersimmon

    @apersimmon

    3 ай бұрын

    ​@@DouglasDwyer Understandable I would have given you money anyway even if you couldn't guarantee anything for the project. But I understand you don't want to take money from people if you cant promise anything, I'm like that my self.

  • @user-vc9rh3bk8t
    @user-vc9rh3bk8t2 ай бұрын

    What do you mean the rendering is done? You're not going to add Ray Tracing Global Illumination MW 2019 gun animations??? /s

  • @GrenFlem
    @GrenFlem4 ай бұрын

    goes to show how much minecraft java would benefit from a new rendering engine aswell as LODs

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Luckily, there are many performance-based mods out there nowadays. But it would be nice if Minecraft Java were, say, rewritten in Rust... 🦀🦀🦀

  • @limieon
    @limieon4 ай бұрын

    Tooley1998 is using UE5 afaik

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Yep, that's my understanding too! I would guess that he still has implemented a custom data representation and LOD system for his voxels too, so his work is impressive from both a technical and visual standpoint.

  • @limieon

    @limieon

    4 ай бұрын

    @@DouglasDwyer I still want to know what he did. I tried Voxel Plugin one time and it was kinda janky. I really wanna make a voxel game (maybe also engine) but Im a noob in every engine and I have good understanding of C++ and no understanding of Rust but Rust is the objectively better choice...

  • @tristunalekzander5608
    @tristunalekzander56084 ай бұрын

    I don't see why you need an octree, that just seems like a lot of memory allocation every time the player moves, you need to recalculate the octree, don't you? If you're already looking at each chunk and figuring out where it goes on the octree by distance, why not just use that distance instead of storing it in an octree?

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    I'm not really looking at every chunk - the octree structure itself is what encodes the position of the data and helps me determine what needs to be loaded. That said, the mention of octrees was meant mostly to explain the hierarchical way that the LODs are organized. I actually use hashmaps to store the data internally, which are a bit more flexible.

  • @tristunalekzander5608

    @tristunalekzander5608

    3 ай бұрын

    @@DouglasDwyer Ah, I see, in the few implementations of voxel LOD I've done, it's just a per chunk thing, and so the minimum LOD is dictated by the chunk size. However, both were finite, and more of a simulation type thing, so the entire world has to be small enough to fit into ram anyway so the LOD was only for GPU memory, not ram. But for yours it's both because your voxels are so small. I think I see now, very cool! PS sorry for rambling I was just playing DnD and I'm a little faded haha great video though man

  • @MatthewHolevinski
    @MatthewHolevinski4 ай бұрын

    needs bazookas

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    agreed

  • @nanta18
    @nanta183 ай бұрын

    Nuke❤

  • @TheMasterOfSafari
    @TheMasterOfSafari4 ай бұрын

    1:30 Meet Gorgeous Latina Women 😂 very nice Ads from YT lol

  • @bacon_with_brussels_sprout
    @bacon_with_brussels_sprout4 ай бұрын

    And mf microsoft struggling with a 15 yr old voxel game

  • @plaguegaming3642
    @plaguegaming36424 ай бұрын

    you should really render in vulkan is at all possible

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    I use WGPU, which is a graphics abstraction layer that allows me to target many backends (including Vulkan)! However, I target DX12 on desktop Windows since swapchains are less buggy in it.

  • @plaguegaming3642

    @plaguegaming3642

    3 ай бұрын

    dont know what all that means but 👍@@DouglasDwyer

  • @Caldaron
    @Caldaron3 ай бұрын

    meet gorgeous latina women ;-)

  • @lemonke8132
    @lemonke81324 ай бұрын

    first

  • @bernadinadimitt3971
    @bernadinadimitt39713 ай бұрын

    "Promo sm"

  • @oliver-nation4377
    @oliver-nation43773 ай бұрын

    I do not understand why anyone would ever use voxels, the graphics sucks so badly, so even what gameplay they might add will not matter in the long run.

  • @asdasfdfgewqgrgyjh
    @asdasfdfgewqgrgyjh4 ай бұрын

    Please for the love of God stop flashbanging us Everytime you show some code. This video looked interesting but I had to stop about 35% of the way in

  • @DouglasDwyer

    @DouglasDwyer

    4 ай бұрын

    Buy sunglasses? 😂

  • @asdasfdfgewqgrgyjh

    @asdasfdfgewqgrgyjh

    3 ай бұрын

    @@DouglasDwyer on order

Келесі