UI-Blur-LWRP-2020 icon indicating copy to clipboard operation
UI-Blur-LWRP-2020 copied to clipboard

ScreenPointToRay coordinates get offset with this solution.

Open Nova-Ardent opened this issue 2 years ago • 2 comments

Nova-Ardent avatar Jun 19 '22 04:06 Nova-Ardent

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
}

Nova-Ardent avatar Jun 19 '22 04:06 Nova-Ardent

better fix:

        if (Screen.height != renderTexture.height || Screen.width != renderTexture.width)
        {
            renderTexture.Release();
            renderTexture.width = Screen.width;
            renderTexture.height = Screen.height;
            renderTexture.Create();
        }

Nova-Ardent avatar Jun 19 '22 05:06 Nova-Ardent