Tantan
Tantan
  • 64
  • 2 506 544
Blazingly Fast Greedy Mesher - Voxel Engine Optimizations
This greedy mesher is blazingly fast. Written with Rust and Bevy, using clever bitwise operations we can generate chunk meshes, an average of 0.000195 per 32x32x32 mesh!!!
This mesher blows most culled meshers out of the water, and I want to teach you the "secrets" of how to implement this for own voxel engine.
There are 2 algorithms we'll explore:
Binary greedy meshing AND binary face culling.
IT'S OPEN SOURCE!
github.com/TanTanDev/binary_greedy_mesher_demo
Resources:
Greedy Meshing Voxels Fast - Optimism in Design Handmade Seattle 2022: czcams.com/video/4xs66m1Of4A/video.htmlfeature=shared
C++ binary greedy mesher repository: github.com/cgerikj/binary-greedy-meshing
Simplified greedy mesher article: vercidium.com/blog/voxel-world-optimisations/
My discord group:
discord.gg/9P8QSYf
Want to support me?
⁍ Patreon: patreon.com/Tantandev
⁍ Monero: 43Ktj1Bd4Nkaj4fdx6nPvBZkJewcPjxPB9nafnepM7SdGtcU6rhpxyLiV9w3k92rE1UqHTr4BNqe2ScsK1eEENvZDC3W1ur
0:00 blazingly fast
0:30 but why?
2:56 greedy meshing algorithm
4:23 indexing?
4:52 binary data
5:43 code: binary greedy meshing
7:44 chunk slicing
10:14 why it's slow
11:24 WORLDS FASTEST binary greedy mesher
19:43 why it's fast
21:01 interesting findings
22:22 resources
#rustlang #gamedev #programming
zhlédnutí: 99 152

Video

your first RUST programming experience
zhlédnutí 28KPřed 4 měsíci
Learning the RUST programming language can be a turbulent experience. Welcome to rust, enjoy your stay! My discord group: discord.gg/9P8QSYf Want to support me? ⁍ Patreon: patreon.com/Tantandev ⁍ Monero: 43Ktj1Bd4Nkaj4fdx6nPvBZkJewcPjxPB9nafnepM7SdGtcU6rhpxyLiV9w3k92rE1UqHTr4BNqe2ScsK1eEENvZDC3W1ur #rustlang #gamedev #programming
5 RUST DEVS Make a GAME Without COMMUNICATING!
zhlédnutí 21KPřed 5 měsíci
rust bevy developers tries to make a smash hit of a game without communicating. No communication rust edition ;) thanks @Blackthornprod for the inspiration! project source code: github.com/TanTanDev/no_communication_0 My discord group: discord.gg/9P8QSYf Want to support me? ⁍ Patreon: patreon.com/Tantandev ⁍ Monero: 43Ktj1Bd4Nkaj4fdx6nPvBZkJewcPjxPB9nafnepM7SdGtcU6rhpxyLiV9w3k92rE1UqHTr4BNqe2Sc...
Game Development With Strangers
zhlédnutí 8KPřed 5 měsíci
I invited 2 strangers to make a game together. We made a rouge like dungeon crawler using RUST and BEVY. My favorite programming language and game engine. We only had 3 days to make the game for the bevy game jam 4. GAME LINK: tantandev.itch.io/forest-cleaner My discord group: discord.gg/9P8QSYf Want to support me? ⁍ Patreon: patreon.com/Tantandev ⁍ Monero: 43Ktj1Bd4Nkaj4fdx6nPvBZkJewcPjxPB9naf...
200 Days Of Game Development Progress
zhlédnutí 28KPřed 6 měsíci
Tower Defense typing rougelike a glorious combination for this game I'm making using the rust programming language and the bevy game engine. I documented the 200 days of development of this game, show the unexpected game design problems and opportunities. I WILL SHIP A GAME! My discord group: discord.gg/9P8QSYf Want to support me? ⁍ Patreon: patreon.com/Tantandev ⁍ Monero: 43Ktj1Bd4Nkaj4fdx6nPv...
Bevy & Rust Star Wars Scene - How it Works
zhlédnutí 17KPřed 7 měsíci
BEVY and RUST Star Wars = epic. This is a code breakdown / walk through of this project I built in 1 hour using Bevy and Rust. Everything from laser shooting walkers xwing to procedual world generation to heightmap rendering shader. PROJECT SOURCE CODE: github.com/TanTanDev/not_star_wars.git VIDEO OF ME BUILDING THIS PROJECT in 1 hour no commentary: czcams.com/video/poyTZE8exb0/video.htmlfeatur...
ASMR programming STAR WARS - RUST & BEVY
zhlédnutí 13KPřed 7 měsíci
ASMR programming star wars inspired "game" made with BEVY and RUST, no commentary. Lasers, walkers, xwing, a stunning fog ridden desert landscape. I wanted to showcase cool projects you can make with Bevy and Rust, I edited away long time of mistakes so you don't have to suffer through that in a 3 hour video :P PROJECT SOURCE CODE: github.com/TanTanDev/not_star_wars.git MILESTONE TIMESTAMPS: 0:...
Game Engine Of The Future
zhlédnutí 133KPřed 8 měsíci
Bevy, the future powerhouse game engine that will power many games. Today I break down the core philosophy of this game engine, and outline why the engines core philosophies are so powerful, that will truly shine among the game industry's adopted game engine standards (Unity, Unreal, Godot, GameMaker etc...). GAMES SHOWCASED IN VIDEO: 0:14 Procedual 3D - i_am_feenster 0:15 flappy be...
rust macros are magic
zhlédnutí 44KPřed 10 měsíci
Rust macros are magic. I want to show you a real life application of a powerful rust macro I put together, that handles spell assets in the bevy game engine. If you want to learn more about macro programming with Rust I recommend checking these videos out: Rust's Witchcraft by @NoBoilerplate czcams.com/video/MWRPYBoCEaY/video.html Declarative Macros in Rust by @letsgetrusty czcams.com/video/KsJ...
Programming Language Name Tier List
zhlédnutí 13KPřed rokem
Time to rank programming languages NAMES. Are the programming languages names fun to say, is it descriptive of what the language is capable of... Who shall prevail in this ULTIMATE tier list? My discord group: discord.gg/9P8QSYf Want to support me? ⁍ Patreon: patreon.com/Tantandev ⁍ Monero: 43Ktj1Bd4Nkaj4fdx6nPvBZkJewcPjxPB9nafnepM7SdGtcU6rhpxyLiV9w3k92rE1UqHTr4BNqe2ScsK1eEENvZDC3W1ur #gamedev ...
2 Game Genres You Wouldn't Expect to Work Together
zhlédnutí 13KPřed rokem
Tower defence typing game, a game genre combination that on paper doesn't sound like they would work together, yet somehow they do. WELCOME TO MY NEW DEVLOG, a week of programming with Rust and Bevy, and this is the result. Hope you like it :) My discord group: discord.gg/9P8QSYf Want to support me? ⁍ Patreon: patreon.com/Tantandev ⁍ Monero: 43Ktj1Bd4Nkaj4fdx6nPvBZkJewcPjxPB9nafnepM7SdGtcU6rhpx...
Pushing the rendering limits - Rust Voxel Engine
zhlédnutí 85KPřed rokem
I implemented 6 new rendering related techniques in my voxel engine using the rust programming language and Bevy game engine. pbr integration, shadow rendering, fog, level of detail (LOD), far distance heightmap approximation, skybox. My discord group: discord.gg/9P8QSYf Want to support me? ⁍ Patreon: patreon.com/Tantandev ⁍ Monero: 43Ktj1Bd4Nkaj4fdx6nPvBZkJewcPjxPB9nafnepM7SdGtcU6rhpxyLiV9w3k9...
ChatGPT makes Voxel Engine with Rust
zhlédnutí 90KPřed rokem
I put artificial intelligence to the test by making a voxel engine using the rust programming language and the bevy game engine. How useful is ChatGPT for programming really? SOURCE CODE (good luck lol): github.com/TanTanDev/chat_gpt_makes_voxel_engine.git My discord group: discord.gg/9P8QSYf Want to support me? ⁍ Patreon: patreon.com/Tantandev ⁍ Monero: 43Ktj1Bd4Nkaj4fdx6nPvBZkJewcPjxPB9nafnep...
Procedual Voxel Tree Generation - Rust Game
zhlédnutí 33KPřed rokem
Procedual Voxel Tree Generation - Rust Game
Making A Multidimensional Game
zhlédnutí 15KPřed rokem
Making A Multidimensional Game
Multiplayer programming bug BROKE MY GAME
zhlédnutí 17KPřed rokem
Multiplayer programming bug BROKE MY GAME
Voxel Game development - Creatures and Spells
zhlédnutí 36KPřed rokem
Voxel Game development - Creatures and Spells
Voxel Game Development Is Hard
zhlédnutí 94KPřed rokem
Voxel Game Development Is Hard
your text editor SUCKS
zhlédnutí 36KPřed rokem
your text editor SUCKS
Rust breakout game tutorial
zhlédnutí 30KPřed rokem
Rust breakout game tutorial
automating git with rust (don't try this at home)
zhlédnutí 28KPřed rokem
automating git with rust (don't try this at home)
one month voxel game development
zhlédnutí 50KPřed 2 lety
one month voxel game development
1 week no computer mouse challenge
zhlédnutí 22KPřed 2 lety
1 week no computer mouse challenge
Rust multi-threading code review
zhlédnutí 195KPřed 2 lety
Rust multi-threading code review
From idea to open source in 5 days
zhlédnutí 17KPřed 2 lety
From idea to open source in 5 days
3D Cellular Automata - complex behavior from simple rules
zhlédnutí 37KPřed 2 lety
3D Cellular Automata - complex behavior from simple rules
100 Hours Of Graphics Programming
zhlédnutí 144KPřed 2 lety
100 Hours Of Graphics Programming
Best unity game wins 1000$ - PolyMars & Tantan
zhlédnutí 11KPřed 2 lety
Best unity game wins 1000$ - PolyMars & Tantan
I freaking LOVE programming
zhlédnutí 17KPřed 2 lety
I freaking LOVE programming
Rust and Unity game development
zhlédnutí 46KPřed 2 lety
Rust and Unity game development

Komentáře

  • @thygrrr
    @thygrrr Před 4 minutami

    I think your memory layout can probably benefit a little from ordering by which stage of execution needs the direction. The newer CPU has a better cache and branch prediction, and that's why it outperformed on the culled renderer. The greedy mesher caused it to stall more, so these advantages were likely nullified. Your greedy mesher seems to tax the cache a lot - your blocks are 32x32x32 bits (right?), and interleaved in triples; but it could be better to somehow make them fit into 64x8=8x8x8 bits (64 bytes, a cache line) for each of their core operations. So, making the block smaller by a factor of 2 to 4 in every dimension AND ordering the memory according to execution order / ordering execution to be doing operations on directly adjacent memory blocks directly after one another could probably give you another big boost.

  • @zxuiji
    @zxuiji Před 8 hodinami

    7:41 Uh StdDev and MAD appear to be faster though? A picosecond is smaller than a nanosecond, 1000th of it to be exact. Even when their results entered nanoseconds in your example they appear to have been roughly 150-155 times faster.

  • @zxuiji
    @zxuiji Před 9 hodinami

    4:55, I'd like to make different suggestion that isn't so memory hungry. To start with, yes every block type shares the same map area. When the game 1st boots it also produces the very first binary map, doesn't matter what type, only that the types are looped through in order during this. You might need some additional binary maps depending on how faster the mesher is vs the binary mapper. Every time you finish one binary map you permit the mesher to go through it, whenever the mesher does this it recends it's right to do so at the end by putting it back in the pool of maps to map to. This way you have at most a few dozen maps to use for any number of block types. It all depends on how many potential block types can be assigned to the same map. So if you're map is say 8x8x8 then you have at most 2048 potential binary maps to make. Let's be real, that's only going to happen if the player is allowed to place block types and the player happens to be a limit pusher of some kind like "let's game it out".

  • @LosManexStudio666
    @LosManexStudio666 Před dnem

    For non-programming people programming looks like magic, but for me graphics programming looks like magic :D I wish i will have enough courage to learn it someday

  • @artimdutton
    @artimdutton Před dnem

    You lost me a rust, legit 18 seconds in

  • @danieles6684
    @danieles6684 Před 2 dny

    What glider game is shown at 1:47? It looks beautiful

  • @Burgo361
    @Burgo361 Před 2 dny

    At least it gave you an amusing outro

  • @machiii7394
    @machiii7394 Před 3 dny

    Crying rn that Lua was only B tier to you 😂 Great beginner language imo (no reasonable person likes indented languages, Python.) especially since it’s the staple of Roblox, which very well means it’s introducing programming to the youth, and that’s always welcome.

  • @dragon-xt4vw
    @dragon-xt4vw Před 3 dny

    Misread the title as "Racist Multi-Threading Code Review". Seemed a curious thing.

  • @ivangh94
    @ivangh94 Před 5 dny

    A true tool for coders, while we develop games we can share our plugins. Yes, Godot is great and will become much better, but it is not the best tool for coders.

  • @stephenmcconnell7868

    I program on Mac and don’t use dlls (dumb language libs). How does one get around this?

  • @Fittiboy
    @Fittiboy Před 6 dny

    Great video, thanks for explaining it so well! Just started making my first game in Godot, when I suddenly learned about ECS. Since I love Rust, I was extremely tempted to switch over to bevy, but the lack of an official editor is a deal breaker for me as a complete beginner. I could do it the hard way, learning game dev entirely with bevy. I'm sure that would make me a better dev in the end. As complexity grows, existing abstractions you import through frameworks become too limited and you need to dig deeper. In Godot I already had to ditch the particle system and handle that myself due to engine limitations. That's why I love love love that bevy has such loose, almost nonexistent boundaries between the game engine and the game you make using it. If it's all Rust, it's so much more ergonomic! I'll definitely start learning bevy relatively soon! But for now I'll stick with the extremely helpful GUI the Godot editor gives me!

  • @VulpeculaJoy
    @VulpeculaJoy Před 7 dny

    Someone on the internet makes a fast greedy voxel mesher. *distant horizons 2.0 has entered chat

  • @dominobuilder100
    @dominobuilder100 Před 7 dny

    This was insanely interesting. I wonder if any of this could be used to optimize minecraft

  • @guilhermerafaelzimermann4196

    If i wasn't suffering from severe autistic burnout *and* had enough focus and time to properly learn all these different optimized voxel engines i've watched people on youtube do, i'd probably already have all the info i need to construct the fastest physically possible voxel renderer with real time editable terrain

  • @johnmoser3594
    @johnmoser3594 Před 11 dny

    "Greedy meshing is slow…er" lol Can you do a video continuing to explore your use of this greedy meshing code with things like how to minimize the amount of additional work done when inserting and removing voxels, and how determine and what to do when a lot of voxels are changed in an area (such as blowing something up or hitting it with a 4x4x4 hammer that smashes a whole cube of 64 blocks at once)? I'm doing my own voxel engine and I don't think I can improve on your approach here, and there are a lot of problems to solve in general. (My voxel plugin is just for terrain, so it's simple; the goal is to allow the programmer to just plop blocks in the world and have it do the right thing, including handling meshing, culling of non-visible blocks, hitbox compositing, and so forth.)

  • @meetem7374
    @meetem7374 Před 12 dny

    Oh! Great catch. Initially in my rendering I've used 64 bitmasks, because my chunks (not rendering chunks) were always 4x4x4 voxels. Tho I haven't implemented a greedy meshing, because I need to support much more than a solid block, so different shapes etc. End up with custom rasterizer.

  • @hujiko44745278184
    @hujiko44745278184 Před 13 dny

    Cool 😎

  • @simple_classic
    @simple_classic Před 16 dny

    YO THIS IS A PAPER

  • @GaijinXIII
    @GaijinXIII Před 16 dny

    Offense taken.

  • @rybeardj
    @rybeardj Před 16 dny

    trojan detected, don't download

  • @1____-____1
    @1____-____1 Před 17 dny

    When I saw the file picked I said "hmm, that looks a lot like Helix".

  • @NexusKiwi
    @NexusKiwi Před 21 dnem

    So impressive

  • @shadow_blader192
    @shadow_blader192 Před 23 dny

    3:20 i dont know, but it sounds like TCP

  • @gustavosantiago1543
    @gustavosantiago1543 Před 24 dny

    Is there really a need for all those flat arrays? Wouldn't the compiler allocate n-dimensional statically sized arrays contiguously anyways?

  • @jawtaro4583
    @jawtaro4583 Před 24 dny

    reminds me of the game, Kingdom

  • @alby13
    @alby13 Před 24 dny

    i want to play the gme

  • @jackjohnes2623
    @jackjohnes2623 Před 26 dny

    I imagine, there should be a way to optimise the procedure at ~3:35 so that the whole meshing step is complete in the smallest number of expansions possible (for the general case).

  • @Aspadien
    @Aspadien Před 28 dny

    I wanted this video and I find

  • @CielMC
    @CielMC Před 29 dny

    1. You're using Rust, why would you care that it's too complicated for people 2. Simdeez time? 3. I see a few temp Vecs like the one from the greedy mesher, there is probably a better way to avoid those allocations, perhaps with an `impl Iterator`(wish generators are stable) or just a vec that you pass &mut to the function so they don't have to allocate their own, or maybe you can give the function your vertex buffer and have the function append to it directly.

  • @CielMC
    @CielMC Před 29 dny

    Blazingly fast 🔥🚀

  • @intbar
    @intbar Před 29 dny

    Some things to note: You couldve navigated the Open/Save As/Open Folder dialogs entirely with the keyboard When you land on the dialog, your focus is on the file name area Press shift + tab 3 times to access the folder tree on the left and use the arrow keys to select the folder you want, expand it with right arrow or collapse with left Then press enter and the folder should be open in the folder pane on the right Use the arrow keys or start typing the name of the file/folder you want, then once the item you want is selected and you see its name in the folder/file name area, press alt + o to click the open button (or alt + s to click the save button if save dialog) Alternatively once in the right folder you can press alt + n to select the folder/file name field and type it there, to select a suggestion there (then press enter or alt + o to select) Also also in apps with menu bars you can press alt + the first letter of the menu button (like alt + f for file menu) then follow the underlined letters to select options

  • @guisampaio2008
    @guisampaio2008 Před měsícem

    Make it faster.

  • @holyknighthodrick5223
    @holyknighthodrick5223 Před měsícem

    Now speedrun vulkan triangle from memory, without storing the vertices in the shader, and selecting the memory types correctly, and ensuring validation layers are enabled but with no errors. No using vkb or vma. Edit: And no dynamic rendering

  • @tedchirvasiu
    @tedchirvasiu Před měsícem

    shank

  • @thanatosor
    @thanatosor Před měsícem

    So that's how devs spread dozen of weird named libraries... to get high 😂

  • @thanatosor
    @thanatosor Před měsícem

    Wait, I need speed to handle 10Billions polygons in a single mesh 😂

  • @thanatosor
    @thanatosor Před měsícem

    This guy don't need drug to get high, but coding 😂

  • @GabrielxC
    @GabrielxC Před měsícem

    My culled mesher in my i5 of second generation is around 0.102156ms even I got 0.0947ms

  • @jamesalewis
    @jamesalewis Před měsícem

    This is the same algorithm as bitmap edge detection. Shift-not-and-ing is really common in other applications 🤙

  • @TiagoTiagoT
    @TiagoTiagoT Před měsícem

    What if instead of always checking one direction all the way first, you checked all axes, and picked the one that grew the rectangle/ractangular-cuboid (not the name I remember the shape having, but it's what Wikipedia told me it's called, the generic brick shape) the most? Would the delay added by the measuring and comparison be enough to counter the faster growth of the block per-step on average?

  • @sunofabeach9424
    @sunofabeach9424 Před měsícem

    50:12 are you a wayland user by chance?

  • @GabrielxC
    @GabrielxC Před měsícem

    In the beginning of the video looking the rust syntax is the reason why C is better, why make things harder for nothing why?

    • @Wyvernnnn
      @Wyvernnnn Před dnem

      Because it's not for nothing and provides invaluable features that C could never have?

  • @MrRolnicek
    @MrRolnicek Před měsícem

    So what you're saying is: If your voxel data was already bools in the binary matrix of the world ... this whole thing would be 60% faster still? Since you wouldn't need the step that converts the data, right?

  • @bellattery
    @bellattery Před měsícem

    Whats funny about this, the more you don't use something that made everything infinitely easier the more you learn how a PC was originally designed. It actually helps people think better, problem solve especially how it helps you adapt and teach people about hotkeys, menu drops and new software to assist you and even from the beginning of the video you had stated you created something to make it easier this has to be healthy for us! (or maybe i'm going overboard and getting too excited over this minor thing lol)

  • @SirRelith
    @SirRelith Před měsícem

    Is it possible to make write this threaded? each axis having it's own thread? or somehow execute this on a gpu? Thx for the deep dive, I learned a lot!

  • @petemoss3160
    @petemoss3160 Před měsícem

    4:50 ... the humans are dead!

  • @AmaroqStarwind
    @AmaroqStarwind Před měsícem

    Every time you say "chunk", it sounds like "shaunk"

  • @GeorgeTsiros
    @GeorgeTsiros Před měsícem

    i love everything about this your awkward presentation, the handdrawn sketches, the weird pronounciation, the focus on speed, your manbun, your long hair that makes you look like a metalhead, the jokes, the effort you made, everything, everything in this video is just *right* .

  • @CottidaeSEA
    @CottidaeSEA Před měsícem

    My first idea was to just bitmask. If you have a 1x4 area and want to check the area next to it, it'd be far faster and cheaper to just get the area next to it, use the first one as a bit mask over it and if there are no differences then it's all good and you can proceed. If it isn't, you can check where the differences begin and then you can discard from the conflicting side and then keep going. Okay, seems like that's pretty much exactly what's done.