UI-Blur-LWRP-2020
UI-Blur-LWRP-2020 copied to clipboard
ScreenPointToRay coordinates get offset with this solution.
off set relative to screen aspect ratio.
edit: potential fix for this is to change the size relative to Screen.height, and Screen.width fix:
if (Screen.height != renderTexture.height || Screen.width != renderTexture.width)
{
renderTexture = new RenderTexture(Screen.width, Screen.height, renderTexture.depth, renderTexture.format);
renderTexture.name = "replaced";
renderTexture.Create();
mainCamera.targetTexture = renderTexture; // main camera
outputImage.texture = renderTexture; // texture to the raw image of the UI
globalBlurMaterial.SetTexture("_BlurTex", renderTexture); // global material reference, currently being used for UI
}
better fix:
if (Screen.height != renderTexture.height || Screen.width != renderTexture.width)
{
renderTexture.Release();
renderTexture.width = Screen.width;
renderTexture.height = Screen.height;
renderTexture.Create();
}