Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: CF5371 on July 17, 2016, 05:25:28 PM

Title: Random UVW Offsets with Gradient Texture
Post by: CF5371 on July 17, 2016, 05:25:28 PM
Hello,

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.
(https://s31.postimg.org/b1gx8jf57/texture1.jpg)

At first I worked with Option 1:
Without any Offsets applied in uvw xform i get this:
(https://s31.postimg.org/u9ttxf4fv/Option1_No_Offsets.jpg)
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:
(https://s31.postimg.org/3qd3k07wb/Option1_Offsets1.jpg)
Now the edges are in the bottom left edge of the plank.
With calculations for the second Random Offset Parameter i get this.
(https://s32.postimg.org/gpsddltfp/Option1_Offsets2.jpg)
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:
(https://s32.postimg.org/6v9b47qp1/Option1_Offsets3.jpg)
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.
(https://s31.postimg.org/3rvrlqpm3/Option1_Offsets4.jpg)
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.
(https://s32.postimg.org/86itd37p1/Option2_Offsets1.jpg)
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
Title: Re: Random UVW Offsets with Gradient Texture
Post by: Paul Roberts on July 18, 2016, 11:47:23 AM
Hi,

Thanks for contacting us. To tackle this task I would take a look at the Mapping Bricks and Tiles tutorial (http://www.itoosoft.com/tutorials/tutorial_uvw_xform.php?back=page%3D1) 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.

(http://i.imgur.com/SrH7XWA.png)

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

Many Thanks,

Paul