Search Unity

Creating a shader bassed on the Standard(Specular setup)

Discussion in 'Shaders' started by MaxPowerGames, Sep 3, 2015.

  1. MaxPowerGames

    MaxPowerGames

    Joined:
    Aug 19, 2015
    Posts:
    8
    Hey all,
    I'm trying to create a PBR shader based off Standard(Specular setup) that uses Specular instead of _Metallic.
    I want to be able to modify the specular so I can have a falloff on the reflection.

    Is there somewhere I could find the source file for this standard shader? Or how can I modify the standard one to accept o.Specular.

    I assume I need a different lighting model to #pragma surface surf Standard fullforwardshadows but have no idea where to find the one I need.

    Regards,
    Lucas
     
  2. MaxPowerGames

    MaxPowerGames

    Joined:
    Aug 19, 2015
    Posts:
    8
    As usual I spend hours trying to find an answer and as soon as I post the question on here I find it.

    If anyone is interested this is how I did it.

    replaced all referenced to _Metallic with _Specular

    changed #pragma surface surf Standard fullforwardshadows
    to #pragma surface surf StandardSpecular fullforwardshadows

    changed void surf (Input IN, inout SurfaceOutputStandard o)
    to void surf (Input IN, inout SurfaceOutputStandardSpecular o)

    removed o.Metallic = _Metallic;
    added o.Specular = _Specular