question

Aaron Ross avatar image
Aaron Ross asked ·

Split vector into three floats?

Hi,

Is there a way to separate a vector output into three float values?

Thanks,

Aaron

shading
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.

Stephen Blair avatar image
Stephen Blair answered ·

There's no dedicated node for that.

You could use Multiply to zero out two vector components (eg multiply by 1, 0, 0) and plug that into Length or RGBtoFloat

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.

Max Tarpini avatar image
Max Tarpini answered ·

Just for the records, Arnold supports only one output parameter per shader node, that's why there isn't any VectorToFloat3 node.

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.

Aaron Ross avatar image
Aaron Ross answered ·

@Max Tarpini

Thanks for that answer Max, it clears things up a lot!

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.

Aaron Ross avatar image
Aaron Ross answered ·

The output of RGB to Vector is still a single vector. There are no individual elements. I need three floats.

This is partly an issue with 3ds Max not providing separate ports for XYZ and RGB connections in general, and it's also an issue with Arnold not providing a "Vector to Float-3" node. I guess in other applications, such a node is not needed. But it is definitely needed in 3ds Max.

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.

Shawn Kearney avatar image
Shawn Kearney answered ·

I could be wrong, but don't you just use RGB to Vector using the "Raw" mode, and then just pipe out the individual elements? That's how it's done with C4DtoA and HtoA. Is Max different?

Normalized mode will map the input 0 to +1. Canonical will map to a range of -1 to +1.

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.

Aaron Ross avatar image
Aaron Ross answered ·

Thank you Stephen. The Multiply node itself requires a vector input. How do I provide it with three float values 1,0,0? With Float To RGB?

It sounds like if I want to extract three float values from a vector node, it involves building a complex network of many nodes. Minimum number of nodes appears to be nine.

Please consider this a request for a dedicated "Vector To Float-3" node. It would not take much developer time.

Also, this section of the documentation is not helpful because, for example, it does not explain the options for Vector To RGB > Mode. What is "Normalized"? What is "Canonical"?

And more fundamentally, what is the difference between a Vector and an RGB value in the first place? Is it simply that RGB is constrained from zero to one, and vector has no limits?

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.