Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!ucsd!ucbvax!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!star.cs.vu.nl!mmblom From: mmblom@cs.vu.nl (Marc Blom) Newsgroups: comp.sys.amiga.programmer Subject: Fast 3d Graphics Keywords: fast 3d optimizing assembly cycles Message-ID: <9529@star.cs.vu.nl> Date: 2 Apr 91 21:24:30 GMT Sender: news@cs.vu.nl Lines: 34 'm wondering how fast 3D graphics can really go. I've written some rotation and perspective routines (in assembly) and profiling shows that 60 % of the time is spend in my routine RotatePoint. This routine rotates 1 point around all three axes in only about 900 cycles minimum and about 1100 cycles maximum. Is this fast ? Can someone do better ? (If so PLEASE mail me how you did it). I won't include the source here because it's about 100 lines long but instead i'll tell you what it does: It rotates a point x.word, y.word, z.word (signed) using fixed point (14 bits behind the point) integer calculation. rotating around each ax uses 4 muls, giving a total of 12 muls. (This is the variation in clock cycles I mentioned above, about 900 for best case muls, about 1100 for worst case muls) By the way, these clock cycles are only valid for a plain 68000. (I don't know about 680x0 with x=1,2,3,(4?) I believe you then have to play with cache-sizes etc. to get the best results). I want to have the fastest possible rotation routine so I can concentrate on kicking the Graphics Library AreaMove/Draw/End out (In a system friendly manner, don't worry :-) ) And write a fast blitter routine. The 60 % mentioned above was only relative to my routines part of the execution time, of the total time involved, 15 % was spend in my routines, including RotatePoint, Perspective etc and 85 % was consumed by those wonderfull (yuk, did I say wonderfull ?) Graphics Library Calls. No wonder games writers kick the OS out ! (I hope this doesn't provoke another TO OS OR NOT TO OS discussion !) If someone is interested in the source of RotatePoint, just drop me a line and I will mail it to you. Marc Blom +--------------------------------------------+------------------------+ | Marc Blom | Email: mmblom@cs.vu.nl | What IS the question ? | | Gondel 14/13 | | | | 8243 BL Lelystad | Phone: 03200-46233 (NL) | TO OS OR NOT TO OS, | | The Netherlands | | that is the question ! | +------------------+-------------------------+------------------------+