home *** CD-ROM | disk | FTP | other *** search
- X-Mailer: MicroDot 1.10 [UNREGISTRIERT] via [DOS/NCBMail V2.21 REL.:160995]
- Message-ID: <xJSEnMD0aez4@point86.people-s.people.de>
- Organization: Artwork Demo Factories ..
- References: <38232371@kone.fipnet.fi> <38232442@kone.fipnet.fi>
- X-Gateway: ZCONNECT UU people-s.people.de [DUUCP vom 01.07.1994]
- MIME-Version: 1.0
- Content-Type: text/plain; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
- From: azure@people-s.people.de (Tim Boescke)
- Subject: Re: TMapping again!
- Date: 16 Feb 1996 23:28:23 +0100
- Path: people-s.people.de!azure
- Newsgroups: comp.sys.amiga.programmer
- Distribution: world
-
- jsaarinen@kone.fipnet.fi (Jyrki Saarinen) erzeugte am 13.02.1996 unter dem
- Betreff "Re: TMapping again!" :
-
-
- JS> > A ultraoptimized texturemapper uese no shading table.
- JS> > even add-shading slows mapping down.
- JS> >
- JS> > Imgagine 32 colors, each 8 shading-steps = 256 colors.
- JS>
- JS> Yep. But how do you expect that a game for example can
- JS> be made with n-1 textures, all sharing the same 32c palette?
- JS>
- JS> > move.w d1,d6
- JS> > move.b d0,d6
- JS> > move.l d6,a0
- JS> > move.b (a0),d7
- JS> > sub.b d5,d7 ;another 2 cycles
- JS> > move.b d7,(a1)+ ;another 2 cycles
- JS> >
- JS> > addx.l d2,d0 ;x
- JS> > addx.l d3,d1 ;y
- JS> > addx.l d4,d5 ;gouraud-alike color. ;another 2 cycles
- JS>
- JS> Your sub.b d5,d7 trashs the X-flag .. better use or.b.
- JS>
- JS> > no reg left for dbra loop. 2 more cycles in unrolled loop.
- JS> >
- JS> > in inner-loop another 6 additional cycles compared to
- JS> > nonshaded mapping. +30%.
- JS>
- JS> Hmm. I made once a mapper with 16c and 16 shades, all fitted
- JS> to registers, add.l an,ax was used for V interpolation though,
- JS> only 8 bits of fraction in V.
- JS>
- JS> > I guess with table it's more like +70%.
- JS>
- JS> Well. How many cycles the optimal mapper was?
- JS>
- JS> move.w d1,d0
- JS> move.b d2,d0
- JS> addx.l d3,d1
- JS> move.l d0,a0
- JS> addx.l d4,d2
- JS> move.b (a0),(a1)+
- JS>
- JS> That is 17 cycles .. now, my Texture/Gouraud loop with
- JS> a shading table, 256c and up to 256 shades is 30 020/030
- JS> cycles, calculated the same way like that 17 cycles.
- JS>
- JS> ~76% slower .. Quite a good guess.
-
- A time ago I did an approach to this problem using a similar trick
- than my two-command mapper.
- (btw. actually this one WORKS .. I have tried it out)
-
-
- move.l d3,d2 ;d3=d4=0000000000000XXXXXXXxxxxxxYYYYYY
- move d0,d5 ;d0=a6=yyyyyyyy000000000000BBBBBBbbbbbb
- and.l d6,d2 ;d6= 00000000000001111111000000111111
- and.b d7,d5 ;d7= xxxxxxxxxxxxxxxxxxxxxxxx11000000
- or d5,d2
- move.b (a4,d2.l),(a2)+ ;d2= 00000000000000xxxxxxbbbbbbyyyyyy
- add.l a6,d0
- addx.l d4,d3
-
- This one is doing Texturemapping + gouraud shading with
- shadetable. (!!)
-
- The Texture is 64x64 (6 bit) and the shading is 6 bit two. You
- will need a 256k combined Texture/Shading table.
-
- The Routine byself was a bit slower than ordenary Texturemapping.
- But should be a lot fast than to memery-accesses. And it uses only
- two adds..
-
- Speed could still be improved by aligned the table to a 256k border.
-
- JS> -- _
- JS> a Stellar programmer _ //
- JS> "Amiga - back for the future" \X/
-
- --
- +--------------------------------------------------------------------+
- | - AZURE@PEOPLE-S.people.de - Tim Boescke - AZURE /atw.bzr |
- +------------------<programming on:AMIGA,PC,C64,PLUS/4,VCS2600>------+
-