Jump to content

[1.9.x] TUFX - Post Processing


Shadowmage

Recommended Posts

1 hour ago, bigboibru said:

It only matters what DirectX version KSP uses, right? Can the rest of my system use a different version (DX12) while KSP uses DX11?

KSP uses DX11 by default. You can override it to use DX12 if your GPU/OS supports DX12 but it will likely end up in crash depending on the mods installed, etc.

Link to comment
Share on other sites

Just added TUFX to my  AVP + Scaterrer game, and I'm seeing parts show up as "transparent", where if you zoom in on a craft you can see other parts and background through them. Highlighting the parts also outlines some innards of the model in a pink hue. Any thoughts what might be causing this? I tried toggling and tweaking different settings of the TUFX profile, but nothing seems to have an effect.

Album here: https://imgur.com/a/XFsDg6Y

Log: https://www.dropbox.com/s/3wbjo3pzn0dt3r9/KSP.log?dl=0

Link to comment
Share on other sites

4 hours ago, OldMold said:

Just added TUFX to my  AVP + Scaterrer game, and I'm seeing parts show up as "transparent", where if you zoom in on a craft you can see other parts and background through them. Highlighting the parts also outlines some innards of the model in a pink hue. Any thoughts what might be causing this? I tried toggling and tweaking different settings of the TUFX profile, but nothing seems to have an effect.

Album here: https://imgur.com/a/XFsDg6Y

Log: https://www.dropbox.com/s/3wbjo3pzn0dt3r9/KSP.log?dl=0

Do you have HDR enabled in TUFX? This happens to me if HDR is enabled, but disabling it fixes it.

Link to comment
Share on other sites

Does the antialiasing setting get ignored on a scene change for anybody else or is it just me? If my profile has TAA enabled and I'm in the flight scene, if I switch to the map view and back antialiasing is off. I get this in my KSP.log when switching from flight to map and back to flight.

[LOG 10:25:28.931] [TUFX] Detected change of active camera; recreating post-process objects.
[LOG 10:25:28.931] [TUFX] Destroying existing PostProcessVolume (from previous camera).
[LOG 10:25:28.931] [TUFX] Enabling profile: Default-Flight.  Current GameScene: FLIGHT
[LOG 10:25:28.932] [TUFX] Setting HDR for camera: Camera ScaledSpace to: False
[LOG 10:25:28.932] [TUFX-ERROR] Layer was null when attempting to update AA mode.
[LOG 10:25:28.935] [TUFX] Profile enabled: Default-Flight

...

[LOG 10:25:30.258] [TUFX] Detected change of active camera; recreating post-process objects.
[LOG 10:25:30.258] [TUFX] Destroying existing PostProcessVolume (from previous camera).
[LOG 10:25:30.258] [TUFX] Enabling profile: Jinx-Flight-2.  Current GameScene: FLIGHT
[LOG 10:25:30.258] [TUFX] Setting HDR for camera: Camera 00 to: False
[LOG 10:25:30.258] [TUFX-ERROR] Layer was null when attempting to update AA mode.
[LOG 10:25:30.259] [TUFX] Profile enabled: Jinx-Flight-2

 

Link to comment
Share on other sites

Hello, fellow Kerbonauts

After a LONG time (my latest continuous, gameplay on KSP was around 1.9....) I made my return on the kerbal scene.
Thanks an A LOT better PC, now, I can also enjoy to add a lot of fancy stuff that, previously, I was unable to use, alike a lot of visual mods.

In the process, I added TUFX, and I'm totally blow out by the immense possibility of the post processing: I donwloaded here and there a lot of profiles (the more, the merrier) to have an ample selection and eventually find those that I could, in the end, like more...
... but obviously, my core idea is, then, to build my own ones.
My problem is, then, the abbundancy of options available, so I was guessing if, somewhere, a kind soul could have build some sort of basic wiki/guide where a total noob alike me could learn some "ropes", rather than try to figure out them by random messing with them.

Thanks in advance for any answer or guide.

Link to comment
Share on other sites

On 9/16/2021 at 1:27 PM, jefferyharrell said:

Does the antialiasing setting get ignored on a scene change for anybody else or is it just me? If my profile has TAA enabled and I'm in the flight scene, if I switch to the map view and back antialiasing is off. I get this in my KSP.log when switching from flight to map and back to flight.

[LOG 10:25:28.931] [TUFX] Detected change of active camera; recreating post-process objects.
[LOG 10:25:28.931] [TUFX] Destroying existing PostProcessVolume (from previous camera).
[LOG 10:25:28.931] [TUFX] Enabling profile: Default-Flight.  Current GameScene: FLIGHT
[LOG 10:25:28.932] [TUFX] Setting HDR for camera: Camera ScaledSpace to: False
[LOG 10:25:28.932] [TUFX-ERROR] Layer was null when attempting to update AA mode.
[LOG 10:25:28.935] [TUFX] Profile enabled: Default-Flight

...

[LOG 10:25:30.258] [TUFX] Detected change of active camera; recreating post-process objects.
[LOG 10:25:30.258] [TUFX] Destroying existing PostProcessVolume (from previous camera).
[LOG 10:25:30.258] [TUFX] Enabling profile: Jinx-Flight-2.  Current GameScene: FLIGHT
[LOG 10:25:30.258] [TUFX] Setting HDR for camera: Camera 00 to: False
[LOG 10:25:30.258] [TUFX-ERROR] Layer was null when attempting to update AA mode.
[LOG 10:25:30.259] [TUFX] Profile enabled: Jinx-Flight-2

 

Yup, same thing with scene changes for me. Doesn't matter what profile, which AA mode, or if hdr is on or off etc. Took me a while to realize it was from each scene change.

Link to comment
Share on other sites

22 minutes ago, diamond-optic said:

Yup, same thing with scene changes for me. Doesn't matter what profile, which AA mode, or if hdr is on or off etc. Took me a while to realize it was from each scene change.

Between this and the screenshot supersize thing, I'd sure love to see a little update to this mod. Not to be a jerk about it, obviously, but it's such a great mod.

Link to comment
Share on other sites

I liked what this was doing for shadows but I was also seeing some conflicts with Scatterer. There was some "tree ring" texture effect on some parts and a large dark spot appeared on Mun and Minmus (at least) on map view unless zoomed far out.  KSP 1.12.2, TUFX 1.0.2.3, Scatterer 0.0772

Edit - It's doing this without Scatterer. The dark circle on the planet is from ambient occlusion- turning it off will fix that.

Edited by Krazy1
not Scatterer
Link to comment
Share on other sites

On 9/18/2021 at 12:25 PM, jefferyharrell said:

Between this and the screenshot supersize thing, I'd sure love to see a little update to this mod. Not to be a jerk about it, obviously, but it's such a great mod.

I think i might have solved the AA problem. Can you test on your end with this file (..\GameData\TUFX\Plugins\ - backup the original too): https://github.com/diamond-optic/TUFX/raw/AA_Scene_Change_BUILDTEST/GameData/TUFX/Plugins/TUFX.dll
 

*edit*

To explain what I changed... There was this part of the code:

onAntiAliasingSelected(tufxProfile.AntiAliasing, false);
layer = activeCam.gameObject.AddOrGetComponent<PostProcessLayer>();
layer.Init(Resources);
layer.volumeLayer = ~0;//everything //TODO -- fix layer assignment...
Log.debug("Layer: " + layer?.GetHashCode());

which I think basically means it was trying to set the AA mode before it set the layer variable. Hence why it was giving a 'layer = null' error. Moving the onAntiAliasingSelected() below the layer = activeCam.... line seems to have fixed it for me

Edited by diamond-optic
explain what I changed
Link to comment
Share on other sites

9 hours ago, diamond-optic said:

I think i might have solved the AA problem. Can you test on your end with this file (..\GameData\TUFX\Plugins\ - backup the original too): https://github.com/diamond-optic/TUFX/raw/AA_Scene_Change_BUILDTEST/GameData/TUFX/Plugins/TUFX.dll

I will happily test this for you next time I get a chance to play, probably later today. Thanks!

Link to comment
Share on other sites

@diamond-optic, looks like you fixed it. Antialiasing is now "sticking" between scene changes, and here's my log file when switching from flight to map to flight again:

[LOG 09:17:08.131] [TUFX] Detected change of active camera; recreating post-process objects.
[LOG 09:17:08.131] [TUFX] Destroying existing PostProcessVolume (from previous camera).
[LOG 09:17:08.131] [TUFX] Enabling profile: Default-Flight.  Current GameScene: FLIGHT
[LOG 09:17:08.132] [TUFX] Setting HDR for camera: Camera ScaledSpace to: False
[LOG 09:17:08.135] [TUFX] Profile enabled: Default-Flight
...
[LOG 09:17:20.363] [TUFX] Detected change of active camera; recreating post-process objects.
[LOG 09:17:20.363] [TUFX] Destroying existing PostProcessVolume (from previous camera).
[LOG 09:17:20.363] [TUFX] Enabling profile: Jinx-Flight-2.  Current GameScene: FLIGHT
[LOG 09:17:20.364] [TUFX] Setting HDR for camera: Camera 00 to: False
[LOG 09:17:20.364] [TUFX] Profile enabled: Jinx-Flight-2

Great job!

Link to comment
Share on other sites

11 hours ago, diamond-optic said:

I think i might have solved the AA problem. Can you test on your end with this file (..\GameData\TUFX\Plugins\ - backup the original too): https://github.com/diamond-optic/TUFX/raw/AA_Scene_Change_BUILDTEST/GameData/TUFX/Plugins/TUFX.dll
 

*edit*

To explain what I changed... There was this part of the code:

onAntiAliasingSelected(tufxProfile.AntiAliasing, false);
layer = activeCam.gameObject.AddOrGetComponent<PostProcessLayer>();
layer.Init(Resources);
layer.volumeLayer = ~0;//everything //TODO -- fix layer assignment...
Log.debug("Layer: " + layer?.GetHashCode());

which I think basically means it was trying to set the AA mode before it set the layer variable. Hence why it was giving a 'layer = null' error. Moving the onAntiAliasingSelected() below the layer = activeCam.... line seems to have fixed it for me

Feel free to put in a PR for this change and I can merge it into main branch for inclusion in the next release.

Good work on finding the solution :)

Link to comment
Share on other sites

@Shadowmage, do you have any idea why SCREENSHOT_SUPERSIZE isn't working with TUFX? Instead of being up-rezd supersized screenshots are just normal resolution but upscaled so each pixel is twice (or whatever) as big. You've been told about this, right? If not I can provide screenshot examples and a log file, if you want.

Link to comment
Share on other sites

21 minutes ago, jefferyharrell said:

@diamond-optic, looks like you fixed it. Antialiasing is now "sticking" between scene changes

thank you for confirming!

 

7 minutes ago, Shadowmage said:

Feel free to put in a PR for this change and I can merge it into main branch for inclusion in the next release.

Good work on finding the solution :)

Will do

Link to comment
Share on other sites

6 minutes ago, jefferyharrell said:

@Shadowmage, do you have any idea why SCREENSHOT_SUPERSIZE isn't working with TUFX? Instead of being up-rezd supersized screenshots are just normal resolution but upscaled so each pixel is twice (or whatever) as big. You've been told about this, right? If not I can provide screenshot examples and a log file, if you want.

I've heard of the issue, but do not no the exact cause.

Likely it is something in the Unity Post Processing stack that isn't playing nicely with it.  Would have to know exactly what triggers these screenshots (is it Unity built-in code, or KSP custom code?), how they are processed, etc.  Seems probable that it is KSP custom code, calling some custom routines on their custom camera rigs, which are then ignoring the post-process framework (and/or are unaware of the framework, which may be manipulating settings that they rely upon).

(this 'supersize screenshot' feature was added after I stepped away from mod development, so I have zero information on it)

Link to comment
Share on other sites

9 minutes ago, Shadowmage said:

I've heard of the issue, but do not no the exact cause.

Likely it is something in the Unity Post Processing stack that isn't playing nicely with it.  Would have to know exactly what triggers these screenshots (is it Unity built-in code, or KSP custom code?), how they are processed, etc.  Seems probable that it is KSP custom code, calling some custom routines on their custom camera rigs, which are then ignoring the post-process framework (and/or are unaware of the framework, which may be manipulating settings that they rely upon).

(this 'supersize screenshot' feature was added after I stepped away from mod development, so I have zero information on it)

Understood. It'd be nice if TUFX and SCREENSHOT_SUPERSIZE worked together, but it's not a hugely critical issue or anything. It's just about taking pretty pretty screenshots.

Link to comment
Share on other sites

  • 2 weeks later...

Hello!

I have a strange issue.

I exported a test profile with ldrlut enabled, added it to a file with others, but after loading the game, in settings ldrlut is disabled.

KSP 1.12.2
Mods: TUFX, KRASH.
No errors/warnings in logs.
 

Profile:

TUFX_PROFILE
{
    name = LUT Test
    hdr = False
    antialiasing = None
    EFFECT
    {
        name = ColorGrading
        GradingMode = LowDefinitionRange
        LDRLUT = TUFX/Textures/EGA_LUT
    }
}

BuiltinTextures:
TUFX_TEXTURES
{
    //named for ModuleManager patching
    name = Builtins
 
    EFFECT
    {
        //the name of the effect to add textures for
        name = ColorGrading
        //the property-name from the effect, and the texture path; multiple entries supported
        LDRLUT = TUFX/Textures/EGA_LUT
    }
}

 

In game:

hHzFYFdWJVA.jpg?size=1920x1080&quality=9

Edited by Vladimir_Rusol
Link to comment
Share on other sites

It looks like there's some issue with AO scaling or something. On small probes I see "tree rings" . There's alos huge AO around KSC buildings.  Changing AO Radius setting doesn't seem to do anything. It would be super cool if you considered updating the mod now that we got the final KSP update.
 image.pngimage.png

Link to comment
Share on other sites

  • 3 weeks later...
On 10/5/2021 at 1:01 PM, Vladimir_Rusol said:

Hello!

I have a strange issue.

I exported a test profile with ldrlut enabled, added it to a file with others, but after loading the game, in settings ldrlut is disabled

There's a bug in general for loading textures; camera dirt textures are also saved, but not loaded. I looked in the git and there's a pull request for a fix for that already, and Shadowmage posted here recently about pull requests, so I think we just have to wait for the new release :) 

Link to comment
Share on other sites

Maybe I'm doing something wrong, but I can't seem to get TUFX working in the main menu and editor. I've read through all the documentation I could find and haven't found anything I may be doing wrong.

When in the editor I can't select a profile, not even the default-editor one which shouldn't do anything at all (scene is shown correctly, but nothing happens when clicking a profile) and as far as the main menu is concerned, I have no idea how you're supposed to select a profile for it. I tried to name the profile after the scene, so "MAINMENU" but that didn't do anything. Tried a few things, nothing of which had the desired outcome, so I'm just asking here.

Edit: Main menu works now when editing the default-MaiMenu with the GUI, then manually applying the changes in the config and then quitting to the main menu. No idea why it doesn't work with my profile. Will try further later.

Link to comment
Share on other sites

10 hours ago, CreepyShadow said:

Maybe I'm doing something wrong, but I can't seem to get TUFX working in the main menu and editor. I've read through all the documentation I could find and haven't found anything I may be doing wrong.

When in the editor I can't select a profile, not even the default-editor one which shouldn't do anything at all (scene is shown correctly, but nothing happens when clicking a profile) and as far as the main menu is concerned, I have no idea how you're supposed to select a profile for it. I tried to name the profile after the scene, so "MAINMENU" but that didn't do anything. Tried a few things, nothing of which had the desired outcome, so I'm just asking here.

Edit: Main menu works now when editing the default-MaiMenu with the GUI, then manually applying the changes in the config and then quitting to the main menu. No idea why it doesn't work with my profile. Will try further later.

I don't think you're doing anything wrong. I don't believe TUFX is intended to work at the main menu or in either editor.

Link to comment
Share on other sites

2 hours ago, jefferyharrell said:

I don't think you're doing anything wrong. I don't believe TUFX is intended to work at the main menu or in either editor.

That could of course be the case, though it would nonethelesss surprise me as there are default profiles for both the main menu and editor. Additionally I actually got the default profile working in the main menu, but I haven't gotten around to test it under all circumstances so maybe it only works when done in a specific way.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...