Auburn / FastNoiseLite

Fast Portable Noise Library - C# C++ C Java HLSL GLSL JavaScript Rust Go
http://auburn.github.io/FastNoiseLite/
MIT License
2.79k stars 327 forks source link

Missing Methods? #88

Closed Stanlyhalo closed 2 years ago

Stanlyhalo commented 2 years ago

Not entirely sure if this is on purpose, or I can't just find where it is, but in the GUI app form, there's input fields like the Domain Warp Frequency, but that doesn't appear to be something we can change (at least for c#), am I missing something? Is it called something different or just not there?

Stanlyhalo commented 2 years ago

While attempting to make a texture in c# from the values I got through the GUI app, it does appear that everything in the image shown aren't in functions/methods except for the domain warp type, and domain warp amplitude, everything else there isn't a method.

Stanlyhalo commented 2 years ago

I attempted to make this texture (texture made from the GUI executable): image But even though I used all the same values in the api version, when I set each pixel to the x & y coordinate data, it came out looking like this: image If you're wondering, these are the properties I set in the GUI application: image And these are the values made in the api (c#):

FastNoiseLite noise = new FastNoiseLite();
noise.SetNoiseType(FastNoiseLite.NoiseType.Value);
noise.SetSeed(100);
noise.SetFrequency(0.05f);
noise.SetFractalType(FastNoiseLite.FractalType.PingPong);
noise.SetFractalOctaves(1);
noise.SetFractalLacunarity(3.2f);
noise.SetFractalGain(1.8f);
noise.SetFractalWeightedStrength(0.1f);
noise.SetFractalPingPongStrength(0.4f);
noise.SetDomainWarpType(FastNoiseLite.DomainWarpType.OpenSimplex2);
noise.SetDomainWarpAmp(80f);
Auburn commented 2 years ago

You need a separate FastNoiseLite instance for domain warping. The missing methods you mentioned are referencing the standard methods but on the domain warp instance.

Stanlyhalo commented 2 years ago

Oooh, but than how would I go about mixing the domain warping instance and my main noise instance?

Auburn commented 2 years ago

You can see how it's done here in the preview app: https://github.com/Auburn/FastNoiseLite/blob/6be3d6bf7fb408de341285f9ee8a29b67fd953f1/PreviewApp/FastNoiseLiteGUI.cs#L541

Stanlyhalo commented 2 years ago

Awesome! Thanks so much, that makes so much more sense now! Worked like a charm. image