Fix alpha screenshots with certain post processing effects #183
No reviewers
Labels
No labels
bug
dependencies
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
IllusionMods/BepisPlugins!183
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix_ppe_alpha_screenshots"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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.
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.GetTypeat first but I also need to actually use some of the components directly (e.g. thePostProcessVolume). 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
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.
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.
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!