According to the documentation, Cosinus and Sinus take an input in radians.
The Cosine expression outputs the cosine of the value input (in radians).
This is of course what anyone would expect from them, and any other behavior would be counter intuitive and unwanted.
In 4.10 though, the generated HLSL multiplies the input value by 2π before passing it to the cos()
and sin()
functions. See for example the generated code for the following minimal material:
half3 GetMaterialEmissiveRaw(FMaterialPixelParameters Parameters)
{
MaterialFloat4 Local0 = MaterialCollection0.Vectors[0];
MaterialFloat Local1 = (Local0.r * 6.28318548);
MaterialFloat Local2 = sin(Local1);
MaterialFloat3 Local3 = (Local2 + Material.VectorExpressions[1].rgb);
return Local3;;
}
half3 GetMaterialBaseColorRaw(FMaterialPixelParameters Parameters)
{
MaterialFloat4 Local4 = MaterialCollection0.Vectors[0];
MaterialFloat Local5 = (Local4.r * 6.28318548);
MaterialFloat Local6 = cos(Local5);
MaterialFloat3 Local7 = (Local6 * Material.VectorExpressions[2].rgb);
return Local7;;
}