How to access a single component of a color vector as variable?

Hi!

I am still very new to vvvv and want to modify some shaders.
I need to access single color components of a color vector to use them for non-vector type calculations.

So for a given color “float4 c1” I want to access e.g. the red, blue, green or depth component individually.

I thougt maby there is a notation like c1.0 or c1.r or c1.red. Is there a way to do this?

float4 c;
c.x , c.y, c.z , c.w
or
c.r, c.g, c.b, c.a

alos you can mix like
c.rg or c.ar and so on

this is called swizzling and documented here: https://vvvv.org/documentation/ex9.hlsl.introduction#vectors-and-swizzling

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.