Getting old shitty video cards to work - Page 2

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

Post by robed »

I couldn't find the code, didn't look to hard though. I think i'mah just find out how to do polygon outlines... Kindah like what shows up when you start building a build, or unit, the green outlineing. Do that for units and ground, and then simply add an appropriate glColor4f(); tag to set the color to the team color. I ~might~ even change the background color of the sky box, or remove the sky box and set the color with a jeez... been a while, glClearScene(Rf,Gf,Bf); It's something like that... clear the current screen buffer and sets the color of the scene to the given RGB value, before doing any drawing to the buffer.
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

Found the code snipet for drawing the debug collition spheres. I might use this, along with disabling any regular drawing of the units, and adding some color coding depending on the team. Still need to get map textures to draw in grid mode :/ Off to read a few tutorials and get back up to speed with gl i guess... Should have something finished tonight, or tomorrow. depends on if I go to sinbads house or not ;p
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

Here's a screen of my fix for shitty old cards

http://img236.imageshack.us/my.php?imag ... led7kn.jpg

It removes all map textures (the map texture file is never even loaded, nor is memory created for the textures)

The diffs will come in another post, to try and keep things clean...

Problems:

1) LOD really causes trouble, if you look at the screen the lower midle section has the best 'grid' or wiremesh, the next box is decent and you can just make out the last box, which is terrible. I might make it so that the map LOD becomes a static setting when bUseCompressedTex is on. Instead of doing a LOD, I'd just use a static Detail level for the entire scene. Course this will come later...

2) I havn't removed the shadow maps for the ground. I'll be able to do this later, but at the moment, I figured getting it up was best. Anyways, shadows textures for the map are still created, and that's a waste of preciouse memory for the slow cheap ass system that will be using this feature (like mine; PS: I accept donations of money, computer parts, and sex, although i prefer the latter).

3) Still need to find and look at the minimap code to have that drawn in some sort of useful and clear way.

4) water is still drawn below the terrain, and it can be dificult to see were the land ends and the water begings.

5) be nice if depending on the height, the color of the wiremesh changed

6) would also be nice if debug view drew the map this way to make visible the LOD of the terrain/textures

Pros: It works on shitty cards

Ok, lemme diff the files, gimme 5-10 ;p
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

It's ugly, but here goes:

diff -r -u trunk trunk.orig-conf/

Code: Select all

Binary files trunk/build/rts/Rendering/GL/myGL.o and trunk.orig-conf/build/rts/Rendering/GL/myGL.o differ
Binary files trunk/build/rts/Rendering/Map/BFGroundDrawer.o and trunk.orig-conf/build/rts/Rendering/Map/BFGroundDrawer.o differ
Binary files trunk/build/rts/Sim/Map/ReadMap.o and trunk.orig-conf/build/rts/Sim/Map/ReadMap.o differ
Binary files trunk/build/rts/Sim/Map/SmfReadMap.o and trunk.orig-conf/build/rts/Sim/Map/SmfReadMap.o differ
Binary files trunk/build/scons_signatures.dblite and trunk.orig-conf/build/scons_signatures.dblite differ
Binary files trunk/game/spring and trunk.orig-conf/game/spring differ
diff -r -u trunk/rts/Rendering/GL/myGL.cpp trunk.orig-conf/rts/Rendering/GL/myGL.cpp
--- trunk/rts/Rendering/GL/myGL.cpp	2006-03-10 18:57:22.000000000 -0500
+++ trunk.orig-conf/rts/Rendering/GL/myGL.cpp	2006-03-10 18:06:07.000000000 -0500
@@ -8,7 +8,6 @@
 #include "VertexArray.h"
 #include "VertexArrayRange.h"
 #include "FileSystem/FileHandler.h"
-#include "Platform/ConfigHandler.h"
 #include "Game/GameVersion.h"
 #include "Rendering/Textures/Bitmap.h"
 #include "Platform/errorhandler.h"
@@ -43,16 +42,9 @@
 		exit(0);
 	}
 
-	if (!GLEW_ARB_texture_compression) {
-		handleerror(0,
-			"Needed extension GL_ARB_texture_compression not found"
-			". Disabling compressed textures",
-			"Update drivers to see the map textures",
-			0);
-		// Disable compressed textures; See SmfMapReader.h variable
-		// m_bUseCompressedTex for more details
-		configHandler.SetInt("bUsecompressedTex", 0);
-		// exit(0); Why quit when we can avoid compressed textures?
+	if(!GLEW_ARB_texture_compression){
+		handleerror(0,"Needed extension GL_ARB_texture_compression not found","Update drivers",0);
+		exit(0);
 	}
 	
 	vertexArray1=new CVertexArray;
Only in trunk/rts/Rendering/GL: myGL.cpp~
diff -r -u trunk/rts/Rendering/Map/BFGroundDrawer.cpp trunk.orig-conf/rts/Rendering/Map/BFGroundDrawer.cpp
--- trunk/rts/Rendering/Map/BFGroundDrawer.cpp	2006-03-10 19:08:14.000000000 -0500
+++ trunk.orig-conf/rts/Rendering/Map/BFGroundDrawer.cpp	2006-03-10 18:06:07.000000000 -0500
@@ -100,11 +100,7 @@
 
 void CBFGroundDrawer::DrawGroundVertexArray()
 {
-	if (groundTextures) {
-		va->DrawArray0(GL_TRIANGLE_STRIP);
-	} else {
-		va->DrawArray0(GL_LINE_STRIP);
-	}
+	va->DrawArray0(GL_TRIANGLE_STRIP);
 
 	va=GetVertexArray();
 	va->Initialize();
@@ -124,9 +120,7 @@
 	va=GetVertexArray();
 	va->Initialize();
 
-	// This is Null if bUseCompressedTex is false;
-	// Read SmfReadMap.h, var m_bUsecompressedTex for more info
-	if (groundTextures) groundTextures->DrawUpdate();
+	groundTextures->DrawUpdate();
 
 	int x,y;
 	int mapx=gs->mapx+1;
@@ -184,21 +178,16 @@
 //		info->AddLine("%i %i",sx,ex);
 		for(int btx=sx;btx<ex;++btx){
 			bigtexsubx=btx;
-			
-			// This is Null if bUseCompressedTex is false;
-			// Read SmfReadMap.h, var m_bUsecompressedTex for more info
-			if (groundTextures) {
-				if((drawExtraTex) || !shadowHandler->drawShadows){
-					groundTextures->SetTexture(btx,bty);
-					SetTexGen(1.0/1024,1.0/1024,-btx,-bty);
-				} else {
-					glActiveTextureARB(GL_TEXTURE2_ARB);
-					groundTextures->SetTexture(btx,bty);
-					glProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB,11, -btx,-bty,0,0);
-					glActiveTextureARB(GL_TEXTURE0_ARB);
-				}
+
+			if((drawExtraTex) || !shadowHandler->drawShadows){
+				groundTextures->SetTexture(btx,bty);
+				SetTexGen(1.0/1024,1.0/1024,-btx,-bty);
+			} else {
+				glActiveTextureARB(GL_TEXTURE2_ARB);
+				groundTextures->SetTexture(btx,bty);
+				glProgramEnvParameter4fARB(GL_VERTEX_PROGRAM_ARB,11, -btx,-bty,0,0);
+				glActiveTextureARB(GL_TEXTURE0_ARB);
 			}
-			
 			for(int lod=1;lod<(2<<NUM_LODS);lod*=2){
 				int cx=(int)(cam2->pos.x/(SQUARE_SIZE));
 				int cy=(int)(cam2->pos.z/(SQUARE_SIZE));
Only in trunk/rts/Rendering/Map: BFGroundDrawer.cpp~
diff -r -u trunk/rts/Sim/Map/SmfReadMap.cpp trunk.orig-conf/rts/Sim/Map/SmfReadMap.cpp
--- trunk/rts/Sim/Map/SmfReadMap.cpp	2006-03-10 18:57:22.000000000 -0500
+++ trunk.orig-conf/rts/Sim/Map/SmfReadMap.cpp	2006-03-10 18:06:06.000000000 -0500
@@ -18,7 +18,6 @@
 using namespace std;
 
 CSmfReadMap::CSmfReadMap(std::string mapname)
-:	m_bUseCompressedTex	(configHandler.GetInt("bUseCompressedTex", 1) != 0)
 {
 	readmap=this;//not entirely legal probably
 
@@ -226,34 +225,30 @@
 	gluBuild2DMipmaps(GL_TEXTURE_2D,GL_RGBA8 ,bm.xsize, bm.ysize, GL_RGBA, GL_UNSIGNED_BYTE, bm.mem);
 
 	PrintLoadMsg("Creating overhead texture");
-	
-	// If we don't use Compressed textures, we're using wireframe and this texture doesn't need to be loaded into memory
-	if (m_bUseCompressedTex) {
-		unsigned char* buf=new unsigned char[MINIMAP_SIZE];
-		ifs->Seek(header.minimapPtr);
-		ifs->Read(buf,MINIMAP_SIZE);
-		glGenTextures(1, &minimapTex);
-		glBindTexture(GL_TEXTURE_2D, minimapTex);
-		glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
-		glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
-		//glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA8 ,512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, buf);
-		int offset=0;
-		for(unsigned int i=0; i<MINIMAP_NUM_MIPMAP; i++)
-		{
-			int mipsize = 1024>>i;
-
-			int size = ((mipsize+3)/4)*((mipsize+3)/4)*8;
-
-			glCompressedTexImage2DARB(GL_TEXTURE_2D, i, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, mipsize, mipsize, 0, size, buf + offset);
-
-			offset += size;
-		}
-		
-		glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MINIMAP_NUM_MIPMAP-1 );
-		bigtex[0]=minimapTex;
 
-		delete[] buf;
+	unsigned char* buf=new unsigned char[MINIMAP_SIZE];
+	ifs->Seek(header.minimapPtr);
+	ifs->Read(buf,MINIMAP_SIZE);
+	glGenTextures(1, &minimapTex);
+	glBindTexture(GL_TEXTURE_2D, minimapTex);
+	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
+	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
+	//glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA8 ,512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, buf);
+	int offset=0;
+	for(unsigned int i=0; i<MINIMAP_NUM_MIPMAP; i++)
+	{
+		int mipsize = 1024>>i;
+
+		int size = ((mipsize+3)/4)*((mipsize+3)/4)*8;
+
+		glCompressedTexImage2DARB(GL_TEXTURE_2D, i, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, mipsize, mipsize, 0, size, buf + offset);
+
+		offset += size;
 	}
+	glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, MINIMAP_NUM_MIPMAP-1 );
+	bigtex[0]=minimapTex;
+
+	delete[] buf;
 
 	unsigned char *map = new unsigned char[gs->mapx/2*gs->mapy/2];
 	ifs->Seek(header.metalmapPtr);
@@ -262,9 +257,7 @@
 
 	PUSH_CODE_MODE;
 	ENTER_UNSYNCED;
-	if (m_bUseCompressedTex) {
-		groundTextures=new CBFGroundTextures(ifs);
-	}
+	groundTextures=new CBFGroundTextures(ifs);
 	POP_CODE_MODE;
 
 	PrintLoadMsg("Creating ground shading");
@@ -366,10 +359,8 @@
 	if (minimapTex) glDeleteTextures (1, &minimapTex);
 	if (shadowTex) glDeleteTextures (1, &shadowTex);
 
-	// Ohh the pain... if (groundTextures) please... ~.~ amateurs
-	if (groundTextures) delete groundTextures;
+	delete groundTextures;
 
-	// Ohh the pain... if (pointer/array) please... ~.~ amateurs
 	//myDelete(heightmap);
 	delete[] heightmap;
 //	delete[] normals;
Only in trunk/rts/Sim/Map: SmfReadMap.cpp~
diff -r -u trunk/rts/Sim/Map/SmfReadMap.h trunk.orig-conf/rts/Sim/Map/SmfReadMap.h
--- trunk/rts/Sim/Map/SmfReadMap.h	2006-03-10 18:52:25.000000000 -0500
+++ trunk.orig-conf/rts/Sim/Map/SmfReadMap.h	2006-03-10 18:06:06.000000000 -0500
@@ -29,7 +29,6 @@
 
 	unsigned char waterHeightColors[1024*4];
 protected:
-	bool m_bUseCompressedTex;		// Should we use Compressed Textures; Else draw Wiremesh
 	float3 GetLightValue(int x, int y);
 	void ParseSMD(std::string filename);
 };
Only in trunk/rts/Sim/Map: SmfReadMap.h~
Only in trunk/rts/build/kdevelop: rts.kdevses
Binary files trunk/rts/build/scons/config.pyc and trunk.orig-conf/rts/build/scons/config.pyc differ
Binary files trunk/rts/build/scons/detect.pyc and trunk.orig-conf/rts/build/scons/detect.pyc differ
Binary files trunk/rts/build/scons/filelist.pyc and trunk.orig-conf/rts/build/scons/filelist.pyc differ
Binary files trunk/rts/build/scons/rts.pyc and trunk.orig-conf/rts/build/scons/rts.pyc differ
Only in trunk: rts.kdevelop.filelist
Only in trunk: rts.kdevelop.pcs
If someone wants I can upload a file, wait i know...

http://taspring.clan-sy.com/mantis/view.php?id=124

There the diff is on mantis too ;p
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

probably shades of green to red for land, and shades of blue to magenta for underwater would look reasonable
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

How about I wait till they add this to SVN before I do any more work. from past experiance, the ta dev team rarly does add bug fixes of this nature... But if that's changed, and it has from what I hear, then I'll tweak the fix, and do that list of problems thing I wrote.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I think that you should ahve at least mentioned it in the mailing list as then you'd know perfectly what they where gonna do with it, and they'd be giving you feedback.

Otherwise you said ti was ugly in one of your posts and if I'm correct and havent misread, its not turn on/offable by settings.exe yet is it? Eitherway those 2 would be very good reasons for not submitting to svn currently.

Say thigns in the mailing list. If you say them on the forums and just aimlessly send it to them it wont have the same effect.
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

1) It is turn on off able, just not added to the rtsSettings, so there ain't no checkbox.

2) If the devs want my help, they can read my post here and in mantis, and add this to svn or complain to me about it in a post.

3) the ugly was refering to posting a diff to the forum, and not to the actual fix.

4) I dono... I forgot or something... my rant power is weakning... i'm mellting,,, ~>~
User avatar
FoeOfTheBee
Posts: 557
Joined: 12 May 2005, 18:26

Post by FoeOfTheBee »

This is really fantastic. It's great to see the content of the game made available to people who can't afford the presentation of that content.
User avatar
robed
Posts: 56
Joined: 02 Mar 2006, 03:18

Post by robed »

I'll probably be doing alot to this effect, since at the moment, I can't afford the presentation of the content. wireframe unit models, turn off skybox, wireframe water. Possibly alot more that has yet to come to mind. Disabling mipmaping, etc... My goal is to get up to about 30 FPS with both the software rendering (ie: CPU rendering, and no GPU usage) and with my current Ati Rage card. Even if I end up getting a new vid card, I've always played one level of a game at highest graphics mode, to see what it looks like, and then set everything to lowest to actually play the game. if anyone is interested in playing the game but annot do to limited graphics resources (CPU resources, memory etc...) pm me through the forum 'mail' system and I'll try to see what I can do to get your system running spring :D
patmo98
Posts: 188
Joined: 09 Jan 2006, 17:51

Post by patmo98 »

Try posting this to the mailing list. Thats the best place to post stuff like this IF you have it as a diff. On the other hand most feature request sent there are ignored if the requester isn't willing to write most of the code. In my experence thay are very willing to take diff files though.
Post Reply

Return to “Engine”