Crowd random texture on Solaris

   605   3   1
User Avatar
Member
948 posts
Joined: April 2008
Offline
Hey guys I am trying to wrap my head around a very simple issue that in SOPs would be piece of cake, I have10 different textures for the agent and I would like to vary per "agent id" just overwriting the path, what would be the proper way to tackle this? I am not sure how to use the wrangle to vary the string from 001 to 010.

I hope that it makes sense.

Thanks.
Edited by mzigaib - Feb. 6, 2024 20:54:13

Attachments:
Screenshot 2024-02-06 224523_marked.png (1.7 MB)

https://vimeo.com/user2163076 [vimeo.com]
User Avatar
Member
381 posts
Joined: June 2018
Offline
You can use the USD native shader (Usd UV Texture) (or a vex shader) and put the texture path as a primvars on the agents.
In the material you can read the texture path from the string primvar and this should alter the textures with enough artist control.
Edited by JonasSorgenfrei - Feb. 7, 2024 14:25:14
Jonas Sorgenfrei
FX/PIPELINE TD | RISE Visual Effects Studios
User Avatar
Member
19 posts
Joined: Aug. 2020
Offline
I am also curious about the best way to do this. I've messed around a little bit and these are my conclusions.

1.) The easiest way is to set all agent prims to NOT be instanceable, which is not default behavior. This would mean you can just assign a material to each agent and potential geom subsets randomly. I have not experienced any performance hits when using uninstanceable prims as HoudiniGL is already very slow for usdSkel and i find it to be unusable compared to storm. Maybe load times would become a problem when you get to large crowds of over 1000 but i have not tested.

2.) If you want to keep the agents as instanced, you can read in a primvar of the texture path like was suggested above and then randomize that primvar on the top level agent prim which in your example would be "mocapbiped3_*". By doing this the primvar should be "inherited" by the instanceable prim below, basically allowing you to read the primvar from a different primitive than where the material is assigned. You can also use the MaterialX UDIM Offset to select textures based on values, it is mentioned here [www.sidefx.com].

I am not sure how to deal with the the viewport performance and that is the biggest problem i have encountered, using storm seems to be the best/only option.
Edited by Latimerias - Feb. 7, 2024 14:01:35
User Avatar
Member
948 posts
Joined: April 2008
Offline
Thanks for the feedback guys!

The problem with using primvars strings is that it does not work with XPU I am trying my best to stick it since I am using one machine and it would much slower with CPU, with a farm maybe.

The best solution I found is since I have 10 textures is to have 10 different shaders with different textures and use the assignvarymaterial, that did the trick but yeah you loose a little efficiency if you need to change the properties of the material.

I hope Sidefx can soon add this feature to Solaris.
Edited by mzigaib - Feb. 7, 2024 14:46:15
https://vimeo.com/user2163076 [vimeo.com]
  • Quick Links