Hi ..
I have a group of geometry pieces that I unwrap. then, in a for each loop, I want to offset each piece's UVs by a random value with rand(1) in u and v.
But that does not work correctly. There is some random transformation going on, but not for each piece individually (that's why I assign it in the for each sop), but ALL pieces get the same random value assigned ('globally').
What could be the issue ?
Any input ?
Thanks..
m.
random UV transform
3498 4 1- deadalvs
- Member
- 196 posts
- Joined: 8月 2011
- Offline
- Dmitry Shurov
- Member
- 3 posts
- Joined: 1月 2014
- Offline
Actually, rand(1) will always return you the same value because of its deterministic nature. To get different random values you must use different seeds. In your case, something like rand(a*u) and rand(b*v) may be reasonable, where a and b are any real numbers of your choice, except zero. You can try a=b=1 as a starting point.
- deadalvs
- Member
- 196 posts
- Joined: 8月 2011
- Offline
- dan.baciu
- Member
- 30 posts
- Joined: 9月 2010
- Offline
In a for each loop you can use an expression like rand(stamp(“../”, “FORVALUE”, 0)*733.73).
This way the rand function will generate a random offset using the iteration number times some other number (for variation) as a seed.
So you can have for U rand(stamp(“../”, “FORVALUE”, 0)*733.73)
and for V rand(stamp(“../”, “FORVALUE”, 0)*328.42)
This way the rand function will generate a random offset using the iteration number times some other number (for variation) as a seed.
So you can have for U rand(stamp(“../”, “FORVALUE”, 0)*733.73)
and for V rand(stamp(“../”, “FORVALUE”, 0)*328.42)
- deadalvs
- Member
- 196 posts
- Joined: 8月 2011
- Offline
-
- Quick Links