Author Topic: Specular DX8 performance drain vs OGL's  (Read 3040 times)

0 Members and 1 Guest are viewing this topic.

Specular DX8 performance drain vs OGL's
I was experimenting with a BSG mission with a galactica and 30+ fighters and I've found that with speculars activated in DX8, the FPS slows to a 6fps crawl. OGL mode runs the mission at 28-40 fps.

The DX8 matchs OGL performance with speculars OFF. Whats the deal? Is DX8 no longer being optimized the way OGL is?

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Specular DX8 performance drain vs OGL's
I have recently found out that specular lighting actually does not work for me at all with OGL, but only on D3D (or at least it looks very different than on D3D). This might have something to do with that. Can you actually see the specular effect in OGL?

 
Specular DX8 performance drain vs OGL's
Yes... its not as accurate as DX8 on my 6600gt Geforce. But I'll give up accuracy for 30 extra FPS. The OGL speculars have a smaller "hotspot" reflection than DX8's. Perhaps the shine maps are interpolated differently.

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Specular DX8 performance drain vs OGL's
I'll need to check it out in more detail then. I was playing a mission a week ago and had accidentally set it to OGL mode; the lighting looked basically the same as it used to in retail FS2 and was a huge and immediately noticeable difference from the D3D specular lighting.

The D3D and OGL framerates seem to be about the same for me though. I get a consistent 75+ fps on both.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Specular DX8 performance drain vs OGL's
Quote
Originally posted by Omniscaper
The OGL speculars have a smaller "hotspot" reflection than DX8's. Perhaps the shine maps are interpolated differently.

The size is selectable and when I wrote the code I posted a couple of test shots at various values to see what people wanted most.  There wasn't a big consensus I dont' think so I just went with what looked a bit better to me as an inbetween value.  It doesn't hurt FPS any to use a different value so maybe I can make it a cmdline or registry option, or something.  Specular highlight accuracy will also increase when envmapping hits public builds.  With envmapping turned on in OGL you basically get per-pixel lighting automatically.

And as far as optimization goes... D3D isn't getting much, if any, work done on it.  OGL is used on the Windows, Linux and OS X versions and the icculus.org Freespace2 project so it's considerably more important as far as usage goes.  In other words, it gets my full attention for fixes and optimizations.  And since D3D is an 8th class citizen to me I tend to ignore it unless one of my changes forces me to work on that code.  I don't think anyone else really cares about it enough to clean up the D3D code either.

 
Specular DX8 performance drain vs OGL's
PER PIXEL LIGHTING!? Dude!!!

When Bob perfects his materials thingy, will OGL get the beneift of bumpmapping as well? Or better yet... normal mapping?

Requests aside, I've never used OGL till now, and I'm quite impressed with the performance, now that I'm seeing shinemaps working properly with my 6600gt vs my old 9500pro. U suppose you can hook up the BSG mod with a tad more shine values? :)

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Specular DX8 performance drain vs OGL's
Do D3D and OGL use different default values for those specular options? I think it's already possible to adjust the size of the specular highlight using the -spec_exp command; maybe messing with that will help things.

I would like to use OGL since it doesn't have all the interface problems of D3D (menu popup delay, briefing icons misplaced, offset pixels in mainhall) but only D3D has the environmentally mapping right now, which I really like. When will that be added into OGL?

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Specular DX8 performance drain vs OGL's
Quote
Originally posted by Omniscaper
When Bob perfects his materials thingy, will OGL get the beneift of bumpmapping as well? Or better yet... normal mapping?

It will get whatever Bob's code will do.  I doubt that will be ready as soon as Bob's code hits CVS but everything will get filled in as quickly as possible.

Quote
Originally posted by Omniscaper
U suppose you can hook up the BSG mod with a tad more shine values? :)

I'll go ahead and drop in a temporary cmdline option for the shininess value (-ogl_shine) which will go from 0 to 128, with 80 being the default (and current value).  The higher the value the smaller and brighter the highlight.  I'll probably remove that option in favor of something more permanent later but that won't be anytime soon.  Should be available in the next build that redmenace puts out.  If you find a value which you like better please let me know what it is.

Quote
Originally posted by CP5670
Do D3D and OGL use different default values for those specular options? I think it's already possible to adjust the size of the specular highlight using the -spec_exp command; maybe messing with that will help things.

I would like to use OGL since it doesn't have all the interface problems of D3D (menu popup delay, briefing icons misplaced, offset pixels in mainhall) but only D3D has the environmentally mapping right now, which I really like. When will that be added into OGL?

I don't know that there is a similar way to set that option for D3D and OGL.  -spec_exp affects normal light sources but not this particular OGL value so the cmdline option is all you can use for that.

OGL does still have issues with the interface, popup menus can show the previous screen in the background or just a solid color (if you have an ATI card), pixels are still offset in the mainhall but only if using a non-standard resolution, screenshots can produce the same image several times in a row when you press the key.  All of that is being actively worked on though so it's just a matter of time before those bugs get squashed.

Env mapping has the unfortunate priviledge of using a really new OGL extension.  It's only supported by the newest drivers for both Linux and Windows and still not supported on OS X.  This can cause linking errors if the extension is totally missing so I'm reworking the extension system a bit to get around this.  I've been too busy working on bugs, PXO, and the OS X version to get that finished but I'll get back to it soon and it won't take long to complete and test.

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Specular DX8 performance drain vs OGL's
Yeah, I spent a little while playing around with spec_exp but wasn't able to achieve the same effect as D3D. I'll just use D3D for now until the next stable build comes out.

The interface works without any issues for me in OGL, although you may be right about the screenshots. I haven't seen the offset pixels in OGL; maybe they are still correctly aligned in exact multiples of the standard resolutions.

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Specular DX8 performance drain vs OGL's
CP5670 what video card are you using and are your drivers up to date

specular highlighting is not _Technically_ in the D3D specifications [infact the specs say it's not supported], so drivers that support it are technically not to spec.


Specular lighting has been in OpenGL since..... OGL 1.0?
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Specular DX8 performance drain vs OGL's
6800 GT and XG 77.13, although I will probably switch to the new XG 81.85 set later today.

I don't know much about the API specifications, but as things stand the D3D specular mapping looks much better than the OGL one does.

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Specular DX8 performance drain vs OGL's
poor implementation on nVidia's part

/me isn't suprised
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline CP5670

  • Dr. Evil
  • Global Moderator
  • 212
Specular DX8 performance drain vs OGL's
I looked into this a bit more and it might also have something to do with the ambient light level. D3D seems to look darker and consequently has better contrast than OGL. These screenshots are both coming out darker than they actually look in the game, but they still show the relative difference between the modes:

D3D:

OGL:

 

Offline StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
Specular DX8 performance drain vs OGL's
Ah, the glory that is -ambient_factor.  I always have it set at about 85.
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Specular DX8 performance drain vs OGL's
I still haven't heard a good reason for why that can't be a mission variable...isn't gamma supposed to take care of brightness?
-C

 

Offline StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
Specular DX8 performance drain vs OGL's
Mission variables should be local, the command-line parameter should be a global scalar (nevermind that last I checked we couldn't use the ambient light slider in FRED).  I don't want to have to edit all of the main campaign missions to turn down their ambient brightness.  And it's not gamma as it doesn't affect light from actual sources.
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Specular DX8 performance drain vs OGL's
Ahh, gotcha.
-C

 

Offline Fenrir

  • 28
  • ?
Specular DX8 performance drain vs OGL's
Quote
Originally posted by StratComm
Ah, the glory that is -ambient_factor.  I always have it set at about 85.


Indeed. For a long time I'd been playing with the default lighting and one day I decided to try out ambient_factor 75 as many have suggested. I swear my jaw just about fell right out of my face.

 

Offline taylor

  • Super SCP/Linux Guru
  • Moderator
  • 212
    • http://www.icculus.org/~taylor
Specular DX8 performance drain vs OGL's
@CP5670:  If you don't mind playing with the values of the -ogl_spec option and -ambient_factor in the next CVS build and letting me know what values in OGL match the appearance of what values in D3D I'll try and get all of the math right so that they match more closely.

Quote
Originally posted by WMCoolmon
I still haven't heard a good reason for why that can't be a mission variable...isn't gamma supposed to take care of brightness?

Other than StratComm's comment, I'm leary of a mission setting because gamma visibility is conditional on the monitor.  Depending on type, quality and calibration (and eyesight of the viewer) it can be a pain to get that all to an acceptable setting unless it's left up to the user.  Even if -ambient_factor can modify the mission defined value it's impossible for everyone to see the same thing with the same settings.  Bless the mission makers and all but if this gets into wide use the end user is not going to see the same thing that the mission designer did when the mission was created and tested.  I already use different -ambient_factor settings for different mods simply because they end up being darker than I'm am able to see reliably (I have trouble seeing light in very dark properly).

 

Offline StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
Specular DX8 performance drain vs OGL's
I could see it being useful to adjust ambient light across a campaign though.  It'd be nice to be able to set it up so that missions with a lot of bright nebula backgrounds would raise the ambient light relatively and missions in deep space to have it lowered (so that the're more contrast between light and dark).  It shouldn't be used to just lower ambient lighting across a campaign though, because that's what the command-line flag and gamma settings are for (they should scale the effect in mission).  There's a place for all of it, but it has to be used properly.
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM