Code Monkey home page Code Monkey logo

opensimplex2's People

Contributors

creativecreatorormaybenot avatar dzoni94 avatar filimindji avatar kdotjpg avatar makryl avatar marcociaramella avatar smcameron avatar yoplitein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opensimplex2's Issues

glsl versions throw error trying to use in webgl

I'm seeing an error in the matrix derivative line here:

128:     vec3 derivative = -8.0 * mat4x3(d1, d2, d3, d4) * (aa * a * extrapolations)
^^^ ERROR: '=' : cannot convert from 'highp 4-component vector of float' to 'highp 3-component vector of float'

129:         + mat4x3(g1, g2, g3, g4) * aaaa;
^^^ ERROR: 'mat4x3' : no matching overloaded function found

I know WebGL is an older version of GLSL, maybe too old for this specific implementation?

Maybe a fix is out of scope for your library, or maybe the error I'm seeing has to do with my specific webGL wrapper - possible I'm missing something.

Performance of the new instanceless 2 (2F) 3D variant

It seems performance suffers greatly due to the exponentiation of seed by SEED_FLIP_3D in the one loop iteration. How is this constant calculated, and is its value significant, over just xoring the seed or something? Without this exponentiation, OpenSImplex2 3D is twice as fast in implementations I wrote in a couple languages (I have not measured your C# and Java versions).

Scaling factors

Could you enlighten us on the method you use to calculate the scaling factors of your noise algorithms? Some example code would be much appreciated. Thank you.

IndexOutOfRangeException using 2D Simplex Noise

When I try to get noise using the 2D function, I get an out of range exception.

Here's my usage:

        float max = 0.0f;
        float min = 0.0f;
        float sum = 0.0f;

        float frequency = scale;
        float amplitude = 1.0f;
        float x = xin;
        float y = yin;
        for (int i = 0; i < octaves; i++)
        {            
            x = x * frequency;
            y = y * frequency;
            float v = (float)noiseGenerator.Noise2(x, y);
            sum += v * amplitude;
            max += amplitude;
            min -= amplitude;

            frequency *= lacunarity;
            amplitude *= persistance;
        }

        return (sum - min) / (max - min);

In particular when "scale" is at sizes at around 20 or so or higher.

e: The issue also occurs if I attempt to use Classic Simplex Noise.

Always 0

Why does double noise = OpenSimplex2.noise2(seed, 0d , 0d); always return zero no matter what the seed is?

What kind of things can be generalized?

Say, porting OpenSimplex to Scala:

def eval[N <: Nat](coords: Sized[N, Double])(implicit ev: OpenSimplex[N]): Double

What constants can't be calculated (i.e. they would have to be included in OpenSimplex)? Is it possible to generalize the algorithm over N?

What is the difference between the GLSL OpenSimplex2S and C# OpenSimplex2S?

I'm trying to understand the difference between the GLSL* and C# versions of the algorithm. I created textures from both of them and although they actual values are not identical, the quality of the noise looks identical. Is the GLSL version of the noise supposed to be somehow inferior because it cannot store the perm and permGrad states?

If I wanted identical versions on the CPU and GPU, would I be good to just translate the GLSL version directly to C#?

Also want to say, thanks so much for creating OpenSimplex! It's really awesome stuff. :)

*by the GLSL version I mean bccNoise8Point.glsl specifically.

areagen documentation

Hi @KdotJPG ๐Ÿ™‚ First of, I want to say I really appreciate your efforts, great work on OpenSimplex ๐ŸŽ‰

As I am currently in the process of porting OpenSimplex2 to Dart, I am trying to understand how it works exactly.
I am basing my efforts off of the Java implementation and I am confused by the areagen directory.

Problem

So my struggle is that I want to understand what I can recommend to use.
If I copy your implementation and basically have two different libraries (the regular one and the areagen one) that kind of do the same, it will be very confusing as to which one you should use.

Questions

This makes me wonder about two things:

  • Which one is the implementation that I should port?
  • What exactly are the drawbacks and benefits, the differences between the two implementations?

Docs

The README mentions:

The classes in java/areagen offer speed-optimized whole-area generators, which operate by flood-fill queue on the noise lattice. (i.e. they don't use a "range")

I do not understand the second part of that statement (what are "whole-area generators" and the "flood-fill queue"?)
Flood fill says something to me, but then what does this mean for the end user?

The only differences between the two versions' area generators are: radius parameter and normalization constant.

The radius can be straightforwardly reduced for faster noise, or increased for smoother noise. There are no geometric traversal steps to cause discontinuities, and no hardcoded point computations to limit performance increases, as would be the case with varying the radius in the evaluators.
The normalization constant is baked into the same gradient set as the evaluator. It can be recomputed using Noise Normalizer. If left as is, the noise will still function correctly, it will just have a different output range.

This whole section I am really not sure about. I checked the classes and usage looked the same to me, so I am very confused about what this is trying to say.


I will go with the non-areagen library for now (which might be slower?) as I do not have answers to these questions. It would be super awesome if you could shed some light on these questions ๐Ÿ™

Implementation issues

Hello, and thank you for all your work. I am in the process of porting these various algorithms to Common Lisp. So far I ported 2F 2D, and I'm currently wondering if my 2F 3D implementation is correct. It seems to look too regular compared to your examples, though they do share some similarities. This is difficult to debug, as I'm not seeing any graphical artifacts or anything. I am not sure if what I have looks correct or not after staring at it for so long. Below is a 2D slice of 2F 3D XY/Z, though results look pretty similar to Classic. For completion, I also provided an animated gif, moving through the third axis. My goal is to finish a correct implementation in Common Lisp, so that I can submit a PR to your repository. Thank you for your help.

Edit: My version seems to be very sparse compared to yours, with features packed much more closer together in yours.

GIF Animation

No 1D functions

Hi @KdotJPG, I'm using the _old version of the C# one (but I haven't seen it in any others as well) and was looking for 1D generators.
Can it be made from using the 2D generator along one axis, or is there a proper way to do it?
Also, the reason I'm using the _old one is because it seems more optimised by caching more, is this accurate?
Thanks!

Please add C bindings for the rust version of the library

Looking at the rust code, it seems that the interface can be trivially used from C if exported correctly. I have previously ported the C# version to a language I use, but it was the old version and it would probably be a lot of work to update it after a couple years. Enabling C FFI from the rust version seems like the easiest way to impact the maximum of languages possible.

Why the use of both float and double in the OpenSimplex2S.java file?

I am porting this file to Swift to use in an art project and was wondering why the use of floats in this version? A lot of functions take double parameters but return a float. Is this just because the the output of the noise is generally mapped to something like an RGB value or angle or height map etc and accuracy there tends not to be that important ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.