Results 1 to 10 of 18

Thread: Rendering realistic satellite view style terrain with OpenGL

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

    There are many ways to synthesize larger texture patches from smaller ones. Unsurprisingly, searches for "texture synthesis", especially combined with "SIGGRAPH" will yield good results. The Inigo Quilez page referenced above has a couple of good examples on sampling a tiled texture so that it appears less regular. Image Quilting is a popular image synthesis technique, as is use of Wang Tiles.

    Managing transitions between biomes is, as you have discovered, the tricky part. As I mentioned in the part that you already have covered, a very good way to handle this transition is to synthesize biomes on the fly using temperature and rainfall maps for each biome type. You sample each temperature/rainfall map and add a fractal factor to each one: you now have a set of values that tells you how much each sample belongs to each biome type. The simplest resolution is to threshold that result by picking the single largest value: that's your biome type. You can also pick the largest n values and blend among those biome types. Once the biome type is selected, pick a pixel in your biome exemplar using some function of your world position.

    It really sounds more like you want to do a tile-based render of your terrain and are concerned about getting transitions between your tiles. A quick search for "tile-based game transition" turns up quite a few techniques, many of them based on the idea of preparing special boundaries between tiles of a specific type.

    If you are indeed using hexgonal tiles, you can do texture splats along the boundaries to get varying amounts of repeatable overlap (Hierarchical Poisson might be a good search term for ideas).

    Note that I'm not trying to be vague or difficult here. I'm trying to provide solid search terms and ideas. Without knowing what your underlying code base looks like, there's not a whole lot of specifics that I can provide.

  2. #2

    Default

    Quote Originally Posted by waldronate View Post
    There are many ways to synthesize larger texture patches from smaller ones. Unsurprisingly, searches for "texture synthesis", especially combined with "SIGGRAPH" will yield good results. The Inigo Quilez page referenced above has a couple of good examples on sampling a tiled texture so that it appears less regular. Image Quilting is a popular image synthesis technique, as is use of Wang Tiles.

    Managing transitions between biomes is, as you have discovered, the tricky part. As I mentioned in the part that you already have covered, a very good way to handle this transition is to synthesize biomes on the fly using temperature and rainfall maps for each biome type. You sample each temperature/rainfall map and add a fractal factor to each one: you now have a set of values that tells you how much each sample belongs to each biome type. The simplest resolution is to threshold that result by picking the single largest value: that's your biome type. You can also pick the largest n values and blend among those biome types. Once the biome type is selected, pick a pixel in your biome exemplar using some function of your world position.

    It really sounds more like you want to do a tile-based render of your terrain and are concerned about getting transitions between your tiles. A quick search for "tile-based game transition" turns up quite a few techniques, many of them based on the idea of preparing special boundaries between tiles of a specific type.

    If you are indeed using hexgonal tiles, you can do texture splats along the boundaries to get varying amounts of repeatable overlap (Hierarchical Poisson might be a good search term for ideas).

    Note that I'm not trying to be vague or difficult here. I'm trying to provide solid search terms and ideas. Without knowing what your underlying code base looks like, there's not a whole lot of specifics that I can provide.
    Unfortunatelly I'm finding lots of research papers with algorithms for texture synthesis, and no specific guidelines on how to implement those using shader language. Generally speaking it's beyond tricky, since most algorithms require multiple passes on the image and information about neighbouring pixels, which is impossible in shaders.

    In any case, thanks for provided information, at least now I'm on some path forward!

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

    Default

    Quote Originally Posted by denisv View Post
    Unfortunatelly I'm finding lots of research papers with algorithms for texture synthesis, and no specific guidelines on how to implement those using shader language. Generally speaking it's beyond tricky, since most algorithms require multiple passes on the image and information about neighbouring pixels, which is impossible in shaders.

    In any case, thanks for provided information, at least now I'm on some path forward!
    The traditional way to do a lot of things with shaders is to use render-to-texture, and then use that output as the feed into the next stage. You'll need to render multiple passes with different shader programs, but you can get away with quite a few passes because your textures may not need to be full-screen.

    http://iquilezles.org/www/articles/t...repetition.htm offers suggestions (and shader code) for turning a tiling texture into a semi non-repeating texture (effectively on-the-fly texture synthesis).

  4. #4

    Default

    Quote Originally Posted by waldronate View Post
    There are many ways to synthesize larger texture patches from smaller ones. Unsurprisingly, searches for "texture synthesis", especially combined with "SIGGRAPH" will yield good results. The Inigo Quilez page referenced above has a couple of good examples on sampling a tiled texture so that it appears less regular. Image Quilting is a popular image synthesis technique, as is use of Wang Tiles.

    Managing transitions between biomes is, as you have discovered, the tricky part. As I mentioned in the part that you already have covered, a very good way to handle this transition is to synthesize biomes on the fly using temperature and rainfall maps for each biome type. You sample each temperature/rainfall map and add a fractal factor to each one: you now have a set of values that tells you how much each sample belongs to each biome type. The simplest resolution is to threshold that result by picking the single largest value: that's your biome type. You can also pick the largest n values and blend among those biome types. Once the biome type is selected, pick a pixel in your biome exemplar using some function of your world position.

    It really sounds more like you want to do a tile-based render of your terrain and are concerned about getting transitions between your tiles. A quick search for "tile-based game transition" turns up quite a few techniques, many of them based on the idea of preparing special boundaries between tiles of a specific type.

    If you are indeed using hexgonal tiles, you can do texture splats along the boundaries to get varying amounts of repeatable overlap (Hierarchical Poisson might be a good search term for ideas).

    Note that I'm not trying to be vague or difficult here. I'm trying to provide solid search terms and ideas. Without knowing what your underlying code base looks like, there's not a whole lot of specifics that I can provide.
    BTW, I was looking into Wang Tiles a while ago, but I wasn't able to find any tool or algorithm for that matter that would take a reference texture and generate a set of wang tiles from it. Any chance you ever came across such thing?

Tags for this Thread

Posting Permissions

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