Permalink
Browse files

updated complex sample to use % instead of mod

  • Loading branch information...
1 parent f52f4f3 commit b24761dc35a2f12080926b2337d45cbf74abe046 @WolfgangSt WolfgangSt committed Sep 1, 2011
View
2 IIS.SLSharp.Examples.Complex/Shaders/SimplexNoiseShader.cs
@@ -129,7 +129,7 @@ protected float GradPerm(float x, vec3 p)
[FragmentShader]
protected float Noise(vec3 p)
{
- var q = mod(Floor(p), 256.0f);
+ var q = Floor(p) % 256.0f;
p -= Floor(p);
var f = Fade(p);
View
2 IIS.SLSharp.Examples.Complex/Shaders/WangShader.cs
@@ -20,7 +20,7 @@ public abstract class WangShader : Shader
[FragmentShader]
public vec4 WangAt(vec2 tex)
{
- var address = tex - mod(tex, 1.0f / 256.0f);
+ var address = tex - tex % (1.0f / 256.0f);
var subPos = Fraction(tex * 256.0f) / 4.0f;
var offset = texture(WangMap, Fraction(address)).xw;
var tc = offset + subPos;

0 comments on commit b24761d

Please sign in to comment.