Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Daz3d's HDRP shader is broken

Discussion in 'Shaders' started by Nodice, Dec 31, 2020.

  1. Nodice

    Nodice

    Joined:
    Apr 14, 2020
    Posts:
    6
    Daz3d has a free DazToUnity system that works, but their skin shader is broken. It was working about 2 months ago and I'm not sure if it was a change to unity or Daz's scripts that broke it.

    The error is: Shader error in 'Daz3D/IrayUberSkin': maximum ps_5_0 sampler register index (16) exceeded at line 5939 (on d3d11) on compile.

    Anyone with more Shader Knowledge than me (Everyone), chime in to what is needed to fix it?

    I've attached the Shaders as they are available free from Daz3d.
     

    Attached Files:

  2. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,117
    There are 16 Texture Sample nodes in that graph. The limit as the error mentions is 16 samplers for shader model 5.0.

    Unity uses a few of its own samplers when shaders compile that support lightmapping (and maybe some other stuff now in HDRP), so usually the limit for your own shaders is around 13 samplers in Unity when making a standard fully lit shader.

    To get around this you instead want to define your own Samplers to use for multiple Sample Texture 2D nodes, instead of letting each Sample Texture node use its own Sampler that is generated using the (Wrap/Filter Mode) options on the Texture's import settings.

    Create a Sampler State and plug it into a bunch of the Sample Texture 2D nodes' Sample(SS) slots.
     
  3. Nodice

    Nodice

    Joined:
    Apr 14, 2020
    Posts:
    6
    Since this is my first time working with shaders or the shader graph i will have to reread what you wrote a few times and learn each part. I greatly appreciate your help. At least I have an action plan.
     
  4. Nodice

    Nodice

    Joined:
    Apr 14, 2020
    Posts:
    6
    That worked! Well at least after adding the same sampler state to 4 sample texture 2d nodes the shader compiled.

    You are truely awesome Invertex
     
    Invertex likes this.
  5. Nodice

    Nodice

    Joined:
    Apr 14, 2020
    Posts:
    6
    Here is my fixed version.
     

    Attached Files:

    Treecrotch likes this.
  6. Treecrotch

    Treecrotch

    Joined:
    Dec 30, 2019
    Posts:
    166
    Quality post!

    Is daz a good resource? Good characters and work with unity? Years ago i remember they had some nice stuff but I thought the license was weird or something, limited, couldn't use in games? Did/do they also own poser?

    I might be wrong about all that I wasn't working with unity at the time but I recall there were some kind of strings attached with daz
     
  7. Nodice

    Nodice

    Joined:
    Apr 14, 2020
    Posts:
    6
    Daz3d I think about a year ago they added the interactive license. It's a different fee depending on the asset. Majority of the time it's $50, but other times they put it on sale. Check for Bundled deals like this one. Only $9 for the interactive. https://www.daz3d.com/tara-8-world-adventurer-mega-bundle.

    In my opinion their human and humanoid models you can't beat for the price.

    The shader I mention in this post is part of their Daz To Blender plugin for Daz Studio. Using it, it will export Humanoid Rigged Characters to Unity HDRP. It has a collection of scripts for Unity that converts the Daz based Materials into high quality SSS materials.

    If you are targeting another rendering pipline, I would probably start a Utility project in HDRP, export from Daz into that project and then export the asset to import into another project and then fix the shaders and materials.
     
    Treecrotch likes this.
unityunity