[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [linuxgames] Poll: Video Access



Adam D. Moss wrote:

I don't remember what answers you got originally.  I'm sure that
someone would have suggested textured palettes (though they're
somewhat deprecated).
Most modern graphics cards don't support pallettized textures
anymore - they just quietly convert them back to full RGB in
the driver as they are loaded.  Don't go that route.

If you want to get fancy and really want to encode all this
info in a single texture to work on all OpenGL implementations,
I think you could use a single alpha channel to encode both the
outline-mask and the tinting-levels by:
<snip>

It should be said that for REALLY modern graphics cards (anything
released less than a year ago), the way to go is to use Fragment
shaders.  With those, you can encode the data in your sprite any
way your little heart desires.

A shader is a program that runs at blinding speed for every pixel
that's rendered - using the hardware in the graphics card.  You can
do some truly spectacular things with this.

But since these cards typically have 256Mbytes of on-board memory
and you can probably use about 240Mb of that for textures...you are
unlikely ever to run out with the kinds of artwork you'd paint yourself
without a vast team of artists backing you up!

As has been pointed out, the OpenGL driver also 'virtualizes' that
memory - so if you DO run out, you'll never know it - all that happens
is that textures that havn't been used recently get left in the main
PC's memory - and are switched in and out as needed.  This is just
like virtual memory at the OS level - except that the backing store
is just the PC's main memory instead of the disk drive.

However, with next year's batch of graphics cards likely to come out
with 512Mb on-board, we are getting to a situation where there may
well be more RAM on the graphics card than inside the PC anyway!!

---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1@airmail.net>    WorkEmail: <sjbaker@link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
           http://tuxkart.sf.net http://prettypoly.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M-
V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----