unity-frosted-glass
unity-frosted-glass copied to clipboard
Blur amount is dependent on resolution at launch
I just tried making a Windows build of a game that uses this effect, and the blur worked, but was distinctly less blurred than it appeared in the editor:


This happens in Unity 2018.1.2f1 and in Unity 2018.2.0b9. I'm running Windows 10.
Could it be related to your Quality Settings ?
OK, I've just confirmed that it doesn't have to do with Quality Settings, but in the process I accidentally found what it DOES have to do with -- the amount of blur in the editor seems to be relative to whatever the resolution of the "game" pane was at the START of playback. When I was making my test case, I did "build and run", then went back to the editor, hit play, popped out the "game" tab, and THEN resized it to fit with the running game. At that point, if I turn play mode off and on again, THEN it matches.
Hopefully that's a good diagnostic as to how to fix this, because unfortunately it isn't much of a workaround for me, because where I'm actually using this is in VR... I'm pretty sure I'm rendering at the same VR resolution in the editor as in the build, but the blur is distinctly different regardless, which I guess means to work around this I'd have to resize my editor window to fit whatever buffers the standalone VR build is using, but I'm not sure what that would be?
Also, I just confirmed that the same amount of blur looks very different at different resolutions (even when working around the bug), here's the same scene but at half the size (then scaled up 2x for comparison)

OK so I just realised this has turned into a discussion of two different issues, but I have a workaround for one of them at least.
I can do a pull request to fix the fact that changing window size while it's running distorts the blur. I haven't yet figured out what to change to make the blur look similar at different resolutions. Should I do the PR for the first issue or wait until I've addressed both?
You're welcome to do one PR per issue :)
OK, the "it looks weird if you change the window size while it's running" bug is fixed here: https://github.com/andydbc/unity-frosted-glass/pull/5
OK, I think I've now got the original issue of the thread also fixed in https://github.com/andydbc/unity-frosted-glass/pull/6