Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

LWRP. SRP Batcher not work on mobile ??

Discussion in 'General Graphics' started by WryMim, May 12, 2019.

  1. WryMim

    WryMim

    Joined:
    Mar 16, 2019
    Posts:
    69
    Android.

    I use script "SRPBatcherProfiler".
    Toggle enable / disable SRPBatcher.

    SRP batcher WORK on PC. Not WORK on Android.

    On the screen says that it is enabled / disabled. But all Shader are given in the section standard and will not batching.

    Help pls!
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    From the Unity 2019.2 beta blog-post:
    https://blogs.unity3d.com/2019/05/09/unity-2019-2-beta-is-now-available/

    Do you use 2019.2 beta?

    This blog-post, 3 months old by now, contains a "supported platforms" table:
    https://blogs.unity3d.com/2019/02/28/srp-batcher-speed-up-your-rendering/
     
  3. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    If you're on 2019.1, SRP bacther Android support will be there in several weeks.
    If you're on a newer version, it should work. If it doesn't, please report a bug.
     
  4. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    Thx!
    I use 2019.1.1. Waiting for updates!
     
  5. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    I'll post here when it lands :)
     
    Peter77 likes this.
  6. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    Scratch that, this was another fix landing :)
    I'll post when the real thing happens.
     
    Last edited: May 16, 2019
  7. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    2019.1.5f1 will have it.
     
  8. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    Thanks for help! I will wait
     
  9. BattleAngelAlita

    BattleAngelAlita

    Joined:
    Nov 20, 2016
    Posts:
    400
    Any chance to backport to 2018 LTS?
     
  10. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    @BattleAngelAlita unfortunately, no.
    This wasn't a backport. This functionality was added in 2019.1, but then it was disabled due to a certain bug it introduced. The bug was fixed in 2019.1.5f1, and SRP batcher support on GL was re-enabled.
     
  11. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    Hi.
    2019.1.5 out, I look at the list of changes and there is no bug fix?
     
  12. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
  13. Eyeofgod

    Eyeofgod

    Joined:
    Jun 25, 2010
    Posts:
    126
    Hi,

    I was checking SRP batching on iOS (Unity 2019.1.2f1 and LWRP 5.13). There are differences between what Xcode reports as draw and Unity's frame debugger.
    Scene.png Unity Batches.png Xcode draws.png

    On Xcode there are 3877 draws, but on the Unity frame debugger it only shows 7. @aleksandrk Is this expected? Is SRP working?
     
  14. Eyeofgod

    Eyeofgod

    Joined:
    Jun 25, 2010
    Posts:
    126
    Also let me add that SRP Batcher doesn't work if objects are light mapped ONLY ON DEVICE, on editor works great.
     
  15. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    The frame debugger isn't showing draw calls. It's showing internal renderer thread events. Each event may produce multiple draw calls.

    Also the SRP Batcher isn't making drawing multiple objects use one "draw call", instead it makes those draw calls much cheaper. This was true of static batching too btw. If you have 4 objects that are staticly batched, it shows as one event in the frame debugger, but it's still 4 draw calls if you use RenderDoc (on PC) or XCode.

    One thing to understand is draw calls themselves are not necessarily expensive. Changing the rendering settings (shader or shader variant, mesh, blend mode, textures in use, material properties, object position, etc.) is the expensive part. The idea behind the SRP Batcher is to try to reduce the settings change cost.
     
    Leozzyzheng and robinbobin like this.
  16. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    When will SRP batching support be added on a mobile device in Unity 2019.1 ?
     
  17. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    @unity_5fpsmegasupergiperprogramer The bug doesn't mention the batcher itself.
    It's the first entry in the release notes: "Android: Fixed a crash when a shader is written in GLSL and uses Single-pass rendering in Android VR." This was a blocking issue for the batcher, so we decided to disable SRP batcher support as a quick fix and then fixed it properly.
     
  18. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    @Eyeofgod Bgolus answered the draw call question :)

    Please report a bug.
     
  19. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    Once again, the question "When will SRP Batcher run on android in 2019.1 Unity ?", or will be available only in 2019.2 ?

    Why in Unity 2019.2 beta, it says "OpenGL support for SRP batcher (iOS and Android) to improve CPU performance in projects that use the Lightweight Render Pipeline (LWRP)."
     
  20. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    Once again, 2019.1.5 has it.
     
  21. juanfornos

    juanfornos

    Joined:
    Feb 17, 2018
    Posts:
    10
  22. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    I get some black objects which are static and have baked lightmaps. Dynamic textmespro text aren't visible not UI ones. It uses TextMeshPro/Mobile/Distance Field shader . I use this for character names on top of their head and move dynamically. It was working in March now it doesn't. I'm using lwrp 6.9.1 and unity 2019.2.0f1
     
    Last edited: Aug 16, 2019
  23. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    Please report a bug.
     
  24. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    Hi i reported it early but could't explain. Case number 1176626

    I don't know why static objects are black but will try after disabling static batching.
    And all of moving text are in origin position (0,0,0) after using srp on android build
     
  25. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
  26. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
  27. Vorontsev

    Vorontsev

    Joined:
    Feb 12, 2019
    Posts:
    3
    Did you find a solution?
     
  28. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    Yeah it works now.
     
  29. AndreyPakhomov

    AndreyPakhomov

    Joined:
    Mar 27, 2014
    Posts:
    6
    I have same problem on 2019.2.9f1 (LWRP 6.9.1) in IL2CPP build on android. Everything static is black. Is this solved by disabling batching?
     
  30. segant

    segant

    Joined:
    May 3, 2017
    Posts:
    196
    If you can upgrade it to 7.1.2 Universal Rp then it will be solved. Basically just download 2019.3 beta
     
    Last edited: Oct 15, 2019
  31. AndreyPakhomov

    AndreyPakhomov

    Joined:
    Mar 27, 2014
    Posts:
    6
    I cant use beta, because some packages not compiles in it. Like Package Manager UI or Input System. Is there a guarantee that everything will be fine in beta?
     
  32. unity_5fpsmegasupergiperprogramer

    unity_5fpsmegasupergiperprogramer

    Joined:
    Dec 1, 2017
    Posts:
    101
    There's no guarantee, Unity doesn't know what they want and everything will be redone again 100
     
  33. rahul-kumar186

    rahul-kumar186

    Joined:
    Feb 12, 2017
    Posts:
    2
    It is still not working , any update on this?
     
  34. Arcan-Studios

    Arcan-Studios

    Joined:
    Mar 12, 2015
    Posts:
    58
    I m develop for oculus quest, with unity 2019.3.11 and srp batching not working un quest, work in pc nut not when compile to oclus quest
     

    Attached Files:

  35. Arcan-Studios

    Arcan-Studios

    Joined:
    Mar 12, 2015
    Posts:
    58
    i test with new unity 2019.3.12 and fixed, now srp batcher works well in oculus quest
     
  36. robinbobin

    robinbobin

    Joined:
    Aug 22, 2018
    Posts:
    4
    Hi!
    Using Unity 2019.4.0f1 and URP v.7.3.1
    We develop the Card game. Now I faced the same issue with Android build.
    Use frame debugger and in it says there are all cards batches in one event in UnityEditor (Windows) - 19 events per frame total.
    But in android build there are about one event per card (.
    Interesting that it happens while using URP/Unlit shader.
    But if use URP/SimpleLit shader all cards batches in one event and the frame debugger shows only 9 events per frame Android.

    Is it bug or feature?) Can I use unlit shader with same batching as simpleLit?
     
    Last edited: Jun 19, 2020
  37. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,983
    Hi!
    It should work :)
    Please report a bug.
     
    robinbobin likes this.
  38. robinbobin

    robinbobin

    Joined:
    Aug 22, 2018
    Posts:
    4
    Done.
    BTW also same issue appears using our custom unlit shader. There is no batching on Android.
     
  39. Foreman_Dev

    Foreman_Dev

    Joined:
    Feb 4, 2018
    Posts:
    79
    I'm having the same issue! The SRP Batcher does not appear to work on an Android build in Unity 2019.4.16f1 and URP 7.3.1 while it works fine in-editor. :(

    I made a thread about my issue here: https://forum.unity.com/threads/gpu...quest-2-android-works-fine-in-editor.1017781/

    If this is a bug, has the bug been addressed at all?