Ok i found something to work with, but i still have this shifting issue. The quad should be perfectly centered but it isn’t.
I marked the Center Lines with yellow. As you can see they don’t go through the Center…
I use this CustomNode Code:
float4 NewPos = float4(InPosition.xyz, 1.f);
float4x4 TransformMat1 = {
/*M[0][0]*/ InScale.x, /*M[1][0]*/ 0.f, /*M[2][0]*/ 0.f, InOffset.x,
/*M[0][1]*/ 0.f, /*M[1][1]*/ InScale.y, /*M[2][1]*/ 0.f, InOffset.y,
/*M[0][2]*/ 0.f, /*M[1][2]*/ 0.f, /*M[2][2]*/ 1.f, InOffset.z,
0.0f, 0.0f, 0.0f, 1.0f
};
float4x4 TransformMat2 = {
/*M[0][0]*/ 1.f, /*M[1][0]*/ 0.f, /*M[2][0]*/ 0.f, InOffset.x,
/*M[0][1]*/ 0.f, /*M[1][1]*/ 1.f, /*M[2][1]*/ 0.f, InOffset.y,
/*M[0][2]*/ 0.f, /*M[1][2]*/ 0.f, /*M[2][2]*/ 1.f, InOffset.z,
0.0f, 0.0f, 0.0f, 1.0f
};
NewPos = mul(TransformMat2, NewPos);
NewPos = mul(TransformMat1, NewPos);
return NewPos;
And here the Material:
Note that the 2 last inputs are not used by the CustomNode at the Moment!