itsFulcrum / Unity-URP-Hair-Shader

Hair cards shader for unity universal render pipeline
Creative Commons Zero v1.0 Universal
16 stars 2 forks source link

pink material! #1

Closed nebis-software closed 3 weeks ago

nebis-software commented 1 year ago

Hi, I am trying to use your nice shader with a hair model of mine , i am using unity 2022.4 From the 3d artist i got normal map, opacity, diffuse, transparency and base color. Applying them to your shader i always get a pink material.... do you have any idea / hints to share? I really like the youtube demo and I would like to test it

Thanks! Luigi

itsFulcrum commented 1 year ago

Hard to say without more information. What errors are you seeing?

nebis-software commented 1 year ago

No errors, it is just pink... Where can I see errors? My impression is that the shader was created with a previous version of URP (13 maybe?) and Unity 2022 has URP 14

Happy to send a test project if this helps Many thanks!! Luigi

On Fri, Sep 22, 2023 at 5:33 PM itsFulcrum @.***> wrote:

Hard to say without more information. What errors are you seeing?

— Reply to this email directly, view it on GitHub https://github.com/itsFulcrum/Unity-URP-Hair-Shader/issues/1#issuecomment-1731622453, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7V2WQMD5PMPF7RW2OW7ZI3X3WVTVANCNFSM6AAAAAA5BXVOBQ . You are receiving this because you authored the thread.Message ID: @.***>

itsFulcrum commented 1 year ago

I don't have time at the moment to test it as I am on vacation. Maybe in 2 weeks. Make sure all files are in the same folder. If you select the main shader file it should give you errors in the inspector view. It's possible that the newer version of urp broke it but I'd say that's rather unlikely, I'm not aware of any mayor changes.

nebis-software commented 1 year ago

Hi, here is the error I am getting (from Inspector -> compile and show code) PS: my target platform is Android, does it make a difference?

image

Thanks!

xrr-233 commented 10 months ago

Chaging unity to the corresponding version is ok for me. My previous version was too high.

Jaimi commented 5 months ago

To fix this in 2022.3+, find this line in Hairlighting.hlsl:

uint meshRenderingLayers = GetMeshRenderingLightLayer();

And change it to look like this:

  #if UNITY_VERSION < 202220
       uint meshRenderingLayers = GetMeshRenderingLightLayer();
  #else
       uint meshRenderingLayers = GetMeshRenderingLayer();
  #endif     
itsFulcrum commented 3 weeks ago

To fix this in 2022.3+, find this line in Hairlighting.hlsl:

uint meshRenderingLayers = GetMeshRenderingLightLayer();

And change it to look like this:

  #if UNITY_VERSION < 202220
       uint meshRenderingLayers = GetMeshRenderingLightLayer();
  #else
       uint meshRenderingLayers = GetMeshRenderingLayer();
  #endif     

Closing issue since unity aparently updated their naming for no reason.