Split node is not intutive, RGBA output splitting Position vector

Hi there,

Just wanted to send some feedback, that the Split node outputting RGBA channels seems very strange when you’re wanting to split up for example a Position Vector3. It works, but for first time users it just seems like a really odd UX issue. There’s other nodes that will smartly change the output depending on what’s connected to the input, could this not do the same, and outputs something named more appropriate or something more generic even.

To retiterate, sending in a Position (x,y,z) vector3 to the Split node, and it outputting four channels RGBA, is not intuitive, for a first time user they think they’re doing something wrong, or unable to find the correct way to split up a vector.

Thanks!

There is also Swizzle node. The thing is if you change RGBA to XYZW, then it will be not intuitive when you split colors and most of the time you split colors and swizzle vectors.

I’ll check this out thanks… I had searched for an alternative and nothing was coming up for me thanks.

I mean, the split node could have a toggle that makes it change between RGBA and XYZW for clarity, the generated shader code doesn’t need to change (rgba and xyzw are interchangeable anyway).

So it’s kind of what I was after, but still not quite. If I feed in say a Vector3 and want to split this inito three float ouputs x,y,z, the Swizzle is more intended to rearrange the fields, not split them. So yes, I could use three Swizzle nodes each filtering for x, y, and z, which is fine, it’s just a little cumbersome.

Yea this plus making the output vector length dynamic based on input length. For example, it doesn’t make sense to be connecting a Vec3 to output a Vec4.

I mean, this is not my own logic, but what developers wanted. I bet it was directed towards “artists”, for me personally it could be always xyz. However I don’t think adding option to display xyz or rgb is really needed as it does not change anything, so I would prefer some bug to be fixed instead of this feature :smile:

It would add clarity when looking at it.

Personally I don’t use the shader graph all that much so I would prefer the team disbands and they work on something else.

I think the ideal result and most intutive would be if the Split node simply splits whatever you connect to the input both in vector length and with named fields.

Connect a Vec4, you get 4 split channels x,y,z,w. Connect a Color, you get r,g,b,a. Connect a Vec2 you get x,y.

No need for settings or format strings. It just splits what you send it. That’s the most intuitive and I would say ‘expected’ behaviour.

There is no such thing as Color or Vector4 in shaders, everything is just ‘struct’ with one of several components, and node output and input names are just display names, often based on function parameters.

You would need separate mechanism to define type for every single node, then those nodes would need to inherit types and what if you multiply color and vector3? you inherit color?
Actually no, you can’t even do that as you can have multiple outputs in single node.

We are talking about the visual part. I typically write .r when it’s coming from something that is intended to be color, and .x when it’s from something that is intended to be a position or a vector, the benefit being is it gives me more info about what happens in a glance (“I’m doing stuff with colors here”).

Similarly, the split node should keep that convention: it should output whatever it receives (visually).

I get the point and I agree, the thing is that graph nodes does not carry this abstract information. The only easy way is what you mentioned, dropdown with mode to display xyz or rgb.

1 Like

Can you just make a subgraph that reassigns the RGBA to XYZW outputs and call it SplitVector and use it instead for the time being?

We’re talking about UX and UI improvements for Shadergraph, not how HLSL functions. This is about an improvement to the UI, other nodes in SG already behave in ways described with dynamically changing outputs and vector lengths.

Agree. That is the most intuituve behaviour.

Yes there’s planty of work arounds, and if we’re talking work arounds then I’d just stick with using a Split node, it works, using multiple Swizzle nodes works. Thanks for the suggestion, but this thread was intended more as a feature request to improve the UX.

which nodes? in what way