From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Allegro perspective-correct texture mapping Date: Tue, 4 Mar 1997 20:17:03 +0000 Organization: None Distribution: world Message-ID: References: <5fg3s0$hob$1 AT troll DOT powertech DOT no> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 54 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Ove Kaaven writes: >1. Using POLYTYPE_PTEX, polygon3d_f bombs with SIGFPE when looking at >my (vertical) wall at extremely small angles (wall and camera ray >almost parallel). Here's a traceback, just in case. Argh: I don't like the sound of that! Are you sure the problem is the small angle, and not the Z coordinate being extremely small? Drawing polygons with a zero Z will result in a division by zero, and it's possible that if your input Z values are extremely small, rounding errors are truncating them down to zero. If that's not the problem, could you mail me a copy of the source that demonstrates the trouble (private email, there's no point clogging up the list with it). >2. The perspective-correct mapping is also somewhat slower than what's >appropriate for games like Doom or Duke3D. By looking at the Allegro This is true. But a Doom engine is a very specialised case involving a lot of restrictions on what can be displayed, which I don't think is appropriate for a general-purpose lib like Allegro. >vertical surfaces, or even better, the method described in zed3d >(letting the logical scanlines you map onto be slanted themselves) to >have a very fast perspective mapper? I'm pretty sure that would be slower than my method, because it wouldn't allow multiple pixels to be processed in unison with 32 bit writes, and tracing arbitrary lines through video memory would do bad things to the bus bandwidth and SVGA bank switching. My perspective divides are very slow on a 486, but almost free on a pentium since they are pipelined to run in parallel with the integer instructions for the previous set of pixels... >3. What should I give Shawn for his excellent library? Send me a complimentary copy of any programs you write with it. >4. Where should I post this to keep it from being off-topic? I don't think this is off-topic. I don't have a copy of the group charter handy, but I'm pretty sure that djgpp-specific issues like FPU exceptions and libs like Allegro are appropriate (the best way to do texture mapping is more dubious, but I'd be tempted to give that the benefit of the doubt and allow it as well, as long as it didn't turn into a lengthy thread). Am I right? (DJ? Eli???) /* * Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ * Beauty is a French phonetic corruption of a short cloth neck ornament. */