Optimized version of shaders for SM 3.0

aoineko

Recruit
Best answers
0
Original M&B shaders was created for Shader Model 2.0. I just recompiled the shaders to use SM 3.0. If you have a video card compatible with SM 3.0, you will notice small improvement in performance: 0 ~ 5% depending of the scene (I suppose only few shader have been really optimized).

To install, download the archive, backup your <M&B>\mb.fxo (rename it what ever you want), then copy the new one from the zip at the same place.

I didn't changed the shaders source but I'm sure we can optimize it for SM 3.0 et 4.0. I will investigate this soon. :smile:
 

Kolba

Good addtion, but it won't work on my computer. Any screenshots or before/after?
 

Riffraffselbow

Recruit
M&B
Best answers
0
Kolba said:
Good addtion, but it won't work on my computer. Any screenshots or before/after?
Shouldn't change the visuals any, just FPS. He recompiled the same shaders with SM3.0 optimizations.
 

aoineko

Recruit
Best answers
0
Kolba said:
Good addtion, but it won't work on my computer. Any screenshots or before/after?
Do you have a Shader Model 3 compatible video card?

As said bellow, this mod don't change the graphics, just add some FPS.

By the way, after some test, I get a difference between +0 and +10%. I suppose only few shaders are really optimized by my recompile so only scene that use those shaders may have better FPS. For example, on the map, there is no improvement.
 

3shirtlessmen

Recruit
Best answers
0
Sorry to ruin the party but ...

Recompiling shaders to a HIGHER number does NOT increase FPS. Infact, it actually DECREASES performance.

The reasons are highly technical and can be explained via review of how GPUs respond to the lower level compiled code in regards to shader model.

What you are experiencing is a placebo effect by "the higher is better" idea - and that's just not the case. A higher shader model gives shader authors (me) more room and technically, more instructions and additional methods to create 'more realistic' effects.

If you would have optimized the shaders, you would have instead, lowered the instruction count (which you can see in FXcomposer) with the SAME visual output. Often times, you decrease instruction would along side with quality.

So, if you want to get dirty with these shaders and make them actually USE the additional room that SM3 has over 2, then learn HLSL and get to work! :smile:
 

aoineko

Recruit
Best answers
0
3shirtlessmen said:
Sorry to ruin the party but ...
You seem to forget SM3 compiler have some specific optimizations that make the same HLSL source to create more efficient assembly code (than its SM2 compiled counterpart). As I said, I didn't really dig into the code, but as the generated assembly code is smaller and there is easily verifiable FPS improvement, I have no doubt about the fact some optimization occurred.

3shirtlessmen said:
So, if you want to get dirty with these shaders and make them actually USE the additional room that SM3 has over 2, then learn HLSL and get to work! :smile:
I'm video game programmer for more than 10 year and I learned HLSL long time ago. :wink:

Anyway, I agree the fact the only way to take fully advantage of SM3 specification is to rewrite the code. The recompile was just a step, not the goal.
 

3shirtlessmen

Recruit
Best answers
0
You'd have to show me the ASM difference for me to believe you, because technically I simply don't see that as being possible.

I should make very clear that I haven't tested your mod, so of course, my words have little weight in regards to this mod specifically. I'll do some tests when I get home.

Glad to hear there are some professionals around here too. :smile:
 
Best answers
0
I have GTX 260 with SM 4.0 but i replaced mb.fxo with it and the textures become white? Why did this happened...

And can someone upload the original mb.fxo file i forgot backup it  :???: (for 1.011)
 

Dwarden

Recruit
WBNWVC
Best answers
0
with AMD.ATI HD46xx/48xx cards i have weird random flashing on screen and rare crashes ... i was forced to revert back to original

ofc i would like to see recompiled optimized shaders but stable :smile:
 

Adorno

Bedroom Assassin
Duke
WBNWM&BVC
Best answers
0
Khergit Avcısı said:
And can someone upload the original mb.fxo file i forgot backup it  :???: (for 1.011)
Sure, here:
http://www.4shared.com/file/85041969/bd4c536f/mb_online.html