Hello,
I'm trying to do two things.
First: I have this emitter that emits particles with random colors, and that's ok, arnold does the job. The thing is, despite the trail object color is set to be the same as particle color, arnold renders all the trails the same color despite the color of the corresponding particle. Is there a workaround for this?
Second: Is it possible to assign random colors to the trails from a given color palette (ramp)? (not just random random colors)
Thank you.
Unfortunately the X-Particles SDK is limited and I can not read color of a trail or tell which trail belongs to which particle.
You can use the utility shader in uniform ID color mode to drive a ramp. Alternatively you can enable Export IDs in the Arnold tag of the xpTrail and read the id via a user_data_int shader. Use curve_id as the attribute.
Hello,
I'm a bit confused about the order of the nodes. In the first solution, the ramp comes before or after the utility? which nodes connect to which? In the second solution, to which node connects the user_data_int?
The utility shader in uniform ID mode will generate a random color of each trail. You can connect it to the input of the ramp shader to randomly select a color.
Same for the user_data shader, you can connect it to a random shader for instance to generate a random color based on the id (trail index) and connect that to the ramp.
Hi again,
I can't see "curve_id" in the atributes for user_data_int, only "id". In the arnold tag assigned to the trail object "export IDs" is checked though.
Hello Peter Horvath,
I tried your workaround with Uniform ID. But I only manage to get random colors. I can't make it work that I can get the Uniform ID information do drive a ramp. Am I doing something wrong?
Your setup looks correct to me. Here's a simple scene with colors picked up from a red to white gradient: xptrails_random_ramp.zip
Just to clarify, the colors are still random but selected from a ramp (color palette).
I hope I can add direct support for xptrail colors in the near future.
Oh well my bad, the shade mode has to be on flat. Mine was for whatever reason on ndoteye. But thank you for the help!