[MOD] ShaderMod, glow boosts and soft shadow approximations.

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Cpt.Badger
Posts: 31
Joined: Fri, 30. Dec 11, 03:17
x4

Re: [MOD] ShaderMod, Now as cat/dat, no longer needs -prefersinglefiles

Post by Cpt.Badger » Wed, 7. Jun 23, 18:33

JonMicheelsen wrote:
Tue, 6. Jun 23, 19:06
What are you using Reshade for in the game?
I use the following:

+ Ambient Light (works really great and the additional lens effects look really cool in space)
+ CAS Adaptive Sharpening (gives those textures some more pop)
+ Bloom and Lensflares (for additional, chromatic abberation lens flares)
+ SMAA (aliasing is really bad in X4)

Performance hit is really minor.

user1679
Posts: 789
Joined: Fri, 20. Jul 18, 23:20

Re: [MOD] ShaderMod, Now as cat/dat, no longer needs -prefersinglefiles

Post by user1679 » Thu, 8. Jun 23, 06:38

Does this mod require certain graphics settings to be enabled (shadows, screen space reflections, etc.) or is it an override that's always on?

Also if I wanted a "lite" version (similar to how the ENB editor for Skyrim let you turn down shadows, lights, etc.) is there a parameter or two that I can edit?

JonMicheelsen
Posts: 33
Joined: Tue, 15. Aug 17, 22:08
xr

Re: [MOD] ShaderMod, Now as cat/dat, no longer needs -prefersinglefiles

Post by JonMicheelsen » Thu, 8. Jun 23, 12:14

Does this mod require certain graphics settings to be enabled (shadows, screen space reflections, etc.) or is it an override that's always on?
It doesn't require it no, but in particular the ssao is used for more things now.
Also if I wanted a "lite" version (similar to how the ENB editor for Skyrim let you turn down shadows, lights, etc.) is there a parameter or two that I can edit?
I don't know yet if I can parameterize settings, beyond compile time defines in one of the shader include files, so far I've been told that that is not possible on the Egosoft Discord. I will not be doing and maintaining a bunch of modular versions myself.
Ambient Light (works really great and the additional lens effects look really cool in space)
Can you elaborate what exactly you mean by ambient light in this case?
+ CAS Adaptive Sharpening (gives those textures some more pop)
Bloom and Lensflares (for additional, chromatic abberation lens flares)
I've not looked at anything postprocessing yet, I might add CAS. Just boosting existing bloom, flares and chromatic fringing, should be easy to add - but some people hate those effects.
(aliasing is really bad in X4)
I work with AA off, and aim to reduce the sources of aliasing, before touching anything AA, or CAS for that matter, related.

user1679
Posts: 789
Joined: Fri, 20. Jul 18, 23:20

Re: [MOD] ShaderMod, Now as cat/dat, no longer needs -prefersinglefiles

Post by user1679 » Thu, 8. Jun 23, 20:20

JonMicheelsen wrote:
Thu, 8. Jun 23, 12:14
Does this mod require certain graphics settings to be enabled (shadows, screen space reflections, etc.) or is it an override that's always on?
It doesn't require it no, but in particular the ssao is used for more things now.
Also if I wanted a "lite" version (similar to how the ENB editor for Skyrim let you turn down shadows, lights, etc.) is there a parameter or two that I can edit?
I don't know yet if I can parameterize settings, beyond compile time defines in one of the shader include files, so far I've been told that that is not possible on the Egosoft Discord. I will not be doing and maintaining a bunch of modular versions myself.
Thanks for clarifying. I understand not wanting to maintain a modular setup so let me elaborate what I was thinking of. With the ENB executable (yes, different than this mod) for Skyrim you have an in-game GUI that lets you choose "low, medium, high" for shadows and other "spinner" type controls that let you change light intensity / brightness, etc. I'm not asking for something so elaborate but if it's possible to add a define for shadow intensity or lighting intensity, it could then be modified by the "advanced" user (by unpacking / repacking the CAT) so when the game is launched it gets compiled by the GPU driver.

The reason I'm asking is despite me having an RTX 3060 with 12 GB VRAM, this mod causes me to lose about 20 fps. I even have shadows and screen reflections disabled in the game's graphics settings and use FXAA. Without the mod I'm around 55 fps but with this shader mod I'm hitting around 28 to 31.

It does look beautiful though. I even think it makes asteroids look better :)

Skeeter
Posts: 3675
Joined: Thu, 9. Jan 03, 19:47
x3

Re: [MOD] ShaderMod, Now as cat/dat, no longer needs -prefersinglefiles

Post by Skeeter » Fri, 9. Jun 23, 05:42

Finally got it working, looks nice but some bugs like dissapearing textures in the managers room when standing next to the right side of the chair there near the wall next to thing looks like hole in the wall with black outline. Around the walls of it textures appear and dissapear when moving the camera.

Dunno why but it looked a bit strange like blury when i watching the large station fly past on the terran dlc main menu. Dunno if just me. The alising of spec stuff seems much improved, didnt even really need aa on i thought.
[ external image ]
7600x cpu 5.4ghz 32gb DDR5 5600mhz 6700XT 32" 1440p mon

JonMicheelsen
Posts: 33
Joined: Tue, 15. Aug 17, 22:08
xr

Re: [MOD] ShaderMod, Now as cat/dat, no longer needs -prefersinglefiles

Post by JonMicheelsen » Fri, 9. Jun 23, 12:47

Finally got it working, looks nice but some bugs like dissapearing textures in the managers room when standing next to the right side of the chair there near the wall next to thing looks like hole in the wall with black outline. Around the walls of it textures appear and dissapear when moving the camera.

Dunno why but it looked a bit strange like blury when i watching the large station fly past on the terran dlc main menu. Dunno if just me. The alising of spec stuff seems much improved, didnt even really need aa on i thought.
Is this the cat/dat version of the the code version? Also, screenshots would be great? There's technically nothing in the code changes that can make a "texture disappear", so what you are describing is something else.


On that note, there's a big update around the corner, that among other things, adds soft shadow approximations to all light types, and some more improvements to the screen space shadows! :D

Cpt.Badger
Posts: 31
Joined: Fri, 30. Dec 11, 03:17
x4

Re: [MOD] ShaderMod, Now as cat/dat, no longer needs -prefersinglefiles

Post by Cpt.Badger » Fri, 9. Jun 23, 16:22

JonMicheelsen wrote:
Thu, 8. Jun 23, 12:14
Can you elaborate what exactly you mean by ambient light in this case?
This shader:

https://github.com/Otakumouse/stormshad ... ntLight.fx

It adds a bit of bloom / coloring around bright pixels, which is color dependent, so overall I find it simulates ambient lighting rather well.
I've not looked at anything postprocessing yet, I might add CAS. Just boosting existing bloom, flares and chromatic fringing, should be easy to add - but some people hate those effects.
That's true, X4 is the only game I use this shader as it fits really nicely into a space-themed game, where in space - light emiting stars are actually REALLY bright. :)

JonMicheelsen
Posts: 33
Joined: Tue, 15. Aug 17, 22:08
xr

Re: [MOD] ShaderMod, glow boosts and soft shadow approximations.

Post by JonMicheelsen » Mon, 19. Jun 23, 12:10

New push up!

Latest changes:
  • SSAO polish.
  • Glow tweaking.
  • Fixed reflection probes that was accidentally broken in a previous version.
  • Performance improvements of screen space shadows and further tweaking of both near and far parameters giving better coverage in both cases.
  • Fake soft shadow approximation on all light types - relies on SSAO to be on!

Realspace
Posts: 1372
Joined: Wed, 15. Nov 06, 10:21
x4

Re: [MOD] ShaderMod, glow boosts and soft shadow approximations.

Post by Realspace » Wed, 21. Jun 23, 21:37

Seems fine on my old gfc rx580, no performance loss.
I am using it together with my Reshade settings, very clean and contrasty result and better lighting overall. Glow is very visibile close to gates, f.i.
I've not understood one thing, should I activate SSAO in game's settings to see your mod's SSAO in action or are they applied automatically?

JonMicheelsen
Posts: 33
Joined: Tue, 15. Aug 17, 22:08
xr

Re: [MOD] ShaderMod, glow boosts and soft shadow approximations.

Post by JonMicheelsen » Thu, 22. Jun 23, 17:31

Seems fine on my old gfc rx580, no performance loss.
Happy to hear that 8)
Glow is very visibile close to gates, f.i.
I'll check it out. The proper way to do what I did would be to go through all the materials and tweak their emissive that way, but that's a lot of work and possibly conflict prone, so I did a globally remapped 90% of original glow intensity to 0-1 range and then multiplied the sum of the original 10% and 90% levelled by 12, across the board, which was enough to make the little lamps on stations cause light bloom, without completely exploding large bloom surfaces. If I could boost the emissive intensity of the tiny lights instead that would be better.
I've not understood one thing, should I activate SSAO in game's settings to see your mod's SSAO in action or are they applied automatically?
Yes, SSAO needs to be on for this to do anything. I can't force it on. Vanilla takes any light's influence and multiplies it with the ssao result. I instead pass the SSAO through some additional functions to refine it a bit. There's one for ambient specular(SSR + probes), ambient diffuse(probes) and for directional lights(any other light).
For the ambient ones, this is the concepts used. https://iryoku.com/downloads/Practical- ... lusion.pdf
For the directional ones I use the one found on page 32 and onwards here, modified a tiny bit: https://advances.realtimerendering.com/ ... _Final.pdf
I did boost the native SSAO range by 50%, to make it a little bit wider. I would like it to be even more so, but it require some more complex technique changes I haven't yet looked into.

Post Reply

Return to “X4: Foundations - Scripts and Modding”