Updated comments on noise maps.
This commit is contained in:
parent
2413c7d3d4
commit
c02fb342a7
@ -35,7 +35,7 @@ func clipNormalized(x float64) float64 {
|
||||
return x
|
||||
}
|
||||
|
||||
// Value generates the noise value for an x/y pair. The range of the output is approximately [-1.325825214,1.325825214] (for 4 harmonics).
|
||||
// Value generates the noise value for an x/y pair.
|
||||
func (m *noiseMap) Value(x, y int32) float64 {
|
||||
value := m.noise.Noise2D(float64(x)*.01, float64(y)*.01, m.alpha, m.beta, m.harmonics)*.565 + .5
|
||||
return clipNormalized(value)
|
||||
@ -45,7 +45,7 @@ type randomNoiseMap struct {
|
||||
*noise.Perlin
|
||||
}
|
||||
|
||||
// Value generates the noise value for an x/y pair. The range of the output is approximately [-1.325825214,1.325825214] (for 4 harmonics).
|
||||
// Value generates the noise value for an x/y pair.
|
||||
func (m randomNoiseMap) Value(x, y int32) float64 {
|
||||
value := m.Noise2D(float64(x)*.53, float64(y)*.53, 1.01, 2, 2)*.5 + .5
|
||||
return clipNormalized(value)
|
||||
|
Loading…
Reference in New Issue
Block a user