Community
Arnold for Maya Forum
Rendering with Arnold in Maya using the MtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

aiColorJitter combined meshes, groups of faces, Maya

1 REPLY 1
Reply
Message 1 of 2
jen_steinkamp
303 Views, 1 Reply

aiColorJitter combined meshes, groups of faces, Maya

I would like to know if the aiColorJitter utility can work on groups of faces.

For example

Make a few Poly spheres

Use Mesh Combine to make 1 object
Apply aiColorJitter to make each group of faces a new color.

Right now I can only get individual faces to make a patchwork quilt.

I would like each sphere to have its own color.

This would be really handy for Paint Effects converted to polys. I would like to avoid separating the mesh.

Tags (2)
Labels (2)
1 REPLY 1
Message 2 of 2
madsd
in reply to: jen_steinkamp

I have this working in MAX. Fairly simple to do, I don't use the Jitternode however, but just access the IDs from OSL getattribute(); directly.

This grants me access to use OSL to grade, scale, offset hues, and add random seeds to the spheres just as the Jitternode would do, just with more flexibility.
The spheres are treated as integers thus, 1 solid random color, pr. face collection.

This is the easy part.

What you need to do, is basically find and use a utility in Maya, that automatically generates a random integer pr face collection. The spheres needs to have this added, since there is no way to know for the spheres that you need pr collection sets.

In max this is as simple as adding a modifier on the object that contains all spheres that is called "MaterialPrElement" and then I just add a a large range, so each element, gets this ID.

I then call getattribute("mtlID",container);
And process this integer stream.

So your task is not so much about Arnold and OSL, but more like generic Maya setup.
Im not a maya expert, but you want to use a Maya tool to generate an integer for each sphere, and then the rest is easy.
You don't want to have to sit and select faces manually for each sphere, so some kind of script/tool that does this for you is needed.

Arnold cannot achieve what you want, from a pure shade side of things only. We need a pregenerated signal to run the randomness on.

There is an alternative which we also use for Bifrost related subjects since texture loading is not in.
This method uses Vertex colors. You simply store the integer on a random texture channel, like channel 42 for example, and you can call this from Arnold and OSL with a UVW loader, picking a channel number 42.
Again here, you need a tool to automatically fabricate this UVW channel data stream, I use a data channel modifier which can give random Element IDs, and I then have it in OSL and can generate seeds, spread collect filter, do all the things you want to do.

cc.gif
Attached an .ass file that is already set up.
You should be able to reproduce the Jitter noodle above with this and attach it to the .ass file and see the spheres change color each time you push seed.
elementID.zip


Shader that goes into obj_seed.
You need to find the Maya hook for my "mtlID" and make sure it carries valid data.

shader ID
(
    int seed = 0,
    output int Index = 0
)
{
    getattribute("mtlID", Index);
    Index +=seed;    
}

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report