Jump to content

Shuffle identical primitives to break repetition


Recommended Posts

So I have a few textures for a hardwood floor, and the textures align nicely on a grid  object, but it's still obvious that it's not a seamless texture.

With the correct number of rows and columns set, I have one primitive per apparent plank. Some planks may have a seam somewhere but it's not too important right now.

Now how do I shuffle the primitives ? I'm looking for the most Houdini way to do it..  Either actually shuffle the primitives, or copy the uv from a random primitive, which should look the same.

planks.png

Edited by AntoineSfx
Link to comment
Share on other sites

hardwood2.thumb.jpg.a5e7ad74b10c961ca844c6a895ad5d89.jpg

So here is how I did it

Once the grid's cells align with the texture,

Facet -> Unique points,

Name each primitive (assign the name attribute)

Pack the geometry (using the name attribute)

Work on the point locations of the grid in an attribute wrangle, using a second grid for example in input1.. Randomize the points  order ( sort / points / random ) of the second grid.

@P=point(1,"P",@ptnum); 

unpack, and the rest is trivial.. I tweaked the colors and shifted every other row randomly.

Edited by AntoineSfx
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

  • 7 months later...
  • 8 months later...

sorry to dredge this but I'm also looking how to do this

I have a simple replication of your steps, 2x grids of 10x10 size 10x6 divisions

houdinifx_brYZaPPyuK.png.764f3a6911d2719d486445dd5cb6ccfb.png

facet set to primitives and 'Unique Points' checked

houdinifx_OiF1CpyDbG.png.f1d3ed9b8ad36b5791cda490ff362e0f.png

The 'Name' SOP adding a 'name' Attribute

houdinifx_KP99a75Bap.png.89ff8047bac9b53181dae6e1618a2a21.png

(this doesn't show in geometry spreadsheet, but does show in middle mouse click)

image.png.0681d80e5ffe8e352a976517f323f965.png

The 'Pack' node

houdinifx_2fen9vgoyU.png.86bac6919e29673660aa402edca5651c.png

attribute wrangle...

houdinifx_ib1WJ1YDy1.png.f89e90346be304e6e3cff28c20195508.png

 

 

New to houdini so still trying to get my head around most of this, I'll also be applying this to a curve so this may not work for me. Will look at curveu? or another way to randomly chop prims.

 

Thanks

Ant

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...