Material Sine in C++
Hello, I have done gerstner waves material and now I want to reproduce it in C++. Does anyone know how to reproduce Sine function in C++?
asked Jul 08 '18 at 08:21 AM in C++ Programming
Unreal has a math utility class called FMath. You will want to use its SinCos function it will look like this:
inputVal is whatever you are trying to compute the Sine of.
answered Jul 09 '18 at 03:48 AMBrian Johnstone (suspended)
Material Sine is described here https://docs.unrealengine.com/en-us/Engine/Rendering/Materials/ExpressionReference/Math And it's not clear sin.
If anyone is looking for Sine in C++ it looks like this:
It's not perfect though.
If you are trying to calculate the value of Sine or Cosine withing a material function, I believe there is a serious bug in UE.
the sine function returns -.43 for sin(1.57079).
answered Dec 19 '18 at 12:36 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here