Mysterious slowdowns continue... [SOLVED]

For collaboration on developing the mod capabilities of VS; request new features, report bugs, or suggest improvements

Moderator: Mod Contributor

Mysterious slowdowns continue... [SOLVED]

Postby chuck_starchaser » Tue Mar 18, 2008 11:00 am

Two people have reported frame-rate slowdowns when flying the Centurion in PU.
Now there's another ship causing the same effect (Galaxy HQ I think).
These ships haven't been touched. (Well, the Centurion cockpit I DDS's it, but that was *after* the problem was reported; and going back to jpg doesn't solve the problem.)
This all started since the last executable.
Problem goes away in cockpitless mode.
Sometimes it goes away on its own, but changing to external view and
then back to cockpit brings the problem back.
Removing the .pu folder, updating, and starting a new game doesn't fix it.
Here's the thread:
http://wcjunction.com/phpBB2/viewtopic.php?p=7342#7342
Last edited by chuck_starchaser on Thu Mar 20, 2008 6:58 am, edited 1 time in total.
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Postby safemode » Tue Mar 18, 2008 11:12 am

i'm almost positive this is the same issue as having a unit take up your field of vision. I can also almost guarantee that it is size bound. Meaning, the size of the texture you're viewing determines how much of a load it will be to display. Be it a unit or the cockpit, it seems to be treated the same.


To me, this screams a per-texture option being set that does some kind of modification to the texture (thus larger ones hurt more). Also note that changing resolution decreases the effect, which would just corroberate that, since whether it's the image size, or the screen resolution, both minimize the texture and thus whatever it's doing to it.

This _HAS_ to be a gl option, becuase DDS files dont get manipulated out of GL.

Either we're hitting the physical limitations of the cards that experience the slowdowns, or we have a problem option being set. It's very possible that these large amounts of textures are overloading the memory capabilities of these cards. (if i overclock my video ram, the problem lessens). I'm not saying that that is it, but it could be. Most games dont use such large textures. It's more likely a bad option being set though.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Postby chuck_starchaser » Tue Mar 18, 2008 11:19 am

Your theory makes sense; in fact, the Centurion, and I'm pretty sure the Galaxy too, have larger cockpit textures than most other ships.
Maybe I'll try using a mipmapped dds texture, tonight; just to see what happens.
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Postby safemode » Tue Mar 18, 2008 11:46 am

I would try a non mipmapped dxt1 texture.

Basically, i think making the texture a smaller size, or reducing screen resolution will decrease the issue, but it doesn't fix the problem (assuming hardware constraints aren't the problem).


we need to look at _ALL_ the gl options we set and enable, something is being enabled that is very intensive when displaying textures. It's probably set for all textures, and we only notice it being detrimental on large textures.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Postby chuck_starchaser » Tue Mar 18, 2008 4:19 pm

I already tried with non-mip-mapped DXT1; I was just having a hunch that maybe WITH a mip-map it might work better; but it's probably a false hunch :)

Where are the GL options set? I wouldn't mind having a look.
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Postby safemode » Tue Mar 18, 2008 11:05 pm

all over gldrv/ but I wouldn't guarantee that that is the only place.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Postby ace123 » Tue Mar 18, 2008 11:49 pm

Have you tried different shaders or detail (maximum texture size) settings yet?
ace123
Lead Network Developer
Lead Network Developer
 
Posts: 2560
Topics: 32
Joined: Sun Jan 12, 2003 2:13 am
Location: Palo Alto CA

Postby chuck_starchaser » Wed Mar 19, 2008 3:20 am

Frankly, I don't know where the shaders are; so I'm not totally sure we got them. I assumed so; I set the shader to nicest in setup. I'd take a look right now but I'm at work.
What's max texture size? Never seen that.
Detail settings don't make a difference in pu; we haven't got details, yet :D (Seriously; what detail affects is at what size in the screen the LOD changes; and we ain't got any LOD's.)
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Postby safemode » Wed Mar 19, 2008 5:20 am

turning shaders on and off doesn't do anything for this problem.

already tried it.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Postby chuck_starchaser » Wed Mar 19, 2008 12:56 pm

(NEW, BEFUDDLING DEVELOPMENTS...)

Not one, but TWO users report the slowdowns in the Centurion don't happen if they have no armor. As soon as they buy armor, the slowdown commences.

I KNOW... It makes absolutely no sense.

But they insist. I'm just the messenger; don't shoot me!

I can't, for the life of me, imagine what having or not having armor has got to do with the videocard.
The only thing I can think of is that maybe when you have no armor, the armor indicator texture overlay perhaps is removed from the display list; but it's a smallish texture...

For the record:

Centurion cockpit:

ImageEhm... it was larger than I thought... I think I'll try and bring it down a notch, and let you know...

Armor:

Image

Image
Last edited by chuck_starchaser on Wed Mar 19, 2008 1:38 pm, edited 1 time in total.
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Postby safemode » Wed Mar 19, 2008 1:36 pm

I dont see how that could effect anything. But just to be safe, have everyone experiencing the slowdown to do it. if it's the cause, they'll all report that it works. If anyone says it doesn't change anything, then it's not the cause, and it's likely that we're hitting the hardware maximums as far as texture capacity and processing and that one less texture helps those cards teetering on the edge.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Postby chuck_starchaser » Wed Mar 19, 2008 1:48 pm

safemode wrote:I dont see how that could effect anything. But just to be safe, have everyone experiencing the slowdown to do it.
if it's the cause, they'll all report that it works.
If anyone says it doesn't change anything, then it's not the cause, and it's likely that we're hitting the hardware maximums
as far as texture capacity and processing and that one less texture helps those cards teetering on the edge.

Thing is, there's only two users experiencing the slowdown, and they both report that it goes away without the armor.
Very puzzling.
I'm going to ask them to rename the armor textures in the cockpit folder, and see if that makes any difference.
Meanwhile, I'll make a smaller cockpit texture. 2k x 2k is insane...
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Postby charlieg » Wed Mar 19, 2008 2:14 pm

Yehr are you sure all video cards will cope well with such big textures?
Free Gamer - free software games compendium and commentary!
FreeGameDev forum - open source game development community
User avatar
charlieg
Elite Mercenary
Elite Mercenary
 
Posts: 1328
Topics: 56
Joined: Thu Mar 27, 2003 4:51 pm
Location: Manchester, UK

Postby chuck_starchaser » Wed Mar 19, 2008 2:35 pm

No; I'm definitely NOT sure; however, I just learned that the texture in trunk was already 1024 x 1024.

Now, for the BIG NEWS ....

One user just tried my hopeless little experiment of renaming the armor textures, and... lo and behold! ... IT WORKED!
The problem goes away.
So it's those tiny little textures that are causing all the trouble...
Don't ask me how...
http://wcjunction.com/phpBB2/viewtopic.php?p=7428#7428

Here's a question/hypothesis:
Could it be because the little textures already have an alpha channel, AND we're alpha-blending them on top?
(BTW, they SHOULDN'T have an alpha channel; it's not being used. I'm going to try DXT1'ing them.)

EDIT:
DAMN! Just found out another thing: Those little armor images are not powers of two; they are 25 x 100 ...
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Postby safemode » Wed Mar 19, 2008 3:12 pm

non pow 2 is a big deal
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Postby chuck_starchaser » Wed Mar 19, 2008 3:58 pm

Okay; they are power-of-two-ized and dxt1'd now and committed. Just waiting for feedback...
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Postby chuck_starchaser » Thu Mar 20, 2008 6:56 am

Feedback finally arrived. It was indeed the non-power-of-two little textures.
Problem solved.
http://wcjunction.com/phpBB2/viewtopic.php?p=7465#7465

Sorry for the false "bug report".
Even sorrier that this didn't help identify the planet viewing slowdown in vegastrike. BTW, I don't notice planet slowdowns in PU, but I do notice some space station viewing slowdowns. The difference is probably texture sizes; --planets in PU haven't got big textures yet.
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Postby safemode » Thu Mar 20, 2008 7:36 am

yea, texture size there plays a serious role. Though, whatever is going on with the bigger textures, goes on with the smaller ones, it's just that even my crappy Nvidia 6600 can handle the smaller texture operations. I notice much higher gpu use when viewing planets and bases and such, the smaller the texture though, the less of an impact it has on frame-rate, the larger and the more it impacts frame-rate.

It may just be that VS has gotten too intense for crappy video cards like my 6600. We dont pkg low res textures and high res textures, we only got the high res. And we dont currently turn of per-pixel lighting and such either.

Perhaps we need to rethink how we go about altering quality levels, so we dont totally keep people out who have 15 dollar video cards still. Maybe we need to have two repositories for texture data (we'd only need to worry about planets and units and space backgrounds). One repository where nothing is bigger than 512x512 for units and 1024x512 for planets and 512x512 for backgrounds, the other would be the way it is now.


We can test if this will work by setting the max texture size for high quality mode to be 512. We dont need to change any textures. The reason we cant use this for production is that the mipmaps made for DDS, aren't high quality resizes, and so, things aren't gonna look as good as if we used a high quality scaler to resize the images.

In any case, if the slowdown goes away for those experiencing it, the the issue is simply a hardware limitation problem
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Postby chuck_starchaser » Thu Mar 20, 2008 9:00 am

Would be much less expensive in terms of bandwidth, server space and maintenance, to put a halver routine into the engine. If the user changes the setting to "lo-rez textures" in setup, next time you boot the engine, all textures are scaled down 50% and saved with the same name prepended with an underscore. DDS textures with mipmaps would be the easiest, as all you have to do is throw away the top level.

BTW, for 50% scaling all you have to do is average 4 texels at a time. In the particular case of scaling down by powers of two, simple averaging looks better than bicubic scaling. Bicubic tends to look blurrier for no benefit, when downscaling by powers of two (and any integer ratios, for that matter).
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Postby safemode » Thu Mar 20, 2008 10:26 am

I already have the ability to scale DDS that way.

to check it out, set the max_texture_size in the config file to some small number like 512
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Postby chuck_starchaser » Thu Mar 20, 2008 10:36 am

Ah, good; so when the LoRez setting is on you can just load from the 2nd mipmap ownards on the fly?
Ok, so that leaves then the non-mip-mapped dds's...
Maybe the best solution would be to mipmap everything and use a single mechanism for lo-rez'ing, come to think...
The size of the un-used, lower mipmap levels is probably much less than the disk space wasted by having two files...
...talking about disk granularity issues.
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Postby safemode » Thu Mar 20, 2008 11:27 am

yea, it's done on the fly. That's how i make retro mode look the way it does. I think if we dont have mipmaps, i dont rescale. Since menus would look unreadable. Basically, i take anything without mipmaps to mean that they would have something you need to read on them, so lower res mipmaps may be unreadable.

I still have to fix it so that when we know ahead of time we dont want to load mipmaps (for when s3tc is not detected), we dont read them in. But that's separate.


Basically, anything without mipmaps, likely isn't something displayed during gameplay, or at least isn't something that is going to singularly affect gpu performance. I think it's safe to not resize mipmap-less files.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania

Postby chuck_starchaser » Thu Mar 20, 2008 3:24 pm

Cockpit textures, chances are, are not mipmapped; at least I wouldn't have mipmapped them, since distance doesn't change much; but may need to be.
Are you sure about text not being readable at half-rez? Usually the text on cockpit lights and buttons is pretty big. But, in any case, those textures are small, so it wouldn't make much difference to halve them. Now, if you're talking about text in the poster screens when the game is starting, there's not enough time to read them, anyways :D But those images are not game-speed critical...

Ok, I get your point, now; so, all you need to do is implement the config variable and load the second map of mipmapped images when LoRez is on. Nice!
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Postby safemode » Thu Mar 20, 2008 3:35 pm

half size may be fine, but after that, not so much. test and check. all the code exists already for most things. I'll have to check about mipmap-less stuff.
Ed Sweetman endorses this message.
safemode
Developer
Developer
 
Posts: 2150
Topics: 84
Joined: Sun Apr 22, 2007 6:17 pm
Location: Pennsylvania



Return to Modding Engine Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron