question

Francisco Cunha avatar image
Francisco Cunha asked ·

xParticles xpTrails colors, how to control them?

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.


x-particlestrails
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Francisco Cunha avatar image
Francisco Cunha answered ·

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?

3 comments Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

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.

0 Likes 0 · ·

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.

0 Likes 0 · ·

It's indeed not listed in the menu, just simply type in curve_id.

1 Like 1 · ·
Peter Horvath avatar image
Peter Horvath answered ·

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.

Share
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.