home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4082 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: nntp.teleport.com!sschaem
  2. From: sschaem@teleport.com (Stephan Schaem)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Wolfenstein Texture mapping problem
  5. Date: 18 Feb 1996 19:27:05 GMT
  6. Organization: Teleport - Portland's Public Access (503) 220-1016
  7. Message-ID: <4g7ui9$em3@maureen.teleport.com>
  8. References: <4g5mv0$sns@news01.uni-trier.de>
  9. NNTP-Posting-Host: linda.teleport.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Hans-Joerg Frieden (hfrieden@fix.uni-trier.de) wrote:
  13. : Hi all!
  14.  
  15. : I'm currently writing a Wolfenstein-type engine. I did start in C and 
  16. : slowly converted parts over to assembler. Although I have experienced 
  17. : some speed up, I'm still not satisfied. I think the bottleneck is the 
  18. : wall texturemapping.
  19.  
  20. : What I do is calculate the ratio texture_height/wall_height as a fixpoint 
  21. : number and use it to add to the offset into the texture. The fixpoint 
  22. : arithmetics do involve some shifting and stuff, and I guess that it 
  23. : simply too much overhead. 
  24.  
  25. : Now I have a new solution in mind: I have two tables, one to shrink and 
  26. : one to enlarge the texture. It is basically a precalculated version of 
  27. : what I've done before... What I'd like to know is if someone's willing to 
  28. : part with some information about how he would do it. I'd really like to 
  29. : hear something, as I'm not really an assembler programmer, and I don't 
  30. : like counting cycles...
  31.  
  32.  You tryed this and its to slow?
  33.  
  34.  move.b    (a0,d0.w),(a1)
  35.  addx.l    d1,d0
  36.  adda.l    a2,a1
  37.  
  38.  Now what you could do is use self creating code :
  39.  
  40.  move.b    (a0),(width*0,a1)
  41.  move.b (a0),(width*1,a1)
  42.  move.b (a0)+,(width*2,a1)
  43.  etc...
  44.  
  45.  create a peice of code for each scale factor that you want to speedup.
  46.  probably only the tall lines, and just to wich ever code is best for
  47.  the condition. but this will only give you a ~30% speedup vs the first
  48.  methode.
  49.  
  50.  using precalc table like this
  51.  
  52.  move.w    (a3)+,d0
  53.  movea.l d0,a0
  54.  move.b    (a0),(a1)
  55.  adda.l    a2,a1
  56.  
  57.  is bad.... My guess is stick with the good old 3 inst/pixel methode.
  58.  Mapping floor with a 32x32 texture pattern can be done in 13cycle
  59.  mapping walls take 11. There is no reason not to map floor & ceiling :)
  60.  
  61.  Stephan
  62.