Skip to content

Commit f6750cf

Browse files
authored
Merge pull request #5 from saceria/master
Updates 2D Noise Function Scaling to [-1, 1]
2 parents 9f0b2cd + fa14707 commit f6750cf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Source/SimplexNoise/Private/SimplexNoiseBPLibrary.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ float USimplexNoiseBPLibrary::SimplexNoise2D(float x, float y)
222222

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

228229

0 commit comments

Comments
 (0)