Creating a raytracer for DOS, in 16 VGA colors
Sign in to YouTube
Sign in to YouTube
Sign in to YouTube
Uploaded on May 23, 2011
In this tool-assisted education video I create a raytracer from scratch.
The raytracer renders in 16-color VGA palette at 640x480 resolution.
List of programs written by me that made this video possible:
- ADLMIDI (This plays MIDI files through OPL3 emulation)
- JAINPUT (Japanese input editor)
- E.EXE (Full-screen DOS editor)
- SPCPLAY (This plays SPC files, which are SNES music), however see below
- New.php (With this I architected how exactly to input the code, where to resize the screen and where to scroll the window etc.)
- INPUTTER (This tool ensured that the plan is followed perfectly, given the time constraints)
- SPCtoMIDI (This converts log files created by SPCPLAY into MIDI files)
- Firstframe.php (This rendered the various effects at 11:10 to 11:54 , after which the real rendered frames were displayed verbatim. The slowness in the beginning was how the BC++ compiled program would have appeared, but it was simulated with this PHP program.)
- Animmerger (This ensured that the frames produced by Firstframe.php were indeed of the EGA palette and dithered the same way as the raytracing was)
- Hudmaker (This converts raw audio and video streams and overlays graphical items, like subtitles, into it, and sends result to encoder)
- Tile4 (This did the four-video inset at the end of the video. I got the idea from Freddy Wong (user:Freddiew).)
List of significant programs involved that were not written by me (all but BC++ are open-source):
- DOSBox and its associated utilities like "mount"
- FreeDOS command prompt
- Borland C++ compiler, Turbo Assembler, Turbo Link
- SNES9x (I used portions of SNES9x in SPCPLAY)
- MEncoder (Video+Audio Encoder; The video recorded by DOSBox was of varying FPS and of varying resolution, due to all the screenmode changes. With MEncoder I resampled them all into a common format, which was 3200x2400 120-fps RGB16 raw video.)
- Lzop (I compressed raw video streams with this for intermediate storage)
- GCC, GNU assembler, GNU gold (After verifying that the program _works_ on BC++, I compiled the _actual_ raytracer with this and did the actual rendering on a multicore Linux server, because raytracing is, well, quite slow)
- Imagemagick (This converted 16-bit PNGs into 8-bit ones)
- Audacity (I mixed audio tracks together with this tool)
- Sox (I may have used it to convert WAV from/to RAW)
- X264 (Video Encoder, used for the final encoding)
- Oggenc (Audio Encoder, used for the final encoding)
- MKVmerge (Video+Audio Multiplexer, used for the final encoding)
- HDPMI32 also makes an appearance in this video, but it's a decoy, as is ADLMIDI in this video. The audio produced within DOSBox was discarded, because it was choppy. I recorded and mixed the audio separately.
Source code links:
ADLMIDI: http://bisqwit.iki.fi/source/adlmidi....
JAINPUT: http://bisqwit.iki.fi/source/jainput....
Animmerger: http://bisqwit.iki.fi/source/animmerg...
Hudmaker: http://bisqwit.iki.fi/source/hudmaker...
-
Category
-
License
Standard YouTube License
Loading...
Loading...
Loading...
Loading...
-
4:55
Why Girls Swallowby Sex Advice VideosFeatured
2,199,750
-
59:06
Richard Dawkins documentaryby The Atheist
57,391 views
-
14:56
256 colors is enough for everyoneby Bisqwit
9,487 views
-
14:56
OpenGL programming, simple FPS style walking scene (DOS)by Bisqwit
51,012 views
-
14:57
Tandy 1000 Soundchip revisited: ASM programming exampleby Bisqwit
4,414 views
-
2:58
Bjarne Stroustrup: Why the Programming Language C Is Obsoleteby Big Think
86,031 views
-
1:10:29
Writing a Raytracer in Common Lisp - Part 1by Alexander Lehmann
2,054 views
-
6:21
Ray Tracing Real time demo - Rigid Gems 2.0by hamadsamer1
9,860 views
-
9:55
Windows Vista vs OpenGEMby CurryMan977
7,975 views
-
2:44
Bjarne Stroustrup: A Unified Programming Language?by Big Think
18,113 views
-
2:29
96-square-foot tiny home handbuilt inside century-old sheep barnby kirstendirksen
119,648 views
-
1:00:30
Interactive Ray Tracing: A Better Way to Program 3Dby GoogleTechTalks
16,963 views
-
2:26
Terasology (Minecraft-like open source project) - Flight 3by Moving Blocks!
49,439 views
-
15:00
Creating a NES emulator in C++11 (PART 2/2)by Bisqwit
21,313 views
-
2:50
Anatomy of the standard VGA 256-color paletteby Bisqwit
3,178 views
-
32:09
John Carmack Interview: GPU Race, Intel Graphics, Ray Tracing and Voxels and more! - PC Perspectiveby PC Perspective
64,675 views
-
2:51
Homebrew 6809 Computer: Color Video! (TMS9918A)by 74hc595
11,865 views
-
1:32
Josh Triplett Demo Reel Highby monkeykatvfx
253,528 views
-
11:17
How to make money from youtubeby Brad Scott PLEASE SUBSCRIBE
415,849 views
-
9:52
Install Windows XP on 33 Laptops Dell Latitude E6400 CloneZillaby 0100011101001101
144,769 views
- Loading more suggestions...
Uploader Comments (Bisqwit)
jorijndg 4 days ago
What software did you use for compiling and such, the thing that looks like an ide, and what os?
Sign in to YouTube
Sign in to YouTube
Bisqwit 4 days ago
The compiler was Borland C++ 4.52. The IDE was an editor I created myself. The OS was DOSBox version 0.74.
Sign in to YouTube
Sign in to YouTube
Cobblestoned100 1 month ago
is this in realtime? great work!
Sign in to YouTube
Sign in to YouTube
Bisqwit 1 month ago
No part of this video is in real time, except around 11:11, and even that is a simulation. That said, the program renders exactly what it promises. Raytracing just is not usually very fast.
Sign in to YouTube
Sign in to YouTube
vapourmile 1 month ago
Very good. You're talented! Q. is the editor E.EXE both your own creation and the one which allows you to switch between PC/DOS and Commodore 64 looks, in DOS?
Sign in to YouTube
Sign in to YouTube
Bisqwit 1 month ago
Thank you! Yes, it is.
Sign in to YouTube
Sign in to YouTube
Top Comments
adam10603 11 months ago
programming lvl: mind blown
Sign in to YouTube
Sign in to YouTube
Bisqwit 4 months ago
Quite intentional! Thanks for the post.
Sign in to YouTube
Sign in to YouTube
All Comments (59)
jorijndg 4 days ago
Nevermind, I forgot the description
Sign in to YouTube
Sign in to YouTube
moffmoff jr 1 month ago
code lvls:
level:asian <---bisqwit!!!
level:god
level:demigod
level:boss
level:get a life
level:noob
Sign in to YouTube
Sign in to YouTube
Loic Urien 1 month ago
You're a great inspiration for me, thanks for all your vidéos ;)
And, by the way, I love the music ^^
Sign in to YouTube
Sign in to YouTube
vapourmile 1 month ago
Well done! Well done! Well done! :)
I admire what you have done here. Speaking as a programmer who began in 1981 you retain the old-school spirit of minimising interference between your program code and the hardware, and by using home-grown tools built around your own working methods. Very good! :)
Sign in to YouTube
Sign in to YouTube