No video

I made a Voxel Engine with Rust (NO GAME ENGINE)

  Рет қаралды 81,557

Tantan

Tantan

Күн бұрын

Time to LEVEL UP my graphics programming skills by making a Voxel Engine from scratch using the Rust programming language.
I've been considering remaking my Unity voxel rpg game using Rust, this is my first test to see if I'm capable of doing a 3D voxel rendering application.
I managed to implement voxel rendering, chunk management, flying camera and simple lightning. Future plans is to optimize the code, I have not done any benchmarks, but it does need some speed improvements.
This was made using wgpu-rs which is a wrapper over OpenGL, DirectX, Vulkan, Metal or WebGPU.
The voxel project is open source here!
github.com/Tan...
Want to support me?
Patreon: / tantandev
XMR:
43Ktj1Bd4Nkaj4fdx6nPvBZkJewcPjxPB9nafnepM7SdGtcU6rhpxyLiV9w3k92rE1UqHTr4BNqe2ScsK1eEENvZDC3W1ur
Resources:
Graphics rendering api:
wgpu.rs/
The tutorial I followed to learn wgpu:
sotrh.github.i...
Relevant resources that may help when learning how to make a voxel engine:
sites.google.c...
A note on these videos, I think they do a great job in showing the realities of making a voxel engine, and at the same time providing good information on how it works.
Voxel Game Mesh Optimizations by ‪@Hopsonn‬
• Voxel Game Mesh Optimi...
I Made Minecraft in 24 Hours by ‪@SamHogan‬
• I Made Minecraft in 24...
Making Minecraft from scratch in 48 hours (NO GAME ENGINE) by ‪@jdh‬
• Making Minecraft from ...
The voxel game I was talking about that I'm considering remaking:
Adding Flying to my Voxel Game: • Adding Flying to my Vo...

Пікірлер: 112
@Tantandev
@Tantandev 3 жыл бұрын
We have almost reached 4k subscribers! Thanks for the support. I have a discord group: discord.gg/9P8QSYf Project source code: github.com/TanTanDev/first_voxel_engine
@zyansheep
@zyansheep 3 жыл бұрын
Woooo!
@alyti
@alyti 3 жыл бұрын
lowkey hoping eventual game is using bevy 👀
@Cal97g
@Cal97g Жыл бұрын
You got 30k now short king
@jdh
@jdh 3 жыл бұрын
Bold of you to use a language with proper memory safety facilities for such a project.
@ahmadj1064
@ahmadj1064 3 жыл бұрын
woah the actual jdh
@Mooskislide
@Mooskislide Жыл бұрын
@jdh what's your opinion on Rust? Personally, I used to listen to the memes then tried it myself about a month ago and enjoyed it a lot.
@poopfungus5097
@poopfungus5097 Жыл бұрын
@@Mooskislide im not jdh but im relatively new to programming (have experience with python fundamentals and thats pretty much it) and im about to try out rust, what to expect?
@bnlbnlbnl
@bnlbnlbnl Жыл бұрын
@@poopfungus5097 greatest language of all time
@baldi1640
@baldi1640 Жыл бұрын
@@bnlbnlbnl "asm" we can't argue
@jsbarretto
@jsbarretto 3 жыл бұрын
Congrats from a Veloren dev! Nice work, I love how approachable the video is. Next up: vertex ambient occlusion, volumetric lighting, animations! Looking forward to seeing this grow.
@cassiejade413
@cassiejade413 3 жыл бұрын
loving the 'hectic programming' spotify playlist u got there
@Tantandev
@Tantandev 3 жыл бұрын
It's very useful when you are in the zone!
@SmoothieBuns
@SmoothieBuns 3 жыл бұрын
You continue to blow my small gamer mind with these projects bro... I'm already looking forward to part 2 👀
@WannibeManisha
@WannibeManisha 3 жыл бұрын
Ohh thats cool! Honestly not surprised you moved to building your own engine in Rust. Really great job and excited to see where you take this!
@Tantandev
@Tantandev 3 жыл бұрын
Haha yeah I was thinking, some people probably could have guessed I would try something like this at some point
@TylerGreen
@TylerGreen 3 жыл бұрын
This is such an awesome devlog, you're one of my faves! I've played around with voxels in Unity and it's not easy lol I'm excited to see where you take this
@blugatroff593
@blugatroff593 3 жыл бұрын
This is really cool! I, while learning wgpu also made a small Voxel Engine and it's fun seeing how you implemented yours. A little story: I was curious about the performance of my Engine and generated a whole bunch of chunks and rendered them at the same time, I was really impressed with the performance (I guess the great performance of Rust can make up for my noobish coding) and started adding more and more chunks until it suddenly crashed. The error message from was something like "not enough memory", i was confused because I was hardly using 100mB of RAM and didn't realize the error was talking about VRAM xD. Next time i ran the program i looked at the vram usage and sure enough it managed to fill up the whole 6GB of my GPU. After thinking for a little too long about why this could be i realized that: something like 500 Chunks * at least ~2000 Vertices per chunk * 8 f32s per Vertex * 4 bytes per f32 = A whole bunch of bytes. So I managed to cram all of the information of a Vertex into one u32, 6bits for each coordinate 0-31, 3 bits for the normal and the remaining 11 for an index into a uniform storage buffer which stores the UVs. I have to be honest, i was quite proud of me that day and it did actually solve the memory problems. I am really curious how you will continue developing your Engine, it would be absolutely amazing if you can translate even just the some the features of your Unity Voxel RPG into Rust and make an actual game. My projects rarely last beyond the experimentation stage. Great video and channel overall!
@Tantandev
@Tantandev 3 жыл бұрын
What a great story to read! Next up is looking at optimization, I will keep this in mind
@TheGhostandTheFlame
@TheGhostandTheFlame 3 жыл бұрын
I'm a simple man: I see a Tantan video, I press like
@sotrh7974
@sotrh7974 3 жыл бұрын
Nice video! Glad my tutorial was helpful! I've been thinking of implementing my own voxel engine as well.
@Tantandev
@Tantandev 3 жыл бұрын
The legend himself! :O
@sotrh7974
@sotrh7974 3 жыл бұрын
@@Tantandev I'd hardly say legend, but thanks!
@flyingsquirrel3271
@flyingsquirrel3271 3 жыл бұрын
Impresive project! Looks like RIIR is not just a meme :D I can definitely relate to your decision to try this. Actually that's probably the biggest downside of rust: Once you know it well enough, you want to write EVERYTHING in it. At this point pretty much every other language just feel unsatisfying and brittle to me.
@Tantandev
@Tantandev 3 жыл бұрын
Haha yeaah Rust messes with my head when I go to other languages, I want me Enums :p
@onichan6897
@onichan6897 2 жыл бұрын
Coming from dynamic language,. Rust have a steep learning curve, borrow checker is a pain to deal with at first, but when I finally get it my code is so much cleaner.
@ktmochiii
@ktmochiii 3 жыл бұрын
what a madlad. man said "no need for game engine i got this."
@Zac8668
@Zac8668 3 жыл бұрын
This video is so nice! You inspired me, downloading rust rn, can't wait to try it. Update: I'm following the book and damn is kinda complicated, for me at least that just used python lol, but I'm enjoying, gonna get the basics of the language and try to find a PyGame for rust and make some games.
@Tantandev
@Tantandev 3 жыл бұрын
Hope it goes well! You can ask away in my discord if you need help, we are friendly :)
@Zac8668
@Zac8668 2 жыл бұрын
@blot Still programming on it :) really nice, really like it and even did some gigs with game dev on it, the pygame for rust is Macroquad ;)
@sombrastudios
@sombrastudios 2 жыл бұрын
Hey Zac, 9 Months later now, how is it going?
@mikael808
@mikael808 3 жыл бұрын
Really cool video! I like that you show how you made it, it is really interesting to watch! :)
@Conlexio
@Conlexio 3 жыл бұрын
omg i’m so excited
@kjpg7413
@kjpg7413 3 жыл бұрын
Adding to my other comment, also IMO we should teach people to use the Simplex-type noise options in these libraries, and seek out libraries with them (FNL has it), to avoid Perlin's tendency to align features with the grid directions. Perlin has had a stronghold in the PCG community for not very good reason, when there are functions out there better suited to more purposes.
@Tantandev
@Tantandev 3 жыл бұрын
I will definitely explore more noise functions! what is FNL?
@kjpg7413
@kjpg7413 3 жыл бұрын
@@Tantandev FastNoiseLite. Successor to FastNoise. It's open source (github). The simplex-type noise functions in it are good for producing less visible grid following, and the domain rotation options in it are good for making the 3D functions that otherwise look griddy: Perlin, Value, and Value-Cubic) look good in 2D plane slices. (Using the 3D evaluator function)
@ThunderYorn
@ThunderYorn 3 жыл бұрын
Heeey Tantan amazing video as always, it's really nice to follow your progress with rust and the voxel game. The animations that you put in the video were really pleasant, I really enjoy the rhythm of your videos :)
@Tantandev
@Tantandev 3 жыл бұрын
Means a lot! Your comments always cheers me up!
@foodwaterwifi5034
@foodwaterwifi5034 Жыл бұрын
Thank you so much for making this video. I was about to cry because I couldn't figure out where the flickering was coming from, but it's the backend :')
@eboatwright_
@eboatwright_ 3 жыл бұрын
This is really interesting! You're really good with this stuff. :)
@thefatfebruary1063
@thefatfebruary1063 3 жыл бұрын
humungus Pog the bababoi is at it again with rust less gooo
@frankdev2988
@frankdev2988 3 жыл бұрын
Cant wait to watch
@krtirtho
@krtirtho 3 жыл бұрын
You're awesome. Nice work👍
@arkansaatolo1666
@arkansaatolo1666 3 жыл бұрын
omg, I love these little animations everywhere! This is amazing
@NoCrispin
@NoCrispin 3 жыл бұрын
Inspiring video as always.
@stormbringer1330
@stormbringer1330 3 жыл бұрын
So coooool. Thank's. I learn rust right now, and your voxel engien look's really great, and inspirating for me. Thank's a lot for your sharing. I hope, you will continue to talk about your engine. Good job and keep courgage for the next steps.
@Tantandev
@Tantandev 3 жыл бұрын
Thank you! I'm next going to look into optimizing the code which will be super interesting, I think atleast haha.
@SergioRibera
@SergioRibera 3 жыл бұрын
Wow, that's very amazing
@Naftoreiclag
@Naftoreiclag 3 жыл бұрын
ok now this is epic
@ThaRemo
@ThaRemo 3 жыл бұрын
My man, that's pretty sick progress! I've been holding off on getting into WGPU but this made it seem quite approachable, gonna give it a shot soon!
@otistically
@otistically 2 жыл бұрын
I like your Carykh-like character.
@pnc_luiz
@pnc_luiz 3 жыл бұрын
Love seeing Rust getting popular with game devs! Great devblog, keep it going!
@sanderbos4243
@sanderbos4243 2 жыл бұрын
Very cool devlog, thanks!
@Skeffles
@Skeffles 3 жыл бұрын
Another great rust video! The engine looks great and I can't wait to see if you actually integrate it with your game.
@WorstDeveloper
@WorstDeveloper 3 жыл бұрын
7:04 - You have a typo in your code. "set_density_fraciton"
@pxolqopt3597
@pxolqopt3597 Жыл бұрын
The one bad thing about code autocompletion is typos like this won't be discovered for a long time
@amanthakur4145
@amanthakur4145 2 жыл бұрын
Everyone in the world wants to become Software Engineer just because of 6 figured salary but few person like you really loves to write the code and build project that the true spirit who is passionate about building out projects.
@cartodados9589
@cartodados9589 3 жыл бұрын
Nice move man, I will follow up, very inspiring.
@barj
@barj 3 жыл бұрын
The Rusty Man himself
@DestusG
@DestusG 2 жыл бұрын
Damn this is awesome
@nexovec
@nexovec 3 жыл бұрын
I like the way you jenerated the schunk and adschechted the values.
@eboatwright_
@eboatwright_ 3 жыл бұрын
I'm gonna learn WGPU-rs and Rust! :D Wish me luck!
@Tantandev
@Tantandev 3 жыл бұрын
brave brave man! good luck :D
@eboatwright_
@eboatwright_ 3 жыл бұрын
@@Tantandev :D
@grillad5
@grillad5 3 жыл бұрын
Great video! Great information about the process even i understood :)
@jupyter_core9411
@jupyter_core9411 Жыл бұрын
Awesome video man! I saw the guy who made Assetto corsa using wgpu-rs to build his next game. I thought about about using it to mess around with building a voxel engine but ended up on the c library raylib. I want to try and understand how a voxel engine works before diving into graphics programming.
@amjadiqbal478
@amjadiqbal478 Жыл бұрын
Rust, the new foundation for new languages. Keep it up tantan. Would be grateful, if you could also publish a brief of your becoming a programmer for the inspiration on your channel, please. Thanks.
@roccociccone597
@roccociccone597 Жыл бұрын
I've recently started dabbling with developing a game without an engine, and I thought it was a good idea to use vulkan directly. But turns out wgpu probably is a better idea :)
@trinidad17
@trinidad17 2 жыл бұрын
Interesting project, specially given the need to learn rendering by yourself. The only problem I have with this is that those are what I like to call boxels, not fully fledged voxels. In the same way that a bitmap is not just back and white, but have values in between and even representing not just grayscale but colors which are not even linear, the same can apply to voxels. A voxel "image" can define a scalar field, like those used for MRI images and rendered smoothly either using threshold values which probably now is totally doable using just shaders, but the easier way out is using marching cubes over that scalar field in order to render it using polygons.
@algs5483
@algs5483 3 жыл бұрын
Tantan = rust lover You cannot change my mind.
@user-wc1sm8cj8s
@user-wc1sm8cj8s 3 жыл бұрын
"I end up writing unoptimized bad code because it is fast and easy to do, and in the end, it ends up harder to work with." Man, I can't relate much more, LOL, happens to me if not most, but all the times. The spaghetti code, the class that doesn't make sense, the dwindling interest in the project, LMFAO, seems I'm looking on a clone of me, hahahhahahahah. Can't help myself with how much I can relate to this dude!
@JeremyChone
@JeremyChone 3 жыл бұрын
First, great vid as usual. One question, why no Bevy? Would Bevy have made it faster or harder to do this project (I am not a game developer, so, just curious).
@Tantandev
@Tantandev 3 жыл бұрын
Bevy might have been a little bit faster due to not requiring as much graphics rendering knowledge (maybe), but my goal is to better understand how it works as low level I can, because I find it really interesting.
@JeremyChone
@JeremyChone 3 жыл бұрын
@@Tantandev Makes total sense. Thanks for the answer. Cool channel!
@ajayojha955
@ajayojha955 3 жыл бұрын
Can you please make a crash course for graphics programming in wgpu? 🙏
@ZooHair
@ZooHair 3 жыл бұрын
Coffeeeee
@isabellolsson8919
@isabellolsson8919 3 жыл бұрын
''I'm a banana'' 0:11
@nix3l_
@nix3l_ 2 жыл бұрын
Wow, i didnt even know that rust had bindings for opengl!
@Tantandev
@Tantandev 2 жыл бұрын
I'm very impressed how many libraries exists for Rust!
@Skyefaux
@Skyefaux 2 жыл бұрын
I still haven't successfully done the triangle program... I've tried several times over the last couple months
@JZSNooB
@JZSNooB 3 жыл бұрын
god speed
@coffee-is-power
@coffee-is-power 2 жыл бұрын
Why did you use fast noise instead of the FOSS version?
@alexmercer4795
@alexmercer4795 3 жыл бұрын
Heath Ledger is alive
@Eldermanable
@Eldermanable 3 жыл бұрын
So if we don't use game engine, we'll need coffee
@falxie_
@falxie_ 3 жыл бұрын
I was wondering if you'd do this
@toibiu
@toibiu 3 жыл бұрын
Hey! I am Jeff. I have done some basic (very basic) programming before. I decided that I am going to learn to make games using rust. Absolutely following your channel and your links are very helpful. As a complete novice to programming do you have ideas for projects that I could start with to help me progress??? (I really dont even know what a library is yet =P)
@mariobroselli3642
@mariobroselli3642 5 ай бұрын
I am surprised you managed to shift from Python to a more complex language without learning C. How about doing it with Racket, Elixir or Clojure or Scala?😮
@jemsurfer3905
@jemsurfer3905 3 жыл бұрын
3:02 probably windows not working properly with vulkan, less likely to be a problem with the library
@user-bj6lk4wh7y
@user-bj6lk4wh7y 3 жыл бұрын
good vidoe :)
@rafaeu292
@rafaeu292 2 жыл бұрын
Rust is a better option than C++ when creating a game right? With no game engine that is
@Zac8668
@Zac8668 2 жыл бұрын
Well the setup is easier, best option is really broad and there is preferences to something like this, but it's really good 👍
@toshinoriyagi4686
@toshinoriyagi4686 2 жыл бұрын
is this the new cubeworld?
@koensampers5505
@koensampers5505 3 жыл бұрын
Heya tantan. Have you ever used the gdnative crate for rust to use rust in the godot game engine? I recommend you try it out cause it gives you a GUI where u can work with
@judgsmith
@judgsmith 2 жыл бұрын
Have you seen wbk?
@paspielka
@paspielka Жыл бұрын
Nice video, but why is it in 15~ fps
@BracketGuySerious
@BracketGuySerious 2 жыл бұрын
Why is your video 5 fps?
@wizardnotknown
@wizardnotknown 2 жыл бұрын
Ah yes making a Game Engine with Rust then specifying you did not use any free Game Engine out there to build your Game Engine made with Rust.
@noeljose
@noeljose Жыл бұрын
you look like heath ledger
@thezava
@thezava 2 жыл бұрын
This is not a voxel graphic, it uses a polygonal mesh that simulates voxels, for a full voxel graphic, you need to use a 3D point tree and recursive ray casting (for relistic rendering) 🤨
@daniil2704
@daniil2704 8 ай бұрын
07:10 let height_val = height_val * 1f64; - ???
@vpowertvmusic7203
@vpowertvmusic7203 2 жыл бұрын
1:38 lmao unity
@eygs493
@eygs493 Жыл бұрын
bro you rock
Making my Voxel Engine faster
16:38
Tantan
Рет қаралды 45 М.
ChatGPT makes Voxel Engine with Rust
12:20
Tantan
Рет қаралды 94 М.
Incredible Dog Rescues Kittens from Bus - Inspiring Story #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 27 МЛН
ISSEI & yellow girl 💛
00:33
ISSEI / いっせい
Рет қаралды 25 МЛН
This Dumbbell Is Impossible To Lift!
01:00
Stokes Twins
Рет қаралды 35 МЛН
100 Hours Of Graphics Programming
6:48
Tantan
Рет қаралды 152 М.
I Optimised My Game Engine Up To 12000 FPS
11:58
Vercidium
Рет қаралды 650 М.
Minecraft On Scratch Is Possible
9:35
ggenije
Рет қаралды 406 М.
RETRO VOXEL ENGINE! // Code Review
36:18
The Cherno
Рет қаралды 178 М.
Making a difficult game about fitting in - Acerola Jam 0
19:17
jess::codes
Рет қаралды 352 М.
Rust is not a faster horse
11:37
No Boilerplate
Рет қаралды 324 М.
Boxel Engine #1 | RAYTRACING my voxels
9:43
Hukuna
Рет қаралды 15 М.
Making a Voxel Engine from SCRATCH (w/ Destruction)
14:31
MaxMakesGames
Рет қаралды 33 М.
Incredible Dog Rescues Kittens from Bus - Inspiring Story #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 27 МЛН