Fix alpha screenshots with certain post processing effects #183

Merged
RikkiBalboa merged 6 commits from fix_ppe_alpha_screenshots into master 2023-08-29 12:00:33 +00:00
RikkiBalboa commented 2023-08-23 14:30:17 +00:00 (Migrated from github.com)

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.

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 commented 2023-08-23 20:39:22 +00:00 (Migrated from github.com)

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.

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 commented 2023-08-23 21:28:28 +00:00 (Migrated from github.com)

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

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 commented 2023-08-24 14:35:08 +00:00 (Migrated from github.com)

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.

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.
ManlyMarco (Migrated from github.com) reviewed 2023-08-28 21:53:49 +00:00
ManlyMarco (Migrated from github.com) commented 2023-08-28 21:53:49 +00:00
```suggestion ```
ManlyMarco (Migrated from github.com) reviewed 2023-08-28 21:56:04 +00:00
ManlyMarco (Migrated from github.com) left a comment

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.

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 commented 2023-08-29 06:40:26 +00:00 (Migrated from github.com)

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!

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!
Sign in to join this conversation.
No description provided.