Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: Swifty on March 27, 2012, 03:29:18 am
-
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
-
Got a patchfile too?
-
Every time I read about Swifty optimizations I get that flippy floppy feeling in my stomach like a pretty girl walked by
-
Got a patchfile too?
It's in the archive.
-
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.
-
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).
-
Try it from my MediaFire account... worked for me.
http://www.mediafire.com/?w8bogu5teko8i42
-
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%
-
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 try it!
-
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.
-
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 )
-
Try running the debug build and nail your fs2_open.log file here.
-
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.
(http://lazymodders.fsmods.net/axemart/FreeSpace/Debug/3sathtest.jpg)
Swifty is victorious against RC5! :)
-
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?
-
There didn't need to be a new build actually. The bugs that were reported were due to old shader files.
-
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.
-
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.
-
Does that mean, FSO support Tesselation features ? :)
-
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.
-
Where does the patch file go?
-
Nowhere, it just contains changed code base on some revision of the FSO trunk. It's meant for coders only.
-
ohhhh, nice! I'm assuming you basically used a similar technique that is used for skeletal deformation?
with this in place model instancing becomes a lot easier.
-
Yup, that's pretty much it. :D
As for model instancing, perhaps it's feasible but I've given it cursory thought for now. Right now I have rotation and position info stored in a floating point texture per ship which is then bound in a texture unit before draw. Not very scalable for instanced drawing. Perhaps I could have a transformation texture per ship class which will store the data that the shader can rely on when getting per instance data. Or I can use array textures.
I'll think about it fully when this gets stable.
-
Swifty is super cool
-
Yup, that's pretty much it. :D
As for model instancing, perhaps it's feasible but I've given it cursory thought for now. Right now I have rotation and position info stored in a floating point texture per ship
is this a 1D texture? can it be made into a 1D texture, if so then you can use the second dimension for more than one ship. or make a 3d texture.
and you wouldn't even need to do this per class, you could just put everything into one texture, use the ship class index as the offset in one dimension.