YouTube home Comedy Week on YouTube
Upload

Creating a raytracer for DOS, in 16 VGA colors

Bisqwit Bisqwit·283 videos
1,990
7,704
Like     Dislike 1

Sign in to YouTube

Sign in with your Google Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to like Bisqwit's video.

Sign in to YouTube

Sign in with your Google Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to dislike Bisqwit's video.

Sign in to YouTube

Sign in with your Google Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to add Bisqwit's video to your playlist.

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 icon Loading...

Loading icon Loading...

Loading icon Loading...

Loading icon Loading...

Ratings have been disabled for this video.
Rating is available when the video has been rented.
This feature is not available right now. Please try again later.

Uploader Comments (Bisqwit)

  • jorijndg

    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 with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate jorijndg's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate jorijndg's comment.
  • Bisqwit

    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 with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Bisqwit's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Bisqwit's comment.
    in reply to jorijndg (Show the comment)
  • Cobblestoned100

    is this in realtime? great work!

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Cobblestoned100's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Cobblestoned100's comment.
  • Bisqwit

    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 with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Bisqwit's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Bisqwit's comment.
    in reply to Cobblestoned100 (Show the comment)
  • vapourmile

    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 with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate vapourmile's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate vapourmile's comment.
  • Bisqwit

    Thank you! Yes, it is.

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Bisqwit's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Bisqwit's comment.
    in reply to vapourmile (Show the comment)

Top Comments

  • adam10603

    programming lvl: mind blown

    · 14

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate adam10603's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate adam10603's comment.
  • Bisqwit

    Quite intentional! Thanks for the post.

    · 5

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Bisqwit's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Bisqwit's comment.
    in reply to csper jk (Show the comment)

All Comments (59)

Sign in now to post a comment!
  • jorijndg

    Nevermind, I forgot the description

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate jorijndg's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate jorijndg's comment.
  • moffmoff jr

    code lvls:

    level:asian <---bisqwit!!!

    level:god

    level:demigod

    level:boss

    level:get a life

    level:noob

    ·

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate moffmoff jr's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate moffmoff jr's comment.
  • Loic Urien

    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 with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Loic Urien's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate Loic Urien's comment.
  • vapourmile

    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 with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate vapourmile's comment.

    Sign in to YouTube

    Sign in with your YouTube Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to rate vapourmile's comment.
    in reply to Bisqwit (Show the comment)
  • Loading comment...
Loading...
Loading...
Working...
Sign in to add this to Watch Later