Search Unity

Feedback Shadergraph Somewhat Missing The Point Of Lwrp?

Discussion in 'Shader Graph' started by Tartiflette, Apr 10, 2019.

  1. Tartiflette

    Tartiflette

    Joined:
    Apr 10, 2015
    Posts:
    84
    I've been playing a bit with the shadergraph in the LWRP, and I feel like in its current state it's quite counter productive. LWRP was meant to be targeted at low-end platforms but shadergraph pushes the user towards the least efficient way of writing shaders: no proper conditionals, everything is happening at the fragment level, no explicit control over the operation precision, and some nodes should never ever be used on mobile (i.e. noises) but the average user has no way to know it.

    I understand that it's great to empower artists who would not want to dive into shader programming, but in my opinion, this is pretty much why Unreal has had such atrocious performance on mobile. Having analysed a few auto-generated UE shaders in the past (from some of their biggest games), I would be very sad to see Unity games heading the same way.
     
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,982
    I would just avoid it and write by hand if you know how to write shaders. I dont think shadergraph is meant to be better than authoring a shader manually
     
  3. Tartiflette

    Tartiflette

    Joined:
    Apr 10, 2015
    Posts:
    84
    There is no equivalent of surface shaders in lwrp and as far as I know you have to use the graph.
     
  4. Rafarel

    Rafarel

    Joined:
    Jul 21, 2017
    Posts:
    199
  5. Tartiflette

    Tartiflette

    Joined:
    Apr 10, 2015
    Posts:
    84
    Nope, not even in France anymore, just love the word :)
     
    Rafarel likes this.
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    While true, if you look at the generated shader code from a basic Shader Graph you'll see the LWRP's shaders are for the most part pretty simple.
     
  7. alexandral_unity

    alexandral_unity

    Unity Technologies

    Joined:
    Jun 18, 2018
    Posts:
    163
    @bgolus has the right idea.
    For the time being, while we work on adding more performance optimizations, you can build your shader with the graph and use the generated shader code as a base. You can then optimize your shader as desired (since you seem fairly knowledgable in shaders in the first place) and have the template structure for LWRP shaders already constructed for you.
    I know it's the not the ideal workflow but it should get you to the end point you want while we're still working on the tool itself.
     
  8. Tartiflette

    Tartiflette

    Joined:
    Apr 10, 2015
    Posts:
    84
    That makes sense, I'll give it a try.