How to multiply two vector4

In the shader you can to that simply like this for example.

// A, B and C are half4
half4 D = A.xxyy * B.xxyy * C.xyzw;

But how to convert this in C#. It seems that we can’t multiply vector4.

You can create a new Vector4 by multiplying the components you’re interested in…

    Vector4 v1 = new Vector4(1, 2, 3, 4);
    Vector4 v2 = new Vector4(2, 3, 4, 5);
    Vector4 v3 = new Vector4(v1.x * v2.x, v1.y * v2.y, v1.z * v2.z, v1.w * v2.w);

Not the prettiest, but it works. Create a static method to do it for you.

It seems that the Vector4.Scale is the good choice !

See this:

Just a quick google and you can find anything.