Homesource Forums

Homeworld Source Editing Talk
It is currently Mon Sep 25, 2017 10:53 pm

All times are UTC - 5 hours

Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Oct 01, 2008 5:51 am 

Joined: Wed Nov 15, 2006 8:15 am
Posts: 100
Since a couple of days, I have been looking at the code to find a way to increase graphic quality.

I am sure you all have seen that after a certain number of ships is displayed to the screen the graphic quality decreases harshly. I was certainly a good idea back in 1999, but with the increase in power of both our gpu and cpu, it becomes more of a limit.

What we can say is that texture quality when a the best level of detail is pretty good for a game from 1999, now, the idea is to allow the quality to stay at this level.

I have been looking into the code and found two limiters. Firstly the scale factor which controls directly the level of detail based on the distance between the camera and the ship, and the limit of polygons displayed which affects the scale factor by reducing it when the maximum number of polygon is reached.

So I have been toying a little bit with these parameters and here is a little patch that changes these settings :

Index: src/Game/StatScript.c
--- src/Game/StatScript.c (révision 674)
+++ src/Game/StatScript.c (copie de travail)
@@ -1881,7 +1881,7 @@
scriptSet(NULL,"ShipView.script", ShipViewTweaks);
- scriptSet(NULL,"AutoLOD.script", AutoLODTweaks);
+// scriptSet(NULL,"AutoLOD.script", AutoLODTweaks);
Index: src/Game/Options.c
--- src/Game/Options.c (révision 674)
+++ src/Game/Options.c (copie de travail)
@@ -415,7 +415,7 @@
sdword opSaveVoiceChat;


sdword opSaveDetailThresholdVal;
udword opDetailThresholdVal = 100;
Index: src/Game/AutoLOD.c
--- src/Game/AutoLOD.c (révision 674)
+++ src/Game/AutoLOD.c (copie de travail)
@@ -18,18 +18,18 @@

static udword alodNumPolys;
-static udword alodTargetPolys = 2000;
+static udword alodTargetPolys = 6000;
static udword alodPolyDelta;
static real32 alodIdealScaleFactor;
static real32 alodMaxScaleFactor;
static real32 alodMinScaleFactor;
-static real32 alodScaleFactorDelta = 0.008f;
+static real32 alodScaleFactorDelta = 0.024f;
static bool alodAmPanicking;

static real32 alodFastMinScale = 0.2f;
-static real32 alodFastMaxScale = 1.2f;
-static udword alodFastTargetPolys = 2000;
-static udword alodFastTargetDelta = 350;
+static real32 alodFastMaxScale = 3.6f;
+static udword alodFastTargetPolys = 6000;
+static udword alodFastTargetDelta = 1050;
static real32 alodSlowMinScale = 0.1f;
static real32 alodSlowMaxScale = 0.7f;
static udword alodSlowTargetPolys = 1400;

In this patch, I've increased bot the scale factor the polygon limit by third. I have also disable the fetching of these parameter in the ".big" file.
One more information, the max detail setting in the Option -> Video in reality make the scale factor always equal to the maximum set and not dependant upon the number of polygon displayed.

Could you guys test it and let me know if it's okay for you to commit it in the repo

PostPosted: Wed Oct 08, 2008 3:17 am 

Joined: Tue Nov 07, 2006 4:40 am
Posts: 236

I've not had chance to try this yet I'm afraid.

Could we use a variable within the Homeworld.cfg as a modifier then it can be changed dynamically rather than having to recompile the game if we need to test different values? It would then be more flexible for different specification machines. :)


PostPosted: Mon May 25, 2009 7:41 am 

Joined: Tue Oct 10, 2006 2:04 pm
Posts: 73
Location: North germany
Or what about increasing/decreasing the quality when a certain framerate can't be held anymore?

.: The hardest punishment are the innocent eyes of a child searching for truth :.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group