Getting old shitty video cards to work

Getting old shitty video cards to work

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Getting old shitty video cards to work

Post by robed »

Muhahahahahahaha, I am god, at least that what I wanted to call the topic ;p

Anyways, I have a way to get my Rage AGP card to work with TA Spring. It's kindah tricky in my case (I'm telling XFree it's a ATI 8500 Radeon, and so on). Either way, the important part is that with a litle modification we can get shitty old cards to run spring. What's the trick you ask? grep for this:

1) glCompressedTexImage2DARB(...)
2) GL_COMPRESSED_RGBA_S3TC_DXT1_EXT
3) GL_LINEAR_MIPMAP_NEAREST

for any lines with 1 or 2, just comment them out (There's a for loop in /Rendering/Map/SmfReadMap.cpp so uncomment that loop, and likewise for other parts of the code)

for lines with 3, it's usually in something like this, from SmfReadMap.cpp:

Code: Select all

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
Switch it to

Code: Select all

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
If you beg me, i might even make a screen of my 6 FPS ta spring game ;p (Yah, maxes out at 7, could go down to 1 though, lol). This is sinbad's descript of my card:
make it work on old crappy video cards your friend gave you that he got from his brother in law when it stopped working cause the fan was busted and you attached the fan from an old p2 300 Mhz processor you found in the garbage to make work (thanks sinbad)
I'mah go party now, because I am god (or at least his #1 man... after jesus, and the 12 deciples, and the holy ghost, and priests and nunes, and good people, and ... well shudap).

When I come back, I'll start adding some code to RtsSettings, and grep though changing code to something like this:

Code: Select all

if (configHandler.GetInt("UseMipmap", 1))
{
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
} else {
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
}
I'll do the same for compressed textures, with some else like

Code: Select all

configHandler.GetInt("UseCompressTex", 1)
Course there are some problems with map textures not showing up and such... And it could blow my computer up at any second, but it runs, instead of crashing, and that's good.

Ohh almost forgot, uncomment this line in /rednder/gl/myGl.cpp

Code: Select all


void LoadExtensions()
{
	glewInit();

	if(!GLEW_ARB_multitexture || !GLEW_ARB_texture_env_combine){
		handleerror(0,"Needed extension GL_ARB_texture_env_combine not found","Update drivers",0);
		// exit(0); Who needs a crash when you can play? :P
	}

	if(!GLEW_ARB_texture_compression){
		handleerror(0,"Needed extension GL_ARB_texture_compression not found","Update drivers",0);
		// exit(0); Who needs a crash when you can play? :P
	}
I'll make a cleaner fix and add to mantis, maybe tomorrow but right now, It's Time to party, cyahs ;p[/quote]
User avatar
hrmph
Posts: 1054
Joined: 12 May 2005, 20:08

Post by hrmph »

Great work!!! Now we have something else to tell people with crap video cards other than "Install the newer drivers, turn off all settings." Good man!
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

You know... Could also try to use the software rendering device, I know that in DirectX, I'm 99% sure there's something simular in GL too. So mipmaps off and compressed textures off and rendering device selection. People with multiple vid cards might want the rendering device selection too, so it's usful for them too, I'll see what I can do either today or tomorrow. By the By I have a feeling that the Ati 9200 button text display bug is caused by the GL_LINEAR_MIPMAP_NEAREST setting on either the button textures or the font textures. I have a feeeling that bug can be fixed too :D
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

Humm, couldn't find any docs on selecting the GL device (ie: card 1, card 2, software rendering). If anyone knows the flag needed, this would allow anyone with a P2 cluster of 10 computers and an ISA video card to play spring (lol, mines only 2 P2 and a AMD K7, and it's not up yet, because of lack of power; the circuit breaker keeps flipping off and the computers go down randomly). I'll do some more googling today, maybe find the DX call to do this, since I remeber using it.

Mipmaps work on my video card, but no reason to force people to use them. There's alot of places that use mipmaps though, about 20 or so lines that need to be changed throughout the code.

As for compressed textures, I'm still working on this one... If I turn it off the terrain map won't have a texture, and shows up as solid white (or some other 'odd' collection of white and black). My guess is that the textures have been saved into the map files as compressed textures. I'd have to write some code to decompress them before using them as uncompressed textures. Could be wrong though, been a while since I played with GL/DX :P

Lemme clean up some things, get the latest svn, and then I'll post the diffs, gimme a few hours ;p
User avatar
mother
Posts: 379
Joined: 04 May 2005, 05:43

Post by mother »

The textures in the maps are stored in DXT1 format.
[AF: Suggest you give the man a cookie]

And that is about all of value I can add...
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

Stored as GL_COMPRESSED_RGBA_S3TC_DXT1_EXT byte data? In that case the best I can do is 1) code something to decompress this stuff (bleh). or 2) bind the gound textures to a simple "grid" texture, so that us people with crap as computers will never load the map textures, but we will get a 'grid' for the ground.

Here's a screen of what it looks like when i use, say glTexImage2D, or gluBuild2DMipmaps to build the texture

Funny thing... Flooded Deserts minimap looks fine, but mars and smalldiv minimaps look all white (with the grey shadows on hills and such)

Desert:
http://img88.imageshack.us/my.php?image=untitled5yq.jpg
Mars:
http://img50.imageshack.us/my.php?image=screen4wd.jpg
User avatar
Maelstrom
Posts: 1950
Joined: 23 Jul 2005, 14:52

Post by Maelstrom »

Flooded Deserts minimap is NOT fine in that pic. Its just off-white with shadowed hills, instead of white with shadowed hills.

Ill try and find a screenshot of Desert so you can see what its ment to look like.

EDIT: Look in the background of this shot:
http://taspring.clan-sy.com/screenshots/screen84.jpg

The Minimap, when working properly, has those red-white-red-white alternating stipes on it.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

@ mother:My thinking exactly *hands robed a sizeable killocookie!*
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

Funny, the only two places that this glCompessedTexXYZ function call is used, is for the minimap and map textures... I'mah just hardcode a grid bmp texture intos the file, or something... and use that, but not today, or tomorrow, maybe not the next day either, need to do stuff, like find a job, get a life, that sort of thing :P

*breaks the cookie up* Free cookie crumbes from a sizeable killocookie for all!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

=O

*AF trembles with shock, visibly shaking as he sees a most horrendous sight*

You broke up a cookie! BLASPHEMY!!!!!!

* The broken cookie glistens as its fragments lay across the floor, the forum goers pick up the 'shards of cookie' expecting a delicious treat only to find the shards unsatisfying and 'unwholesome'*
User avatar
Min3mat
Posts: 3455
Joined: 17 Nov 2004, 20:19

Post by Min3mat »

its still good though ^^
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Dont take it badly tho, what your doing should push spring firmly itno the range needed for it to work nicely on this computer and not just my permanently offline rig.
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

This isn't going to speed up the framerate or anything. if it does we're talking going from say 25 FPS to 25.0000000001 FPS :P If you want a better frame rate, look into LOD on units, making the lowest setting use hummm... I think a prisime is the best shape for absolutely no tris per unit, and droping the lowest quality on the LOD for maps too. Ofcourse, that meens that the texture files for the units won't really be useful... Could always make a grid texture of white lines and black surface for the terain and a ~inverse 'team color' lines with 'team color' surface grid for the prisme units of varying sizes... Ofcourse, if you really want to improve FPS, I'd look into using only one texture surface (atm it looks like GL is setup to use multi pass textures, applying, say battle damage to map textures, and such). Turn all that off, and drop the number of tris down (along with the very low memory footprint of a simple grid texture) and you'll see a great improvement in FPS. I havn't looked into it but culling also improves speed, anyone know if the map rendering uses culling? Not usre if it's useful for units, but it's great for terrain.

*bakes another cookie; collects the cookie bits from the ground and eats them all, since nobody liked them :P*

edit: wierd... the touge looks like a happy face at 1600x1200... Muhahaha, take this bb code d: Muhahaha d: d: d:
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

yeah... we've determined that none of the rendering kills PCs as much as the pathing/terrain deformation/collition detection part of it...
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

None of the 'normal' rendering... But if units are reduced to prisms/squares and terrain resolution is as good as ohhh... ummm... it's coming... it's coming... WOFLINSTEIN!!!! For DOS!!! lol... yah, like 5 to 10 tris per 1x1 grid of the map (large maps are 16x16 no?) then a texas instument could run TA spring; then again a texas instrument can run an androde... Meh, the point is, there is plenty of skipping out (graphics wise) that could be done to spring, but as of yet hasn't been done.
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

Your just insane...
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

I'n sane? you spelt it wrong, it's "I'm sane" ;p

And what's wrong with blobs attacking different colored blobs on a black and white (or black and green) grid?

The human mind has an amazing capacity for symbolic associations. The drive for better graphics simply indicate's the mental capacity of ~some~ of the people who play 3D games ;p

Hummm, I wonder... the code for displaying the bulbs of collition... I could just use that... I hope it's already color coded... Units will probably need a surface though... the current bulbs use an alpha channel...
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

Waita minute, waitaminite... are you telling me the code supports alpha transparency in debug view? why don't we have this for units yet?
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

I'm saying it ~might~ depending on how it's drawn. the bubbles around the unit are one of two things:

1) and alpha map of an image of lines and a serries of tris that make up a sphere

2) a color code and a series of lines that form a hollow shape of a sphere, but are really just lines, not a sphere

If it's 1 then yah, debug view has alpha map support
If it's 2 then no, it doesn't

Either way, most of the textures are in a GL_RGBA format (normally GL_RGBA8) meening that the texture supports alpha mapping. The catch is that alot of the textures have multiple passes, to add things like battle damage to the ground. To apply the same alpha map to multiple textures is a bitch, but basically, the water code most definatly does alpha mapping. Adding alpha mapping is like adding cool waves to water that you can only see if you paid $5000 for your video card, like some devilish creature i know... As for adding them to mod units, well it should already be there, I have no clue though, but it should be there... Then again, alpha maps on units is going to drop FPS by say, about 5 (yah, a significant amount, increasing with each unit). having it on the ground textue would be just silly, since reall this is a 2D game with height... (and not a 3D game with underground tunnels or whatnot).
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

hmm, you mean the spheres drawn in debug view? If I remember those seme more like lines drawn around the unit of the same type as the AI lines only of much thinner thickness.

I'm probably wrong though.....
Post Reply

Return to “Engine”