I'm using color jitter to give different tint to a lot of trees in my scene. I really love how easy it is to set. The problem is when i start to render frames, the object's color changes at each frame..How can I randomize colors on different objects, without the flickering effect in an animation?
The colors don't change for me. What is your shader setup?
Same problem here. With fixed camera it works fine. As soon as you use an animated camera the color jitter randomly switch between objects every frame...
Is it a bug?
if I try to use "utility" map with obj as color mode, it does the same as color jitter: objects are changing color randomly with animated camera. With non moving camera it works as it should.
You are right. Since objects, in some cases, gets re-translated with a different name along animation, shaders based on a random seed computed out of the objects' name change their behavior along animation.
We're working on fixing this for the next release.
This is a possible workaround. It may require some work if you have a lot of objects. Anyway:
Instead of using the Object mode, we leverage the User Data one. So, reset the Object's min/max stuff to 0, and transfer the values to the User Data group.
Assign each object an Arnold Property, enable the User Options and enter this string in the field for the first object:
declare seed constant INT seed 1
For the second object, enter
declare seed constant INT seed 2
and so on for all the objects.
In the material editor, get a user_data_int node, and set its Attribute to seed.
What is now going on is the following: on exporting the shapes, MAXtoA attaches the User Options string to the objects. The string means that a constant user data called "seed" is now on the object, its value being 1 for the first object, 2 for the second, and so on.
On rendering, user_data_int reads this values from the hit object. So, if "seed" is found, its value is returned as the output of the shader.
cololr_jitter, in User Data mode, computes the random seed based on the data_input, and so, for obejcts sharing the same seed in the User Options string, you'll get the same randomized value.
Makes sense ?
Zap made me note that constant user data can be set in 2019 also without using the Arnold Properties.
RMB on the object, select Object Properties, and under the User Defined tab enter
seed=1
for the first object, etc.
instead of user_data_int, use user_data_float, and prefix the attribute name by "usr_", as in the screenshot.
Another advantage is that this can also be scripted
Thanks Nicola, I tried to use the data instead of object but did not know how to declare the variable. I hope this will be fixed in the next update.
Of course, you already have user data with a running number for each object, it's called "nodeHandle". It should be safe to use for randomization purpouses.
/Z
I have another question regarding this jitter color. I have a tree, multi subobject material for trunk, branches and leaves. How could I use the jitter color to produce randomnes in the color of the leaves? Is there an option to use user data with a specific uv set for example?
Right Zap ! I was focusing too much on 2018.
So, you can forget about all the user options and properties, and just use the following.
It does not work with an animated camera. Still have the random changes along the animation. In 2018 or 2019 it is the same...
Sorry wrong test. It does work in 2018 and 2019.
Thanks a lot!
Thanks! Tested and it works fine!
Do you know if there is any trick using color jitter with leaves of a tree (all leaves, branches and trunk in same object), to randomize a little bit the leaves color?
thanks
@Olivier Desrois
See if this can help: https://answers.arnoldrenderer.com/questions/7547/pflow-and-color-jitter-1.html?childToView=7629#ans...
In short, if the tree is a single mesh, then you must provide the shader a way to identify the leaves being hit. Send me a simple scene if you want me to help further.
thanks for that, it works very well! Arnold is very powerfull! (thanks to the very good and responsive support!)
link to solution for the others:
I am also getting this flickering with the aiColorJitter node in Maya 2019. I have a figure with just an aiStandardsurface and with that the aiColorJitter node. I wanted each polygon of the figure to be a different color so I set the aiColorJitter to "face". Looks correct when I render. However, I then create a MASH Explode node so that all the polygons start off on the ground and then piece back together to form the figure. During the explode/build up the polygons constantly flicker. Is there any way of fixing this?
Here's an example of what my figure looks like. https://www.pictorem.com/127099/Parrot%20LOW%20POLY%20ART%20.html but each poly explodes out separately with the MASH node.
Can't find what you're looking for? Ask the community or share your knowledge.