View topic - are features expensive now?



All times are UTC + 1 hour


Post new topic Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: 12 Apr 2012, 19:33 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
what should that tell us?


Top
 Online Profile  
 
PostPosted: 13 Apr 2012, 02:32 
Spring Developer

Joined: 16 Dec 2006, 20:59
Thanks behe. Zooming in renders less features, so feature fading is likely not related to this. Anyway I mantised it.

http://springrts.com/mantis/view.php?id=3061


Top
 Offline Profile  
 
PostPosted: 13 Apr 2012, 07:11 
Moderator
User avatar

Joined: 23 Nov 2005, 06:16
Location: Dunedin, New Zealand
FSAA is the same as SSAA?


Top
 Offline Profile  
 
PostPosted: 13 Apr 2012, 14:31 
Spring Developer

Joined: 08 Oct 2006, 15:58
yes (FSAA and SSAA are synonyms), and no (Spring uses MSAA)

Beherith wrote:
Look at Altored divide remake:

26 fps:
Image



Did you know that:

1) on this screenshot (and this better one), there are 126 features visible?
2) of those 126 features, 63 have 3840 vertices and the remaining 63 have 1472?
3) each of these is being rendered at least twice per frame, both times with textures bound (for the alpha-masked shadows) so your 4xAA is effectively 8xAA?
4) even with MSAA, depth values are still super-sampled (like regular fragments in FSAA/SSAA)?


Last edited by Kloot on 13 Apr 2012, 15:25, edited 1 time in total.

Top
 Offline Profile  
 
PostPosted: 13 Apr 2012, 14:57 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
Kloot, any ides on WHY it is so slow now? I though that 3x cost jk was talking about was fixed?


Top
 Offline Profile  
 
PostPosted: 13 Apr 2012, 17:04 
Spring Developer

Joined: 08 Oct 2006, 15:58
I get the same framerate in 82.7 (~90 to within a variance of ~10, double the amount after /advmodelshading 0) for that viewpoint using the same springrc settings despite all the code changes between 82.7 and 88.0, so I don't understand where this "feature drawing is slow now" sentiment is coming from. As for why that specific situation on Altored is slow, my previous post contains two big hints.

Quote:
I though that 3x cost jk was talking about was fixed?


No, when and where did you get that idea? He only mentioned it two days ago and the "3x" part refers to some code which only becomes active when zoomed out, so that is not relevant anyway.


Top
 Offline Profile  
 
PostPosted: 13 Apr 2012, 17:06 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
Kloot explained why it is slow and I gave the reason why it is such damn slow. And no it isn't fixed, also zerver's last post gives me the impression my way of solving it would cause again much hate, neither do I see zerver fixing his code ...

Kloot wrote:
the "3x" part refers to some code which only becomes active when zoomed out, so that is not relevant anyway.
current code calls glAlphaFunc() for each invisible+fading feature returned by getquad() (means it matters when zoomed in, too!), it is a no-go function for per-instance drawing. glAlphaFunc() causes a lot restructure in the GPU and takes a damn lot of time. Neither are the current glMaterialfv() calls ideal, they change _uniform_ vars. On Nvidia GPUs uniforms are a lot slower (on change) than attributes (glColor, texcoords, ...) and should be avoided on per instance drawing, too.

Kloot wrote:
I get the same framerate in 82.7
You would need to compare it with pre-fading-features which where added iirc with 78-79, but there the features won't show I assume (maps are incompatible with such engine builds).


Top
 Online Profile  
 
PostPosted: 13 Apr 2012, 17:15 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
kloot:
"Zoomed out", behe's shots are "zoomed in" to me. It is new because ever since I saw the fps drop, I assumed it was my code. This has been the case for well over a year. I usually tested on the map gunmetal harbor. which heavily uses features. but because I didn't think features were the cause, I just assumed I fixed the bug when I moved to testing gundam on gantelope. I had NO idea that it was because gante has no features. then I came back to gunmetal, saw the fps plummet and started looking outside of gundam. I don't know when or what changed. when I played gundam back in 2010 I was playing with several people in map wide survival matches. Now just running gunmetal with NOTHING going on is at 45fps? that is a bit strange.


Top
 Offline Profile  
 
PostPosted: 13 Apr 2012, 17:47 
Spring Developer

Joined: 08 Oct 2006, 15:58
glAlphaFunc might not be a big problem when zoomed in because the test-value passed to it is 0.5 and the shadow pass uses the same value --> a smart driver will probably avoid the state change if nothing else calls it.

jK wrote:
You would need to compare it with pre-fading-features which where added iirc with 78-79, but there the features won't show I assume (maps are incompatible with such engine builds).


That's true, fading features were committed for http://springrts.com/mantis/view.php?id=1335 / 0.78.2.1 (with https://github.com/spring/spring/commit ... c4b76ce368) but note that the code then neither performed alpha-testing nor material updates and smoth's use of "now" suggested a more recent problem. I also placed a 'return' at the top of FeatureDrawer::DrawFadeFeatures and still had the same performance as without it (when zoomed in).

smoth: what framerates did you usually get on Gunmetal? Would you be willing to verify that with this old (0.77b5) installer?


Top
 Offline Profile  
 
PostPosted: 13 Apr 2012, 18:00 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
Kloot wrote:
glAlphaFunc might not be a big problem when zoomed in because the test-value passed to it is 0.5 and the shadow pass uses the same value --> a smart driver will probably avoid the state change if nothing else calls it.
Not that AlphaFunc I mean the one in CFeatureDrawer::DrawFadeFeaturesSet with glAlphaFunc(GL_GREATER, fi->second / 2.0f);


Top
 Online Profile  
 
PostPosted: 13 Apr 2012, 18:21 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
Kloot wrote:
smoth: what framerates did you usually get on Gunmetal?

IIRC they were pretty solid, I ran in vsync most of the time back then so mostly it was 59-60fps. In a really large battle, with lots of stuff happening(this was 3-4 players vs 1 spawner) I had bottom 10-35fps.

Kloot wrote:
Would you be willing to verify that with this old (0.77b5) installer?

Sure I can try when I get home tonight.

*Edit*
I should also note 2010 I had a dual 3.4 ghz and 8 gigs of ram. Not sure if it relevant


Top
 Offline Profile  
 
PostPosted: 14 Apr 2012, 01:20 
Spring Developer
User avatar

Joined: 28 Jun 2007, 06:30
Kloot wrote:
That's true, fading features were committed for http://springrts.com/mantis/view.php?id=1335 / 0.78.2.1 (with https://github.com/spring/spring/commit ... c4b76ce368) but note that the code then neither performed alpha-testing nor material updates and smoth's use of "now" suggested a more recent problem. I also placed a 'return' at the top of FeatureDrawer::DrawFadeFeatures and still had the same performance as without it (when zoomed in).
Tested it today again, too. Now it doesn't give an significant improvement either :/
Just a few weeks ago Seth2 gave me <40fps with it (and >140fps w/o it), possibly it was related to some system/driver change.


Top
 Online Profile  
 
PostPosted: 14 Apr 2012, 14:27 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
settings could not be setup.
Couldn't run the same gundam in old spring.

not able to use that version, sorry kloot.


Top
 Offline Profile  
 
PostPosted: 13 May 2012, 00:18 
Spring Developer

Joined: 16 Dec 2006, 20:59
Kloot wrote:
2) of those 126 features, 63 have 3840 vertices and the remaining 63 have 1472?

I did not verify Kloots' numbers, but if they are correct, I would say that this map simply has very advanced features.

An armflash has about 50 vertices so just a single of these trees can equal something like 100 armflash. 10 trees = 1000 armflash etc. Try to spawn 1000 armflash and look at the FPS.

Also, with the alpha masked textures of these features, almost all of the vertices have to be rendered since virtually none are occluded. Even more so when you zoom in.

Terrain only: 220 fps

20 of the worst trees zoomed in: 40 fps
Same trees without alpha masks: 110 fps
Same trees without alpha masks and without depth test: 40 fps

It is apparent that the lowest two figures come from the fact that the system has to render all vertices due to transparency and in my last test due to the disabled depth test.

For comparison
500 armflash, without depth test: 110 fps
1000 armflash, without depth test: 70 fps

Fading features also has a performance hit, but not as big as the one caused by zoom in. The fps drops to about half on my system. The fading will also force the system to render all vertices due to transparency.


Top
 Offline Profile  
 
PostPosted: 13 May 2012, 01:56 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
I was able to play with higher fps years ago on an LESSER machine. Now it is really low. Do you really think the fade is hurting it that much? is there a way to turn it off to test?


Top
 Offline Profile  
 
PostPosted: 13 May 2012, 11:20 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
smoth wrote:
I was able to play with higher fps years ago on an LESSER machine. Now it is really low. Do you really think the fade is hurting it that much? is there a way to turn it off to test?


On the same map?


Top
 Offline Profile  
 
PostPosted: 13 May 2012, 11:29 
Journeywar Developer & Mapper
User avatar

Joined: 24 Jan 2006, 21:12
Location: There is no god - and reality is his prophetess
i remember when spring was all free - and the moddevs didnt have to pay extra for every feature.


Top
 Offline Profile  
 
PostPosted: 13 May 2012, 17:06 
Spring Developer

Joined: 16 Dec 2006, 20:59
FLOZi wrote:
smoth wrote:
I was able to play with higher fps years ago on an LESSER machine. Now it is really low. Do you really think the fade is hurting it that much? is there a way to turn it off to test?


On the same map?

Forget about this specific map and other maps that use the same trees. Are there any other maps with problems?

Fading has zero impact when zoomed in, but I will try to make it configurable anyway.


Top
 Offline Profile  
 
PostPosted: 13 May 2012, 17:13 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
Its the alpha masking that makes it sooo expensive. Spring can render 500 BAR jammer towers (2k tri's each) at 30 fps. With shadows and AA on.


Top
 Offline Profile  
 
PostPosted: 13 May 2012, 17:38 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
FLOZi wrote:
smoth wrote:
I was able to play with higher fps years ago on an LESSER machine. Now it is really low. Do you really think the fade is hurting it that much? is there a way to turn it off to test?


On the same map?

I don't know if I can find that version of gunmetal


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 48 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: Bing [Bot] and 0 guests


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

Site layout created by Roflcopter et al.