id Tech Forums

id Tech 4 (Doom3/Prey/Q4) => id Tech 4 Mod Coding => Topic started by: VGames on October 07, 2015, 05:27:36 PM

Title: Optimising Sikkmod 1.2 code
Post by: VGames on October 07, 2015, 05:27:36 PM
Is there anything that can be done to the Sikkmod code that could help it be less tasking on systems? I know that the best way to do it would be to reinvent the wheel like oneofthe8devilz is doing with his hybrid engine to go about making the same effects as Sikkmod possible but with less stress on the system. But is there something that can be done to the current Sikkmod 1.2 code that maybe Sikkpin was unaware of that has now been realized since the last release of Sikkmod 1.2? Like maybe using an older version of HDR or something like that? Just thinking out loud.
Title: Re: Optimising Sikkmod 1.2 code
Post by: nbohr1more on October 08, 2015, 12:19:10 AM
Revelator and SteveL have gotten direct access to the depth buffer working in The Dark Mod v2.03.
You could re-engineer Sikkpin's shaders to use the native depth buffer rather than rendering depth to a texture
then decoding it. The Dark Mod team is currently working on similar stuff.

Without making engine changes like that? I don't think you'll be able to optimize what Sikk has done much further.
There are tons of derivative or variants of the Sikkpin shaders out there.

I personally liked the shader that JC Denton made for the Ruiner mod, it wasn't as fancy as Sikk's but it matched the Doom 3 look better.
Add that to Dentonmod and Doom 3 looks really nice and has nice visceral gun effects. If you wanna offer a low-end Perfected Doom 3 then
you might consider using the shaders from Ruiner.

http://www.moddb.com/mods/ruiner
Title: Re: Optimising Sikkmod 1.2 code
Post by: VGames on October 08, 2015, 08:41:31 AM
Now when u say the shaders are u talking about the files in the glprogs folder? Or actual code in the source? I didn't think the source had been released for Ruiner.
Title: Re: Optimising Sikkmod 1.2 code
Post by: nbohr1more on October 08, 2015, 09:09:16 AM
Just the glprogs folder.

No need for their SDK code.
Title: Re: Optimising Sikkmod 1.2 code
Post by: nbohr1more on October 08, 2015, 10:05:17 AM
BTW. They did release their source code too:

http://www.moddb.com/mods/ruiner/downloads/ruiner-hardqore-2-source-codes
Title: Re: Optimising Sikkmod 1.2 code
Post by: VGames on October 08, 2015, 10:45:11 AM
Yeah I just saw that earlier. I guess I completely missed that.

So just using the glprogs files will help speed things up? I figured more work in the source would be needed to use some of those glprog files from other mods.

Can I still use the interaction files that come with sikkmod? I'd like to be able to use relief or Pom as would the users of PD3 I'm sure. And I love the look of the game when using sikkmods non relief/Pom custom blin-phong interaction file.
Title: Re: Optimising Sikkmod 1.2 code
Post by: nbohr1more on October 08, 2015, 11:44:05 AM
POM is going to be taxing on any hardware whether you have source code access or not. There is NO solution that will make POM perform well.
The entire way that POM works has largely been abandoned by the industry in favor of Tessellation. You could alter the interaction file in ruiner to
include a POM section but you will defeat the purpose of "optimizing".

As I can tell, here are the additional challenge you face:

Soft Shadows = Sikkpin's method requires re-rendering the scene 2x for each shadow and requires the depth buffer trick
DOF = Requires Sikkpin's depth buffer trick
SSAO = Requires Sikkpin's depth buffer trick
SSIL = Requires Sikkpin's depth buffer trick

All those will require Sikkpin's shaders too.

Ruiner doesn't have any code support for any of the above, the only thing you gain from it is the interaction shader and if you don't want that
you can simply stick with Sikkmod and remove the option to enable the above effects.

Does this make sense?

Title: Re: Optimising Sikkmod 1.2 code
Post by: VGames on October 08, 2015, 11:55:00 AM
This makes perfect sense. Thank u. So using the Ruiner shaders would be a waste of time since the ability to use relief and POM must be kept as an option. I'll just stick with what I got then. When I upgrade my rig I'm sure I'll finally have more then enough to run PD3 with sikkmod features maxed out.

I was wondering something though. How does sikkmod 1.2 run for u without Pom/relief and with all the graphics features turned off? I recently tried this which i haven't ever tried and I don't get the best frame rate as i should. I get around 30-40 instead of a smooth 60 like with vanilla Doom 3. I'm using ATI. Could I have a driver issue?
Title: Re: Optimising Sikkmod 1.2 code
Post by: The Happy Friar on October 08, 2015, 10:05:41 PM
Quote from: nbohr1more on October 08, 2015, 11:44:05 AM
Soft Shadows = Sikkpin's method requires re-rendering the scene 2x for each shadow and requires the depth buffer trick

With modern hardware & D3 BFG optimizations, could it be better performance wise to duplicate & offset lights slightly to get "real" soft shadows?  In the mid-late 00's the biggest issue was performance.
Title: Re: Optimising Sikkmod 1.2 code
Post by: VGames on October 08, 2015, 10:30:39 PM
I'm sure that would work but I lack the knowledge to do so. In the near future I'm thinking about paying somebody to optimize the sikkmod graphics features and further push them.
Title: Re: Optimising Sikkmod 1.2 code
Post by: The Happy Friar on October 08, 2015, 10:34:47 PM
Did a test in a custom made I made a while ago.

Run though with map as is (timedemo run 3 times) ~622fps.  Triple the lights & (timedemo run 3 times) ~279fps.  So it would be a big performance hit.
Title: Re: Optimising Sikkmod 1.2 code
Post by: VGames on October 08, 2015, 10:40:12 PM
What is this u are showing results for?
Title: Re: Optimising Sikkmod 1.2 code
Post by: nbohr1more on October 08, 2015, 10:46:58 PM
OK for a performance comparison:

1) HDR / Color Grading / Bloom / Wulfen Textures = 45 to 60 FPS in Mars City (hovers around 50)
2) Add SSAO Crytech (blur quality 2) = 25 to 30 FPS
3) Add Soft Shadows remove SSAO = 15 to 23 FPS (mostly 20 FPS)

4) POM and no other effects? 9 FPS or Less   ;D

Resolution = 1440x900

CPU = 3.4 Ghz i3-2130
GPU = Geforce GT 730 1GB (384 cores)
Title: Re: Optimising Sikkmod 1.2 code
Post by: VGames on October 08, 2015, 10:58:48 PM
That's about me too. AMD 940 black edition with a Radeon 5870 1024ghz GPU. I'm seriously thinking of paying to have the sikkmod source rebuilt to use better methods for the enhanced graphics features. Unless the Friar already has something better. His results seem much better.
Title: Re: Optimising Sikkmod 1.2 code
Post by: The Happy Friar on October 08, 2015, 11:06:38 PM
Quote from: VGames on October 08, 2015, 10:40:12 PM
What is this u are showing results for?

Trying to duplicate lights to make real soft shadows vs a shader.
Title: Re: Optimising Sikkmod 1.2 code
Post by: VGames on October 08, 2015, 11:28:44 PM
Interesting. Are u using sikkmod 1.2 as a base?
Title: Re: Optimising Sikkmod 1.2 code
Post by: The Happy Friar on October 09, 2015, 10:50:10 AM
No, stock Doom 3 for a benchmark.  Turns out demos don't use any existing maps either, it's all stored in the .demo file so I need to do a new demo for each change I make.
Title: Re: Optimising Sikkmod 1.2 code
Post by: VGames on October 09, 2015, 11:34:10 AM
How much do u think someone would charge to get Sikkmods shaders to use the native depth buffer?
Title: Re: Optimising Sikkmod 1.2 code
Post by: VGames on October 09, 2015, 11:58:14 AM
And also make another version that's compatible with ROE.