home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3421 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.9 KB  |  48 lines

  1. Path: news.eunet.fi!fipnet!kone!jsaarinen
  2. Newsgroups: comp.sys.amiga.programmer
  3. X-NewsReader: IntuiNews 1.2b (31.7.94)
  4. References: <4g5mv0$sns@news01.uni-trier.de>
  5. From: "Jyrki Saarinen" <jsaarinen@kone.fipnet.fi>
  6. Date: Mon, 19 Feb 96 19:30:09 UT
  7. Comments: Illegal date header - new date added by quicknews
  8. X-Original-Date: Mon, 19 Feb 96 19:36:37 
  9. MIME-Version: 1.0
  10. Content-Type: text/plain; charset=iso-8859-1
  11. Content-Transfer-Encoding: binary
  12. Subject: Re: Wolfenstein Texture mapping problem
  13. Message-ID: <38232525@kone.fipnet.fi>
  14.  
  15.  
  16. > I'm currently writing a Wolfenstein-type engine. I did start in C and 
  17. > slowly converted parts over to assembler. Although I have experienced 
  18. > some speed up, I'm still not satisfied. I think the bottleneck is the 
  19. > wall texturemapping.
  20.  
  21. Very fast wallmapping is easy.
  22.  
  23. > What I do is calculate the ratio texture_height/wall_height as a
  24. > fixpoint  number and use it to add to the offset into the texture. The 
  25. >áfixpoint arithmetics do involve some shifting and stuff, and I guess that
  26. > it  simply too much overhead. 
  27.  
  28. Use addx! No shifting needed:
  29.  
  30.         move.b  (a0,d0.w),(a1)  ;fetch pixel from the texture and write
  31.         addx.l  d1,d0           ;interpolate, 16 bit fraction in the upper
  32.                                 ;word
  33.         add.l   a2,a1           ;move to the next line
  34.  
  35. You should use 90 degrees rotated textures to be able to use
  36. this. This loop is 14 68020/68030 cycles per pixel, quite fast.
  37. Some unrolling would be a very nice thing to do, too..
  38.  
  39. Also, for a Wolf3D clone with only walls, scrambled chunky
  40. buffer would be good since rendering is done vertically,
  41. thus the first pass can be eliminated. Then, while copying
  42. the chunky buffer from fast to chip do one or two c2p passes
  43. for free and then use QBlit() to do async c2p passes.
  44.  
  45. --                               _
  46. a Stellar programmer          _ //
  47. "Amiga - back for the future" \X/
  48.