Author Topic: Possible fix for Mantis 1855: Mac OS X GLSL shader problems  (Read 13800 times)

0 Members and 1 Guest are viewing this topic.

Offline Echelon9

  • Moderator
  • 210
Possible fix for Mantis 1855: Mac OS X GLSL shader problems
A fix for Mantis 1855 is currently undergoing testing. Could Mac users who have noticed the 'white-textured' problems since the introduction of the GLSL feature in July 2008 please test the below build? I'd be interested to hear whether you use Leopard (10.5.x) or Tiger (10.4.x) and what graphics card you have.

The build contains all fixes including and up to r5020, plus the GLSL shader fixes to resolve Mantis 1855.

Builds for Windows and Linux that incorporate the same change should be out soon, to ensure that we don't take one step forward fixing things for Mac, and two backwards by breaking something else on Windows and Linux.

FS2_Open r5020 rosebay.zip
MD5 (FS2_Open r5020 rosebay.zip) = 858f566dad78a468873349762099d82c

« Last Edit: December 27, 2008, 03:49:46 am by Echelon9 »

 

Offline Tinman

  • 27
  • Released: WCS mini campaign
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
OMG - it's working.!  :yes:

MacOS X 10.4.11 (G5/7800GT) working in fullscreen and windowed mode, everything ok
MacOS X 10.5.6 (G5/7800GT) working in fullscreen and windowed mode, but in techroom the model rotates with about 1-2fps, ingame it's about 4 to 8 fps

Edit: just tested with MBP Nvidia9400M working in fullscreen and windowed mode, everything ok, ingame 60fps, but in techroom models rotate with lower fps, I assume it's about 11-16 fps for the Ullysses

 

Offline Echelon9

  • Moderator
  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
Good to hear that it appears the Mac OpenGL problems might be fixed for all.

Taylor has some further graphics performance improvement changes to commit to trunk (the nightly builds). It's just a better habit of open source project management to make small, granular changes that address one particular feature at a time.

As always, we should appreciate taylor's contributions to the SCP.

Oh, and also make sure you add -normal and -height to your command line. You might as well enjoy the eye-candy now it works for us!

 

Offline blowfish

  • 211
  • Join the cult of KILL MY ROUTER!!!!!!!!!!1
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
:jaw: It works!! :jaw:

Congratulations! :)  Glad to see this longstanding issue has finally been resolved.  Also appears to fix the lighting issues in no_glsl mode.  On a side note, environmental mapping is still pretty broken, but I'm pretty sure this is a separate issue, and I will be submitting it to mantis later today.

 

Offline Echelon9

  • Moderator
  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
Also appears to fix the lighting issues in no_glsl mode.  On a side note, environmental mapping is still pretty broken, but I'm pretty sure this is a separate issue, and I will be submitting it to mantis later today.

It was pleasing to see the -no_glsl lighting fixed too, for as GLSL is on by default we want those with hardware not quite able to support it to not be disadvantaged. I also noticed some env map weirdness, but I think it's a separate issue to be addressed in due course.
« Last Edit: December 28, 2008, 07:49:09 am by Echelon9 »

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
One other thing I was interested in know for sure, is if -no_glsl behaves the same as leaving GLSL enabled on a card that doesn't support GLSL, or when no shaders were found.  To my knowledge, all of those cases should behave identically.  This is definitely a great fix though.  Echelon and Taylor deserve some mad props for this one, getting it fixed over the holidays even.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline neoterran

  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
Oh wow this is huge ! Now to get a wanderer version of this (or just get the radar icons committed to trunk finally)

taylor and echelon, thanks very much for this fix to a really depressing problem !

*edit*

Okay, spoke to soon. I can confirm that it works to enable normal maps, but it significantly damages the FPS to the point where the game is unplayable with it on.

This is on a 2008 Intel Macbook Pro with an nvidia 8600M GT, Core 2 Duo @ 2.4 Ghz.  The game is really fast with it off, ultra slow with it on, full screen mode tested.
« Last Edit: December 29, 2008, 08:06:16 pm by neoterran »
Official Taylor Fan Club Member.
Chief Grognard.
"How much code could a coder code if a coder could code code?"

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
Well it'll be in trunk soon, assuming it doesn't break anything, and then the next time Wanderer syncs his branch there could be a Wanderer build.  But that stuff will be committed to trunk shortly after 3.6.10 is released (there's only a few serious bugs left!)
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline neoterran

  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
*edited for clarity*
« Last Edit: December 30, 2008, 11:39:48 am by neoterran »
Official Taylor Fan Club Member.
Chief Grognard.
"How much code could a coder code if a coder could code code?"

 

Offline Echelon9

  • Moderator
  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
neoterran, I've got pretty much the same laptop as you, and yes I've also seen my FPS drop when the GLSL normal maps are turned on.

In part some performance impact is to be expected - after all few graphical improvements come at zero cost - but there are more general OpenGL tweaks to be committed that should improve FPS a bit. We're not able to quantify exactly what that improvement will be at this early stage. Also as I get more familiar with the code I've noticed some areas that might benefit from further optimization.

 

Offline neoterran

  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
*edited for clarity*
« Last Edit: December 30, 2008, 11:40:25 am by neoterran »
Official Taylor Fan Club Member.
Chief Grognard.
"How much code could a coder code if a coder could code code?"

 

Offline neoterran

  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
Yeah, i've gotten it completely repeatable now, and this may be something of value for you or not. Go into the F3 room and load the Level 0 Uly. The FPS counter comes up when the model shows up with normal maps. it's around 8fps to 11fps for me for around 20 seconds, after which there is always a sudden jump to 30 fps range. I've repeated the behavior 4 times.

This is on Mac OS X 10.5.6.
Official Taylor Fan Club Member.
Chief Grognard.
"How much code could a coder code if a coder could code code?"

 

Offline neoterran

  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
There seems to be 3 levels so far at which the FPS in the F3 room stay stable. the first is 8 to 10 fps, then, there is a jump to the 30 fps range, and a little bit later on there is a further jump to around 50 fps. It's pretty interesting, and unusual. In the missions too, i think i'm seeing the same behavior - at first, very slow, and then speeds up after you've been in the mission for a little bit. The windows version didn't exhibit this behavior. Anyway, it would be nice if another mac user could play around with it for a while and corroborate what I'm seeing.
Official Taylor Fan Club Member.
Chief Grognard.
"How much code could a coder code if a coder could code code?"

 

Offline neoterran

  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
Okay, some more feedback. Sorry for the post amounts, but I figure few other macbook users are as adept and long term users of freespace as me, or willing to give this level of feedback.

With -no_glsl on : FPS with models are at a close to constant 60 fps. The lighting face issue is also now solved. This is a big step forward, regardless!

The frame jumping is very interesting with glsl on and normal maps enabled. It's repeatable with no action from me just being patient and sitting in the F3 room, doing nothing. However, When i load other models after the frames on the uly are high, (for example, i load the ursa) I get the bad frames performance again (8 to 10 fps) for a bit, until it too alleviates. If you guys want me to take screenshots to show the fps, i can do that since it's repeatable.

The fact that I've seen the models work at around 50 fps with normal and glsl on means that that's probably what the perforamnce level should be on this machine. 8 to 10 fps is very low, and that's what it always starts out at. I also notice after the framerate jumps up, if you just go to the normal "tech room" the model is rotating with significantly higher rates there too, whereas it was slow at first as well. 

However, the performance issue appears to occur again on each mission load. I'll need to do more testing with fps enabled to determine if that is the case.
Official Taylor Fan Club Member.
Chief Grognard.
"How much code could a coder code if a coder could code code?"

 

Offline neoterran

  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
Some more things I noticed.

I'm in the F3 room, loaded the Uly, starts rendering at 8 to 11 fps. After about 30 seconds or so, the rendering goes up to 30-33 fps. Then after another 30 seconds or so, the rendering reaches 50-52fps, from which it does not get any higher.

Here's the interesting part. If i now open the render options screen and toggle normal maps off, I immediately suffer the drop down to 11 fps range for another period of time, which returns again eventually to the 52fps upper limit. After this occurs once, i can toggle normal maps on and off again with no FPS loss at all. Even more interestingly, If I toggle Glow maps, or specular pass, the same behavior occurs.

This is pretty cool considering it's all repeatable right there in the F3 room. (what's that feature called again anyway ?)

Anyway, I realized different models have different fps averages, so I decided to stick with the ulysses, but i can repeat this behavior with all of them. And if a mod wants to clean up this thread as I was posting while testing, some of the earlier assumptions aren't quite right, so it might be a good thing. This is the most relevant post.
« Last Edit: December 29, 2008, 09:18:35 pm by neoterran »
Official Taylor Fan Club Member.
Chief Grognard.
"How much code could a coder code if a coder could code code?"

 

Offline neoterran

  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
Okay, testing with the mediavps in mission one of the main freespace campaign (3.6.10 complete used) :

initial fps at beginning of mission (with glsl on, normal maps enabled) ~ 5 fps.
initial fps at beginning of mission (with -no_glsl, no normals) ~ 60 fps.

To me, that's not the hit you'd expect from enabling normal maps. It's certainly not the hit you take on windows.

Anyway, with no_glsl on, the game now has the env mapping and lighting actually working correctly, so I'm super happy for this build and the fixes. It's just that on mac, the normal mapping has something else going on in fullscreen mode (I only do testing in fullscreen mode) that is affecting it's performance.

This is my last post for feedback on the subject.  :D
Official Taylor Fan Club Member.
Chief Grognard.
"How much code could a coder code if a coder could code code?"

 

Offline neoterran

  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
Here's the screenshots :

Initial FPS on model :


After 30 or so seconds :


Final FPS :


I imagine this issue occurs during the missions, but with different ships coming in and out, it's probably impossible to really test that.
Official Taylor Fan Club Member.
Chief Grognard.
"How much code could a coder code if a coder could code code?"

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
I seemed to notice something like that in the tech room, where I can detect a slight skipping for a little bit, and then it seems to smooth out.  I definitely noticed it with the Uly too.  Not as sharp on some other fighters, but still there.  And  this was on a Windows box so maybe it's not isolated to OS X, but perhaps exaggerated.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline neoterran

  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
Here's the map toggling behavior (works for the first time only with either env mapping, normals, or specular)

Start, after FPS has risen to max :


After disabling normals :

the frames immediately drop to 10 for several seconds, and eventually rise back up like in the first pic.

After re-enabling normals:

this has no effect on the fps. From this point on I can toggle normal maps on and off with no FPS effect.
*edit* fixed last pic.
« Last Edit: December 29, 2008, 10:30:59 pm by neoterran »
Official Taylor Fan Club Member.
Chief Grognard.
"How much code could a coder code if a coder could code code?"

 

Offline neoterran

  • 210
Re: Possible fix for Mantis 1855: Mac OS X GLSL shader problems
I seemed to notice something like that in the tech room, where I can detect a slight skipping for a little bit, and then it seems to smooth out.  I definitely noticed it with the Uly too.  Not as sharp on some other fighters, but still there.  And  this was on a Windows box so maybe it's not isolated to OS X, but perhaps exaggerated.

Yeah, i know what you're talking about, and I think that's the normal behavior, but these FPS drops are for prolonged periods, not just a second or two. It's definately worse in the mac build. I'm just trying to show what's going on as those with knowledge of the rendering code might be able to draw a conclusion from this behavior.

Anyway, I don't want to discourage you guys. This is the most significant improvement on the mac we've had in a year or so since this problem has existed, and the entire game on the mac is much more playable, and the lighting way, way nicer in no_glsl mode/fullscreen,  even if I still can't really use glsl. I just thought I should give you exhaustive feedback on it early on in the process.
« Last Edit: December 29, 2008, 10:40:39 pm by neoterran »
Official Taylor Fan Club Member.
Chief Grognard.
"How much code could a coder code if a coder could code code?"