Help needed, How to randomise UVs on packed geo per copy? <SOLVED>

   2299   4   0
User Avatar
Member
17 posts
Joined: July 2017
Offline
Hi
Please help me figure it out, let me describe my example.

I have modelled wood plank and generated UVs for it.
Now I want to copy the plank to points to create for instance wooden floor or fence.
Then to make it look more natural I want to randomise each copy by offseting UVs by random number per copy (or per UV connected geo) so that each planks get different area of texture map

I know it can be done in two ways:
- copy stamping
- for each loop

I tried to do it both ways but I failed to do it correctly.

Can someone help me with that? Maybe provide hip file with example of both ways.
Thank you in advance.
Edited by McKormick - Aug. 7, 2018 07:08:32
User Avatar
Member
17 posts
Joined: July 2017
Offline
Anybody?
Please help.
User Avatar
Member
8582 posts
Joined: July 2007
Online
if you modify UVs or any attribute inside of packed primitives per copy, you'll lose the advantage of instancing

so rather than doing that, just do it in the shader
- add any id attribute per packed primitive like i@plankid for example
- then access it in the shader using Renderstate VOP like integer packed:plankid use that to randomize the offset
- then just drive UV Transform's trans input to modify uvs per unique plankid

see example
Edited by tamte - Aug. 5, 2018 07:04:21

Attachments:
ts_randomize_uv_on_packed.hip (390.6 KB)

Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
17 posts
Joined: July 2017
Offline
Thank you Tomas, your solution works great, I appreciate your effort to help me.
User Avatar
Member
8 posts
Joined: Nov. 2016
Offline
Hi, any clue how to do this for Arnold, please? I tried many things, but can't get it to work..

Bretislav Kaspar
  • Quick Links