Itoo Software Forum

Author Topic: Random UVW Offsets with Gradient Texture  (Read 1045 times)


  • Newbie
  • *
  • Posts: 2
Random UVW Offsets with Gradient Texture
« on: July 17, 2016, 05:25:28 PM »

i want to make a Wood Floor. I use a texture which is big enough to cover a few planks. But it has a gradient on it, so it is not tileable!
To get variety in the planks i use the uvw xform operator and set values for Random Offset. Since my texture is not tileable i have to be careful with this values to not get visible seams on the planks.
I have set the bitmap of the texture to Real-World Scale.

For the mapping of the texture on the plank i found out there are two options.

Option 1: In 3dsMax set a UVW Map on the Object (Plank) and set it to Real-World-Scale.
Option 2: Don't set a UVW Map on the Object but in RailClone set "Apply Box Mapping" and "Real-World Map Size"

To see whats going on i used this texture as an example.

At first I worked with Option 1:
Without any Offsets applied in uvw xform i get this:

Exactly what i dont want. The edges of the texture is in the center of each plank.
After applying some calculations to put the texture edges to the object edges i get this:

Now the edges are in the bottom left edge of the plank.
With calculations for the second Random Offset Parameter i get this.

No Edges. Exactly as i want it. Except for one thing.
I made everything parametric and want to control the size of the plank with numeric parameters.

If i scale the object with the Fixed Size Parameter, my calculations don't work anymore:

However if change the size of the planks not by scaling them with Railclone but by resizing the actual object within Max it works as expected. So the calculations must be correct.

But I find this uncomfortable.

So i tried Option2.
After setting the offset so that the texture edge is at the bottom left object edge i get this, which is different from Option1.

Apparantly when the uvw map is set with 3ds max the map is set for each plank (see picture of option1), but when i apply "real world map size" in railclone the uvws are mapped differently.
I don't know how i can set random offset values here without getting visible seams.

So i hope you understand my problem and can help me with my initial problem.

Here is the scene with the working configuration of Option1, where you have to resize the object in 3ds max.

Regards Matthias

Paul Roberts

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1760
Re: Random UVW Offsets with Gradient Texture
« Reply #1 on: July 18, 2016, 11:47:23 AM »

Thanks for contacting us. To tackle this task I would take a look at the Mapping Bricks and Tiles tutorial that deals with this subject in depth. I've attached is a version of your file which has been amended using some of these techniques. Some of the changes are as follows:

- Changed the mapping on the base object so that it uses standard UVW space (not real world) and maps the whole texture to fit on the plank. This is so that we can use RailClone to adjust the mapping more easily
- The style uses two UVW XForm operators, one for the U axis and one for the Y. This is because there is only one Random Step value per node so if you have different numbers of planks in the source texture on the U and V axis you couldn't easily randomise them. By creating two nodes you get separate step controls for each axis.
- Calculate the tiling and step values by dividing 1.0 by the number of planks on the U or V axis.

I hope that helps, please let me know if you have any further questions.

Many Thanks,

Paul Roberts
iToo Software