joshforisha / open-simplex-noise-js Goto Github PK
View Code? Open in Web Editor NEWOpenSimplex noise for TypeScript/JavaScript
License: The Unlicense
OpenSimplex noise for TypeScript/JavaScript
License: The Unlicense
We need some docs. At this moment some information about the returned value range of the noise function. Just add a line to readme.md about the value range. 0..1
or -1..1
or -0.5..0.5
? etc.
Ok I see that the value is -1..1
. So I can normalize it by (value + 1) / 2
to convert -1..1
to 0..1
.
But as I can see it correctly it's never reaches 1
(min / max). It's about 0.7
or 0.9
. I tested it with with a lot of iterations.
Would be nice if it were possible to import this library as ES6 modules, e.g. when compiling via rollup or tsc in your own toolchain.
What is the range of output?
I get the following webpack error when loading this module in a typescript project:
ERROR in ./node_modules/open-simplex-noise/lib/index.js
Module not found: Error: Can't resolve './constants' in '~/code/phaser-games/top-down-rpg/node_modules/open-simplex-noise/lib'
@ ./node_modules/open-simplex-noise/lib/index.js 3:18-40
@ ./src/GameScene.ts
@ ./src/index.ts
This is the project template I'm using in case it's something wrong with my webpack/ts configs. I verified that you can reproduce the error by cloning this repo and trying to use the module. For example:
// GameScene.ts
import { makeNoise2D } from "open-simplex-noise"
const noise = makeNoise2D()
I don't know if speed is even a design goal for you, so feel free to close this issue if it's not. ๐
Basically, I decided to evaluate a handful of different noise generators while profiling texture-generation in one of my own projects and thought you might be interested to see how this library stacks up if nothing else.
jsperf is here: https://jsperf.com/fast-simplex-noise/1
It is known that simplex noise is used in landscape generation. But your example image looks rather like a white noise.
Can you change it to a better image, so game developers can trust this lib is for them?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.