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