Created
August 21, 2013 13:25
-
-
Save Madsy/6294418 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//setup | |
x = startX; | |
y = startY; | |
float sX = s1*x; //s1 is 'a' for s | |
float sY = s2*y; //s2 is 'b' for s | |
float wX = w1*X; //w1 is 'a' for w | |
float wY = w2*Y; //w2 is 'b' for w | |
//optimized loop: | |
for(; y < yEnd; ++y){ | |
for(; x < xEnd; ++x){ | |
float sOverW = sX + sY + s3; //s3 is 'c' for s | |
float finalW = 1.0f / (wX + wY + w3); //w3 is 'c' for w | |
float finalS = sOverW * finalW; | |
sX += s1; | |
wX += w1; | |
} | |
sY += s2; | |
wY += w2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment