Search Unity

Question Lwrp and Shader Graph performance on mobile

Discussion in 'Shader Graph' started by ernakgl, Jul 11, 2019.

  1. ernakgl

    ernakgl

    Joined:
    Oct 9, 2018
    Posts:
    21
    Actually ı work on generally on mobile phones and ı use legacy vertex lit rendering path and lagacy shaders they are perfect for performance but lwrp and shader graph not. I make this but its not good for mobile:

    actaully lwrp dont have good performance for some mobile phone not ıphone ,a talking about android.
    I Use lowQualityLwrp but why it is dont give me good performance like legacy ?
     
  2. MP-ul

    MP-ul

    Joined:
    Jan 25, 2014
    Posts:
    230
    LWRP is garbage for low end mobile platforms, you are better off with the standard rendering pipeline.
     
    ernakgl likes this.
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,794
    I don't want to defend LWRP, but I think even if you wrote that shader by hand in the legacy RP, keeping the same logic, it would be pretty slow for old mobiles.

    Something more appropriate for older devices would be blending a couple of textures and distorting the UVs. It will look less fancy than procedurally generated Voronoi but it should be much faster, both in legacy and LWRP.

    It would be nice if Shader Graph could have something like a cycle cost per node (kinda like substance designer does it), so people can see where things get slow.
     
    Last edited: Jul 12, 2019
  4. MP-ul

    MP-ul

    Joined:
    Jan 25, 2014
    Posts:
    230
    Trust me, the legacy RP is faster to setup in order to get outstanding performance on mobile. This is the proof
    .

    Edit: Indeed blending 2 textures is a ton faster but you need to know that you have to avoid complex calculations on mobile platforms like Dot products and other like it.
     
    Last edited: Jul 12, 2019
    Hobodi and ernakgl like this.
  5. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    It's important to understand that Shader Graph does every operation on a per-pixel basis, rather than doing some of the work on a per-vertex basis (for instance, UV modifications). This is a vital important performance factor on mobile hardware.

    Amplify Shader Editor has a "Frag to vert" node which specifies the input needs to be done in the vertex shader, and it's result passed to the fragment (pixel) shader. This'll hopefully be possible with Shader Graph in the future, but I suspect this will be a long time from now. Edit: it is now!

    Also what @AcidArrow mentions is very true. Generating complex noise patterns is something that needs to be avoided when performance is concerned.
     
    Last edited: Sep 23, 2019
    DungDajHjep, JonPQ, MP-ul and 2 others like this.
  6. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,437

    What is the node (or nodes) in Shadergraph that will do this now?

    I'm experiencing extremely poor performance with Shadgraph shaders due to transparency issues and (as far as I know) also due to the Shadergraph doing things on a "per-pixel" basis as you mentioned above -- probably related.

    Can anyone give an example (or post a shader graph picture) on what nodes to use and where to place them in the graph "pipeline", in order to convert the Shadergraph from using per-pixel to vertex instead?