   Perlin noise equations for terrain rendering
  Well, I've already posted a few threads trying to understand procedural planet generation.Thus far, I have been able to generate a geosphere from a octahedron and subdivide it many times (LoD to come later), and have implemented a map class which takes the exact 3D point to apply some sin's and cos's to the three points to mimic 3DPerlin noise.The phase was a success . . . sort of.The sphere properly deformed correctly; however, the terrain looked nothing, well, terrain-like.What I need help with now is figuring out a good 3DPerlin noise equation that will work for me.  In particular, any sites that have examples and what not.  There are a lot of treads on here that ask similar questions and have good responses, except they are so old that they resulting website is no longer around.Any help would be appreciated.   
  This was the site that really clicked perlin noise algorithm for me:http://www.angelcode.com/dev/perlin/perlin.aspIt doesn't mention anything about terrain, but you should be able to adapt something like that for your usage if you find good scaling numbers for the different octaves.Also I'm assuming that you really want 2D perlin noise and not 3D noise. 3d noise would be for like something that varies with time. A terrain is just going to be a surface, with a height value at each point.   ;Quote:Original post by karwostsThis was the site that really clicked perlin noise algorithm for me:http://www.angelcode.com/dev/perlin/perlin.aspIt doesn't mention anything about terrain, but you should be able to adapt something like that for your usage if you find good scaling numbers for the different octaves.Also I'm assuming that you really want 2D perlin noise and not 3D noise. 3d noise would be for like something that varies with time. A terrain is just going to be a surface, with a height value at each point.Well, the reason I was going with 3D Perlin noise was to easily create a terrain without having to worry about lining up edges.Some people had recommended cube mapping, but my real worry was about the top and bottom images not fitting with the other sides.  When I read about 3D Perlin noise that creates a value based upon three points instead of two, I thought it was perfect.  From my current experiment, the terrain rolled smoothly, but, as I said, it doesn't look too right.Note: the geosphere I generate is generated with the radius as 1, thereby the coordinates never go above 1.edit:  I'm looking at the site, it may prove to be a little helpful, but it may not be what I need most.   ;  Can you post a screen shot to show "what does not look right" ?Also how many octaves etc. are you using for the noise ?With anything procedural...there are lots of tweaks to things like octaves, gain, frequency, lacunarity and so on until something "looks right" comes out.I've been using Ridged Multi fractals - here's a snippet of shader code...hope this helps.float ridge(float h, float offset)  { h = abs(h); h = offset - h; h = h * h; return h;  }   float ridgedmf(float3 p, int octaves, float lacunarity, float gain = 0.05, float offset = 1.0)  { float sum = 0.0f; float freq = 1.0f; float amp = 0.5f; float prev = 1.0f; for ( int i = 0; i < octaves; i ++ ) {float n  = ridge( inoise( p * freq ), offset );sum += n * amp *prev;prev  = n;freq *= lacunarity;amp *= gain; } return sum;  };  This code generates a height given a coordinate :static float waves (int i, int j){int symbol = 70;int gap = 4;int phaseVague = 12;int height = 0;return  ((float)(symbol*0.005f* (cos((i*gap*0.1+phaseVague))+ sin((j*gap*0.1+phaseVague))))) + height;}Although, I used it to create waves, it could  be modified to generateterrain surface. Just tweak the values. For example, the above code produces thefollowing plane.;libnoise3D noise works great for heightmapping a sphere, and all of the modules in libnoise are 3D versions. Interpolate the (x,y,z) coordinates of the generated vertices to calculate the (x,y,z) at any given point on the sphere, and pass that as input to your noise module tree.   ;Quote:Original post by JTippettslibnoise3D noise works great for heightmapping a sphere, and all of the modules in libnoise are 3D versions. Interpolate the (x,y,z) coordinates of the generated vertices to calculate the (x,y,z) at any given point on the sphere, and pass that as input to your noise module tree.Thank you, the source will be very useful.I was really hoping to build the noise function myself, as this will become one of my portfolio programs; however, it looks like Perlin noise (especially in 3D) may be too broad a subject for me to attempt as a simple portfolio project.As to the ones asking for a screenshot of what the wrongly deformed one looks like, I'll post it as soon as I get a chance.  I'm on my recreational computer right now, but have all of my 3D programming on my school laptop.edit:  My big concern is getting an equation that doesn't hurt the processors power too much, as I will constantly by collapsing and splitting trees on the geosphere for LoD, later on when I implement it.  This ultimately means that anytime the camera changes to a point where new polygons need to be made, the noise function will get called for the new points.edit2:  Wow, I'm liking the tut8 on the website.  I might actually use this, cause I realy want to wow my professor and classmates in July when I start my engine design class after this long class break (small classes suck when enough people fail a prerequisite class making it impossible to not only graduate on time but ensure that, if in senior year, you have to waste money on blow off classes just to maintain part-time).   ;  Generate all geometry and height maps on the GPU via shaders...it's *much* faster than doing on the CPU.   ;Quote:Original post by GregMichaelGenerate all geometry and height maps on the GPU via shaders...it's *much* faster than doing on the CPU.I've thought about that; however, the book I've read recommends that the information about terrains should be kept CPU side instead of GPU, so that the information can be read for collision detection.  Also, as I'm aware of, shaders do not actually create faces or extra points, rather, it just modifies them.  Ultimately, I want to demonstrate a program that has planetary LoD control that allows high detail at close distances, even though it will be very cheap as a quickly put together program.Now, unless there's something new with DX10 or DX12 (the book is "Introduction to 3D Game Programming with DirectX 9.0c: A shader approach," which, ironically, doesn't do a very good job explaining shaders.)  I have decided, though, that the actual coloring will be done GPU side.  as you mentioned, it would be faster, much faster.   ;  I'm using DX9 and shader model 3I can generate a planet with CPU generated UV coordinates that specify geometry as well as height map and normals as well. I agree with needing the resulting data for collision etc back on CPU....that's on my todo list :)....getting the data back for CPU usage..hmmmm....You are right that GPU's (DX9) can't create vertices...but given a UV coordinate for a given face of a unit cube, and a planet radius it can do wonders.Add in some 3D noise of your choice...and you have a landscape. Next comes normal creation for lighting...and collision detection (once I've figured out how to efficiently get the data back to CPU).Add in some quad-tree magic to manage the LOD and it all looks promising.Although...others on this site are a few light years ahead of what I've only just got going :)