Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Writing a vert/frag physically based shader?

Discussion in 'Shaders' started by Eliotz, Jun 26, 2016.

  1. Eliotz

    Eliotz

    Joined:
    Jul 18, 2015
    Posts:
    81
    Hi everyone! I'm trying to write my own physically based shader and that's because I want to implement some additional effects which won't be possible to achieve using shaderLab language, but the only problem I have is that I just cannot find information on how physically based shaders are constructed and the correct equations and stuff.

    You can find how blinn-phong model is constructed pretty much everywhere, but that doesn't look like the case for PBS.

    So to all you smart people, I'm gonna need your help on this one!
     
  2. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,469
    search for Sebastian Laguarde's blog, selfshadow's blog and Filmicworld's blog, you should also find reference from there toward other one
     
  3. Eliotz

    Eliotz

    Joined:
    Jul 18, 2015
    Posts:
    81
    Thanks Bro!
     
  4. customphase

    customphase

    Joined:
    Aug 19, 2012
    Posts:
    243
    Why write it yourself from scratch? You can make copies of UnityStandardCore.cginc and UnityStandardInput.cginc from Unity 5\Editor\Data\CGIncludes folder, then download the source for the standard shader, make copy of that and just make it so that it uses your duplicated cgincs instead of original one. Then inside of cgincs you can add whatever functionality you can imagine
     
    Last edited: Jun 27, 2016