Announcement

Collapse
No announcement yet.

xGen Strays [mutant hair]

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

  • xGen Strays [mutant hair]

    is there a way to get stray hairs passed from xGen to the vray hair shader..?
    id like to create mutant hair like in shave...

  • #2
    Well you could make stray hairs (say 5%) within a description like explained in this tutorial - https://www.youtube.com/watch?v=4Q_fNjyTGmY
    But all the hairs will share the same material - the one of the description.
    What you could do is make 2 descriptions on the same geometry and make the stray hairs only in one of the 2 descriptions and assign it a different hair shader.
    V-Ray for Maya developer

    Comment


    • #3
      But then you loose the flexibility of having stray hairs. You would need to change your description on 2 places everytime you change stuff.
      Having the ability to for example output stray hairs as white and normal hairs as black through the HairSampler would be awesome. Then you can get the shading variation you want for the stray hairs, but keep it in 1 hair shader (or output it as a mask for a blend between 2 hair shaders).

      But that info might not be accessible through xgen for other renderers?
      Im thinking of something like a stray_color shader parameter could be added that then gets picked up by the hairsampler.
      CG Artist - RnD and CG Supervision at Industriromantik

      Comment


      • #4
        to geht this working we would need to pass the hair id and face id to the shader..

        $id
        $faceid

        Comment


        • #5
          I sort of did what you wanted - I assigned a switch mtl to the description and on slots 0/1 - 2 different materials.
          Then on the switch parameter of the switch mtl I assigned VRayHairSampler.
          Then I added the "root_color" custom shader parameter as color and gave it the following expression: "[stray(), stray(), stray()]" which essentially outputs white and black colors based on what stray() returns (which can be configured as a percentage from XGen/Descriptions/Set Stray Percentage...)

          This is the best I could think of - here is a pic of the result with 10% set as stray (and more xgen noise for them)
          Click image for larger version

Name:	colored_strays.png
Views:	1
Size:	149.5 KB
ID:	858344

          This way though you will not be able to color each hair individually with root_color/tip_color with a hair sampler because it will be already used to distinguish stray/non-stray hairs...

          FSGFX - As far as hair/face id's are concerned - I have no ideas.
          Last edited by viktor.kirilov; 17-09-2015, 04:00 AM.
          V-Ray for Maya developer

          Comment


          • #6
            Originally posted by viktor.kirilov View Post
            This way though you will not be able to color each hair individually with root_color/tip_color with a hair sampler because it will be already used to distinguish stray/non-stray hairs...

            FSGFX - As far as hair/face id's are concerned - I have no ideas.
            thanks... but thats no solution here...
            i would need to use root - tip color + stray mutant

            Comment


            • #7
              Hi Viktor do you have access to the maya beta?

              There is a thread running regarding my issue here.
              A lot of god infos in there.

              Comment


              • #8
                Oh wow - I am a bit embarrassed
                Indeed there is no need for silly switch materials with hair sampler and wasting the root/tip colors like I did...

                All you need to do is to pass an expression to the root/tip colors like this:
                stray() ? [1,0,0] : [0,1,0]

                And this will give red to strays and green to non-strays. You could also read from maps instead of hardcoding colors like this - but this is in the SeExpr language realm which is used for all xgen expressions
                V-Ray for Maya developer

                Comment


                • #9
                  hehe... now my new idea...

                  could we have an custom attribute for the hair shader to read in the stray data via the hairsampler node.?
                  this would be much easier to have some sliders in the hair shader to color the stray hair...


                  turn on stray in xgen
                  create attribute on vray hair shader

                  Comment


                  • #10
                    I don't think this would be possible in the near (or even far) future.
                    V-Ray for Maya developer

                    Comment


                    • #11
                      thanks Viktor...

                      Comment


                      • #12
                        is there any way to read in custom attributes with the vrayhairsampler node...
                        not just the hardcoded root_color and tip_color..?
                        i want use those two and feed them into a ramp node....

                        at the moment the sampler node will read in both at the same time...
                        but i would need one for root_color and an other one for tip_color...
                        Last edited by FSGFX; 15-02-2016, 01:48 PM.

                        Comment


                        • #13
                          VRayUserColor is implemented in the nightlies and the next SP.
                          V-Ray/PhoenixFD for Maya developer

                          Comment


                          • #14
                            great thats what i need...!

                            Comment

                            Working...
                            X