UIEffectSnapshot icon indicating copy to clipboard operation
UIEffectSnapshot copied to clipboard

Black screen after Capture on some devices

Open memcpy1337 opened this issue 2 years ago • 6 comments

I have several phones, on one works fine, but on an older tablet huawei mediapad t3 instead of blur screen displays solid black. I am using URP in my project. I also use shaders created in Shader Graph, they work without any problems on the problematic tablet. What could be the problem? Can you help please?

And thank you so much for your asset

memcpy1337 avatar Jun 17 '22 07:06 memcpy1337

Thank you for your reporting!

Tell me about your develop/build environment.

  • UIEffectSnapshot version [e.g. 1.0.0]
  • Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL]
  • Unity version: [e.g. 2022.2.0f1]
  • Build options: [e.g. IL2CPP, .Net 4.x, URP/HDRP]

Could you please attach a minimal project (included Assets, Packages and ProjectSettings directories) that reproduces the issue?

repos

mob-sakai avatar Jun 17 '22 07:06 mob-sakai

UIEffectSnapshot version : 1.0.1 Platform: Android Unity version: 2019.4.31f1 Build options: NET Standart 2.0, URP, Mono

Here (tested right now - black screen): Project.zip

memcpy1337 avatar Jun 17 '22 08:06 memcpy1337

This issue is not reproduced on my Android (Xperia ZX: Snapdragon 820).

So, I will create a test project with ScreenCapture.CaptureScreenshotIntoRenderTexture API for you. :+1: https://docs.unity3d.com/ScriptReference/ScreenCapture.CaptureScreenshotIntoRenderTexture.html

mob-sakai avatar Jun 19 '22 06:06 mob-sakai

Project_fixtest.zip

@memcpy1337 Please test this project on your Android.

mob-sakai avatar Jun 19 '22 07:06 mob-sakai

@mob-sakai Unfortunately, the problem is also observed in your project

memcpy1337 avatar Jun 22 '22 05:06 memcpy1337

The problem is in the script UIEffectSnapshotUpdater function SetupCommandBuffer Lines:

// [3] Iterate blurring operation.
            if (request.blurMode != UIEffectSnapshotRequest.BlurMode.None)
            {
                for (var i = 0; i < request.blurIterations; i++)
                {
                    // [3.1] Apply blurring (horizontal).
                    cb.SetGlobalVector(s_EffectFactorId, new Vector4(request.blurFactor, 0));
                    Blit(cb, ref src, ref dst, mat, 1);
            
                    // [3.2] Apply blurring (vertical).
                    cb.SetGlobalVector(s_EffectFactorId, new Vector4(0, request.blurFactor));
                    Blit(cb, ref src, ref dst, mat, 1);
                }
            }

If i comment this lines all works fine (except blurring :)). I debugging this on problematic tablet (huawei mediapad t3), and did not see any visible (to me) errors

memcpy1337 avatar Jun 22 '22 06:06 memcpy1337