Jump to content
marque_pierre

Random values for material inputs

Recommended Posts

I am trying my hand at random values.

My expression here fit(rand($PT), 0, 1, 0.7, 1) is meant to input a random number into saturation between 0.7 and 1.0.

But as the render shows, it seems to just input 0 into saturation.

What am I doing wrong here?

Houdini_img_shader2.jpeg

Share this post


Link to post
Share on other sites
symek    266

Did you put $PT inside material parameter? If so, it won't work as $PT is a local variable meaningful only in SOPs' context. If you wan't to drive saturation per point, you have to create an attribute in SOPs, and bind it to shader parameter. Or use something what is available in shaders, like uv, prim number etc. 

Share this post


Link to post
Share on other sites

Thanks symek. I just really want a random number inside a range. That is all. It doesn't need to be tied to a point or anything. All I want is a random number inside a set range to drive my shader. The geo is part of a HDA, so I just want random variation on certain shader parameters every time another instance of the HDA is created. How do I do that then?

Edited by marque_pierre

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

×