UIEffectSnapshot
UIEffectSnapshot copied to clipboard
Black screen after Capture on some devices
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
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?
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
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 Unfortunately, the problem is also observed in your project
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