How to apply user created attributes in a V-ray shading network inside Houdini
In this tutorial I will show you how to use an attribute created in SOPS inside a V-ray shading network.
In this practical example, I have a 3D model of a woman and I will create a mask to control the blending factor between a metal material and a dirt material. The dirt material will be applied to the white part of the mask. The black part will hold the metal material. I used the measure SOP to create the curvature attribute.
Inside the material network matnet1, I created a V-ray Material Builder to adjust the mask. V-ray for Houdini offers four user data nodes to retrieve information from user created attributes. In this example I used the V-ray user float node because the mask is a scalar information and color is not needed.
Then, two colors nodes, one with a black and the other with a white value was created...
...and connected to a V-ray TexBlend node. This node is connected to the diffuse slot in a V-ray material shader to allow us to see and adjust the mask using the IPR.
In the V-ray userFloat node it is necessary to write the name of the attribute we want to read the information from. In this case, curvature.
The remap node was used to fine tune the strength of the curvature mask.
Then, we have the result in the IPR window:
After we have the mask ready, we have to use a V-ray Blend Material node to mix the metal and the dirt material. I created another V-ray material builder and put the metal and dirt material network there (I used the weathered metal and the soil material from the V-ray material Library). Then, I copied and pasted the mask network into there. The weathered metal material was connected to brdf_1, and the soil material was connected to brdf_2. The mask network was connected to weight_2 to do the blending correctly. In this example, if the mask network were connected to weight_1, the blend result would be inverted.
Then, we check the result in IPR and do the final render.