-
-
Notifications
You must be signed in to change notification settings - Fork 201
Open
Description
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))
Metadata
Metadata
Assignees
Labels
No labels