Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18

Thread: Rendering realistic satellite view style terrain with OpenGL

  1. #11

    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!

  2. #12

    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?

  3. #13
    Guild Expert johnvanvliet's Avatar
    Join Date
    Jul 2012
    Location
    N 42.39 W 83.44
    Posts
    1,091
    Blog Entries
    4

    Default

    there a few things here
    http://www.ipol.im/

    -- click on the "DEMO" tab on each paper for a online demo

    it is research code and will need hacking for your needs

    Inpainting is what i use some examples
    http://www.ipol.im/pub/art/2013/54/
    http://www.ipol.im/pub/art/2013/40/

    and this works VERY well for high frequency " near noise/ data"
    http://www.ipol.im/pub/art/2011/ggm_rpn/

    this works rather well -- " MOSTLY ???? " for inpainting
    http://www.logarithmic.net/pfh/resynthesizer

    -- builds fine on Linux and on win32 using mingw ( should build on apple )

    i also use " G'Mic"
    http://gmic.eu/

    -- formally "GREYCStoration"


    --- 90 seconds to Midnight ---
    --------

    --- Penguin power!!! ---


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

    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).

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

    Default

    http://kesen.realtimerendering.com (if you've never come across it) has links to papers from most of the major graphics conferences, including links to author's pages. Many of those pages have source code.

    A couple of quick probes using the search term '"wang tiles for image and texture generation" cohen' (the name of one of the early papers on the subject + the name of first author) led to this and other implementations: http://www.robburke.net/mle/wang/

  6. #16

    Default

    I guess my google skills should improve greatly, in any case I bow before yours My original implementation, back in the days, was going to be wang tiles, but despite all my desperate attempts to find a generator, I found none.

  7. #17

    Default

    Quote Originally Posted by waldronate View Post
    Once you have your biomes, sample a googly map of Earth at similar biomes to get a patch of representative texture. Then synthesize larger patches on the fly using a texture synthesis engine. As above, use a fractal to control the hard transition between biome types.
    Hi again

    I'm trying the wang tiles approach, and as you've suggested, I'm trying to sample Google Earth Pro for textures. Surprisingly, Google Earth Pro only saves images in jpg format, moreover the quality of textures in Google Earth itself is quite low when I zoom in to a lavel of 30-40 km above surface.

    Any ideas what other tools I can use to sample textures?

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

    Default

    If you can zoom into your desired altitude (or maybe a little lower) and the textures look good, you should be able to take a screenshot, clip out your areas from that screenshot, and then paste them into the graphics program of your choice. One area to watch out for is the Google watermarks. You shouldn't need huge patches of texture to get things started.

    One other way to get what appears to be higher-resolution data is to appear to synthesize higher-resolution data. Take the lower-resolution data, rescale it so that it appears to be higher-resolution data and then blend that higher-resolution data onto the lower-resolution data (ideally in places that aren't on the screen). You can do this as a static one-time operation or you might be able to do it on the fly by compositing color and shading information separately (separate out the hue and saturation channels in one image, then separate out the value channel to another; use higher-resolution value channels to get the appearance of more detail without huge amounts of color noise).

Page 2 of 2 FirstFirst 12

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
  •