Search Unity

LWRP Surfase shaderss Custom

Discussion in 'Shaders' started by imaewyn, Aug 3, 2019.

  1. imaewyn

    imaewyn

    Joined:
    Apr 23, 2016
    Posts:
    211
    Hello, I'm trying to upgrate my project to lwrp but I have some custom shaders wchich using StandardSpecular lighting model. And this shaders don't interact with lighting after adding lwrp.
    Need I rewrite surface shaders to fragment shaders and where can I get fragment shader source code for lwrp?
     
    Last edited: Aug 3, 2019
  2. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    201
    Standards shaders (non LWRP or HDRP) are not compatible with LWRD or HDRP, those have their own shaders.

    You would need to re-write your custom shaders for LWRP, i would recommend using shader graph.
     
    imaewyn likes this.
  3. imaewyn

    imaewyn

    Joined:
    Apr 23, 2016
    Posts:
    211
    What if I passing my custom data to shader using color or tangent. Then In surface shader I trying my own functions. Shader graph can do this?
     
  4. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    201
    Not sure what you mean by custom data being color or tangent, but if you mean that you are using vertex colors and tangents, I'm pretty sure you can get that in shader graph, as for custom functions, definitely can in unity 2019.2.

    If you mean that you are passing custom data from a c# script, then again you can just define an exposed property in shader graph with the name you are using in c# to get it.
     
  5. imaewyn

    imaewyn

    Joined:
    Apr 23, 2016
    Posts:
    211
    F. E. I have small texture, where I packed data. And I have color for each vertex which is number of texel form small texture. And In shader I extract this data.