RE: [Algorithms] Isometric 2D drawing order.
Brought to you by:
vexxed72
From: Tom F. <to...@mu...> - 2000-11-17 18:54:12
|
It's entirely possible that doing this: 1) decent high level cull 2) z-buf on 3) render base front to back 4) render buildings and sprites 5) sort alpha tris back to front 6) z-buf write off 7) render alpha tris Will be quicker. Despite the fact that you have the Z-buffer on, by drawing front to back you will get very fast Z-rejects for hidden stuff, and the framebuffer won't be touched, and the textels won't be fetched. This can be quicker, depending on your level of overdraw. Turning the Z-buffer write off (you still need the read) for alpha stuff is standard practice. Since they are sorted anyway, there's no need to write the Z values back, and it saves a bit of bandwidth. Having said all that, the majority of 2D drawing code is CPU-bound, not rasteriser-bound, so it may all be completely irrelevant. Tom Forsyth - purely hypothetical Muckyfoot bloke. This email is the product of your deranged imagination, and does not in any way imply existence of the author. > -----Original Message----- > From: Martin Slater [mailto:Ma...@cs...] > Sent: 17 November 2000 16:02 > To: gda...@li... > Subject: RE: [Algorithms] Isometric 2D drawing order. > > > > Cheers for the info, (and thanks to brian for starting it off) > > As I'm not looking for ground breaking speed (yet) the best > bet for speed to > implement has to be > > 1) decent high level cull > 2) z-buf off > 3) render base back to front > 4) z-buf on > 5) render buildings and sprites > 6) sort alpha tris back to front > 7) render alpha tris > > Only aiming at dx at the mo with only a token thought to users of old > systems so I can't imagine this will be too slow. Time to try it out.. > > > Martin > > > -----Original Message----- > > From: gda...@li... > > [mailto:gda...@li...]On > Behalf Of Tom > > Forsyth > > Sent: 17 November 2000 15:31 > > To: gda...@li... > > Subject: RE: [Algorithms] Isometric 2D drawing order. > > > > > > Further caveat - (1) is only true if they _all_ use ONE:ONE. > > If half use > > standard alpha-blend modes, they all need to be sorted > > properly. Well, OK, > > you don't need to sort ONE:ONEs with each other, just with > > the non-ONE:ONEs, > > but that's almost the same amount of work by the time you > > have written a > > sorting routine, etc. and I suspect the code that tests > > whether two facets > > do or don't need to be sorted against each other is going to > > be slower than > > just doing the sort for everything. > > > > > > Tom Forsyth - purely hypothetical Muckyfoot bloke. > > > > This email is the product of your deranged imagination, > > and does not in any way imply existence of the author. > > > > > > > -----Original Message----- > > > From: Tony Cox [mailto:to...@mi...] > > > Sent: 17 November 2000 12:13 > > > To: gda...@li... > > > Subject: RE: [Algorithms] Isometric 2D drawing order. > > > > > > > > > Almost, but not quite. You still need to sort the alpha polygons > > > back-to-front amongst themselves, *unless* > > > > > > (a) They use a blending mode like ONE:ONE which does not > > need sorting, > > > or > > > (b) They are unfiltered 1-bit alpha with alpha-testing > (i.e. simple > > > masks), where you can use the alpha testing to do the right > > thing on a > > > per-pixel basis to the z-buffer. > > > > > > If you have semi-transparency, then you have to sort. > > > > > > Of course, you can do a very rough sort, and hope that your alpha > > > primitives are sparse enough that the result is right enough > > > of the time > > > that nobody notices the odd error. > > > > > > Tony Cox - DirectX Luminary > > > Windows Gaming Developer Relations Group > > > http://msdn.microsoft.com/directx > > > > > > > > > >Just batch em up and render after everything else should do it, > > > shouldn't > > > >it? > > > > > > > >Martin > > > > > > > >> -----Original Message----- > > > >> From: gda...@li... > > > >> [mailto:gda...@li...]On > > > >> Behalf Of Ville > > > >> Miettinen > > > >> Sent: 17 November 2000 11:31 > > > >> To: gda...@li... > > > >> Subject: RE: [Algorithms] Isometric 2D drawing order. > > > >> > > > >> > > > >> Vanilla z-buffer does not handle alpha-blending > properly without > > > >> back->front sorting. Thus, you need to apply some > algorithm (such > > > >> as the one described below) to determine the correct drawing > > > >> order. > > > _______________________________________________ > > > GDAlgorithms-list mailing list > > > GDA...@li... > > > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > > > _______________________________________________ > > GDAlgorithms-list mailing list > > GDA...@li... > > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |