Jump to content

Random Textures in Solaris/USD/Lops/Karma

Recommended Posts

Hi all,

I'm not a lighting or shading person. I'm barely a Houdini person, if the truth was told, but I struggle on...


I am having a terrible time trying to figure out how to assign random textures to packed geometry in Solaris/Lops/USD/Karma (referred to as SULK from now on, OK?)

I have a Crowd scene with some flag waving agents. I want the flags to have a material on them where I can choose a random texture from a set of three textures.

With me so far? Excellent.




I've tried 'editMaterial' node

I've tried 'materialVariation' node

I've even looked at 'variations' but that's s total mess in there - I'm not going anywhere near that!


The flag geometry is packed and has an attribute called 'flagTex' which has a random int value from 1 - 3.

When I import the geometry into SULK, that attribute becomes primvar@flagTex

So far so mediocre.

Now the problem: How do I use that attribute to choose a texture file on the shader?

I can do this in Mantra, so I would expect it can be done in SULK, but how?

I expected SULK to relieve some of the pain of StyleSheets but in truth it is a lot worse.

Please, someone, help me out here before I throw in the towel and ditch SULK.

Many thanks.


Edited by dansidi

Share this post

Link to post
Share on other sites

Just stumbled across this topic - this might be way too late, but maybe it can help someone else:


I use a principled shader in this solution: go to the texture tab and mouse over the parameter to get the name and type (eg. basecolor_texture, string).
Outside you need to create a primvar with this type and parameter. Then Karma will take this value, set on the primitive, rather than the default one specified in the shader. You can do that with an attribwrangle or a materialvariation:
In the materialvariation be sure to put the primitive that you want to change in "primitives", set the name and type and fill in the new value that you want to overwrite the shader with. Done!

  • Like 2

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now