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

  1. Path: nntp.teleport.com!sschaem
  2. From: sschaem@teleport.com (Stephan Schaem)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: TMapping again!
  5. Date: 20 Feb 1996 09:57:47 GMT
  6. Organization: Teleport - Portland's Public Access (503) 220-1016
  7. Message-ID: <4gc5ur$brr@maureen.teleport.com>
  8. References: <38232371@kone.fipnet.fi> <4fntd3$g56@sunsystem5.informatik.tu-muenchen.de> <38232442@kone.fipnet.fi> <4fvnjb$gdm@oreig.uji.es> <4g147q$sit@maureen.teleport.com> <4ga6lr$rp8@brachio.zrz.TU-Berlin.DE>
  9. NNTP-Posting-Host: julie.teleport.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Philipp Boerker (rawneiha@hydra.zrz.TU-Berlin.DE) wrote:
  13. : sschaem@teleport.com (Stephan Schaem) writes:
  14.  
  15. : > I would unroll the innerloop, you probably can save hundreds of dbra
  16.  
  17. : If you have an object with let's say 5000 polys umrolling will mean
  18. : a big overhead because of the treatment of "pixels modulo unrolling".
  19. : You may never enter that unrolled loop!
  20.  
  21.  What do you mean by "pixel modulo unrolling"? Never enter the loop?!?!
  22.  then you dont draw any pixels so its VERY fast :)
  23.  
  24.  Its true that there is some overhead, But here is an example:
  25.  
  26.     ...
  27.     moveq    #%1111,d3    ;2
  28.     and.w    d2,d3        ;2
  29.     neg.w    d3        ;2
  30.     lsr.w    #4,d2        ;4
  31.     jmp    (.z,pc,d3.w*8)    ;10 = 20 per scanline
  32.  ..    REPEAT    16
  33.     move.b    (a0,d0.w),(a1)
  34.     addx.l    d1,d0
  35.     adda.l    a2,a1
  36.     ENDR
  37. .z    dbra    d2,..        ;6 per pixel
  38.     ...
  39.  
  40.  now if this 'polygon' is more then 4 pixel height its worth it... well,
  41.  if its a few pixel width too :) 
  42.  But yea, I would be carefull if the polygon are realy tiny and the 
  43.  routine is out of the cache for each new polygon rendered.
  44.  
  45.  If the poly where to be ~4x4 pixel I would think rendering then using
  46.  the average color of the texture (precalculated of course) and use a
  47.  flat shading function (using also the average of the light value at the
  48.  triangle vertices, I dont think its worth gouraud shading stuff that
  49.  tiny).
  50.  
  51.  Stephan
  52.