lukakldiashvili / Unified-Universal-Blur

UI blur (translucent) effect for Unity.
MIT License
427 stars 33 forks source link

[Feature Request] Scale with resolution #13

Closed matyX6 closed 6 months ago

matyX6 commented 8 months ago

When I change the resolution, on lower resolutions it seems like there are more blur. I tried to implement "resolution scaling" solution for my post processing effects as well as for this asset, to have more consistent results across multiple resolutions. The change in blur visuals is very noticable when going from desktop pc (high resolution 1440p) to Steam Deck (lower resolution 800p).

I included reference photo in which it is clearly visible that the blur is not consistent on multiple resolutions without scaling, I included my solution photo as well. Could you add this feature, I'd like to use it as a package instead with your own edits?

Is this the "safe" approach, or any other way to scale blur with resolution?

scaling-blur

My edits and solution: scaling-feature-edits scaling-pass-edits

matyX6 commented 8 months ago

One other thing that crosses my mind is maybe to incorporate URP render scaling as well since it also affects blur... And will be useful for everybody that changes it from a default value.

So in the end code could look something like: var urpAsset = (UniversalRenderPipelineAsset)GraphicsSettings.renderPipelineAsset; scale = (Screen.height urpAsset.renderScale) / passData.referenceResolutionHeight

lukakldiashvili commented 8 months ago

Hi @matyX6, thank you for the request and the solution. I'll make sure to implement this feature, soon.

lukakldiashvili commented 6 months ago

Sorry for the delay. After testing in the editor, default behaviour produced better/correct results compared to this request. I may implement this kind of scaling as an optional feature later down in line.

In the meantime, please check if some other changes are affecting the scaling.

lukakldiashvili commented 6 months ago

After further investigation, this seems to be caused by difference between behaviours of RenderingUtils.ReAllocateIfNeeded and RenderTexture constructor, where only latter one working as intended. This solution is needed for editor versions UNITY_2022_1_OR_NEWER.

Solution will be released in the next version, probably in a different way. Thank you for raising the issue.