No video

Voxel Space (Comanche Terrain Rendering)

  Рет қаралды 26,443

pikuma

pikuma

Күн бұрын

Пікірлер: 145
@ricepony33
@ricepony33 Жыл бұрын
I remember being blown away with delta force because there was no pop in and you could zoom forever. Felt like the future!
@PlasticCogLiquid
@PlasticCogLiquid 10 ай бұрын
It still works too, I still play the first 3 games pretty often
@Eugensson
@Eugensson 6 ай бұрын
I remember how laggy it was on my pc
@josiahjack455
@josiahjack455 11 ай бұрын
Would love if you dived into this more. Looks like there is some kind of deterministic noise in Delta Force giving extra detail, coupled with color blending and perhaps height blending. Would be interesting to explore how these might work.
@touilleMan
@touilleMan Жыл бұрын
Well I have to say I didn't plan to spend my new year eve watching a voxel engine video, but I peek just a bit I got hooked until the end ! Happy 2023 folks, this is a very nice way to start the year 🤠
@ghosthuntergr
@ghosthuntergr Жыл бұрын
Gustavo you are a unique teacher and presenter!
@guilhermecampos8313
@guilhermecampos8313 15 күн бұрын
Hallelujah! Lots of fun doing it!
@pikuma
@pikuma 15 күн бұрын
@@guilhermecampos8313 That's the goal. 🙂
@RyanZola
@RyanZola Жыл бұрын
Hallelujah! I made it all the way! Thank you for this fun and relaxing weekend programming adventure after a crazy week of professional programming lol. Thanks to your other videos and courses, i was also able to implement the lerp on the tilting motions as well as a gradual acceleration and deceleration. Super fun!
@pikuma
@pikuma Жыл бұрын
Great stuff! :)
@ViniciusSoaresBatista
@ViniciusSoaresBatista 2 ай бұрын
Your passion for teaching is inspiring
@pikuma
@pikuma 2 ай бұрын
Grande Vinícius. O tópico ajuda nesse caso. :)
@nahuakang
@nahuakang Жыл бұрын
Thanks for a New Year's video to start 2023, Gustavo!
@burntt999
@burntt999 3 ай бұрын
oh dear lord.. 3 hours whew. i'll be back! SUPER happy that this is online.. i've been wanting to find a place that would teach me the voxel graphics/engine/ whatever. bless you sir. but i'm gonna need to start this on a fresh day.
@ChooChooThomas
@ChooChooThomas 3 ай бұрын
Here's to help even a bit with the algorithm. Thank you for making such a detailed explanation. Definitely a great resource!
@pikuma
@pikuma 3 ай бұрын
Thank you. 💪
@HiddenAsbestos
@HiddenAsbestos Жыл бұрын
Hallelujah! (thanks for this tutorial, great!)
@mikeand9
@mikeand9 9 ай бұрын
Awesome tutorial, it is amazing how you show all of these things easily that for me was magical stuuf in the past! I'm enjoying all your videos. 🧑‍💻
@jzhu623
@jzhu623 2 ай бұрын
Wolfenstein 3d and Comanche came out in the same year, but you would never guess by just looking at them.
@ahmetpehlivan6312
@ahmetpehlivan6312 Жыл бұрын
Hapoy new year! This is the best present i got today!
@abdou.the.heretic
@abdou.the.heretic Жыл бұрын
Managed to get some craters forming on mouse click, but performance takes a Tyson's mean cross, I've noticed the craters keep all details even from far away unlike the terrain which gets pixelated by distance, not sure if I can call it an LOD problem. It's not something that bugs me I'm just happy I found some explanation that my old head who still holds Comanche and Delta Force to high regard, can understand and work with. My programming days are long gone, hell I'm using my son's gmail and account, but seeing your video being this long, explaining the very essence that made me love those games, made me boot up a laptop and start grinding my C gears again!! Thanks you, kind sir! And yeah, Hallelujah!
@pikuma
@pikuma Жыл бұрын
This is absolutely great! My coding days are also behind me, but the good news is that the fun part starts now. 🙂
@pikuma
@pikuma Жыл бұрын
PS: feel free to share your code on a Github repo.
@suvetar
@suvetar 8 ай бұрын
Good on Kyle Freeman!! Worth noting that even in those heady days, Medical imaging was using point clouds and voxels, or technical versions that were close as to be twinned siblings, if not closer! It's important, too, to recognise his insight and very practical experience to making it work on your bog-standard PC in stead of a high power medical workstation! Don't forget other classics like Outcast and the Magic Carpet games too!
@suvetar
@suvetar 8 ай бұрын
I think that the render sequence of the Genesis device in the Star Trek films also used this aapproach?
@R.B.
@R.B. 10 ай бұрын
Hallelujah. Caught files vs. maps when you started. I was surprised you didn't have an error at that point, but then I remembered you were writing in C.
@thepink_game_dev6610
@thepink_game_dev6610 Жыл бұрын
What a master piece about old technology!! Gustavo, I think you are undervaluated!! You have made my head blow up!! It's an amazing lesson!! Thank you, thank you, thank you!
@henribas
@henribas 23 күн бұрын
Great lessons, thank you! About your end question: pseudo racing game (Top Gear, Outrun, Chase HQ, etc).
@dizphunkt
@dizphunkt Жыл бұрын
Crazy good content for new year. Thanks for sharing your knowledge - happy new year!
@alexandrohdez3982
@alexandrohdez3982 7 күн бұрын
amazing 👏👏👏
@MrNareez
@MrNareez Жыл бұрын
Another awesome video-book!
@abdou.the.heretic
@abdou.the.heretic Жыл бұрын
I've been looking for an in depth video on this for ages, time to fire up my computer and get programming memory running again.
@CasperBorretzen
@CasperBorretzen 5 ай бұрын
Hallelujah! Thank you so much for this aaaamazing tutorial, super interesting and fun!:) Hmm, option 2, exploring different pseudo 3D racers sounds very cool!
@Error-pb6ee
@Error-pb6ee Жыл бұрын
Great video!
@braveitor
@braveitor Жыл бұрын
Great content. Explanations are clear and the result is amazing. Thanks for sharing your knowledge.
@vinnyhorgan7186
@vinnyhorgan7186 Жыл бұрын
This is so cool! Thank you so much Gustavo!!!!!!
@ooichu_
@ooichu_ Жыл бұрын
Great New Year's gift, Gustavo! Thank you!
@blacklistnr1
@blacklistnr1 Жыл бұрын
Great visualisations! I understood the process even though I skipped the code parts
@lucetubegplusstillsux2678
@lucetubegplusstillsux2678 Жыл бұрын
Hallelujah I got it with my own custom terrain rendered in Blender~
@pottuvoi2
@pottuvoi2 Жыл бұрын
Back in the days the implementation I remember tracked the height of the ray on each point of the map it checked. So it just checked if height of ray was higher than pixel in heightmap. As an optimization when moving to next pixel, it started testing the height from same location on map. Without this optimization it could be used as full 3D renderer with free camera. (As long as ray generation supported it, but was really slow) Always fun to see voxel/heightmap renderers, a lot of possibilities for fun tricks.
@dustinclark5620
@dustinclark5620 Жыл бұрын
Another wonderful video Gustavo!
@salsicha2
@salsicha2 3 ай бұрын
Voce eh brasileiro! Boa, muito bom ver brasileiros fazendo magica!
@realcundo
@realcundo 9 ай бұрын
Nice video! I remember Comanche being used as a proof that PC was better than Amiga. :D It also reminds me of an old dos demo MARS.EXE (search youtube for an example -- the original archive has a readme describing the rendering details). It worked back to front, but it was only rendering pixels when the upper edge of the closer Z plane was lower on the screen than the upper edge of the farther Z plane: it then rendered vertical pixels between the upper edge and the closer upper edge. This way it only rendered surfaces that were facing the camera and reduced the overdraw (painter's algorithm). And since it interpolated between heights and colours, it looked very smooth.
@pikuma
@pikuma 9 ай бұрын
mars.exe was classic! 🙂
@SerBallister
@SerBallister 8 ай бұрын
@@pikumaThere were voxel terrain renderers running on stock AGA Amiga's (@14mhz), albeit in low resolution, although the PC was far better suited for voxel rendering, and they came with much stronger CPUs 40Kb intro from "Stellar" kzbin.info/www/bejne/a4qUY3eomqx3pdE
@Ehal256
@Ehal256 Жыл бұрын
If you convert the constant depth algorithm to front to back order, you just need to maintain a per-column y buffer to prevent overdraw, and still maintain the benefit of reducing divisions for projection. You just need to calculate 1/z per constant-depth row, then multiply the height values fetched from the height map by the 1/z, which is much faster than a division. On very slow hardware you can even precalculate a table of 1/z values (and coordinate offsets for level of detail!), which I believe arkagis escape does on megadrive/genesis
@Ehal256
@Ehal256 Жыл бұрын
I finished watching the video and see that the projection lookup table idea was already mentioned. :)
@pikuma
@pikuma Жыл бұрын
Yup. Quality comment. 🙂👍 Just checking something... Visitor from Hacker News, by any chance?
@Ehal256
@Ehal256 Жыл бұрын
@@pikuma No, just linked by someone else, but I have written similar engines before :)
@eulondon
@eulondon 2 күн бұрын
Hallelujah.
@gwelter
@gwelter 10 ай бұрын
Just a comment to help you with the KZbin algorithm
@pikuma
@pikuma 10 ай бұрын
That's the spirit. 🙂 Thank you so much.
@achyuththouta6957
@achyuththouta6957 Жыл бұрын
Wow. You have so much knowledge.
@PlasticCogLiquid
@PlasticCogLiquid 10 ай бұрын
I love voxels sooooo much.
@Anonymousewizard
@Anonymousewizard 10 ай бұрын
its so cool how coding works... you can be using a polygon system for so long, then some guy walks in, has a think, and boom, increased performance. incredible problem solving
@AngryCPPCoder
@AngryCPPCoder Жыл бұрын
Thank you so much for this great video. I always wanted to learn more about voxel engines. Great explanation. For upcoming videos, I would say racer or a new topic.
@brunorcabral
@brunorcabral Жыл бұрын
Both options would be great
@Chevifier
@Chevifier 3 ай бұрын
Im gonna try doing this with compute shaders
@harshguptaxg2774
@harshguptaxg2774 Жыл бұрын
Go Ahead!
@luispieri640
@luispieri640 Жыл бұрын
Hallelujah! Gaucho!
@canova
@canova Жыл бұрын
Thank you Gustavo, excellent video. For the next option, I would like to know more about the optimization techniques you've mentioned.
@pikuma
@pikuma Жыл бұрын
Sure thing!
@elferna
@elferna Жыл бұрын
Hallelujah!!!
@AnonANONY-jz1wg
@AnonANONY-jz1wg Жыл бұрын
Hallelujah
@pikuma
@pikuma Жыл бұрын
Ahhhhhh, the first! ❤️
@StiffAftermath
@StiffAftermath 2 ай бұрын
Have you seen John Lin's voxel engine yet? It is mind-blowing!
@pikuma
@pikuma 2 ай бұрын
I was not aware of that project! Amazing. Thanks for the tip.
@StiffAftermath
@StiffAftermath 2 ай бұрын
@@pikuma thank you for your awesome work! I love voxel tech! If you see it, I'd love to hear your thoughts!
@billallwell6507
@billallwell6507 Жыл бұрын
Just completed the course tonight 2am Melbourne Aust. Amazing piece of work. Vista pro on the Amiga ! I remember I use to leave it running all night to generate a 100 frame animation and hope the trusty old Amiga 500 didn't crash. Please go with some pseudo 3d games, the format you use of theory and history coupled with the implementation is awesome. Not sure whether stunt car racer could be a consideration or Outrun?
@lorrainefigueroa4624
@lorrainefigueroa4624 Жыл бұрын
Hallelujah! I am really enjoying learning something new this holiday. I vote for 3D racer!
@lucassamuel6069
@lucassamuel6069 Жыл бұрын
Amazing
@Aexorzist
@Aexorzist Жыл бұрын
Cool video! The 386 required a 387 to even run floating point code. I don't think one FSINCOS per frame would have been that bad even back then. It's 194-809 cycles on 387. About as much time as processing one vertical line? A LUT is trivial though so not an optimization that would have been missed.
@kevinbatdorf
@kevinbatdorf Жыл бұрын
Very well done. Thank you
@galacta6841
@galacta6841 Ай бұрын
Are you considering doing more tutorials on 2.5D engines like Mode 7, portal rendering, and such?
@pikuma
@pikuma Ай бұрын
@@galacta6841 Yes, it's in the queue. 🙂
@nahuakang
@nahuakang Жыл бұрын
Also, option 1 for the MS DOS implementation sounds fun :) But both are great ideas!
@OGkuma_
@OGkuma_ Жыл бұрын
Thank you for this content!! Are you planning to do a kind of course on creating a Minecraft clone in C++ and talking about some rendering optimization etc? That would be so nice
@TheIlluminatedParker
@TheIlluminatedParker Жыл бұрын
56:38 Is that yerba mate?? 🧉
@pikuma
@pikuma Жыл бұрын
It sure is... also known as "chimarrão" in the south of Brazil.
@TheIlluminatedParker
@TheIlluminatedParker Жыл бұрын
@@pikuma ahh, I didn't know it was a thing in Brazil. I only know about yerba mate, because I have some friends from Argentina
@shdon
@shdon Жыл бұрын
Hallelujah indeed
@3f006
@3f006 Жыл бұрын
Really cool
@aakarshanraj1176
@aakarshanraj1176 8 күн бұрын
01:04:21 the formula of delta y is wrong, its missing + operator after pl.y
@sha5b
@sha5b Жыл бұрын
Great tutorial! Happy new year. 3rd comment, just saying
@pikuma
@pikuma Жыл бұрын
Maybe one day that'll be worth millions! 😅
@bimoverbohm6837
@bimoverbohm6837 Жыл бұрын
Halleluja (on the Game Boy Advance btw). Would love to see what optimizations you can come up with and how your demo would run on a 386.
@pikuma
@pikuma Жыл бұрын
On the GBA??? Amazing. 😀 Share a video of it working with us on Twitter @pikuma. 💛
@pedrocosta1742
@pedrocosta1742 2 ай бұрын
Hallelujah😄
@pikuma
@pikuma 2 ай бұрын
Grande!
@klr607
@klr607 Жыл бұрын
I really enjoy the 6502 8-bit programming, but these 3D graphics are awesome 😊
@Rydn
@Rydn Жыл бұрын
1:04:22 There's something I'm not getting about this. If you are in the middle ray calculating delta X, the offset is zfar, so zfar/zfar gives an increment of one on the delta X, but for that ray, shouldn't deltaX be 0 all the way?
@pikuma
@pikuma Жыл бұрын
Hi Rydn, Let's imagine that our camera is in the middle of the map (512,512), and our zfar distance is 400. Therefore, the left and right points x coordinates are plx= -400 and prx=400. So, our delta X is: (-400 + ((400-(-400))/320 * 160)) / 400 which is zero!
@pikuma
@pikuma Жыл бұрын
The addition of plx (which is negative) with the other terms makes the deltax zero when our column is 160.
@Rydn
@Rydn Жыл бұрын
@@pikuma Oh! Thank you. I was wrongly thinking about plx as the zero in my head. I can't wait to finish this. Thank you for your great videos.
@akshatra2k1
@akshatra2k1 Жыл бұрын
We want both options please, emulator and 3d racing game. Moreover, can we implement voxel space engine in real 3d from scratch using C?
@GabrielxC
@GabrielxC Жыл бұрын
Wich VI theme do you use friendo?
@pikuma
@pikuma Жыл бұрын
Hello. I use "ron" (default) or "Benokai".
@binaryburnout3d
@binaryburnout3d Жыл бұрын
first comment!!!! happy new year!
@pikuma
@pikuma Жыл бұрын
Happy 2023! 🙂
@peterlous853
@peterlous853 Жыл бұрын
Thanks for excellent video! I would op for pseudo 3D race for next video.
@ramyres110
@ramyres110 Жыл бұрын
Aleluia 🙌
@pikuma
@pikuma Жыл бұрын
Feitooooo! ❤️
@santitabnavascues8673
@santitabnavascues8673 5 ай бұрын
Would it be posible to do something similar but with sprites? You know, rendering sprites with depth information or something... would it make sense? 🤔😅
@CYON4D
@CYON4D Жыл бұрын
Great explanation. And since I have played all the DOS classics back in the day, this was exceptionally fun. I was wondering if you are considering uploading your "3D Computer Graphics Programming" lesson on Udemy.
@pikuma
@pikuma Жыл бұрын
Hi! It's a fun topic. 🙂 Unfortunately I don't use Udemy for my courses anymore.
@EmiTheLoomistar
@EmiTheLoomistar Жыл бұрын
Pls cover the MS - DOS implementation!!
@jamesonsouza9417
@jamesonsouza9417 Жыл бұрын
Vim pelo canal do Fabio Akita. Sensacional a sua iniciativa de ensinar a base. Gostaria muito que tivesse seu curso em Português. Pagarei com todo prazer.
@ArtexStudios
@ArtexStudios Жыл бұрын
Please optimize the voxel engine to old skool computers first and continue with other techniques later... Thanks. ;)
@erikmarchini3274
@erikmarchini3274 9 ай бұрын
Hi ! So from what I understood, you can determine the colour and the height of a pixel for the cost of 2 bytes. My question is, is there a way to determine the inclination of a pixel ?
@CGWerft
@CGWerft 4 ай бұрын
Either you save them in a normal map, which IS Just another Image saving the normal or you could calculate the slope by comparing that Pixel with the Pixels around it. I think there should be a formula in the blog of Inigo Quilez.
@jeffvenancius
@jeffvenancius Жыл бұрын
57:49 - if the slopes are exactly oposites,, is it possible to make a loop where you use half the width while painting both fet and right pixels each time(?)
@jeffvenancius
@jeffvenancius Жыл бұрын
Left*
@jeffvenancius
@jeffvenancius Жыл бұрын
something like l_delta_x = plx + i r_delta_x = prx - i
@jeffvenancius
@jeffvenancius Жыл бұрын
Interesting how it compares with mode 7
@StijnDeWitt
@StijnDeWitt Ай бұрын
1:01:30 You say you need to calculate delta x and y once for each ray, so 320 times. Yet you place the code inside the inner loop, where it will be calculated 320 * zfar times... It should go in the outer loop I think.
@StijnDeWitt
@StijnDeWitt Ай бұрын
Looks like in the actual code, you don't make that mistake
@PaulSpades
@PaulSpades 11 ай бұрын
Hah... I actually never seen this vertical ray algorithm, the horizontal painters algo is slow and useless. This one integrates perfectly with existing ray cast rendering. Also, the 90deg fov sure simplifies some annoying trigonometry and results in faster operations. I've learned some stuff, thanks!
@josiahjack455
@josiahjack455 11 ай бұрын
Halelujah, but how did you get the scanline effect....ooohh you cheated and used a CRT!! No wonder it looks so good.
@pikuma
@pikuma 11 ай бұрын
The DOS-like framework has its own CRT shader. 🙂
@jamiecropley
@jamiecropley Жыл бұрын
Voxel course incoming?
@pikuma
@pikuma Жыл бұрын
Only if I get to really use DOS & VGA 0x13h.
@pieterverhoeven1642
@pieterverhoeven1642 Жыл бұрын
Did they ever combine these voxel landscapes with something like portal/cell rendering for interiors? Would have been an interesting alternative history where GTA was software rendered like that :P
@WesleyMarques79
@WesleyMarques79 Жыл бұрын
Sudo 3D racers please!!
@eobet
@eobet Жыл бұрын
Fantastic video, but you should have connected it to Minecraft as well to get the attention of the kids! 😉 (Btw, can’t remember what computer I had when I got Comanche but it never ran anywhere close to that smooth!) 🤣
@pikuma
@pikuma Жыл бұрын
Oh, right! I forgot about Minecraft! 😅 I had a Cyrix 486 dx2 and it ran... ok.
@circuit10
@circuit10 Жыл бұрын
I don't think it would work for Minecraft because it can't do overhangs or detailed walls
@jeffvenancius
@jeffvenancius Жыл бұрын
Aleluia!
@enricotrudu6760
@enricotrudu6760 3 ай бұрын
1:20:10 No.
@AnnatarTheMaia
@AnnatarTheMaia Жыл бұрын
You didn't have to quit out of vim every time: if your terminal discipline is configured correctly, you could have just sent SIGSUSP (^z), did whatever on the command line, and then typed "fg" to go back into vim.
@pikuma
@pikuma Жыл бұрын
Hi Annatar! I am used to have different windows for the editor and for my bash sessions (either via terminal window or termux). I believe I exited vi only in the first one or two times I was editing the file. After that, I was swapping between editor and command line without the need to quit vi. :)
@viniciusrodrigues1428
@viniciusrodrigues1428 Жыл бұрын
hey gustavo, conheci teu canal pelo fabio akita e eu realmente fiquei interessado nos teus cursos, porém é muito caro o valor em dolár, você não pensa em adaptar esses valores em reais? um abraço e que video sensacional, estou gostando demais de ver os teus videos
@vitoralmeidasilva
@vitoralmeidasilva 3 ай бұрын
Aleluia! :)
@vitoralmeidasilva
@vitoralmeidasilva 3 ай бұрын
Btw, here is the Makefile that I used to compile the program using a Linux machine: build: gcc *.c `sdl2-config --libs --cflags` -lGL -lGLEW -lm -lpthread -o voxel clean: rm voxel run: ./voxel
@pikuma
@pikuma 3 ай бұрын
Feito! 🙂👍
@jmssun
@jmssun 5 ай бұрын
Mars.exe
@space302
@space302 Жыл бұрын
You sure enjoy repeating things multiple times. Meaning, you say things multiple times, so you repeat things. So to be clear, you say the same thing multiple times. So basically, you repeat.
@pikuma
@pikuma Жыл бұрын
I'll work on that. Thanks. 😉
@bcodetube
@bcodetube Жыл бұрын
My channel has a tutorial on Pseudo 3D Racing using Pygame!
@juanignacioleyenberger55
@juanignacioleyenberger55 Жыл бұрын
MATE!❤
@TheNeoxpert
@TheNeoxpert 10 ай бұрын
halleluja. Java with LWJGL
@pikuma
@pikuma 10 ай бұрын
❤️❤️❤️
@avlcek
@avlcek Жыл бұрын
Hallelujah!
@pikuma
@pikuma Жыл бұрын
Yay us!
@billallwell6507
@billallwell6507 Жыл бұрын
Hallelujah
@ManutoUzumaki
@ManutoUzumaki Жыл бұрын
Hallelujah
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 706 М.
Underwater Challenge 😱
00:37
Topper Guild
Рет қаралды 22 МЛН
Whoa
01:00
Justin Flom
Рет қаралды 17 МЛН
Prank vs Prank #shorts
00:28
Mr DegrEE
Рет қаралды 9 МЛН
Can This Bubble Save My Life? 😱
00:55
Topper Guild
Рет қаралды 82 МЛН
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,5 МЛН
Tools to make a Game Engine in C++
48:03
pikuma
Рет қаралды 52 М.
Tehuelche v0.2 (Full C# & GDI+ Voxel Space Engine)
5:21
Adri Kriptok
Рет қаралды 242
Making a Voxel Engine from SCRATCH (w/ Destruction)
14:31
MaxMakesGames
Рет қаралды 33 М.
Harder Drive: Hard drives we didn't want or need
36:47
suckerpinch
Рет қаралды 1,6 МЛН
How Ray Tracing (Modern CGI) Works And How To Do It 600x Faster
32:06
Josh's Channel
Рет қаралды 571 М.
Better Mountain Generators That Aren't Perlin Noise or Erosion
18:09
Josh's Channel
Рет қаралды 353 М.
Andrew Kelley   Practical Data Oriented Design (DoD)
46:40
ChimiChanga
Рет қаралды 85 М.
Underwater Challenge 😱
00:37
Topper Guild
Рет қаралды 22 МЛН