Results 1 to 10 of 11

Thread: Fractal Continent Generator

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator waldronate's Avatar
    Join Date
    Mar 2007
    Location
    The High Desert
    Posts
    3,561

    Default

    One thing that you might try is to use an ellipse and rectangle rather than circle or square. These shapes give you an additional degree of freedom (aspect ratio), which might well get you more interesting shapes with fewer primitives.

    As far as the shapes themselves, they don't seem statistically different than the output of a slice through a fractional Brownian motion (fBm) surface or a simple wavelet noise surface. I suppose that's not surprising because the basic process is the same (add progressively smaller details to a basic shape).

    If I understand correctly, you're generating an abstract shape tree and then rasterizing it, which would mean that performance would break down the generation phase and the rendering phase. Are you limited on the placement end or on the rendering end?

  2. #2

    Default

    Quote Originally Posted by adampjr View Post
    wow. I really like the last output there. Are you going to make the program available when you finish?
    Yes? I'd make both the source and the program avaliable. I'd want to do a quick UI on top of it (right now it's just a single command in the terminal), but I'd like to release.

    Quote Originally Posted by waldronate View Post
    One thing that you might try is to use an ellipse and rectangle rather than circle or square. These shapes give you an additional degree of freedom (aspect ratio), which might well get you more interesting shapes with fewer primitives.
    Yeah, I think I'll probably do that. My other option was to read in vector shapes and use those, so I could theoretically have a "C" shape or something, but it might be that ellipses and rectangles are enough. Oh, and of course I'd need to have a random rotation of the ellipse and rectangle.

    Quote Originally Posted by waldronate View Post
    As far as the shapes themselves, they don't seem statistically different than the output of a slice through a fractional Brownian motion (fBm) surface or a simple wavelet noise surface. I suppose that's not surprising because the basic process is the same (add progressively smaller details to a basic shape).
    Ehhhhh.... kind of. I'd love to see some kind of mathematical analysis to see if they were similarish, but I suspect the reason they look similar is because the third one was blurred and then thresholded, which removed most of the noise around the edges. If you go back and look at the first two I posted (the unblurred and thresholded ones) you'll see the noise I'm talking about, which doesn't seem like either of those you mentioned.

    Now, are these existing methods better? Very good question...

    Quote Originally Posted by waldronate View Post
    If I understand correctly, you're generating an abstract shape tree and then rasterizing it, which would mean that performance would break down the generation phase and the rendering phase. Are you limited on the placement end or on the rendering end?
    Ah, that was my first approach, yes; that approach quickly became too slow to be usable. A faster approach is instead to tie the generation in with the rendering: this means I don't have to save that massive tree, and am instead only looking at a part of it at a time.

    i.e.:
    Code:
    DrawFractal( size, location )
       DrawRandomShape( size, location )
       GenerateRandomChildren()
       ForEach Child
          DrawFractal ( Child.size, Child.location )
    Similar in concept to a depth-first search tree rather than a breadth-first search tree. In terms of memory use, this means I'm only keeping the size and the location on the stack (three doubles), and at each iteration of draw fractal I create a new shape on the heap, draw it, then delete it, so I don't consume as much memory.

  3. #3
    Administrator waldronate's Avatar
    Join Date
    Mar 2007
    Location
    The High Desert
    Posts
    3,561

    Default

    Quote Originally Posted by vither999 View Post
    If you go back and look at the first two I posted (the unblurred and thresholded ones) you'll see the noise I'm talking about, which doesn't seem like either of those you mentioned.
    As an example of an fBm surface with similar characteristics to the ones that you posted, consider the attached image. All that blurring and thresholding should have done is effectively reduce the image resolution, not change the characteristics of the surface.

    Adding different types of shapes at different levels is a good algorithm. It should be possible to allow arbitrary images as the starting point, as long as the initial image meets the basic requirements for the shapes at that scale. I would expect that using a distance field in the areas to be placed and using that distance field as the guide would be a helpful optimization.

    Click image for larger version. 

Name:	Untitled-1.gif 
Views:	844 
Size:	21.3 KB 
ID:	55056

  4. #4

    Default

    Ah, yes, that does have a similar noise pattern on the edges. My mistake; I'm still working on understanding the different noise algorithms I've seen.

    I'm not sure what you mean by blurring not changing the characteristics of the surface. If we were to take two any two different surfaces and blur/smooth them a large amount, wouldn't they end up looking similar to each other? Or am I not thinking about the characteristics of a surface correctly?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •