Announcement

Collapse
No announcement yet.

[Plugin] Simplex Noise 1D,2D,3D,4D Fast Perlin Noise Version

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [Plugin] Simplex Noise 1D,2D,3D,4D Fast Perlin Noise Version

    Hi,

    I just released the Simplex Noise Plugin for UnrealeEngine 4 on my GitHub.
    https://github.com/devdad/SimplexNoise

    This is a clean, fast, modern, and free Perlin Simplex noise function.
    All Public Functions are BlueprintCallable so they can be used in every blueprint
    From DevDad and Dedicated to you and Unreal Community! Use it free for whatever you want I only request that you mention me in the credits for your game in the way that feels most appropriate to you.


    Click image for larger version  Name:	SimplexNoise.jpg Views:	1 Size:	873.0 KB ID:	1168878

    *SimplexNoise 1D,2D,3D & 4D *Scaled Version SimplexNoise 1D,2D,3D & 4D *InRange version SimplexNoise 1D,2D,3D & 4D

    *SimplexNoise Function returns float value between 0 - 1
    *SimplexNoise Scaled returns float value between 0 - scale factor
    *SimplexNoise In Range returns float value between minRange - maxRange

    This algorithm was originally designed by Ken Perlin, but my code has been adapted and extended from the implementation written by Stefan Gustavson (stegu@itn.liu.se) and modified to fit Unreal Engine 4

    //This library is public domain software, released by the author
    // into the public domain in February 2011. You may do anything
    // you like with it. You may even remove all attributions

    New update plugin version https://github.com/devdad/SimplexNoi...1.2.0_UE4.25.3 There is a release also. 4 new functions as well as a lot of bug fixes and improvement here and there.

    Added 4 new functions exposed to BP:
    • GetSimlexNoise1D_EX (GetSimpleNoise1D_EX (float x, float lacunarity, float persistance, int octaves, float inFactor, bool ZeroToOne)
    • GetSimpleNoise2D_EX (float x, float y, float lacunarity, float persistance, int octaves, float inFactor, bool ZeroToOne)
    • GetSimpleNoise3D_EX (float x, float y, float z, float lacunarity, float persistance, int octaves, float inFactor, bool ZeroToOne)
    • GetSimpleNoise4D_EX (float x, float y, float z, float w, float lacunarity, float persistance, int octaves, float inFactor, bool ZeroToOne)
    Inputs:
    positions x,y,z,w - depends on which version of the function you are using
    float lacunarity, float persistance, int octaves to define number of noise layers combine together with smaller and smaller details
    float inFactor to scale input value (x,y,z,w) to get smaller or bigger noise frequency
    bool ZeroToOne - if true set output to: 0.0f - 1.0f , otherwise output is:-1.0f - 1.0f
    Last edited by DevDad; 07-30-2020, 01:14 PM.
    *My Free Simplex Noise Plugin For UE4 - Fast version of Perlin Noise Function
    *All Public Functions are BlueprintCallable so they can be used in every blueprint
    *https://github.com/devdad/SimplexNoise

    #2
    Thank you very much. I was hoping somebody would make this

    Comment


      #3
      Is this working for anyone on 4.9?? I cant get any output besides 0.0

      Comment


        #4
        Originally posted by yulaw2k View Post
        Is this working for anyone on 4.9?? I cant get any output besides 0.0
        Yeah it's working on 4.10, though it's a bit odd.. Here's how I find the best way to use it:

        Simplex Noise 1D
        Input: X
        Output: Return Value

        (None of the others work properly anyway, so just use Simplex Noise 1D)

        - For the input, it expects an increasing number, so you can just make a float called Timer, and add delta seconds to it on the event tick. Plug this timer variable into the input X.
        - The output seems to give between -0.4 and 0.4, so it's kind of odd, not precise but you can multiply it by a larger number to get a nice random effect.
        - To have multiple different random values, just add a number to your timer. So Timer + 50 plugged into the input X. This will grab from the perlin noise 50 seconds ahead, so it'll be different from the regular Timer.

        Thanks DevDad, although it's not working as you intended (at least in 4.10) with some workarounds it still does the job beautifully!

        Comment


          #5
          Thanks you for that @DevDad !
          Hevedy - Instance Tools: https://hevedy.itch.io/hevedyinstances
          Hevedy - Image Tools: https://hevedy.itch.io/imagetools

          Comment


            #6
            Hi, I greatly appreciate the work here - but one question that seems to be painfully annoying to find an answer to - How does one build and install 3rd party plugins?

            For a high-end engine Unreal sure seems to lack a lot of information on basics and I've been banging my head on trying to build your plugin for the past hour.

            Comment


              #7
              can you upload a sample project? i try to make somthing with your plugin but get only crazy values out of this.
              what the values spezificly mean? i have think they give something like this out:
              Click image for larger version

Name:	Yubrs.png
Views:	1
Size:	86.8 KB
ID:	1099611

              Comment


                #8
                The values that come out the functions are noise value, by default between -1 and 1, for a given set of inputs.

                Noa3,
                You could get your desired sample back out by combining the results several times over in octaves. Where every octave uses a successively doubled set of inputs and successively halved outputs. See my example code below:
                Code:
                TArray<float> currentHeightMap;
                currentHeightMap.SetNumZeroed(myGrid->numNodes);
                for (int32 nodeIndex = 0; nodeIndex < myGrid->numNodes;++nodeIndex)
                {
                	FVector nodeLocation = myGrid->getNodeLocationOnSphere(myGrid->gridLocationsM[nodeIndex]);
                	float magReduction = 1;
                	for (int32 octave = 0; octave < numOctaves;++octave)
                	{
                		currentHeightMap[nodeIndex] += USimplexNoiseBPLibrary::SimplexNoise3D(nodeLocation.X, nodeLocation.Y, nodeLocation.Z)/magReduction;
                		nodeLocation *= 2;
                		magReduction *= 2;
                	}
                }
                Note that I'm using it for 3d locations on a sphere, but the same idea would apply for any 2D or 3D location. Here's a very rough height map I'm getting a sphere using this (note that I'm not blending between colors for the heights here just giving my self a rough idea of what I'm getting):
                Click image for larger version

Name:	SampleBaseHeightMap.png
Views:	1
Size:	352.5 KB
ID:	1100466

                Comment


                  #9
                  Originally posted by ZenonSeth View Post
                  Hi, I greatly appreciate the work here - but one question that seems to be painfully annoying to find an answer to - How does one build and install 3rd party plugins?

                  For a high-end engine Unreal sure seems to lack a lot of information on basics and I've been banging my head on trying to build your plugin for the past hour.
                  Were you ever able to get this working? This is exactly the sort of plugin I've been looking for, but I'm having no luck getting it to install.

                  Comment


                    #10
                    I'm keen on this one too. I can build the plugin for you and upload it somewhere - typically a plugin dev needs to do a binary release or most people can't use it. The documentation to do this is readily available but it's not at all easy to do the first few times.

                    Comment


                      #11
                      Isn't 3D simplex noise Patented by Nokia currently?


                      Consider supporting me on patreon

                      My Open source tools and plugins
                      Advanced Sessions Plugin
                      VR Expansion Plugin

                      Comment


                        #12
                        Hey guys it was busy month for me . It is great to see a lot of interest for this plugin. All functions are working well and I'll upload example project soon so you guys can learn easier how to use plugin. It is simple once you understand how it works. I'll upload also binaries so you can start to use straight away

                        @mordentral

                        Not really , Perlin Noise is patented
                        http://www.google.com/patents/US6867776

                        Cheers !
                        *My Free Simplex Noise Plugin For UE4 - Fast version of Perlin Noise Function
                        *All Public Functions are BlueprintCallable so they can be used in every blueprint
                        *https://github.com/devdad/SimplexNoise

                        Comment


                          #13
                          Originally posted by DevDad View Post
                          Hey guys it was busy month for me . It is great to see a lot of interest for this plugin. All functions are working well and I'll upload example project soon so you guys can learn easier how to use plugin. It is simple once you understand how it works. I'll upload also binaries so you can start to use straight away

                          @mordentral

                          Not really , Perlin Noise is patented
                          http://www.google.com/patents/US6867776

                          Cheers !
                          See now that Patent is terribly titled, I understand that it says "Standard for perlin noise" but the actual patent applies to an "improved implementation of perlin noise using a simplicial grid". It has been my understanding that the only reason Perlin is still even relevant anymore is because of the patent over Simplex noise being a potential issue, honestly I would love to use Simplex myself but I don't think it is legal to do so with UE4.

                          The patent describes Simplex Noise but doesn't name it as such. I hate to be the possible bearer of bad news man but I don't want you wasting your time if it is going to be an issue.

                          There was even an alternative algorithm made just to avoid the patent issue with Simplex (sadly not as fast): https://en.wikipedia.org/wiki/OpenSimplex_noise


                          See just some of the quotes from the patent:

                          BACKGROUND OF THE INVENTION
                          Perlin Noise has been a mainstay of computer graphics since 1985, being the core procedure that enables procedural shaders to produce natural appearing materials. Now that real-time graphics hardware has reached the point where memory bandwidth is more of a bottleneck than is raw processing power, it is imperative that the lessons learned from procedural shading be adapted properly to real-time hardware platforms.
                          Specifically, when these implementations of Perlin Noise are applied to a rotated domain, a casual viewer of the result can easily pick out the orientation of the rotated coordinate grid. Ideally, it should be impossible for a casual viewer to infer the orientation of the rotated coordinate system, when presented with the texture image produced by Perlin Noise applied to a rotated domain.
                          . A method for generating images comprising the steps of:
                          producing the images with texture that do not have visible grid artifacts with the computer by decomposing a hypercube into n! simplices, where each simplex corresponds to
                          In this way, a gradient vector is defined using only a small number of bit operations and two additions. In particular, the computation of gradient requires no multiply operations. This contrasts with previous implementations of Perlin Noise, in which three multiply operations were required for each gradient computation (one multiply in each of the three component dimensions).

                          The New Reconstruction Primitive

                          Simplex Grid

                          Rather than placing each input point into a cubic grid, based on the interger parts of its (x,y,z) coordinate values, the input point is placed onto a simplicial grid as follows:


                          Consider supporting me on patreon

                          My Open source tools and plugins
                          Advanced Sessions Plugin
                          VR Expansion Plugin

                          Comment


                            #14
                            Well,it's to hard to understand how it's work.(as for me)
                            Maybe you can make a tutorial how to work with this?
                            And why you're using a branch on the ss?

                            Just need a tutorial...please....

                            Comment


                              #15
                              Thank you man - it's really useful!

                              Comment

                              Working...
                              X