This page offers a tutorial on how to set custom data as UVs in V-Ray for Houdini.
In Houdini you can use two types of data as UV coordinates for textures – those are the Float and Color attributes. They can be used directly or adjusted in the shader.
In this tutorial we'll show both ways.
Float Data as UV Coordinates
First step is to create a grid object and dive into it. For easier generation of the UV coordinates and predictable behavior, we use UV Texture SOP, which later will be deleted.
Using the Attribute Wrangle SOP, transfer the data of the UV vector attribute to new float attributes.
Create atr_time attribute in order to animate the UV values later on. All attributes are saved in class Point.
We use the Null SOP only for clarity in the node scheme.
Assign a texture in the File field of the V-Ray Image File VOP.
Change the UV Type to Explicit in the UV tab.
This changes the type of the V-Ray Image File VOP and we can connect the desired attributes as UV data.
Create V-Ray User Float VOP.
In the Attribute field write the name of the attribute you are using. Do this for both the uv_u and the uv_v attributes.
These steps are enough for V-Ray to display a texture in the final render.
Using the V-Ray Float Operations, we can mathematically manipulate the values of the u and v coordinates.
Using the V-Ray User Float VOP add atr_time, with the help of which we can animate the u component in time.
For the change of the v component, we use V-Ray Float VOP, which for now, we'll leave with a value of 0.
Connect the Sum output with the respective u and v input. See the node scheme.
This way we change the component along by changing the frame.
The 4-th frame rendered.
Change the v coordinate value to see the change in the render.
Color Data as UV Coordinates
Create a grid object and dive into it. Use the Attribute Wrangle to generate @Cd attribute from @P.x and @P.z for each point.
In the mat network create V-Ray Material Builder and dive into it.
Connect the V-Ray Image File with the diffuse input of the V-Ray Material VOP.
Then, set a texture in the File field of the V-Ray Image File VOP.
In the UV tab change the uv Type to Explicit. This changes the type of the V-Ray Image File VOP and we can connect the desired attributes as uv data.
Create V-Ray User Color VOP and V-Ray Color Operations VOP.
Connect the V-Ray User Color VOP to the color_a input of the V-Ray Color Operations VOP. And red and green outputs of V-Ray Color Operations VOP to u and v input of the V-Ray Image File VOP. Leave the Output Mode to Result A.
Now V-Ray can display a texture in the final render.
Let's try and put a V-Ray ColorCorrect VOP between the V-Ray User Color VOP and V-Ray Color Operations.
Changing the values of the Red and Green Offset of the RGBA Channel Mapping, we can manipulate the u and v components.
And here is the resulting render.