Skip to content

Commit

Permalink
Merge pull request #5 from saceria/master
Browse files Browse the repository at this point in the history
Updates 2D Noise Function Scaling to [-1, 1]
  • Loading branch information
devdad authored Feb 12, 2018
2 parents 9f0b2cd + fa14707 commit f6750cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/SimplexNoise/Private/SimplexNoiseBPLibrary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ float USimplexNoiseBPLibrary::SimplexNoise2D(float x, float y)

// Add contributions from each corner to get the final noise value.
// The result is scaled to return values in the interval [-1,1].
return 40.0f * (n0 + n1 + n2); // TODO: The scale factor is preliminary!
//return 40.0f * (n0 + n1 + n2); // TODO: The scale factor is preliminary! //These values currently scale from ~ [-0.884343445, 0.884343445]
return 40.0f / 0.884343445f * (n0 + n1 + n2); //accurate to e-9 so that values scale to [-1, 1], same acc as F2 G2.
}


Expand Down

0 comments on commit f6750cf

Please sign in to comment.