Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Black screen after Capture on some devices #6

Open
memcpy1337 opened this issue Jun 17, 2022 · 6 comments
Open

Black screen after Capture on some devices #6

memcpy1337 opened this issue Jun 17, 2022 · 6 comments

Comments

@memcpy1337
Copy link

memcpy1337 commented Jun 17, 2022

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

@mob-sakai
Copy link
Owner

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

@memcpy1337
Copy link
Author

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

@mob-sakai
Copy link
Owner

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. 👍
https://docs.unity3d.com/ScriptReference/ScreenCapture.CaptureScreenshotIntoRenderTexture.html

@mob-sakai
Copy link
Owner

Project_fixtest.zip

@memcpy1337
Please test this project on your Android.

@memcpy1337
Copy link
Author

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

@memcpy1337
Copy link
Author

memcpy1337 commented Jun 22, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants