Search Unity

Bug Pathtracing and 3dsMax Physical Material doesnt work together

Discussion in 'High Definition Render Pipeline' started by newguy123, Oct 18, 2021.

  1. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Hi guys

    For a bidirectional workflow from Max to Unity, Unity to Max, Max back to Unity, the 3ds Max Physical Material does not work with Pathtracing in HDRP 12. It works fine with Raytracing it seems, but not with Pathtracing.

    Can we get a fix for this please?
     
  2. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    hey, as you might have seen, 3dsMax Physical material in Unity is nothing else than a shader graph using stacklit as a base.
    Since Pathtracer supports stacklit, this should not be a problem aside from the few node unsupported in raytracing (mostly derivative like normals from texture.. etc), which the default graph uses by the way.

    However, I had a quick look and there is one exposed parameter (coat weight which controls coat mask value) when equal to zero that will create a black render (like the material's not supported).
    Putting anything above zero fixes the problem so while we have a look, you can try and see if this workaround works on your side.

    Thanks for the feedback
     
  3. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Woohoo thanks @chap-unity I can confirm making coat weight 0.1, "fixes" the problem of black render with pathtracing. This is awesome!

    So then are you saying you guys will do somehting your end so it's fixed in the future and I won't have to increase coat weight?
     
  4. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    I'll also add though that the UI for the Physical Material is extremely slow, compared to the HDRP/Lit
    quickest way to test is simply scrolling the slider on the side up/down
    upload_2021-10-18_16-44-13.png
     
  5. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    Yes something's not right. A bug has been created and is being investigated.

    I'll have a look for the UI one while we're at it.
     
    newguy123 likes this.
  6. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Out of interesting @chap-unity when I use pathtracing in any foilage with HDRP/Lit shaders and a diffusion profile, a lot of the foilage renders much darker, some of it almost black, is this perhaps related?

    Same thing happens with Speedtree models with speedtree materials, with pathtracing they render almost black
     
  7. chap-unity

    chap-unity

    Unity Technologies

    Joined:
    Nov 4, 2019
    Posts:
    766
    The previous issue have been fixed with this PR and robustness have been improved for the stacklit support as a whole thanks to your feedback.

    For speed tree, this is actually different but still interesting. It's not black because the material is unsupported, it's black because the normal data are most probably null.

    Speed tree uses a shader graph with a lit master node and this graph uses Custom Interpolator to pass data (Normal / Tangeant / Bitangent in world space) from the vertex to the pixel shader stage. Those custom interpolator doesn't seem to be supported with pathtracer and the doc hasn't been updated yet.

    I'm no expert but in this case, using normal / tangent / bitangent nodes instead of these interpolators seem to be producing the same result and fix the path tracer black issue. So while we investigate if there is proper reaons on why these are used, there's a workaround.

    upload_2021-10-20_19-20-57.png
     
    newguy123 likes this.
  8. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Awesome! Thanks for the quick service!

    Thanks, appreciate the info.