(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.

Hi @Monkeybrother ,

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

https://forums.chaosgroup.com/forum/v-ray-for-houdini-forums/v-ray-for-houdini-problems/1054083-mutli-id-texture-don-t-seem-to-work-at-all?p=1071698#post1071698

https://forums.chaosgroup.com/forum/v-ray-for-houdini-forums/v-ray-for-houdini-general/1089548-resolved-hue-shift-by-attribute?p=1089553#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?

Hello @Monkeybrother , yes you could use path attribute in TexPatternID which could control TexMult, or to combine UVWGenRandomizer with TexTriplanar. Check the example.
randomize.zip (192 KB)

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.

Sorry my mistake, I’ll check if I cant find out a solution

Try this one.
texRandomize.zip (195 KB)

Thank you! Thanks for taking the time.

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.

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.