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

Blacksmith hair pink

Discussion in 'Shaders' started by scarpelius, Sep 23, 2016.

  1. scarpelius

    scarpelius

    Joined:
    Aug 19, 2007
    Posts:
    966
    I've tried to look at the blacksmith hair example, https://www.assetstore.unity3d.com/en/#!/content/39945, but it gives me an error after importing it and the hair is pink:


    Shader error in 'Volund/Standard Hair': undeclared identifier 'samplerunity_SpecCube1' at Assets/Features/Hair/Hair_UnityStandardCore.cginc(379) (on d3d11)

    Compiling Vertex program with DIRECTIONAL LIGHTMAP_OFF DYNAMICLIGHTMAP_OFF DBG_NONE
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING

    I've attached the shader file just in case. Any help will be greatly appreciated.
    P/S. Forgot to mention: Unity 5.4.1f Windows 7
     

    Attached Files:

  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,448
    Copied from the Comments section:
    I haven't tried it myself though.
     
    rogaroga likes this.
  3. scarpelius

    scarpelius

    Joined:
    Aug 19, 2007
    Posts:
    966
    Thanks, I tried that last night after the earthquake, but I was to tired to remember to update this post.
    It does work.
     
  4. rogaroga

    rogaroga

    Joined:
    Oct 30, 2016
    Posts:
    10
    Anyone coming accross this in Feb 2017 or later, I had this issue, and the code fix stated above is now in a different file, at least it was for me. I found it here:

    File: Hair_setup.cginc
    Line: 124

    Code to change same as post above:
    UNITY_PASS_TEXCUBE(unity_SpecCube1)
    to:
    UNITY_PASS_TEXCUBE_SAMPLER(unity_SpecCube1,unity_SpecCube0)