Search Unity

Passing two normals to lighting function

Discussion in 'Shaders' started by Deleted User, Aug 25, 2017.

  1. Deleted User

    Deleted User

    Guest

    In a shaderlab shader with a custom lighting model I'd like to pass two normals from the surf function to the lighting function. One normal has the normal map applied and the second does not.

    My issue is that between the surf and lighting function unity transforms the vector named "Normal" from tangent to world space, but doesn't do this for any other vectors.

    How can I also transform my second normal from tangent to world space? Naming it similarly (ie, Normal2) doesn't seem to work and it doesn't appear that I have access to tangent space ( IN.tSpace0, IN.tSpace1, IN.tSpace2) in either the surface or lighting function.

    Thanks,
    Erin