home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!julienas!loria!loria.fr!eker
- From: eker@loria.fr (Steven Eker)
- Newsgroups: comp.sys.atari.st
- Subject: Re: Apology: True Colour *IS* great for games.
- Message-ID: <711@muller.loria.fr>
- Date: 24 Dec 92 15:51:38 GMT
- References: <11490@uqcspe.cs.uq.oz.au> <1992Dec24.053556.20186@leland.Stanford.EDU>
- Sender: news@news.loria.fr
- Organization: CRIN (CNRS) Nancy - INRIA Lorraine
- Lines: 54
-
- In article <1992Dec24.053556.20186@leland.Stanford.EDU>, geomorph@leland.Stanford.EDU (Bayard Wenzel) writes:
- |> Another nifty thing about TRUE COLOR Mode is that when writing complex computer
- |> generated screens in real time, like the 3D projections of a flight sim., you
- |> do not have to go through all the palette registers to find the closest RGB
- |> match to the color you want to display. This looking up can take a lot of time,
-
- Not if you choose the positions of your colours in the palette to work for you
- rather than against you - with smart allocation scheme it can be faster.
-
- |> specially when the comp. gen.'d screen has many colors, i.e. gouraud shaded
- |> polygons (now some people qill say "Wait a minute! You can't generate g. shaded
- |> polygons in real time! can you?" well think again. Simple gouraud shading is
- |> not too time consuming.
-
- The good thing about true color is that it is 1word/pixel layout in memory
- rather than interleaved bit planes. Thus you can set the colour of a pixel
- with 1 access rather than 16. With flat shading this isn't so important since you
- can write 16 consectutive pixels with the same colour. With gouraud shading the
- value of each pixel is calculated individually and it makes a big difference.
-
- 256 colour palette with 1byte/pixel would be much faster for shading and texture
- mapping but unfortunately 256 color modes use interleaved bit planes on the
- falcon.
-
- It _might_ be possible to do real time gouraud shading and even texture mapping
- in true color mode if the bus is fast/smart enough.
-
- |> especially with a DSP. Look at the latest flight sims
- |> for the PC line for some impressive example of this. And those things have slow
- |> buses too!). What this all means is that TRUE COLOR Mode will not only look
- |> better but it may also perform faster than 256 color mode when using this kind
- |> of graphics!
-
- The DSP<->main memory bus is unlikely to be fast enough for the DSP to do shading.
- The trick is to have the DSP do all the 3D/lighting calculations/facet
- sorting/clipping at polygon level so that the 68030 can spend ~90% of its
- time rendering polygons
- - ideally with a tight (<=128 byte) inner loop so that it gets most of its
- instructions from cache to avoid bus contention.
-
- Suppose 6byte/vertex (16bit x, y, color) and average of 6 vertices/polygon.
- At 30fps with say 500 polygons on screen we need ~540K/s DSP->main memory.
- Assuming the world is stored in DSP RAM the main memory->DSP transfers will
- only contain position updates for moving objects. Just about doable...
- but only just.
-
- Its the speed of the 68030 and the 68030<->main memory bandwidth that worries me.
- Even with the best algorithms and coding tricks I doubt you can render even a
- small gouraud polygon in ~300 instructions... but maybe its possible to find
- a neat way of preprocessing the polygon on the DSP (eg y-sorting verticies,
- precomputing Bresenham increments for each edge) to speed things up; or do
- something clever with the blitter.
-
- Steven
-