jwagner / simplex-noise.js

A fast simplex noise implementation in Javascript / Typescript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to generate 1D noise?

finscn opened this issue · comments

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

Thanks.

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 , 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 )

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?

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

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

Is there any news about 1D ?

@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.