simplex-noise.js icon indicating copy to clipboard operation
simplex-noise.js copied to clipboard

How to generate 1D noise?

Open finscn opened this issue 8 years ago • 7 comments
trafficstars

How to generate 1D noise by simplex-noise.js ?

Thanks.

finscn avatar Sep 10 '17 16:09 finscn

simplex-noise.js does not have a function specifically for 1D noise. You could use the 2D one just along one axis and fix the other one or derive one from the code if performance is a concern.

jwagner avatar Sep 19 '17 21:09 jwagner

@jwagner , thanks for your reply . Why simplex-noise don't support "1D noise" ? Is '1D noise' is hard to implement ? or it's useless in real world ? Is '1D noise' in your plan ? ( I hope so , please )

finscn avatar Sep 20 '17 17:09 finscn

It's not hard to implement but simplex noise (as in the algorithm) is mostly useful in dimensions. For the 1D case you can just simply linearly interpolate. The main reason it's not in the library is that I didn't have a need for it. What are you trying to do with 1D noise?

jwagner avatar Sep 20 '17 18:09 jwagner

I need it in my web game. I like this lib , but because 1D , I have to use another one . it's so sad.

finscn avatar Sep 21 '17 16:09 finscn

1D noise is useful for generating a terrain height map for 2d side view games like the popular Worms series.

paulrobello avatar Oct 31 '17 16:10 paulrobello

Is there any news about 1D ?

finscn avatar Apr 23 '19 08:04 finscn

@finscn for now just use 2D while fixing 1 variable. It's not optimal performance wise but for the vast majority of 1d use cases it should do.

jwagner avatar May 04 '19 21:05 jwagner