Jump to content

Assigning random textures for copy stamp


queenmandarin

Recommended Posts

Hi everyone. I'm currently working on a project where I need a swarm of butterflies flying towards a general direction. I got the animation down, but I'm just stuck with the shading/texturing part.

 

I've tried Show Am All, but it doesn't work with multi-grid textures (there are 4 image files per texture, and 5 textures in total). Is there a way to assign random multigrid textures to a copy stamped crowd sim? I would appreciate the help, thank you in advance!

 

Link to comment
Share on other sites

Lots of ways to do this. 

Hard to say what's best without some kind of example. 

 

Two suggestions

 

1) Set up five shaders, one per shader set. Create a primitive string attribute on your geometry called "shop_materialpath" and set it to one of the five shaders using copy-stamping

 

2) Instead of setting up five shaders, build all five textures into a single shader. Use some kind of point numerical attribute on your geometry to toggle a switch statement in your shader to determine which texture set to use.

 

There are probably a number of other ways to achieve the same effect. 

Link to comment
Share on other sites

you can as well just create string attribute on your points that contains the full path to your textures (like per point path)

make sure you pass that attribute to copies using Copy SOP/Attribute tab

 

and if the name of that attribute matches the name of the texture parameter(actual name, not label) on your shader it will be automatically used so you can have literally different texture per butterfly with just one shader

you will not see any difference in viewport though

  • Like 1
Link to comment
Share on other sites

you can as well just create string attribute on your points that contains the full path to your textures (like per point path)

make sure you pass that attribute to copies using Copy SOP/Attribute tab

 

and if the name of that attribute matches the name of the texture parameter(actual name, not label) on your shader it will be automatically used so you can have literally different texture per butterfly with just one shader

you will not see any difference in viewport though

Correct me if I`m wrong, but I think that attributes must be set on prims to override shader parameters. So you have to promote them after copy sop.

Link to comment
Share on other sites

they generally don't have to be prim attribs, vertex, point, prim, detail are fine (used in that order, so if detail and point Cd is present, point is used etc. )

but for string attributes you may be right as there is no way they can interpolate over prim (so only prim and detail make sense)

 

but you can directly transfer any template point attribute to point,prim or vertex in Attribute tab of Copy SOP if you wish

Edited by anim
  • Like 1
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...