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

  1. Path: informatik.tu-muenchen.de!fischerj
  2. From: fischerj@informatik.tu-muenchen.de (Juergen "Rally" Fischer)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: TMapping again!
  5. Date: 12 Mar 1996 18:09:21 GMT
  6. Organization: Technische Universitaet Muenchen, Germany
  7. Distribution: world
  8. Message-ID: <4i4ekh$8t4@sunsystem5.informatik.tu-muenchen.de>
  9. References: <38232442@kone.fipnet.fi> <4h45g4$ije@sunsystem5.informatik.tu-muenchen.de> <xRL9hMD0aRz1@point86.people-s.people.de>
  10. NNTP-Posting-Host: hphalle10.informatik.tu-muenchen.de
  11. Originator: fischerj@hphalle10.informatik.tu-muenchen.de
  12.  
  13.  
  14. In article <xRL9hMD0aRz1@point86.people-s.people.de>, azure@people-s.people.de (Tim Boescke) writes:
  15. |> Reply to Re: TMapping again! / 29.02.1996
  16. |> by fischerj@informatik.tu-muenchen.de (Juergen Rally Fischer)
  17. |> JF> In article <38232567@kone.fipnet.fi>, "Jyrki Saarinen" <jsaarinen@kone.fipnet.fi> writes:
  18. |> JF> |> 
  19. |> JF> |> >     A time ago I did an approach to this problem using a similar trick
  20. |> JF> |> >     than my two-command mapper.
  21. |> JF> |> >     (btw. actually this one WORKS .. I have tried it out)
  22. |> JF> |> > 
  23. |> JF> |> > 
  24. |> JF> |> >         move.l  d3,d2           ;d3=d4=0000000000000XXXXXXXxxxxxxYYYYYY
  25. |> JF> |> >         move    d0,d5           ;d0=a6=yyyyyyyy000000000000BBBBBBbbbbbb
  26. |> JF> |> >         and.l   d6,d2           ;d6=   00000000000001111111000000111111
  27. |> JF> |> >         and.b   d7,d5           ;d7=   xxxxxxxxxxxxxxxxxxxxxxxx11000000
  28. |> JF> |> >         or      d5,d2
  29. |> JF> |> >         move.b  (a4,d2.l),(a2)+ ;d2=   00000000000000xxxxxxbbbbbbyyyyyy
  30. |> JF> |> >         add.l   a6,d0
  31. |> JF> |> >         addx.l  d4,d3
  32. |> JF> |> > 
  33. |> JF> |> >      This one is doing Texturemapping + gouraud shading with
  34. |> JF> |> >      shadetable. (!!)
  35. |> JF> |> > 
  36. |> JF> |> >      The Texture is 64x64 (6 bit) and the shading is 6 bit two. You
  37. |> JF> |> >      will need a 256k combined Texture/Shading table.
  38. |> JF> |> 
  39. |> JF> |> Hmm. Not nice in a game for example where several textures
  40. |> JF> |> are needed. But a nice idea anyway!
  41. |> 
  42. |>     YOu can use this code with several textures. For example you could
  43. |>     split up the shading range. For example B=0-31 is textere one and
  44. |>     B=32-63 is Texture two.. etc. or use 32x32 textures...
  45. |> 
  46. |> JF> nice ? Cooooooool! 
  47. |> JF> Cool idea to pack the shading value into the texture adress!
  48. |> 
  49. |>     Thanks ;)
  50. |> 
  51. |> JF> The example does too much instructions :) but allows more general
  52. |> JF> mem usage.
  53. |> JF> 
  54. |> JF> What about this...
  55. |> JF> 
  56. |> JF>  add.l  a2,d2          0...00BBBbbbbbbbbbbbbbbbb
  57. |> JF>  add.l  a3,d1          x...xxxxxYYYYYYYYyyyyyyyy
  58. |> JF>  addx.l d3,d0          0...0000000000000XXXXXXXX
  59. |> JF>  move.l d2,d6
  60. |> JF>  move.w d1,d6
  61. |> JF>  move.b d0,d6
  62. |> JF>  move.b 0(a0,d6.l),(a1)+
  63. |> JF> 
  64. |> JF> 20 cycles gouraud mapping :)
  65. |> JF> 
  66. |> JF> 8 shadingsteps are 512k, not too much even for a A1200 game imho 
  67. |> JF> (well, people tell me they aim for higher machines anyway,
  68. |> JF> so the mem consumption can't be considered so bad ;)
  69. |> 
  70. |>     Welll. of course this is two cycles faster, but it takes twice the
  71. |>     memory and 8 shading steps are simply not enough ;)
  72.  
  73. why twice the mem ?
  74.  
  75. it can do also 16 steps, just like yours.
  76. n colors shaded textures, needing 2^(n-1) times more mem, just like yours :)
  77.  
  78.  
  79. |> 
  80. |> JF> I would really think about using this routine, it's really LOT quicker.
  81. |> JF> You can put multiple textures into a given 64k range btw. but those can't
  82. |> JF> be "repeart-mapped" uh "multiplexed" ? how you call it if x gets 256 and then
  83. |> JF> _plop_, 0 again on the left side ? Is this called bump-mapping ? :D
  84. |> 
  85. |>     wrap-around textures ?? Well erhm.. Bump-mapping is a bit different.
  86.  
  87. not knowing what it is I can imagine it is a bit different, though the ":D" ;)
  88. so what is bump-mapping ?
  89.  
  90. wrap-around: imagine you scan over the border of a 256x256 texture.
  91. pointer will be in same texture again, beacuse it's all "anded" to 64k.
  92. you can have multiple times the same texture in one polygon this way.
  93.  
  94. when using the 256x256 space for storting multiple textures (4 times
  95. 128x128 etc) you loose "wrap-around" :) Is the word silly ? what you'd use
  96. for it ?
  97.  
  98.  
  99. |>     (hehe found a nice and fast innerloop for that, too. ;) )
  100. |> 
  101. |> --
  102. |>     +--------------------------------------------------------------------+
  103. |>     |      -  AZURE@PEOPLE-S.people.de - Tim Boescke - AZURE /atw.bzr    |
  104. |>     +---------------------------------<AMIGA,PC,C64,PLUS/4,VCS2600>------+
  105. ------------------------------------------------------------------------
  106.    fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer)   =:)
  107.  
  108.