Author Topic: Optimization: GPU-based Submodel Transforms  (Read 7326 times)

0 Members and 1 Guest are viewing this topic.

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Optimization: GPU-based Submodel Transforms
I'm always working on a lot of optimizations but I feel that this one is ready to be tested by the community. This feature speeds up rendering by merging all submodels into one big model while letting the GPU do all the work into positioning and orienting them for the final render. This cuts down CPU overhead by significantly reducing the number of draw calls needed to render a model, especially if the model has a lot of submodels.

This shifts a bit of extra overhead on the GPU though. I'm essentially communicating with the video card through floating point textures and constantly have to update those textures per frame. Also, there's an additional cost in the vertex shader of having to fetch the necessary transform data from those textures and doing an extra matrix multiply. Your mileage may vary with this build.

This requires an OpenGL 3.0 compliant card. I should mention that this build is based off of Trunk Revision 8627.

To switch on and off this feature, load up the builds using the Launcher, go to the "Features" tab, open the "Experimental" drop down selection, and enable "Enable merged index buffers"

Please give feedback of what your performance is with and without this feature enabled. Also be sure to indicate what CPU and GPU you're running on.

EDIT: Please make sure you don't have any *.sdr files in your "effects" folder! This test build has new shader files built to get this working.

http://www.mediafire.com/?mv9gfwq50by8zgg
« Last Edit: March 30, 2012, 01:11:49 pm by Swifty »

 

Offline Sushi

  • Art Critic
  • 211
Re: Optimization: GPU-based Submodel Transforms
Got a patchfile too?

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Optimization: GPU-based Submodel Transforms
Every time I read about Swifty optimizations I get that flippy floppy feeling in my stomach like a pretty girl walked by

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Optimization: GPU-based Submodel Transforms
Got a patchfile too?
It's in the archive.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Rga_Noris

  • 29
  • What?
Re: Optimization: GPU-based Submodel Transforms
Link doesnt work for me.

EDIT: Got it working by adding it to my account and then downloading. If I try to D/L from your mediafire account, it just says OOPS! Restarting your download! And then it doesnt.
« Last Edit: March 27, 2012, 10:36:43 am by Rga_Noris »
I think I'll call REAL Mahjong 'Chinese Dominoes', just to make people think I'm an ignorant asshat.

 

Offline Sushi

  • Art Critic
  • 211
Re: Optimization: GPU-based Submodel Transforms
Ugh, can we get a mirror? Mediafire has apparently decided to go full sucktastic. It keeps shoveling ads at me while telling me "there was a problem with your download, click here to retry" (and get more ads shoveled in my face).

 

Offline Rga_Noris

  • 29
  • What?
Re: Optimization: GPU-based Submodel Transforms
Try it from my MediaFire account... worked for me.

http://www.mediafire.com/?w8bogu5teko8i42
I think I'll call REAL Mahjong 'Chinese Dominoes', just to make people think I'm an ignorant asshat.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: Optimization: GPU-based Submodel Transforms
Did my tests on a BtA mission with an intro cutscene that features the HTL Arcadia and a lot of other ships flying around. Some with rotating submodels, some with stationary submodels. Pretty busy scene.

GPU: GeForce GTX 550 Ti
CPU: Intel Core i7 970 3.2Ghz

Regular Trunk
FPS: 38 - 40
CPU Load: 100%
GPU Load: 13-30%

Optimized Build
FPS: 40-42
CPU Load: 100%
GPU Load: 20-40%
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Optimization: GPU-based Submodel Transforms
There seem to be a major bug with this build preventing submodels from being rendered (defeating almost the whole purpose of this optimization). I'll upload a new build ASAP.

 
Re: Optimization: GPU-based Submodel Transforms
I'll try it!
$Formula: ( every-time
   ( has-time-elapsed "0" )
   ( Do-Nothing
   )
   ( send-message
      "#Dalek"
      "High"
      "Pro-crasti-nate"
   )
   )
)
+Name: Procratination
+Repeat Count: 99999999999
+Interval: 1

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Optimization: GPU-based Submodel Transforms
Hmm, I can't get a hold of the bug that Axem and mjn.mixael had reported. Can more people please try out this build and tell me the results? I've only got feedback from like, two people.

 

Offline Angelus

  • 210
  • The Angriest Angel
Re: Optimization: GPU-based Submodel Transforms
the build crashes the game right after the splashscreen, with and without the new flag.

Intel Xeon 2.4 and a ATI Radeon 2600HD ( AGP )

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Optimization: GPU-based Submodel Transforms
Try running the debug build and nail your fs2_open.log file here.

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Optimization: GPU-based Submodel Transforms
alright, so some of the problems with this build has been due to old shaders lingering in the "effects" folder. More people should continue testing this build.

On another note, Axem has given me some interesting data when looking at a scene with three FSU Sathanas.



Swifty is victorious against RC5! :)

 

Offline Echelon9

  • Moderator
  • 210
Re: Optimization: GPU-based Submodel Transforms
There seem to be a major bug with this build preventing submodels from being rendered (defeating almost the whole purpose of this optimization). I'll upload a new build ASAP.
I'll test, but wanted to make sure the newer, fixed build was the one linked to in original post?

 

Offline Swifty

  • 210
  • I reject your fantasy & substitute my own
Re: Optimization: GPU-based Submodel Transforms
There didn't need to be a new build actually. The bugs that were reported were due to old shader files.

 

Offline Darius

  • 211
Re: Optimization: GPU-based Submodel Transforms
Haven't got any objective testing done yet, but subjectively I'm noticing a huge increase in framerate in ship-heavy scenes. It's almost like getting a CPU upgrade.

 

Offline Fury

  • The Curmudgeon
  • 213
Re: Optimization: GPU-based Submodel Transforms
Even though Swifty included updated shaders in the executables themselves, any mods bundling shaders in their vp files will override Swifty's shaders. Such mods include BP2 which are great for testing. So I took the liberty of uploading BP2 shaders which do not have this missing submodel problem: http://www.mediafire.com/?1vf1z9mh2f9p220

However, Kyad pointed out an issue with these shaders. See following two pics:
http://img826.imageshack.us/img826/8545/screen0003q.jpg
http://img835.imageshack.us/img835/7223/screen0002l.jpg
The transport seen in these pics is rotated 90 degrees, with glowpoints still in their original place. Weird issue, which I can also confirm. I do not know how much these shaders differ from the ones included in the executables.
« Last Edit: March 31, 2012, 02:41:33 am by Fury »

 

Offline MetalDestroyer

  • Starwars reborn!
  • 210
Re: Optimization: GPU-based Submodel Transforms
Does that mean, FSO support Tesselation features ? :)

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Optimization: GPU-based Submodel Transforms
No. Tesselation is a very different beast. This code just moves part of the work associated with setting up a model for rendering from the CPU to the GPU.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns