Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page offers a tutorial on how to set custom data as UVs in V-Ray for Houdini.

 


Overview

...

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.


To download scene files: 

UI Button
colorblue
newWindowtrue
titleDownload Scene Files
urlhttps://docs.chaos.com/display/VRAYHOUDINI/Custom+Data+as+UV+Coordinates?preview=/44733204/44733205/custom%20data%20as%20UVs.rar


...


Want to follow along but don’t have a license?:

UI Button
colorblue
newWindowtrue
icondownload
titleDownload Free Trial
urlhttps://www.chaos.com/free-trial?utm_campaign=docs-tutorials&utm_medium=website&utm_source=docs.chaos.com
 



Float Data as UV Coordinates

...

Section
Column
width55%

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.

 
Column
width5%

Column
width40%

 

 


...


Section
Column
width55%

In the mat network create V-Ray Material Builder and dive into it.

Column
width5%

 


Column
width40%

 

...


...


Section
Column
width55%

Connect the V-Ray Image File to the Diffuse input slot of the V-Ray Material VOP.

 
Column
width5%


Column
width40%

...

 


...


Section
Column
width55%

Assign a texture in the File field of the V-Ray Image File VOP.

Column
width5%

 


Column
width40%

 

...


...


Section
Column
width55%

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.

Column
width5%

 


Column
width40%

...

 


...


Section
Column
width55%

Create V-Ray User Float VOP.

 
Column
width5%


Column
width40%

 

...


...


Section
Column
width55%

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.

Column
width5%

 


Column
width40%

 

 


...


These steps are enough for V-Ray to display a texture in the final render.

 


 

 


...


Section
Column
width55%

Using the V-Ray Float Operations, we can mathematically manipulate the values of the u and v coordinates.

 
Column
width5%


Column
width40%

 

 


...


Section
Column
width55%

Using the V-Ray User Float VOP add atr_time, with the help of which we can animate the u component in time.

 
Column
width5%


Column
width40%

 

 


...


Section
Column
width55%

For the change of the v component, we use V-Ray Float VOP, which for now, we'll leave with a value of 0.

 
Column
width5%


Column
width40%

 

...


...


Section
Column
width55%

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.

 
Column
width5%


Column
width40%

 


...

The 4-th frame rendered.

 


...

Change the v coordinate value to see the change in the render.

 


 

 



Color Data as UV Coordinates

...

Section
Column
width55%

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.

Column
width5%

 


Column
width40%

...

 


...


Section
Column
width55%

In the mat network create V-Ray Material Builder and dive into it.

Column
width5%

 


Column
width40%

 

...


...


Section
Column
width55%

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.

 
Column
width5%


Column
width40%

...

 


...


Section
Column
width55%

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.

Column
width5%

 


Column
width40%

 

 


...


Section
Column
width55%

Create V-Ray User Color VOP and V-Ray Color Operations VOP.

 
Column
width5%


Column
width40%

 

...


...


Section
Column
width55%

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.

Column
width5%

 


Column
width40%

 


...

Now V-Ray can display a texture in the final render. 


 

 


...


Section
Column
width55%

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.

 
Column
width5%


Column
width40%

 


...

And here is the resulting render.