diff options
| author | Ryan Houdek <Sonicadvance1@gmail.com> | 2011-12-11 07:02:13 -0600 |
|---|---|---|
| committer | Ryan Houdek <Sonicadvance1@gmail.com> | 2011-12-11 07:02:13 -0600 |
| commit | e85a3d68b02b61f607637dddffd575ab99ba2898 (patch) | |
| tree | cf064cc0be8686acf4481f1e1dd72bb23407bebe /Source/Core/VideoCommon | |
| parent | ad13f2d23d8dd809e5f5246a7ea45bbcb0b3fc70 (diff) | |
Looks like we make use of fmod, make a GLSL function for it!
Diffstat (limited to 'Source/Core/VideoCommon')
| -rw-r--r-- | Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 940a34f537..5f66dfb6e9 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -573,6 +573,15 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType WRITE(p, "#define saturate(x) clamp(x, 0.0f, 1.0f)\n"); WRITE(p, "#define lerp(x, y, z) mix(x, y, z)\n"); + // A function here + // Fmod implementation gleaned from Nvidia + // At http://http.developer.nvidia.com/Cg/fmod.html + WRITE(p, "float fmod( float x, float y )\n"); + WRITE(p, "{\n"); + WRITE(p, "float z = fract( abs( x / y) ) * abs( y );\n"); + WRITE(p, "return (x < 0) ? -z : z;\n"); + WRITE(p, "}\n"); + for (int i = 0; i < 8; ++i) WRITE(p, "%suniform sampler2D samp%d;\n", WriteBinding(ApiType, i), i); |
