Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

How to replicate the LWRP standard shader in ShaderGraph?

Discussion in 'Shaders' started by col000r, Jul 4, 2018.

  1. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    665
    I'm trying to replicate the LWRP standard shader, so I can add some features on top (outlines, etc.), but apparently it's not as easy as feeding textures into the main node. What am I missing? What other magic is going on in there? Or is there maybe even a better way to add stuff on top of another shader?

    LWRP Standard on the left, my attempt on the right:


    This is the graph:
     
    P_Jong likes this.
  2. space928

    space928

    Joined:
    Jun 11, 2015
    Posts:
    21
    Just from the picture, I can tell that the normals are wrong, I've never used the shader graph before but one suggestion I have would be to see if there is an UnpackNormal node (or something like that) and attach it between the normal map slot and the normal map sampler. Otherwise do some more testing by creating 2 cubes, one with the default material on it and another with your shader on it (with no normal map specified/a really subtle normal map (whichever makes it look weird)). In the scene view make it display the normals and take a screenshot of both cubes side by side and post it here.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    8,688
    You appear to be doing everything correct. I believe this is a bug with the Shader Graph itself. It does not properly handle meshes that have been scaled.
     
  4. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    665
    2 years later, tried again, seems to work now!

     
  5. SynergyAssets

    SynergyAssets

    Joined:
    Nov 19, 2019
    Posts:
    1
    Looks nice! Can you share the full shader?
     
unityunity