Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix alpha screenshots with certain post processing effects #183

Merged
merged 6 commits into from
Aug 29, 2023

Conversation

RikkiBalboa
Copy link
Contributor

Certain post processing effects create issues with alpha screenshots (e.g. bloom making the whole screenshot transparent). This PR just extends the functionality that already seems to be there for the in-game effects.

All games except KK and EC come with the post processing runtime by default and this should just work. For KK I added the post processing runtime as a reference so it is able to compile. But the code it setup such that it falls back to the default behavior if the post processing runtime does not exist
For EC I just excluded it at compile time.

I tested it on both KK and KKS, with and without having the runtime.dll manually installed.

@ManlyMarco
Copy link
Collaborator

ManlyMarco commented Aug 23, 2023

Why have it in KK at all if it will always fail since that file doesn't exist in Unity 5.6? You could exclude it like in EC.

You don't need to reference the assembly at all if it might not exist. Instead you could use Type.GetType to get the types to disable instead and see if you get a null or not.

@RikkiBalboa
Copy link
Contributor Author

If you use the PostProcessing Plugin on KK the runtime will exist though, KK and EC just don't ship with the runtime. I'm also unaware of any PostProcessing plugins on EC so I excluded it completely there.

I also tried using Type.GetType at first but I also need to actually use some of the components directly (e.g. the PostProcessVolume). And doing it with reflection is not something I've ever done before and also looked messy in how it would need to be done.

Considering this code only runs once you make a screenshot, this seemed like the most simple and readable solution

@ManlyMarco
Copy link
Collaborator

I see, didn't know about the KK plugin including it. I'll take a look at it later to see if I can simplify it.

Copy link
Collaborator

@ManlyMarco ManlyMarco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be working fine while being a bit faster and hopefully cleaner. If you can confirm that this version works for you I'll merge the PR.

@RikkiBalboa
Copy link
Contributor Author

I confirmed it working on both KK and KKS, both with and without PPE installed (including runtime in KK) and it works without problems. Thanks!

@ManlyMarco ManlyMarco merged commit 879ffdd into IllusionMods:master Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants