Hi,
I just hopped into the current UE4 jam and tried to write a custom shader.
I need to apply a matrix transformation for every step of a for loop, so unfortunately I can only apply the transformation right through the custom node and not via the normal UE4 material nodes.
I now wanted to define a transformation matrix and according to microsoft (https://docs.microsoft.com/de-de/win…cs-hlsl-matrix) HLSL should support matrices which are defined either by something like:
float3x3 TestMatrix = …
or
matrix <float, 3, 3> Test Matrix = …
Neither does work for me though and I always get an error X3000: syntax error: unexpected token ‘float3x3’.
This is really weird to me as the microsoft page to be native to HLSL and I thought should work in the custom node as it´s straight HLSL as far as I´m aware.
If I´m making some stupid mistake with my assumptions please let me know, I´m pretty new to HLSL.
This is a test matrix I tried defining:
// IdentityMatrix
float3x3 IMatrix = {
1.f, 0.f, 0.f,
0.f, 1.f, 0.f,
0.f, 0.f, 1.f
};
Which does report the error X3000.
**Alternatively **what could also REALLY help me and make the above irrelevant for now (though I´d still be interested in a solution for matrices) would be the ability to call the “TransformVector” node straight out of the custom node. I know that for the Noise node this works by calling MaterialExpressionNoise(…) with the needed parameters but I didn´t have any luck with “MaterialExpressionTransform”, “MaterialExpressionTransformVector”, “Transform” or “TransformVector”.
If someone could hint me to whether it´s possible to call this node out of the custom node and if so how, it would be greatly appreciated.
Thanks a lot in advance and happy jamming to anyone joining as well!
Kind regards,
foodi