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

Re: OpenGL texturing

Steve Baker:

> Don't make each unit be a separate texture.  You'll get MUCH better
> performance if you can pack lots of little images into one larger texture
> and change the texture coordinates on the unit to select which piece of the
> texture to use.
This sounds a good idea...

> Sorting your units so you draw all of them that use texture map A before
> you switch to using texture map B - will make a MASSIVE difference to
> performance if you do run out of texture space on the graphics card.
Another good idea...

> > Are there run-time color transformations available for OpenGL (except
> > lightning or reflection...)
> There are a lot of possibilities - too many to discuss in email.
I 'll search around the net...

> You use glGenTextures() to get either one handle - or a bunch of them if
> you need a lot of textures.
> Then you use glBindTexture() to make that handle "current".
Ok, i got it.

>1) Draw the texture with transparent parts where the unit colours
>    are needed.  Draw each unit twice - once in it's "unit colour"
>    and then again in white with the texture applied to it. Wherever
>    there are holes in the texture, your unit colours show through.
>    No textures to download or modify in realtime!  One set of textures
>    does for all the players.
I'll try this with some lights to change the colors...

>2) Just create one set of textures for each player and download them
>    all at the start of the game.   If there aren't too many unit
>    types and player colours - that's a simple thing to do.
Too many units and too many players....

Again thank you, you've been very helpful.
Francesco Orsenigo