You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to get this shader running in Unity, and while the original ShaderMan conversion had many errors that I could fix just by intuitively going between the Unity .shader file, the original ShaderToy upload file, and this primitive guide, there was still a weird difference between the .shader's results and the original. After lots of trial and error, I found out from the last response in this forum thread that the HLSL fmod() function that ShaderMan used to replace usages of GLSL's mod() is inaccurate to the math that mod() does in GLSL. The easiest way to get the same functionality in HLSL is to#define a new mod() as such:
#define mod(x, y) (x - y * floor(x / y))
The text was updated successfully, but these errors were encountered:
I was trying to get this shader running in Unity, and while the original ShaderMan conversion had many errors that I could fix just by intuitively going between the Unity .shader file, the original ShaderToy upload file, and this primitive guide, there was still a weird difference between the .shader's results and the original. After lots of trial and error, I found out from the last response in this forum thread that the HLSL
fmod()
function that ShaderMan used to replace usages of GLSL'smod()
is inaccurate to the math thatmod()
does in GLSL. The easiest way to get the same functionality in HLSL is to#define
a newmod()
as such:#define mod(x, y) (x - y * floor(x / y))
The text was updated successfully, but these errors were encountered: