5 ms·
A simple raytracer is also a good step in that list.
by jacquesm 5y ago
A simple raytracer is also a good step in that list.
- pjmlp 5y agoWhich in 1992 would mean getting acquainted with either MASM or TASM.
- jacquesm 5y agoI did it in '86 using a DSP32 :) Patience... A couple of hours to render a simple scene at 800x600, and displayed using dithering due to a lack of colors in the palette. But it worked.
- pjmlp 5y agoUau, that is when I started in computing with a Timex 2068, naturally ray tracing was not even on my radar at the time. Did it also do the classical line based rendering?
- jacquesm 5y agoIt was the most stupid and naive implementation possible, classic reverse raytracing starting from a distance from the center of the virtual camera plane and branching a few times to get the basics of reflection and a light model to work, then adding other features bit by bit. I don't really remember all the details, but I do remember that it was agonizingly slow on the CPU, the DSP made all the difference and allowed me to add a couple of features. The main loop was on every pixel of the virtual camera plane. I no longer have that code (or the DSP, for that matter) but it was a fun exercise and it taught me a lot of matrix/vector math. The dithering code was also interesting, because my graphics card could not do true color I put 3x64 RGB shades in the palette and then cranked up the brightness for tetris like sets of pixels to simulate a true color display. Worked pretty well. This was the DSP board: https://www.signalogic.com/images/Ariel_DSP32-PC.jpg https://www.signalogic.com/images/Ariel_DSP32-PC.jpg I managed to gently overclock it to 24 MHz without problems, it did get a bit warmer but nothing too bad.
- pjmlp 5y agoVery interesting, thanks for sharing.
- markus_zhang 5y agoI'm thinking, a lot of people, even developers are scary of assembly, right? Or a more irrefutable one: it doesn't have much use. Definitely it is true in the sense that indeed even system programmers don't write full assembly programs. But then I thought about the kids in 80s, the Romeros and Carmacks, and a little before that the Garriots and Gates, those kids started with BASIC but immediately picked up assembly given the chance, because that was how high performance code could be written and they just learned it on the way. No Internet, very few books even for rich kids (usually a [Machine] programming guide is good enough). Now that I think about it, some of them were barely teenages. I bet the real difference is 1) Much simpler machine arch and 2) They had to learn it for writing games and other high performance software.
- jacquesm 5y agoAssembly was pretty much the only way to break the speed barrier that BASIC imposed. It started out as 'the' language, then after a while you'd realize there was the computer underneath BASIC that could do more and was faster, but also a bit scary. Then, after you mastered peek and poke and bit by bit learned more about what made the computer tick one day you'd wake up and realize that all you still used BASIC for was to load machine language programs. That gradual ramp made it work.
- markus_zhang 5y agoYep. Plus nowadays people have so many selections and it doesn't really make sense to use assembly for production unless in rare cases.
- pjmlp 5y agoI am also from that generation. I really don't get how people are scared of low level programming, computer languages don't bite, don't attack on dark street corners, don't whatever. Yes bad programs might corrupt some data, just like removing the plug with computer on might do the same and no one thinks twice about it. Back in the day we didn't had tooling like Compiler Explorer to understand how BASIC would map to Assembly, only trial and error, alongside pen and paper. Anyone that wants to learn Assembly nowadays can jump there, click on the high level constructs and see how they map to Assembly instructions for their favourite CPU.