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.

 

How?

 

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.

Dan

Edited by dansidi
Link to comment
Share on other sites

  • 3 months later...

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
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...