Skip to content
0:00 / 0:00

#doom#portalrendering#softwarerendering

Creating a Doom-style 3D engine in C

Bisqwit

147K subscribers • 9 videos on Hallway

YouTube
  • Recommended by 3 people: 3 on Hacker News.
  • A classic. People kept recommending it from 2015 to 2019.
  • Presented by Bisqwit
  • May be out of date. Uploaded 11 years ago, in an area where tools change fast.

Advanced. Deep dive for people who know the field.

990K views11 years ago3 recommendations

Graphics and audioGame developmentRenderingCGame programming

Bisqwit demonstrates how to build a Duke Nukem 3D or Doom-style software-rendering pseudo-3D engine from scratch in C, supporting non-Euclidean geometry.

In this tool-assisted education video I walk through the creation of a Duke Nukem 3D style (or Doom-style) software-rendering pseudo-3D engine from scratch. It supports non-Euclidean geometry. Topics such as vector rotation and portal rendering are at the core. SUBTITLES ARE AVAILABLE. Twitter: twitter.com/RealBisqwit Patreon: patreon.com/Bisqwit (alternatives at iki.fi/bisqwit/donate.html) Twitch: twitch.tv/RealBisqwit Homepage: iki.fi/bisqwit/ Contribute subtitles: youtube.com/timedtext_video?vHQYsFshbkYw or: youtube.com/timedtext_cs_panel?c=UCKTehwyGCKF-b2wo0RKwrcg&ta… This homebrew software-rendering pseudo-3D engine bears many similarities to Duke Nukem 3D. The geometry can be tweaked at run time without performance penalties, to create things like ceiling crushers or rotating doors. For rendering, it only supports single-color floors, walls and ceilings, with optional depth shading. Unlike Duke3D, it also requires that each sector is convex. So far this engine does not support objects or sprites. It also does not support sloped surfaces or parallax ceilings. DOWNLOAD MATERIAL: - iki.fi/bisqwit/jkp/portalrendering.html SUPPORT / INSTRUCTIONS: The C program must be compiled with a C compiler supporting the C99 standard. If you attempt to compile it as C++, errors will be produced. If you attempt to compile it on a C89 compiler, errors will be produced. You must compile it as C using C99 standard or newer (on GCC, use the commandline option: -std=c99 or -std=c11). You also need libSDL 1.2. SDL 2.0 will not work. Add the options printed by pkg-config sdl --libs --cflags into your compiler commandline. The BASIC program is ideally run in QBASIC or QuickBASIC 4.5. It will not work in QB64 without modifications, because QB64 does not support DEF FN. It will not work in GW-BASIC, because of the structural programming statements. Music credits in order of appearance: - Lunar: Silver Star Story - Lunar Traffic theme (Noriyuki Iwadare) - Axelay - SPIDERS (Taro Kudou) - Tales of Phantasia - Final Act (Motoi Sakuraba and Shinji Tamura) - Tales of Phantasia - Ridge Racer (Shinji Hosoe) All these video game songs have been transformed into OPL3 songs with homebrew tools and played through ADLMIDI. Sorry about the fluctuating narration volume. I recorded pretty much every sentence separately over many days, and my microphone was positioned differently at different times, and sometimes it was day, sometimes night, sometimes I had morning voice, etc. I tried to compensate with both manual volume adjustment as well as running a compression filter over it all, but it was only after publication when I noticed how uneven it still is. My typical workflow for recording the narration involves the following: 1. Watching some of the video 2. Writing into a text file what I would like to say (this file will also form the basis of closed-captioning later). Much of the text comes from

Why it's here

3 people recommend this

What people say. Highly recommended for its unique, sped-up tool-assisted coding style and as a mind-blowing demonstration of graphics programming from scratch.

petercooperon Hacker News • Recommends

On “The Strange Appeal of Watching Coders Code”

This is why I love bisqwit's videos on YouTube. He takes a middle ground between "typing it in" and pondered narration. The typing effect is sped up and faked and done at just the right speed to 'follow along' with his thought process. Example: link to this video

petercooperon Hacker News • Recommends

On “Ask HN: What is your favorite YouTube channel for developers?”

link is by far my favorite and I've spent many hours watching him. He does things like create a Doom-style engine from scratch: link to this video .. create a NES emulator: link .. work back from a C++17 example to show why new C++ standards are needed: link .. and even building a Tetris clone in GW-BASIC: link .. Right now, he's doing a series on cracking 80s videogame passwords: link Sirajology - link - is another interesting one. He moves a bit too quickly for me, but does things like explain machine learning in 5 minutes or how to generate music with systems like Tensorflow.

iwakuraon Hacker News • Recommends

On “Ask HN: What is your favorite YouTube channel for developers?”

Bisqwit's video focusing on systems and graphics programming are total gems. link Not particularly useful for web developers which is what most programmers are nowdays, they will still blow your mind though. link to this video

petercooperon Hacker News • Recommends

On “Let’s Create a Speech Synthesizer in C++17 [video]”

Agreed. My favourite programming YouTuber by a long stretch. If anyone is unfamiliar with him and wants to watch some of the "classics" I'd recommend these: His "cracking videogame passwords" series: link Creating a Doom-style 3D engine in C: link to this video Creating a Rogue-like game in C++11: link Creating a PIC16 emulator and NES music player: link Creating a NES emulator: link Creating a DOS VGA raytracer: link

rpedenon Hacker News • Recommends

On “Ask HN: Best coding related YouTube channels?”

I'm a fan of Bisqwit: link Mostly because he does fun things that are outside of the kind of programming I usually do, so it helps me broaden my horizons a bit. One of my favourites is the video where he sets out to make a basic 3D game engine in C, but starts by prototyping it in Basic: link to this video

u/jurnissin r/C_Programming • Mentions

On “An explanation of Doom Engine?”

Only the best YouTube programming video of all time, from Bisqwit: link to this video (In some respects the engine shown is closer to the Build engine from Duke3D, but many concepts are shared with Doom.)

u/wrelamin r/C_Programming • Mentions

On “Does anyone remember the old website that showed how to build Doom with C?”

Are you thinking of this video by Bisqwit? "Creating a Doom-style 3D engine in C"

u/spartanatreyuin r/compsci • Mentions

On “Entertaining CS YouTube channels?”

Bisqwit is a really weird but great channel to watch and he has his own strange style that I haven't seen anyone else do. Most of his videos boil down to watching a **fast-paced** replay of his code with a voice over telling you what he's doing without too much hand holding. A good example is when he creates an fps engine from scratch in 20 minutes, (as opposed to hours and hours with other tutorials) You can replicate all his code by hand to follow along or get the final products in the description+comments.

u/Cikuozzoin r/emacs • Mentions

Person animation in emacs Hello, I was watching this video: [video and at one point i noticed a wild mario walking on the tool bar, so I asked myself: Is there a way to have something like this in Emacs too?

u/Only9Voltsin r/C_Programming • Mentions

On “I Want to do a Doom Game in C but I dont know how to start”

I believe bisqwit has some videos about this on his channel. link to this video

u/anintegerin r/C_Programming • Mentions

On “C programming talks and conferences on youtube”

…some links: Sean Barrett, he's the guy responsible for nothing's.org and the general stb based libraries. He has a series of C programming videos based on building a Minecraft like game (for example Open world block building game part 1 ) Bisqwit's, who does most videos in C++, did actually create a video about making a Doom like engine in C: link to this video Assembly Assembly has an NES speed coding series: link to this video Everyone always links Handmade Hero so I'll let someone else comment on that.…

TazeTSchnitzelon Hacker News • Mentions

On “Non-Euclidean Worlds Engine [video]”

As was Duke Nukem 3D. Here's a video about making a simple demo engine based around the concept, which shows off a little non-Euclidean geometry: link to this video

u/Mentioned_Videosin r/compsci • Mentions

On “Entertaining CS YouTube channels?”

Videos in this thread: Watch Playlist ▶ VIDEO|COMMENT -|- (1) NMCS4ALL: Artificial Life (full version) (2) Lecture 1 Machine Learning (Stanford)|11 - These lectures were great, I learned a lot and I enjoyed listening to this guy talk. It's an MIT course on artificial intelligence. Also, anything you find by Erik Demaine is awesome, he's got stuff on MIT OCW as well, here's one I've been increme... Creating a Doom-style 3D engine in C|6 - Bisqwit is a really weird but great channel to watch and he has his own strange style that I haven't seen anyone else do. Most of his videos boil down to watching a fast-paced replay of his code with a voice over telling you what he's do…