Announcement

Collapse
No announcement yet.

Houdini hair, Vray and using texture maps to drive hair color

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Houdini hair, Vray and using texture maps to drive hair color

    Hi All,

    In Houdini 19.5 and Vray how does one assign a texture map to the Hair Next shader and get the hair to render the color of the image?

    In Vray/Maya with xgen or yeti you just plug a texture into the dye color of the Hair Next shader and the hair will render the color of the texture map.

    Here's what I've got in Houdini. What am I missing?

    Thanks


    Attached Files

  • #2
    From the top of my head you need to transfer the skin’s uvs to the hair, then you can assign texture as you would in maya. There might be some attribute promotion necassary to get it from prim attribute to point attribute - might work without.

    Comment


    • #3
      I'll need at least simple scene to check what is the problem.
      Georgy Chakarov | QA
      www.chaosgroup.com
      georgy.chakarov@chaosgroup.com

      Comment


      • #4
        Huge response incoming!


        We've been using vray in production on many creatures with udim textures into the dye color of the hair shader and it all works as expected.

        Are you working with packed .abc? If yes, then you just need your uv attribute to be promoted to live as a primitive attribute called "uv" before you write out the alembic.
        If you're not using packed .abc then you should be for various reasons.

        If you have the "uv" attribute on points or vertex and do not promote it to a primitive attribute called "uv" before writing out the .abc it will not read when rendering using the packed .abc.

        Also (this is a Houdini behavior) if you do write out the .abc with the "uv" attribute stored on primitives, and now read in the .abc, unpacking it will not show the "uv" primitive attribute anymore.
        A "uv" primitive attribute gets lost when unpacking.I believe this is due to the fact that a "uv" is not normally something you associate with primitives, but points and vertex.
        So when unpacking the .abc its lost either due to Houdini things or Alembic things. This has nothing to do with vray.

        What we do for our workflow is take the current "uv" attribute stored on the points and promote it to be stored on primitives and it's called "uv". Next, we do not delete the original point "uv" attribute, but we rename it from "uv" to "uvToPromote".

        Now we have a point attribute called uvToPromote and a primitive attribute called uv. (It's extra data to maintain but this way we have everything for the hair asset in one portable file)

        This way when we write out the .abc of our asset we have the proper uv for rendering and when we unpack for cfx shot work we can access the "uvToPromote" point attribute to re-promote to prims and rename "uv" when we output CFX shot caches.

        Alternatively, you can use the guideskin attribute lookup sop to transfer uvs from the skin back to hair curves as needed instead of storing the point "uv" renamed to "uvToPromote"
        But we found that the versions of the grooms and mdl skin uv's was easier to become out of sync.

        I hope this made sense, I was closely involved with the grooming pipeline here and vray does work for hair quite well.

        Some big gotchas to know when doing shot work with hair and vray (and chaos is aware of these issues already)

        One is motion blur discrepancies with the skin and hair.
        We currently generate a .abc sequence per frame for our animated grooms. We calculate velocity and store it on the points before writing out the .abc. For the skin, we'd also calculate velocity but write out a single .abc for the anim.
        This was an issue though as the single .abc velocity attribute was being ignored even when specifying to use it. So instead vray was doing its own linear interpolation for motion blur with the skin and then reading the pre-calculated velocity for the hair.
        This caused the motion blur to not align on some frames.To solve for this we just calculate velocity the same way for the hair and skin and then write out the .abc sequence per frame for both the hair and the skin.
        Now vray will read the motion blur the same way and it all aligns.

        Next gothca is only read in and write out the files in the same scale, if you transform the packed .abc of the hair, all the attributes get broken and will not render with vray correctly. Even if you tell the transform sop to exclude those attributes, it doesn't matter.

        We work in the houdini standard of treating each unit as a meter.

        Do not have both a point and primitive attribute called the same. ie do not have a point attribute called "uv" and the primitive attribute called "uv" before writing the .abc. It will break many things. That's why we rename our point attribute to "uvToPromote"

        Lastly do not confuse the attribute called "primuv" as the same thing as an attribute called "uv" on primitives, They are very different things.



        I hope this is helpful and it may seem like a lot to digest, but this works. Good luck.


        David Eschrich
        Global Head of 3d
        Zoic Studios

        Comment


        • #5
          Hi David,

          Wow, thanks for the detailed response. I'll try your suggestions and reply in a bit!

          Thanks

          Comment


          • #6
            Hi Jackson_lukas , sorry for my late reply. I somehow missed your e-mail. Reason you don't have uvs on hair is that the uv is that the uv attribute is not set in the hairgen sop nodes. Go to "Attribute & Appearance" tab of the hairgen SOP and add uv in "Vertex Attributes" parameter in "Source Attribute Transfer" group for my late reply. I somehow missed your e-mail.

            Click image for larger version

Name:	houdinifx_oyQQafRPak.png
Views:	239
Size:	903.9 KB
ID:	1191904
            Georgy Chakarov | QA
            www.chaosgroup.com
            georgy.chakarov@chaosgroup.com

            Comment


            • #7

              It's worth mentioning for others that come across this post, if you rely on the hairgen node to transfer the uvs, even though you are choosing transfer vertex uvs, just know that the uvs from the hairgen will now be stored as a primitive attribute on the hair not vertex.

              This is the part people seem to get caught up on. UV attributes for hair have to be on primitives.

              ​​​Click image for larger version

Name:	image.png
Views:	203
Size:	367.5 KB
ID:	1191965

              There will be many times that artists are given a file of just hair curves, like an alembic of the final groom from a client. You might not have the .hip with the hairgen setup etc. Thats ok.
              You can always transfer uvs from an unpacked skin mesh to unpacked hair curves later on as I mentioned above with the guide skin attribute lookup sop.

              Just specify uv in the vertex attribute like Georgy mentioned using the hairgen node but this time using the guide skin attribute lookup sop.
              Your unpacked hair will now have the correct uv attribute on primitives

              Click image for larger version

Name:	image.png
Views:	186
Size:	467.0 KB
ID:	1191966

              I've seen so much confusion about this with many people which is why I felt it worth mentioning this info here.

              David Eschrich
              Global Head of 3d
              Zoic Studios​

              Comment

              Working...
              X