1. RE: Perlin Noise - Early demo release was ( - Texture Generator)
- Posted by rforno at tutopia.com Nov 24, 2002
- 457 views
Thanks. The problem with your approach, at least for me, is that it is too slow and requires a lot of code. I'd like to attain the same results, but at least two orders of magnitude faster. Any chance? ----- Original Message ----- From: <dm31 at uow.edu.au> Subject: Re: Perlin Noise - Early demo release was ( - Texture Generator) |The wave shape shown in your .bmp does not seem to correspond to noise, but |rather to a definite pitch sound. The thing you must understand about Perlin noise, is that it's aim is to create more natural looking noise. All data in the Perlin functions are derived from the rand() func in Eu. It uses Interpolate and smoothing over several layers. Each layer is given a frequency and a amplitude. The frequency tells the function how often to place the "real" random data, and it interpolates between to fill the gaps. |If at all possible, please post it to the forum or send me it by mail. I'll need a stamped, self addressed.... :P I think I'll post on the forum instead of mailing :P Anyways, a very early version has been attached. You will need Exotica1_7.dll to use this lib as it is atm. If anyone doesn't have it, I can email it to them. It shouldn't be to hard to change the psound.ew and psound.exw to not uses ExoticaX, but PTexture would be a little be harder. |Attached you will find two text files describing the .wav format. I |downloaded them, I think, from www.wotsit.com, or somewhere similar. |You will also find a .ex file. This is part of an unfinished project I'm |working in at this very moment. Thank you very much. I have glossed over it and believe it will help me greatly. I'm working over the routines at the moment to provide data that can be used for wav files. Please excuse the lack of docu's at the moment. There are many advanced features that have not been implemented in this version so far, so stay tuned from so very nifty features. ;) Cheers, Dan McG ==^^=============================================================== This email was sent to: rforno at tutopia.com
2. RE: Perlin Noise - Early demo release was ( - Texture Generator)
- Posted by dm31 at uow.edu.au Nov 24, 2002
- 456 views
|The problem with your approach, at least for me, is that it is too slow and |requires a lot of code. I'd like to attain the same results, but at least |two orders of magnitude faster. Any chance? One, it is already around 6 times faster then it was. :S Two, in pure Eu, it will be hard getting it too much faster. Of course I always try optimising code thou. Too much code? *me* looks at latest version here.... uh oh. Its already double since that release, and once 3D(Volumetric/animated 2D) and 4D(animated 3D) is done, it will be over double again... OK, here is what can be done. First, if you where using PTexture.ew, the blitfast/surface_flip bits of code can be deleted and bitmap_(un)lock moved to outside the for loops. (Its like it is atm for testing purposes). One thing I was going to do, is see if the random generator code I had in C would be faster then the rand function if I wrote a dll to use it. Has anyone got a random number generator in Eu/C/ASM that IS faster then rand()? Now, I was going to try to keep this code pure Eu, HOWEVER, once I get a stable version going, I might start writing some ASM to speed it up in a alternative version. Eu is just not suited to fast, intensive work. So, it is PSound.ew not PTexture that you will be using right? If I can get some details I'll see if I can speed it up by making a specific version that only meets THOSE requirements. Output Range: -32567 <=> 32567 ? Dimensions: 1 (2? If you require a slightly different 2 channel 4 stero) Anyothers that I should know? (I take it that it is producing appropriate data atm) Cheers, Dan McG
3. RE: Perlin Noise - Early demo release was ( - Texture Generator)
- Posted by rforno at tutopia.com Nov 25, 2002
- 418 views
Thanks. It will suffice being 1 channel. The range may be -32767 to 32767 *or* greater, if this eases things. Anyway, I'd be grateful in case you explain the basics of Perlin noise generation, for me to try. ----- Original Message ----- From: <dm31 at uow.edu.au> Subject: RE: Perlin Noise - Early demo release was ( - Texture Generator) |The problem with your approach, at least for me, is that it is too slow and |requires a lot of code. I'd like to attain the same results, but at least |two orders of magnitude faster. Any chance? One, it is already around 6 times faster then it was. :S Two, in pure Eu, it will be hard getting it too much faster. Of course I always try optimising code thou. Too much code? *me* looks at latest version here.... uh oh. Its already double since that release, and once 3D(Volumetric/animated 2D) and 4D(animated 3D) is done, it will be over double again... OK, here is what can be done. First, if you where using PTexture.ew, the blitfast/surface_flip bits of code can be deleted and bitmap_(un)lock moved to outside the for loops. (Its like it is atm for testing purposes). One thing I was going to do, is see if the random generator code I had in C would be faster then the rand function if I wrote a dll to use it. Has anyone got a random number generator in Eu/C/ASM that IS faster then rand()? Now, I was going to try to keep this code pure Eu, HOWEVER, once I get a stable version going, I might start writing some ASM to speed it up in a alternative version. Eu is just not suited to fast, intensive work. So, it is PSound.ew not PTexture that you will be using right? If I can get some details I'll see if I can speed it up by making a specific version that only meets THOSE requirements. Output Range: -32567 <=> 32567 ? Dimensions: 1 (2? If you require a slightly different 2 channel 4 stero) Anyothers that I should know? (I take it that it is producing appropriate data atm) Cheers, Dan McG ==^^=============================================================== This email was sent to: rforno at tutopia.com
4. RE: Perlin Noise - Early demo release was ( - Texture Generator)
- Posted by dm31 at uow.edu.au Nov 27, 2002
- 481 views
|Thanks. |It will suffice being 1 channel. |The range may be -32767 to 32767 *or* greater, if this eases things. |Anyway, I'd be grateful in case you explain the basics of Perlin |noise generation, for me to try. Many people have used random number generators in their programs to create unpredictability, make the motion and behavior of objects appear more natural, or generate textures. Random number generators certainly have their uses, but at times their output can be too harsh to appear natural. Perlin Noise has a very wide range of uses, more than I can think of, but basically anywhere where you need something to look natural in origin. What's more it's output can easily be tailored to suit your needs. If you look at many things in nature, you will notice that they are fractal. They have various levels of detail. A common example is the outline of a mountain range. It contains large variations in height (the mountains), medium variations (hills), small variations (boulders), tiny variations (stones)... you could go on. The Perlin Noise function recreates this by simply adding up noisy functions at a range of different scales. The two most important functions needed, are the Noise function, and the Interpolate function. The Noise function will create the random data to be used, and the Interpolate funcion smoothly interpolates between the values. I'm going to assume that you understand the terms Frequency & Amplitude. The key to Perlin Noise is to create several layers of Noise, at different Frequency and Amplitudes. The most common way to go is to half the amplitude and double the frequency. Of course you could do whatever you want, depended on you desired effect(atm, you can select any frequencies for the layers, and selectable Amps will be coded soon) Once you have made the layers of Noise at different Freqs and Amps, you can simply add them together, and volia. With simple modifications, you can do this in 1D(limited uses. Sound, Sketchy Interfaces, etc), 2D(Moving 1D, Textures, creating 3d Terrain), 3D(Moving 2D, Volumetric Textures(VERY good stuff :), etc) and 4D(Moving 3D) The three types of Interpolate functions you would most likely use are Linear(fastest, blocky looking), Cosine(Good Detail, good speed) and Cubic(slowest, but the smoothest, more complex to implement). Aside from creating the Noise and Interpolating it, another function that you would most likey want to implement is a smoothing algorithm. If you have ever written a Image smoothing filter, or a Fire Algo, you should be familiar with the process. Hopefully I explained enough for you to figure out Perlin Noise. Cheers, Dan McG
5. RE: Perlin Noise - Early demo release was ( - Texture Generator)
- Posted by rforno at tutopia.com Dec 01, 2002
- 482 views
I am trying to program it the way you told me. In the meantime, I've found a fast, easy algorithm to something similar. I'd like that you test it in order to see if the results are somewhat similar. The idea is old and very simple. It is called "exponential smoothing" and works as follows, assuming it is applied to sound (it seems not too difficult to extend it to images): Let us call x[t] (t = 1, 2, 3,... n) the samples generated at, for example, 44100 each second. Let us say that z is a randomly generated number between -32768 and 32767 ( z = rand(65536) - 32769). Then: x[t+1] = z * alpha + x[t] * (1.0 - alpha) where alpha is a coefficient between 0 and 1. The output consists in the integer part of x[t] for successive t's. The generated sound has a main frequency that decreases with alpha. It reminds me the "space" noise in the film 2001. Regards. ----- Original Message ----- From: <dm31 at uow.edu.au> To: EUforum <EUforum at topica.com> Sent: Tuesday, November 26, 2002 9:04 PM Subject: RE: Perlin Noise - Early demo release was ( - Texture Generator) |Thanks. |It will suffice being 1 channel. |The range may be -32767 to 32767 *or* greater, if this eases things. |Anyway, I'd be grateful in case you explain the basics of Perlin |noise generation, for me to try. Many people have used random number generators in their programs to create unpredictability, make the motion and behavior of objects appear more natural, or generate textures. Random number generators certainly have their uses, but at times their output can be too harsh to appear natural. Perlin Noise has a very wide range of uses, more than I can think of, but basically anywhere where you need something to look natural in origin. What's more it's output can easily be tailored to suit your needs. If you look at many things in nature, you will notice that they are fractal. They have various levels of detail. A common example is the outline of a mountain range. It contains large variations in height (the mountains), medium variations (hills), small variations (boulders), tiny variations (stones)... you could go on. The Perlin Noise function recreates this by simply adding up noisy functions at a range of different scales. The two most important functions needed, are the Noise function, and the Interpolate function. The Noise function will create the random data to be used, and the Interpolate funcion smoothly interpolates between the values. I'm going to assume that you understand the terms Frequency & Amplitude. The key to Perlin Noise is to create several layers of Noise, at different Frequency and Amplitudes. The most common way to go is to half the amplitude and double the frequency. Of course you could do whatever you want, depended on you desired effect(atm, you can select any frequencies for the layers, and selectable Amps will be coded soon) Once you have made the layers of Noise at different Freqs and Amps, you can simply add them together, and volia. With simple modifications, you can do this in 1D(limited uses. Sound, Sketchy Interfaces, etc), 2D(Moving 1D, Textures, creating 3d Terrain), 3D(Moving 2D, Volumetric Textures(VERY good stuff :), etc) and 4D(Moving 3D) The three types of Interpolate functions you would most likely use are Linear(fastest, blocky looking), Cosine(Good Detail, good speed) and Cubic(slowest, but the smoothest, more complex to implement). Aside from creating the Noise and Interpolating it, another function that you would most likey want to implement is a smoothing algorithm. If you have ever written a Image smoothing filter, or a Fire Algo, you should be familiar with the process. Hopefully I explained enough for you to figure out Perlin Noise. Cheers, Dan McG ==^^=============================================================== This email was sent to: rforno at tutopia.com