{{ 2016-06-23 added comments: This document is the original script to my Raytracer video, which was published at https://www.youtube.com/watch?v=N8elxpSu9pw . I have not previously published this. It shows how I first _intended_ to make the video. In the end, most of this script was scrapped, leaving only the little animation with the slapping of the monitor and associated sound effects, in order to actually get the video out in reasonable time. In the end of the document, there is text that I intended for the video description. When I published the video however, I had forgotten about that, and I only just now discovered it again. The editor, now iconic to many of my programming videos, was only originally created for the sake of this particular video. The rest of this document is dated March 19 2011. Copyright (c) Joel Yliluoma. Unauthorized duplication prohibited. }} [Subtitle: 16 colors is enough for everyone! [ Erase with backspaces, rewrite to: ] Creating a raytracer ] **SCENE 1** Hello, everyone! Some of you may have been wondering how is it possible for me to type code so fast. Well, the answer is simple: Time travel. [Zoom out to show two clones sitting beside me.] [On the table, a Go game is seen. (Maybe Redrose vs. Tartrate?)] This is me from now. This is me, from five hours ago. (Or: This is me, pulled five hours into future.) This is me from tomorrow. **SCENE 2: FLASHBACK** Together with my temporal clones,- [Flashback: jikyuu kage-bunshin no jutsu! Clones appear.] [voiceover:] -I can type a lot faster than I could alone. Myself: Business, clean Clone 1: Covert op, with metallic suitcase, appear in ninja pose Clone 2: Leisure, sitting (as if typing on computer), and falling **SCENE 3: Back in scene 1** Of course, this requires rehearsing. [Clone: Lots of it.] Yeah, but because of time travel, none of it actually happens. Any significant imperfections get rewritten and totally undone from the history. [[Also, due to something called "Blinovich limitation effect", we cannot touch each others, or even the same keyboard. Each of me has to bring my own keyboard. -- Too long and distracting, CUT]] **SCENE 4: Walking (towards computer?) and explaining** To solve the problem with me getting old fast by reliving the same time many times, I just warp forward in the time an equal amount of time. So there are indeed times during which I don[-cut- disappear -reappear-]'t exist at all anywhere in the universe. [To invoke the warp, possibly touch some kind of wrist device?] **SCENE 5** [Clone 1 speaking:] Anyway, I will have been demonstrating how to create a raytracer, and will get back to it again yesterday, which is apparently now. EQUIPMENT FOR FILMING: Clothes for the clones Halogen lamp Camera Goban and stones Metallic suitcase (on-location) ---------------- [Render time. After some while of watching it render a pixel at time, start pondering about adding new CPU cores. Adding new CPU cores is accompanied with a heavy-duty "equipment" sound, and will instantly bring a couple of new scanlines that get rendered simultaneously, still molasses slow. Watch that a little while (long enough to see what is happening), then SLAP the side of the monitor (accompanied with a HEAVY slapping sound and the image shaking violently sideways). After the slap, rendering gets suddenly progressively faster, until it is real time, accompanied with the sound of a dozen engines starting.] "It's too slow!" "Well you see, that's why I brought these extra CPUs with me." *Crunch* "Good thinking!" "Not at all, my dear." "Still too slow... This might help." --------------------------------------------------- I would have initially created this in Borland C++ 3.1 IDE, but in order to have it support the Japanese IME that I created, it would have had to be in 80x25 text mode all the time, because 80x25 is the only text mode supported by BC that has 16-pixel fonts. Because 80x25 is rather crammy and has quite a confined feeling to it, and it BC really did not support any other 16-pixel font modes (and believe me I tried making it support e.g. 132x43 mode available on DOSBox), I finally had to create my own editor in which to write this raytracer as you see here. Using my own editor, I typed the program. However, because I had to refine the program several times, and it was a large program to type and I only had 12 minutes or so (Youtube length limits), I had to invent time travel to help me type it faster. This video also features ADLMIDI, an OPL3 MIDI player I have created. It provides the background music. The two music tracks are both composed by Motoi Sakuraba and come from Tales of Phantasia and Star Ocean games respectively. Those were SNES games, but I converted the SPC dumps into MIDI files using a program I have created. I tweaked the conversion parameters as much as I could to make them sound good on OPL3; in the end, it was simply up to selecting the proper instruments, the proper wavelength modifiers and the proper amplitude coefficients for each instrument. The reverberation (spacey feeling) heard in the sound is generated by ADLMIDI; it was not added in postprocess. (However, ADLMIDI's sound was mixed in postprocess because of problems with its sound output in DOSBox.) The editor features: general feeling of being hotkey-compatible with Joseph Allen's editor called Joe (which itself derives its hotkeys from Wordstar); syntax highlighting compatible with Joe, using the JSF syntax highlighting description files, which are parsed in run-time; arbitrary VGA text modes: the display dimensions (width, height, doublescan, pixel doubling, 8/9 pixels) can be controlled separately and freely, with five distinct font heights provided: 8, 14, 16, 19, 32, of which the 32-pixel font also supports a "fat mode" where the character cells are 16x32 in size, each being composed of two 8x32 cells. Mario is also added (using exactly the same technique as Norton's textmode arrow mouse pointer, except with positional dithering so as to appear in grayscale rather than B/W), and a C64 emulation mode is provided. It does nothing special except look a bit like Commodore 64, by using the C64 palette (from Vice) and by using the actual PET ROM font. By the way, writing meaningful C++ code in a 40x25 window is unbelievably difficult. The lines tend to be much, much longer than that. The Japanese IME is available at http://bisqwit.iki.fi/source/jainput.html . It creates double-width Japanese characters by combining two 8x16 cells, each containing half of a Japanese syllable character. The OPL3 MIDI player is available at http://bisqwit.iki.fi/source/adlmidi.html . It compiles on unix-style and Windows platforms, and is stand-alone, requiring no patch files and no hardware FM synthesis (it uses a built-in OPL3 emulator). The editor used in this program can be available on request; I haven't published it yet, because I only created it for this video and it has not been tested extensively...