Announcement

Collapse
No announcement yet.

(Resolved) Need help randomizing texture

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

  • (Resolved) Need help randomizing texture

    Hi. I'm learning Houdini by, among other things, doing a boulder/rock surface HDA. The HDA outputs one object with X amount of rocks and I'd like to randomize the main texture (as in the texture file) in the material, to create variety. I've got access to convex/concave masks etc from Houdini, but I can't figure out how to randomize textures in VRay 4.3. I know it's a new feature in VRay 5, but I need to use stable versions. Can I give each rock/"island" some sort of id and access that in the material? Thanks.

    Click image for larger version  Name:	stenar1.png Views:	129 Size:	354.8 KB ID:	1094633
    Last edited by Gosho.Genchev; 21-12-2020, 03:21 AM.

  • #2
    Hi Monkeybrother,

    There are several things you can do that, check this threads:

    https://forums.chaosgroup.com/forum/...98#post1071698

    https://forums.chaosgroup.com/forum/...53#post1089553

    The multiIdtext is pretty handy to assign different textures, and instead of driving it with the attribute, you can use the sampler node to get the "random by poly shel" instead. Also, for generating random values you now have the "random" node which is super handy for this kind of things.
    For texture mapping variation you you can just use the "tri-planar mapping" node and use the randomisation nodes in it.

    Best,
    David.
    David Anastácio // Accenture Song - VFX
    https://www.accenture.com/us-en/serv...visual-effects

    Comment


    • #3
      Originally posted by david.anastacio View Post
      Hi Monkeybrother,

      There are several things you can do that, check this threads:

      https://forums.chaosgroup.com/forum/...98#post1071698

      https://forums.chaosgroup.com/forum/...53#post1089553

      The multiIdtext is pretty handy to assign different textures, and instead of driving it with the attribute, you can use the sampler node to get the "random by poly shel" instead. Also, for generating random values you now have the "random" node which is super handy for this kind of things.
      For texture mapping variation you you can just use the "tri-planar mapping" node and use the randomisation nodes in it.

      Best,
      David.
      Thank you! That put me on the right path. Random texture works, but I just can't get tri-planar randomness to work, got any examples? The "randomness" seems to treat all rocks as one object, which makes textures look repeated. My HDA outputs packed geo with a primitive for each rock, and a group for each - can I use them to randomize per primitive?

      Comment


      • #4
        Hello Monkeybrother , yes you could use path attribute in TexPatternID which could control TexMult, or to combine UVWGenRandomizer with TexTriplanar. Check the example.
        Attached Files
        Georgy Chakarov | QA
        www.chaosgroup.com
        georgy.chakarov@chaosgroup.com

        Comment


        • #5
          Originally posted by chakarov View Post
          Hello Monkeybrother , yes you could use path attribute in TexPatternID which could control TexMult, or to combine UVWGenRandomizer with TexTriplanar. Check the example.
          Thanks. My problem is that I need to use VRay 4.3 for now, until we start using VRay 5, so when I open your .hip I get a lot of errors and I can't find any "random" node when I search for it.

          Comment


          • #6
            Sorry my mistake, I'll check if I cant find out a solution
            Georgy Chakarov | QA
            www.chaosgroup.com
            georgy.chakarov@chaosgroup.com

            Comment


            • #7
              Try this one.
              Attached Files
              Georgy Chakarov | QA
              www.chaosgroup.com
              georgy.chakarov@chaosgroup.com

              Comment


              • #8
                Originally posted by chakarov View Post
                Try this one.
                Thank you! Thanks for taking the time.

                Comment


                • #9
                  Originally posted by chakarov View Post
                  Hello Monkeybrother , yes you could use path attribute in TexPatternID which could control TexMult, or to combine UVWGenRandomizer with TexTriplanar. Check the example.
                  This not exactly the same as a true random distribution, using the pattern node limits you to having to write the name in the path you want to use. Imagine you are adding some more objects/paths to your scene, the pattern will ignore them. There should be an option to generate a random integer out of the path attribute, or a random_by_path in the output of the "sampler node.

                  I would advise using the method described in my first link, creating a random integer value to each object and using that attribute as the multiTxt "id_gen_txt" source.

                  Best,
                  David.
                  David Anastácio // Accenture Song - VFX
                  https://www.accenture.com/us-en/serv...visual-effects

                  Comment


                  • #10
                    Originally posted by david.anastacio View Post

                    This not exactly the same as a true random distribution, using the pattern node limits you to having to write the name in the path you want to use. Imagine you are adding some more objects/paths to your scene, the pattern will ignore them. There should be an option to generate a random integer out of the path attribute, or a random_by_path in the output of the "sampler node.

                    I would advise using the method described in my first link, creating a random integer value to each object and using that attribute as the multiTxt "id_gen_txt" source.

                    Best,
                    David.
                    Yes, your post helped me get the solution. The later posts were more about triplanar mapping. Thanks again.

                    Comment


                    • #11
                      Originally posted by Monkeybrother View Post

                      Yes, your post helped me get the solution. The later posts were more about triplanar mapping. Thanks again.
                      You can use the same "id" on the triplanar to drive the randomization, set the "Random Mode" to "User Attribute" and use your integer attribute there.
                      David Anastácio // Accenture Song - VFX
                      https://www.accenture.com/us-en/serv...visual-effects

                      Comment

                      Working...
                      X