home *** CD-ROM | disk | FTP | other *** search
- X-Mailer: MicroDot 1.10 [UNREGISTRIERT] via [DOS/NCBMail V2.21 REL.:160995]
- Message-ID: <xSLfXMD0aez4@point86.people-s.people.de>
- Organization: Artwork Demo Factories ..
- References: <38232442@kone.fipnet.fi> <4i4ekh$8t4@sunsystem5.informatik.tu-muenchen.de>
- 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: 14 Mar 1996 23:20:39 +0100
- Path: people-s.people.de!azure
- Newsgroups: comp.sys.amiga.programmer
- Distribution: world
-
-
- Reply to Re: TMapping again! / 12.03.1996
-
-
- JF> |> JF> |> > A time ago I did an approach to this problem using a similar trick
- JF> |> JF> |> > than my two-command mapper.
- JF> |> JF> |> > (btw. actually this one WORKS .. I have tried it out)
- JF> |> JF> |> >
- JF> |> JF> |> > move.l d3,d2 ;d3=d4=0000000000000XXXXXXXxxxxxxYYYYYY
- JF> |> JF> |> > move d0,d5 ;d0=a6=yyyyyyyy000000000000BBBBBBbbbbbb
- JF> |> JF> |> > and.l d6,d2 ;d6= 00000000000001111111000000111111
- JF> |> JF> |> > and.b d7,d5 ;d7= xxxxxxxxxxxxxxxxxxxxxxxx11000000
- JF> |> JF> |> > or d5,d2
- JF> |> JF> |> > move.b (a4,d2.l),(a2)+ ;d2= 00000000000000xxxxxxbbbbbbyyyyyy
- JF> |> JF> |> > add.l a6,d0
- JF> |> JF> |> > addx.l d4,d3
- JF> |> JF> |> >
- JF> |> JF> |> > This one is doing Texturemapping + gouraud shading with
- JF> |> JF> |> > shadetable. (!!)
- JF> |> JF> |> >
- JF> |> JF> |> > The Texture is 64x64 (6 bit) and the shading is 6 bit two. You
- JF> |> JF> |> > will need a 256k combined Texture/Shading table.
- JF> |> JF> |>
- JF> |> JF> |> Hmm. Not nice in a game for example where several textures
- JF> |> JF> |> are needed. But a nice idea anyway!
- JF> |>
- JF> |> YOu can use this code with several textures. For example you could
- JF> |> split up the shading range. For example B=0-31 is textere one and
- JF> |> B=32-63 is Texture two.. etc. or use 32x32 textures...
-
- JF> |> JF> The example does too much instructions :) but allows more general
- JF> |> JF> mem usage.
- JF> |> JF>
- JF> |> JF> What about this...
- JF> |> JF>
- JF> |> JF> add.l a2,d2 0...00BBBbbbbbbbbbbbbbbbb
- JF> |> JF> add.l a3,d1 x...xxxxxYYYYYYYYyyyyyyyy
- JF> |> JF> addx.l d3,d0 0...0000000000000XXXXXXXX
- JF> |> JF> move.l d2,d6
- JF> |> JF> move.w d1,d6
- JF> |> JF> move.b d0,d6
- JF> |> JF> move.b 0(a0,d6.l),(a1)+
- JF> |> JF>
- JF> |> JF> 20 cycles gouraud mapping :)
- JF> |> JF>
- JF> |> JF> 8 shadingsteps are 512k, not too much even for a A1200 game imho
- JF> |> JF> (well, people tell me they aim for higher machines anyway,
- JF> |> JF> so the mem consumption can't be considered so bad ;)
- JF> |>
- JF> |> Welll. of course this is two cycles faster, but it takes twice the
- JF> |> memory and 8 shading steps are simply not enough ;)
- JF> why twice the mem ?
-
- Because my loops table takes only 256k for 64x64x64.. but ok. the amount
- of data is the same. Its just spread different in the memory.
-
- JF> it can do also 16 steps, just like yours.
-
- nope.. My has 64 shading steps..
-
- JF> n colors shaded textures, needing 2^(n-1) times more mem, just like yours :)
-
- Yep.. 4mb for 64 shading steps. Simply too much! Thats why I did
- this bit-fiddling !!
-
- JF> |> JF> I would really think about using this routine, it's really LOT quicker.
- JF> |> JF> You can put multiple textures into a given 64k range btw. but those can't
- JF> |> JF> be "repeart-mapped" uh "multiplexed" ? how you call it if x gets 256 and then
- JF> |> JF> _plop_, 0 again on the left side ? Is this called bump-mapping ? :D
- JF> |>
- JF> |> wrap-around textures ?? Well erhm.. Bump-mapping is a bit different.
- JF>
- JF> not knowing what it is I can imagine it is a bit different, though the ":D" ;)
- JF> so what is bump-mapping ?
-
- Bump mapping is Phong-shading with a bumpmap. The bumpmap contains
- a list of angles. These are added to the polys normal, so that you
- can simulate rough surfaces etc. In my TP5 Intro ("Creep") is a bump-
- mapped torus. Though the bumpmap is too small and there are some
- light errors. But I fixed that by now.. wait and see. ;)
-
- JF> wrap-around: imagine you scan over the border of a 256x256 texture.
- JF> pointer will be in same texture again, beacuse it's all "anded" to 64k.
- JF> you can have multiple times the same texture in one polygon this way.
- JF>
- JF> when using the 256x256 space for storting multiple textures (4 times
- JF> 128x128 etc) you loose "wrap-around" :) Is the word silly ? what you'd use
- JF> for it ?
-
- You could use my loop with a different AND-mask ..
-
- --
- +--------------------------------------------------------------------+
- | - AZURE@PEOPLE-S.people.de - Tim Boescke - AZURE /atw.bzr |
- +---------------------------------<AMIGA,PC,C64,PLUS/4,VCS2600>------+
-