3 ms·
Nostalgia flashback. Anyone else implemented a renderer based on fatmap2.txt[1]? I came up with my own approach using bresenham and storing spans, but it was s
by magicalhippo 2y ago
Nostalgia flashback. Anyone else implemented a renderer based on fatmap2.txt[1]?
I came up with my own approach using bresenham and storing spans, but it was slow and sucked.
Then my buddy found fatmap2.txt on a BBS and gave it to me, as I didn't have a modem at the time. It was a revelation.
Programming in Turbo Pascal I was hampered by it being 16bit, but discovered I could prepend the assembly opcodes with 66h to turn them into 32bit instructions.
Later I tried converting the code to C, being only 300 lines and at that point well understood I figured it was a good task to get started with C. I was self-taught at programming but had read enough C to feel confident enough to try.
Converted it all line by line to C before compiling... and got literally over 3000 errors and warnings, and none of them made any sense.
Discouraged I left it, but a week later I was determined to get it working. After a few hours staring and bashing my head against the wall, I saw that the constant for the texture width which I had converted to a #define in C, had a semi-colon at the end...
So I removed it, and voila it complied flawlessly...
Only later did I realize my C compiler, djgpp, was actually a C++ compiler and that's probably why I got so many seemingly weird errors.
Anyway, good times...
[1]: https://github.com/rcoscali/ftke/blob/master/ogles/doc/fatmap2.txt https://github.com/rcoscali/ftke/blob/master/ogles/doc/fatma...
- ggambetta 2y agoI don't think I ever came across fatmap2.txt, but I do miss the good ol' times. I think my reference was 3DGPL, unfortunately can't find a live link to that. Took a quick look at fatmap2 and surprisingly it doesn't do perspective-correct texture mapping (although it points to some other document in the introduction).
- magicalhippo 2y ago> I think my reference was 3DGPL, unfortunately can't find a live link to that. This one[1], code being here[2]? > surprisingly it doesn't do perspective-correct texture mapping Yeah it was covered in some other document, can't recall which. I have some memory of fatmap3, but I can't find any references to it, and any files I had were on my IBM Deathstar[3]... [1]: https://www.gamers.org/dEngine/rsc/ https://www.gamers.org/dEngine/rsc/ [2]: https://www.gamers.org/dEngine/rsc/3dgpl/code/ https://www.gamers.org/dEngine/rsc/3dgpl/code/ [3]: https://en.wikipedia.org/wiki/Deskstar#IBM_Deskstar_75GXP_failures https://en.wikipedia.org/wiki/Deskstar#IBM_Deskstar_75GXP_fa...
- Agingcoder 2y agoPerspective correct texture mapping was too expensive for the hardware available at fatmap time I think ? Edit: it was actually possible at the time.
- magicalhippo 2y agoIt was but it was borderline. A typical trick was to do the division at the start and end of a span, and interpolate linearly, rather than per pixel. This worked well enough if the triangle was seen fairly straight on and was not too large. Quake popularized the per-8 pixels technique, which is close enough in most cases.
- Agingcoder 2y agoAh yes indeed !I had forgotten about the quake trick. Thanks !
- Agingcoder 2y agoYes I read fatmap. Writing software rasterizers was what got me into coding when I was a teenager. Quite honestly, it was a great way to learn: algorithms, hardware, assembly, software architecture, all had to be taken care of to get a usable 3D engine.
- DeathArrow 2y agoI had tough times with graphics under DOS. BorlandC C had a limited graphics library called Turtle. So I used DOS mode 13H for fancy 320x200 display with 256 colors. Later, somebody gave me the source code for some graphics libraries together with some drivers and I could use 800x600 resolution with millions of colors. After that I went to Windows and Linux and graphics APIs quit being an issue.
- scoopr 2y agoI was reading 3dica[0], though I was too young or stupid to really grok it back then. [0] https://www.modeemi.fi/drdoom/3dica/3dica.htm https://www.modeemi.fi/drdoom/3dica/3dica.htm
- gustavopezzi 2y agoThank you for posting this. I cannot believe I did not know about it yet!
- magicalhippo 2y agoTons of awesome demo-related tutorials floating around back then, surely some great stuff has been lost to the mists of time :(