The documentation for sine and cosine in the Material Editor state that they take the input angle as radians, but in reality they take a 0.0 to 1.0 scale (e.g. for 45 degrees, the value of 45/360 should be used).
This has been discovered by others in problems
but I’m inputting this bug report to make clear that it is the documentation that is incorrect (i.e. the hover text)
I went ahead and entered a documentation ticket for this issue. The sine value is normalized to be a value between 0 and 1 because the UV space is normalized to be between 0 and 1, which needs to be stated in the documentation in some form.
So I actually confused myself and provided incorrect information. Here is a quick rundown of Sine and Cosine as described in the engine, which can be found in the Math_Hall content examples level.
Sine is a function of an angle that represents a ratio between the sides of a right triangle. In UE4 the default period of sine is 1.0. This means it repeats itself every 1 unit. The sine wave is represented as a range from -1 to 1.
It is the ABS (absolute) which maps the Sine wave to positive values, which in turn creates a bouncing effect if applied to a material using world position offset.
Hopefully these graphs and the example maps can get you moving in the right direction. If we are talking Sine wave, and using the question that if you input -0.25, it would actually equate to -1.0 along the Y axis.
Are you referring to our online Documentation, the tooltips, or something within the editor that is contradicting itself? I do see that Sine and Cosine have the same explanation within our Docs, so I am assuming that is what you are talking about. I believe Sine should mention the -1 to 1 range however, and not the 0 to 1 range.
Perfect… This is one of the many WTFs moments when working with unreal engine even if you read the document so carefully and after a week of debugging you found the common sense does not make any sense…
It could be just one sentence of comment in the doc saying the range of the input is from -0.5 to 0.5 comparing common (-pi, pi). Or it’s still better to just not have no document so people can just find it online. Making the “radians” documentation is just trying to confuse people as much as possible…